diff --git a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php index 46fd0cc0..f12252c8 100644 --- a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -78,6 +78,7 @@ # 160122-1337 - Added display of gmt-offset, last-local-call and called-since-last-reset # 160407-2023 - Design changes, added more variable scrubbing, added more admin logging # 160926-1052 - Fix for inbound call notes display +# 170224-1639 - Added ability to display archived recordings # require("dbconnect_mysqli.php"); @@ -1860,7 +1861,7 @@ else $logs_to_print = mysqli_num_rows($rslt); if ($DB) {echo "$logs_to_print|$stmt|\n";} - $u=0; + $u=0; $rec_ids="''"; while ($logs_to_print > $u) { $row=mysqli_fetch_row($rslt); @@ -1920,9 +1921,78 @@ else echo " $location \n"; echo " $row[13] "; echo "\n"; - + $rec_ids .= ",'$row[0]'"; } + $stmt="SELECT recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log_archive where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and recording_id NOT IN($rec_ids) order by recording_id desc limit 500;"; + $rslt=mysql_to_mysqli($stmt, $link); + $logs_to_print = mysqli_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $v=0; + while ($logs_to_print > $v) + { + $row=mysqli_fetch_row($rslt); + if (preg_match("/1$|3$|5$|7$|9$/i", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) + { + $URLserver_ip = $location; + $URLserver_ip = preg_replace('/http:\/\//i', '',$URLserver_ip); + $URLserver_ip = preg_replace('/https:\/\//i', '',$URLserver_ip); + $URLserver_ip = preg_replace('/\/.*/i', '',$URLserver_ip); + $stmt="SELECT count(*) from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_to_mysqli($stmt, $link); + $rowx=mysqli_fetch_row($rsltx); + + if ($rowx[0] > 0) + { + $stmt="SELECT recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_to_mysqli($stmt, $link); + $rowx=mysqli_fetch_row($rsltx); + + if (preg_match("/ALT_IP/i",$rowx[0])) + { + $location = preg_replace("/$URLserver_ip/i", "$rowx[1]", $location); + } + if (preg_match("/EXTERNAL_IP/i",$rowx[0])) + { + $location = preg_replace("/$URLserver_ip/i", "$rowx[2]", $location); + } + } + } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if ( (preg_match('/ftp/i',$location)) or (preg_match('/http/i',$location)) ) + if ($log_recording_access<1) + {$location = "$locat";} + else + {$location = "$locat";} + else + {$location = $locat;} + $u++; + $v++; + echo ""; + echo "$u"; + echo " $row[12] "; + echo " $row[4] \n"; + echo " $row[8] \n"; + echo " $row[0]  \n"; + echo " $row[10] \n"; + echo " $location *\n"; + echo " $row[13] "; + echo "\n"; + } + + echo "

\n";