I have a question. I am using table.inc to output the results of my data from a mysql table. (See blow)
<?php
// Include Table
include_once("table.inc");
include_once("csv_table.inc");
// make a Table instance
$t = new Table;
// We want table headings to be printed.
$t->heading = "on";
// Create a database object
$db = new UG_DB;
if($Extract == "Timesheet") {
printf("<P>");
printf($Extract);
printf(" Results for weeks ");
printf($selFromWeek);
printf(" to ");
printf($selToWeek);
printf("</P>");
$db->query("select a.job_id Job_Id, a.emp_id Employee, b.last_name Last_Name, a.week_end_date Week_End_Date, sum(a.day1)+sum(a.day2)+sum(a.day3)+sum(a.day4)+sum(a.day5)+sum(a.day6)+sum(a.day7) Total_Hrs from time_sheet_details a, employee b where week_end_date between '$selFromWeek' and '$selToWeek' and a.emp_id = b.emp_id group by a.job_id, a.emp_id, b.last_name, a.week_end_date order by a.job_id, a.emp_id, b.last_name, a.week_end_date ");
$rows = 0;
$rows = $t->show_result($db, "data");
}
else if($Extract == "Expense"){
printf("<P>");
printf($Extract);
printf(" Results for weeks ");
printf($selFromWeek);
printf(" to ");
printf($selToWeek);
printf("</P>");
$db->query("select a.emp_id Employee, b.last_name Last_Name, a.job_id Job_Id, a.exp_date Expense_Date, a.exp_id Exp_Id, a.exp_desc Exp_Desc, a.amount Amount, a.gst_amount GST_Amount, a.tot_amount TOT_Amount from expense_details a, employee b where a.week_end_date between '$selFromWeek' and '$selToWeek' and a.emp_id = b.emp_id and a.job_id <> '' order by a.emp_id, b.last_name, a.week_end_date");
$rows = 0;
$rows = $t->show_result($db, "data");
}
//Run export script
echo "<p><input type=button Name=csv_exp Value=\"Export to CSV\" onClick=\"parent.location='tsextractcsv.php?selFromWeek=$selFromWeek&selToWeek=$selToWeek&Extract=$Extract'\">";
echo "";
?>
<?php page_close(); ?>
Okay, what I want to know is, is there a way of making the text in the table to be left aligned and the data values in the table to right aligned? Or do I have to store all the values I am getting back from the mysql table into an array?
Anyone's advice would be most appreciated!
Thanks