403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.217.139
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/nymp/wwwdev/rpt/route_sheet.php
<?php include('mod/_mod_security.php'); ?>
<?php
	//var_dump($_GET);
	//exit;
	$sql_route = "SELECT r.*, rg.region_name FROM routes r INNER JOIN regions rg ON (r.region_id = rg.region_id) WHERE route_id = ".nz($_GET['route_id'], '0');
	$result_route = $db->query($sql_route) or die('Database Error!');
	if ($result_route->rowCount() > 0) :
		$row_route = $result_route->fetch(PDO::FETCH_OBJ);
	endif;
	$sql = "SELECT l.location_name, l.bldg_nbr, l.street, l.city, l.zip, l.phone, l.contact_name, l.instructions, dd.qty, l.comments FROM locations l INNER JOIN routes_zip_codes rz ON (l.zip = rz.zip) ".
			"LEFT OUTER JOIN deliveries dd ON (l.location_id = dd.location_id AND dd.create_date = (SELECT MAX(create_date) FROM deliveries WHERE location_id = l.location_id)) ".
			"WHERE rz.route_id = ".nz($_GET['route_id'], '0')." AND l.active = 1 AND l.region_id IN (".get_regions().") ".
			"ORDER BY l.street, l.bldg_nbr";
	//echo " === ".$sql." === ";
	//die();
	$result = $db->query($sql) or die('Database 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 Route Sheet Report</td>'.
							'<td width="65%" style="text-align: right;">Route: '.$row_route->region_name.' - '.$row_route->route_name.'</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="15%" align="center" style="border:1px solid #000000;">Location Name</td>';
		$html .= '<td width="5%" align="center" style="border:1px solid #000000;">Bldg Nbr</td>';
		$html .= '<td width="15%" align="center" style="border:1px solid #000000;">Street</td>';
		$html .= '<td width="10%" align="center" style="border:1px solid #000000;">City</td>';
		$html .= '<td width="5%" align="center" style="border:1px solid #000000;">Zip</td>';
		$html .= '<td width="10%" align="center" style="border:1px solid #000000;">Phone</td>';
		$html .= '<td width="10%" align="center" style="border:1px solid #000000;">Contact Name</td>';
		$html .= '<td width="10%" align="center" style="border:1px solid #000000;">Instructions</td>';
		$html .= '<td width="5%" align="center" style="border:1px solid #000000;">Qty</td>';
		$html .= '<td width="15%" align="center" style="border:1px solid #000000;">Comments</td>';
		$html .= '</tr></thead><tbody>';
		$first_row = true;
		$total_qty = 0;
		while($row = $result->fetch(PDO::FETCH_OBJ)) :
			$html .= '<tr>';
			$html .= '<td style="border:1px solid #000000;">'.$row->location_name.'</td>';
			$html .= '<td style="border:1px solid #000000;">'.$row->bldg_nbr.'</td>';
			$html .= '<td style="border:1px solid #000000;">'.$row->street.'</td>';
			$html .= '<td style="border:1px solid #000000;">'.$row->city.'</td>';
			$html .= '<td style="border:1px solid #000000;">'.$row->zip.'</td>';
			$html .= '<td style="border:1px solid #000000;">'.$row->phone.'</td>';
			$html .= '<td style="border:1px solid #000000;">'.$row->contact_name.'</td>';
			$html .= '<td style="border:1px solid #000000;">'.$row->instructions.'</td>';
			$html .= '<td style="border:1px solid #000000;" align="right">'.$row->qty.'</td>';
			$html .= '<td style="border:1px solid #000000;">'.$row->comments.'</td>';
			$html .= '</tr>';
			$total_qty += $row->qty;
		endwhile;
		$html .= '<tr>';
		$html .= '<td>Total records:</td>';
		$html .= '<td colspan="6">'.$result->rowCount().'</td>';
		$html .= '<td>Total Qty:</td>';
		$html .= '<td colspan="1" align="right">'.$total_qty.'</td>';
		$html .= '<td colspan="1">&nbsp;</td>';
		$html .= '</tr>';
		$html .= '</tbody></table>';
		$html .= '</body></html>';
		$html = utf8_encode($html);
		$mpdf->WriteHTML($html);
		$mpdf->Output(); 
	endif;
?>

Youez - 2016 - github.com/yon3zu
LinuXploit