| 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/hotel-dev/public_html/rpt/ |
Upload File : |
<?php include('mod/_mod_security.php'); ?>
<?php
$criteria = '';
$filter = '';
if (!empty($_POST['csr_date_start']) && is_date($_POST['csr_date_start'])) :
$criteria .= " AND c.update_date >= " . nzdate($_POST['csr_date_start']) . " ";
$filter .= '<br> Updated start date: ' . $_POST['csr_date_start'];
endif;
if (!empty($_POST['csr_date_end']) && is_date($_POST['csr_date_end'])) :
$criteria .= " AND c.update_date <= " . nzdatetime($_POST['csr_date_end'] . ' 23:59:59') . " ";
$filter .= '<br> Updated end date: ' . $_POST['csr_date_end'];
endif;
if (!empty($_POST['csr_category'])) :
$criteria .= " AND h.category = " . $db->quote($_POST['csr_category']) . " ";
$filter .= '<br> Hotel category: ' . $_POST['csr_category'];
endif;
if (isset($_POST['csr_status'])) :
$criteria .= " AND c.status = " . nz($_POST['csr_status'], '0') . " ";
$filter .= '<br> Concierge status: ';
switch ($_POST['csr_status']) :
case '0' :
$filter .= 'Inactive';
break;
case '1' :
$filter .= 'Active';
break;
case '2' :
$filter .= 'In Transition';
break;
endswitch;
endif;
$sql = "SELECT h.hotel_name, n.neighborhood_name, h.zip, c.*, MAX(v.update_date) AS verify_date, su.user_name AS verifier,
CASE
WHEN c.status = 0 THEN 'Inactive'
WHEN c.status = 1 THEN 'Active'
WHEN c.status = 2 THEN 'In Transition'
END AS concierge_status
FROM hotels h
INNER JOIN concierges 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.concierge_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('Concierge Status Report');
$rpt->report_start();
$rpt->header_start();
if (!empty($filter)) :
$rpt->header_row_start();
$rpt->header_cell_add('Filters: '.$filter, ['colspan'=>'14', '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('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('Work Email', ['width'=>'70']);
$rpt->header_cell_add('Pers Email', ['width'=>'70']);
$rpt->header_cell_add('Work Phone', ['width'=>'70']);
$rpt->header_cell_add('Pers Phone', ['width'=>'70']);
$rpt->header_cell_add('Last Updated', ['width'=>'70']);
$rpt->header_cell_add('Verifier', ['width'=>'70']);
$rpt->header_cell_add('Status', ['width'=>'70']);
$rpt->header_cell_add('CGR Member', ['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->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->primary_email);
$rpt->data_cell_add($row->secondary_email);
$rpt->data_cell_add($row->work_phone);
$rpt->data_cell_add($row->cell_phone);
$rpt->data_cell_add(nzdate_display($row->update_date));
$rpt->data_cell_add($row->verifier);
$rpt->data_cell_add($row->concierge_status);
$rpt->data_cell_add($row->cgr ? 'Y' : '');
$tot_count += 1;
$rpt->data_row_end();
endwhile;
$rpt->data_row_start();
$rpt->data_cell_add('Totals', ['colspan'=>14, 'align'=>'center']);
$rpt->data_row_end();
$rpt->data_row_start();
$rpt->data_cell_add('Total concierges', ['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();
?>