示例#1
0
function showSummary($query)
{
    global $db_conn;
    print '<table align="center" border="1">';
    // print table column headers
    $tableHeaders = array("id", "Name", "Phone #", "Email", "Points", "Details");
    writeTableHeader($tableHeaders);
    // retrieve all data from the database to be displayed
    $result = $db_conn->query($query);
    if ($result == true) {
        $result->data_seek(0);
        while ($row = $result->fetch_assoc()) {
            $id = $row[tcCustomer::$custIdStr];
            $fname = $row[tcCustomer::$fnameStr];
            $lname = $row[tcCustomer::$lnameStr];
            $phone = $row[tcCustomer::$phoneStr];
            $email = $row[tcCustomer::$emailStr];
            $totalPtrs = tcVisits::getTotalPointsById($db_conn, $id);
            writeTRBegin();
            writeTD('<a href="' . 'editcustomer.php?custId=' . $id . '">' . $id . '</a>');
            writeTDArray(array("{$fname} {$lname}", $phone, $email));
            writeTD($totalPtrs, "right");
            writeTD('<a href="' . 'showdetails.php?custId=' . $id . '">Details</a>');
            writeTREnd();
        }
        $result->free();
    } else {
        exit("Unable to access the database.");
    }
    print "</table>";
}
示例#2
0
 public function showDetailTable()
 {
     print '<table align="center" border="1">';
     // write the table header information
     writeTableHeader(array("Name", "Phone", "Email", "Date", "Points"));
     // write the table row to the web page
     writeTRBegin();
     writeTDArray(array("{$this->fname}  {$this->lname}", $this->phone, $this->email));
     print '<td colspan=2></td>';
     writeTREnd();
     $visits = new tcVisits($this->custId, $this->db_conn);
     $visits->initVisits();
     $numVisits = count($visits->visits);
     // NOTE: rowspan number has to plus 2 for unknown reason
     print '<td colspan=3 rowspan=' . ($numVisits + 2) . '></td>';
     for ($i = 0; $i < $numVisits; ++$i) {
         writeTRBegin();
         writeTD($visits->visits[$i]->dtime);
         writeTD($visits->visits[$i]->point, "right");
         writeTREnd();
     }
     $totalPtrs = tcVisits::getTotalPointsById($this->db_conn, $this->custId);
     writeTRBegin();
     writeTD("Balance:");
     writeTD($totalPtrs, "right");
     writeTREnd();
     print '</table>';
 }
$iCell = 0;
$inMonth = false;
foreach ($days as $index => $value) {
    if ($iCell % 7 == 0 && $iCell != 0) {
        $iRow++;
        ?>
</tr>
		<!-- Row <?php 
        echo $iRow;
        ?>
-->
		<tr><?php 
    }
    $vday = $value['day'];
    $vtype = $value['type'];
    echo writeTD($vday, $vtype, $events);
    $iCell++;
}
?>
		</tr>
	</tbody>
</table> 
<!-- Events -->
<ul class="events">
</ul>
<!-- Bottom toolbar -->
<ul class="bottom-bar">
	<li class="bottom-bar-today"></li>
	<li class="bottom-bar-list" onclick="alert('list');"></li>
	<li class="bottom-bar-day" onclick="alert('day');"></li>
	<li class="bottom-bar-month" onclick="alert('month');"></li>