diff --git a/app/fax/fax_files.php b/app/fax/fax_files.php index d1cd66ff9b..cdda50ad6c 100644 --- a/app/fax/fax_files.php +++ b/app/fax/fax_files.php @@ -128,98 +128,95 @@ else { echo " \n"; echo "
"; - if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_file_view')) { - //$text['title-fax_files'] - //$text['description-fax_file'] - echo "\n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo "
\n"; +//show the header + //$text['title-fax_files'] + //$text['description-fax_file'] + echo "\n"; + echo " \n"; + echo " \n"; - echo " \n"; - echo " \n"; - echo "
\n"; + if ($_REQUEST['box'] == 'inbox') { echo " ".$text['header-inbox'].": ".$fax_name." (".$fax_extension.")\n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo "
\n"; + } + if ($_REQUEST['box'] == 'sent') { + echo " ".$text['header-sent'].": ".$fax_name." (".$fax_extension.")\n"; + } + echo "
\n"; + echo " \n"; + echo "
\n"; + echo "
\n"; + +//prepare to page the results + $sql = "select count(*) as num_rows from v_fax_files "; + $sql .= "where fax_uuid = '$fax_uuid' "; + $sql .= "and domain_uuid = '$domain_uuid' "; + if ($_REQUEST['box'] == 'inbox') { + $sql .= "and fax_mode = 'rx' "; + } + if ($_REQUEST['box'] == 'sent') { + $sql .= "and fax_mode = 'tx' "; + } + if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } + $prep_statement = $db->prepare($sql); + if ($prep_statement) { + $prep_statement->execute(); + $row = $prep_statement->fetch(PDO::FETCH_ASSOC); + if ($row['num_rows'] > 0) { + $num_rows = $row['num_rows']; + } + else { + $num_rows = '0'; + } } - //prepare to page the results - $sql = "select count(*) as num_rows from v_fax_files "; - $sql .= "where fax_uuid = '$fax_uuid' "; - $sql .= "and domain_uuid = '$domain_uuid' "; - if ($_REQUEST['box'] == 'inbox') { - $sql .= "and fax_mode = 'rx' "; - } - if ($_REQUEST['box'] == 'sent') { - $sql .= "and fax_mode = 'tx' "; - } - if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } - $prep_statement = $db->prepare($sql); - if ($prep_statement) { - $prep_statement->execute(); - $row = $prep_statement->fetch(PDO::FETCH_ASSOC); - if ($row['num_rows'] > 0) { - $num_rows = $row['num_rows']; - } - else { - $num_rows = '0'; - } - } +//prepare to page the results + $rows_per_page = 10; + $param = ""; + $page = $_GET['page']; + if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } + list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); + $offset = $rows_per_page * $page; - //prepare to page the results - $rows_per_page = 10; - $param = ""; - $page = $_GET['page']; - if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); - $offset = $rows_per_page * $page; - - //get the list - $sql = "select * from v_fax_files "; - $sql .= "where fax_uuid = '$fax_uuid' "; - $sql .= "and domain_uuid = '$domain_uuid' "; - if ($_REQUEST['box'] == 'inbox') { - $sql .= "and fax_mode = 'rx' "; - } - if ($_REQUEST['box'] == 'sent') { - $sql .= "and fax_mode = 'tx' "; - } - if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } - $sql .= "limit $rows_per_page offset $offset "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - $result_count = count($result); - unset ($prep_statement, $sql); +//get the list + $sql = "select * from v_fax_files "; + $sql .= "where fax_uuid = '$fax_uuid' "; + $sql .= "and domain_uuid = '$domain_uuid' "; + if ($_REQUEST['box'] == 'inbox') { + $sql .= "and fax_mode = 'rx' "; + } + if ($_REQUEST['box'] == 'sent') { + $sql .= "and fax_mode = 'tx' "; + } + if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } + $sql .= "limit $rows_per_page offset $offset "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + $result_count = count($result); + unset ($prep_statement, $sql); +//show the table and content $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "
\n"; - echo "\n"; + echo "
\n"; echo "\n"; //echo th_order_by('fax_uuid', $text['label-fax_uuid'], $order_by, $order); //echo th_order_by('fax_mode', $text['label-fax_mode'], $order_by, $order); echo th_order_by('fax_number', $text['label-fax_number'], $order_by, $order); - echo th_order_by('fax_file_type', $text['label-fax_file_type'], $order_by, $order); - //echo th_order_by('fax_file_path', $text['label-fax_file_path'], $order_by, $order); + //echo th_order_by('fax_file_type', $text['label-fax_file_type'], $order_by, $order); + echo th_order_by('fax_file_path', $text['label-fax_file_path'], $order_by, $order); echo th_order_by('fax_caller_id_name', $text['label-fax_caller_id_name'], $order_by, $order); echo th_order_by('fax_caller_id_number', $text['label-fax_caller_id_number'], $order_by, $order); echo th_order_by('fax_date', $text['label-fax_date'], $order_by, $order); //echo th_order_by('fax_epoch', $text['label-fax_epoch'], $order_by, $order); //echo th_order_by('fax_base64', $text['label-fax_base64'], $order_by, $order); - echo "\n"; + echo "\n"; echo "\n"; - if ($result_count > 0) { foreach($result as $row) { //if (permission_exists('fax_file_edit')) { @@ -229,8 +226,8 @@ else { //echo " \n"; //echo " \n"; echo " \n"; - echo " \n"; - //echo " \n"; + //echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -250,6 +247,7 @@ else { unset($sql, $result, $row_count); } //end if results +//show the paging controls echo "\n"; echo "
"; - //if (permission_exists('fax_file_add')) { - // echo "$v_link_label_add"; - //} - //else { - echo " \n"; - //} - echo " 
".$row['fax_uuid']." ".$row['fax_mode']." ".$row['fax_number']." ".$row['fax_file_type']." ".$row['fax_file_path']." ".$row['fax_file_type']." ".basename($row['fax_file_path'])." ".$row['fax_caller_id_name']." ".$row['fax_caller_id_number']." ".date("F d Y H:i:s", strtotime($row['fax_date']))." 
\n"; echo " \n"; @@ -268,6 +266,7 @@ else { echo ""; echo "

"; +//close the table and div echo ""; echo ""; echo "
";