| Server IP : 104.21.21.239 / 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-prod/public_html/rpt/ |
Upload File : |
<?php include('mod/_mod_security.php'); ?>
<?php
$criteria = '';
$filter = '';
if (!empty($_POST['vcr_date_start']) && is_date($_POST['vcr_date_start'])) :
$criteria .= " AND v.create_date >= " . nzdate($_POST['vcr_date_start']) . " ";
$filter .= '<br> Last verification start date: ' . $_POST['vcr_date_start'];
endif;
if (!empty($_POST['vcr_date_end']) && is_date($_POST['vcr_date_end'])) :
$criteria .= " AND v.create_date <= " . nzdatetime($_POST['vcr_date_end'] . ' 23:59:59') . " ";
$filter .= '<br> Last verification end date: ' . $_POST['vcr_date_end'];
endif;
if (!empty($_POST['vcr_neighborhood'])) :
$criteria .= " AND h.neighborhood_id = " . nz($_POST['vcr_neighborhood'], '0') . " ";
$filter .= '<br> Neighborhood: ' . lookup_db_field('neighborhoods', 'neighborhood_id', $_POST['vcr_neighborhood'], 'neighborhood_name');
endif;
if (!empty($_POST['vcr_verifier'])) :
$criteria .= " AND v.create_by = " . nz($_POST['vcr_verifier'], '0') . " ";
$filter .= '<br> Verifier: ' . lookup_db_field('sys_users', 'user_id', $_POST['vcr_verifier'], 'full_name');
endif;
$sql = "SELECT h.hotel_name, n.neighborhood_name, v.*, MAX(v.create_date) AS verify_date, su.full_name AS verifier
FROM hotels h
INNER 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
))
INNER JOIN sys_users su ON (v.create_by = su.user_id)
LEFT JOIN neighborhoods n ON (h.neighborhood_id = n.neighborhood_id)
WHERE h.status = 1
$criteria
GROUP BY h.hotel_name, h.neighborhood_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('Verification Comment Report');
$rpt->report_start();
$rpt->header_start();
if (!empty($filter)) :
$rpt->header_row_start();
$rpt->header_cell_add('Filters: '.$filter, ['colspan'=>'6', 'class'=>'large', 'align'=>'left']);
$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('Spoke To', ['width'=>'70']);
$rpt->header_cell_add('Verifier', ['width'=>'70']);
$rpt->header_cell_add('Last Verify Date', ['width'=>'70']);
$rpt->header_cell_add('Verification Comment', ['width'=>'270']);
$rpt->header_row_end();
$rpt->header_end();
$rpt->data_start();
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->spoke_to);
$rpt->data_cell_add($row->verifier);
$rpt->data_cell_add(nzdate_display($row->verify_date));
$rpt->data_cell_add($row->comments);
$rpt->data_row_end();
endwhile;
$rpt->data_end();
$rpt->report_end();
$rpt->output_report();
?>