예제 #1
0
				color: #CC0000;
			}
		</style>
	<?php 
$sql = "\r\n\t\tselect * from timetable \r\n\t\twhere compid = " . $_COOKIE['CompanyId'] . " \r\n\t\torder by timeid desc\r\n\t\t";
$rs = $conn->Execute($sql);
/*
$stmt = $dbh->prepare('select * from timetable where compid='.$_COOKIE['CompanyId'].' order by timeid desc');
$stmt->execute();
*/
print '<center>';
print '<table id="timelist" border=1 bordercolor="#DDDDDD" style="border-collapse: collapse;">';
$rowArray = array(0 => "Start Time", 1 => "Stop Time", 2 => "Duration", 3 => "Comment");
printTableRow($rowArray, "labels");
while (!$rs->EOF) {
    $rowArray = array(0 => formatDateForTimeclock($rs->fields['start']), 1 => formatDateForTimeclock($rs->fields['stop']), 2 => getDurationClockedIn($rs->fields['start'], $rs->fields['stop']), 3 => $rs->fields['comment']);
    printTableRow($rowArray);
    $rs->MoveNext();
}
/*
while ($row = $stmt->fetch()) {
	$rowArray = array (
		0 => formatDateForTimeclock($row['start']),
		1 => formatDateForTimeclock($row['stop']),
		2 => getDurationClockedIn($row['start'], $row['stop']),
		3 => $row['comment'],
	);
	printTableRow($rowArray);
}
*/
print '</table>';
예제 #2
0
}
*/
## PDF SETTINGS
$col1 = 35;
$col2 = 35;
$col3 = 20;
$col4 = 90;
$pdf = new PDF('P', 'mm', 'A4');
$pdf->AliasNbPages();
$pdf->AddPage();
## RERUN SQL FOR PDF
$rs = $conn->Execute($sql);
/*
$stmt->execute();
*/
while (!$rs->EOF) {
    //while ($row = $stmt->fetch()) {
    #$TotalHours = $TotalHours + getDurationClockedIn($row['start'], $row['stop']);
    $pdf->SetFont('Times', '', 9);
    $pdf->Cell($col1, 4, formatDateForTimeclock($rs->fields['start']), 0, 0);
    $pdf->Cell($col2, 4, formatDateForTimeclock($rs->fields['stop']), 0, 0);
    $pdf->Cell($col3, 4, getDurationClockedIn($rs->fields['start'], $rs->fields['stop']), 0, 0);
    #$pdf->MultiCell(100, 0, formatDateForTimeclock($row['stop']), 0);
    #$pdf->Cell($col4,0,$row['comment'],0,1);
    $pdf->MultiCell(0, 4, stripPDFComment($rs->fields['comment']), 0);
    $pdf->Ln(5);
    $rs->MoveNext();
}
## DO PDF
$pdf->Output();
include_once 'adodb_disconnect.php';