| Server IP : 172.67.201.108 / Your IP : 216.73.216.11 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/nymp/wwwdev/rpt/ |
Upload File : |
<?php include('mod/_mod_security.php'); ?>
<?php
//var_dump($_GET);
//exit;
$sql = "SELECT s.start_stop_date, (CASE s.startstop_type WHEN 1 THEN 'Start' WHEN 2 THEN 'Stop' END ) AS stype, s.spoke_to, l.location_name, l.bldg_nbr, l.street, l.city, l.state, l.zip, s.old_qty, s.new_qty, s.comments ".
"FROM startstop s INNER JOIN locations l ON (s.location_id = l.location_id) ".
"WHERE DATE(s.start_stop_date) >= ".nzdate($_GET['date_start'])." AND DATE(s.start_stop_date) <= ".nzdate($_GET['date_end'])." ".
"ORDER BY l.location_name ";
//echo " === ".$sql." === ";
$result = $db->query($sql) or die('Database Error!');
//$result = mysql_query($sql) or die(mysql_error());
$margin_left = 0.5;
$margin_right = 0.5;
$margin_top = 1.0;
$margin_bottom = 0.75;
$margin_header = 0.5;
$margin_footer = 0.5;
if ($_GET['fmt'] == 'excel') :
echo '<script>';
echo "window.location.href = 'mod/_export_excel.php?sql=".urlencode(sys_encrypt(gzcompress($sql,6), $_SESSION['rand_key']))."';";
echo '</script>';
elseif ($_GET['fmt'] == 'pdf') :
$mpdf=new mPDF('','Letter'.'-L','','',$margin_left * 25.4,$margin_right * 25.4,$margin_top * 25.4,$margin_bottom * 25.4,$margin_header * 25.4,$margin_footer * 25.4, '');
$mpdf->debug = false;
$mpdf->useOnlyCoreFonts = false; // false is default
$mpdf->keep_table_proportions = true;
$mpdf->SetProtection(array('copy','print'));
$mpdf->SetTitle("Master Hotel Database - Report");
$mpdf->SetAuthor("Davler Media Group");
$mpdf->SetHTMLHeader('<table width="100%" style="vertical-align: bottom; font-size: 11pt; color: #000000;"><tr>'.
'<td width="35%" style="text-align: left;">NYMP Start/Stop Report</td>'.
'<td width="65%" style="text-align: right;">Date Range: '.nzdate_display($_GET['date_start']).' - '.nzdate_display($_GET['date_end']).'</td>'.
'</tr></table><br /><br />');
$mpdf->SetHTMLFooter('<table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 8pt; color: #000000; font-weight: bold; font-style: italic;"><tr>'.
'<td width="33%"><span style="font-weight: bold; font-style: italic;">{DATE m/j/Y}</span></td>'.
'<td width="33%" align="center" style="font-weight: bold; font-style: italic;">Page {PAGENO} of {nbpg}</td>'.
'<td width="33%" style="text-align: right; ">Davler Media Group</td>'.
'</tr></table>');
$mpdf->SetDisplayMode('fullpage');
$html = '<html><body style="font-family: Arial; font-size: 11pt; line-height: 12pt; ">';
$html .= '<table width="100%" style="vertical-align: top; text-align:left; font-size: 10pt; color: #000000; font-weight: normal; border-collapse:collapse;">';
$html .= '<thead style="font-weight:bold;"><tr>';
$html .= '<td width="10%" align="center">Start/Stop Date</td>';
$html .= '<td width="6%" align="center">Type</td>';
$html .= '<td width="6%" align="center">Spoke To</td>';
$html .= '<td width="14%" align="center">Location</td>';
$html .= '<td width="4%" align="center">Bldg</td>';
$html .= '<td width="14%" align="center">Street</td>';
$html .= '<td width="12%" align="center">City</td>';
$html .= '<td width="5%" align="center">State</td>';
$html .= '<td width="5%" align="center">Zip</td>';
$html .= '<td width="6%" align="center">Old Qty</td>';
$html .= '<td width="6%" align="center">New Qty</td>';
$html .= '<td width="12%" align="center">Comments</td>';
$html .= '</tr></thead><tbody>';
while($row = $result->fetch(PDO::FETCH_OBJ)) :
$html .= '<tr>';
$html .= '<td>'.nzdate_display($row->start_stop_date).'</td>';
$html .= '<td>'.$row->stype.'</td>';
$html .= '<td>'.$row->spoke_to.'</td>';
$html .= '<td>'.$row->location_name.'</td>';
$html .= '<td>'.$row->bldg_nbr.'</td>';
$html .= '<td>'.$row->street.'</td>';
$html .= '<td>'.$row->city.'</td>';
$html .= '<td>'.$row->state.'</td>';
$html .= '<td>'.$row->zip.'</td>';
$html .= '<td align="right">'.$row->old_qty.'</td>';
$html .= '<td align="right">'.$row->new_qty.'</td>';
$html .= '<td>'.$row->comments.'</td>';
$html .= '</tr>';
endwhile;
$html .= '</tbody></table>';
$html .= '</body></html>';
$html = utf8_encode($html);
$mpdf->WriteHTML($html);
$mpdf->Output();
endif;
?>