diff --git a/app/fax/fax_files.php b/app/fax/fax_files.php index 611729a01a..542174e64b 100644 --- a/app/fax/fax_files.php +++ b/app/fax/fax_files.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2018-2020 + Portions created by the Initial Developer are Copyright (C) 2018-2022 the Initial Developer. All Rights Reserved. Contributor(s): @@ -197,7 +197,8 @@ } //prepare to page the results - $sql = "select count(fax_file_uuid) from v_fax_files "; + $sql = "select count(fax_file_uuid) "; + $sql .= "from v_fax_files "; $sql .= "where fax_uuid = :fax_uuid "; $sql .= "and domain_uuid = :domain_uuid "; if ($_REQUEST['box'] == 'inbox') { @@ -220,15 +221,42 @@ list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true); $offset = $rows_per_page * $page; +//set the time zone + if (isset($_SESSION['domain']['time_zone']['name'])) { + $time_zone = $_SESSION['domain']['time_zone']['name']; + } + else { + $time_zone = date_default_timezone_get(); + } + $parameters['time_zone'] = $time_zone; + +//set the time format options: 12h, 24h + if (isset($_SESSION['domain']['time_format']['text'])) { + if ($_SESSION['domain']['time_format']['text'] == '12h') { + $time_format = 'HH12:MI:SS am'; + } + elseif ($_SESSION['domain']['time_format']['text'] == '24h') { + $time_format = 'HH24:MI:SS'; + } + } + else { + $time_format = 'HH12:MI:SS am'; + } + //get the list - $sql = "select * from v_fax_files "; - $sql .= "where fax_uuid = :fax_uuid "; - $sql .= "and domain_uuid = :domain_uuid "; + $sql = "select domain_uuid, fax_file_uuid, fax_uuid, fax_mode \n"; + $sql .= "fax_destination, fax_file_type, fax_file_path, fax_caller_id_name \n"; + $sql .= "fax_caller_id_number, fax_epoch, fax_base64, fax_date, \n"; + $sql .= "to_char(timezone(:time_zone, fax_date), 'DD Mon YYYY') as fax_date_formatted, \n"; + $sql .= "to_char(timezone(:time_zone, fax_date), '".$time_format."') as fax_time_formatted \n"; + $sql .= "from v_fax_files \n"; + $sql .= "where fax_uuid = :fax_uuid \n"; + $sql .= "and domain_uuid = :domain_uuid \n"; if ($_REQUEST['box'] == 'inbox') { - $sql .= "and fax_mode = 'rx' "; + $sql .= "and fax_mode = 'rx' \n"; } if ($_REQUEST['box'] == 'sent') { - $sql .= "and fax_mode = 'tx' "; + $sql .= "and fax_mode = 'tx' \n"; } $parameters['fax_uuid'] = $fax_uuid; $parameters['domain_uuid'] = $domain_uuid; @@ -412,8 +440,7 @@ } } echo " \n"; - $fax_date = ($_SESSION['domain']['time_format']['text'] == '12h') ? date("F d Y H:i", $row['fax_epoch']) : date("F d Y H:i", $row['fax_epoch']); - echo " ".$fax_date." \n"; + echo " ".$row['fax_date_formatted']." ".$row['fax_time_formatted']." \n"; echo "\n"; $x++; } @@ -426,7 +453,6 @@ echo "\n"; echo "\n"; - //include the footer require_once "resources/footer.php";