From 61848da9e51139b6c8175f36f1f0d04ab0b1b181 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 22 Nov 2016 16:37:42 +0000 Subject: [PATCH] Added code to check for recordings in archived/non-archived tables if none found in Calls Export Report git-svn-id: svn://192.168.202.10@2624 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/call_report_export.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/www/vicidial/call_report_export.php b/www/vicidial/call_report_export.php index c9f269fd..b604624b 100644 --- a/www/vicidial/call_report_export.php +++ b/www/vicidial/call_report_export.php @@ -51,6 +51,7 @@ # 160914-2200 - Added option to grab reports by either call date or entry date # 161017-1242 - Added DID custom variables to EXTENDED_3 output option # 161111-1232 - Fixed debug output to work with export +# 161122-1136 - Added code to check for recordings in archived/non-archived tables if none found # $startMS = microtime(); @@ -884,6 +885,33 @@ if ($run_export > 0) $u++; } + if ($recordings_ct < 1) + { + if (preg_match("/_archive/",$recording_log_table)) + {$TEMPrecording_log_table = 'recording_log';} + else + {$TEMPrecording_log_table = 'recording_log_archive';} + $stmt = "SELECT recording_id,filename,location from ".$TEMPrecording_log_table." where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($DB) {echo "CHECKING FOR RECORDINGS IN OTHER TABLE:$stmt\n";} + $recordings_ct = mysqli_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysqli_fetch_row($rslt); + + ### PARSE TAB CHARACTERS FROM THE DATA ITSELF + for ($t=0; $t