updated language builds for vicidial_it, agc_it and agc_sk
git-svn-id: svn://192.168.202.10@981 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
<?
|
||||
### active_list_refresh.php
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
### This script is designed purely to serve updates of the live data to the display scripts
|
||||
### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
###
|
||||
### required variables:
|
||||
### - $server_ip
|
||||
### - $session_name
|
||||
### - $user
|
||||
### - $pass
|
||||
### optional variables:
|
||||
### - $ADD - ('1','2','3','4','5')
|
||||
### - $order - ('asc','desc')
|
||||
### - $format - ('text','table','menu','selectlist','textarea')
|
||||
### - $bgcolor - ('#123456','white','black','etc...')
|
||||
### - $txtcolor - ('#654321','black','white','etc...')
|
||||
### - $txtsize - ('1','2','3','etc...')
|
||||
### - $selectsize - ('2','3','4','etc...')
|
||||
### - $selectfontsize - ('8','10','12','etc...')
|
||||
### - $selectedext - ('cc100')
|
||||
### - $selectedtrunk - ('Zap/25-1')
|
||||
### - $selectedlocal - ('SIP/cc100')
|
||||
### - $textareaheight - ('8','10','12','etc...')
|
||||
### - $textareawidth - ('8','10','12','etc...')
|
||||
### - $field_name - ('extension','busyext','extension_xfer','etc...')
|
||||
###
|
||||
|
||||
# active_list_refresh.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to serve updates of the live data to the display scripts
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $ADD - ('1','2','3','4','5')
|
||||
# - $order - ('asc','desc')
|
||||
# - $format - ('text','table','menu','selectlist','textarea')
|
||||
# - $bgcolor - ('#123456','white','black','etc...')
|
||||
# - $txtcolor - ('#654321','black','white','etc...')
|
||||
# - $txtsize - ('1','2','3','etc...')
|
||||
# - $selectsize - ('2','3','4','etc...')
|
||||
# - $selectfontsize - ('8','10','12','etc...')
|
||||
# - $selectedext - ('cc100')
|
||||
# - $selectedtrunk - ('Zap/25-1')
|
||||
# - $selectedlocal - ('SIP/cc100')
|
||||
# - $textareaheight - ('8','10','12','etc...')
|
||||
# - $textareawidth - ('8','10','12','etc...')
|
||||
# - $field_name - ('extension','busyext','extension_xfer','etc...')
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50323-1147 - First build of script
|
||||
# 50401-1132 - small formatting changes
|
||||
@@ -125,7 +125,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Non valido Utentename/Parola d`accesso: |$user|$pass|\n";
|
||||
echo "Utentename/Password non validi: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -133,7 +133,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n";
|
||||
echo "ip del server non valido: |$server_ip| or Nome sessione non valido: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -145,7 +145,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Non valido session_name: |$session_name|$server_ip|\n";
|
||||
echo "Nome sessione non valido: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -159,10 +159,10 @@ if ($format=='table')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSIONE: $version CONFIGURAZIONE: $build ADD: $ADD server_ip: $server_ip-->\n";
|
||||
echo "<!-- VERSIONE: $version BUILD: $build ADD: $ADD server_ip: $server_ip-->\n";
|
||||
echo "<title>Visualizza Lista: ";
|
||||
if ($ADD==1) {echo "Interni Attivi";}
|
||||
if ($ADD==2) {echo "Interni Occupati";}
|
||||
if ($ADD==1) {echo "Estensioni Attive";}
|
||||
if ($ADD==2) {echo "Estensioni Occupate";}
|
||||
if ($ADD==3) {echo "Linee Esterne";}
|
||||
if ($ADD==4) {echo "Interni Locali";}
|
||||
if ($ADD==5) {echo "Conferenze";}
|
||||
@@ -214,7 +214,7 @@ if ($ADD==1)
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedext") {echo "SELECTED ";}
|
||||
if ($row[0]=="$selectedext") {echo "SELEZIONATO ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</OPTION>\n";
|
||||
@@ -271,7 +271,7 @@ if ($ADD==2)
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedext") {echo "SELECTED ";}
|
||||
if ($row[0]=="$selectedext") {echo "SELEZIONATO ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0]";
|
||||
echo "</OPTION>\n";
|
||||
@@ -327,7 +327,7 @@ if ($ADD==3)
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedtrunk") {echo "SELECTED ";}
|
||||
if ($row[0]=="$selectedtrunk") {echo "SELEZIONATO ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</OPTION>\n";
|
||||
@@ -383,7 +383,7 @@ if ($ADD==4)
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedlocal") {echo "SELECTED ";}
|
||||
if ($row[0]=="$selectedlocal") {echo "SELEZIONATO ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</OPTION>\n";
|
||||
@@ -440,7 +440,7 @@ if ($ADD==5)
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedext") {echo "SELECTED ";}
|
||||
if ($row[0]=="$selectedext") {echo "SELEZIONATO ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</OPTION>\n";
|
||||
@@ -469,7 +469,7 @@ if ($ADD==5)
|
||||
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
if ($format=='table') {echo "\n<!-- tempo di esecuzione dello script: $RUNtime secondi -->";}
|
||||
if ($format=='table') {echo "\n<!-- script runtime: $RUNtime secondi -->";}
|
||||
if ($format=='table') {echo "\n</body>\n</html>\n";}
|
||||
|
||||
exit;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?
|
||||
# astguiclient.php - the web-based version of the astGUIclient client application
|
||||
#
|
||||
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least
|
||||
# user_level 1 or greater to access this page. Also you need to have the login
|
||||
@@ -105,7 +105,7 @@ if ($force_logout)
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
}
|
||||
echo "Ora siete non Loggati . Grazie\n";
|
||||
echo "Ora non sei collegato. Grazie\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ $agcDIR = eregi_replace('astguiclient.php','',$agcDIR);
|
||||
{
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
echo "<title>web client astGUIclient: Inizio attività</title>\n";
|
||||
echo "<title>web client astGUIclient: Login</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
|
||||
echo "<TABLE><TR><TD></TD>\n";
|
||||
@@ -153,19 +153,19 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/astguicli
|
||||
echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
|
||||
echo "<BR><BR><BR><CENTER><TABLE WIDTH=360 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCC2E0\"><TR BGCOLOR=WHITE>";
|
||||
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/agc_tab_astguiclient.gif\" Border=0></TD>";
|
||||
echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Inizio attività </TD>";
|
||||
echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Login </TD>";
|
||||
echo "</TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Inizio attività dell`Utente: </TD>";
|
||||
echo "<TR><TD ALIGN=RIGHT>Login Utente: </TD>";
|
||||
echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=user SIZE=10 maxlength=20 VALUE=\"$user\"></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Parola d`accesso Dell`Utente: </TD>";
|
||||
echo "<TR><TD ALIGN=RIGHT>Password Utente: </TD>";
|
||||
echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=pass SIZE=10 maxlength=20 VALUE=\"$pass\"></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Inizio attività Telefono: </TD>";
|
||||
echo "<TR><TD ALIGN=RIGHT>Login Telefono: </TD>";
|
||||
echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=phone_login SIZE=10 maxlength=20 VALUE=\"$phone_login\"></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Parola d`accesso del Telefono: </TD>";
|
||||
echo "<TR><TD ALIGN=RIGHT>Password Telefono: </TD>";
|
||||
echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"$phone_pass\"></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=INVIA VALUE=INVIA></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIONE: $version CONFIGURAZIONE: $build</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIONE: $version BUILD: $build</TD></TR>\n";
|
||||
echo "</TABLE>\n";
|
||||
echo "</FORM>\n\n";
|
||||
echo "</body>\n\n";
|
||||
@@ -185,7 +185,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/astguicli
|
||||
$LOGfullname=$row[0];
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICICHIAMA|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/astguicli
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICICHIAMA|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
@@ -204,11 +204,11 @@ header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSIONE: $version CONFIGURAZIONE: $build ADD: $ADD-->\n";
|
||||
echo "<!-- VERSIONE: $version BUILD: $build ADD: $ADD-->\n";
|
||||
|
||||
if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) )
|
||||
{
|
||||
echo "<title>web client astGUIclient: Inizio attività Telefono</title>\n";
|
||||
echo "<title>web client astGUIclient: Login Telefono</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
|
||||
echo "<TABLE><TR><TD></TD>\n";
|
||||
@@ -220,15 +220,15 @@ echo "<INPUT TYPE=HIDDEN NAME=user VALUE=\"$user\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=pass VALUE=\"$pass\">\n";
|
||||
echo "<BR><BR><BR><CENTER><TABLE WIDTH=360 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCC2E0\"><TR BGCOLOR=WHITE>";
|
||||
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/agc_tab_astguiclient.gif\" Border=0></TD>";
|
||||
echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Inizio attività Telefono </TD>";
|
||||
echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Login Telefono </TD>";
|
||||
echo "</TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Inizio attività Telefono: </TD>";
|
||||
echo "<TR><TD ALIGN=RIGHT>Login Telefono: </TD>";
|
||||
echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=phone_login SIZE=10 maxlength=20 VALUE=\"$phone_login\"></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Parola d`accesso del Telefono: </TD>";
|
||||
echo "<TR><TD ALIGN=RIGHT>Password Telefono: </TD>";
|
||||
echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"$phone_pass\"></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=INVIA VALUE=INVIA></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIONE: $version CONFIGURAZIONE: $build</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIONE: $version BUILD: $build</TD></TR>\n";
|
||||
echo "</TABLE>\n";
|
||||
echo "</FORM>\n\n";
|
||||
echo "</body>\n\n";
|
||||
@@ -245,7 +245,7 @@ $row=mysql_fetch_row($rslt);
|
||||
$authphone=$row[0];
|
||||
if (!$authphone)
|
||||
{
|
||||
echo "<title>web client astGUIclient: Inizio attività Telefono</title>\n";
|
||||
echo "<title>web client astGUIclient: Login Telefono</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
|
||||
echo "<TABLE><TR><TD></TD>\n";
|
||||
@@ -257,15 +257,15 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/astguicli
|
||||
echo "<INPUT TYPE=HIDDEN NAME=pass VALUE=\"$pass\">\n";
|
||||
echo "<BR><BR><BR><CENTER><TABLE WIDTH=360 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCC2E0\"><TR BGCOLOR=WHITE>";
|
||||
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/agc_tab_astguiclient.gif\" Border=0></TD>";
|
||||
echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Inizio attività Telefono </TD>";
|
||||
echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Login Telefono </TD>";
|
||||
echo "</TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> <BR><FONT SIZE=3>Spiacente, la vostra password e login non sono attivi in questo sistema, riprova di nuovo: <BR> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Inizio attività Telefono: </TD>";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> <BR><FONT SIZE=3>Spiacente, il telefono inserito non e` attivo in questo sistema, riprova di nuovo: <BR> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Login Telefono: </TD>";
|
||||
echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=phone_login SIZE=10 maxlength=20 VALUE=\"$phone_login\"></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Parola d`accesso del Telefono: </TD>";
|
||||
echo "<TR><TD ALIGN=RIGHT>Password Telefono: </TD>";
|
||||
echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"$phone_pass\"></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=INVIA VALUE=INVIA></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIONE: $version CONFIGURAZIONE: $build</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIONE: $version BUILD: $build</TD></TR>\n";
|
||||
echo "</TABLE>\n";
|
||||
echo "</FORM>\n\n";
|
||||
echo "</body>\n\n";
|
||||
@@ -390,7 +390,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<!-- No Extension Favorites Present -->\n";
|
||||
echo "<!-- Nessun interno preferito presente -->\n";
|
||||
}
|
||||
|
||||
### gather phone extensions and fullnames for favorites editor ###
|
||||
@@ -716,7 +716,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
}
|
||||
|
||||
// ################################################################################
|
||||
// LIVE TRUNK LIST FOR ATTACCA/HIJACK MENU FUNCTIONS
|
||||
// LIVE TRUNK LIST FOR RIAGGANCIA/HIJACK MENU FUNCTIONS
|
||||
function refresh_busytrunkhangup()
|
||||
{
|
||||
document.getElementById("TrunkHangupContent").innerHTML = Nactiveext;
|
||||
@@ -763,7 +763,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
}
|
||||
|
||||
// ################################################################################
|
||||
// LIVE LOCAL LIST FOR ATTACCA/HIJACK MENU FUNCTIONS
|
||||
// LIVE LOCAL LIST FOR RIAGGANCIA/HIJACK MENU FUNCTIONS
|
||||
function refresh_busylocalhangup()
|
||||
{
|
||||
document.getElementById("LocalHangupContent").innerHTML = Nactiveext;
|
||||
@@ -885,7 +885,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
else
|
||||
{
|
||||
bsr_continue=0;
|
||||
alert("Potete soltanto monitorare i canali Zap:\n" + listenvalue);
|
||||
alert("Puoi soltanto monitorare i canali Zap:\n" + listenvalue);
|
||||
}
|
||||
}
|
||||
if (bsr_continue == '1')
|
||||
@@ -1195,7 +1195,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
{
|
||||
recLIST = recLIST + "|" + monitorchannelvalue;
|
||||
filename = filedate + "_" + user_abb;
|
||||
var rec_start_html = "<a href=\"#\" onclick=\"liverecording_send_recording('StopMonitor','" + monitorchannelvalue + "','" + taskspan + "','" + filename + "');return false;\">Stop Registrazione";
|
||||
var rec_start_html = "<a href=\"#\" onclick=\"liverecording_send_recording('StopMonitor','" + monitorchannelvalue + "','" + taskspan + "','" + filename + "');return false;\">Ferma la registrazione";
|
||||
document.getElementById(taskspan).innerHTML = rec_start_html;
|
||||
|
||||
}
|
||||
@@ -1205,7 +1205,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
recLIST = recLIST.replace(regy, '');
|
||||
|
||||
filename = taskfile;
|
||||
var rec_stop_html = "<a href=\"#\" onclick=\"liverecording_send_recording('Monitor','" + monitorchannelvalue + "','" + taskspan + "','');return false;\">Registrazione";
|
||||
var rec_stop_html = "<a href=\"#\" onclick=\"liverecording_send_recording('Monitor','" + monitorchannelvalue + "','" + taskspan + "','');return false;\">Record";
|
||||
document.getElementById(taskspan).innerHTML = rec_stop_html;
|
||||
}
|
||||
livemonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + monitorvalue + "&format=text&channel=" + monitorchannelvalue + "&queryCID=" + queryCID + "&filename=" + filename + "&exten=" + protocol + "/" + extension;
|
||||
@@ -1257,7 +1257,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
recLIST = recLIST + "|" + taskconfrec;
|
||||
filename = filedate + "_" + user_abb;
|
||||
var channelrec = "Local/" + taskconfrec + "@" + ext_context;
|
||||
var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('StopMonitorConf','" + taskconfspan + "','" + taskconfrec + "','" + filename + "');return false;\">Stop Registrazione</a>";
|
||||
var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('StopMonitorConf','" + taskconfspan + "','" + taskconfrec + "','" + filename + "');return false;\">Ferma la registrazione</a>";
|
||||
document.getElementById(taskconfspan).innerHTML = conf_rec_start_html;
|
||||
|
||||
}
|
||||
@@ -1268,7 +1268,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
|
||||
filename = taskconffile;
|
||||
var channelrec = "Local/" + taskconfrec + "@" + ext_context;
|
||||
var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + taskconfspan + "','" + taskconfrec + "','');return false;\">Registrazione</a>";
|
||||
var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + taskconfspan + "','" + taskconfrec + "','');return false;\">Record</a>";
|
||||
document.getElementById(taskconfspan).innerHTML = conf_rec_start_html;
|
||||
}
|
||||
confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + recording_exten + "&ext_context=" + ext_context + "&ext_priority=1";
|
||||
@@ -1384,7 +1384,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
var conv_start=3;
|
||||
if (live_calls > 0)
|
||||
{
|
||||
var live_calls_HTML = "<font face=\"Arial,Helvetica\"><B>CHIAMATE ATTIVE SU QUESTO TELEFONO:</B></font><BR><table width=100%><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\">CANALE CLIENT</td><td><font class=\"log_title\">CANALE REMOTO</td><td><font class=\"log_title\">Registrazione</td><td><font class=\"log_title\">ATTACCA</td><td><font class=\"log_title\">TRASF</td><td><font class=\"log_title\">PARK</td></tr>";
|
||||
var live_calls_HTML = "<font face=\"Arial,Helvetica\"><B>CHIAMATE IN CORSO SU QUESTO TELEFONO:</B></font><BR><table width=100%><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\">CANALE CLIENT</td><td><font class=\"log_title\">CANALE REMOTO</td><td><font class=\"log_title\">Registrazione</td><td><font class=\"log_title\">RIAGGANCIA</td><td><font class=\"log_title\">TRASF</td><td><font class=\"log_title\">ATTESA</td></tr>";
|
||||
if ( (LCAcount > live_calls) || (LCAcount < live_calls) )
|
||||
{
|
||||
LCAe[0]=''; LCAe[1]=''; LCAe[2]=''; LCAe[3]=''; LCAe[4]=''; LCAe[5]='';
|
||||
@@ -1400,7 +1400,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
{var row_color = '#DDDDFF';}
|
||||
else
|
||||
{var row_color = '#CCCCFF';}
|
||||
var Registrazionebutton = 'Monitor';
|
||||
var Recordbutton = 'Monitor';
|
||||
var conv_ct = (loop_ct + conv_start);
|
||||
var conversation_array = check_live_array[conv_ct].split(" ~");
|
||||
var channelfieldA_array = conversation_array[1].split(": ");
|
||||
@@ -1410,11 +1410,11 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
|
||||
var regx = new RegExp("\\|"+channelfieldBtrunk_array[1],"ig");
|
||||
if (recLIST.match(regx))
|
||||
{live_calls_HTML = live_calls_HTML + "<span id=\"recordlive" + loop_ct + "\"><a href=\"#\" onclick=\"liverecording_send_recording('StopMonitor','" + channelfieldBtrunk_array[1] + "','recordlive" + loop_ct + "');return false;\">Stop Registrazione</span>";}
|
||||
{live_calls_HTML = live_calls_HTML + "<span id=\"recordlive" + loop_ct + "\"><a href=\"#\" onclick=\"liverecording_send_recording('StopMonitor','" + channelfieldBtrunk_array[1] + "','recordlive" + loop_ct + "');return false;\">Ferma la registrazione</span>";}
|
||||
else
|
||||
{live_calls_HTML = live_calls_HTML + "<span id=\"recordlive" + loop_ct + "\"><a href=\"#\" onclick=\"liverecording_send_recording('Monitor','" + channelfieldBtrunk_array[1] + "','recordlive" + loop_ct + "');return false;\">Registrazione</span>";}
|
||||
{live_calls_HTML = live_calls_HTML + "<span id=\"recordlive" + loop_ct + "\"><a href=\"#\" onclick=\"liverecording_send_recording('Monitor','" + channelfieldBtrunk_array[1] + "','recordlive" + loop_ct + "');return false;\">Record</span>";}
|
||||
|
||||
live_calls_HTML = live_calls_HTML + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldBtrunk_array[1] + "');return false;\">ATTACCA</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + channelfieldBtrunk_array[1] + "','" + channelfieldA_array[1] + "');return false;\">TRASF</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + channelfieldBtrunk_array[1] + "');return false;\">PARK</td></tr>";
|
||||
live_calls_HTML = live_calls_HTML + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldBtrunk_array[1] + "');return false;\">RIAGGANCIA</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + channelfieldBtrunk_array[1] + "','" + channelfieldA_array[1] + "');return false;\">TRASF</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + channelfieldBtrunk_array[1] + "');return false;\">ATTESA</td></tr>";
|
||||
|
||||
if (LCAe[ARY_ct].length < 1)
|
||||
{LCAe[ARY_ct] = channelfieldA_array[1]; LCAcontent_change++; LCAalter++;}
|
||||
@@ -1531,7 +1531,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
var conv_start=0;
|
||||
if (out_calls > 0)
|
||||
{
|
||||
var out_log_HTML = "<table width=580><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\"> DATE/TIME DI CHIAMATA</td><td><font class=\"log_title\">NUMERO</td><td align=right><font class=\"log_title\">LUNGHEZZA (M:SS)</td><td><font class=\"log_title\"> </td></tr>"
|
||||
var out_log_HTML = "<table width=580><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\"> DATA/ORA CHIAMATA</td><td><font class=\"log_title\">NUMERO</td><td align=right><font class=\"log_title\">LUNGHEZZA (M:SS)</td><td><font class=\"log_title\"> </td></tr>"
|
||||
while (loop_ct < out_calls)
|
||||
{
|
||||
loop_ct++;
|
||||
@@ -1545,7 +1545,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
var call_out_datetime = call_array[1];
|
||||
var call_out_number = call_array[2];
|
||||
var call_out_length = call_array[3];
|
||||
out_log_HTML = out_log_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + call_out_datetime + "</td><td><font class=\"log_text\">" + call_out_number + "</td><td align=right><font class=\"log_text\">" + call_out_length + " </td><td><font class=\"log_text\"><a href=\"#\" onclick=\"basic_originate_call('" + call_out_number + "');return false;\">CHIAMA</a></td></tr>";
|
||||
out_log_HTML = out_log_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + call_out_datetime + "</td><td><font class=\"log_text\">" + call_out_number + "</td><td align=right><font class=\"log_text\">" + call_out_length + " </td><td><font class=\"log_text\"><a href=\"#\" onclick=\"basic_originate_call('" + call_out_number + "');return false;\">DIAL</a></td></tr>";
|
||||
|
||||
}
|
||||
out_log_HTML = out_log_HTML + "</table>";
|
||||
@@ -1559,7 +1559,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
var conv_start=0;
|
||||
if (in_calls > 0)
|
||||
{
|
||||
var in_log_HTML = "<table width=580><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\"> DATE/TIME DI CHIAMATA</td><td><font class=\"log_title\">IN-NUMERO</td><td COLSPAN=2><font class=\"log_title\">CALLERID</td><td align=right><font class=\"log_title\">LUNGHEZZA</td><td><font class=\"log_title\"> </td></tr>"
|
||||
var in_log_HTML = "<table width=580><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\"> DATA/ORA CHIAMATA</td><td><font class=\"log_title\">IN-NUMERO</td><td COLSPAN=2><font class=\"log_title\">CALLERID</td><td align=right><font class=\"log_title\">LUNGHEZZA</td><td><font class=\"log_title\"> </td></tr>"
|
||||
while (loop_ct < in_calls)
|
||||
{
|
||||
loop_ct++;
|
||||
@@ -1575,7 +1575,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
var call_in_idnum = call_array[3];
|
||||
var call_in_idname = call_array[4];
|
||||
var call_in_length = call_array[5];
|
||||
in_log_HTML = in_log_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + call_in_datetime + "</td><td><font class=\"log_text\">" + call_in_number + "</td><td><font class=\"log_text\">" + call_in_idnum + "</td><td><font class=\"log_text\">" + call_in_idname + "</td><td align=right><font class=\"log_text\">" + call_in_length + " </td><td><font class=\"log_text\"><a href=\"#\" onclick=\"basic_originate_call('" + call_in_idnum + "');return false;\">CHIAMA</a></td></tr>";
|
||||
in_log_HTML = in_log_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + call_in_datetime + "</td><td><font class=\"log_text\">" + call_in_number + "</td><td><font class=\"log_text\">" + call_in_idnum + "</td><td><font class=\"log_text\">" + call_in_idname + "</td><td align=right><font class=\"log_text\">" + call_in_length + " </td><td><font class=\"log_text\"><a href=\"#\" onclick=\"basic_originate_call('" + call_in_idnum + "');return false;\">DIAL</a></td></tr>";
|
||||
|
||||
}
|
||||
in_log_HTML = in_log_HTML + "</table>";
|
||||
@@ -1634,7 +1634,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
var conv_start=-1;
|
||||
if (parked_count > 0)
|
||||
{
|
||||
var park_HTML = "<table width=600><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\">CHANNEL<BR> CHIAMATA ID</td><td><font class=\"log_title\">PARCHEGGIATO DA<BR> TEMPO PARCHEGGIATO</td><td><font class=\"log_title\">ATTACCA</td><td><font class=\"log_title\">TRASF</td><td><font class=\"log_title\">RIPRENDI</td></tr>"
|
||||
var park_HTML = "<table width=600><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\">CHANNEL<BR> CHIAMATA ID</td><td><font class=\"log_title\">MESSO IN ATTESA DA<BR> TEMPO IN ATTESA</td><td><font class=\"log_title\">RIAGGANCIA</td><td><font class=\"log_title\">TRASF</td><td><font class=\"log_title\">RIPRENDI</td></tr>"
|
||||
while (loop_ct < parked_count)
|
||||
{
|
||||
loop_ct++;
|
||||
@@ -1650,7 +1650,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
var park_call_id = park_array[1];
|
||||
var parked_by = park_array[3];
|
||||
var parked_time = park_array[4];
|
||||
park_HTML = park_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + park_channel + "<BR> " + park_call_id + "</td><td><font class=\"log_text\">" + parked_by + "<BR> " + parked_time + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + park_channel + "');return false;\">ATTACCA</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + park_channel + "');return false;\">TRASF</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParK','" + park_channel + "');return false;\">RIPRENDI</a></td></tr>";
|
||||
park_HTML = park_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + park_channel + "<BR> " + park_call_id + "</td><td><font class=\"log_text\">" + parked_by + "<BR> " + parked_time + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + park_channel + "');return false;\">RIAGGANCIA</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + park_channel + "');return false;\">TRASF</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParK','" + park_channel + "');return false;\">RIPRENDI</a></td></tr>";
|
||||
|
||||
}
|
||||
park_HTML = park_HTML + "</table>";
|
||||
@@ -1762,7 +1762,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
show_reglink=1;
|
||||
reglink = "<a href=\"#\" onclick=\"conf_register_room('" + head_conf + "');return false;\">Register</a>";
|
||||
}
|
||||
var conf_head_HTML = "<font class=\"sh_text\">CONFERENZA " + head_conf + "</b></font><font class=\"sb_text\"> Registrato a: " + head_reg + " " + reglink + " <a href=\"#\" onclick=\"basic_originate_call('" + head_conf + "','NO','NO');return false;\">Entra in Conferenza </a><BR><a href=\"#\" onclick=\"check_for_conf_calls('" + head_conf + "','1');return false;\">Aggiorna </a> <span id=\"conf_rec_link\"><a href=\"#\" onclick=\"conf_send_recording('MonitorConf','conf_rec_link','" + head_conf + "');return false;\">Registrazione</a></span> <input TYPE=TEXT SIZE=15 NAME=conf_dtmf STYLE=\"font-family : sans-serif; font-size : 10px\"> <A HREF=\"#\" onclick=\"SendConfDTMF(" + head_conf + ");\">Trasmetta DTMF</A> <input TYPE=TEXT SIZE=15 NAME=conf_dial STYLE=\"font-family : sans-serif; font-size : 10px\"> <A HREF=\"#\" onclick=\"SendManualDial('YES'," + head_conf + ");\">Chiama dalla Conferenza</A><BR></font>";
|
||||
var conf_head_HTML = "<font class=\"sh_text\">CONFERENZA " + head_conf + "</b></font><font class=\"sb_text\"> Registrato su: " + head_reg + " " + reglink + " <a href=\"#\" onclick=\"basic_originate_call('" + head_conf + "','NO','NO');return false;\">Entra in Conferenza </a><BR><a href=\"#\" onclick=\"check_for_conf_calls('" + head_conf + "','1');return false;\">Aggiorna </a> <span id=\"conf_rec_link\"><a href=\"#\" onclick=\"conf_send_recording('MonitorConf','conf_rec_link','" + head_conf + "');return false;\">Record</a></span> <input TYPE=TEXT SIZE=15 NAME=conf_dtmf STYLE=\"font-family : sans-serif; font-size : 10px\"> <A HREF=\"#\" onclick=\"SendConfDTMF(" + head_conf + ");\">Trasmetti Tono Tastiera</A> <input TYPE=TEXT SIZE=15 NAME=conf_dial STYLE=\"font-family : sans-serif; font-size : 10px\"> <A HREF=\"#\" onclick=\"SendManualDial('YES'," + head_conf + ");\">Chiama dalla Conferenza</A><BR></font>";
|
||||
|
||||
document.getElementById("ConfereNceHeaderContent").innerHTML = conf_head_HTML;
|
||||
check_for_conf_calls(head_conf,taskrefresh);
|
||||
@@ -1823,7 +1823,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
var LMAcontent_change=0;
|
||||
var LMAcontent_match=0;
|
||||
var conv_start=-1;
|
||||
var live_conf_HTML = "<font face=\"Arial,Helvetica\"><B>CHIAMATE ATTIVE IN QUESTA CONFERENZA:</B></font><BR><TABLE WIDTH=500><TR BGCOLOR=#E6E6E6><TD><font class=\"log_title\">#</TD><TD><font class=\"log_title\">CANALE REMOTO</TD><TD><font class=\"log_title\">ATTACCA</TD><TD><font class=\"log_title\">TRASF</TD></TR>";
|
||||
var live_conf_HTML = "<font face=\"Arial,Helvetica\"><B>CHIAMATE IN CORSO SU QUESTA CONFERENZA:</B></font><BR><TABLE WIDTH=500><TR BGCOLOR=#E6E6E6><TD><font class=\"log_title\">#</TD><TD><font class=\"log_title\">CANALE REMOTO</TD><TD><font class=\"log_title\">RIAGGANCIA</TD><TD><font class=\"log_title\">TRASF</TD></TR>";
|
||||
if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0))
|
||||
{
|
||||
LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]='';
|
||||
@@ -1839,7 +1839,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
{var row_color = '#CCCCFF';}
|
||||
var conv_ct = (loop_ct + conv_start);
|
||||
var channelfieldA = conf_chan_array[conv_ct];
|
||||
live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">ATTACCA</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + channelfieldA + "');return false;\">TRASF</td></tr>";
|
||||
live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">RIAGGANCIA</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + channelfieldA + "');return false;\">TRASF</td></tr>";
|
||||
|
||||
if (!LMAe[ARY_ct])
|
||||
{LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;}
|
||||
@@ -2061,7 +2061,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
}
|
||||
|
||||
// ################################################################################
|
||||
// Send Originate command to manager to direct user to Casella del voicemail
|
||||
// Send Originate command to manager to direct user to Casella Voicemail
|
||||
function SendCheckVoiceMail()
|
||||
{
|
||||
var xmlhttp=false;
|
||||
@@ -2288,7 +2288,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
var VD_favlist_ct_half = parseInt(favlistCT / 2);
|
||||
if (VD_favlist_ct_half < 30) {VD_favlist_ct_half = 30;}
|
||||
var favlist_sec_col = 0;
|
||||
var favedit_HTML = "<center><table cellpadding=5 cellspacing=5 width=750><tr><td colspan=2 align=center bgcolor=\"#DDDD99\"><B>INTERNI DISPONIBILI</B></td><td align=center bgcolor=\"#CCCC99\"><B> FAVORITI</B></td></tr><tr><td bgcolor=\"#DDDD99\" height=380 width=200 valign=top><font class=\"ss_text\"><span id=FavSelectA>";
|
||||
var favedit_HTML = "<center><table cellpadding=5 cellspacing=5 width=750><tr><td colspan=2 align=center bgcolor=\"#DDDD99\"><B>INTERNI DISPONIBILI</B></td><td align=center bgcolor=\"#CCCC99\"><B> PREFERITI</B></td></tr><tr><td bgcolor=\"#DDDD99\" height=380 width=200 valign=top><font class=\"ss_text\"><span id=FavSelectA>";
|
||||
loop_ct = 0;
|
||||
while (loop_ct < favlistCT)
|
||||
{
|
||||
@@ -2385,7 +2385,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";}
|
||||
hideDiv('MainPanel');
|
||||
showDiv('LogouTBox');
|
||||
|
||||
document.getElementById("LogouTBoxLink").innerHTML = "<a href=\"" + agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&user=" + user + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "\">FAI CLICK QUI PER LOGGARTI DI NUOVO </a>\n";
|
||||
document.getElementById("LogouTBoxLink").innerHTML = "<a href=\"" + agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&user=" + user + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "\">FAI CLICK QUI PER AUTENTICARTI DI NUOVO</a>\n";
|
||||
|
||||
logout_stop_timeouts = 1;
|
||||
|
||||
@@ -2716,14 +2716,14 @@ echo "</head>\n";
|
||||
<TR VALIGN=TOP ALIGN=LEFT><TD COLSPAN=5 VALIGN=TOP ALIGN=LEFT>
|
||||
<INPUT TYPE=HIDDEN NAME=extension>
|
||||
<font class="body_text">
|
||||
<? echo "Benvenuto $LOGfullname, siete loggati dentro questo telefono: $fullname - $protocol/$extension su $server_ip <a href=\"#\" onclick=\"LogouT();return false;\">LOGOUT</a><BR>\n"; ?>
|
||||
<? echo "Benvenuto $LOGfullname, Sei loggato su questo telefono: $fullname - $protocol/$extension su $server_ip <a href=\"#\" onclick=\"LogouT();return false;\">LOGOUT</a><BR>\n"; ?>
|
||||
</TD></TR>
|
||||
<TR VALIGN=TOP ALIGN=LEFT>
|
||||
<TD><A HREF="#" onclick="MainPanelToFront();"><IMG SRC="../agc/images/agc_tab_main.gif" ALT="Pannello Principale" WIDTH=83 HEIGHT=30 Border=0></A></TD>
|
||||
<TD><A HREF="#" onclick="ActiveLinesPanelToFront();"><IMG SRC="../agc/images/agc_tab_active_lines.gif" ALT="Pannello Linee Attive " WIDTH=139 HEIGHT=30 Border=0></A></TD>
|
||||
<TD><A HREF="#" onclick="ActiveLinesPanelToFront();"><IMG SRC="../agc/images/agc_tab_active_lines.gif" ALT="Pannello Linee Attive" WIDTH=139 HEIGHT=30 Border=0></A></TD>
|
||||
<TD><A HREF="#" onclick="ConfereNcesPanelToFront();"><IMG SRC="../agc/images/agc_tab_conferences.gif" ALT="Pannello Conferenze" WIDTH=139 HEIGHT=30 Border=0></A></TD>
|
||||
<TD><A HREF="#" onclick="SendCheckVoiceMail();"><IMG SRC="../agc/images/agc_check_voicemail_ON.gif" NAME=voicemail ALT="Controlla la Voicemail" WIDTH=170 HEIGHT=30 Border=0></A></TD>
|
||||
<TD><IMG SRC="../agc/images/agc_live_call_OFF.gif" NAME=livecall ALT="Chimate Attive" WIDTH=109 HEIGHT=30 Border=0></TD>
|
||||
<TD><A HREF="#" onclick="SendCheckVoiceMail();"><IMG SRC="../agc/images/agc_check_voicemail_ON.gif" NAME=voicemail ALT="Controlla Voicemail" WIDTH=170 HEIGHT=30 Border=0></A></TD>
|
||||
<TD><IMG SRC="../agc/images/agc_live_call_OFF.gif" NAME=livecall ALT="Chiamata in corso" WIDTH=109 HEIGHT=30 Border=0></TD>
|
||||
</TR></TABLE>
|
||||
</SPAN>
|
||||
|
||||
@@ -2732,59 +2732,59 @@ echo "</head>\n";
|
||||
</span>
|
||||
|
||||
<span style="position:absolute;left:0px;top:12px;z-index:29;" id="TrunkHangupBox">
|
||||
<table border=1 bgcolor="#CDE0C2" width=600 height=500><TR><TD> TRUNK ATTACCA <BR><BR>
|
||||
<table border=1 bgcolor="#CDE0C2" width=600 height=500><TR><TD> TRUNK RIAGGANCIA <BR><BR>
|
||||
<span id="TrunkHangupContent"> Active Trunks Menu </span><BR>
|
||||
<span id="TrunkHangup_HUlink"><a href="#" onclick="busyhangup_send_hangup('Trunk');return false;">Disconnetti il Trunk</a> | </span>
|
||||
<span id="TrunkHangup_HJlink"><a href="#" onclick="busyhangup_send_redirect('Trunk','HIJACK');return false;">Dirotta il Trunk</a> | </span>
|
||||
<span id="TrunkHangup_ZMlink"><a href="#" onclick="busyhangup_send_redirect('Trunk','LISTEN');return false;">Ascolta il Trunk</a> | </span>
|
||||
<a href="#" onclick="busytrunkhangup_force_refresh();return false;">Aggiorna</a> |
|
||||
<a href="#" onclick="hideTrunkHangup('TrunkHangupBox');">Tornate alla schermata principale</a>
|
||||
<a href="#" onclick="hideTrunkHangup('TrunkHangupBox');">Torna alla schermata principale</a>
|
||||
</TD></TR></TABLE>
|
||||
</span>
|
||||
|
||||
<span style="position:absolute;left:0px;top:12px;z-index:28;" id="LocalHangupBox">
|
||||
<table border=1 bgcolor="#CDE0C2" width=600 height=500><TR><TD> DISCONNETTI LOCALI <BR><BR>
|
||||
<table border=1 bgcolor="#CDE0C2" width=600 height=500><TR><TD> DISCONNETTI LOCALE <BR><BR>
|
||||
<span id="LocalHangupContent"> Menu Locale Attivo </span><BR>
|
||||
<span id="LocalHangup_HUlink"><a href="#" onclick="busyhangup_send_hangup('Local');return false;">Disconnetti locale</a> | </span>
|
||||
<span id="LocalHangup_HJlink"><a href="#" onclick="busyhangup_send_redirect('Local');return false;">Dirotta il Locale</a> | </span>
|
||||
<span id="LocalHangup_ZMlink"><a href="#" onclick="busyhangup_send_redirect('Local','LISTEN');return false;">Ascolta il locale</a> | </span>
|
||||
<span id="LocalHangup_HJlink"><a href="#" onclick="busyhangup_send_redirect('Local');return false;">Dirotta Locale</a> | </span>
|
||||
<span id="LocalHangup_ZMlink"><a href="#" onclick="busyhangup_send_redirect('Local','LISTEN');return false;">Ascolta Locale</a> | </span>
|
||||
<a href="#" onclick="busylocalhangup_force_refresh();return false;">Aggiorna</a> |
|
||||
<a href="#" onclick="hideLocalHangup('LocalHangupBox');">Tornate alla schermata principale</a>
|
||||
<a href="#" onclick="hideLocalHangup('LocalHangupBox');">Torna alla schermata principale</a>
|
||||
</TD></TR></TABLE>
|
||||
</span>
|
||||
|
||||
<span style="position:absolute;left:80px;top:12px;z-index:42;" id="MainXfeRBox">
|
||||
<input type=hidden name=H_XfeR_channel>
|
||||
<input type=hidden name=M_XfeR_channel>
|
||||
<table border=0 bgcolor="#FFFFCC" width=600 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> TRASFERIMENTO CHIAMATA ATTIVA</b> <BR>Canale trasferito: <span id="MainXfeRChanneL">Canale</span><BR></tr>
|
||||
<tr><td>Interni:<BR><span id="MainXfeRContent"> Menu degli Interni </span></td>
|
||||
<table border=0 bgcolor="#FFFFCC" width=600 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> TRASFERIMENTO DELLA CHIAMATA IN CORSO</b> <BR>Canale trasferito: <span id="MainXfeRChanneL">Canale</span><BR></tr>
|
||||
<tr><td>Interni:<BR><span id="MainXfeRContent"> Menu Interni </span></td>
|
||||
<td>
|
||||
<BR>
|
||||
<a href="#" onclick="mainxfer_send_redirect('XfeR');return false;">Invia all` interno selezionato</a> <BR><BR>
|
||||
<a href="#" onclick="mainxfer_send_redirect('XfeR');return false;">Invia all`interno selezionato</a> <BR><BR>
|
||||
<a href="#" onclick="mainxfer_send_redirect('VMAIL');return false;">Invia alla VoiceMail selezionata</a> <BR><BR>
|
||||
<a href="#" onclick="mainxfer_send_redirect('ENTRY');return false;">Invia a questo numero </a>:<BR><input type=text name=extension_xfer_entry size=20 maxlength=50> <BR><BR>
|
||||
<a href="#" onclick="mainxfer_send_redirect('ENTRY');return false;">Invia a questo numero</a>:<BR><input type=text name=extension_xfer_entry size=20 maxlength=50> <BR><BR>
|
||||
<a href="#" onclick="getactiveext('MainXfeRBox');return false;">Aggiorna</a> <BR><BR><BR>
|
||||
<a href="#" onclick="hideMainXfeR('MainXfeRBox');">Tornate alla schermata principale</a> <BR><BR>
|
||||
<a href="#" onclick="hideMainXfeR('MainXfeRBox');">Torna alla schermata principale</a> <BR><BR>
|
||||
</TD>
|
||||
<TD>Conferenze:<BR><font size=1>(Seleziona il numero sopra per inviarlo ad una conferenza)<BR><input type=checkbox name=MainXfeRconfXTRA size=1 value="1"> Invia anche il mio canale<div class="scroll_list" id="MainXfeRconfContent"> Menu Conferenza </div></td></TR></TABLE>
|
||||
<TD>Conferenze:<BR><font size=1>(Seleziona uno dei numeri sotto per inviarlo ad una conferenza)<BR><input type=checkbox name=MainXfeRconfXTRA size=1 value="1"> Invia anche il mio canale<div class="scroll_list" id="MainXfeRconfContent"> Menu Conferenze </div></td></TR></TABLE>
|
||||
</span>
|
||||
|
||||
<span style="position:absolute;left:80px;top:12px;z-index:43;" id="LocalDialBox">
|
||||
<table border=0 bgcolor="#FFFFCC" width=600 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> Chiamata Interni locali</b> <BR>Chiamata proveniente da: <span id="LocalDialChanneL">Canale</span><BR></tr>
|
||||
<tr><td>Interni:<BR><span id="LocalDialContent"> Menu degli Interni </span></td>
|
||||
<table border=0 bgcolor="#FFFFCC" width=600 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> LOCAL Interni Dial</b> <BR>Chiamata proveniente da: <span id="LocalDialChanneL">Canale</span><BR></tr>
|
||||
<tr><td>Interni:<BR><span id="LocalDialContent"> Menu Interni </span></td>
|
||||
<td>
|
||||
<BR>
|
||||
<a href="#" onclick="mainxfer_send_originate('DiaL','','');return false;">Chiama l` interno selezionato</a> <BR><BR>
|
||||
<a href="#" onclick="mainxfer_send_originate('VMAIL');return false;">Chiama la Voice Mail selezionata</a> <BR><BR>
|
||||
<a href="#" onclick="mainxfer_send_originate('DiaL','','');return false;">Chiama l`interno selezionato</a> <BR><BR>
|
||||
<a href="#" onclick="mainxfer_send_originate('VMAIL');return false;">Chiama la VoiceMail selezionata</a> <BR><BR>
|
||||
<a href="#" onclick="getactiveext('LocalDialBox');return false;">Aggiorna</a> <BR><BR><BR>
|
||||
<a href="#" onclick="hideLocalDial('LocalDialBox');">Tornate alla schermata principale</a> <BR><BR>
|
||||
<a href="#" onclick="hideLocalDial('LocalDialBox');">Torna alla schermata principale</a> <BR><BR>
|
||||
</TD>
|
||||
<TD></td></TR></TABLE>
|
||||
</span>
|
||||
|
||||
<span style="position:absolute;left:40px;top:12px;z-index:41;" id="ParkDisplayBox">
|
||||
<table border=0 bgcolor="#FFFFCC" width=640 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> CHIAMATE PARCHEGGIATE:</b> <div class="scroll_park" id="ParkDisplayContents"></div>
|
||||
<a href="#" onclick="hideParkDisplay('ParkDisplayBox');">Tornate alla schermata principale</a> <BR><BR>
|
||||
<table border=0 bgcolor="#FFFFCC" width=640 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> CHIAMATE IN ATTESA:</b> <div class="scroll_park" id="ParkDisplayContents"></div>
|
||||
<a href="#" onclick="hideParkDisplay('ParkDisplayBox');">Torna alla schermata principale</a> <BR><BR>
|
||||
</td></TR></TABLE>
|
||||
</span>
|
||||
|
||||
@@ -2794,19 +2794,19 @@ echo "</head>\n";
|
||||
</TD></TR>
|
||||
<tr><td><span id="busycallsspan"></span></td></tr>
|
||||
<tr><td><span id="busycallsdebug"></span></td></tr>
|
||||
<tr><td align=center><font face="Arial,Helvetica"><B>VOICEMAIL </B></font> NUOVO: <span id="new_vmail_span"></span> VECCHIO: <span id="old_vmail_span"></span> <font face="Arial,Helvetica"><B>Chiamata Manuale </B></font><input TYPE=TEXT SIZE=20 NAME=manual_dial STYLE="font-family : sans-serif; font-size : 10px"> <A HREF="#" onclick="SendManualDial();">CHIAMA</A></td></tr>
|
||||
<tr><td align=center><font face="Arial,Helvetica"><B>VOICEMAIL </B></font> NUOVO: <span id="new_vmail_span"></span> VECCHIO: <span id="old_vmail_span"></span> <font face="Arial,Helvetica"><B>CHIAMATA MANUALE </B></font><input TYPE=TEXT SIZE=20 NAME=manual_dial STYLE="font-family : sans-serif; font-size : 10px"> <A HREF="#" onclick="SendManualDial();">DIAL</A></td></tr>
|
||||
|
||||
<tr><td align=center><a href="#" onclick="showParkDisplay('ParkDisplayBox');return false;"><font face="Arial,Helvetica"><B>CHIAMATE PARCHEGGIATE</B></a>: <span id="parked_calls_count">0</span> <a href="#" onclick="showLocalDial('LocalDialBox');return false;"><font face="Arial,Helvetica"><B>INTERNI DI CHIAMATA LOCALE</a></td></tr>
|
||||
<tr><td align=center><a href="#" onclick="showParkDisplay('ParkDisplayBox');return false;"><font face="Arial,Helvetica"><B>CHIAMATE IN ATTESA</B></a>: <span id="parked_calls_count">0</span> <a href="#" onclick="showLocalDial('LocalDialBox');return false;"><font face="Arial,Helvetica"><B>LOCAL CHIAMA EXTENSIONS</a></td></tr>
|
||||
|
||||
<tr><td align=center><font face="Arial,Helvetica"><B>CHIAMATE OUTBOUND:</B></font></td></tr>
|
||||
<tr><td align=center><div class="scroll_log" id="outboundcallsspan"></div></td></tr>
|
||||
<tr><td align=center><font face="Arial,Helvetica"><B>CHIAMATE INBOUND:</B></font></td></tr>
|
||||
<tr><td align=center><div class="scroll_log" id="inboundcallsspan"></div></td></tr>
|
||||
<tr><td align=left><font face="Arial,Helvetica" size=1>VERSIONEE web del astGUIclient:<? echo $version ?> CONFIGURAZIONE:<? echo $build ?></font></td></tr>
|
||||
<tr><td align=left><font face="Arial,Helvetica" size=1>Versione di astGUIclient web-client:<? echo $version ?> BUILD:<? echo $build ?></font></td></tr>
|
||||
</TABLE>
|
||||
|
||||
<span style="position:absolute;left:640px;top:0px;z-index:33;" id="FavoriteSBox">
|
||||
<table border=0 bgcolor="#DDDDFF" width=200 height=400 cellpadding=2 ALIGN=TOP><TR><TD align=center><span id="FavoriteSContent"><font class="sh_text"> FAVORITI</font><font class="sb_text"> <a href="#" onclick="favorites_editor('BuilD');return false;"> modifica</a></span></TD></TR>
|
||||
<table border=0 bgcolor="#DDDDFF" width=200 height=400 cellpadding=2 ALIGN=TOP><TR><TD align=center><span id="FavoriteSContent"><font class="sh_text"> PREFERITI</font><font class="sb_text"> <a href="#" onclick="favorites_editor('BuilD');return false;"> modifica</a></span></TD></TR>
|
||||
<?
|
||||
$h=0;
|
||||
while ($favorites_count > $h)
|
||||
@@ -2824,10 +2824,10 @@ echo "</head>\n";
|
||||
|
||||
|
||||
<span style="position:absolute;left:5px;top:5px;z-index:34;" id="FavoriteSEdiT">
|
||||
<table border=0 bgcolor="#DDDDFF" width=800 height=450 cellpadding=2 ALIGN=TOP><TR HEIGHT=95%><TD align=center HEIGHT=95%><span id="FavoriteSEditContent"> FAVORITI</span></TD></TR>
|
||||
<table border=0 bgcolor="#DDDDFF" width=800 height=450 cellpadding=2 ALIGN=TOP><TR HEIGHT=95%><TD align=center HEIGHT=95%><span id="FavoriteSEditContent"> PREFERITI</span></TD></TR>
|
||||
<TR><TD ALIGN=CENTER><BR> </TD></TR>
|
||||
<TR VALIGN=BOTTOM><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#FFFFCC"><a href="#" onclick="SubmiT_FavoritE_ChangEs();return false;">SALVA I CAMBIAMENTI - richiede Logout</a></TD></TR>
|
||||
<TR VALIGN=BOTTOM><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#FFFFCC"><a href="#" onclick="hideDiv('FavoriteSEdiT');return false;">TORNA SCHERMATA PRECEDENTE- ignora i cambiamenti fatti</a></TD></TR>
|
||||
<TR VALIGN=BOTTOM><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#FFFFCC"><a href="#" onclick="SubmiT_FavoritE_ChangEs();return false;">SALVA I CAMBIAMENTI AI PREFERITI - richiede Logout</a></TD></TR>
|
||||
<TR VALIGN=BOTTOM><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#FFFFCC"><a href="#" onclick="hideDiv('FavoriteSEdiT');return false;">TORNA ALLA SCHERMATA PRECEDENTE- ignora i cambiamenti fatti</a></TD></TR>
|
||||
</TABLE>
|
||||
</span>
|
||||
|
||||
@@ -2837,7 +2837,7 @@ echo "</head>\n";
|
||||
<span style="position:absolute;left:0px;top:46px;z-index:20;" id="ActiveLinesPanel">
|
||||
<table border=0 BGCOLOR="#CDE0C2" width=640>
|
||||
<tr><td colspan=3>
|
||||
<a href="#" onclick="pause();return false;">PAUSA</a> | <a href="#" onclick="start();return false;">INIZIO</a> Aggiorna i tempi: <span id="refresh_rate">1000 ms</span> <a href="#" onclick="faster();return false;">Più velocemente</a> | <a href="#" onclick="slower();return false;">Più lento</a></p>
|
||||
<a href="#" onclick="pause();return false;">ARRESTO</a> | <a href="#" onclick="start();return false;">INIZIO</a> Frequenza di refresh: <span id="refresh_rate">1000 ms</span> <a href="#" onclick="faster();return false;">Piu` veloce</a> | <a href="#" onclick="slower();return false;">Piu` lento</a></p>
|
||||
<div id="status"><em>Inizializzazione..</em></div>
|
||||
</td></tr>
|
||||
<tr><td>Interni Attivi <BR>
|
||||
@@ -2856,11 +2856,11 @@ echo "</head>\n";
|
||||
</td></tr>
|
||||
|
||||
<tr><td VALIGN=TOP>
|
||||
<span id="activeext"><em>I Dati vanno inseriti qui</em></span><BR><BR>
|
||||
<span id="activeext"><em>I Dati vanno qui</em></span><BR><BR>
|
||||
</td><td VALIGN=TOP>
|
||||
<span id="busytrunk"><em>I Dati vanno inseriti qui</em></span><BR><BR><span id="TrunkHangupLink"><a href="#" onclick="showTrunkHangup('TrunkHangupBox');return false;">Azione Del Trunk</a></span>
|
||||
<span id="busytrunk"><em>I Dati vanno qui</em></span><BR><BR><span id="TrunkHangupLink"><a href="#" onclick="showTrunkHangup('TrunkHangupBox');return false;">Azione Trunk</a></span>
|
||||
</td><td VALIGN=TOP>
|
||||
<span id="busyext"><em>I Dati vanno inseriti qui</em></span><BR><BR><span id="LocalHangupLink"><a href="#" onclick="showLocalHangup('LocalHangupBox');return false;">Azione Locale</a></span>
|
||||
<span id="busyext"><em>I Dati vanno qui</em></span><BR><BR><span id="LocalHangupLink"><a href="#" onclick="showLocalHangup('LocalHangupBox');return false;">Azione Locale</a></span>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
@@ -2877,7 +2877,7 @@ echo "</head>\n";
|
||||
|
||||
<span style="position:absolute;left:140px;top:0px;z-index:32;color:black;width:500;" id="ConfereNceHeaderSpan">
|
||||
<span id="ConfereNceHeaderContent"> </span><BR>
|
||||
<span style="width:540;height:400;" id="ConfereNceDetailContent">Seleziona una stanza sulla sinistra per informazioni sulla conferenza </span>
|
||||
<span style="width:540;height:400;" id="ConfereNceDetailContent">Fai click su una delle conferenze room sulla sinistra per avere informazioni a riguardo </span>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<?
|
||||
### call_log_display.php
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
### This script is designed purely to send the inbound and outbound calls for a specific phone
|
||||
### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
###
|
||||
### required variables:
|
||||
### - $server_ip
|
||||
### - $session_name
|
||||
### - $user
|
||||
### - $pass
|
||||
### optional variables:
|
||||
### - $format - ('text','debug')
|
||||
### - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
### - $protocol - ('SIP','Zap','IAX2',...)
|
||||
### - $in_limit - ('10','20','50','100',...)
|
||||
### - $out_limit - ('10','20','50','100',...)
|
||||
###
|
||||
|
||||
# call_log_display.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to send the inbound and outbound calls for a specific phone
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
# - $protocol - ('SIP','Zap','IAX2',...)
|
||||
# - $in_limit - ('10','20','50','100',...)
|
||||
# - $out_limit - ('10','20','50','100',...)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50406-1013 - First build of script
|
||||
# 50407-1452 - Added definable limits
|
||||
@@ -73,7 +73,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Non valido Utentename/Parola d`accesso: |$user|$pass|\n";
|
||||
echo "Utentename/Password non validi: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -81,7 +81,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n";
|
||||
echo "ip del server non valido: |$server_ip| or Nome sessione non valido: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -93,7 +93,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Non valido session_name: |$session_name|$server_ip|\n";
|
||||
echo "Nome sessione non valido: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -107,8 +107,8 @@ if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSIONE: $version CONFIGURAZIONE: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Visualizza il Call Log";
|
||||
echo "<!-- VERSIONE: $version BUILD: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Visualizza il Log della chiamata";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -120,7 +120,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
if ( (strlen($exten)<1) or (strlen($protocol)<3) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Exten $exten non è valido o protocollo $protocol non è valido\n";
|
||||
echo "Exten $exten non e` valido o protocollo $protocol non e` valido\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -187,7 +187,7 @@ if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- tempo di esecuzione dello script: $RUNtime secondi -->";
|
||||
echo "\n<!-- script runtime: $RUNtime secondi -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?
|
||||
# conf_exten_check.php
|
||||
# conf_exten_check.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to send whether the meetme conference has live channels connected and which they are
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
@@ -35,6 +35,9 @@
|
||||
# 61128-2255 - Added update for manual dial vicidial_live_agents
|
||||
# 70319-1542 - Added agent disabled display function
|
||||
# 71122-0205 - Added vicidial_live_agent status output
|
||||
# 80424-0442 - Added non_latin lookup from system_settings
|
||||
# 80519-1425 - Added calls-in-queue tally
|
||||
# 80703-1106 - Added API functionality for Hangup and Dispo
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -63,14 +66,42 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"
|
||||
if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];}
|
||||
elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];}
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
|
||||
}
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($format)) {$format="text";}
|
||||
if (!isset($ACTION)) {$ACTION="refresh";}
|
||||
if (!isset($client)) {$client="agc";}
|
||||
|
||||
$Alogin='N';
|
||||
$RingCalls='N';
|
||||
$DiaLCalls='N';
|
||||
|
||||
$version = '2.0.4-12';
|
||||
$build = '71122-0205';
|
||||
$StarTtime = date("U");
|
||||
@@ -81,15 +112,16 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
$random = (rand(1000000, 9999999) + 10000000);
|
||||
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Non valido Utentename/Parola d`accesso: |$user|$pass|\n";
|
||||
echo "Utentename/Password non validi: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -97,7 +129,7 @@ $random = (rand(1000000, 9999999) + 10000000);
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n";
|
||||
echo "ip del server non valido: |$server_ip| or Nome sessione non valido: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -109,7 +141,7 @@ $random = (rand(1000000, 9999999) + 10000000);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Non valido session_name: |$session_name|$server_ip|\n";
|
||||
echo "Nome sessione non valido: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -123,8 +155,8 @@ if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSIONE: $version CONFIGURAZIONE: $build MEETME: $conf_exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Controllo interni della conferenza";
|
||||
echo "<!-- VERSIONE: $version BUILD: $build MEETME: $conf_exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Conf Extension Check";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -138,7 +170,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
if (strlen($conf_exten)<1)
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Conf Exten $conf_exten non è valido\n";
|
||||
echo "Conf Exten $conf_exten non e` valido\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -181,30 +213,45 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
if ($campagentstdisp == 'YES')
|
||||
{
|
||||
### grab the status of this agent to display
|
||||
$stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
$stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Alogin=$row[0];
|
||||
$Acampaign=$row[1];
|
||||
$AccampSQL=$row[2];
|
||||
$AccampSQL = ereg_replace(' -','', $AccampSQL);
|
||||
$AccampSQL = ereg_replace(' ',"','", $AccampSQL);
|
||||
|
||||
### grab the number of calls being placed from this server and campaign
|
||||
$stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';";
|
||||
$stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$RingCalls=$row[0];
|
||||
if ($RingCalls > 0) {$RingCalls = "<font class=\"queue_text_red\">Calls in Queue: $RingCalls</font>";}
|
||||
else {$RingCalls = "<font class=\"queue_text\">Calls in Queue: $RingCalls</font>";}
|
||||
|
||||
### grab the number of calls being placed from this server and campaign
|
||||
$stmt="SELECT count(*) from vicidial_auto_calls where status NOT IN('XFER') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DiaLCalls=$row[0];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$Alogin='N';
|
||||
$RingCalls='N';
|
||||
$DiaLCalls='N';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$Alogin='N';
|
||||
$RingCalls='N';
|
||||
$DiaLCalls='N';
|
||||
|
||||
### update the vicidial_live_agents every second with a new random number so it is shown to be alive
|
||||
$stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';";
|
||||
@@ -213,10 +260,19 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
|
||||
}
|
||||
|
||||
### grab the API hangup and API dispo fields in vicidial_live_agents
|
||||
$stmt="SELECT external_hangup,external_status from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$external_hangup = $row[0];
|
||||
$external_status = $row[1];
|
||||
if (strlen($external_status)<1) {$external_status = '::::::::::';}
|
||||
|
||||
if ($Acount < 1) {$Alogin='DEAD_VLA';}
|
||||
if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';}
|
||||
|
||||
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n";
|
||||
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Stato: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . "|\n";
|
||||
|
||||
}
|
||||
$total_conf=0;
|
||||
@@ -270,7 +326,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
if ( (strlen($conf_exten)<1) || (strlen($exten)<1) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Conf Exten $conf_exten non è valido or Exten $exten non è valido\n";
|
||||
echo "Conf Exten $conf_exten non e` valido or Exten $exten non e` valido\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -279,7 +335,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
echo "Conferenza $conf_exten è stato registrato $exten\n";
|
||||
echo "Conferenza $conf_exten e` stato registrato su $exten\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +344,7 @@ if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- tempo di esecuzione dello script: $RUNtime secondi -->";
|
||||
echo "\n<!-- script runtime: $RUNtime secondi -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<?
|
||||
#
|
||||
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
# dbconnect.php version 2.0.5
|
||||
#
|
||||
# database connection settings and some global web settings
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
if ( file_exists("/etc/astguiclient.conf") )
|
||||
{
|
||||
@@ -36,7 +40,10 @@ $WeBServeRRooT = '/usr/local/apache2/htdocs';
|
||||
}
|
||||
|
||||
$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass");
|
||||
mysql_select_db("$VARDB_database");
|
||||
if (!$link) {
|
||||
die('MySQL connect ERROR: ' . mysql_error());
|
||||
}
|
||||
mysql_select_db("$VARDB_database",$link);
|
||||
|
||||
$local_DEF = 'Local/';
|
||||
$conf_silent_prefix = '7';
|
||||
@@ -44,5 +51,8 @@ $local_AMP = '@';
|
||||
$ext_context = 'demo';
|
||||
$recording_exten = '8309';
|
||||
$WeBRooTWritablE = '1';
|
||||
$non_latin = '0'; # set to 1 for UTF rules, overridden by system_settings
|
||||
$flag_channels=0;
|
||||
$flag_string = 'VICIast20';
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
<?
|
||||
### inbound_popup.php
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
### This script is designed to open up when a live_inbound call comes in giving the user
|
||||
### options of what to do with the call or options to lookup the callerID on various web sites
|
||||
### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
###
|
||||
### required variables:
|
||||
### - $server_ip
|
||||
### - $session_name
|
||||
### - $uniqueid - ('1234567890.123456',...)
|
||||
### - $user
|
||||
### - $pass
|
||||
### optional variables:
|
||||
### - $format - ('text','debug')
|
||||
### - $vmail_box - ('101','1234',...)
|
||||
### - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
### - $ext_context - ('default','demo',...)
|
||||
### - $ext_priority - ('1','2',...)
|
||||
### - $voicemail_dump_exten - ('85026666666666')
|
||||
### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL)
|
||||
###
|
||||
|
||||
# inbound_popup.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to open up when a live_inbound call comes in giving the user
|
||||
# options of what to do with the call or options to lookup the callerID on various web sites
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $uniqueid - ('1234567890.123456',...)
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $vmail_box - ('101','1234',...)
|
||||
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
# - $ext_context - ('default','demo',...)
|
||||
# - $ext_priority - ('1','2',...)
|
||||
# - $voicemail_dump_exten - ('85026666666666')
|
||||
# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50428-1500 - First build of script display only
|
||||
# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links
|
||||
@@ -85,7 +85,7 @@ if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Non valido Utentename/Parola d`accesso: |$user|$pass|\n";
|
||||
echo "Utentename/Password non validi: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -93,7 +93,7 @@ if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n";
|
||||
echo "ip del server non valido: |$server_ip| or Nome sessione non valido: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -105,7 +105,7 @@ if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Non valido session_name: |$session_name|$server_ip|\n";
|
||||
echo "Nome sessione non valido: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -124,7 +124,7 @@ while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
|
||||
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSIONE: $version CONFIGURAZIONE: $build UNIQUEID: $uniqueid server_ip: $server_ip-->\n";
|
||||
echo "<!-- VERSIONE: $version BUILD: $build UNIQUEID: $uniqueid server_ip: $server_ip-->\n";
|
||||
?>
|
||||
<script language="Javascript">
|
||||
var server_ip = '<? echo $server_ip ?>';
|
||||
@@ -250,11 +250,11 @@ echo "<!-- VERSIONE: $version CONFIGURAZIONE: $build UNIQUEID: $uniqueid
|
||||
</script>
|
||||
|
||||
<?
|
||||
echo "<title>CHIAMATA INBOUND ATTIVA";
|
||||
echo "<title>CHIAMATA INBOUND IN CORSO";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=\"#CCC2E0\" marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onload=\"link_timeout();\">\n";
|
||||
echo "<CENTER><H2>CHIAMATA INBOUND ATTIVA</H2>\n";
|
||||
echo "<CENTER><H2>CHIAMATA INBOUND IN CORSO</H2>\n";
|
||||
echo "<B>$NOW_TIME</B><BR><BR>\n";
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ echo "<B>$NOW_TIME</B><BR><BR>\n";
|
||||
if (strlen($uniqueid)<9)
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Uniqueid $uniqueid non è valido\n";
|
||||
echo "Uniqueid $uniqueid non e` valido\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -321,8 +321,8 @@ echo "<B>$NOW_TIME</B><BR><BR>\n";
|
||||
echo "<tr bgcolor=\"#DDDDFF\"><td>Numero chiamato: </td><td align=left>$row[8]</td></tr>\n";
|
||||
echo "<tr bgcolor=\"#DDDDFF\"><td>Note: </td><td align=left>$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|</td></tr>\n";
|
||||
echo "<tr bgcolor=\"#DDDDFF\"><td colspan=2 align=center>\n<span id=\"callactions\">";
|
||||
echo "<a href=\"#\" onclick=\"livehangup_send_hangup('$row[1]');return false;\">ATTACCA</a> - \n";
|
||||
echo "<a href=\"#\" onclick=\"liveredirect_send_vmail('$row[1]','$vmail_box');return false;\">INVIA AL MIO VOICEMAIL</a>\n";
|
||||
echo "<a href=\"#\" onclick=\"livehangup_send_hangup('$row[1]');return false;\">RIAGGANCIA</a> - \n";
|
||||
echo "<a href=\"#\" onclick=\"liveredirect_send_vmail('$row[1]','$vmail_box');return false;\">INVIA ALLA MIA VOICEMAIL</a>\n";
|
||||
echo "</span></td></tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
@@ -342,7 +342,7 @@ if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- tempo di esecuzione dello script: $RUNtime secondi -->";
|
||||
echo "\n<!-- script runtime: $RUNtime secondi -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<?
|
||||
### live_exten_check.php
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
### This script is designed purely to send whether the client channel is live and to what channel it is connected
|
||||
### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
###
|
||||
### required variables:
|
||||
### - $server_ip
|
||||
### - $session_name
|
||||
### - $user
|
||||
### - $pass
|
||||
### optional variables:
|
||||
### - $format - ('text','debug')
|
||||
### - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
### - $protocol - ('SIP','Zap','IAX2',...)
|
||||
###
|
||||
|
||||
# live_exten_check.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to send whether the client channel is live and to what channel it is connected
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
# - $protocol - ('SIP','Zap','IAX2',...)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50404-1249 - First build of script
|
||||
# 50406-1402 - added connected trunk lookup
|
||||
@@ -74,7 +74,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Non valido Utentename/Parola d`accesso: |$user|$pass|\n";
|
||||
echo "Utentename/Password non validi: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -82,7 +82,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n";
|
||||
echo "ip del server non valido: |$server_ip| or Nome sessione non valido: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -94,7 +94,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Non valido session_name: |$session_name|$server_ip|\n";
|
||||
echo "Nome sessione non valido: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -108,8 +108,8 @@ if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSIONE: $version CONFIGURAZIONE: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Controllo Interni Attivi ";
|
||||
echo "<!-- VERSIONE: $version BUILD: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Controllo Interni Attivi";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -131,7 +131,7 @@ echo "$row[0]|";
|
||||
if ( (strlen($exten)<1) or (strlen($protocol)<3) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Exten $exten non è valido o protocollo $protocol non è valido\n";
|
||||
echo "Exten $exten non e` valido o protocollo $protocol non e` valido\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -269,7 +269,7 @@ if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- tempo di esecuzione dello script: $RUNtime secondi -->";
|
||||
echo "\n<!-- script runtime: $RUNtime secondi -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
|
||||
+826
-189
File diff suppressed because it is too large
Load Diff
@@ -1,22 +1,22 @@
|
||||
<?
|
||||
### park_calls_display.php
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
### This script is designed purely to send the details on the parked calls on the server
|
||||
### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
###
|
||||
### required variables:
|
||||
### - $server_ip
|
||||
### - $session_name
|
||||
### - $user
|
||||
### - $pass
|
||||
### optional variables:
|
||||
### - $format - ('text','debug')
|
||||
### - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
### - $protocol - ('SIP','Zap','IAX2',...)
|
||||
###
|
||||
|
||||
# park_calls_display.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to send the details on the parked calls on the server
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
# - $protocol - ('SIP','Zap','IAX2',...)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50524-1515 - First build of script
|
||||
# 50711-1208 - removed HTTP authentication in favor of user/pass vars
|
||||
@@ -64,14 +64,14 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) )
|
||||
{
|
||||
echo "Non valido Utentename/Parola d`accesso: |$user|$pass|\n";
|
||||
echo "Utentename/Password non validi: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) {
|
||||
echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n";
|
||||
echo "ip del server non valido: |$server_ip| or Nome sessione non valido: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -83,7 +83,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Non valido session_name: |$session_name|$server_ip|\n";
|
||||
echo "Nome sessione non valido: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -97,8 +97,8 @@ if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSIONE: $version CONFIGURAZIONE: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Display Chiamate Parcheggiate";
|
||||
echo "<!-- VERSIONE: $version BUILD: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Display Chiamate in Attesa";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -110,7 +110,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
if ( (strlen($exten)<1) or (strlen($protocol)<3) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Exten $exten non è valido o protocollo $protocol non è valido\n";
|
||||
echo "Exten $exten non e` valido o protocollo $protocol non e` valido\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -137,7 +137,7 @@ if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- tempo di esecuzione dello script: $RUNtime secondi -->";
|
||||
echo "\n<!-- script runtime: $RUNtime secondi -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
|
||||
+863
-235
File diff suppressed because it is too large
Load Diff
+1480
-514
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,21 @@
|
||||
<?
|
||||
### voicemail_check.php
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
### This script is designed purely to check whether the voicemail box on the server defined has new and old messages
|
||||
### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
###
|
||||
### required variables:
|
||||
### - $server_ip
|
||||
### - $session_name
|
||||
### - $user
|
||||
### - $pass
|
||||
### optional variables:
|
||||
### - $format - ('text','debug')
|
||||
### - $vmail_box - ('101','1234',...)
|
||||
###
|
||||
|
||||
# voicemail_check.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to check whether the voicemail box on the server defined has new and old messages
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $vmail_box - ('101','1234',...)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50422-1147 - First build of script
|
||||
# 50503-1241 - added session_name checking for extra security
|
||||
@@ -61,7 +61,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Non valido Utentename/Parola d`accesso: |$user|$pass|\n";
|
||||
echo "Utentename/Password non validi: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -69,7 +69,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n";
|
||||
echo "ip del server non valido: |$server_ip| or Nome sessione non valido: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -81,7 +81,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Non valido session_name: |$session_name|$server_ip|\n";
|
||||
echo "Nome sessione non valido: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -95,7 +95,7 @@ if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSIONE: $version CONFIGURAZIONE: $build VMBOX: $vmail_box server_ip: $server_ip-->\n";
|
||||
echo "<!-- VERSIONE: $version BUILD: $build VMBOX: $vmail_box server_ip: $server_ip-->\n";
|
||||
echo "<title>Controllo Voicemail";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
@@ -107,7 +107,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
if (strlen($vmail_box)<1)
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Casella del voicemail $vmail_box non è valido\n";
|
||||
echo "Casella Voicemail $vmail_box non e` valido\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -131,7 +131,7 @@ if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- tempo di esecuzione dello script: $RUNtime secondi -->";
|
||||
echo "\n<!-- script runtime: $RUNtime secondi -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,482 @@
|
||||
<?
|
||||
# active_list_refresh.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to serve updates of the live data to the display scripts
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $ADD - ('1','2','3','4','5')
|
||||
# - $order - ('asc','desc')
|
||||
# - $format - ('text','table','menu','selectlist','textarea')
|
||||
# - $bgcolor - ('#123456','white','black','etc...')
|
||||
# - $txtcolor - ('#654321','black','white','etc...')
|
||||
# - $txtsize - ('1','2','3','etc...')
|
||||
# - $selectsize - ('2','3','4','etc...')
|
||||
# - $selectfontsize - ('8','10','12','etc...')
|
||||
# - $selectedext - ('cc100')
|
||||
# - $selectedtrunk - ('Zap/25-1')
|
||||
# - $selectedlocal - ('SIP/cc100')
|
||||
# - $textareaheight - ('8','10','12','etc...')
|
||||
# - $textareawidth - ('8','10','12','etc...')
|
||||
# - $field_name - ('extension','busyext','extension_xfer','etc...')
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50323-1147 - First build of script
|
||||
# 50401-1132 - small formatting changes
|
||||
# 50502-1402 - added field_name as modifiable variable
|
||||
# 50503-1213 - added session_name checking for extra security
|
||||
# 50503-1311 - added conferences list
|
||||
# 50610-1155 - Added NULL check on MySQL results to reduced errors
|
||||
# 50711-1209 - removed HTTP authentication in favor of user/pass vars
|
||||
# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60619-1118 - Added variable filters to close security holes for login form
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
### If you have globals turned off uncomment these lines
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
|
||||
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
|
||||
if (isset($_GET["format"])) {$format=$_GET["format"];}
|
||||
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
|
||||
if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];}
|
||||
elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];}
|
||||
if (isset($_GET["order"])) {$order=$_GET["order"];}
|
||||
elseif (isset($_POST["order"])) {$order=$_POST["order"];}
|
||||
if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];}
|
||||
elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];}
|
||||
if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];}
|
||||
elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];}
|
||||
if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];}
|
||||
elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];}
|
||||
if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];}
|
||||
elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];}
|
||||
if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];}
|
||||
elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];}
|
||||
if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];}
|
||||
elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];}
|
||||
if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];}
|
||||
elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];}
|
||||
if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];}
|
||||
elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];}
|
||||
if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];}
|
||||
elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];}
|
||||
if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];}
|
||||
elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];}
|
||||
if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];}
|
||||
elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];}
|
||||
|
||||
### security strip all non-alphanumeric characters out of the variables ###
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
|
||||
$ADD=ereg_replace("[^0-9]","",$ADD);
|
||||
$order=ereg_replace("[^0-9a-zA-Z]","",$order);
|
||||
$format=ereg_replace("[^0-9a-zA-Z]","",$format);
|
||||
$bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor);
|
||||
$txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor);
|
||||
$txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize);
|
||||
$selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize);
|
||||
$selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize);
|
||||
$selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext);
|
||||
$selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk);
|
||||
$selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal);
|
||||
$textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight);
|
||||
$textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth);
|
||||
$field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name);
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($ADD)) {$ADD="1";}
|
||||
if (!isset($order)) {$order='desc';}
|
||||
if (!isset($format)) {$format="text";}
|
||||
if (!isset($bgcolor)) {$bgcolor='white';}
|
||||
if (!isset($txtcolor)) {$txtcolor='black';}
|
||||
if (!isset($txtsize)) {$txtsize='2';}
|
||||
if (!isset($selectsize)) {$selectsize='4';}
|
||||
if (!isset($selectfontsize)) {$selectfontsize='10';}
|
||||
if (!isset($textareaheight)) {$textareaheight='10';}
|
||||
if (!isset($textareawidth)) {$textareawidth='20';}
|
||||
|
||||
$version = '0.0.8';
|
||||
$build = '60619-1118';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Nesprávny Užívateľské meno/Heslo: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Nesprávny server_ip: |$server_ip| or Nesprávny session_name: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Nesprávny session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='table')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERZIA: $version POSTAVENÉ: $build ADD: $ADD server_ip: $server_ip-->\n";
|
||||
echo "<title>Zobraziť zoznamy: ";
|
||||
if ($ADD==1) {echo "Aktívne pobočky";}
|
||||
if ($ADD==2) {echo "Obsadené pobočky";}
|
||||
if ($ADD==3) {echo "Vonkajšie linky";}
|
||||
if ($ADD==4) {echo "Lokálne pobočky";}
|
||||
if ($ADD==5) {echo "Konferencie";}
|
||||
if ($ADD==99999) {echo "POMOC";}
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=1 display all live extensions on a server
|
||||
######################
|
||||
if ($ADD==1)
|
||||
{
|
||||
$pt='pt';
|
||||
if (!$field_name) {$field_name = 'extension';}
|
||||
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
|
||||
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
|
||||
if ($format=='selectlist')
|
||||
{
|
||||
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
|
||||
}
|
||||
if ($format=='textarea')
|
||||
{
|
||||
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
|
||||
}
|
||||
|
||||
$stmt="SELECT extension,fullname FROM phones where server_ip = '$server_ip' order by extension $order";
|
||||
if ($format=='table') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$phones_to_print = mysql_num_rows($rslt);}
|
||||
$o=0;
|
||||
while ($phones_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($format=='table')
|
||||
{
|
||||
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</TD></TR>\n";
|
||||
}
|
||||
if ( ($format=='text') or ($format=='textarea') )
|
||||
{
|
||||
echo "$row[0] - $row[1]\n";
|
||||
}
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedext") {echo "SELECTED ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</OPTION>\n";
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
|
||||
if ($format=='table') {echo "</TABLE>\n";}
|
||||
if ($format=='menu') {echo "</SELECT>\n";}
|
||||
if ($format=='selectlist') {echo "</SELECT>\n";}
|
||||
if ($format=='textarea') {echo "</TEXTAREA>\n";}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=2 display all busy extensions on a server
|
||||
######################
|
||||
if ($ADD==2)
|
||||
{
|
||||
if (!$field_name) {$field_name = 'busyext';}
|
||||
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
|
||||
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
|
||||
if ($format=='selectlist')
|
||||
{
|
||||
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
|
||||
}
|
||||
if ($format=='textarea')
|
||||
{
|
||||
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
|
||||
}
|
||||
|
||||
$stmt="SELECT extension FROM live_channels where server_ip = '$server_ip' order by extension $order";
|
||||
if ($format=='table') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$busys_to_print = mysql_num_rows($rslt);}
|
||||
$o=0;
|
||||
while ($busys_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($format=='table')
|
||||
{
|
||||
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
|
||||
echo "$row[0]";
|
||||
echo "</TD></TR>\n";
|
||||
}
|
||||
if ( ($format=='text') or ($format=='textarea') )
|
||||
{
|
||||
echo "$row[0]\n";
|
||||
}
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedext") {echo "SELECTED ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0]";
|
||||
echo "</OPTION>\n";
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
|
||||
if ($format=='table') {echo "</TABLE>\n";}
|
||||
if ($format=='menu') {echo "</SELECT>\n";}
|
||||
if ($format=='selectlist') {echo "</SELECT>\n";}
|
||||
if ($format=='textarea') {echo "</TEXTAREA>\n";}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=3 display all busy outside lines(trunks) on a server
|
||||
######################
|
||||
if ($ADD==3)
|
||||
{
|
||||
if (!$field_name) {$field_name = 'trunk';}
|
||||
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
|
||||
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
|
||||
if ($format=='selectlist')
|
||||
{
|
||||
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
|
||||
}
|
||||
if ($format=='textarea')
|
||||
{
|
||||
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
|
||||
}
|
||||
|
||||
$stmt="SELECT channel, extension FROM live_channels where server_ip = '$server_ip' order by channel $order";
|
||||
if ($format=='table') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$busys_to_print = mysql_num_rows($rslt);}
|
||||
$o=0;
|
||||
while ($busys_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($format=='table')
|
||||
{
|
||||
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</TD></TR>\n";
|
||||
}
|
||||
if ( ($format=='text') or ($format=='textarea') )
|
||||
{
|
||||
echo "$row[0] - $row[1]\n";
|
||||
}
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedtrunk") {echo "SELECTED ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</OPTION>\n";
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
|
||||
if ($format=='table') {echo "</TABLE>\n";}
|
||||
if ($format=='menu') {echo "</SELECT>\n";}
|
||||
if ($format=='selectlist') {echo "</SELECT>\n";}
|
||||
if ($format=='textarea') {echo "</TEXTAREA>\n";}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=4 display all busy Local lines on a server
|
||||
######################
|
||||
if ($ADD==4)
|
||||
{
|
||||
if (!$field_name) {$field_name = 'local';}
|
||||
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
|
||||
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
|
||||
if ($format=='selectlist')
|
||||
{
|
||||
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
|
||||
}
|
||||
if ($format=='textarea')
|
||||
{
|
||||
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
|
||||
}
|
||||
|
||||
$stmt="SELECT channel, extension FROM live_sip_channels where server_ip = '$server_ip' order by channel $order";
|
||||
if ($format=='table') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$busys_to_print = mysql_num_rows($rslt);}
|
||||
$o=0;
|
||||
while ($busys_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($format=='table')
|
||||
{
|
||||
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</TD></TR>\n";
|
||||
}
|
||||
if ( ($format=='text') or ($format=='textarea') )
|
||||
{
|
||||
echo "$row[0] - $row[1]\n";
|
||||
}
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedlocal") {echo "SELECTED ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</OPTION>\n";
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
|
||||
if ($format=='table') {echo "</TABLE>\n";}
|
||||
if ($format=='menu') {echo "</SELECT>\n";}
|
||||
if ($format=='selectlist') {echo "</SELECT>\n";}
|
||||
if ($format=='textarea') {echo "</TEXTAREA>\n";}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=5 display all agc-usable conferences on a server
|
||||
######################
|
||||
if ($ADD==5)
|
||||
{
|
||||
$pt='pt';
|
||||
if (!$field_name) {$field_name = 'conferences';}
|
||||
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
|
||||
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
|
||||
if ($format=='selectlist')
|
||||
{
|
||||
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
|
||||
}
|
||||
if ($format=='textarea')
|
||||
{
|
||||
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
|
||||
}
|
||||
|
||||
$stmt="SELECT conf_exten,extension FROM conferences where server_ip = '$server_ip' order by conf_exten $order";
|
||||
if ($format=='table') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$phones_to_print = mysql_num_rows($rslt);}
|
||||
$o=0;
|
||||
while ($phones_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($format=='table')
|
||||
{
|
||||
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</TD></TR>\n";
|
||||
}
|
||||
if ( ($format=='text') or ($format=='textarea') )
|
||||
{
|
||||
echo "$row[0] - $row[1]\n";
|
||||
}
|
||||
if ( ($format=='menu') or ($format=='selectlist') )
|
||||
{
|
||||
echo "<OPTION ";
|
||||
if ($row[0]=="$selectedext") {echo "SELECTED ";}
|
||||
echo "VALUE=\"$row[0]\">";
|
||||
echo "$row[0] - $row[1]";
|
||||
echo "</OPTION>\n";
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
|
||||
if ($format=='table') {echo "</TABLE>\n";}
|
||||
if ($format=='menu') {echo "</SELECT>\n";}
|
||||
if ($format=='selectlist') {echo "</SELECT>\n";}
|
||||
if ($format=='textarea') {echo "</TEXTAREA>\n";}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
if ($format=='table') {echo "\n<!-- bežiaci script: $RUNtime sekúnd -->";}
|
||||
if ($format=='table') {echo "\n</body>\n</html>\n";}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,196 @@
|
||||
<?
|
||||
# call_log_display.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to send the inbound and outbound calls for a specific phone
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
# - $protocol - ('SIP','Zap','IAX2',...)
|
||||
# - $in_limit - ('10','20','50','100',...)
|
||||
# - $out_limit - ('10','20','50','100',...)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50406-1013 - First build of script
|
||||
# 50407-1452 - Added definable limits
|
||||
# 50503-1236 - added session_name checking for extra security
|
||||
# 50610-1158 - Added NULL check on MySQL results to reduced errors
|
||||
# 50711-1202 - removed HTTP authentication in favor of user/pass vars
|
||||
# 60323-1550 - added option for showing different number dialed in log
|
||||
# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60619-1202 - Added variable filters to close security holes for login form
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
### If you have globals turned off uncomment these lines
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
|
||||
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
|
||||
if (isset($_GET["format"])) {$format=$_GET["format"];}
|
||||
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
|
||||
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
|
||||
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
|
||||
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
|
||||
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
|
||||
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($format)) {$format="text";}
|
||||
if (!isset($in_limit)) {$in_limit="100";}
|
||||
if (!isset($out_limit)) {$out_limit="100";}
|
||||
$number_dialed = 'number_dialed';
|
||||
#$number_dialed = 'extension';
|
||||
|
||||
$version = '0.0.8';
|
||||
$build = '60619-1202';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Nesprávny Užívateľské meno/Heslo: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Nesprávny server_ip: |$server_ip| or Nesprávny session_name: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Nesprávny session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERZIA: $version POSTAVENÉ: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Zobraziť log hovoru";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
}
|
||||
|
||||
|
||||
$row=''; $rowx='';
|
||||
$channel_live=1;
|
||||
if ( (strlen($exten)<1) or (strlen($protocol)<3) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Exten $exten Nie je správny alebo protokol $protocol Nie je správny\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
##### print outbound calls from the call_log table
|
||||
$stmt="SELECT uniqueid,start_time,$number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$out_calls_count = mysql_num_rows($rslt);}
|
||||
echo "$out_calls_count|";
|
||||
$loop_count=0;
|
||||
while ($out_calls_count>$loop_count)
|
||||
{
|
||||
$loop_count++;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$call_time_M = ($row[3] / 60);
|
||||
$call_time_M = round($call_time_M, 2);
|
||||
$call_time_M_int = intval("$call_time_M");
|
||||
$call_time_SEC = ($call_time_M - $call_time_M_int);
|
||||
$call_time_SEC = ($call_time_SEC * 60);
|
||||
$call_time_SEC = round($call_time_SEC, 0);
|
||||
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
|
||||
$call_time_MS = "$call_time_M_int:$call_time_SEC";
|
||||
|
||||
if ($number_dialed == 'extension') {$row[2] = substr($row[2],-10);}
|
||||
echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
##### print inbound calls from the live_inbound_log table
|
||||
$stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$in_calls_count = mysql_num_rows($rslt);}
|
||||
echo "$in_calls_count|";
|
||||
$loop_count=0;
|
||||
while ($in_calls_count>$loop_count)
|
||||
{
|
||||
$loop_count++;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$call_time_M = ($row[4] / 60);
|
||||
$call_time_M = round($call_time_M, 2);
|
||||
$call_time_M_int = intval("$call_time_M");
|
||||
$call_time_SEC = ($call_time_M - $call_time_M_int);
|
||||
$call_time_SEC = ($call_time_SEC * 60);
|
||||
$call_time_SEC = round($call_time_SEC, 0);
|
||||
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
|
||||
$call_time_MS = "$call_time_M_int:$call_time_SEC";
|
||||
$callerIDnum = $row[3]; $callerIDname = $row[3];
|
||||
$callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum);
|
||||
$callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname);
|
||||
|
||||
echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- bežiaci script: $RUNtime sekúnd -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,353 @@
|
||||
<?
|
||||
# conf_exten_check.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to send whether the meetme conference has live channels connected and which they are
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $ACTION - ('refresh','register')
|
||||
# - $client - ('agc','vdc')
|
||||
# - $conf_exten - ('8600011',...)
|
||||
# - $exten - ('123test',...)
|
||||
# - $auto_dial_level - ('0','1','1.2',...)
|
||||
# - $campagentstdisp - ('YES',...)
|
||||
#
|
||||
|
||||
# changes
|
||||
# 50509-1054 - First build of script
|
||||
# 50511-1112 - Added ability to register a conference room
|
||||
# 50610-1159 - Added NULL check on MySQL results to reduced errors
|
||||
# 50706-1429 - script changed to not use HTTP login vars, user/pass instead
|
||||
# 50706-1525 - Added date-time display for vicidial client display
|
||||
# 50816-1500 - Added random update to vicidial_live_agents table for vdc users
|
||||
# 51121-1353 - Altered echo statements for several small PHP speed optimizations
|
||||
# 60410-1424 - Added ability to grab calls-being-placed and agent status
|
||||
# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60619-1201 - Added variable filters to close security holes for login form
|
||||
# 61128-2255 - Added update for manual dial vicidial_live_agents
|
||||
# 70319-1542 - Added agent disabled display function
|
||||
# 71122-0205 - Added vicidial_live_agent status output
|
||||
# 80424-0442 - Added non_latin lookup from system_settings
|
||||
# 80519-1425 - Added calls-in-queue tally
|
||||
# 80703-1106 - Added API functionality for Hangup and Dispo
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
### If you have globals turned off uncomment these lines
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
|
||||
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
|
||||
if (isset($_GET["format"])) {$format=$_GET["format"];}
|
||||
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
|
||||
if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];}
|
||||
elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];}
|
||||
if (isset($_GET["client"])) {$client=$_GET["client"];}
|
||||
elseif (isset($_POST["client"])) {$client=$_POST["client"];}
|
||||
if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];}
|
||||
elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];}
|
||||
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
|
||||
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
|
||||
if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];}
|
||||
elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];}
|
||||
if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];}
|
||||
elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];}
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
|
||||
}
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($format)) {$format="text";}
|
||||
if (!isset($ACTION)) {$ACTION="refresh";}
|
||||
if (!isset($client)) {$client="agc";}
|
||||
|
||||
$Alogin='N';
|
||||
$RingCalls='N';
|
||||
$DiaLCalls='N';
|
||||
|
||||
$version = '2.0.4-12';
|
||||
$build = '71122-0205';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$FILE_TIME = date("Ymd_His");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
$random = (rand(1000000, 9999999) + 10000000);
|
||||
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Nesprávny Užívateľské meno/Heslo: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Nesprávny server_ip: |$server_ip| or Nesprávny session_name: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Nesprávny session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERZIA: $version POSTAVENÉ: $build MEETME: $conf_exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Overiť konferenčnú pobočku";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
}
|
||||
|
||||
if ($ACTION == 'refresh')
|
||||
{
|
||||
$MT[0]='';
|
||||
$row=''; $rowx='';
|
||||
$channel_live=1;
|
||||
if (strlen($conf_exten)<1)
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Conf Exten $conf_exten Nie je správny\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ($client == 'vdc')
|
||||
{
|
||||
$Acount=0;
|
||||
$AexternalDEAD=0;
|
||||
|
||||
### see if the agent has a record in the vicidial_live_agents table
|
||||
$stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Acount=$row[0];
|
||||
|
||||
if ($Acount > 0)
|
||||
{
|
||||
$stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Astatus=$row[0];
|
||||
}
|
||||
# ### find out if external table shows agent should be disabled
|
||||
# $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';";
|
||||
# if ($DB) {echo "|$stmt|\n";}
|
||||
# $rslt=mysql_query($stmt, $link);
|
||||
# $row=mysql_fetch_row($rslt);
|
||||
# $AexternalDEAD=$row[0];
|
||||
|
||||
if ($auto_dial_level > 0)
|
||||
{
|
||||
### update the vicidial_live_agents every second with a new random number so it is shown to be alive
|
||||
$stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
if ($campagentstdisp == 'YES')
|
||||
{
|
||||
### grab the status of this agent to display
|
||||
$stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Alogin=$row[0];
|
||||
$Acampaign=$row[1];
|
||||
$AccampSQL=$row[2];
|
||||
$AccampSQL = ereg_replace(' -','', $AccampSQL);
|
||||
$AccampSQL = ereg_replace(' ',"','", $AccampSQL);
|
||||
|
||||
### grab the number of calls being placed from this server and campaign
|
||||
$stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$RingCalls=$row[0];
|
||||
if ($RingCalls > 0) {$RingCalls = "<font class=\"queue_text_red\">Calls in Queue: $RingCalls</font>";}
|
||||
else {$RingCalls = "<font class=\"queue_text\">Calls in Queue: $RingCalls</font>";}
|
||||
|
||||
### grab the number of calls being placed from this server and campaign
|
||||
$stmt="SELECT count(*) from vicidial_auto_calls where status NOT IN('XFER') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DiaLCalls=$row[0];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$Alogin='N';
|
||||
$RingCalls='N';
|
||||
$DiaLCalls='N';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$Alogin='N';
|
||||
$RingCalls='N';
|
||||
$DiaLCalls='N';
|
||||
|
||||
### update the vicidial_live_agents every second with a new random number so it is shown to be alive
|
||||
$stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
}
|
||||
|
||||
### grab the API hangup and API dispo fields in vicidial_live_agents
|
||||
$stmt="SELECT external_hangup,external_status from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$external_hangup = $row[0];
|
||||
$external_status = $row[1];
|
||||
if (strlen($external_status)<1) {$external_status = '::::::::::';}
|
||||
|
||||
if ($Acount < 1) {$Alogin='DEAD_VLA';}
|
||||
if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';}
|
||||
|
||||
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Stav: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . "|\n";
|
||||
|
||||
}
|
||||
$total_conf=0;
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$sip_list = mysql_num_rows($rslt);}
|
||||
# echo "$sip_list|";
|
||||
$loop_count=0;
|
||||
while ($sip_list>$loop_count)
|
||||
{
|
||||
$loop_count++; $total_conf++;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$KanálA[$total_conf] = "$row[0]";
|
||||
if ($format=='debug') {echo "\n<!-- $row[0] -->";}
|
||||
}
|
||||
$stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$channels_list = mysql_num_rows($rslt);}
|
||||
# echo "$channels_list|";
|
||||
$loop_count=0;
|
||||
while ($channels_list>$loop_count)
|
||||
{
|
||||
$loop_count++; $total_conf++;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$KanálA[$total_conf] = "$row[0]";
|
||||
if ($format=='debug') {echo "\n<!-- $row[0] -->";}
|
||||
}
|
||||
}
|
||||
$channels_list = ($channels_list + $sip_list);
|
||||
echo "$channels_list|";
|
||||
|
||||
$counter=0;
|
||||
$countecho='';
|
||||
while($total_conf > $counter)
|
||||
{
|
||||
$counter++;
|
||||
$countecho = "$countecho$KanálA[$counter] ~";
|
||||
# echo "$KanálA[$counter] ~";
|
||||
}
|
||||
|
||||
echo "$countecho\n";
|
||||
}
|
||||
|
||||
if ($ACTION == 'register')
|
||||
{
|
||||
$MT[0]='';
|
||||
$row=''; $rowx='';
|
||||
$channel_live=1;
|
||||
if ( (strlen($conf_exten)<1) || (strlen($exten)<1) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Conf Exten $conf_exten Nie je správny or Exten $exten Nie je správny\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
echo "Konferencia $conf_exten bol zaregistrovaný $exten\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- bežiaci script: $RUNtime sekúnd -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?
|
||||
#
|
||||
# dbconnect.php version 2.0.5
|
||||
#
|
||||
# database connection settings and some global web settings
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
if ( file_exists("/etc/astguiclient.conf") )
|
||||
{
|
||||
$DBCagc = file("/etc/astguiclient.conf");
|
||||
foreach ($DBCagc as $DBCline)
|
||||
{
|
||||
$DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline);
|
||||
if (ereg("^PATHlogs", $DBCline))
|
||||
{$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);}
|
||||
if (ereg("^PATHweb", $DBCline))
|
||||
{$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);}
|
||||
if (ereg("^VARDB_server", $DBCline))
|
||||
{$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);}
|
||||
if (ereg("^VARDB_database", $DBCline))
|
||||
{$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);}
|
||||
if (ereg("^VARDB_user", $DBCline))
|
||||
{$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);}
|
||||
if (ereg("^VARDB_pass", $DBCline))
|
||||
{$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);}
|
||||
if (ereg("^VARDB_port", $DBCline))
|
||||
{$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
#defaults for DB connection
|
||||
$VARDB_server = 'localhost';
|
||||
$VARDB_user = 'cron';
|
||||
$VARDB_pass = '1234';
|
||||
$VARDB_database = '1234';
|
||||
$WeBServeRRooT = '/usr/local/apache2/htdocs';
|
||||
}
|
||||
|
||||
$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass");
|
||||
if (!$link) {
|
||||
die('MySQL connect ERROR: ' . mysql_error());
|
||||
}
|
||||
mysql_select_db("$VARDB_database",$link);
|
||||
|
||||
$local_DEF = 'Local/';
|
||||
$conf_silent_prefix = '7';
|
||||
$local_AMP = '@';
|
||||
$ext_context = 'demo';
|
||||
$recording_exten = '8309';
|
||||
$WeBRooTWritablE = '1';
|
||||
$non_latin = '0'; # set to 1 for UTF rules, overridden by system_settings
|
||||
$flag_channels=0;
|
||||
$flag_string = 'VICIast20';
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,351 @@
|
||||
<?
|
||||
# inbound_popup.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to open up when a live_inbound call comes in giving the user
|
||||
# options of what to do with the call or options to lookup the callerID on various web sites
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $uniqueid - ('1234567890.123456',...)
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $vmail_box - ('101','1234',...)
|
||||
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
# - $ext_context - ('default','demo',...)
|
||||
# - $ext_priority - ('1','2',...)
|
||||
# - $voicemail_dump_exten - ('85026666666666')
|
||||
# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50428-1500 - First build of script display only
|
||||
# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links
|
||||
# 50503-1244 - added session_name checking for extra security
|
||||
# 50711-1203 - removed HTTP authentication in favor of user/pass vars
|
||||
# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60619-1205 - Added variable filters to close security holes for login form
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
### If you have globals turned off uncomment these lines
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
|
||||
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
|
||||
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
|
||||
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
|
||||
if (isset($_GET["format"])) {$format=$_GET["format"];}
|
||||
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
|
||||
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
|
||||
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
|
||||
if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];}
|
||||
elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];}
|
||||
if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];}
|
||||
elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];}
|
||||
if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];}
|
||||
elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];}
|
||||
if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];}
|
||||
elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];}
|
||||
if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];}
|
||||
elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];}
|
||||
if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);}
|
||||
else {$local_web_callerID_URL = '';}
|
||||
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($format)) {$format="text";}
|
||||
|
||||
$version = '0.0.6';
|
||||
$build = '60619-1205';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
$DO = '-1';
|
||||
if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Nesprávny Užívateľské meno/Heslo: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Nesprávny server_ip: |$server_ip| or Nesprávny session_name: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Nesprávny session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$forever_stop=0;
|
||||
$user_abb = "$user$user$user$user";
|
||||
while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
|
||||
{$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;}
|
||||
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERZIA: $version POSTAVENÉ: $build UNIQUEID: $uniqueid server_ip: $server_ip-->\n";
|
||||
?>
|
||||
<script language="Javascript">
|
||||
var server_ip = '<? echo $server_ip ?>';
|
||||
var epoch_sec = '<? echo $StarTtime ?>';
|
||||
var user_abb = '<? echo $user_abb ?>';
|
||||
var vmail_box = '<? echo $vmail_box ?>';
|
||||
var ext_context = '<? echo $ext_context ?>';
|
||||
var ext_priority = '<? echo $ext_priority ?>';
|
||||
var voicemail_dump_exten = '<? echo $voicemail_dump_exten ?>';
|
||||
var session_name = '<? echo $session_name ?>';
|
||||
var user = '<? echo $user ?>';
|
||||
var pass = '<? echo $pass ?>';
|
||||
|
||||
|
||||
// ################################################################################
|
||||
// Send Hangup command for Live call connected to phone now to Manager
|
||||
function livehangup_send_hangup(taskvar)
|
||||
{
|
||||
var xmlhttp=false;
|
||||
/*@cc_on @*/
|
||||
/*@if (@_jscript_version >= 5)
|
||||
// JScript gives us Conditional compilation, we can cope with old IE versions.
|
||||
// and security blocked creation of the objects.
|
||||
try {
|
||||
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (E) {
|
||||
xmlhttp = false;
|
||||
}
|
||||
}
|
||||
@end @*/
|
||||
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
|
||||
{
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
}
|
||||
if (xmlhttp)
|
||||
{
|
||||
var queryCID = "HLagcP" + epoch_sec + user_abb;
|
||||
var hangupvalue = taskvar;
|
||||
livehangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Hangup&format=text&channel=" + hangupvalue + "&queryCID=" + queryCID;
|
||||
xmlhttp.open('POST', 'manager_send.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(livehangup_query);
|
||||
xmlhttp.onreadystatechange = function()
|
||||
{
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
|
||||
{
|
||||
Nactiveext = null;
|
||||
Nactiveext = xmlhttp.responseText;
|
||||
alert(xmlhttp.responseText);
|
||||
}
|
||||
}
|
||||
delete xmlhttp;
|
||||
}
|
||||
call_action_link_clear();
|
||||
}
|
||||
|
||||
|
||||
// ################################################################################
|
||||
// Send Redirect command for ringing call to go directly to your voicemail
|
||||
function liveredirect_send_vmail(taskvar,taskbox)
|
||||
{
|
||||
var xmlhttp=false;
|
||||
/*@cc_on @*/
|
||||
/*@if (@_jscript_version >= 5)
|
||||
// JScript gives us Conditional compilation, we can cope with old IE versions.
|
||||
// and security blocked creation of the objects.
|
||||
try {
|
||||
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (E) {
|
||||
xmlhttp = false;
|
||||
}
|
||||
}
|
||||
@end @*/
|
||||
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
|
||||
{
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
}
|
||||
if (xmlhttp)
|
||||
{
|
||||
var queryCID = "RVagcP" + epoch_sec + user_abb;
|
||||
var hangupvalue = taskvar;
|
||||
var mailboxvalue = taskbox;
|
||||
liveredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + hangupvalue + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "" + mailboxvalue + "&ext_context=" + ext_context + "&ext_priority=" + ext_priority;
|
||||
xmlhttp.open('POST', 'manager_send.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(liveredirect_query);
|
||||
xmlhttp.onreadystatechange = function()
|
||||
{
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
|
||||
{
|
||||
Nactiveext = null;
|
||||
Nactiveext = xmlhttp.responseText;
|
||||
alert(xmlhttp.responseText);
|
||||
}
|
||||
}
|
||||
delete xmlhttp;
|
||||
}
|
||||
call_action_link_clear();
|
||||
}
|
||||
|
||||
|
||||
// ################################################################################
|
||||
// timeout to deactivate the call action links after 30 sekúnd
|
||||
function link_timeout()
|
||||
{
|
||||
window.focus();
|
||||
setTimeout("call_action_link_clear()", 30000);
|
||||
}
|
||||
|
||||
// ################################################################################
|
||||
// deactivates the call action links
|
||||
function call_action_link_clear()
|
||||
{
|
||||
document.getElementById("callactions").innerHTML = "";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?
|
||||
echo "<title>ŽIVÝ PRÍCHODZÍ HOVOR";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=\"#CCC2E0\" marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onload=\"link_timeout();\">\n";
|
||||
echo "<CENTER><H2>ŽIVÝ PRÍCHODZÍ HOVOR</H2>\n";
|
||||
echo "<B>$NOW_TIME</B><BR><BR>\n";
|
||||
}
|
||||
|
||||
|
||||
$MT[0]='';
|
||||
$row=''; $rowx='';
|
||||
$channel_live=1;
|
||||
if (strlen($uniqueid)<9)
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Uniqueid $uniqueid Nie je správny\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$channels_list = mysql_num_rows($rslt);
|
||||
if ($channels_list>0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|";
|
||||
# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt|||||
|
||||
if ($format=='debug') {echo "\n<!-- $row[0]|$row[1]|$row[2]|$row[3]|$row[4]|$row[5]|$row[6]|$row[7]|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]| -->";}
|
||||
echo "<table width=95% cellpadding=1 cellspacing=3>\n";
|
||||
echo "<tr bgcolor=\"#DDDDFF\"><td>Kanál: </td><td align=left>$row[1]</td></tr>\n";
|
||||
echo "<tr bgcolor=\"#DDDDFF\"><td>IDvolajúceho: </td><td align=left>$row[3]</td></tr>\n";
|
||||
echo "<tr bgcolor=\"#DDDDFF\"><td colspan=2 align=center>\n";
|
||||
|
||||
$phone = eregi_replace(".*\<","",$row[3]);
|
||||
$phone = eregi_replace("\>.*","",$phone);
|
||||
$NPA = substr($phone, 0, 3);
|
||||
$NXX = substr($phone, 3, 3);
|
||||
$XXXX = substr($phone, 6, 4);
|
||||
$D='-';
|
||||
echo "<a href=\"http://www.google.com/search?hl=en&lr=&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial_s&q=$NPA+$NXX+$XXXX&btnG=Search\" target=\"_blank\">GOOGLE</a> - \n";
|
||||
echo "<a href=\"http://www.anywho.com/qry/wp_rl?npa=$NPA&telephone=$NXX$XXXX\" target=\"_blank\">ANYWHO</a> - \n";
|
||||
echo "<a href=\"http://www.switchboard.com/bin/cgirlookup.dll?SR=&MEM=1&LNK=32%3A36&type=BOTH&at=$NPA&e=$NXX&n=$XXXX&search.x=55&search.y=20\" target=\"_blank\">SWITCHBOARD</a> - \n";
|
||||
echo "<a href=\"http://yellowpages.superpages.com/listings.jsp?SRC=&STYPE=&PG=L&CB=&C=&N=&E=&T=&S=&Z=&A=727&X=533&P=8730&AXP=$NPA$NXX$XXXX&R=N&PS=15&search=Find+It\" target=\"_blank\">VERIZON</a> - \n";
|
||||
echo "<a href=\"http://www.whitepages.com/1014/log_click/search/Reverse_Telefón?npa=$NPA&phone=$NXX$XXXX\" target=\"_blank\">WHITEPAGES</a> - \n";
|
||||
echo "<a href=\"http://www.411.com/10742/search/Reverse_Telefón?phone=%28$NPA%29+$NXX$D$XXXX\" target=\"_blank\">411.COM</a> - \n";
|
||||
echo "<a href=\"http://www.phonenumber.com/10006/search/Reverse_Telefón?npa=$NPA&phone=$NXX$XXXX\" target=\"_blank\">411.COM</a> - \n";
|
||||
|
||||
$local_web_callerID_QUERY_STRING ='';
|
||||
$local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_Kanál=$row[1]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]";
|
||||
$local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]";
|
||||
echo "<a href=\"$local_web_callerID_URL$local_web_callerID_QUERY_STRING\" target=\"_blank\">UPRAVENÉ</a> - \n";
|
||||
|
||||
echo "</td></tr>\n";
|
||||
echo "<tr bgcolor=\"#DDDDFF\"><td>Volané číslo: </td><td align=left>$row[8]</td></tr>\n";
|
||||
echo "<tr bgcolor=\"#DDDDFF\"><td>Poznámka: </td><td align=left>$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|</td></tr>\n";
|
||||
echo "<tr bgcolor=\"#DDDDFF\"><td colspan=2 align=center>\n<span id=\"callactions\">";
|
||||
echo "<a href=\"#\" onclick=\"livehangup_send_hangup('$row[1]');return false;\">POLOŹIŤ</a> - \n";
|
||||
echo "<a href=\"#\" onclick=\"liveredirect_send_vmail('$row[1]','$vmail_box');return false;\">POSLAŤ DO MOJEJ HLASOVEJ SCHRÁNKY</a>\n";
|
||||
echo "</span></td></tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
|
||||
$stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- bežiaci script: $RUNtime sekúnd -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,278 @@
|
||||
<?
|
||||
# live_exten_check.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to send whether the client channel is live and to what channel it is connected
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
# - $protocol - ('SIP','Zap','IAX2',...)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50404-1249 - First build of script
|
||||
# 50406-1402 - added connected trunk lookup
|
||||
# 50428-1452 - added live_inbound check for exten on 2nd line of output
|
||||
# 50503-1233 - added session_name checking for extra security
|
||||
# 50524-1429 - added parked calls count
|
||||
# 50610-1204 - Added NULL check on MySQL results to reduced errors
|
||||
# 50711-1204 - removed HTTP authentication in favor of user/pass vars
|
||||
# 60103-1541 - added favorite extens status display
|
||||
# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60619-1203 - Added variable filters to close security holes for login form
|
||||
# 60825-1029 - Fixed translation variable issue ChannelA
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
### If you have globals turned off uncomment these lines
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
|
||||
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
|
||||
if (isset($_GET["format"])) {$format=$_GET["format"];}
|
||||
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
|
||||
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
|
||||
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
|
||||
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
|
||||
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
|
||||
if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];}
|
||||
elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];}
|
||||
if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];}
|
||||
elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];}
|
||||
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($format)) {$format="text";}
|
||||
|
||||
$version = '2.0.1';
|
||||
$build = '60825-1029';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Nesprávny Užívateľské meno/Heslo: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Nesprávny server_ip: |$server_ip| or Nesprávny session_name: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Nesprávny session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERZIA: $version POSTAVENÉ: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Overiť aktívnu pobočku";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
}
|
||||
|
||||
|
||||
echo "DateTime: $NOW_TIME|";
|
||||
echo "UnixTime: $StarTtime|";
|
||||
|
||||
$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "$row[0]|";
|
||||
|
||||
$MT[0]='';
|
||||
$row=''; $rowx='';
|
||||
$channel_live=1;
|
||||
if ( (strlen($exten)<1) or (strlen($protocol)<3) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Exten $exten Nie je správny alebo protokol $protocol Nie je správny\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$channels_list = mysql_num_rows($rslt);}
|
||||
echo "$channels_list|";
|
||||
$loop_count=0;
|
||||
while ($channels_list>$loop_count)
|
||||
{
|
||||
$loop_count++;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$ChanneLA[$loop_count] = "$row[0]";
|
||||
$ChanneLB[$loop_count] = "$row[1]";
|
||||
if ($format=='debug') {echo "\n<!-- $row[0] $row[1] -->";}
|
||||
}
|
||||
}
|
||||
|
||||
$counter=0;
|
||||
while($loop_count > $counter)
|
||||
{
|
||||
$counter++;
|
||||
$stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
|
||||
if ($trunk_count>0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "Conversation: $counter ~";
|
||||
echo "KanálA: $ChanneLA[$counter] ~";
|
||||
echo "KanálB: $ChanneLB[$counter] ~";
|
||||
echo "KanálBtrunk: $row[0]|";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
|
||||
if ($trunk_count>0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "Conversation: $counter ~";
|
||||
echo "KanálA: $ChanneLA[$counter] ~";
|
||||
echo "KanálB: $ChanneLB[$counter] ~";
|
||||
echo "KanálBtrunk: $row[0]|";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
|
||||
if ($trunk_count>0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "Conversation: $counter ~";
|
||||
echo "KanálA: $ChanneLA[$counter] ~";
|
||||
echo "KanálB: $ChanneLB[$counter] ~";
|
||||
echo "KanálBtrunk: $row[0]|";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
|
||||
if ($trunk_count>0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "Conversation: $counter ~";
|
||||
echo "KanálA: $ChanneLA[$counter] ~";
|
||||
echo "KanálB: $ChanneLB[$counter] ~";
|
||||
echo "KanálBtrunk: $row[0]|";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Conversation: $counter ~";
|
||||
echo "KanálA: $ChanneLA[$counter] ~";
|
||||
echo "KanálB: $ChanneLB[$counter] ~";
|
||||
echo "KanálBtrunk: $ChanneLA[$counter]|";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
|
||||
### check for live_inbound entry
|
||||
$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$channels_list = mysql_num_rows($rslt);}
|
||||
if ($channels_list>0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LIuniqueid = "$row[0]";
|
||||
$LIchannel = "$row[1]";
|
||||
$LIcallerid = "$row[3]";
|
||||
$LIdatetime = "$row[6]";
|
||||
echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|";
|
||||
if ($format=='debug') {echo "\n<!-- $row[0]|$row[1]|$row[2]|$row[3]|$row[4]|$row[5]|$row[6]|$row[7]|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]| -->";}
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
|
||||
|
||||
### if favorites are present do a lookup to see if any are active
|
||||
if ($favorites_count > 0)
|
||||
{
|
||||
$favorites = explode(',',$favorites_list);
|
||||
$h=0;
|
||||
$favs_print='';
|
||||
while ($favorites_count > $h)
|
||||
{
|
||||
$fav_extension = explode('/',$favorites[$h]);
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$favs_print .= "$fav_extension[1]: $row[0] ~";
|
||||
$h++;
|
||||
}
|
||||
echo "$favs_print\n";
|
||||
}
|
||||
|
||||
if ($format=='debug') {echo "\n<!-- |$favorites_count|$favorites_list| -->";}
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- bežiaci script: $RUNtime sekúnd -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,146 @@
|
||||
<?
|
||||
# park_calls_display.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to send the details on the parked calls on the server
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
|
||||
# - $protocol - ('SIP','Zap','IAX2',...)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50524-1515 - First build of script
|
||||
# 50711-1208 - removed HTTP authentication in favor of user/pass vars
|
||||
# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60619-1205 - Added variable filters to close security holes for login form
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
### If you have globals turned off uncomment these lines
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
|
||||
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
|
||||
if (isset($_GET["format"])) {$format=$_GET["format"];}
|
||||
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
|
||||
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
|
||||
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
|
||||
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
|
||||
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
|
||||
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($format)) {$format="text";}
|
||||
if (!isset($park_limit)) {$park_limit="1000";}
|
||||
|
||||
$version = '0.0.4';
|
||||
$build = '60619-1205';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) )
|
||||
{
|
||||
echo "Nesprávny Užívateľské meno/Heslo: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) {
|
||||
echo "Nesprávny server_ip: |$server_ip| or Nesprávny session_name: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Nesprávny session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERZIA: $version POSTAVENÉ: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Zobraziť zaparkované hovory";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
}
|
||||
|
||||
|
||||
$row=''; $rowx='';
|
||||
$channel_live=1;
|
||||
if ( (strlen($exten)<1) or (strlen($protocol)<3) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Exten $exten Nie je správny alebo protokol $protocol Nie je správny\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
##### print parked calls from the parked_channels table
|
||||
$stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$park_calls_count = mysql_num_rows($rslt);
|
||||
echo "$park_calls_count\n";
|
||||
$loop_count=0;
|
||||
while ($park_calls_count>$loop_count)
|
||||
{
|
||||
$loop_count++;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|";
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- bežiaci script: $RUNtime sekúnd -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,140 @@
|
||||
<?
|
||||
# voicemail_check.php version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to check whether the voicemail box on the server defined has new and old messages
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
#
|
||||
# required variables:
|
||||
# - $server_ip
|
||||
# - $session_name
|
||||
# - $user
|
||||
# - $pass
|
||||
# optional variables:
|
||||
# - $format - ('text','debug')
|
||||
# - $vmail_box - ('101','1234',...)
|
||||
#
|
||||
#
|
||||
# changes
|
||||
# 50422-1147 - First build of script
|
||||
# 50503-1241 - added session_name checking for extra security
|
||||
# 50711-1201 - removed HTTP authentication in favor of user/pass vars
|
||||
# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60619-1204 - Added variable filters to close security holes for login form
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
### If you have globals turned off uncomment these lines
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
|
||||
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
|
||||
if (isset($_GET["format"])) {$format=$_GET["format"];}
|
||||
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
|
||||
if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];}
|
||||
elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];}
|
||||
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($format)) {$format="text";}
|
||||
|
||||
$version = '0.0.5';
|
||||
$build = '60619-1204';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Nesprávny Užívateľské meno/Heslo: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Nesprávny server_ip: |$server_ip| or Nesprávny session_name: |$session_name|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
echo "Nesprávny session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERZIA: $version POSTAVENÉ: $build VMBOX: $vmail_box server_ip: $server_ip-->\n";
|
||||
echo "<title>Overiť hlasovú schránku";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
}
|
||||
|
||||
$MT[0]='';
|
||||
$row=''; $rowx='';
|
||||
if (strlen($vmail_box)<1)
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "hlasová schránka $vmail_box Nie je správny\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$vmails_list = mysql_num_rows($rslt);
|
||||
$loop_count=0;
|
||||
while ($vmails_list>$loop_count)
|
||||
{
|
||||
$loop_count++;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "$row[0]|$row[1]";
|
||||
if ($format=='debug') {echo "\n<!-- $row[0] $row[1] -->";}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- bežiaci script: $RUNtime sekúnd -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,907 @@
|
||||
<?
|
||||
# AST_CLOSERstats.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 60905-1326 - Added queue time stats
|
||||
# 71008-1436 - Added shift to be defined in dbconnect.php
|
||||
# 71025-0021 - Added status breakdown
|
||||
# 71218-1155 - Added end_date for multi-day reports
|
||||
# 80430-1920 - Added Customer hangup cause stats
|
||||
# 80709-0331 - Added time stats to call statuses
|
||||
# 80722-2149 - Added Status Category stats
|
||||
# 81015-0705 - Added IVR calls count
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
|
||||
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select group_id from vicidial_inbound_groups;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $groups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="select vsc_id,vsc_name from vicidial_status_categories;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statcats_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $statcats_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vsc_id[$i] = $row[0];
|
||||
$vsc_name[$i] = $row[1];
|
||||
$vsc_count[$i] = 0;
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: Estadísticas de VDAD Closer</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
|
||||
echo " to <INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($groups_to_print > $o)
|
||||
{
|
||||
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<SELECT SIZE=1 NAME=shift>\n";
|
||||
echo "<option selected value=\"$shift\">$shift</option>\n";
|
||||
echo "<option value=\"\">--</option>\n";
|
||||
echo "<option value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "<option value=\"ALL\">ALL</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFICA</a> | <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo "PER FAVORE SELEZIONA UN GRUPPO INBOUND E UN INTERVALLO DI TEMPO, POI PREMI INVIA\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($shift == 'AM')
|
||||
{
|
||||
$time_BEGIN=$AM_shift_BEGIN;
|
||||
$time_END=$AM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "15:15:00";}
|
||||
}
|
||||
if ($shift == 'PM')
|
||||
{
|
||||
$time_BEGIN=$PM_shift_BEGIN;
|
||||
$time_END=$PM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:15:00";}
|
||||
}
|
||||
if ($shift == 'ALL')
|
||||
{
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:59:59";}
|
||||
}
|
||||
$query_date_BEGIN = "$query_date $time_BEGIN";
|
||||
$query_date_END = "$end_date $time_END";
|
||||
|
||||
|
||||
|
||||
echo "VICIDIAL: Estadísticas de Auto-dial en CLOSER $NOW_TIME\n";
|
||||
|
||||
echo "\n";
|
||||
echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- TOTALI\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='" . mysql_real_escape_string($group) . "' and comment_b='START';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $row[0]);
|
||||
$IVRcalls = sprintf("%10s", $rowx[0]);
|
||||
$TOTALsec = $row[1];
|
||||
if ( ($row[0] < 1) or ($TOTALsec < 1) )
|
||||
{$average_call_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_call_seconds = ($TOTALsec / $row[0]);
|
||||
$average_call_seconds = round($average_call_seconds, 0);
|
||||
$average_call_seconds = sprintf("%10s", $average_call_seconds);
|
||||
}
|
||||
|
||||
echo "Llamadas totales tomadas in to this In-Gruppo: $TOTALcalls\n";
|
||||
echo "Average Call Length for all Calls: $average_call_seconds seconds\n";
|
||||
echo "Calls taken into the IVR for this In-Gruppo: $IVRcalls\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- ABBATTUTE\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$DROPcalls = sprintf("%10s", $row[0]);
|
||||
if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
|
||||
{$DROPpercent = '0';}
|
||||
else
|
||||
{
|
||||
$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
|
||||
$DROPpercent = round($DROPpercent, 0);
|
||||
}
|
||||
|
||||
if ( ($row[0] < 1) or ($row[1] < 1) )
|
||||
{
|
||||
$average_hold_seconds = ' 0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$average_hold_seconds = ($row[1] / $row[0]);
|
||||
$average_hold_seconds = round($average_hold_seconds, 0);
|
||||
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
|
||||
}
|
||||
|
||||
echo "Totale Chiamate ABBATTUTE: $DROPcalls $DROPpercent%\n";
|
||||
echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n";
|
||||
|
||||
|
||||
# GET LIST OF ALL STATUSES and create SQL from human_answered statuses
|
||||
$q=0;
|
||||
$stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$p=0;
|
||||
while ($p < $statuses_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$status[$q] = $row[0];
|
||||
$status_name[$q] = $row[1];
|
||||
$human_answered[$q] = $row[2];
|
||||
$category[$q] = $row[3];
|
||||
$statname_list["$status[$q]"] = "$status_name[$q]";
|
||||
$statcat_list["$status[$q]"] = "$category[$q]";
|
||||
$q++;
|
||||
$p++;
|
||||
}
|
||||
$stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$p=0;
|
||||
while ($p < $statuses_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$status[$q] = $row[0];
|
||||
$status_name[$q] = $row[1];
|
||||
$human_answered[$q] = $row[2];
|
||||
$category[$q] = $row[3];
|
||||
$statname_list["$status[$q]"] = "$status_name[$q]";
|
||||
$statcat_list["$status[$q]"] = "$category[$q]";
|
||||
$q++;
|
||||
$p++;
|
||||
}
|
||||
|
||||
##############################
|
||||
######### CALL QUEUE STATS
|
||||
echo "\n";
|
||||
echo "---------- QUEUE STATS\n";
|
||||
|
||||
$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$QUEUEcalls = sprintf("%10s", $row[0]);
|
||||
if ( ($QUEUEcalls < 1) or ($TOTALcalls < 1) )
|
||||
{$QUEUEpercent = '0';}
|
||||
else
|
||||
{
|
||||
$QUEUEpercent = (($QUEUEcalls / $TOTALcalls) * 100);
|
||||
$QUEUEpercent = round($QUEUEpercent, 0);
|
||||
}
|
||||
|
||||
if ( ($row[0] < 1) or ($row[1] < 1) )
|
||||
{$average_queue_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_queue_seconds = ($row[1] / $row[0]);
|
||||
$average_queue_seconds = round($average_queue_seconds, 2);
|
||||
$average_queue_seconds = sprintf("%10.2f", $average_queue_seconds);
|
||||
}
|
||||
|
||||
if ( ($TOTALcalls < 1) or ($row[1] < 1) )
|
||||
{$average_total_queue_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_total_queue_seconds = ($row[1] / $TOTALcalls);
|
||||
$average_total_queue_seconds = round($average_total_queue_seconds, 2);
|
||||
$average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds);
|
||||
}
|
||||
|
||||
echo "Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n";
|
||||
echo "Average QUEUE Length for queue calls: $average_queue_seconds seconds\n";
|
||||
echo "Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n";
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL HOLD TIME BREAKDONW IN SECONDS
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL HOLD TIME BREAKDOWN IN SECONDS\n";
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by queue_seconds;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $reasons_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = ($TOTALcalls + $row[0]);
|
||||
|
||||
if ($row[1] == 0) {$hd_0 = ($hd_0 + $row[0]);}
|
||||
if ( ($row[1] > 0) and ($row{1} <= 5) ) {$hd_5 = ($hd_5 + $row[0]);}
|
||||
if ( ($row[1] > 5) and ($row{1} <= 10) ) {$hd10 = ($hd10 + $row[0]);}
|
||||
if ( ($row[1] > 10) and ($row{1} <= 15) ) {$hd15 = ($hd15 + $row[0]);}
|
||||
if ( ($row[1] > 15) and ($row{1} <= 20) ) {$hd20 = ($hd20 + $row[0]);}
|
||||
if ( ($row[1] > 20) and ($row{1} <= 25) ) {$hd25 = ($hd25 + $row[0]);}
|
||||
if ( ($row[1] > 25) and ($row{1} <= 30) ) {$hd30 = ($hd30 + $row[0]);}
|
||||
if ( ($row[1] > 30) and ($row{1} <= 35) ) {$hd35 = ($hd35 + $row[0]);}
|
||||
if ( ($row[1] > 35) and ($row{1} <= 40) ) {$hd40 = ($hd40 + $row[0]);}
|
||||
if ( ($row[1] > 40) and ($row{1} <= 45) ) {$hd45 = ($hd45 + $row[0]);}
|
||||
if ( ($row[1] > 45) and ($row{1} <= 50) ) {$hd50 = ($hd50 + $row[0]);}
|
||||
if ( ($row[1] > 50) and ($row{1} <= 55) ) {$hd55 = ($hd55 + $row[0]);}
|
||||
if ( ($row[1] > 55) and ($row{1} <= 60) ) {$hd60 = ($hd60 + $row[0]);}
|
||||
if ( ($row[1] > 60) and ($row{1} <= 90) ) {$hd90 = ($hd90 + $row[0]);}
|
||||
if ($row[1] > 90) {$hd99 = ($hd99 + $row[0]);}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$hd_0 = sprintf("%5s", $hd_0);
|
||||
$hd_5 = sprintf("%5s", $hd_5);
|
||||
$hd10 = sprintf("%5s", $hd10);
|
||||
$hd15 = sprintf("%5s", $hd15);
|
||||
$hd20 = sprintf("%5s", $hd20);
|
||||
$hd25 = sprintf("%5s", $hd25);
|
||||
$hd30 = sprintf("%5s", $hd30);
|
||||
$hd35 = sprintf("%5s", $hd35);
|
||||
$hd40 = sprintf("%5s", $hd40);
|
||||
$hd45 = sprintf("%5s", $hd45);
|
||||
$hd50 = sprintf("%5s", $hd50);
|
||||
$hd55 = sprintf("%5s", $hd55);
|
||||
$hd60 = sprintf("%5s", $hd60);
|
||||
$hd90 = sprintf("%5s", $hd90);
|
||||
$hd99 = sprintf("%5s", $hd99);
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
|
||||
echo "| $hd_0 $hd_5 $hd10 $hd15 $hd20 $hd25 $hd30 $hd35 $hd40 $hd45 $hd50 $hd55 $hd60 $hd90 $hd99 | $TOTALcalls |\n";
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL HANGUP REASON STATS
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL HANGUP REASON STATS\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
echo "| HANGUP REASON | CALLS |\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
|
||||
$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by term_reason;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $reasons_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = ($TOTALcalls + $row[0]);
|
||||
|
||||
$REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);}
|
||||
$reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);}
|
||||
# if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';}
|
||||
|
||||
echo "| $reason | $REASONcount |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
|
||||
echo "+----------------------+------------+\n";
|
||||
echo "| TOTAL: | $TOTALcalls |\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL STATUS STATS
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL STATUS STATS\n";
|
||||
echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
|
||||
echo "| STATUS | DESCRIZIONE | CATEGORY | CALLS | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
|
||||
echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
|
||||
|
||||
|
||||
## get counts and time totals for all statuses in this campaign
|
||||
$stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $statuses_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$STATUScount = $row[0];
|
||||
$RAWstatus = $row[1];
|
||||
$r=0; $foundstat=0;
|
||||
while ($r < $statcats_to_print)
|
||||
{
|
||||
if ( ($statcat_list[$RAWstatus] == "$vsc_id[$r]") and ($foundstat < 1) )
|
||||
{
|
||||
$vsc_count[$r] = ($vsc_count[$r] + $STATUScount);
|
||||
}
|
||||
$r++;
|
||||
}
|
||||
|
||||
$TOTALcalls = ($TOTALcalls + $row[0]);
|
||||
$STATUSrate = ($STATUScount / ($TOTALsec / 3600) );
|
||||
$STATUSrate = sprintf("%.2f", $STATUSrate);
|
||||
|
||||
$STATUShours_H = ($row[2] / 3600);
|
||||
$STATUShours_H_int = round($STATUShours_H, 2);
|
||||
$STATUShours_H_int = intval("$STATUShours_H_int");
|
||||
$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
|
||||
$STATUShours_M = ($STATUShours_M * 60);
|
||||
$STATUShours_M_int = round($STATUShours_M, 2);
|
||||
$STATUShours_M_int = intval("$STATUShours_M_int");
|
||||
$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
|
||||
$STATUShours_S = ($STATUShours_S * 60);
|
||||
$STATUShours_S = round($STATUShours_S, 0);
|
||||
if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
|
||||
if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
|
||||
$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
|
||||
|
||||
$STATUSavg_H = (($row[2] / 3600) / $STATUScount);
|
||||
$STATUSavg_H_int = round($STATUSavg_H, 2);
|
||||
$STATUSavg_H_int = intval("$STATUSavg_H_int");
|
||||
$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
|
||||
$STATUSavg_M = ($STATUSavg_M * 60);
|
||||
$STATUSavg_M_int = round($STATUSavg_M, 2);
|
||||
$STATUSavg_M_int = intval("$STATUSavg_M_int");
|
||||
$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
|
||||
$STATUSavg_S = ($STATUSavg_S * 60);
|
||||
$STATUSavg_S = round($STATUSavg_S, 0);
|
||||
if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
|
||||
if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
|
||||
$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
|
||||
|
||||
$STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
|
||||
$status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);}
|
||||
$STATUShours = sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);}
|
||||
$STATUSavg = sprintf("%8s", $STATUSavg);while(strlen($STATUSavg)>8) {$STATUSavg = substr("$STATUSavg", 0, -1);}
|
||||
$STATUSrate = sprintf("%8s", $STATUSrate);while(strlen($STATUSrate)>8) {$STATUSrate = substr("$STATUSrate", 0, -1);}
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$status_name = sprintf("%-20s", $statname_list[$RAWstatus]);
|
||||
while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);}
|
||||
$statcat = sprintf("%-20s", $statcat_list[$RAWstatus]);
|
||||
while(strlen($statcat)>20) {$statcat = substr("$statcat", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$status_name = sprintf("%-60s", $statname_list[$RAWstatus]);
|
||||
while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');}
|
||||
$statcat = sprintf("%-60s", $statcat_list[$RAWstatus]);
|
||||
while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');}
|
||||
}
|
||||
|
||||
|
||||
echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($TOTALcalls < 1)
|
||||
{
|
||||
$TOTALhours = '0:00:00';
|
||||
$TOTALavg = '0:00:00';
|
||||
$TOTALrate = '0.00';
|
||||
}
|
||||
else
|
||||
{
|
||||
$TOTALrate = ($TOTALcalls / ($TOTALsec / 3600) );
|
||||
$TOTALrate = sprintf("%.2f", $TOTALrate);
|
||||
|
||||
$TOTALhours_H = ($TOTALsec / 3600);
|
||||
$TOTALhours_H_int = round($TOTALhours_H, 2);
|
||||
$TOTALhours_H_int = intval("$TOTALhours_H_int");
|
||||
$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
|
||||
$TOTALhours_M = ($TOTALhours_M * 60);
|
||||
$TOTALhours_M_int = round($TOTALhours_M, 2);
|
||||
$TOTALhours_M_int = intval("$TOTALhours_M_int");
|
||||
$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
|
||||
$TOTALhours_S = ($TOTALhours_S * 60);
|
||||
$TOTALhours_S = round($TOTALhours_S, 0);
|
||||
if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
|
||||
if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
|
||||
$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
|
||||
|
||||
$TOTALavg_H = (($TOTALsec / 3600) / $TOTALcalls);
|
||||
$TOTALavg_H_int = round($TOTALavg_H, 2);
|
||||
$TOTALavg_H_int = intval("$TOTALavg_H_int");
|
||||
$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
|
||||
$TOTALavg_M = ($TOTALavg_M * 60);
|
||||
$TOTALavg_M_int = round($TOTALavg_M, 2);
|
||||
$TOTALavg_M_int = intval("$TOTALavg_M_int");
|
||||
$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
|
||||
$TOTALavg_S = ($TOTALavg_S * 60);
|
||||
$TOTALavg_S = round($TOTALavg_S, 0);
|
||||
if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
|
||||
if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
|
||||
$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
|
||||
}
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
$TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTALhours = substr("$TOTALhours", 0, -1);}
|
||||
$TOTALavg = sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);}
|
||||
$TOTALrate = sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);}
|
||||
|
||||
echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
|
||||
echo "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |\n";
|
||||
echo "+------------------------------------------------------+------------+------------+----------+----------+\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### STATUS CATEGORY STATS
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CUSTOM STATUS CATEGORY STATS\n";
|
||||
echo "+----------------------+------------+--------------------------------+\n";
|
||||
echo "| CATEGORY | CALLS | DESCRIZIONE |\n";
|
||||
echo "+----------------------+------------+--------------------------------+\n";
|
||||
|
||||
$TOTCATcalls=0;
|
||||
$r=0;
|
||||
while ($r < $statcats_to_print)
|
||||
{
|
||||
if ($vsc_id[$r] != 'UNDEFINED')
|
||||
{
|
||||
$TOTCATcalls = ($TOTCATcalls + $vsc_count[$r]);
|
||||
$category = sprintf("%-20s", $vsc_id[$r]); while(strlen($category)>20) {$category = substr("$category", 0, -1);}
|
||||
$CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);}
|
||||
$CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);}
|
||||
|
||||
echo "| $category | $CATcount | $CATname |\n";
|
||||
}
|
||||
|
||||
$r++;
|
||||
}
|
||||
|
||||
$TOTCATcalls = sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);}
|
||||
|
||||
echo "+----------------------+------------+--------------------------------+\n";
|
||||
echo "| TOTAL | $TOTCATcalls |\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### USER STATS
|
||||
|
||||
$TOTagents=0;
|
||||
$TOTcalls=0;
|
||||
$TOTtime=0;
|
||||
$TOTavg=0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- STATISTICHE OPERATORE\n";
|
||||
echo "+--------------------------+------------+----------+--------+\n";
|
||||
echo "| AGENT | CALLS | TEMPO M | MEDIA M |\n";
|
||||
echo "+--------------------------+------------+----------+--------+\n";
|
||||
|
||||
$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $users_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTcalls = ($TOTcalls + $row[2]);
|
||||
$TOTtime = ($TOTtime + $row[3]);
|
||||
|
||||
$user = sprintf("%-6s", $row[0]);
|
||||
$full_name = sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
|
||||
$USERcalls = sprintf("%10s", $row[2]);
|
||||
$USERtotTALK = $row[3];
|
||||
$USERavgTALK = $row[4];
|
||||
|
||||
$USERtotTALK_M = ($USERtotTALK / 60);
|
||||
$USERtotTALK_M_int = round($USERtotTALK_M, 2);
|
||||
$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
|
||||
$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
|
||||
$USERtotTALK_S = ($USERtotTALK_S * 60);
|
||||
$USERtotTALK_S = round($USERtotTALK_S, 0);
|
||||
if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
|
||||
$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
|
||||
$USERtotTALK_MS = sprintf("%8s", $USERtotTALK_MS);
|
||||
|
||||
$USERavgTALK_M = ($USERavgTALK / 60);
|
||||
$USERavgTALK_M_int = round($USERavgTALK_M, 2);
|
||||
$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
|
||||
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
|
||||
$USERavgTALK_S = ($USERavgTALK_S * 60);
|
||||
$USERavgTALK_S = round($USERavgTALK_S, 0);
|
||||
if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
|
||||
$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
|
||||
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
|
||||
|
||||
echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (!$TOTcalls) {$TOTcalls = 1;}
|
||||
$TOTavg = ($TOTtime / $TOTcalls);
|
||||
$TOTavg = round($TOTavg, 0);
|
||||
$TOTavg_M = ($TOTavg / 60);
|
||||
$TOTavg_M_int = round($TOTavg_M, 2);
|
||||
$TOTavg_M_int = intval("$TOTavg_M_int");
|
||||
$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
|
||||
$TOTavg_S = ($TOTavg_S * 60);
|
||||
$TOTavg_S = round($TOTavg_S, 0);
|
||||
if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
|
||||
$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
|
||||
$TOTavg = sprintf("%6s", $TOTavg_MS);
|
||||
|
||||
$TOTtime_M = ($TOTtime / 60);
|
||||
$TOTtime_M_int = round($TOTtime_M, 2);
|
||||
$TOTtime_M_int = intval("$TOTtime_M_int");
|
||||
$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
|
||||
$TOTtime_S = ($TOTtime_S * 60);
|
||||
$TOTtime_S = round($TOTtime_S, 0);
|
||||
if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
|
||||
$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
|
||||
$TOTtime = sprintf("%6s", $TOTtime_MS);
|
||||
|
||||
$TOTagents = sprintf("%10s", $i);
|
||||
$TOTcalls = sprintf("%10s", $TOTcalls);
|
||||
$TOTtime = sprintf("%8s", $TOTtime);
|
||||
$TOTavg = sprintf("%6s", $TOTavg);
|
||||
|
||||
echo "+--------------------------+------------+----------+--------+\n";
|
||||
echo "| TOTALE Operatori: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
|
||||
echo "+--------------------------+------------+----------+--------+\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### TIME STATS
|
||||
|
||||
echo "\n";
|
||||
echo "---------- STATISTICHE TEMPO\n";
|
||||
|
||||
echo "<FONT SIZE=0>\n";
|
||||
|
||||
$hi_hour_count=0;
|
||||
$last_full_record=0;
|
||||
$i=0;
|
||||
$h=0;
|
||||
while ($i <= 96)
|
||||
{
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($hi_hour_count < 1)
|
||||
{$hour_multiplier = 0;}
|
||||
else
|
||||
{
|
||||
$hour_multiplier = (100 / $hi_hour_count);
|
||||
#$hour_multiplier = round($hour_multiplier, 0);
|
||||
}
|
||||
|
||||
echo "<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
|
||||
echo "GRAFICO AD INCREMENTO DI 15 MINUTI DEL TOTALE DELLE CHIAMATE TAKEN INTO THIS IN-GROUP\n";
|
||||
|
||||
$k=1;
|
||||
$Mk=0;
|
||||
$call_scale = '0';
|
||||
while ($k <= 102)
|
||||
{
|
||||
if ($Mk >= 5)
|
||||
{
|
||||
$Mk=0;
|
||||
if ( ($k < 1) or ($hour_multiplier <= 0) )
|
||||
{$scale_num = 100;}
|
||||
else
|
||||
{
|
||||
$scale_num=($k / $hour_multiplier);
|
||||
$scale_num = round($scale_num, 0);
|
||||
}
|
||||
$LENscale_num = (strlen($scale_num));
|
||||
$k = ($k + $LENscale_num);
|
||||
$call_scale .= "$scale_num";
|
||||
}
|
||||
else
|
||||
{
|
||||
$call_scale .= " ";
|
||||
$k++; $Mk++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
|
||||
#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n";
|
||||
echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
|
||||
|
||||
$ZZ = '00';
|
||||
$i=0;
|
||||
$h=4;
|
||||
$hour= -1;
|
||||
$no_lines_yet=1;
|
||||
|
||||
while ($i <= 96)
|
||||
{
|
||||
$char_counter=0;
|
||||
$time = ' ';
|
||||
if ($h >= 4)
|
||||
{
|
||||
$hour++;
|
||||
$h=0;
|
||||
if ($hour < 10) {$hour = "0$hour";}
|
||||
$time = "+$hour$ZZ+";
|
||||
}
|
||||
if ($h == 1) {$time = " 15 ";}
|
||||
if ($h == 2) {$time = " 30 ";}
|
||||
if ($h == 3) {$time = " 45 ";}
|
||||
$Ghour_count = $hour_count[$i];
|
||||
if ($Ghour_count < 1)
|
||||
{
|
||||
if ( ($no_lines_yet) or ($i > $last_full_record) )
|
||||
{
|
||||
$do_nothing=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
echo "|$time|";
|
||||
$k=0; while ($k <= 102) {echo " "; $k++;}
|
||||
echo "| $hour_count[$i] |\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_lines_yet=0;
|
||||
$Xhour_count = ($Ghour_count * $hour_multiplier);
|
||||
$Yhour_count = (99 - $Xhour_count);
|
||||
|
||||
$Gdrop_count = $drop_count[$i];
|
||||
if ($Gdrop_count < 1)
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
|
||||
echo "|$time|<SPAN class=\"green\">";
|
||||
$k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;}
|
||||
echo "*X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 101) {echo " "; $char_counter++;}
|
||||
echo "| 0 | $hour_count[$i] |\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$Xdrop_count = ($Gdrop_count * $hour_multiplier);
|
||||
|
||||
# if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
|
||||
|
||||
$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
|
||||
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
$drop_count[$i] = sprintf("%-5s", $drop_count[$i]);
|
||||
|
||||
echo "|$time|<SPAN class=\"red\">";
|
||||
$k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;}
|
||||
echo "D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;}
|
||||
echo "X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 102) {echo " "; $char_counter++;}
|
||||
echo "| $drop_count[$i] | $hour_count[$i] |\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
echo "\nRun Time: $RUNtime seconds\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,916 @@
|
||||
<?
|
||||
# AST_VDADstats.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 61215-1139 - Added drop percentage of answered and round-2 decimal
|
||||
# 71008-1436 - Added shift to be defined in dbconnect.php
|
||||
# 71218-1155 - Added end_date for multi-day reports
|
||||
# 80430-1920 - Added Customer hangup cause stats
|
||||
# 80620-0031 - Fixed human answered calculation for drop perfentage
|
||||
# 80709-0230 - Added time stats to call statuses
|
||||
# 80717-2118 - Added calls/hour out of agent login time in status summary
|
||||
# 80722-2049 - Added Status Category stats
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["agent_hours"])) {$agent_hours=$_GET["agent_hours"];}
|
||||
elseif (isset($_POST["agent_hours"])) {$agent_hours=$_POST["agent_hours"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
|
||||
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $groups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="select vsc_id,vsc_name from vicidial_status_categories;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statcats_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $statcats_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vsc_id[$i] = $row[0];
|
||||
$vsc_name[$i] = $row[1];
|
||||
$vsc_count[$i] = 0;
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: VDAD Stats</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=agent_hours VALUE=\"$agent_hours\">\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
|
||||
echo " to <INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($groups_to_print > $o)
|
||||
{
|
||||
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<SELECT SIZE=1 NAME=shift>\n";
|
||||
echo "<option selected value=\"$shift\">$shift</option>\n";
|
||||
echo "<option value=\"\">--</option>\n";
|
||||
echo "<option value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "<option value=\"ALL\">ALL</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT type=submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFICA</a> | <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo "PER FAVORE SELEZIONA UNA CAMPAGNA E UNA DATA, POI PREMI INVIA\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($shift == 'AM')
|
||||
{
|
||||
$time_BEGIN=$AM_shift_BEGIN;
|
||||
$time_END=$AM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "15:15:00";}
|
||||
}
|
||||
if ($shift == 'PM')
|
||||
{
|
||||
$time_BEGIN=$PM_shift_BEGIN;
|
||||
$time_END=$PM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:15:00";}
|
||||
}
|
||||
if ($shift == 'ALL')
|
||||
{
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:59:59";}
|
||||
}
|
||||
$query_date_BEGIN = "$query_date $time_BEGIN";
|
||||
$query_date_END = "$end_date $time_END";
|
||||
|
||||
|
||||
|
||||
echo "VICIDIAL: Statistiche Auto-Dial $NOW_TIME\n";
|
||||
|
||||
echo "\n";
|
||||
echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- TOTALI\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $row[0]);
|
||||
$TOTALsec = $row[1];
|
||||
if ( ($row[0] < 1) or ($TOTALsec < 1) )
|
||||
{$average_hold_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_hold_seconds = ($TOTALsec / $row[0]);
|
||||
$average_hold_seconds = round($average_hold_seconds, 2);
|
||||
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
|
||||
}
|
||||
echo "Totale Chiamate Effettuate Per Questa Campagna: $TOTALcalls\n";
|
||||
echo "Durata Media per Tutte Le Chiamate In Secondi: $average_hold_seconds\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- ABBATTUTE\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DROPcalls = sprintf("%10s", $row[0]);
|
||||
$DROPcallsRAW = $row[0];
|
||||
$DROPseconds = $row[1];
|
||||
|
||||
|
||||
# GET LIST OF ALL STATUSES and create SQL from human_answered statuses
|
||||
$q=0;
|
||||
$stmt = "SELECT status,status_name,human_answered,category from vicidial_statuses;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$p=0;
|
||||
while ($p < $statuses_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$status[$q] = $row[0];
|
||||
$status_name[$q] = $row[1];
|
||||
$human_answered[$q] = $row[2];
|
||||
$category[$q] = $row[3];
|
||||
$statname_list["$status[$q]"] = "$status_name[$q]";
|
||||
$statcat_list["$status[$q]"] = "$category[$q]";
|
||||
if ($human_answered[$q]=='Y')
|
||||
{$camp_ANS_STAT_SQL .= "'$row[0]',";}
|
||||
$q++;
|
||||
$p++;
|
||||
}
|
||||
$stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$p=0;
|
||||
while ($p < $statuses_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$status[$q] = $row[0];
|
||||
$status_name[$q] = $row[1];
|
||||
$human_answered[$q] = $row[2];
|
||||
$category[$q] = $row[3];
|
||||
$statname_list["$status[$q]"] = "$status_name[$q]";
|
||||
$statcat_list["$status[$q]"] = "$category[$q]";
|
||||
if ($human_answered[$q]=='Y')
|
||||
{$camp_ANS_STAT_SQL .= "'$row[0]',";}
|
||||
$q++;
|
||||
$p++;
|
||||
}
|
||||
$camp_ANS_STAT_SQL = eregi_replace(",$",'',$camp_ANS_STAT_SQL);
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN($camp_ANS_STAT_SQL);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$ANSWERcalls = $row[0];
|
||||
|
||||
if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
|
||||
{$DROPpercent = '0';}
|
||||
else
|
||||
{
|
||||
$DROPpercent = (($DROPcallsRAW / $TOTALcalls) * 100);
|
||||
$DROPpercent = round($DROPpercent, 2);
|
||||
}
|
||||
|
||||
if ( ($DROPcalls < 1) or ($ANSWERcalls < 1) )
|
||||
{$DROPANSWERpercent = '0';}
|
||||
else
|
||||
{
|
||||
$DROPANSWERpercent = (($DROPcallsRAW / $ANSWERcalls) * 100);
|
||||
$DROPANSWERpercent = round($DROPANSWERpercent, 2);
|
||||
}
|
||||
|
||||
if ( ($DROPseconds < 1) or ($DROPcallsRAW < 1) )
|
||||
{$average_hold_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_hold_seconds = ($DROPseconds / $DROPcallsRAW);
|
||||
$average_hold_seconds = round($average_hold_seconds, 2);
|
||||
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
|
||||
}
|
||||
|
||||
echo "Totale Chiamate ABBATTUTE: $DROPcalls $DROPpercent%\n";
|
||||
echo "Percentuale Di Chiamate ABBATTUTE Su Chiamate Con Risposta: $DROPcalls / $ANSWERcalls $DROPANSWERpercent%\n";
|
||||
echo "Durata Media Chiamate ABBATTUTE in secondi: $average_hold_seconds\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- NESSUNA RISPOSTA AUTO-DIAL\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$NAcalls = sprintf("%10s", $row[0]);
|
||||
if ( ($NAcalls < 1) or ($TOTALcalls < 1) )
|
||||
{$NApercent = '0';}
|
||||
else
|
||||
{
|
||||
$NApercent = (($NAcalls / $TOTALcalls) * 100);
|
||||
$NApercent = round($NApercent, 2);
|
||||
}
|
||||
|
||||
if ( ($row[0] < 1) or ($row[1] < 1) )
|
||||
{$average_na_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_na_seconds = ($row[1] / $row[0]);
|
||||
$average_na_seconds = round($average_na_seconds, 2);
|
||||
$average_na_seconds = sprintf("%10s", $average_na_seconds);
|
||||
}
|
||||
|
||||
echo "Totale Chiamate Senza Risposta - occupato, disconnesso, fuori posto...: $NAcalls $NApercent%\n";
|
||||
echo "Durata Media Chiamate Senza Risposta in secondi: $average_na_seconds\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL HANGUP REASON STATS
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL HANGUP REASON STATS\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
echo "| HANGUP REASON | CALLS |\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
|
||||
$stmt="select count(*),term_reason from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by term_reason;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $reasons_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = ($TOTALcalls + $row[0]);
|
||||
|
||||
$REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);}
|
||||
$reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);}
|
||||
if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';}
|
||||
if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER ';}
|
||||
|
||||
echo "| $reason | $REASONcount |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
|
||||
echo "+----------------------+------------+\n";
|
||||
echo "| TOTAL: | $TOTALcalls |\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL STATUS STATS
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL STATUS STATS\n";
|
||||
echo "+--------+----------------------+----------------------+------------+----------------------------------+----------+\n";
|
||||
echo "| | | | | CALL TIME |AGENT TIME|\n";
|
||||
echo "| STATUS | DESCRIZIONE | CATEGORY | CALLS | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
|
||||
echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
|
||||
|
||||
|
||||
## Pull the count of agent seconds for the total tally
|
||||
$stmt="SELECT sum(pause_sec + wait_sec + talk_sec + dispo_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$Ctally_to_print = mysql_num_rows($rslt);
|
||||
if ($Ctally_to_print > 0)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$AGENTsec = "$rowx[0]";
|
||||
}
|
||||
|
||||
|
||||
## get counts and time totals for all statuses in this campaign
|
||||
$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $statuses_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$STATUScount = $row[0];
|
||||
$RAWstatus = $row[1];
|
||||
$r=0;
|
||||
while ($r < $statcats_to_print)
|
||||
{
|
||||
if ($statcat_list[$RAWstatus] == "$vsc_id[$r]")
|
||||
{
|
||||
$vsc_count[$r] = ($vsc_count[$r] + $STATUScount);
|
||||
}
|
||||
$r++;
|
||||
}
|
||||
if ($AGENTsec < 1) {$AGENTsec=1;}
|
||||
$TOTALcalls = ($TOTALcalls + $row[0]);
|
||||
$STATUSrate = ($STATUScount / ($TOTALsec / 3600) );
|
||||
$STATUSrate = sprintf("%.2f", $STATUSrate);
|
||||
$AGENTrate = ($STATUScount / ($AGENTsec / 3600) );
|
||||
$AGENTrate = sprintf("%.2f", $AGENTrate);
|
||||
|
||||
$STATUShours_H = ($row[2] / 3600);
|
||||
$STATUShours_H_int = round($STATUShours_H, 2);
|
||||
$STATUShours_H_int = intval("$STATUShours_H_int");
|
||||
$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
|
||||
$STATUShours_M = ($STATUShours_M * 60);
|
||||
$STATUShours_M_int = round($STATUShours_M, 2);
|
||||
$STATUShours_M_int = intval("$STATUShours_M_int");
|
||||
$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
|
||||
$STATUShours_S = ($STATUShours_S * 60);
|
||||
$STATUShours_S = round($STATUShours_S, 0);
|
||||
if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
|
||||
if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
|
||||
$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
|
||||
|
||||
$STATUSavg_H = (($row[2] / 3600) / $STATUScount);
|
||||
$STATUSavg_H_int = round($STATUSavg_H, 2);
|
||||
$STATUSavg_H_int = intval("$STATUSavg_H_int");
|
||||
$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
|
||||
$STATUSavg_M = ($STATUSavg_M * 60);
|
||||
$STATUSavg_M_int = round($STATUSavg_M, 2);
|
||||
$STATUSavg_M_int = intval("$STATUSavg_M_int");
|
||||
$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
|
||||
$STATUSavg_S = ($STATUSavg_S * 60);
|
||||
$STATUSavg_S = round($STATUSavg_S, 0);
|
||||
if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
|
||||
if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
|
||||
$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
|
||||
|
||||
$STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
|
||||
$status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);}
|
||||
$STATUShours = sprintf("%10s", $STATUShours);while(strlen($STATUShours)>10) {$STATUShours = substr("$STATUShours", 0, -1);}
|
||||
$STATUSavg = sprintf("%8s", $STATUSavg);while(strlen($STATUSavg)>8) {$STATUSavg = substr("$STATUSavg", 0, -1);}
|
||||
$STATUSrate = sprintf("%8s", $STATUSrate);while(strlen($STATUSrate)>8) {$STATUSrate = substr("$STATUSrate", 0, -1);}
|
||||
$AGENTrate = sprintf("%8s", $AGENTrate);while(strlen($AGENTrate)>8) {$AGENTrate = substr("$AGENTrate", 0, -1);}
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$status_name = sprintf("%-20s", $statname_list[$RAWstatus]);
|
||||
while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);}
|
||||
$statcat = sprintf("%-20s", $statcat_list[$RAWstatus]);
|
||||
while(strlen($statcat)>20) {$statcat = substr("$statcat", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$status_name = sprintf("%-60s", $statname_list[$RAWstatus]);
|
||||
while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');}
|
||||
$statcat = sprintf("%-60s", $statcat_list[$RAWstatus]);
|
||||
while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');}
|
||||
}
|
||||
|
||||
echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate | $AGENTrate |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($TOTALcalls < 1)
|
||||
{
|
||||
$TOTALhours = '0:00:00';
|
||||
$TOTALavg = '0:00:00';
|
||||
$TOTALrate = '0.00';
|
||||
}
|
||||
else
|
||||
{
|
||||
$TOTALrate = ($TOTALcalls / ($TOTALsec / 3600) );
|
||||
$TOTALrate = sprintf("%.2f", $TOTALrate);
|
||||
$aTOTALrate = ($TOTALcalls / ($AGENTsec / 3600) );
|
||||
$aTOTALrate = sprintf("%.2f", $aTOTALrate);
|
||||
|
||||
$aTOTALhours_H = ($AGENTsec / 3600);
|
||||
$aTOTALhours_H_int = round($aTOTALhours_H, 2);
|
||||
$aTOTALhours_H_int = intval("$aTOTALhours_H_int");
|
||||
$aTOTALhours_M = ($aTOTALhours_H - $aTOTALhours_H_int);
|
||||
$aTOTALhours_M = ($aTOTALhours_M * 60);
|
||||
$aTOTALhours_M_int = round($aTOTALhours_M, 2);
|
||||
$aTOTALhours_M_int = intval("$aTOTALhours_M_int");
|
||||
$aTOTALhours_S = ($aTOTALhours_M - $aTOTALhours_M_int);
|
||||
$aTOTALhours_S = ($aTOTALhours_S * 60);
|
||||
$aTOTALhours_S = round($aTOTALhours_S, 0);
|
||||
if ($aTOTALhours_S < 10) {$aTOTALhours_S = "0$aTOTALhours_S";}
|
||||
if ($aTOTALhours_M_int < 10) {$aTOTALhours_M_int = "0$aTOTALhours_M_int";}
|
||||
$aTOTALhours = "$aTOTALhours_H_int:$aTOTALhours_M_int:$aTOTALhours_S";
|
||||
|
||||
$TOTALhours_H = ($TOTALsec / 3600);
|
||||
$TOTALhours_H_int = round($TOTALhours_H, 2);
|
||||
$TOTALhours_H_int = intval("$TOTALhours_H_int");
|
||||
$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
|
||||
$TOTALhours_M = ($TOTALhours_M * 60);
|
||||
$TOTALhours_M_int = round($TOTALhours_M, 2);
|
||||
$TOTALhours_M_int = intval("$TOTALhours_M_int");
|
||||
$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
|
||||
$TOTALhours_S = ($TOTALhours_S * 60);
|
||||
$TOTALhours_S = round($TOTALhours_S, 0);
|
||||
if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
|
||||
if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
|
||||
$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
|
||||
|
||||
$TOTALavg_H = (($TOTALsec / 3600) / $TOTALcalls);
|
||||
$TOTALavg_H_int = round($TOTALavg_H, 2);
|
||||
$TOTALavg_H_int = intval("$TOTALavg_H_int");
|
||||
$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
|
||||
$TOTALavg_M = ($TOTALavg_M * 60);
|
||||
$TOTALavg_M_int = round($TOTALavg_M, 2);
|
||||
$TOTALavg_M_int = intval("$TOTALavg_M_int");
|
||||
$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
|
||||
$TOTALavg_S = ($TOTALavg_S * 60);
|
||||
$TOTALavg_S = round($TOTALavg_S, 0);
|
||||
if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
|
||||
if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
|
||||
$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
|
||||
}
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
$TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTALhours = substr("$TOTALhours", 0, -1);}
|
||||
$aTOTALhours = sprintf("%10s", $aTOTALhours);while(strlen($aTOTALhours)>10) {$aTOTALhours = substr("$aTOTALhours", 0, -1);}
|
||||
$TOTALavg = sprintf("%8s", $TOTALavg);while(strlen($TOTALavg)>8) {$TOTALavg = substr("$TOTALavg", 0, -1);}
|
||||
$TOTALrate = sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);}
|
||||
$aTOTALrate = sprintf("%8s", $aTOTALrate);while(strlen($aTOTALrate)>8) {$aTOTALrate = substr("$aTOTALrate", 0, -1);}
|
||||
|
||||
echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
|
||||
echo "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate | |\n";
|
||||
echo "| AGENT TIME | $aTOTALhours | | $aTOTALrate |\n";
|
||||
echo "+------------------------------------------------------+------------+------------+---------------------+----------+\n";
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### STATUS CATEGORY STATS
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CUSTOM STATUS CATEGORY STATS\n";
|
||||
echo "+----------------------+------------+--------------------------------+\n";
|
||||
echo "| CATEGORY | CALLS | DESCRIZIONE |\n";
|
||||
echo "+----------------------+------------+--------------------------------+\n";
|
||||
|
||||
|
||||
$TOTCATcalls=0;
|
||||
$r=0;
|
||||
while ($r < $statcats_to_print)
|
||||
{
|
||||
if ($vsc_id[$r] != 'UNDEFINED')
|
||||
{
|
||||
$TOTCATcalls = ($TOTCATcalls + $vsc_count[$r]);
|
||||
$category = sprintf("%-20s", $vsc_id[$r]); while(strlen($category)>20) {$category = substr("$category", 0, -1);}
|
||||
$CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);}
|
||||
$CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);}
|
||||
|
||||
echo "| $category | $CATcount | $CATname |\n";
|
||||
}
|
||||
$r++;
|
||||
}
|
||||
|
||||
$TOTCATcalls = sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);}
|
||||
|
||||
echo "+----------------------+------------+--------------------------------+\n";
|
||||
echo "| TOTAL | $TOTCATcalls |\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### USER STATS
|
||||
|
||||
$TOTagents=0;
|
||||
$TOTcalls=0;
|
||||
$TOTtime=0;
|
||||
$TOTavg=0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- STATISTICHE OPERATORE\n";
|
||||
echo "+--------------------------+------------+----------+--------+\n";
|
||||
echo "| AGENT | CALLS | TEMPO M | MEDIA M |\n";
|
||||
echo "+--------------------------+------------+----------+--------+\n";
|
||||
|
||||
$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $users_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTcalls = ($TOTcalls + $row[2]);
|
||||
$TOTtime = ($TOTtime + $row[3]);
|
||||
|
||||
$user = sprintf("%-6s", $row[0]);while(strlen($user)>6) {$user = substr("$user", 0, -1);}
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$full_name = sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$full_name = sprintf("%-45s", $row[1]); while(mb_strlen($full_name,'utf-8')>15) {$full_name = mb_substr("$full_name", 0, -1,'utf-8');}
|
||||
}
|
||||
$USERcalls = sprintf("%10s", $row[2]);
|
||||
$USERtotTALK = $row[3];
|
||||
$USERavgTALK = $row[4];
|
||||
|
||||
$USERtotTALK_M = ($USERtotTALK / 60);
|
||||
$USERtotTALK_M_int = round($USERtotTALK_M, 2);
|
||||
$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
|
||||
$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
|
||||
$USERtotTALK_S = ($USERtotTALK_S * 60);
|
||||
$USERtotTALK_S = round($USERtotTALK_S, 0);
|
||||
if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
|
||||
$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
|
||||
$USERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS);
|
||||
|
||||
$USERavgTALK_M = ($USERavgTALK / 60);
|
||||
$USERavgTALK_M_int = round($USERavgTALK_M, 2);
|
||||
$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
|
||||
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
|
||||
$USERavgTALK_S = ($USERavgTALK_S * 60);
|
||||
$USERavgTALK_S = round($USERavgTALK_S, 0);
|
||||
if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
|
||||
$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
|
||||
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
|
||||
|
||||
echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (!$TOTcalls) {$TOTcalls = 1;}
|
||||
$TOTavg = ($TOTtime / $TOTcalls);
|
||||
$TOTavg = round($TOTavg, 0);
|
||||
$TOTavg_M = ($TOTavg / 60);
|
||||
$TOTavg_M_int = round($TOTavg_M, 2);
|
||||
$TOTavg_M_int = intval("$TOTavg_M_int");
|
||||
$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
|
||||
$TOTavg_S = ($TOTavg_S * 60);
|
||||
$TOTavg_S = round($TOTavg_S, 0);
|
||||
if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
|
||||
$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
|
||||
$TOTavg = sprintf("%6s", $TOTavg_MS);
|
||||
|
||||
$TOTtime_M = ($TOTtime / 60);
|
||||
$TOTtime_M_int = round($TOTtime_M, 2);
|
||||
$TOTtime_M_int = intval("$TOTtime_M_int");
|
||||
$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
|
||||
$TOTtime_S = ($TOTtime_S * 60);
|
||||
$TOTtime_S = round($TOTtime_S, 0);
|
||||
if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
|
||||
$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
|
||||
$TOTtime = sprintf("%6s", $TOTtime_MS);
|
||||
|
||||
$TOTagents = sprintf("%10s", $i);
|
||||
$TOTcalls = sprintf("%10s", $TOTcalls);
|
||||
$TOTtime = sprintf("%8s", $TOTtime);
|
||||
$TOTavg = sprintf("%6s", $TOTavg);
|
||||
|
||||
$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$AVGwait = $row[0];
|
||||
$AVGwait_M = ($AVGwait / 60);
|
||||
$AVGwait_M_int = round($AVGwait_M, 2);
|
||||
$AVGwait_M_int = intval("$AVGwait_M_int");
|
||||
$AVGwait_S = ($AVGwait_M - $AVGwait_M_int);
|
||||
$AVGwait_S = ($AVGwait_S * 60);
|
||||
$AVGwait_S = round($AVGwait_S, 0);
|
||||
if ($AVGwait_S < 10) {$AVGwait_S = "0$AVGwait_S";}
|
||||
$AVGwait_MS = "$AVGwait_M_int:$AVGwait_S";
|
||||
$AVGwait = sprintf("%6s", $AVGwait_MS);
|
||||
|
||||
echo "+--------------------------+------------+----------+--------+\n";
|
||||
echo "| TOTALE Operatori: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
|
||||
echo "+--------------------------+------------+----------+--------+\n";
|
||||
echo "| Tempo Medio di Attesa Tra Due Chiamate $AVGwait |\n";
|
||||
echo "+-----------------------------------------------------------+\n";
|
||||
|
||||
##############################
|
||||
######### TIME STATS
|
||||
|
||||
echo "\n";
|
||||
echo "---------- STATISTICHE TEMPO\n";
|
||||
|
||||
echo "<FONT SIZE=0>\n";
|
||||
|
||||
$hi_hour_count=0;
|
||||
$last_full_record=0;
|
||||
$i=0;
|
||||
$h=0;
|
||||
while ($i <= 96)
|
||||
{
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($hi_hour_count < 1)
|
||||
{$hour_multiplier = 0;}
|
||||
else
|
||||
{
|
||||
$hour_multiplier = (100 / $hi_hour_count);
|
||||
#$hour_multiplier = round($hour_multiplier, 0);
|
||||
}
|
||||
|
||||
echo "<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
|
||||
echo "GRAFICO AD INCREMENTO DI 15 MINUTI DEL TOTALE DELLE CHIAMATE EFFETTUATE PER QUESTA CAMPAGNA\n";
|
||||
|
||||
$k=1;
|
||||
$Mk=0;
|
||||
$call_scale = '0';
|
||||
while ($k <= 102)
|
||||
{
|
||||
if ($Mk >= 5)
|
||||
{
|
||||
$Mk=0;
|
||||
if ( ($k < 1) or ($hour_multiplier <= 0) )
|
||||
{$scale_num = 100;}
|
||||
else
|
||||
{
|
||||
$scale_num=($k / $hour_multiplier);
|
||||
$scale_num = round($scale_num, 0);
|
||||
}
|
||||
$LENscale_num = (strlen($scale_num));
|
||||
$k = ($k + $LENscale_num);
|
||||
$call_scale .= "$scale_num";
|
||||
}
|
||||
else
|
||||
{
|
||||
$call_scale .= " ";
|
||||
$k++; $Mk++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
|
||||
#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n";
|
||||
echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
|
||||
|
||||
$ZZ = '00';
|
||||
$i=0;
|
||||
$h=4;
|
||||
$hour= -1;
|
||||
$no_lines_yet=1;
|
||||
|
||||
while ($i <= 96)
|
||||
{
|
||||
$char_counter=0;
|
||||
$time = ' ';
|
||||
if ($h >= 4)
|
||||
{
|
||||
$hour++;
|
||||
$h=0;
|
||||
if ($hour < 10) {$hour = "0$hour";}
|
||||
$time = "+$hour$ZZ+";
|
||||
}
|
||||
if ($h == 1) {$time = " 15 ";}
|
||||
if ($h == 2) {$time = " 30 ";}
|
||||
if ($h == 3) {$time = " 45 ";}
|
||||
$Ghour_count = $hour_count[$i];
|
||||
if ($Ghour_count < 1)
|
||||
{
|
||||
if ( ($no_lines_yet) or ($i > $last_full_record) )
|
||||
{
|
||||
$do_nothing=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
echo "|$time|";
|
||||
$k=0; while ($k <= 102) {echo " "; $k++;}
|
||||
echo "| $hour_count[$i] |\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_lines_yet=0;
|
||||
$Xhour_count = ($Ghour_count * $hour_multiplier);
|
||||
$Yhour_count = (99 - $Xhour_count);
|
||||
|
||||
$Gdrop_count = $drop_count[$i];
|
||||
if ($Gdrop_count < 1)
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
|
||||
echo "|$time|<SPAN class=\"green\">";
|
||||
$k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;}
|
||||
echo "*X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 101) {echo " "; $char_counter++;}
|
||||
echo "| 0 | $hour_count[$i] |\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$Xdrop_count = ($Gdrop_count * $hour_multiplier);
|
||||
|
||||
# if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
|
||||
|
||||
$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
|
||||
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
$drop_count[$i] = sprintf("%-5s", $drop_count[$i]);
|
||||
|
||||
echo "|$time|<SPAN class=\"red\">";
|
||||
$k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;}
|
||||
echo "D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;}
|
||||
echo "X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 102) {echo " "; $char_counter++;}
|
||||
echo "| $drop_count[$i] | $hour_count[$i] |\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
echo "\nRun Time: $RUNtime seconds\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,169 @@
|
||||
<?
|
||||
# AST_VICIDIAL_hopperlist.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60619-1654 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 70115-1614 - Added ALT field for vicidial_hopper alt_dial column
|
||||
# 71029-0852 - Added list_id to the output
|
||||
# 71030-2118 - Added priority to display
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_campaigns='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($server_ip)) {$server_ip = '10.10.10.15';}
|
||||
|
||||
$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $campaigns_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$campaign_id[$i] =$row[0];
|
||||
$campaign_name[$i] =$row[1];
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: Coda Chiamate</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
#echo "<INPUT TYPE=HIDDEN NAME=server_ip VALUE=\"$server_ip\">\n";
|
||||
#echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($campaigns_to_print > $o)
|
||||
{
|
||||
if ($campaign_id[$o] == $group) {echo "<option selected value=\"$campaign_id[$o]\">$campaign_id[$o] - $campaign_name[$o]</option>\n";}
|
||||
else {echo "<option value=\"$campaign_id[$o]\">$campaign_id[$o] - $campaign_name[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo " <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFICA</a> \n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo "PER FAVORE SELEZIONA UNA CAMPAGNA E PREMI INVIA\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
echo "VICIDIAL: Coda Contatti Da Chiamare In Tempo Reale $NOW_TIME\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- TOTALI\n";
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $row[0]);
|
||||
|
||||
echo "Totale Contatti Nella Coda Chiamate In Questo Istante: $TOTALcalls\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### LEAD STATS
|
||||
|
||||
echo "\n";
|
||||
echo "---------- LEADS IN HOPPER\n";
|
||||
echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
|
||||
echo "|ORDER |PRIORITY| LEAD ID | ID LISTA | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n";
|
||||
echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
|
||||
|
||||
$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $users_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$FMT_i = sprintf("%-4s", $i);
|
||||
$lead_id = sprintf("%-9s", $row[0]);
|
||||
$phone_number = sprintf("%-10s", $row[1]);
|
||||
$state = sprintf("%-5s", $row[2]);
|
||||
$status = sprintf("%-6s", $row[3]);
|
||||
$count = sprintf("%-5s", $row[4]);
|
||||
$gmt = sprintf("%-6s", $row[5]);
|
||||
$hopper_id = sprintf("%-6s", $row[6]);
|
||||
$alt_dial = sprintf("%-5s", $row[7]);
|
||||
$list_id = sprintf("%-10s", $row[8]);
|
||||
$priority = sprintf("%-6s", $row[9]);
|
||||
|
||||
if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";}
|
||||
else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,118 @@
|
||||
<?
|
||||
# AST_admin_log_display.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date);
|
||||
|
||||
# AST GUI database administration
|
||||
# AST_admin_log_display.php
|
||||
#
|
||||
# CHANGES
|
||||
# 50325-0932 - First build
|
||||
# 51123-1443 - removed globals=on requirement
|
||||
# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat
|
||||
#
|
||||
|
||||
$version = '0.0.4';
|
||||
$build = '60620-1044';
|
||||
|
||||
$STARTtime = date("U");
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<!-- VERSIONE: $version BUILD: $build ADD: $ADD-->\n";
|
||||
echo "<title>VICIDIAL ADMIN LOG DISPLAY</title>";
|
||||
echo "</head>\n";
|
||||
|
||||
# Fri, 25 Mar 2005
|
||||
|
||||
$DAY_DATE = date("j");
|
||||
if ($DAY_DATE < 10)
|
||||
# {$GREP_DATE = date("D, j M Y");}
|
||||
{$GREP_DATE = date("D, 0j M Y");}
|
||||
else
|
||||
{$GREP_DATE = date("D, j M Y");}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!$query_date) {$query_date = $GREP_DATE;}
|
||||
|
||||
$Gquery_date = eregi_replace(" ",'\ ',$query_date);
|
||||
echo "<!-- |$query_date|$Gquery_date| -->\n";
|
||||
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=20 MAXLENGTH=20 VALUE=\"$query_date\">\n";
|
||||
echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
echo "VICIDIAL ADMIN CHANGE LOG $NOW_TIME\n";
|
||||
|
||||
#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
|
||||
passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,257 @@
|
||||
<?
|
||||
# AST_agent_performance.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60619-1711 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 70201-1203 - Added non_latin UTF8 output code, widened USER ID to 8 chars
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
|
||||
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $campaigns_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: Agent Performance</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($campaigns_to_print > $o)
|
||||
{
|
||||
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<SELECT SIZE=1 NAME=shift>\n";
|
||||
echo "<option selected value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFICA</a> | <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n";
|
||||
echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK INVIA\n";
|
||||
echo " NOTE: stats taken from 6 hour shift specified\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($shift == 'AM')
|
||||
{
|
||||
$query_date_BEGIN = "$query_date 08:45:00";
|
||||
$query_date_END = "$query_date 15:33:00";
|
||||
$time_BEGIN = "08:45:00";
|
||||
$time_END = "15:33:00";
|
||||
}
|
||||
if ($shift == 'PM')
|
||||
{
|
||||
$query_date_BEGIN = "$query_date 15:33:00";
|
||||
$query_date_END = "$query_date 23:15:00";
|
||||
$time_BEGIN = "15:33:00";
|
||||
$time_END = "23:15:00";
|
||||
}
|
||||
|
||||
echo "VICIDIAL: Agent Performance $NOW_TIME\n";
|
||||
|
||||
echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- AGENTS Dettagliatas -------------\n\n";
|
||||
|
||||
echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
|
||||
echo "| USER NAME | ID | CALLS | TALK | TALKAVG| A | B | DC | DNC | N | NI | SALE |\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
|
||||
|
||||
$stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$TOTcalls=($TOTcalls + $row[0]);
|
||||
$TOTtotTALK=($TOTtotTALK + $row[1]);
|
||||
$calls[$i] = sprintf("%-6s", $row[0]);
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$full_name[$i]= sprintf("%-15s", $row[2]);
|
||||
while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
|
||||
|
||||
$user[$i] = sprintf("%-6s", $row[3]);
|
||||
while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$full_name[$i]= sprintf("%-45s", $row[2]);
|
||||
while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}
|
||||
|
||||
$user[$i] = sprintf("%-18s", $row[3]);
|
||||
while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');}
|
||||
}
|
||||
|
||||
$user[$i] = sprintf("%-8s", $row[3]);
|
||||
$USERtotTALK = $row[1];
|
||||
$USERavgTALK = $row[4];
|
||||
|
||||
$USERtotTALK_M = ($USERtotTALK / 60);
|
||||
$USERtotTALK_M = round($USERtotTALK_M, 2);
|
||||
$USERtotTALK_M_int = intval("$USERtotTALK_M");
|
||||
$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
|
||||
$USERtotTALK_S = ($USERtotTALK_S * 60);
|
||||
$USERtotTALK_S = round($USERtotTALK_S, 0);
|
||||
if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
|
||||
$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
|
||||
$pfUSERtotTALK_MS[$i] = sprintf("%6s", $USERtotTALK_MS);
|
||||
|
||||
$USERavgTALK_M = ($USERavgTALK / 60);
|
||||
$USERavgTALK_M = round($USERavgTALK_M, 2);
|
||||
$USERavgTALK_M_int = intval("$USERavgTALK_M");
|
||||
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
|
||||
$USERavgTALK_S = ($USERavgTALK_S * 60);
|
||||
$USERavgTALK_S = round($USERavgTALK_S, 0);
|
||||
if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
|
||||
$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
|
||||
$pfUSERavgTALK_MS[$i] = sprintf("%6s", $USERavgTALK_MS);
|
||||
$i++;
|
||||
}
|
||||
|
||||
$k=0;
|
||||
while($k < $i)
|
||||
{
|
||||
$ctA[$k]="0 "; $ctB[$k]="0 "; $ctDC[$k]="0 "; $ctDNC[$k]="0 "; $ctN[$k]="0 "; $ctNI[$k]="0 "; $ctSALE[$k]="0 ";
|
||||
$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
$m=0;
|
||||
while ($m < $rows_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]); $TOT_A = ($TOT_A + $row[0]);}
|
||||
if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]); $TOT_B = ($TOT_B + $row[0]);}
|
||||
if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]); $TOT_DC = ($TOT_DC + $row[0]);}
|
||||
if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]); $TOT_DNC = ($TOT_DNC + $row[0]);}
|
||||
if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]); $TOT_N = ($TOT_N + $row[0]);}
|
||||
if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]); $TOT_NI = ($TOT_NI + $row[0]);}
|
||||
if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]); $TOT_SALE = ($TOT_SALE + $row[0]);}
|
||||
$m++;
|
||||
}
|
||||
echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctSALE[$k] |\n";
|
||||
|
||||
|
||||
|
||||
$k++;
|
||||
}
|
||||
|
||||
$TOTcalls = sprintf("%-7s", $TOTcalls);
|
||||
|
||||
$TOTtotTALK_M = ($TOTtotTALK / 60);
|
||||
$TOTtotTALK_M = round($TOTtotTALK_M, 2);
|
||||
$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
|
||||
$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
|
||||
$TOTtotTALK_S = ($TOTtotTALK_S * 60);
|
||||
$TOTtotTALK_S = round($TOTtotTALK_S, 0);
|
||||
if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
|
||||
$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
|
||||
$TOTtotTALK_MS = sprintf("%7s", $TOTtotTALK_MS);
|
||||
while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
|
||||
|
||||
$TOT_A = sprintf("%-5s", $TOT_A);
|
||||
$TOT_B = sprintf("%-5s", $TOT_B);
|
||||
$TOT_DC = sprintf("%-5s", $TOT_DC);
|
||||
$TOT_DNC = sprintf("%-5s", $TOT_DNC);
|
||||
$TOT_N = sprintf("%-5s", $TOT_N);
|
||||
$TOT_NI = sprintf("%-5s", $TOT_NI);
|
||||
$TOT_SALE = sprintf("%-5s", $TOT_SALE);
|
||||
|
||||
echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
|
||||
echo "| TOTALI | $TOTcalls| $TOTtotTALK_MS| | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,580 @@
|
||||
<?
|
||||
# AST_agent_performance_detail.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 71119-2359 - First build
|
||||
# 71121-0144 - Replace existing AST_agent_performance_detail.php script with this one
|
||||
# - Fixed zero division bug
|
||||
# 71218-1155 - added end_date for multi-day reports
|
||||
# 80428-0144 - UTF8 cleanup
|
||||
# 80712-1007 - tally bug fixes and time display change
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];}
|
||||
elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];}
|
||||
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
|
||||
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $campaigns_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
$stmt="select user_group from vicidial_user_groups;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$user_groups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $user_groups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$user_groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: Agent Performance</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
|
||||
echo " to <INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($campaigns_to_print > $o)
|
||||
{
|
||||
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<SELECT SIZE=1 NAME=user_group>\n";
|
||||
echo "<option value=\"\">-- ALL GRUPPI UTENTI --</option>\n";
|
||||
$o=0;
|
||||
while ($user_groups_to_print > $o)
|
||||
{
|
||||
if ($user_groups[$o] == $user_group) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<SELECT SIZE=1 NAME=shift>\n";
|
||||
echo "<option selected value=\"$shift\">$shift</option>\n";
|
||||
echo "<option value=\"\">--</option>\n";
|
||||
echo "<option value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "<option value=\"ALL\">ALL</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFICA</a> | <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n";
|
||||
echo "PER FAVORE SELEZIONA UNA CAMPAGNA E UNA DATA E PREMI INVIA\n";
|
||||
echo " NOTE: stats taken from shift specified\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($shift == 'AM')
|
||||
{
|
||||
$time_BEGIN=$AM_shift_BEGIN;
|
||||
$time_END=$AM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "15:15:00";}
|
||||
}
|
||||
if ($shift == 'PM')
|
||||
{
|
||||
$time_BEGIN=$PM_shift_BEGIN;
|
||||
$time_END=$PM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:15:00";}
|
||||
}
|
||||
if ($shift == 'ALL')
|
||||
{
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:59:59";}
|
||||
}
|
||||
$query_date_BEGIN = "$query_date $time_BEGIN";
|
||||
$query_date_END = "$end_date $time_END";
|
||||
|
||||
if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
|
||||
else {$ugSQL='';}
|
||||
|
||||
echo "VICIDIAL: Agent Performance Dettagliata $NOW_TIME\n";
|
||||
|
||||
echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- AGENTS Dettagliatas -------------\n\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$statuses='-';
|
||||
$statusesTXT='';
|
||||
$statusesHEAD='';
|
||||
$statusesHTML='';
|
||||
$statusesARY[0]='';
|
||||
$j=0;
|
||||
$users='-';
|
||||
$usersARY[0]='';
|
||||
$user_namesARY[0]='';
|
||||
$k=0;
|
||||
|
||||
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by status desc,full_name limit 100000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
# $row[0] = ($row[0] - 1); # subtract 1 for login/logout event compensation
|
||||
|
||||
$calls[$i] = $row[0];
|
||||
$talk_sec[$i] = $row[1];
|
||||
$full_name[$i] = $row[2];
|
||||
$user[$i] = $row[3];
|
||||
$pause_sec[$i] = $row[4];
|
||||
$wait_sec[$i] = $row[5];
|
||||
$dispo_sec[$i] = $row[6];
|
||||
$status[$i] = $row[7];
|
||||
if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) )
|
||||
{
|
||||
$statusesTXT = sprintf("%8s", $status[$i]);
|
||||
$statusesHEAD .= "----------+";
|
||||
$statusesHTML .= " $statusesTXT |";
|
||||
$statuses .= "$status[$i]-";
|
||||
$statusesARY[$j] = $status[$i];
|
||||
$j++;
|
||||
}
|
||||
if (!eregi("-$user[$i]-", $users))
|
||||
{
|
||||
$users .= "$user[$i]-";
|
||||
$usersARY[$k] = $user[$i];
|
||||
$user_namesARY[$k] = $full_name[$i];
|
||||
$k++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
|
||||
echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n";
|
||||
echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
|
||||
|
||||
|
||||
### BEGIN loop through each user ###
|
||||
$m=0;
|
||||
while ($m < $k)
|
||||
{
|
||||
$Suser=$usersARY[$m];
|
||||
$Sfull_name=$user_namesARY[$m];
|
||||
$Stime=0;
|
||||
$Scalls=0;
|
||||
$Stalk_sec=0;
|
||||
$Spause_sec=0;
|
||||
$Swait_sec=0;
|
||||
$Sdispo_sec=0;
|
||||
$SstatusesHTML='';
|
||||
|
||||
### BEGIN loop through each status ###
|
||||
$n=0;
|
||||
while ($n < $j)
|
||||
{
|
||||
$Sstatus=$statusesARY[$n];
|
||||
$SstatusTXT='';
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") )
|
||||
{
|
||||
$Scalls = ($Scalls + $calls[$i]);
|
||||
$Stalk_sec = ($Stalk_sec + $talk_sec[$i]);
|
||||
$Spause_sec = ($Spause_sec + $pause_sec[$i]);
|
||||
$Swait_sec = ($Swait_sec + $wait_sec[$i]);
|
||||
$Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]);
|
||||
$SstatusTXT = sprintf("%8s", $calls[$i]);
|
||||
$SstatusesHTML .= " $SstatusTXT |";
|
||||
$status_found++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$SstatusesHTML .= " 0 |";
|
||||
}
|
||||
### END loop through each stat line ###
|
||||
$n++;
|
||||
}
|
||||
### END loop through each status ###
|
||||
$Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
|
||||
$TOTcalls=($TOTcalls + $Scalls);
|
||||
$TOTtime=($TOTtime + $Stime);
|
||||
$TOTtotTALK=($TOTtotTALK + $Stalk_sec);
|
||||
$TOTtotWAIT=($TOTtotWAIT + $Swait_sec);
|
||||
$TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec);
|
||||
$TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec);
|
||||
$Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
|
||||
if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);}
|
||||
else {$Stalk_avg=0;}
|
||||
if ( ($Scalls > 0) and ($Spause_sec > 0) ) {$Spause_avg = ($Spause_sec/$Scalls);}
|
||||
else {$Spause_avg=0;}
|
||||
if ( ($Scalls > 0) and ($Swait_sec > 0) ) {$Swait_avg = ($Swait_sec/$Scalls);}
|
||||
else {$Swait_avg=0;}
|
||||
if ( ($Scalls > 0) and ($Sdispo_sec > 0) ) {$Sdispo_avg = ($Sdispo_sec/$Scalls);}
|
||||
else {$Sdispo_avg=0;}
|
||||
|
||||
$Scalls = sprintf("%6s", $Scalls);
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$Sfull_name= sprintf("%-15s", $Sfull_name);
|
||||
while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
|
||||
$Suser = sprintf("%-8s", $Suser);
|
||||
while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$Sfull_name= sprintf("%-45s", $Sfull_name);
|
||||
while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');}
|
||||
|
||||
$Suser = sprintf("%-24s", $Suser);
|
||||
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
|
||||
}
|
||||
|
||||
$USERtime_M = ($Stime / 60);
|
||||
$USERtime_M_int = round($USERtime_M, 2);
|
||||
$USERtime_M_int = intval("$USERtime_M_int");
|
||||
$USERtime_S = ($USERtime_M - $USERtime_M_int);
|
||||
$USERtime_S = ($USERtime_S * 60);
|
||||
$USERtime_S = round($USERtime_S, 0);
|
||||
if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
|
||||
$USERtime_MS = "$USERtime_M_int:$USERtime_S";
|
||||
$pfUSERtime_MS = sprintf("%7s", $USERtime_MS);
|
||||
|
||||
$USERtotTALK_M = ($Stalk_sec / 60);
|
||||
$USERtotTALK_M_int = round($USERtotTALK_M, 2);
|
||||
$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
|
||||
$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
|
||||
$USERtotTALK_S = ($USERtotTALK_S * 60);
|
||||
$USERtotTALK_S = round($USERtotTALK_S, 0);
|
||||
if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
|
||||
$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
|
||||
$pfUSERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS);
|
||||
|
||||
$USERavgTALK_M = ($Stalk_avg / 60);
|
||||
$USERavgTALK_M_int = round($USERavgTALK_M, 2);
|
||||
$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
|
||||
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
|
||||
$USERavgTALK_S = ($USERavgTALK_S * 60);
|
||||
$USERavgTALK_S = round($USERavgTALK_S, 0);
|
||||
if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
|
||||
$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
|
||||
$pfUSERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
|
||||
|
||||
$USERtotPAUSE_M = ($Spause_sec / 60);
|
||||
$USERtotPAUSE_M_int = round($USERtotPAUSE_M, 2);
|
||||
$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M_int");
|
||||
$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
|
||||
$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
|
||||
$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
|
||||
if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
|
||||
$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
|
||||
$pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS);
|
||||
|
||||
$USERavgPAUSE_M = ($Spause_avg / 60);
|
||||
$USERavgPAUSE_M_int = round($USERavgPAUSE_M, 2);
|
||||
$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M_int");
|
||||
$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
|
||||
$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
|
||||
$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
|
||||
if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
|
||||
$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
|
||||
$pfUSERavgPAUSE_MS = sprintf("%6s", $USERavgPAUSE_MS);
|
||||
|
||||
$USERtotWAIT_M = ($Swait_sec / 60);
|
||||
$USERtotWAIT_M_int = round($USERtotWAIT_M, 2);
|
||||
$USERtotWAIT_M_int = intval("$USERtotWAIT_M_int");
|
||||
$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
|
||||
$USERtotWAIT_S = ($USERtotWAIT_S * 60);
|
||||
$USERtotWAIT_S = round($USERtotWAIT_S, 0);
|
||||
if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
|
||||
$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
|
||||
$pfUSERtotWAIT_MS = sprintf("%6s", $USERtotWAIT_MS);
|
||||
|
||||
$USERavgWAIT_M = ($Swait_avg / 60);
|
||||
$USERavgWAIT_M_int = round($USERavgWAIT_M, 2);
|
||||
$USERavgWAIT_M_int = intval("$USERavgWAIT_M_int");
|
||||
$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
|
||||
$USERavgWAIT_S = ($USERavgWAIT_S * 60);
|
||||
$USERavgWAIT_S = round($USERavgWAIT_S, 0);
|
||||
if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
|
||||
$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
|
||||
$pfUSERavgWAIT_MS = sprintf("%6s", $USERavgWAIT_MS);
|
||||
|
||||
$USERtotDISPO_M = ($Sdispo_sec / 60);
|
||||
$USERtotDISPO_M_int = round($USERtotDISPO_M, 2);
|
||||
$USERtotDISPO_M_int = intval("$USERtotDISPO_M_int");
|
||||
$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
|
||||
$USERtotDISPO_S = ($USERtotDISPO_S * 60);
|
||||
$USERtotDISPO_S = round($USERtotDISPO_S, 0);
|
||||
if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
|
||||
$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
|
||||
$pfUSERtotDISPO_MS = sprintf("%6s", $USERtotDISPO_MS);
|
||||
|
||||
$USERavgDISPO_M = ($Sdispo_avg / 60);
|
||||
$USERavgDISPO_M_int = round($USERavgDISPO_M, 2);
|
||||
$USERavgDISPO_M_int = intval("$USERavgDISPO_M_int");
|
||||
$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
|
||||
$USERavgDISPO_S = ($USERavgDISPO_S * 60);
|
||||
$USERavgDISPO_S = round($USERavgDISPO_S, 0);
|
||||
if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
|
||||
$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
|
||||
$pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS);
|
||||
|
||||
echo "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n";
|
||||
$m++;
|
||||
}
|
||||
### END loop through each user ###
|
||||
|
||||
|
||||
###### LAST LINE FORMATTING ##########
|
||||
### BEGIN loop through each status ###
|
||||
$SUMstatusesHTML='';
|
||||
$n=0;
|
||||
while ($n < $j)
|
||||
{
|
||||
$Scalls=0;
|
||||
$Sstatus=$statusesARY[$n];
|
||||
$SUMstatusTXT='';
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
if ($Sstatus=="$status[$i]")
|
||||
{
|
||||
$Scalls = ($Scalls + $calls[$i]);
|
||||
$status_found++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
### END loop through each stat line ###
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$SUMstatusesHTML .= " 0 |";
|
||||
}
|
||||
else
|
||||
{
|
||||
$SUMstatusTXT = sprintf("%8s", $Scalls);
|
||||
$SUMstatusesHTML .= " $SUMstatusTXT |";
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
### END loop through each status ###
|
||||
|
||||
|
||||
$TOTcalls = sprintf("%7s", $TOTcalls);
|
||||
$TOT_AGENTS = sprintf("%-4s", $m);
|
||||
|
||||
$TOTtime_M = ($TOTtime / 60);
|
||||
$TOTtime_M_int = round($TOTtime_M, 2);
|
||||
$TOTtime_M_int = intval("$TOTtime_M_int");
|
||||
$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
|
||||
$TOTtime_S = ($TOTtime_S * 60);
|
||||
$TOTtime_S = round($TOTtime_S, 0);
|
||||
if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
|
||||
$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
|
||||
$TOTtime_MS = sprintf("%8s", $TOTtime_MS);
|
||||
while(strlen($TOTtime_MS)>8) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
|
||||
|
||||
$TOTtotTALK_M = ($TOTtotTALK / 60);
|
||||
$TOTtotTALK_M_int = round($TOTtotTALK_M, 2);
|
||||
$TOTtotTALK_M_int = intval("$TOTtotTALK_M_int");
|
||||
$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
|
||||
$TOTtotTALK_S = ($TOTtotTALK_S * 60);
|
||||
$TOTtotTALK_S = round($TOTtotTALK_S, 0);
|
||||
if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
|
||||
$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
|
||||
$TOTtotTALK_MS = sprintf("%8s", $TOTtotTALK_MS);
|
||||
while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
|
||||
|
||||
$TOTtotDISPO_M = ($TOTtotDISPO / 60);
|
||||
$TOTtotDISPO_M_int = round($TOTtotDISPO_M, 2);
|
||||
$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M_int");
|
||||
$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
|
||||
$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
|
||||
$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
|
||||
if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
|
||||
$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
|
||||
$TOTtotDISPO_MS = sprintf("%8s", $TOTtotDISPO_MS);
|
||||
while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
|
||||
|
||||
$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
|
||||
$TOTtotPAUSE_M_int = round($TOTtotPAUSE_M, 2);
|
||||
$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M_int");
|
||||
$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
|
||||
$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
|
||||
$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
|
||||
if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
|
||||
$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
|
||||
$TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS);
|
||||
while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
|
||||
|
||||
$TOTtotWAIT_M = ($TOTtotWAIT / 60);
|
||||
$TOTtotWAIT_M_int = round($TOTtotWAIT_M, 2);
|
||||
$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M_int");
|
||||
$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
|
||||
$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
|
||||
$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
|
||||
if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
|
||||
$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
|
||||
$TOTtotWAIT_MS = sprintf("%8s", $TOTtotWAIT_MS);
|
||||
while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
|
||||
|
||||
|
||||
$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);
|
||||
$TOTavgTALK_M_int = round($TOTavgTALK_M, 2);
|
||||
$TOTavgTALK_M_int = intval("$TOTavgTALK_M_int");
|
||||
$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
|
||||
$TOTavgTALK_S = ($TOTavgTALK_S * 60);
|
||||
$TOTavgTALK_S = round($TOTavgTALK_S, 0);
|
||||
if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
|
||||
$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
|
||||
$TOTavgTALK_MS = sprintf("%6s", $TOTavgTALK_MS);
|
||||
while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
|
||||
|
||||
$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);
|
||||
$TOTavgDISPO_M_int = round($TOTavgDISPO_M, 2);
|
||||
$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M_int");
|
||||
$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
|
||||
$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
|
||||
$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
|
||||
if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
|
||||
$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
|
||||
$TOTavgDISPO_MS = sprintf("%6s", $TOTavgDISPO_MS);
|
||||
while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
|
||||
|
||||
$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);
|
||||
$TOTavgPAUSE_M_int = round($TOTavgPAUSE_M, 2);
|
||||
$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M_int");
|
||||
$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
|
||||
$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
|
||||
$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
|
||||
if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
|
||||
$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
|
||||
$TOTavgPAUSE_MS = sprintf("%6s", $TOTavgPAUSE_MS);
|
||||
while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
|
||||
|
||||
$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);
|
||||
$TOTavgWAIT_M_int = round($TOTavgWAIT_M, 2);
|
||||
$TOTavgWAIT_M_int = intval("$TOTavgWAIT_M_int");
|
||||
$TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int);
|
||||
$TOTavgWAIT_S = ($TOTavgWAIT_S * 60);
|
||||
$TOTavgWAIT_S = round($TOTavgWAIT_S, 0);
|
||||
if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";}
|
||||
$TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S";
|
||||
$TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS);
|
||||
while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
|
||||
|
||||
|
||||
echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
|
||||
echo "| TOTALI AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$SUMstatusesHTML\n";
|
||||
echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,385 @@
|
||||
<?
|
||||
# AST_agent_time_sheet.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60619-1729 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 80624-0132 - Added vicidial_timeclock entries
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["agent"])) {$agent=$_GET["agent"];}
|
||||
elseif (isset($_POST["agent"])) {$agent=$_POST["agent"];}
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["calls_summary"])) {$calls_summary=$_GET["calls_summary"];}
|
||||
elseif (isset($_POST["calls_summary"])) {$calls_summary=$_POST["calls_summary"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: Agent Time Sheet</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<a href=\"./admin.php\">VICIDIAL ADMIN</a>: Agent Time Sheet\n";
|
||||
echo " - <a href=\"./user_stats.php?user=$agent\">User Stats</a>\n";
|
||||
echo " - <a href=\"./user_status.php?user=$agent\">User Status</a>\n";
|
||||
echo " - <a href=\"./admin.php?ADD=3&user=$agent\">Modifica Utente</a>\n";
|
||||
echo "<BR>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET> \n";
|
||||
echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n";
|
||||
echo "User ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n";
|
||||
echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=3>\n";
|
||||
|
||||
|
||||
if (!$agent)
|
||||
{
|
||||
echo "\n";
|
||||
echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK INVIA\n";
|
||||
echo " NOTE: stats taken from available agent log data\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$query_date_BEGIN = "$query_date 00:00:00";
|
||||
$query_date_END = "$query_date 23:59:59";
|
||||
$time_BEGIN = "00:00:00";
|
||||
$time_END = "23:59:59";
|
||||
|
||||
$stmt="select full_name from vicidial_users where user='$agent';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
|
||||
echo "VICIDIAL: Agent Time Sheet $NOW_TIME\n";
|
||||
|
||||
echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n";
|
||||
|
||||
if ($calls_summary)
|
||||
{
|
||||
$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
|
||||
|
||||
$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
|
||||
$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
|
||||
$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
|
||||
$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
|
||||
$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
|
||||
$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
|
||||
$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
|
||||
$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
|
||||
$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
|
||||
$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
|
||||
if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
|
||||
if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
|
||||
$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
|
||||
$pfTOTAL_TIME_HMS = sprintf("%8s", $TOTAL_TIME_HMS);
|
||||
|
||||
$TALK_TIME_H = ($row[1] / 3600);
|
||||
$TALK_TIME_H = round($TALK_TIME_H, 2);
|
||||
$TALK_TIME_H_int = intval("$TALK_TIME_H");
|
||||
$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
|
||||
$TALK_TIME_M = ($TALK_TIME_M * 60);
|
||||
$TALK_TIME_M = round($TALK_TIME_M, 2);
|
||||
$TALK_TIME_M_int = intval("$TALK_TIME_M");
|
||||
$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
|
||||
$TALK_TIME_S = ($TALK_TIME_S * 60);
|
||||
$TALK_TIME_S = round($TALK_TIME_S, 0);
|
||||
if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
|
||||
if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
|
||||
$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
|
||||
$pfTALK_TIME_HMS = sprintf("%8s", $TALK_TIME_HMS);
|
||||
|
||||
$PAUSE_TIME_H = ($row[3] / 3600);
|
||||
$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
|
||||
$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
|
||||
$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
|
||||
$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
|
||||
$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
|
||||
$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
|
||||
$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
|
||||
$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
|
||||
$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
|
||||
if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
|
||||
if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
|
||||
$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
|
||||
$pfPAUSE_TIME_HMS = sprintf("%8s", $PAUSE_TIME_HMS);
|
||||
|
||||
$WAIT_TIME_H = ($row[5] / 3600);
|
||||
$WAIT_TIME_H = round($WAIT_TIME_H, 2);
|
||||
$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
|
||||
$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
|
||||
$WAIT_TIME_M = ($WAIT_TIME_M * 60);
|
||||
$WAIT_TIME_M = round($WAIT_TIME_M, 2);
|
||||
$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
|
||||
$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
|
||||
$WAIT_TIME_S = ($WAIT_TIME_S * 60);
|
||||
$WAIT_TIME_S = round($WAIT_TIME_S, 0);
|
||||
if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
|
||||
if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
|
||||
$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
|
||||
$pfWAIT_TIME_HMS = sprintf("%8s", $WAIT_TIME_HMS);
|
||||
|
||||
$WRAPUP_TIME_H = ($row[7] / 3600);
|
||||
$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
|
||||
$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
|
||||
$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
|
||||
$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
|
||||
$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
|
||||
$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
|
||||
$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
|
||||
$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
|
||||
$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
|
||||
if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
|
||||
if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
|
||||
$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
|
||||
$pfWRAPUP_TIME_HMS = sprintf("%8s", $WRAPUP_TIME_HMS);
|
||||
|
||||
$TALK_AVG_M = ($row[2] / 60);
|
||||
$TALK_AVG_M = round($TALK_AVG_M, 2);
|
||||
$TALK_AVG_M_int = intval("$TALK_AVG_M");
|
||||
$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
|
||||
$TALK_AVG_S = ($TALK_AVG_S * 60);
|
||||
$TALK_AVG_S = round($TALK_AVG_S, 0);
|
||||
if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
|
||||
$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
|
||||
$pfTALK_AVG_MS = sprintf("%6s", $TALK_AVG_MS);
|
||||
|
||||
$PAUSE_AVG_M = ($row[4] / 60);
|
||||
$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
|
||||
$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
|
||||
$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
|
||||
$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
|
||||
$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
|
||||
if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
|
||||
$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
|
||||
$pfPAUSE_AVG_MS = sprintf("%6s", $PAUSE_AVG_MS);
|
||||
|
||||
$WAIT_AVG_M = ($row[6] / 60);
|
||||
$WAIT_AVG_M = round($WAIT_AVG_M, 2);
|
||||
$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
|
||||
$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
|
||||
$WAIT_AVG_S = ($WAIT_AVG_S * 60);
|
||||
$WAIT_AVG_S = round($WAIT_AVG_S, 0);
|
||||
if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
|
||||
$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
|
||||
$pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS);
|
||||
|
||||
$WRAPUP_AVG_M = ($row[8] / 60);
|
||||
$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
|
||||
$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
|
||||
$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
|
||||
$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
|
||||
$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
|
||||
if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
|
||||
$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
|
||||
$pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS);
|
||||
|
||||
echo "TOTALE CHIAMATE TAKEN: $row[0]\n";
|
||||
echo "TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n";
|
||||
echo "PAUSE TIME: $pfPAUSE_TIME_HMS AVERAGE: $pfPAUSE_AVG_MS\n";
|
||||
echo "WAIT TIME: $pfWAIT_TIME_HMS AVERAGE: $pfWAIT_AVG_MS\n";
|
||||
echo "WRAPUP TIME: $pfWRAPUP_TIME_HMS AVERAGE: $pfWRAPUP_AVG_MS\n";
|
||||
echo "----------------------------------------------------------------\n";
|
||||
echo "TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n";
|
||||
|
||||
echo "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?calls_summary=1&agent=$agent&query_date=$query_date\">Call Activity Summary</a>\n\n";
|
||||
|
||||
}
|
||||
|
||||
$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
echo "FIRST LOGIN: $row[0]\n";
|
||||
$start = $row[1];
|
||||
|
||||
$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
echo "LAST LOG ACTIVITY: $row[0]\n";
|
||||
$end = $row[1];
|
||||
|
||||
$login_time = ($end - $start);
|
||||
$LOGIN_TIME_H = ($login_time / 3600);
|
||||
$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
|
||||
$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
|
||||
$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
|
||||
$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
|
||||
$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
|
||||
$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
|
||||
$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
|
||||
$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
|
||||
$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
|
||||
if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
|
||||
if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
|
||||
$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
|
||||
$pfLOGIN_TIME_HMS = sprintf("%8s", $LOGIN_TIME_HMS);
|
||||
|
||||
echo "-----------------------------------------\n";
|
||||
echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n";
|
||||
|
||||
|
||||
### timeclock records
|
||||
|
||||
|
||||
##### vicidial_timeclock log records for user #####
|
||||
|
||||
$total_login_time=0;
|
||||
$SQday_ARY = explode('-',$query_date_BEGIN);
|
||||
$EQday_ARY = explode('-',$query_date_END);
|
||||
$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
|
||||
$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
|
||||
|
||||
echo "\n";
|
||||
|
||||
echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n";
|
||||
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ORE:MINUTI</td></tr>\n";
|
||||
|
||||
$stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';";
|
||||
if ($DB>0) {echo "|$stmt|";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$events_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$total_logs=0;
|
||||
$o=0;
|
||||
while ($events_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( ($row[0]=='START') or ($row[0]=='LOGIN') )
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$TC_log_date = date("Y-m-d H:i:s", $row[1]);
|
||||
|
||||
$manager_edit='';
|
||||
if (strlen($row[6])>0) {$manager_edit = ' * ';}
|
||||
|
||||
if (ereg("LOGIN", $row[0]))
|
||||
{
|
||||
$login_sec='';
|
||||
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
||||
echo "<td align=right><font size=2>$manager_edit</td>";
|
||||
echo "<td align=right><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
||||
echo "<td align=right><font size=2> $row[4]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[2]</td>\n";
|
||||
echo "<td align=right><font size=2> </td></tr>\n";
|
||||
}
|
||||
if (ereg("LOGOUT", $row[0]))
|
||||
{
|
||||
$login_sec = $row[3];
|
||||
$total_login_time = ($total_login_time + $login_sec);
|
||||
$event_hours = ($login_sec / 3600);
|
||||
$event_hours_int = round($event_hours, 2);
|
||||
$event_hours_int = intval("$event_hours_int");
|
||||
$event_minutes = ($event_hours - $event_hours_int);
|
||||
$event_minutes = ($event_minutes * 60);
|
||||
$event_minutes_int = round($event_minutes, 0);
|
||||
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
|
||||
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
||||
echo "<td align=right><font size=2>$manager_edit</td>";
|
||||
echo "<td align=right><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
||||
echo "<td align=right><font size=2> $row[4]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[2]</td>\n";
|
||||
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int";
|
||||
if ($DB) {echo " - $total_login_time - $login_sec";}
|
||||
echo "</td></tr>\n";
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
if (strlen($login_sec)<1)
|
||||
{
|
||||
$login_sec = ($STARTtime - $row[1]);
|
||||
$total_login_time = ($total_login_time + $login_sec);
|
||||
if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";}
|
||||
}
|
||||
$total_login_hours = ($total_login_time / 3600);
|
||||
$total_login_hours_int = round($total_login_hours, 2);
|
||||
$total_login_hours_int = intval("$total_login_hours_int");
|
||||
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
|
||||
$total_login_minutes = ($total_login_minutes * 60);
|
||||
$total_login_minutes_int = round($total_login_minutes, 0);
|
||||
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
|
||||
|
||||
if ($DB) {echo " - $total_login_time - $login_sec";}
|
||||
|
||||
echo "<tr><td align=right><font size=2> </td>";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2><font size=2>TOTALE </td>\n";
|
||||
echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n";
|
||||
|
||||
echo "</TABLE>\n";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,332 @@
|
||||
<?
|
||||
# AST_server_performance.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60619-1732 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 70417-1106 - Changed time frame to be definable per time range on a single day
|
||||
# - Fixed vertical scaling issues
|
||||
# 80118-1508 - Fixed horizontal scale marking issues
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["begin_query_time"])) {$begin_query_time=$_GET["begin_query_time"];}
|
||||
elseif (isset($_POST["begin_query_time"])) {$begin_query_time=$_POST["begin_query_time"];}
|
||||
if (isset($_GET["end_query_time"])) {$end_query_time=$_GET["end_query_time"];}
|
||||
elseif (isset($_POST["end_query_time"])) {$end_query_time=$_POST["end_query_time"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
# path from root to where ploticus files will be stored
|
||||
$PLOTroot = "vicidial/ploticus";
|
||||
$DOCroot = "$WeBServeRRooT/$PLOTroot/";
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
if (!isset($begin_query_time)) {$begin_query_time = "$NOW_DATE 09:00:00";}
|
||||
if (!isset($end_query_time)) {$end_query_time = "$NOW_DATE 15:30:00";}
|
||||
if (!isset($group)) {$group = '';}
|
||||
|
||||
$stmt="select server_ip from servers;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$servers_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $servers_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: Server Performance</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "Intervallo di tempo in formato Data/Ora: <INPUT TYPE=TEXT NAME=begin_query_time SIZE=22 MAXLENGTH=19 VALUE=\"$begin_query_time\"> \n";
|
||||
echo "to <INPUT TYPE=TEXT NAME=end_query_time SIZE=22 MAXLENGTH=19 VALUE=\"$end_query_time\"> \n";
|
||||
echo "Server: <SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($servers_to_print > $o)
|
||||
{
|
||||
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT> \n";
|
||||
echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n";
|
||||
echo "PER FAVORE SELEZIONA UN SERVER E UN INTERVALLO DI TEMPO, POI PREMI INVIA\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
$query_date_BEGIN = $begin_query_time;
|
||||
$query_date_END = $end_query_time;
|
||||
|
||||
|
||||
echo "VICIDIAL: Server Performance $NOW_TIME\n";
|
||||
|
||||
echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- TOTALI, PEAKS and AVERAGES\n";
|
||||
|
||||
$stmt="select AVG(sysload),AVG(channels_total),MAX(sysload),MAX(channels_total),MAX(processes) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$AVGload = sprintf("%10s", $row[0]);
|
||||
$AVGchannels = sprintf("%10s", $row[1]);
|
||||
$HIGHload = $row[2];
|
||||
$HIGHmulti = intval($HIGHload / 100);
|
||||
$HIGHchannels = $row[3];
|
||||
$HIGHprocesses =$row[4];
|
||||
if ($row[2] > $row[3]) {$HIGHlimit = $row[2];}
|
||||
else {$HIGHlimit = $row[3];}
|
||||
if ($HIGHlimit < $row[4]) {$HIGHlimit = $row[4];}
|
||||
|
||||
$stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$AVGcpuUSER = sprintf("%10s", $row[0]);
|
||||
$AVGcpuSYSTEM = sprintf("%10s", $row[1]);
|
||||
$AVGcpuIDLE = sprintf("%10s", $row[2]);
|
||||
|
||||
$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$TOTALcalls = sprintf("%10s", $row[0]);
|
||||
$OFFHOOKtime = sprintf("%10s", $row[1]);
|
||||
|
||||
|
||||
echo "Total Calls in/out on this server: $TOTALcalls\n";
|
||||
echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
|
||||
echo "Average/Peak channels in use for server: $AVGchannels / $HIGHchannels\n";
|
||||
echo "Average/Peak load for server: $AVGload / $HIGHload\n";
|
||||
echo "Average USER process cpu percentage: $AVGcpuUSER %\n";
|
||||
echo "Average SYSTEM process cpu percentage: $AVGcpuSYSTEM %\n";
|
||||
echo "Average IDLE process cpu percentage: $AVGcpuIDLE %\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- LINE GRAPH:\n";
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### Graph stats
|
||||
|
||||
$DAT = '.dat';
|
||||
$HTM = '.htm';
|
||||
$PNG = '.png';
|
||||
$filedate = date("Y-m-d_His");
|
||||
$DATfile = "$group$query_date$shift$filedate$DAT";
|
||||
$HTMfile = "$group$query_date$shift$filedate$HTM";
|
||||
$PNGfile = "$group$query_date$shift$filedate$PNG";
|
||||
|
||||
$HTMfp = fopen ("$DOCroot/$HTMfile", "a");
|
||||
$DATfp = fopen ("$DOCroot/$DATfile", "a");
|
||||
|
||||
$stmt="select DATE_FORMAT(start_time,'%Y-%m-%d.%H:%i:%s') as timex,sysload,processes,channels_total,live_recordings,cpu_user_percent,cpu_system_percent from server_performance where server_ip='" . mysql_real_escape_string($group) . "' and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' order by timex limit 99999;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($i<1) {$time_BEGIN = $row[0];}
|
||||
$time_END = $row[0];
|
||||
$row[5] = intval(($row[5] + $row[6]) * $HIGHmulti);
|
||||
$row[6] = intval($row[6] * $HIGHmulti);
|
||||
if ($rows_to_print > 9999)
|
||||
{
|
||||
if ($rows_to_print <= 19999)
|
||||
{
|
||||
if (preg_match("/0$|2$|4$|6$|8$/",$i))
|
||||
{
|
||||
fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
|
||||
}
|
||||
}
|
||||
if ( ($rows_to_print > 19999) and ($rows_to_print <= 49999) )
|
||||
{
|
||||
if (preg_match("/0$|5$/",$i))
|
||||
{
|
||||
fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
|
||||
}
|
||||
}
|
||||
if ( ($rows_to_print > 49999) and ($rows_to_print <= 99999) )
|
||||
{
|
||||
if (preg_match("/0$/",$i))
|
||||
{
|
||||
fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
fclose($DATfp);
|
||||
|
||||
$rows_to_max = ($rows_to_print + 100);
|
||||
|
||||
$time_scale_abb = '5 minutes';
|
||||
$time_scale_tick = '1 minute';
|
||||
if ($i > 1000) {$time_scale_abb = '10 minutes'; $time_scale_tick = '2 minutes';}
|
||||
if ($i > 1500) {$time_scale_abb = '15 minutes'; $time_scale_tick = '3 minutes';}
|
||||
if ($i > 2000) {$time_scale_abb = '20 minutes'; $time_scale_tick = '4 minutes';}
|
||||
if ($i > 3000) {$time_scale_abb = '30 minutes'; $time_scale_tick = '5 minutes';}
|
||||
if ($i > 4000) {$time_scale_abb = '40 minutes'; $time_scale_tick = '10 minutes';}
|
||||
if ($i > 5000) {$time_scale_abb = '60 minutes'; $time_scale_tick = '15 minutes';}
|
||||
if ($i > 6000) {$time_scale_abb = '90 minutes'; $time_scale_tick = '15 minutes';}
|
||||
if ($i > 7000) {$time_scale_abb = '120 minutes'; $time_scale_tick = '30 minutes';}
|
||||
|
||||
print "rows: $i tick: $time_scale_abb scale: $time_scale_tick\n";
|
||||
|
||||
$HTMcontent = '';
|
||||
$HTMcontent .= "#proc page\n";
|
||||
$HTMcontent .= "#if @DEVICE in png,gif\n";
|
||||
$HTMcontent .= " scale: 0.6\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#endif\n";
|
||||
$HTMcontent .= "#proc getdata\n";
|
||||
$HTMcontent .= "file: $DOCroot/$DATfile\n";
|
||||
$HTMcontent .= "fieldnames: userproc sysproc datetime load processes channels\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#proc areadef\n";
|
||||
$HTMcontent .= "title: Server $group $query_date_BEGIN to $query_date_END\n";
|
||||
$HTMcontent .= "titledetails: size=14 align=C\n";
|
||||
$HTMcontent .= "rectangle: 1 1 12 7\n";
|
||||
$HTMcontent .= "xscaletype: datetime yyyy-mm-dd.hh:mm:ss\n";
|
||||
$HTMcontent .= "xrange: $time_BEGIN $time_END\n";
|
||||
$HTMcontent .= "yrange: 0 $HIGHlimit\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#proc xaxis\n";
|
||||
$HTMcontent .= "stubs: inc $time_scale_abb\n";
|
||||
$HTMcontent .= "minorticinc: $time_scale_tick\n";
|
||||
$HTMcontent .= "stubformat: hh:mma\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#proc yaxis\n";
|
||||
$HTMcontent .= "stubs: inc 50\n";
|
||||
$HTMcontent .= "grid: color=yellow\n";
|
||||
$HTMcontent .= "gridskip: min\n";
|
||||
$HTMcontent .= "ticincrement: 100 1000\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#proc lineplot\n";
|
||||
$HTMcontent .= "xfield: datetime\n";
|
||||
$HTMcontent .= "yfield: userproc\n";
|
||||
$HTMcontent .= "linedetails: color=purple width=.5\n";
|
||||
$HTMcontent .= "fill: lavender\n";
|
||||
$HTMcontent .= "legendlabel: user proc%\n";
|
||||
$HTMcontent .= "maxinpoints: $rows_to_max\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#proc lineplot\n";
|
||||
$HTMcontent .= "xfield: datetime\n";
|
||||
$HTMcontent .= "yfield: sysproc\n";
|
||||
$HTMcontent .= "linedetails: color=yelloworange width=.5\n";
|
||||
$HTMcontent .= "fill: dullyellow\n";
|
||||
$HTMcontent .= "legendlabel: system proc%\n";
|
||||
$HTMcontent .= "maxinpoints: $rows_to_max\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#proc curvefit\n";
|
||||
$HTMcontent .= "xfield: datetime\n";
|
||||
$HTMcontent .= "yfield: load\n";
|
||||
$HTMcontent .= "linedetails: color=blue width=.5\n";
|
||||
$HTMcontent .= "legendlabel: load\n";
|
||||
$HTMcontent .= "maxinpoints: $rows_to_max\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#proc curvefit\n";
|
||||
$HTMcontent .= "xfield: datetime\n";
|
||||
$HTMcontent .= "yfield: processes\n";
|
||||
$HTMcontent .= "linedetails: color=red width=.5\n";
|
||||
$HTMcontent .= "legendlabel: processes\n";
|
||||
$HTMcontent .= "maxinpoints: $rows_to_max\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#proc curvefit\n";
|
||||
$HTMcontent .= "xfield: datetime\n";
|
||||
$HTMcontent .= "yfield: channels\n";
|
||||
$HTMcontent .= "linedetails: color=green width=.5\n";
|
||||
$HTMcontent .= "legendlabel: channels\n";
|
||||
$HTMcontent .= "maxinpoints: $rows_to_max\n";
|
||||
$HTMcontent .= "\n";
|
||||
$HTMcontent .= "#proc legend\n";
|
||||
$HTMcontent .= "location: max-1 max\n";
|
||||
$HTMcontent .= "seglen: 0.2\n";
|
||||
$HTMcontent .= "\n";
|
||||
|
||||
fwrite ($HTMfp, "$HTMcontent");
|
||||
fclose($HTMfp);
|
||||
|
||||
|
||||
passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
|
||||
|
||||
sleep(1);
|
||||
|
||||
echo "</PRE>";
|
||||
echo "\n";
|
||||
echo "<IMG SRC=\"/$PLOTroot/$PNGfile\">\n";
|
||||
|
||||
|
||||
echo "<!-- /usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile -->";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,435 @@
|
||||
<?
|
||||
# AST_timeonVDAD.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# live real-time stats for the VICIDIAL Auto-Dialer
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60620-1037 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 61114-2004 - Changed to display CLOSER and DEFAULT, added trunk shortage
|
||||
# 80422-0305 - Added phone login to display, lower font size to 2
|
||||
# 81013-2227 - Fixed Remote Agent display bug
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];}
|
||||
elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
if (isset($_GET["closer_display"])) {$closer_display=$_GET["closer_display"];}
|
||||
elseif (isset($_POST["closer_display"])) {$closer_display=$_POST["closer_display"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
$epochSIXhoursAGO = ($STARTtime - 21600);
|
||||
$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO);
|
||||
|
||||
$reset_counter++;
|
||||
|
||||
if ($reset_counter > 7)
|
||||
{
|
||||
$reset_counter=0;
|
||||
|
||||
$stmt="update park_log set status='HUNGUP' where hangup_time is not null;";
|
||||
# $rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
|
||||
if ($DB)
|
||||
{
|
||||
$stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');";
|
||||
# $rslt=mysql_query($stmt, $link);
|
||||
echo "$stmt\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<?
|
||||
echo "<STYLE type=\"text/css\">\n";
|
||||
echo "<!--\n";
|
||||
|
||||
if ($closer_display>0)
|
||||
{
|
||||
$stmt="select group_id,group_color from vicidial_inbound_groups;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
if ($groups_to_print > 0)
|
||||
{
|
||||
$g=0;
|
||||
while ($g < $groups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$group_id[$g] = $row[0];
|
||||
$group_color[$g] = $row[1];
|
||||
echo " .$group_id[$g] {color: black; background-color: $group_color[$g]}\n";
|
||||
$g++;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
.DEAD {color: white; background-color: black}
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
.yellow {color: black; background-color: yellow}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo"<META HTTP-EQUIV=Refresh CONTENT=\"4; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB&reset_counter=$reset_counter&closer_display=$closer_display\">\n";
|
||||
echo "<TITLE>VICIDIAL: Time On VDAD</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<PRE><FONT SIZE=2>";
|
||||
|
||||
###################################################################################
|
||||
###### SERVER INFORMATION
|
||||
###################################################################################
|
||||
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where server_ip='" . mysql_real_escape_string($server_ip) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$balanceSHORT = $row[0];
|
||||
|
||||
echo "SERVER: $server_ip\n";
|
||||
|
||||
|
||||
|
||||
###################################################################################
|
||||
###### TIME ON SYSTEM
|
||||
###################################################################################
|
||||
|
||||
if ($closer_display>0) {$closer_display_reverse=0; $closer_reverse_link='DEFAULT';}
|
||||
else {$closer_display_reverse=1; $closer_reverse_link='CLOSER';}
|
||||
|
||||
echo "VICIDIAL: Agents Time On Calls $NOW_TIME <a href=\"$PHP_SELF?server_ip=$server_ip&DB=$DB&reset_counter=$reset_counter&closer_display=$closer_display_reverse\">$closer_reverse_link</a> | <a href=\"./admin.php?ADD=999999\">REPORT</a>\n\n";
|
||||
|
||||
if ($closer_display>0)
|
||||
{
|
||||
echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
|
||||
echo "| STATION | PHONE | USER | SESSIONID | CHANNEL | STATUS | CALLTIME | MINUTES | CAMPAIGN | FRONT |\n";
|
||||
echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
|
||||
echo "| STATION | PHONE | USER | SESSIONID | CHANNEL | STATUS | CALLTIME | MINUTES |\n";
|
||||
echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
|
||||
}
|
||||
|
||||
$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),uniqueid,lead_id from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$talking_to_print = mysql_num_rows($rslt);
|
||||
if ($talking_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
while ($i < $talking_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Sextension[$i] = $row[0];
|
||||
$Suser[$i] = $row[1];
|
||||
$Ssessionid[$i] = $row[2];
|
||||
$Schannel[$i] = $row[3];
|
||||
$Sstatus[$i] = $row[4];
|
||||
$Sstart_time[$i] = $row[5];
|
||||
$Scall_time[$i] = $row[6];
|
||||
$Sfinish_time[$i] = $row[7];
|
||||
$Suniqueid[$i] = $row[8];
|
||||
$Slead_id[$i] = $row[9];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$i=0;
|
||||
while ($i < $talking_to_print)
|
||||
{
|
||||
$phone[$i]=' ';
|
||||
if (eregi("R/",$Sextension[$i]))
|
||||
{
|
||||
$protocol = 'EXTERNAL';
|
||||
$dialplan = eregi_replace('R/',"",$Sextension[$i]);
|
||||
$dialplan = eregi_replace("\@.*",'',$dialplan);
|
||||
$exten = "dialplan_number='$dialplan'";
|
||||
}
|
||||
if (eregi("Local/",$Sextension[$i]))
|
||||
{
|
||||
$protocol = 'EXTERNAL';
|
||||
$dialplan = eregi_replace('Local/',"",$Sextension[$i]);
|
||||
$dialplan = eregi_replace("\@.*",'',$dialplan);
|
||||
$exten = "dialplan_number='$dialplan'";
|
||||
}
|
||||
if (eregi('SIP/',$Sextension[$i]))
|
||||
{
|
||||
$protocol = 'SIP';
|
||||
$dialplan = eregi_replace('SIP/',"",$Sextension[$i]);
|
||||
$dialplan = eregi_replace("-.*",'',$dialplan);
|
||||
$exten = "extension='$dialplan'";
|
||||
}
|
||||
if (eregi('IAX2/',$Sextension[$i]))
|
||||
{
|
||||
$protocol = 'IAX2';
|
||||
$dialplan = eregi_replace('IAX2/',"",$Sextension[$i]);
|
||||
$dialplan = eregi_replace("-.*",'',$dialplan);
|
||||
$exten = "extension='$dialplan'";
|
||||
}
|
||||
if (eregi('Zap/',$Sextension[$i]))
|
||||
{
|
||||
$protocol = 'Zap';
|
||||
$dialplan = eregi_replace('Zap/',"",$Sextension[$i]);
|
||||
$exten = "extension='$dialplan'";
|
||||
}
|
||||
|
||||
$stmt="select login from phones where server_ip='" . mysql_real_escape_string($server_ip) . "' and $exten and protocol='$protocol';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$login = $row[0];
|
||||
|
||||
$phone[$i] = sprintf("%-10s", $login);
|
||||
|
||||
if (eregi("READY|PAUSED|CLOSER",$Sstatus[$i]))
|
||||
{
|
||||
$Schannel[$i]='';
|
||||
$Sstart_time[$i]='- WAIT -';
|
||||
$Scall_time[$i]=$Sfinish_time[$i];
|
||||
}
|
||||
$extension[$i] = eregi_replace('Local/',"",$Sextension[$i]);
|
||||
$extension[$i] = sprintf("%-10s", $extension[$i]);
|
||||
while(strlen($extension[$i])>10) {$extension[$i] = substr("$extension[$i]", 0, -1);}
|
||||
$user[$i] = sprintf("%-6s", $Suser[$i]);
|
||||
$sessionid[$i] = sprintf("%-9s", $Ssessionid[$i]);
|
||||
$channel[$i] = sprintf("%-19s", $Schannel[$i]);
|
||||
$cc[$i]=0;
|
||||
while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
|
||||
{
|
||||
$channel[$i] = eregi_replace(".$","",$channel[$i]);
|
||||
$cc[$i]++;
|
||||
if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
|
||||
}
|
||||
$status[$i] = sprintf("%-6s", $Sstatus[$i]);
|
||||
$start_time[$i] = sprintf("%-8s", $Sstart_time[$i]);
|
||||
$cd[$i]=0;
|
||||
while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
|
||||
{
|
||||
$start_time[$i] = eregi_replace("^.","",$start_time[$i]);
|
||||
$cd[$i]++;
|
||||
if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
|
||||
}
|
||||
$uniqueid[$i] = $Suniqueid[$i];
|
||||
$lead_id[$i] = $Slead_id[$i];
|
||||
$closer[$i] = $Suser[$i];
|
||||
$call_time_S[$i] = ($STARTtime - $Scall_time[$i]);
|
||||
|
||||
$call_time_M[$i] = ($call_time_S[$i] / 60);
|
||||
$call_time_M[$i] = round($call_time_M[$i], 2);
|
||||
$call_time_M_int[$i] = intval("$call_time_M[$i]");
|
||||
$call_time_SEC[$i] = ($call_time_M[$i] - $call_time_M_int[$i]);
|
||||
$call_time_SEC[$i] = ($call_time_SEC[$i] * 60);
|
||||
$call_time_SEC[$i] = round($call_time_SEC[$i], 0);
|
||||
if ($call_time_SEC[$i] < 10) {$call_time_SEC[$i] = "0$call_time_SEC[$i]";}
|
||||
$call_time_MS[$i] = "$call_time_M_int[$i]:$call_time_SEC[$i]";
|
||||
$call_time_MS[$i] = sprintf("%7s", $call_time_MS[$i]);
|
||||
|
||||
if ($closer_display<1)
|
||||
{
|
||||
$G = ''; $EG = '';
|
||||
if ($call_time_M_int[$i] >= 5) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
|
||||
if ($call_time_M_int[$i] >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
|
||||
if (eregi("PAUSED",$Sstatus[$i]))
|
||||
{
|
||||
if ($call_time_M_int >= 1)
|
||||
{$i++; continue;}
|
||||
else
|
||||
{$G='<SPAN class="yellow"><B>'; $EG='</B></SPAN>';}
|
||||
}
|
||||
$agentcount++;
|
||||
echo "| $G$extension[$i]$EG | $G$phone[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG |\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($closer_display>0)
|
||||
{
|
||||
|
||||
$ext_count = $i;
|
||||
$i=0;
|
||||
while ($i < $ext_count)
|
||||
{
|
||||
|
||||
$stmt="select campaign_id from vicidial_auto_calls where lead_id='$lead_id[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$camp_to_print = mysql_num_rows($rslt);
|
||||
if ($camp_to_print > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$campaign = sprintf("%-12s", $row[0]);
|
||||
$camp_color = $row[0];
|
||||
}
|
||||
else
|
||||
{$campaign = 'DEAD '; $camp_color = 'DEAD';}
|
||||
if (eregi("READY|PAUSED|CLOSER",$status[$i]))
|
||||
{$campaign = ' '; $camp_color = '';}
|
||||
|
||||
$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$xfer_to_print = mysql_num_rows($rslt);
|
||||
if ($xfer_to_print > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$fronter = sprintf("%-6s", $row[0]);
|
||||
}
|
||||
else
|
||||
{$fronter = ' ';}
|
||||
|
||||
$G = ''; $EG = '';
|
||||
$G="<SPAN class=\"$camp_color\"><B>"; $EG='</B></SPAN>';
|
||||
# if ($call_time_M_int[$i] >= 5) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
|
||||
# if ($call_time_M_int[$i] >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
|
||||
|
||||
echo "| $G$extension[$i]$EG | $G$phone[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
|
||||
echo " $i Operatori collegati al server $server_ip\n\n";
|
||||
# echo " <SPAN class=\"blue\"><B> </SPAN> - 5 o piu` minuti in conversazione</B>\n";
|
||||
# echo " <SPAN class=\"purple\"><B> </SPAN> - Oltre 10 minuti in conversazione</B>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
|
||||
echo " $agentcount Operatori collegati al server $server_ip\n\n";
|
||||
|
||||
echo " <SPAN class=\"yellow\"><B> </SPAN> - Operatori in pausa</B>\n";
|
||||
echo " <SPAN class=\"blue\"><B> </SPAN> - 5 o piu` minuti in conversazione</B>\n";
|
||||
echo " <SPAN class=\"purple\"><B> </SPAN> - Oltre 10 minuti in conversazione</B>\n";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "**************************************************************************************\n";
|
||||
echo "**************************************************************************************\n";
|
||||
echo "********************************* NESSUN OPERATORE IN CONVERSAZIONE *********************************\n";
|
||||
echo "**************************************************************************************\n";
|
||||
echo "**************************************************************************************\n";
|
||||
}
|
||||
|
||||
|
||||
###################################################################################
|
||||
###### OUTBOUND CALLS
|
||||
###################################################################################
|
||||
#echo "\n\n";
|
||||
echo "----------------------------------------------------------------------------------------";
|
||||
echo "\n\n";
|
||||
echo "VICIDIAL: Time On VDAD TRUNK SHORT: $balanceSHORT $NOW_TIME\n\n";
|
||||
echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
|
||||
echo "| CHANNEL | STATUS | CAMPAIGN | PHONE NUMBER | CALLTIME | MINUTES |\n";
|
||||
echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
|
||||
|
||||
$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id desc;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$parked_to_print = mysql_num_rows($rslt);
|
||||
if ($parked_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
while ($i < $parked_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$channel = sprintf("%-19s", $row[0]);
|
||||
$cc=0;
|
||||
while ( (strlen($channel) > 19) and ($cc < 100) )
|
||||
{
|
||||
$channel = eregi_replace(".$","",$channel);
|
||||
$cc++;
|
||||
if (strlen($channel) <= 19) {$cc=101;}
|
||||
}
|
||||
$start_time = sprintf("%-8s", $row[5]);
|
||||
$cd=0;
|
||||
while ( (strlen($start_time) > 8) and ($cd < 100) )
|
||||
{
|
||||
$start_time = eregi_replace("^.","",$start_time);
|
||||
$cd++;
|
||||
if (strlen($start_time) <= 8) {$cd=101;}
|
||||
}
|
||||
$status = sprintf("%-6s", $row[1]);
|
||||
$campaign = sprintf("%-12s", $row[2]);
|
||||
$all_phone = "$row[3]$row[4]";
|
||||
$number_dialed = sprintf("%-18s", $all_phone);
|
||||
$call_time_S = ($STARTtime - $row[6]);
|
||||
|
||||
$call_time_M = ($call_time_S / 60);
|
||||
$call_time_M = round($call_time_M, 2);
|
||||
$call_time_M_int = intval("$call_time_M");
|
||||
$call_time_SEC = ($call_time_M - $call_time_M_int);
|
||||
$call_time_SEC = ($call_time_SEC * 60);
|
||||
$call_time_SEC = round($call_time_SEC, 0);
|
||||
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
|
||||
$call_time_MS = "$call_time_M_int:$call_time_SEC";
|
||||
$call_time_MS = sprintf("%7s", $call_time_MS);
|
||||
$G = ''; $EG = '';
|
||||
if (eregi("LIVE",$status)) {$G='<SPAN class="green"><B>'; $EG='</B></SPAN>';}
|
||||
# if ($call_time_M_int >= 6) {$G='<SPAN class="red"><B>'; $EG='</B></SPAN>';}
|
||||
|
||||
echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
|
||||
echo " $i chiamate effettuate dal server $server_ip\n\n";
|
||||
|
||||
echo " <SPAN class=\"green\"><B> </SPAN> - CHIAMATA IN ATTESA</B>\n";
|
||||
# echo " <SPAN class=\"red\"><B> </SPAN> - Over 5 minutes on hold</B>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "***************************************************************************************\n";
|
||||
echo "***************************************************************************************\n";
|
||||
echo "******************************* NESSUNA CHIAMATA IN ATTESA*********************************\n";
|
||||
echo "***************************************************************************************\n";
|
||||
echo "***************************************************************************************\n";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,219 @@
|
||||
<?
|
||||
# AST_timeonpark.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60620-1042 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];}
|
||||
elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
$timeONEhoursAGO = ($STARTtime - 3600);
|
||||
$epochHALFhoursAGO = ($STARTtime - 1860);
|
||||
$timeONEhoursAGO = date("Y-m-d H:i:s",$timeONEhoursAGO);
|
||||
$timeHALFhoursAGO = date("Y-m-d H:i:s",$epochHALFhoursAGO);
|
||||
|
||||
$reset_counter++;
|
||||
|
||||
if ($reset_counter > 7)
|
||||
{
|
||||
$reset_counter=0;
|
||||
|
||||
$stmt="update park_log set status='HUNGUP' where hangup_time is not null;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
|
||||
if ($DB)
|
||||
{
|
||||
$stmt="delete from park_log where status='TALKING' and grab_time < '$timeONEhoursAGO' and (hangup_time is null or hangup_time='');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
echo "$stmt\n";
|
||||
|
||||
$stmt="delete from park_log where status='PARKED' and parked_time < '$timeHALFhoursAGO' and (hangup_time is null or hangup_time='');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
echo "$stmt\n";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo"<META HTTP-EQUIV=Refresh CONTENT=\"7; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB&reset_counter=$reset_counter\">\n";
|
||||
echo "<TITLE>VICIDIAL: Time On Park</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<PRE><FONT SIZE=3>\n\n";
|
||||
|
||||
echo "VICIDIAL: Time On Park $NOW_TIME <a href=\"./admin.php?ADD=999999\">REPORT</a>\n\n";
|
||||
echo "+------------+-----------------+---------------------+---------+\n";
|
||||
echo "| CHANNEL | GROUP | START TIME | MINUTES |\n";
|
||||
echo "+------------+-----------------+---------------------+---------+\n";
|
||||
|
||||
#$link=mysql_connect("localhost", "cron", "1234");
|
||||
# $linkX=mysql_connect("localhost", "cron", "1234");
|
||||
#mysql_select_db("asterisk");
|
||||
|
||||
$stmt="select extension,user,channel,channel_group,parked_time,UNIX_TIMESTAMP(parked_time) from park_log where status ='PARKED' and server_ip='" . mysql_real_escape_string($server_ip) . "' order by uniqueid;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$parked_to_print = mysql_num_rows($rslt);
|
||||
if ($parked_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
while ($i < $parked_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$channel = sprintf("%-10s", $row[2]);
|
||||
$number_dialed = sprintf("%-15s", $row[3]);
|
||||
$start_time = sprintf("%-19s", $row[4]);
|
||||
$call_time_S = ($STARTtime - $row[5]);
|
||||
|
||||
$call_time_M = ($call_time_S / 60);
|
||||
$call_time_M = round($call_time_M, 2);
|
||||
$call_time_M_int = intval("$call_time_M");
|
||||
$call_time_SEC = ($call_time_M - $call_time_M_int);
|
||||
$call_time_SEC = ($call_time_SEC * 60);
|
||||
$call_time_SEC = round($call_time_SEC, 0);
|
||||
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
|
||||
$call_time_MS = "$call_time_M_int:$call_time_SEC";
|
||||
$call_time_MS = sprintf("%7s", $call_time_MS);
|
||||
$G = ''; $EG = '';
|
||||
if ($call_time_M_int >= 1) {$G='<SPAN class="green"><B>'; $EG='</B></SPAN>';}
|
||||
if ($call_time_M_int >= 6) {$G='<SPAN class="red"><B>'; $EG='</B></SPAN>';}
|
||||
|
||||
echo "| $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+------------+-----------------+---------------------+---------+\n";
|
||||
echo " $i callers waiting on server $server_ip\n\n";
|
||||
|
||||
echo " <SPAN class=\"green\"><B> </SPAN> - 1 minute or more on hold</B>\n";
|
||||
echo " <SPAN class=\"red\"><B> </SPAN> - Over 5 minutes on hold</B>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "****************************************************************\n";
|
||||
echo "****************************************************************\n";
|
||||
echo "******************** NESSUNA CHIAMATA IN ATTESA*********************\n";
|
||||
echo "****************************************************************\n";
|
||||
echo "****************************************************************\n";
|
||||
}
|
||||
|
||||
###################################################################################
|
||||
###### TIME ON INBOUND CALLS
|
||||
###################################################################################
|
||||
echo "\n\n";
|
||||
echo "----------------------------------------------------------------------------------------";
|
||||
echo "\n\n";
|
||||
echo "VICIDIAL: Agents Time On Inbound Calls $NOW_TIME\n\n";
|
||||
echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
|
||||
echo "| STATION | USER | CHANNEL | GROUP | START TIME | MINUTES |\n";
|
||||
echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
|
||||
|
||||
|
||||
$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='" . mysql_real_escape_string($server_ip) . "' order by uniqueid;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$talking_to_print = mysql_num_rows($rslt);
|
||||
if ($talking_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
while ($i < $talking_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$extension = sprintf("%-10s", $row[0]);
|
||||
$user = sprintf("%-6s", $row[1]);
|
||||
$channel = sprintf("%-10s", $row[2]);
|
||||
$number_dialed = sprintf("%-15s", $row[3]);
|
||||
$start_time = sprintf("%-19s", $row[4]);
|
||||
$call_time_S = ($STARTtime - $row[5]);
|
||||
|
||||
$call_time_M = ($call_time_S / 60);
|
||||
$call_time_M = round($call_time_M, 2);
|
||||
$call_time_M_int = intval("$call_time_M");
|
||||
$call_time_SEC = ($call_time_M - $call_time_M_int);
|
||||
$call_time_SEC = ($call_time_SEC * 60);
|
||||
$call_time_SEC = round($call_time_SEC, 0);
|
||||
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
|
||||
$call_time_MS = "$call_time_M_int:$call_time_SEC";
|
||||
$call_time_MS = sprintf("%7s", $call_time_MS);
|
||||
$G = ''; $EG = '';
|
||||
if ($call_time_M_int >= 12) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
|
||||
if ($call_time_M_int >= 31) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
|
||||
|
||||
echo "| $G$extension$EG | $G$user$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
|
||||
echo " $i agents on calls on server $server_ip\n\n";
|
||||
|
||||
echo " <SPAN class=\"blue\"><B> </SPAN> - 12 minutes or more on call</B>\n";
|
||||
echo " <SPAN class=\"purple\"><B> </SPAN> - Over 30 minutes on call</B>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "**************************************************************************************\n";
|
||||
echo "**************************************************************************************\n";
|
||||
echo "********************************* NESSUN OPERATORE IN CONVERSAZIONE *********************************\n";
|
||||
echo "**************************************************************************************\n";
|
||||
echo "**************************************************************************************\n";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,711 @@
|
||||
<?
|
||||
# admin_modify_lead.php
|
||||
#
|
||||
# AST GUI database administration modify lead in vicidial_list
|
||||
# admin_modify_lead.php
|
||||
#
|
||||
# this is the administration lead information modifier screen, the administrator
|
||||
# just needs to enter the leadID and then they can view and modify the
|
||||
# information in the record for that lead
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user
|
||||
# 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60609-1112 - Added DNC list addition if status changed to DNC
|
||||
# 60619-1539 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 61130-1639 - Added recording_log lookup and list for this lead_id
|
||||
# 61201-1136 - Added recording_log user(TSR) display and link
|
||||
# 70305-1133 - Changed to default CHECKED modify logs upon status change
|
||||
# 70424-1128 - Added campaign-specific statuses, reformatted recordings list
|
||||
# 70702-1259 - Added recording location link and truncation
|
||||
# 70906-2132 - Added closer_log records display
|
||||
# 80428-0144 - UTF8 cleanup
|
||||
# 80501-0454 - Added Hangup Reason to logs display
|
||||
# 80516-0936 - Cleanup of logging changes, added vicidial_agent_log display
|
||||
# 80701-0832 - Changed to allow for altering of main phone number
|
||||
# 80805-2106 - Changed comments to TEXTAREA
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
|
||||
elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
|
||||
if (isset($_GET["phone"])) {$phone=$_GET["phone"];}
|
||||
elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];}
|
||||
if (isset($_GET["old_phone"])) {$old_phone=$_GET["old_phone"];}
|
||||
elseif (isset($_POST["old_phone"])) {$old_phone=$_POST["old_phone"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];}
|
||||
elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];}
|
||||
if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];}
|
||||
elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];}
|
||||
elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];}
|
||||
elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];}
|
||||
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
|
||||
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
|
||||
if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];}
|
||||
elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];}
|
||||
if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];}
|
||||
elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["extension"])) {$extension=$_GET["extension"];}
|
||||
elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];}
|
||||
if (isset($_GET["channel"])) {$channel=$_GET["channel"];}
|
||||
elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];}
|
||||
if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];}
|
||||
elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];}
|
||||
if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];}
|
||||
elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];}
|
||||
if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];}
|
||||
elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];}
|
||||
if (isset($_GET["address1"])) {$address1=$_GET["address1"];}
|
||||
elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];}
|
||||
if (isset($_GET["address2"])) {$address2=$_GET["address2"];}
|
||||
elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];}
|
||||
if (isset($_GET["address3"])) {$address3=$_GET["address3"];}
|
||||
elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];}
|
||||
if (isset($_GET["city"])) {$city=$_GET["city"];}
|
||||
elseif (isset($_POST["city"])) {$city=$_POST["city"];}
|
||||
if (isset($_GET["state"])) {$state=$_GET["state"];}
|
||||
elseif (isset($_POST["state"])) {$state=$_POST["state"];}
|
||||
if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];}
|
||||
elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];}
|
||||
if (isset($_GET["province"])) {$province=$_GET["province"];}
|
||||
elseif (isset($_POST["province"])) {$province=$_POST["province"];}
|
||||
if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];}
|
||||
elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];}
|
||||
if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];}
|
||||
elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];}
|
||||
if (isset($_GET["email"])) {$email=$_GET["email"];}
|
||||
elseif (isset($_POST["email"])) {$email=$_POST["email"];}
|
||||
if (isset($_GET["security"])) {$security=$_GET["security"];}
|
||||
elseif (isset($_POST["security"])) {$security=$_POST["security"];}
|
||||
if (isset($_GET["comments"])) {$comments=$_GET["comments"];}
|
||||
elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];}
|
||||
if (isset($_GET["status"])) {$status=$_GET["status"];}
|
||||
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];}
|
||||
elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];}
|
||||
if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];}
|
||||
elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];}
|
||||
if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];}
|
||||
elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];}
|
||||
if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];}
|
||||
elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];}
|
||||
if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];}
|
||||
elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];}
|
||||
if (isset($_GET["modify_logs"])) {$modify_logs=$_GET["modify_logs"];}
|
||||
elseif (isset($_POST["modify_logs"])) {$modify_logs=$_POST["modify_logs"];}
|
||||
if (isset($_GET["modify_closer_logs"])) {$modify_closer_logs=$_GET["modify_closer_logs"];}
|
||||
elseif (isset($_POST["modify_closer_logs"])) {$modify_closer_logs=$_POST["modify_closer_logs"];}
|
||||
if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent_logs"];}
|
||||
elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];}
|
||||
if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];}
|
||||
elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$STARTtime = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$old_phone = ereg_replace("[^0-9]","",$old_phone);
|
||||
$phone_number = ereg_replace("[^0-9]","",$phone_number);
|
||||
$alt_phone = ereg_replace("[^0-9]","",$alt_phone);
|
||||
}
|
||||
if (strlen($phone_number)<6) {$phone_number=$old_phone;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname =$row[0];
|
||||
$LOGmodify_leads =$row[1];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<title>VICIDIAL ADMIN: Registro del Lead modificado</title>
|
||||
</head>
|
||||
<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
<CENTER><FONT FACE="Courier" COLOR=BLACK SIZE=3>
|
||||
<?
|
||||
echo "<a href=\"./admin.php?ADD=100\">VICIDIAL ADMIN</a>: Registro del Lead modificado<BR>\n";
|
||||
|
||||
if ($end_call > 0)
|
||||
{
|
||||
|
||||
### update the lead record in the vicidial_list table
|
||||
$stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "informazione modificata<BR><BR>\n";
|
||||
echo "<form><input type=button value=\"Chiudi Questa Finestra\" onClick=\"javascript:window.close();\"></form>\n";
|
||||
|
||||
if ( ($dispo != $status) and ($dispo == 'CBHOLD') )
|
||||
{
|
||||
### inactivate vicidial_callbacks record for this lead
|
||||
$stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status='ACTIVE';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<BR>vicidial_callback record inactivated: $lead_id<BR>\n";
|
||||
}
|
||||
if ( ($dispo != $status) and ($dispo == 'CALLBK') )
|
||||
{
|
||||
### inactivate vicidial_callbacks record for this lead
|
||||
$stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<BR>vicidial_callback record inactivated: $lead_id<BR>\n";
|
||||
}
|
||||
|
||||
if ( ($dispo != $status) and ($status == 'DNC') )
|
||||
{
|
||||
### add lead to the internal DNC list
|
||||
$stmt="INSERT INTO vicidial_dnc (phone_number) values('" . mysql_real_escape_string($phone_number) . "');";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<BR>Lead added to DNC List: $lead_id - $phone_number<BR>\n";
|
||||
}
|
||||
### update last record in vicidial_log table
|
||||
if (($dispo != $status) and ($modify_logs > 0))
|
||||
{
|
||||
$stmt="UPDATE vicidial_log set status='" . mysql_real_escape_string($status) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by call_date desc limit 1";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
|
||||
### update last record in vicidial_closer_log table
|
||||
if (($dispo != $status) and ($modify_closer_logs > 0))
|
||||
{
|
||||
$stmt="UPDATE vicidial_closer_log set status='" . mysql_real_escape_string($status) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by call_date desc limit 1";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
|
||||
### update last record in vicidial_agent_log table
|
||||
if (($dispo != $status) and ($modify_agent_logs > 0))
|
||||
{
|
||||
$stmt="UPDATE vicidial_agent_log set status='" . mysql_real_escape_string($status) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 1";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
|
||||
if ($add_closer_record > 0)
|
||||
{
|
||||
### insert a NEW record to the vicidial_closer_log table
|
||||
$stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','$NOW_TIME','$STARTtime','1','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ($CBchangeUSERtoANY == 'YES')
|
||||
{
|
||||
### inactivate vicidial_callbacks record for this lead
|
||||
$stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<BR>vicidial_callback record changed to ANYONE<BR>\n";
|
||||
}
|
||||
if ($CBchangeUSERtoUSER == 'YES')
|
||||
{
|
||||
### inactivate vicidial_callbacks record for this lead
|
||||
$stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<BR>vicidial_callback record user changed to $CBuser<BR>\n";
|
||||
}
|
||||
if ($CBchangeANYtoUSER == 'YES')
|
||||
{
|
||||
### inactivate vicidial_callbacks record for this lead
|
||||
$stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<BR>vicidial_callback record changed to USERONLY, user: $CBuser<BR>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$lead_count = $row[0];
|
||||
|
||||
if ($lead_count > 0)
|
||||
{
|
||||
|
||||
##### grab vicidial_log records #####
|
||||
$stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$u=0;
|
||||
$call_log = '';
|
||||
$log_campaign = '';
|
||||
while ($logs_to_print > $u)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
|
||||
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$u++;
|
||||
$call_log .= "<tr $bgcolor>";
|
||||
$call_log .= "<td><font size=1>$u</td>";
|
||||
$call_log .= "<td><font size=2>$row[4]</td>";
|
||||
$call_log .= "<td align=left><font size=2> $row[7]</td>\n";
|
||||
$call_log .= "<td align=left><font size=2> $row[8]</td>\n";
|
||||
$call_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
|
||||
$call_log .= "<td align=right><font size=2> $row[3] </td>\n";
|
||||
$call_log .= "<td align=right><font size=2> $row[2] </td>\n";
|
||||
$call_log .= "<td align=right><font size=2> $row[1] </td>\n";
|
||||
$call_log .= "<td align=right><font size=2> $row[15] </td></tr>\n";
|
||||
|
||||
$campaign_id = $row[3];
|
||||
}
|
||||
|
||||
##### grab vicidial_agent_log records #####
|
||||
$stmt="select * from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$Alogs_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$y=0;
|
||||
$agent_log = '';
|
||||
$Alog_campaign = '';
|
||||
while ($Alogs_to_print > $y)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];}
|
||||
if (eregi("1$|3$|5$|7$|9$", $y))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$y++;
|
||||
$agent_log .= "<tr $bgcolor>";
|
||||
$agent_log .= "<td><font size=1>$y</td>";
|
||||
$agent_log .= "<td><font size=2>$row[3]</td>";
|
||||
$agent_log .= "<td align=left><font size=2> $row[5]</td>\n";
|
||||
$agent_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[1]</A> </td>\n";
|
||||
$agent_log .= "<td align=right><font size=2> $row[7]</td>\n";
|
||||
$agent_log .= "<td align=right><font size=2> $row[9] </td>\n";
|
||||
$agent_log .= "<td align=right><font size=2> $row[11] </td>\n";
|
||||
$agent_log .= "<td align=right><font size=2> $row[13] </td>\n";
|
||||
$agent_log .= "<td align=right><font size=2> $row[14] </td>\n";
|
||||
$agent_log .= "<td align=right><font size=2> $row[15] </td>\n";
|
||||
$agent_log .= "<td align=right><font size=2> $row[17] </td></tr>\n";
|
||||
|
||||
$campaign_id = $row[5];
|
||||
}
|
||||
|
||||
##### grab vicidial_closer_log records #####
|
||||
$stmt="select * from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$Clogs_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$y=0;
|
||||
$closer_log = '';
|
||||
$Clog_campaign = '';
|
||||
while ($Clogs_to_print > $y)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];}
|
||||
if (eregi("1$|3$|5$|7$|9$", $y))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$y++;
|
||||
$closer_log .= "<tr $bgcolor>";
|
||||
$closer_log .= "<td><font size=1>$y</td>";
|
||||
$closer_log .= "<td><font size=2>$row[4]</td>";
|
||||
$closer_log .= "<td align=left><font size=2> $row[7]</td>\n";
|
||||
$closer_log .= "<td align=left><font size=2> $row[8]</td>\n";
|
||||
$closer_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
|
||||
$closer_log .= "<td align=right><font size=2> $row[3] </td>\n";
|
||||
$closer_log .= "<td align=right><font size=2> $row[2] </td>\n";
|
||||
$closer_log .= "<td align=right><font size=2> $row[1] </td>\n";
|
||||
$closer_log .= "<td align=right><font size=2> $row[14] </td>\n";
|
||||
$closer_log .= "<td align=right><font size=2> $row[17] </td></tr>\n";
|
||||
|
||||
$campaign_id = $row[3];
|
||||
}
|
||||
|
||||
##### grab vicidial_list data for lead #####
|
||||
$stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$lead_id = "$row[0]";
|
||||
$dispo = "$row[3]";
|
||||
$tsr = "$row[4]";
|
||||
$vendor_id = "$row[5]";
|
||||
$list_id = "$row[7]";
|
||||
$gmt_offset_now = "$row[8]";
|
||||
$phone_code = "$row[10]";
|
||||
$phone_number = "$row[11]";
|
||||
$title = "$row[12]";
|
||||
$first_name = "$row[13]"; #
|
||||
$middle_initial = "$row[14]";
|
||||
$last_name = "$row[15]"; #
|
||||
$address1 = "$row[16]"; #
|
||||
$address2 = "$row[17]"; #
|
||||
$address3 = "$row[18]"; #
|
||||
$city = "$row[19]"; #
|
||||
$state = "$row[20]"; #
|
||||
$province = "$row[21]"; #
|
||||
$postal_code = "$row[22]"; #
|
||||
$country_code = "$row[23]"; #
|
||||
$gender = "$row[24]";
|
||||
$date_of_birth = "$row[25]";
|
||||
$alt_phone = "$row[26]"; #
|
||||
$email = "$row[27]"; #
|
||||
$security = "$row[28]"; #
|
||||
$comments = "$row[29]"; #
|
||||
|
||||
echo "<br>Informazioni Chiamata: $first_name $last_name - $phone_number<br><br><form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=end_call value=1>\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=hidden name=lead_id value=\"$lead_id\">\n";
|
||||
echo "<input type=hidden name=dispo value=\"$dispo\">\n";
|
||||
echo "<input type=hidden name=list_id value=\"$list_id\">\n";
|
||||
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
|
||||
echo "<input type=hidden name=phone_code value=\"$phone_code\">\n";
|
||||
echo "<input type=hidden name=old_phone value=\"$phone_number\">\n";
|
||||
echo "<input type=hidden name=server_ip value=\"$server_ip\">\n";
|
||||
echo "<input type=hidden name=extension value=\"$extension\">\n";
|
||||
echo "<input type=hidden name=channel value=\"$channel\">\n";
|
||||
echo "<input type=hidden name=call_began value=\"$call_began\">\n";
|
||||
echo "<input type=hidden name=parked_time value=\"$parked_time\">\n";
|
||||
echo "<table cellpadding=1 cellspacing=0>\n";
|
||||
echo "<tr><td colspan=2>Vendor ID: $vendor_id Lead ID: $lead_id</td></tr>\n";
|
||||
echo "<tr><td colspan=2>Fronter: <A HREF=\"user_stats.php?user=$tsr\">$tsr</A> ID Lista: $list_id</td></tr>\n";
|
||||
echo "<tr><td align=right>Nome: </td><td align=left><input type=text name=first_name size=15 maxlength=30 value=\"$first_name\"> \n";
|
||||
echo " Cognome: <input type=text name=last_name size=15 maxlength=30 value=\"$last_name\"> </td></tr>\n";
|
||||
echo "<tr><td align=right>Indirizzo 1 : </td><td align=left><input type=text name=address1 size=30 maxlength=30 value=\"$address1\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Indirizzo 2 : </td><td align=left><input type=text name=address2 size=30 maxlength=30 value=\"$address2\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Indirizzo 3 : </td><td align=left><input type=text name=address3 size=30 maxlength=30 value=\"$address3\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Citta` : </td><td align=left><input type=text name=city size=30 maxlength=30 value=\"$city\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Estado: </td><td align=left><input type=text name=state size=2 maxlength=2 value=\"$state\"> \n";
|
||||
echo " CAP: <input type=text name=postal_code size=10 maxlength=10 value=\"$postal_code\"> </td></tr>\n";
|
||||
|
||||
echo "<tr><td align=right>Provincia : </td><td align=left><input type=text name=province size=30 maxlength=30 value=\"$province\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Stato : </td><td align=left><input type=text name=country_code size=3 maxlength=3 value=\"$country_code\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Main Phone : </td><td align=left><input type=text name=phone_number size=20 maxlength=20 value=\"$phone_number\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Numero Alt : </td><td align=left><input type=text name=alt_phone size=20 maxlength=20 value=\"$alt_phone\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Email : </td><td align=left><input type=text name=email size=30 maxlength=50 value=\"$email\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Seguridad: </td><td align=left><input type=text name=security size=30 maxlength=100 value=\"$security\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Note : </td><td align=left><TEXTAREA name=comments ROWS=3 COLS=65>$comments</TEXTAREA></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Esito: </td><td align=left><select size=1 name=status>\n";
|
||||
|
||||
$stmt="SELECT * from vicidial_statuses where selectable='Y' order by status";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$statuses_list='';
|
||||
|
||||
$o=0;
|
||||
$DS=0;
|
||||
while ($statuses_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) )
|
||||
{$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
|
||||
else
|
||||
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
|
||||
$stmt="SELECT * from vicidial_campaign_statuses where selectable='Y' and campaign_id='$log_campaign' order by status";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$CAMPstatuses_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$o=0;
|
||||
while ($CAMPstatuses_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) )
|
||||
{$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
|
||||
else
|
||||
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
|
||||
|
||||
if ($DS < 1) {$statuses_list .= "<option SELECTED value=\"$dispo\">$dispo</option>\n";}
|
||||
echo "$statuses_list";
|
||||
echo "</select> <i>(with $log_campaign statuses)</i></td></tr>\n";
|
||||
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=left>Modify vicidial log </td><td align=left><input type=checkbox name=modify_logs value=\"1\" CHECKED></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=left>Modify agent log </td><td align=left><input type=checkbox name=modify_agent_logs value=\"1\" CHECKED></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=left>Modify closer log </td><td align=left><input type=checkbox name=modify_closer_logs value=\"1\"></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=left>Add closer log record </td><td align=left><input type=checkbox name=add_closer_record value=\"1\"></td></tr>\n";
|
||||
|
||||
|
||||
echo "<tr><td colspan=2 align=center><input type=submit name=submit value=\"INVIA\"></td></tr>\n";
|
||||
echo "</table></form>\n";
|
||||
echo "<BR><BR><BR>\n";
|
||||
|
||||
if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') )
|
||||
{
|
||||
### find any vicidial_callback records for this lead
|
||||
$stmt="select * from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$CB_to_print = mysql_num_rows($rslt);
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
|
||||
if ($CB_to_print>0)
|
||||
{
|
||||
if ($rowx[9] == 'USERONLY')
|
||||
{
|
||||
echo "<br><form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=CBchangeUSERtoANY value=\"YES\">\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=hidden name=lead_id value=\"$lead_id\">\n";
|
||||
echo "<input type=hidden name=callback_id value=\"$rowx[0]\">\n";
|
||||
echo "<input type=submit name=submit value=\"CHANGE TO ANYONE CALLBACK\"></form><BR>\n";
|
||||
|
||||
echo "<br><form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=CBchangeUSERtoUSER value=\"YES\">\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=hidden name=lead_id value=\"$lead_id\">\n";
|
||||
echo "<input type=hidden name=callback_id value=\"$rowx[0]\">\n";
|
||||
echo "New Callback Owner UserID: <input type=text name=CBuser size=8 maxlength=10 value=\"$rowx[8]\"> \n";
|
||||
echo "<input type=submit name=submit value=\"CHANGE USERONLY CALLBACK USER\"></form><BR>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=CBchangeANYtoUSER value=\"YES\">\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=hidden name=lead_id value=\"$lead_id\">\n";
|
||||
echo "<input type=hidden name=callback_id value=\"$rowx[0]\">\n";
|
||||
echo "New Callback Owner UserID: <input type=text name=CBuser size=8 maxlength=10 value=\"$rowx[8]\"> \n";
|
||||
echo "<input type=submit name=submit value=\"CHANGE TO USERONLY CALLBACK\"></form><BR>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<BR>No Callback records found<BR>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "las operaciones de búsqueda del plomo FALLARON para el lead_id $lead_id $NOW_TIME\n<BR><BR>\n";
|
||||
# echo "<a href=\"$PHP_SELF\">Close this window</a>\n<BR><BR>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo "<br><br>\n";
|
||||
|
||||
echo "<center>\n";
|
||||
|
||||
echo "<B>CHIAMATE VERSO QUESTO CONTATTO:</B>\n";
|
||||
echo "<TABLE width=650 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> TSR</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
||||
|
||||
echo "$call_log\n";
|
||||
|
||||
echo "</TABLE>\n";
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
echo "<B>CLOSER RECORDS FOR THIS LEAD:</B>\n";
|
||||
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> TSR</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> WAIT</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
||||
|
||||
echo "$closer_log\n";
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
|
||||
echo "<B>AGENT LOG RECORDS FOR THIS LEAD:</B>\n";
|
||||
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>CAMPAGNA</td><td align=left><font size=2> TSR</td><td align=left><font size=2> PAUSE</td><td align=right><font size=2> WAIT</td><td align=right><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> SUB</td></tr>\n";
|
||||
|
||||
echo "$agent_log\n";
|
||||
|
||||
echo "</TABLE>\n";
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
|
||||
echo "<B>RECORDINGS FOR THIS LEAD:</B>\n";
|
||||
echo "<TABLE width=750 cellspacing=1 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> RECID</td><td align=center><font size=2>FILENAME</td><td align=left><font size=2>LOCATION</td><td align=left><font size=2>TSR</td></tr>\n";
|
||||
|
||||
$stmt="select * from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$u=0;
|
||||
while ($logs_to_print > $u)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$location = $row[11];
|
||||
if (strlen($location)>30)
|
||||
{$locat = substr($location,0,27); $locat = "$locat...";}
|
||||
else
|
||||
{$locat = $location;}
|
||||
if (eregi("http",$location))
|
||||
{$location = "<a href=\"$location\">$locat</a>";}
|
||||
else
|
||||
{$location = $locat;}
|
||||
$u++;
|
||||
echo "<tr $bgcolor>";
|
||||
echo "<td><font size=1>$u</td>";
|
||||
echo "<td align=left><font size=2> $row[12] </td>";
|
||||
echo "<td align=left><font size=1> $row[4] </td>\n";
|
||||
echo "<td align=left><font size=2> $row[8] </td>\n";
|
||||
echo "<td align=left><font size=2> $row[0] </td>\n";
|
||||
echo "<td align=center><font size=1> $row[10] </td>\n";
|
||||
echo "<td align=left><font size=2> $location </td>\n";
|
||||
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[13]\" target=\"_blank\">$row[13]</A> </td>";
|
||||
echo "</tr>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
|
||||
echo "\n\n\n<br><br><br>\n\n";
|
||||
|
||||
|
||||
echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds</font>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<?
|
||||
# admin_search_lead.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# AST GUI database administration search for lead info
|
||||
# admin_modify_lead.php
|
||||
#
|
||||
# this is the administration lead information modifier screen, the administrator
|
||||
# just needs to enter the leadID and then they can view and modify the information
|
||||
# in the record for that lead
|
||||
#
|
||||
# changes:
|
||||
# 60620-1055 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# - Changed results to multi-record
|
||||
# 80710-0023 - Added searching by list, user, status
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
|
||||
elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
|
||||
if (isset($_GET["phone"])) {$phone=$_GET["phone"];}
|
||||
elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["status"])) {$status=$_GET["status"];}
|
||||
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
|
||||
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$STARTtime = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname =$row[0];
|
||||
$LOGmodify_leads =$row[1];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<title>VICIDIAL ADMIN: Ricerca Contatti</title>
|
||||
</head>
|
||||
<title>Operaciones de búsqueda del Lead</title>
|
||||
</head>
|
||||
<body bgcolor=white>
|
||||
<?
|
||||
echo "<a href=\"./admin.php?ADD=100\">VICIDIAL ADMIN</a>: Lead search<BR>\n";
|
||||
|
||||
|
||||
if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ))
|
||||
{
|
||||
echo date("l F j, Y G:i:s A");
|
||||
echo "\n<br><br><center>\n";
|
||||
echo "<form method=post name=search action=\"$PHP_SELF\">\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<b>Per favore, inserisci:<br> Vendor ID(co`digo del vendedor del Lead): <input type=text name=vendor_id size=10 maxlength=10> or \n";
|
||||
echo "<br><b>un numero di telefono: <input type=text name=phone size=20 maxlength=16> or\n";
|
||||
echo "<br><b>un ID Contatto: <input type=text name=lead_id size=10 maxlength=10> or\n";
|
||||
echo "<br><b>esito: <input type=text name=status size=7 maxlength=6> \n";
|
||||
echo "<b>list ID: <input type=text name=list_id size=15 maxlength=14> \n";
|
||||
echo "<b>user: <input type=text name=user size=15 maxlength=20> <br><br>\n";
|
||||
echo "<input type=submit name=submit value=INVIA></b>\n";
|
||||
echo "</form>\n</center>\n";
|
||||
echo "</body></html>\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
if ($vendor_id)
|
||||
{
|
||||
$stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' order by modify_date desc limit 1000";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($phone)
|
||||
{
|
||||
$stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' order by modify_date desc limit 1000";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($lead_id)
|
||||
{
|
||||
$stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' order by modify_date desc limit 1000";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (strlen($status)>0) or (strlen($list_id)>0) or (strlen($user)>0) )
|
||||
{
|
||||
$statusSQL = '';
|
||||
$list_idSQL = '';
|
||||
$userSQL = '';
|
||||
if (strlen($status)>0)
|
||||
{
|
||||
$statusSQL = "status='" . mysql_real_escape_string($status) . "'"; $SQLctA++;
|
||||
}
|
||||
if (strlen($list_id)>0)
|
||||
{
|
||||
if ($SQLctA > 0) {$andA = 'and';}
|
||||
$list_idSQL = "$andA list_id='" . mysql_real_escape_string($list_id) . "'"; $SQLctB++;
|
||||
}
|
||||
if (strlen($user)>0)
|
||||
{
|
||||
if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';}
|
||||
$userSQL = "$andB user='" . mysql_real_escape_string($user) . "'";
|
||||
}
|
||||
$stmt="SELECT * from vicidial_list where $statusSQL $list_idSQL $userSQL order by modify_date desc limit 1000";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "ERROR: you must search for something! Go back and search for something";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($DB)
|
||||
{
|
||||
echo "\n\n$stmt\n\n";
|
||||
}
|
||||
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$results_to_print = mysql_num_rows($rslt);
|
||||
if ($results_to_print < 1)
|
||||
{
|
||||
echo date("l F j, Y G:i:s A");
|
||||
echo "\n<br><br><center>\n";
|
||||
echo "<b>Le variabili di ricerca inserite non sono attive in questo sistema</b><br><br>\n";
|
||||
echo "<b>Per favore torna indietro e controlla di nuovo le informazioni inserite, quindi reinviale di nuovo</b>\n";
|
||||
echo "</center>\n";
|
||||
echo "</body></html>\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<b>RESULTS: $results_to_print</b><BR><BR>\n";
|
||||
echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0>\n";
|
||||
echo "<TR BGCOLOR=BLACK>\n";
|
||||
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LEAD ID</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>ESITO</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>VENDOR ID</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LAST AGENT</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>ID LISTA</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>PHONE</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>NOME</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>CITY</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>SECURITY</B></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LAST CALL</B></FONT></TD>\n";
|
||||
echo "</TR>\n";
|
||||
$o=0;
|
||||
while ($results_to_print > $o)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$o++;
|
||||
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
echo "<TR $bgcolor>\n";
|
||||
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\">$row[0]</a></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[7]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[11]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[13] $row[15]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[19]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[28]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n";
|
||||
echo "</TR>\n";
|
||||
}
|
||||
echo "</TABLE>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
|
||||
echo "\n\n\n<br><br><br>\n<a href=\"$PHP_SELF\">NUOVA RICERCA</a>";
|
||||
|
||||
|
||||
echo "\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?
|
||||
#
|
||||
# dbconnect.php version 2.0.5
|
||||
#
|
||||
# database connection settings and some global web settings
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
if ( file_exists("/etc/astguiclient.conf") )
|
||||
{
|
||||
$DBCagc = file("/etc/astguiclient.conf");
|
||||
foreach ($DBCagc as $DBCline)
|
||||
{
|
||||
$DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline);
|
||||
if (ereg("^PATHlogs", $DBCline))
|
||||
{$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);}
|
||||
if (ereg("^PATHweb", $DBCline))
|
||||
{$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);}
|
||||
if (ereg("^VARDB_server", $DBCline))
|
||||
{$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);}
|
||||
if (ereg("^VARDB_database", $DBCline))
|
||||
{$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);}
|
||||
if (ereg("^VARDB_user", $DBCline))
|
||||
{$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);}
|
||||
if (ereg("^VARDB_pass", $DBCline))
|
||||
{$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);}
|
||||
if (ereg("^VARDB_port", $DBCline))
|
||||
{$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
#defaults for DB connection
|
||||
$VARDB_server = 'localhost';
|
||||
$VARDB_user = 'cron';
|
||||
$VARDB_pass = '1234';
|
||||
$VARDB_database = '1234';
|
||||
$WeBServeRRooT = '/usr/local/apache2/htdocs';
|
||||
}
|
||||
|
||||
$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass");
|
||||
if (!$link) {
|
||||
die('MySQL connect ERROR: ' . mysql_error());
|
||||
}
|
||||
mysql_select_db("$VARDB_database");
|
||||
|
||||
$local_DEF = 'Local/';
|
||||
$conf_silent_prefix = '7';
|
||||
$local_AMP = '@';
|
||||
$ext_context = 'demo';
|
||||
$recording_exten = '8309';
|
||||
$WeBRooTWritablE = '1';
|
||||
$non_latin = '0'; # set to 1 for UTF rules
|
||||
$AM_shift_BEGIN = '03:45:00';
|
||||
$AM_shift_END = '17:45:00';
|
||||
$PM_shift_BEGIN = '17:45:01';
|
||||
$PM_shift_END = '23:59:59';
|
||||
$admin_qc_enabled = '0';
|
||||
?>
|
||||
@@ -0,0 +1,252 @@
|
||||
<?
|
||||
# group_hourly_stats.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60620-1014 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["status"])) {$status=$_GET["status"];}
|
||||
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
|
||||
if (isset($_GET["date_with_hour"])) {$date_with_hour=$_GET["date_with_hour"];}
|
||||
elseif (isset($_POST["date_with_hour"])) {$date_with_hour=$_POST["date_with_hour"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$STARTtime = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$date_with_hour_default = date("Y-m-d H");
|
||||
$date_no_hour_default = $TODAY;
|
||||
|
||||
if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;}
|
||||
$date_no_hour = $date_with_hour;
|
||||
$date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour);
|
||||
if (!isset($begin_date)) {$begin_date = $TODAY;}
|
||||
if (!isset($end_date)) {$end_date = $TODAY;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
# $stmt="SELECT full_name from vicidial_users where user='$user';";
|
||||
# $rslt=mysql_query($stmt, $link);
|
||||
# $row=mysql_fetch_row($rslt);
|
||||
# $full_name = $row[0];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>VICIDIAL ADMIN: Statistiche Orarie Del Gruppo</title>
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
?>
|
||||
</head>
|
||||
<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
<CENTER>
|
||||
<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php?ADD=100000\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> VICIDIAL ADMIN</a>: Statistiche Orarie Del Gruppo <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?> </TD></TR>
|
||||
|
||||
|
||||
|
||||
|
||||
<?
|
||||
|
||||
if ( ($group) and ($status) and ($date_with_hour) )
|
||||
{
|
||||
$stmt="SELECT user,full_name from vicidial_users where user_group = '" . mysql_real_escape_string($group) . "' order by full_name desc;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$tsrs_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
while($o < $tsrs_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDuser[$o] = "$row[0]";
|
||||
$VDname[$o] = "$row[1]";
|
||||
$o++;
|
||||
}
|
||||
|
||||
$o=0;
|
||||
while($o < $tsrs_to_print)
|
||||
{
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDtotal[$o] = "$row[0]";
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDday[$o] = "$row[0]";
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDcount[$o] = "$row[0]";
|
||||
$o++;
|
||||
}
|
||||
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n";
|
||||
|
||||
echo "<br><center>\n";
|
||||
|
||||
echo "<B>DATI ORARI: <a href=\"./admin.php?ADD=3111&group_id=$group\">$group</a> | $status | $date_with_hour | $date_no_hour</B>\n";
|
||||
|
||||
echo "<center><TABLE width=600 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>TSR </td><td align=left><font size=2>ID </td><td align=right><font size=2> $status</td><td align=right><font size=2> TOTALE CHIAMATE</td><td align=right><font size=2> $status DAY</td><td align=right><font size=2> </td></tr>\n";
|
||||
|
||||
$day_calls=0;
|
||||
$hour_calls=0;
|
||||
$total_calls=0;
|
||||
$o=0;
|
||||
while($o < $tsrs_to_print)
|
||||
{
|
||||
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
echo "<tr $bgcolor><td><font size=2>$VDuser[$o]</td>";
|
||||
echo "<td align=left><font size=2> $VDname[$o]</td>\n";
|
||||
echo "<td align=right><font size=2> $VDcount[$o]</td>\n";
|
||||
echo "<td align=right><font size=2> $VDtotal[$o]</td>\n";
|
||||
echo "<td align=right><font size=2> $VDday[$o]</td>\n";
|
||||
echo "<td align=right><font size=1><a href=\"./admin.php?ADD=3&user=$VDuser[$o]\">MODIFICA</a> | <a href=\"./user_stats.php?user=$VDuser[$o]\">STATISTICHE</a></td></tr>\n";
|
||||
$total_calls = ($total_calls + $VDtotal[$o]);
|
||||
$hour_calls = ($hour_calls + $VDcount[$o]);
|
||||
$day_calls = ($day_calls + $VDday[$o]);
|
||||
|
||||
$o++;
|
||||
}
|
||||
|
||||
echo "<tr><td><font size=2>TOTALE </td><td align=right><font size=2> $status </td><td align=right><font size=2> $hour_calls</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $day_calls</td></tr>\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
echo "<br><br>\n";
|
||||
|
||||
|
||||
echo "<br>Per favore inserisci il gruppo per il quale vuoi le statistiche orarie: <form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=DB value=$DB>\n";
|
||||
echo "gruppo: <select size=1 name=group>\n";
|
||||
|
||||
$stmt="SELECT * from vicidial_user_groups order by user_group";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
$groups_list='';
|
||||
while ($groups_to_print > $o) {
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($group == $group)
|
||||
{$groups_list .= "<option selected value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
|
||||
else
|
||||
{$groups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "$groups_list</select><br>\n";
|
||||
echo "esito: <input type=text name=status size=10 maxlength=10 value=\"$status\"> (esempio: XFER)<br>\n";
|
||||
echo "data e ora: <input type=text name=date_with_hour size=14 maxlength=13 value=\"$date_with_hour\"> (esempio: 2004-06-25 14)<br>\n";
|
||||
echo "<input type=submit name=submit value=INVIA>\n";
|
||||
echo "<BR><BR><BR>\n";
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
|
||||
echo "\n\n\n<br><br><br>\n\n";
|
||||
|
||||
|
||||
echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds</font>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</TD></TR><TABLE>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 492 B |
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,86 @@
|
||||
<?
|
||||
# listloaderMAIN.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this is the main frame page for the lead loading section. This is where you
|
||||
# would upload a file and have it inserted into vicidial_list
|
||||
#
|
||||
# changes:
|
||||
# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 60822-1105 - fixed for nonwritable directories
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$STARTtime = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$FILE_datetime = $STARTtime;
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGload_leads =$row[0];
|
||||
|
||||
if ($LOGload_leads < 1)
|
||||
{
|
||||
echo "You do not have permissions to load leads\n";
|
||||
exit;
|
||||
}
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?><HTML>
|
||||
<HEAD>
|
||||
<TITLE>VICIDIAL: Modulo Caricamento Contatti</TITLE>
|
||||
</HEAD>
|
||||
<FRAMESET ROWS="300,*" border=0>
|
||||
<FRAME SRC="listloader.php" NAME="main">
|
||||
<FRAME SRC="count.htm" NAME="lead_count">
|
||||
</HTML>
|
||||
@@ -0,0 +1,153 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# listloader_rowdisplay.pl version 2.0.5
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60811-1232 - Changed to DBI
|
||||
# 60811-1329 - changed to use /etc/astguiclient.conf for configs
|
||||
#
|
||||
|
||||
### begin parsing run-time options ###
|
||||
if (length($ARGV[0])>1)
|
||||
{
|
||||
$i=0;
|
||||
while ($#ARGV >= $i)
|
||||
{
|
||||
$args = "$args $ARGV[$i]";
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($args =~ /--help|-h/i)
|
||||
{
|
||||
print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($args =~ /-duplicate-check/i)
|
||||
{$dupcheck=1;}
|
||||
if ($args =~ /-postal-code-gmt/i)
|
||||
{$postalgmt=1;}
|
||||
if ($args =~ /--lead-file=/i)
|
||||
{
|
||||
@data_in = split(/--lead-file=/,$args);
|
||||
$lead_file = $data_in[1];
|
||||
$lead_file =~ s/ .*//gi;
|
||||
# print "\n----- LEAD FILE: $lead_file -----\n\n";
|
||||
}
|
||||
else
|
||||
{$lead_file = './vicidial_temp_file.xls';}
|
||||
}
|
||||
}
|
||||
### end parsing run-time options ###
|
||||
|
||||
use Spreadsheet::ParseExcel;
|
||||
use Time::Local;
|
||||
use DBI;
|
||||
|
||||
|
||||
# default path to astguiclient configuration file:
|
||||
$PATHconf = '/etc/astguiclient.conf';
|
||||
|
||||
open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n";
|
||||
@conf = <conf>;
|
||||
close(conf);
|
||||
$i=0;
|
||||
foreach(@conf)
|
||||
{
|
||||
$line = $conf[$i];
|
||||
$line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi;
|
||||
if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) )
|
||||
{$PATHhome = $line; $PATHhome =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) )
|
||||
{$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) )
|
||||
{$PATHagi = $line; $PATHagi =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) )
|
||||
{$PATHweb = $line; $PATHweb =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) )
|
||||
{$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) )
|
||||
{$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) )
|
||||
{$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) )
|
||||
{$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) )
|
||||
{$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) )
|
||||
{$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) )
|
||||
{$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
|
||||
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
|
||||
$i++;
|
||||
}
|
||||
|
||||
# Customized Variables
|
||||
$server_ip = $VARserver_ip; # Asterisk server IP
|
||||
|
||||
if (!$VARDB_port) {$VARDB_port='3306';}
|
||||
|
||||
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
|
||||
$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file");
|
||||
my($iR, $iC, $oWkS, $oWkC);
|
||||
$var_str="";
|
||||
|
||||
foreach $oWkS (@{$oBook->{Worksheet}}) {
|
||||
for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) {
|
||||
$oWkC = $oWkS->{Cells}[0][$iC];
|
||||
if ($oWkC) {
|
||||
$var_str.=$oWkC->Value."|";
|
||||
} else {
|
||||
$var_str.="|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@xls_row=split(/\|/, $var_str);
|
||||
|
||||
|
||||
$stmtA = "select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$rec_count=0;
|
||||
while ($sthArows > $rec_count)
|
||||
{
|
||||
my $names = $sthA->{'NAME'};
|
||||
my $numFields = $sthA->{'NUM_OF_FIELDS'};
|
||||
for (my $i = 0; $i < $numFields; $i++)
|
||||
{
|
||||
# printf("%s%s", $i ? "," : "", $$names[$i]);
|
||||
# printf("%s%s", $i ? "," : "", $$ref[$i]);
|
||||
|
||||
$field_name=uc($$names[$i]);
|
||||
$field_name=~s/\_/ /g;
|
||||
print " <tr bgcolor=#D9E6FE>\r\n";
|
||||
print " <th><font class=standard>".$field_name.": </font></td>\r\n";
|
||||
print " <th><select name='".$$names[$i]."_field'>\r\n";
|
||||
print " <option value='9999'>---------------------</option>\r\n";
|
||||
|
||||
for ($j=0; $j<scalar(@xls_row); $j++)
|
||||
{
|
||||
$xls_row[$j]=~s/\"//g;
|
||||
print " <option value='$j'>\"$xls_row[$j]\"</option>\r\n";
|
||||
}
|
||||
|
||||
print " </select></td>\r\n";
|
||||
print " </tr>\r\n";
|
||||
}
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
exit;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,329 @@
|
||||
<?
|
||||
# remote_dispo.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this is the remote agent disposition screen for calls sent to remote agents.
|
||||
# This allows the remote agent to modify customer information and disposition
|
||||
# the call
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60619-1626 - Added variable filtering to eliminate SQL injection attack threat
|
||||
#
|
||||
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["address1"])) {$address1=$_GET["address1"];}
|
||||
elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];}
|
||||
if (isset($_GET["address2"])) {$address2=$_GET["address2"];}
|
||||
elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];}
|
||||
if (isset($_GET["address3"])) {$address3=$_GET["address3"];}
|
||||
elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];}
|
||||
if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];}
|
||||
elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];}
|
||||
if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];}
|
||||
elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];}
|
||||
if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];}
|
||||
elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];}
|
||||
if (isset($_GET["channel"])) {$channel=$_GET["channel"];}
|
||||
elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];}
|
||||
if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];}
|
||||
elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];}
|
||||
if (isset($_GET["city"])) {$city=$_GET["city"];}
|
||||
elseif (isset($_POST["city"])) {$city=$_POST["city"];}
|
||||
if (isset($_GET["comments"])) {$comments=$_GET["comments"];}
|
||||
elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];}
|
||||
if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];}
|
||||
elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];}
|
||||
if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];}
|
||||
elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];}
|
||||
elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];}
|
||||
if (isset($_GET["email"])) {$email=$_GET["email"];}
|
||||
elseif (isset($_POST["email"])) {$email=$_POST["email"];}
|
||||
if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];}
|
||||
elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];}
|
||||
if (isset($_GET["extension"])) {$extension=$_GET["extension"];}
|
||||
elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];}
|
||||
if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];}
|
||||
elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];}
|
||||
elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
|
||||
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
|
||||
if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];}
|
||||
elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];}
|
||||
elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["phone"])) {$phone=$_GET["phone"];}
|
||||
elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];}
|
||||
if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];}
|
||||
elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];}
|
||||
if (isset($_GET["province"])) {$province=$_GET["province"];}
|
||||
elseif (isset($_POST["province"])) {$province=$_POST["province"];}
|
||||
if (isset($_GET["security"])) {$security=$_GET["security"];}
|
||||
elseif (isset($_POST["security"])) {$security=$_POST["security"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
|
||||
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
|
||||
if (isset($_GET["state"])) {$state=$_GET["state"];}
|
||||
elseif (isset($_POST["state"])) {$state=$_POST["state"];}
|
||||
if (isset($_GET["status"])) {$status=$_GET["status"];}
|
||||
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
|
||||
if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];}
|
||||
elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
|
||||
elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$STARTtime = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$FILE_datetime = $STARTtime;
|
||||
|
||||
$ext_context = 'demo';
|
||||
if (!isset($begin_date)) {$begin_date = $TODAY;}
|
||||
if (!isset($end_date)) {$end_date = $TODAY;}
|
||||
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>REMOTE VICIDIAL: disposicion De la Llamada</title>
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
?>
|
||||
</head>
|
||||
<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
<CENTER><FONT FACE="Courier" COLOR=BLACK SIZE=3>
|
||||
|
||||
<?
|
||||
|
||||
echo "<!-- $call_began $lead_id -->";
|
||||
|
||||
if ($end_call > 0)
|
||||
{
|
||||
|
||||
$call_length = ($STARTtime - $call_began);
|
||||
|
||||
### insert a NEW record to the vicidial_closer_log table
|
||||
$stmt="UPDATE vicidial_closer_log set end_epoch='$STARTtime', length_in_sec='" . mysql_real_escape_string($call_length) . "', status='" . mysql_real_escape_string($status) . "', user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by start_epoch desc limit 1;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### update the lead record in the vicidial_list table
|
||||
$stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "'";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "La Chiamata Ha Avuto Un Esito $NOW_TIME\n<BR><BR>\n";
|
||||
|
||||
echo "<form><input type=button value=\"Chiudi Questa Finestra\" onClick=\"javascript:window.close();\"></form>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$lead_count = $row[0];
|
||||
|
||||
if ($lead_count > 0)
|
||||
{
|
||||
|
||||
$stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$lead_id = "$row[0]";
|
||||
$tsr = "$row[4]";
|
||||
$vendor_id = "$row[5]";
|
||||
$list_id = "$row[7]";
|
||||
$campaign_id = "$row[8]";
|
||||
$phone_code = "$row[10]";
|
||||
$phone_number = "$row[11]";
|
||||
$title = "$row[12]";
|
||||
$first_name = "$row[13]"; #
|
||||
$middle_initial = "$row[14]";
|
||||
$last_name = "$row[15]"; #
|
||||
$address1 = "$row[16]"; #
|
||||
$address2 = "$row[17]"; #
|
||||
$address3 = "$row[18]"; #
|
||||
$city = "$row[19]"; #
|
||||
$state = "$row[20]"; #
|
||||
$province = "$row[21]"; #
|
||||
$postal_code = "$row[22]"; #
|
||||
$country_code = "$row[23]"; #
|
||||
$gender = "$row[24]";
|
||||
$date_of_birth = "$row[25]";
|
||||
$alt_phone = "$row[26]"; #
|
||||
$email = "$row[27]"; #
|
||||
$security = "$row[28]"; #
|
||||
$comments = "$row[29]"; #
|
||||
|
||||
echo "<br>Informazioni Chiamata: $first_name $last_name - $phone_number<br><br><form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=end_call value=1>\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=hidden name=lead_id value=\"$lead_id\">\n";
|
||||
echo "<input type=hidden name=list_id value=\"$list_id\">\n";
|
||||
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
|
||||
echo "<input type=hidden name=phone_code value=\"$phone_code\">\n";
|
||||
echo "<input type=hidden name=phone_number value=\"$phone_number\">\n";
|
||||
echo "<input type=hidden name=server_ip value=\"$server_ip\">\n";
|
||||
echo "<input type=hidden name=extension value=\"$extension\">\n";
|
||||
echo "<input type=hidden name=channel value=\"$channel\">\n";
|
||||
echo "<input type=hidden name=call_began value=\"$call_began\">\n";
|
||||
echo "<input type=hidden name=parked_time value=\"$parked_time\">\n";
|
||||
echo "<table cellpadding=1 cellspacing=0>\n";
|
||||
echo "<tr><td colspan=2>Vendor ID: $vendor_id ID Campagna: $campaign_id</td></tr>\n";
|
||||
echo "<tr><td colspan=2>Fronter: $tsr ID Lista: $list_id</td></tr>\n";
|
||||
echo "<tr><td align=right>Nome: </td><td align=left><input type=text name=first_name size=15 maxlength=30 value=\"$first_name\"> \n";
|
||||
echo " Cognome: <input type=text name=last_name size=15 maxlength=30 value=\"$last_name\"> </td></tr>\n";
|
||||
echo "<tr><td align=right>Indirizzo 1 : </td><td align=left><input type=text name=address1 size=30 maxlength=30 value=\"$address1\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Indirizzo 2 : </td><td align=left><input type=text name=address2 size=30 maxlength=30 value=\"$address2\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Indirizzo 3 : </td><td align=left><input type=text name=address3 size=30 maxlength=30 value=\"$address3\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Citta` : </td><td align=left><input type=text name=city size=30 maxlength=30 value=\"$city\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Estado: </td><td align=left><input type=text name=state size=2 maxlength=2 value=\"$state\"> \n";
|
||||
echo " CAP: <input type=text name=postal_code size=10 maxlength=10 value=\"$postal_code\"> </td></tr>\n";
|
||||
|
||||
echo "<tr><td align=right>Provincia : </td><td align=left><input type=text name=province size=30 maxlength=30 value=\"$province\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Stato : </td><td align=left><input type=text name=country_code size=3 maxlength=3 value=\"$country_code\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Numero Alt : </td><td align=left><input type=text name=alt_phone size=10 maxlength=10 value=\"$alt_phone\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Email : </td><td align=left><input type=text name=email size=30 maxlength=50 value=\"$email\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Seguridad: </td><td align=left><input type=text name=security size=30 maxlength=100 value=\"$security\"></td></tr>\n";
|
||||
echo "<tr><td align=right>Note : </td><td align=left><input type=text name=comments size=30 maxlength=255 value=\"$comments\"></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Esito: </td><td align=left><select size=1 name=status>\n";
|
||||
|
||||
$stmt="SELECT * from vicidial_statuses where selectable='Y' order by status";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$statuses_list='';
|
||||
|
||||
$o=0;
|
||||
while ($statuses_to_print > $o) {
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
|
||||
$o++;
|
||||
}
|
||||
echo "$statuses_list";
|
||||
echo "</select></td></tr>\n";
|
||||
|
||||
|
||||
echo "<tr><td colspan=2><input type=submit name=submit value=\"ESITO CHIAMATA\"></td></tr>\n";
|
||||
echo "</table></form>\n";
|
||||
echo "<BR><BR><BR>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "las operaciones de búsqueda del plomo FALLARON para el lead_id $lead_id $NOW_TIME\n<BR><BR>\n";
|
||||
# echo "<a href=\"$PHP_SELF\">Close this window</a>\n<BR><BR>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
|
||||
echo "\n\n\n<br><br><br>\n\n";
|
||||
|
||||
|
||||
echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds</font>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,558 @@
|
||||
<?
|
||||
# user_stats.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 61201-1136 - Added recordings display and changed calls to time range with 10000 limit
|
||||
# 70118-1605 - Added user group column to login/out and calls lists
|
||||
# 70702-1231 - Added recording location link and truncation
|
||||
# 80117-0316 - Added vicidial_user_closer_log entries to display
|
||||
# 80501-0506 - Added Hangup Reason to logs display
|
||||
# 80523-2012 - Added vicidial timeclock records display
|
||||
# 80617-1402 - Fixed timeclock total logged-in time
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];}
|
||||
elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];}
|
||||
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
||||
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$STARTtime = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
|
||||
if (!isset($begin_date)) {$begin_date = $TODAY;}
|
||||
if (!isset($end_date)) {$end_date = $TODAY;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>VICIDIAL ADMIN: User Stats</title>
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
?>
|
||||
</head>
|
||||
<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
<CENTER>
|
||||
<TABLE WIDTH=680 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> VICIDIAL ADMIN</a>: User Stats for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?> </TD></TR>
|
||||
|
||||
|
||||
|
||||
|
||||
<?
|
||||
|
||||
echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B> \n";
|
||||
|
||||
echo "<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=user value=\"$user\">\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10> to \n";
|
||||
echo "<input type=text name=end_date value=\"$end_date\" size=10 maxsize=10> \n";
|
||||
echo "<input type=submit name=submit value=submit>\n";
|
||||
|
||||
|
||||
echo " $user - $full_name\n";
|
||||
|
||||
echo " - <a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n";
|
||||
echo " - <a href=\"./user_status.php?user=$user\">User Status</a>\n";
|
||||
echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n";
|
||||
|
||||
|
||||
echo "</B></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n";
|
||||
|
||||
|
||||
$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
|
||||
echo "<br><center>\n";
|
||||
|
||||
##### vicidial agent talk time and status #####
|
||||
|
||||
echo "<B>VICIDIAL TEMPO DI CHIAMATA E ESITO:</B>\n";
|
||||
|
||||
echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>ESITO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>ORE:MINUTI</td></tr>\n";
|
||||
|
||||
$total_calls=0;
|
||||
$o=0;
|
||||
while ($statuses_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$call_seconds = $row[2];
|
||||
$call_hours = ($call_seconds / 3600);
|
||||
$call_hours_int = round($call_hours, 2);
|
||||
$call_hours_int = intval("$call_hours_int");
|
||||
$call_minutes = ($call_hours - $call_hours_int);
|
||||
$call_minutes = ($call_minutes * 60);
|
||||
$call_minutes_int = round($call_minutes, 0);
|
||||
if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";}
|
||||
|
||||
echo "<tr $bgcolor><td><font size=2>$row[1]</td>";
|
||||
echo "<td align=right><font size=2> $row[0]</td>\n";
|
||||
echo "<td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n";
|
||||
$total_calls = ($total_calls + $row[0]);
|
||||
|
||||
$call_seconds=0;
|
||||
$o++;
|
||||
}
|
||||
|
||||
$stmt="SELECT sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$counts_to_print = mysql_num_rows($rslt);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$call_seconds = $row[0];
|
||||
$call_hours = ($call_seconds / 3600);
|
||||
$call_hours_int = round($call_hours, 2);
|
||||
$call_hours_int = intval("$call_hours_int");
|
||||
$call_minutes = ($call_hours - $call_hours_int);
|
||||
$call_minutes = ($call_minutes * 60);
|
||||
$call_minutes_int = round($call_minutes, 0);
|
||||
if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";}
|
||||
|
||||
echo "<tr><td><font size=2>TOTALE CHIAMATE </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
|
||||
##### Login and Logout time from vicidial agent interface #####
|
||||
|
||||
echo "<br><br>\n";
|
||||
|
||||
echo "<center>\n";
|
||||
|
||||
echo "<B>VICIDIAL AGENT TIEMPO LOGIN/LOGOUT:</B>\n";
|
||||
echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ORE:MINUTI</td></tr>\n";
|
||||
|
||||
$stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$events_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$total_calls=0;
|
||||
$o=0;
|
||||
$event_start_seconds='';
|
||||
$event_stop_seconds='';
|
||||
while ($events_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("LOGIN", $row[0]))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
if (ereg("LOGIN", $row[0]))
|
||||
{
|
||||
$event_start_seconds = $row[1];
|
||||
echo "<tr $bgcolor><td><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $row[2]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[3]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[4]</td>\n";
|
||||
echo "<td align=right><font size=2> </td></tr>\n";
|
||||
}
|
||||
if (ereg("LOGOUT", $row[0]))
|
||||
{
|
||||
if ($event_start_seconds)
|
||||
{
|
||||
$event_stop_seconds = $row[1];
|
||||
$event_seconds = ($event_stop_seconds - $event_start_seconds);
|
||||
$total_login_time = ($total_login_time + $event_seconds);
|
||||
$event_hours = ($event_seconds / 3600);
|
||||
$event_hours_int = round($event_hours, 2);
|
||||
$event_hours_int = intval("$event_hours_int");
|
||||
$event_minutes = ($event_hours - $event_hours_int);
|
||||
$event_minutes = ($event_minutes * 60);
|
||||
$event_minutes_int = round($event_minutes, 0);
|
||||
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
|
||||
echo "<tr $bgcolor><td><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $row[2]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[3]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[4]</td>\n";
|
||||
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n";
|
||||
$event_start_seconds='';
|
||||
$event_stop_seconds='';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr $bgcolor><td><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $row[2]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[3]</td>\n";
|
||||
echo "<td align=right><font size=2> </td></tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$total_calls = ($total_calls + $row[0]);
|
||||
|
||||
$call_seconds=0;
|
||||
$o++;
|
||||
}
|
||||
|
||||
$total_login_hours = ($total_login_time / 3600);
|
||||
$total_login_hours_int = round($total_login_hours, 2);
|
||||
$total_login_hours_int = intval("$total_login_hours_int");
|
||||
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
|
||||
$total_login_minutes = ($total_login_minutes * 60);
|
||||
$total_login_minutes_int = round($total_login_minutes, 0);
|
||||
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
|
||||
|
||||
echo "<tr><td><font size=2>TOTALE</td>";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int</td></tr>\n";
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##### vicidial_timeclock log records for user #####
|
||||
|
||||
$total_login_time=0;
|
||||
$SQday_ARY = explode('-',$begin_date);
|
||||
$EQday_ARY = explode('-',$end_date);
|
||||
$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
|
||||
$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
|
||||
|
||||
echo "<br><br>\n";
|
||||
|
||||
echo "<center>\n";
|
||||
|
||||
echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n";
|
||||
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ORE:MINUTI</td></tr>\n";
|
||||
|
||||
$stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';";
|
||||
if ($DB>0) {echo "|$stmt|";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$events_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$total_logs=0;
|
||||
$o=0;
|
||||
while ($events_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( ($row[0]=='START') or ($row[0]=='LOGIN') )
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$TC_log_date = date("Y-m-d H:i:s", $row[1]);
|
||||
|
||||
$manager_edit='';
|
||||
if (strlen($row[6])>0) {$manager_edit = ' * ';}
|
||||
|
||||
if (ereg("LOGIN", $row[0]))
|
||||
{
|
||||
$login_sec='';
|
||||
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
||||
echo "<td align=right><font size=2>$manager_edit</td>";
|
||||
echo "<td align=right><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
||||
echo "<td align=right><font size=2> $row[4]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[2]</td>\n";
|
||||
echo "<td align=right><font size=2> </td></tr>\n";
|
||||
}
|
||||
if (ereg("LOGOUT", $row[0]))
|
||||
{
|
||||
$login_sec = $row[3];
|
||||
$total_login_time = ($total_login_time + $login_sec);
|
||||
$event_hours = ($login_sec / 3600);
|
||||
$event_hours_int = round($event_hours, 2);
|
||||
$event_hours_int = intval("$event_hours_int");
|
||||
$event_minutes = ($event_hours - $event_hours_int);
|
||||
$event_minutes = ($event_minutes * 60);
|
||||
$event_minutes_int = round($event_minutes, 0);
|
||||
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
|
||||
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
||||
echo "<td align=right><font size=2>$manager_edit</td>";
|
||||
echo "<td align=right><font size=2>$row[0]</td>";
|
||||
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
||||
echo "<td align=right><font size=2> $row[4]</td>\n";
|
||||
echo "<td align=right><font size=2> $row[2]</td>\n";
|
||||
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int";
|
||||
if ($DB) {echo " - $total_login_time - $login_sec";}
|
||||
echo "</td></tr>\n";
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
if (strlen($login_sec)<1)
|
||||
{
|
||||
$login_sec = ($STARTtime - $row[1]);
|
||||
$total_login_time = ($total_login_time + $login_sec);
|
||||
if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";}
|
||||
}
|
||||
$total_login_hours = ($total_login_time / 3600);
|
||||
$total_login_hours_int = round($total_login_hours, 2);
|
||||
$total_login_hours_int = intval("$total_login_hours_int");
|
||||
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
|
||||
$total_login_minutes = ($total_login_minutes * 60);
|
||||
$total_login_minutes_int = round($total_login_minutes, 0);
|
||||
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
|
||||
|
||||
if ($DB) {echo " - $total_login_time - $login_sec";}
|
||||
|
||||
echo "<tr><td align=right><font size=2> </td>";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2> </td>\n";
|
||||
echo "<td align=right><font size=2><font size=2>TOTALE </td>\n";
|
||||
echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n";
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
|
||||
##### closer in-group selection logs #####
|
||||
|
||||
echo "<br><br>\n";
|
||||
|
||||
echo "<center>\n";
|
||||
|
||||
echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n";
|
||||
echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAGNA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td></tr>\n";
|
||||
|
||||
$stmt="select * from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$u=0;
|
||||
while ($logs_to_print > $u) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$u++;
|
||||
echo "<tr $bgcolor>";
|
||||
echo "<td><font size=1>$u</td>";
|
||||
echo "<td><font size=2>$row[2]</td>";
|
||||
echo "<td align=left><font size=2> $row[1]</td>\n";
|
||||
echo "<td align=left><font size=2> $row[3]</td>\n";
|
||||
echo "<td align=left><font size=2> $row[4] </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</TABLE><BR><BR>\n";
|
||||
|
||||
|
||||
##### vicidial agent outbound calls for this time period #####
|
||||
|
||||
echo "<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||
echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
||||
|
||||
$stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$u=0;
|
||||
while ($logs_to_print > $u) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$u++;
|
||||
echo "<tr $bgcolor>";
|
||||
echo "<td><font size=1>$u</td>";
|
||||
echo "<td><font size=2>$row[4]</td>";
|
||||
echo "<td align=left><font size=2> $row[7]</td>\n";
|
||||
echo "<td align=left><font size=2> $row[8]</td>\n";
|
||||
echo "<td align=left><font size=2> $row[10] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[3] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[14] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[2] </td>\n";
|
||||
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n";
|
||||
echo "<td align=right><font size=2> $row[15] </td></tr>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</TABLE><BR><BR>\n";
|
||||
|
||||
|
||||
##### vicidial agent inbound calls for this time period #####
|
||||
|
||||
echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||
echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
||||
|
||||
$stmt="select * from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$u=0;
|
||||
while ($logs_to_print > $u) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$u++;
|
||||
echo "<tr $bgcolor>";
|
||||
echo "<td><font size=1>$u</td>";
|
||||
echo "<td><font size=2>$row[4]</td>";
|
||||
echo "<td align=left><font size=2> $row[7]</td>\n";
|
||||
echo "<td align=left><font size=2> $row[8]</td>\n";
|
||||
echo "<td align=left><font size=2> $row[10] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[3] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[14] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[2] </td>\n";
|
||||
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n";
|
||||
echo "<td align=right><font size=2> $row[17] </td></tr>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</TABLE></center><BR><BR>\n";
|
||||
|
||||
|
||||
##### vicidial recordings for this time period #####
|
||||
|
||||
echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION </td></tr>\n";
|
||||
|
||||
$stmt="select * from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$u=0;
|
||||
while ($logs_to_print > $u)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$location = $row[11];
|
||||
if (strlen($location)>30)
|
||||
{$locat = substr($location,0,27); $locat = "$locat...";}
|
||||
else
|
||||
{$locat = $location;}
|
||||
if (eregi("http",$location))
|
||||
{$location = "<a href=\"$location\">$locat</a>";}
|
||||
else
|
||||
{$location = $locat;}
|
||||
$u++;
|
||||
echo "<tr $bgcolor>";
|
||||
echo "<td><font size=1>$u</td>";
|
||||
echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>";
|
||||
echo "<td align=left><font size=2> $row[4] </td>\n";
|
||||
echo "<td align=left><font size=2> $row[8] </td>\n";
|
||||
echo "<td align=left><font size=2> $row[0] </td>\n";
|
||||
echo "<td align=center><font size=2> $row[10] </td>\n";
|
||||
echo "<td align=right><font size=2> $location </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
|
||||
echo "\n\n\n<br><br><br>\n\n";
|
||||
|
||||
|
||||
echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds</font>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</TD></TR><TABLE>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,477 @@
|
||||
<?
|
||||
# user_status.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60619-1738 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 80603-1452 - Added manager timeclock force login/logout of user
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];}
|
||||
elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];}
|
||||
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$StarTtimE = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
|
||||
if (!isset($begin_date)) {$begin_date = $TODAY;}
|
||||
if (!isset($end_date)) {$end_date = $TODAY;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname = $row[0];
|
||||
$change_agent_campaign = $row[1];
|
||||
$modify_timeclock_log = $row[2];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
$stmt="SELECT full_name,user_group from vicidial_users where user='" . mysql_real_escape_string($user) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
$user_group = $row[1];
|
||||
|
||||
$stmt="SELECT * from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$agents_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $agents_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Aserver_ip = $row[2];
|
||||
$Asession_id = $row[3];
|
||||
$Aextension = $row[4];
|
||||
$Astatus = $row[5];
|
||||
$Acampaign = $row[7];
|
||||
$Alast_call = $row[14];
|
||||
$Acl_campaigns = $row[15];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="SELECT event_date,status,ip_address from vicidial_timeclock_status where user='" . mysql_real_escape_string($user) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$tc_logs_to_print = mysql_num_rows($rslt);
|
||||
if ($tc_logs_to_print > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Tevent_date = $row[0];
|
||||
$Tstatus = $row[1];
|
||||
$Tip_address = $row[2];
|
||||
$i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$stmt="select * from vicidial_campaigns;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $groups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>VICIDIAL ADMIN: User Status</title>
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
?>
|
||||
</head>
|
||||
<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
<CENTER>
|
||||
<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> VICIDIAL ADMIN</a>: User Status for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?> </TD></TR>
|
||||
|
||||
|
||||
|
||||
|
||||
<?
|
||||
|
||||
echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B> \n";
|
||||
|
||||
##### EMERGENCY CAMPAIGN CHANGE FOR AN AGENT #####
|
||||
if ($stage == "live_campaign_change")
|
||||
{
|
||||
$stmt="UPDATE vicidial_live_agents set campaign_id='" . mysql_real_escape_string($group) . "' where user='" . mysql_real_escape_string($user) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "Agent $user - $full_name changed to $group campaign<BR>\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
##### EMERGENCY LOGOUT OF AN AGENT #####
|
||||
if ($stage == "log_agent_out")
|
||||
{
|
||||
$stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<BR>\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##### BEGIN TIMECLOCK LOGOUT OF A USER #####
|
||||
if ( ( ($stage == "tc_log_user_OUT") or ($stage == "tc_log_user_IN") ) and ($modify_timeclock_log > 0) )
|
||||
{
|
||||
### get vicidial_timeclock_status record count for this user
|
||||
$stmt="SELECT count(*) from vicidial_timeclock_status where user='$user';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vts_count = $row[0];
|
||||
|
||||
$LOG_run=0;
|
||||
$last_action_sec=99;
|
||||
|
||||
if ($vts_count > 0)
|
||||
{
|
||||
### vicidial_timeclock_status record found, grab status and date of last activity
|
||||
$stmt="SELECT status,event_epoch from vicidial_timeclock_status where user='$user';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$status = $row[0];
|
||||
$event_epoch = $row[1];
|
||||
$last_action_date = date("Y-m-d H:i:s", $event_epoch);
|
||||
$last_action_sec = ($StarTtimE - $event_epoch);
|
||||
|
||||
if ($last_action_sec > 0)
|
||||
{
|
||||
$totTIME_H = ($last_action_sec / 3600);
|
||||
$totTIME_H_int = round($totTIME_H, 2);
|
||||
$totTIME_H_int = intval("$totTIME_H");
|
||||
$totTIME_M = ($totTIME_H - $totTIME_H_int);
|
||||
$totTIME_M = ($totTIME_M * 60);
|
||||
$totTIME_M_int = round($totTIME_M, 2);
|
||||
$totTIME_M_int = intval("$totTIME_M");
|
||||
$totTIME_S = ($totTIME_M - $totTIME_M_int);
|
||||
$totTIME_S = ($totTIME_S * 60);
|
||||
$totTIME_S = round($totTIME_S, 0);
|
||||
if (strlen($totTIME_H_int) < 1) {$totTIME_H_int = "0";}
|
||||
if ($totTIME_M_int < 10) {$totTIME_M_int = "0$totTIME_M_int";}
|
||||
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
|
||||
$totTIME_HMS = "$totTIME_H_int:$totTIME_M_int:$totTIME_S";
|
||||
}
|
||||
else
|
||||
{
|
||||
$totTIME_HMS='0:00:00';
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
### No vicidial_timeclock_status record found, insert one
|
||||
$stmt="INSERT INTO vicidial_timeclock_status set status='START', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$status='START';
|
||||
$totTIME_HMS='0:00:00';
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_timeclock_status record inserted for $user: |$affected_rows| -->\n";
|
||||
}
|
||||
|
||||
|
||||
##### Run timeclock login queries #####
|
||||
if ( ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage == "tc_log_user_IN") )
|
||||
{
|
||||
### Add a record to the timeclock log
|
||||
$stmtA="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME', manager_user='$PHP_AUTH_USER', manager_ip='$ip', notes='Manager LOGIN of user from user status page';";
|
||||
if ($DB) {echo "$stmtA\n";}
|
||||
$rslt=mysql_query($stmtA, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
$timeclock_id = mysql_insert_id($link);
|
||||
print "<!-- NEW vicidial_timeclock_log record inserted for $user: |$affected_rows|$timeclock_id| -->\n";
|
||||
|
||||
### Update the user's timeclock status record
|
||||
$stmtB="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';";
|
||||
if ($DB) {echo "$stmtB\n";}
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the timeclock audit log
|
||||
$stmtC="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';";
|
||||
if ($DB) {echo "$stmtC\n";}
|
||||
$rslt=mysql_query($stmtC, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the vicidial_admin_log
|
||||
$SQL_log = "$stmtA|$stmtB|$stmtC|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TIMECLOCK', event_type='LOGIN', record_id='$user', event_code='USER FORCED LOGIN FROM STATUS PAGE', event_sql=\"$SQL_log\", event_notes='Timeclock ID: $timeclock_id|';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_admin_log record inserted for $PHP_AUTH_USER: |$affected_rows| -->\n";
|
||||
|
||||
$LOG_run++;
|
||||
$VDdisplayMESSAGE = "You have now logged-in the user: $user - $full_name";
|
||||
}
|
||||
|
||||
##### Run timeclock logout queries #####
|
||||
if ( ( ($status=='LOGIN') or ($status=='START') ) and ($stage == "tc_log_user_OUT") )
|
||||
{
|
||||
### Add a record to the timeclock log
|
||||
$stmtA="INSERT INTO vicidial_timeclock_log set event='LOGOUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME', manager_user='$PHP_AUTH_USER', manager_ip='$ip', notes='Manager LOGOUT of user from user status page';";
|
||||
if ($DB) {echo "$stmtA\n";}
|
||||
$rslt=mysql_query($stmtA, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
$timeclock_id = mysql_insert_id($link);
|
||||
print "<!-- NEW vicidial_timeclock_log record inserted for $user: |$affected_rows|$timeclock_id| -->\n";
|
||||
|
||||
### Update last login record in the timeclock log
|
||||
$stmtB="UPDATE vicidial_timeclock_log set login_sec='$last_action_sec',tcid_link='$timeclock_id' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;";
|
||||
if ($DB) {echo "$stmtB\n";}
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_log record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Update the user's timeclock status record
|
||||
$stmtC="UPDATE vicidial_timeclock_status set status='LOGOUT', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';";
|
||||
if ($DB) {echo "$stmtC\n";}
|
||||
$rslt=mysql_query($stmtC, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the timeclock audit log
|
||||
$stmtD="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='LOGOUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';";
|
||||
if ($DB) {echo "$stmtD\n";}
|
||||
$rslt=mysql_query($stmtD, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Update last login record in the timeclock audit log
|
||||
$stmtE="UPDATE vicidial_timeclock_audit_log set login_sec='$last_action_sec',tcid_link='$timeclock_id' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;";
|
||||
if ($DB) {echo "$stmtE\n";}
|
||||
$rslt=mysql_query($stmtE, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_audit_log record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the vicidial_admin_log
|
||||
$SQL_log = "$stmtA|$stmtB|$stmtC|$stmtD|$stmtE|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TIMECLOCK', event_type='LOGOUT', record_id='$user', event_code='USER FORCED LOGOUT FROM STATUS PAGE', event_sql=\"$SQL_log\", event_notes='User login time: $last_action_sec|Timeclock ID: $timeclock_id|';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_admin_log record inserted for $PHP_AUTH_USER: |$affected_rows| -->\n";
|
||||
|
||||
$LOG_run++;
|
||||
$VDdisplayMESSAGE = "You have now logged-out the user: $user - $full_name<BR>Amount of time user was logged-in: $totTIME_HMS";
|
||||
}
|
||||
|
||||
if ($LOG_run < 1)
|
||||
{$VDdisplayMESSAGE = "ERROR: timeclock log problem, could not process: $status|$stage";}
|
||||
|
||||
echo "$VDdisplayMESSAGE\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
##### END TIMECLOCK LOGOUT OF A USER #####
|
||||
|
||||
if ($agents_to_print > 0)
|
||||
{
|
||||
echo "<BR>\n";
|
||||
echo "$user - $full_name \n";
|
||||
echo " GROUP: $user_group <BR>\n";
|
||||
|
||||
echo "<TABLE CELLPADDING=0 CELLSPACING=0>";
|
||||
echo "<TR><TD ALIGN=RIGHT>Agent Logged in at server:</TD><TD ALIGN=LEFT> $Aserver_ip</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>in session:</TD><TD ALIGN=LEFT> $Asession_id</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>from phone:</TD><TD ALIGN=LEFT> $Aextension</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Agent is in campaign:</TD><TD ALIGN=LEFT> $Acampaign</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>esito:</TD><TD ALIGN=LEFT> $Astatus</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>hungup last call at:</TD><TD ALIGN=LEFT> $Alast_call</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Closer groups:</TD><TD ALIGN=LEFT> $Acl_campaigns</TD></TR>\n";
|
||||
echo "</TABLE>\n<BR>\n";
|
||||
|
||||
|
||||
if ($change_agent_campaign > 0)
|
||||
{
|
||||
echo "<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=hidden name=user value=\"$user\">\n";
|
||||
echo "<input type=hidden name=stage value=\"live_campaign_change\">\n";
|
||||
echo "Current Campagna: <SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($groups_to_print > $o)
|
||||
{
|
||||
if ($groups[$o] == "$Acampaign") {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<input type=submit name=submit value=CHANGE><BR></form>\n";
|
||||
|
||||
|
||||
echo "<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=hidden name=user value=\"$user\">\n";
|
||||
echo "<input type=hidden name=stage value=\"log_agent_out\">\n";
|
||||
echo "<input type=submit name=submit value=\"EMERGENCY LOG AGENT OUT\"><BR></form>\n";
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
echo "Agent is not logged in to VICIDIAL\n<BR>";
|
||||
}
|
||||
|
||||
echo "\n<BR>";
|
||||
|
||||
if ( ($Tstatus == "LOGIN") or ($Tstatus == "START") )
|
||||
{
|
||||
echo "User $user($full_name) - is logged in to the timeclock. <BR>Login time: $Tevent_date from $Tip_address<BR>\n";
|
||||
$TC_log_change_stage = 'tc_log_user_OUT';
|
||||
$TC_log_change_button = 'TIMECLOCK LOG THIS USER OUT';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "User $user($full_name) - is NOT logged in to the timeclock. <BR>Last logout time: $Tevent_date from $Tip_address<BR>\n";
|
||||
$TC_log_change_stage = 'tc_log_user_IN';
|
||||
$TC_log_change_button = 'TIMECLOCK LOG THIS USER IN';
|
||||
}
|
||||
|
||||
if ($modify_timeclock_log > 0)
|
||||
{
|
||||
echo "<BR><BR>\n";
|
||||
echo "<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||
echo "<input type=hidden name=user value=\"$user\">\n";
|
||||
echo "<input type=hidden name=stage value=\"$TC_log_change_stage\">\n";
|
||||
echo "<input type=submit name=submit value=\"$TC_log_change_button\"><BR></form>\n";
|
||||
echo "<BR><BR>\n";
|
||||
}
|
||||
|
||||
|
||||
echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n";
|
||||
echo " - <a href=\"./user_stats.php?user=$user\">User Stats</a>\n";
|
||||
echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n";
|
||||
|
||||
echo "</B></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n";
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $StarTtimE);
|
||||
|
||||
echo "\n\n\n<br><br><br>\n\n";
|
||||
|
||||
|
||||
echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds</font>";
|
||||
|
||||
echo "|$stage|$group|";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</TD></TR><TABLE>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,604 @@
|
||||
<?
|
||||
# vdremote.php
|
||||
#
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at
|
||||
# least user_level 4 to access this page the first time
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# Changes
|
||||
# 50307-1721 - First version
|
||||
# 51123-1502 - removed requirement of PHP Globals=on
|
||||
# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat
|
||||
#
|
||||
|
||||
$version = '1.1.12';
|
||||
$build = '60619-1603';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];}
|
||||
elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];}
|
||||
elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];}
|
||||
if (isset($_GET["groups"])) {$groups=$_GET["groups"];}
|
||||
elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];}
|
||||
if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];}
|
||||
elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];}
|
||||
if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];}
|
||||
elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];}
|
||||
if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];}
|
||||
elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];}
|
||||
elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];}
|
||||
if (isset($_GET["status"])) {$status=$_GET["status"];}
|
||||
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
|
||||
if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];}
|
||||
elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];}
|
||||
if (isset($_GET["groups"])) {$groups=$_GET["groups"];}
|
||||
elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
|
||||
if (!isset($force_logout)) {$force_logout = 0;}
|
||||
|
||||
if ($force_logout)
|
||||
{
|
||||
if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) )
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
}
|
||||
echo "Ora non sei collegato. Grazie\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
|
||||
$popup_page = './closer_popup.php';
|
||||
$STARTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 3;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_remote_agents where user_start='$PHP_AUTH_USER';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$authx=$row[0];
|
||||
|
||||
if($authx>0)
|
||||
{
|
||||
$stmt="SELECT remote_agent_id,server_ip,number_of_lines from vicidial_remote_agents where user_start='$PHP_AUTH_USER';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$remote_agent_id=$row[0];
|
||||
$server_ip=$row[1];
|
||||
if (!$number_of_lines) {$number_of_lines=$row[2];}
|
||||
|
||||
fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
echo "This remote agent does not exist: |$PHP_AUTH_USER|\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
if ($ADD==61111)
|
||||
{
|
||||
echo"<META HTTP-EQUIV=Refresh CONTENT=\"5; URL=$PHP_SELF?ADD=61111&user=$user&DB=$DB\">\n";
|
||||
}
|
||||
echo "<!-- VERSIONE: $version BUILD: $build -->\n";
|
||||
?>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
.yellow {color: black; background-color: yellow}
|
||||
.orange {color: black; background-color: orange}
|
||||
-->
|
||||
</STYLE>
|
||||
<?
|
||||
echo "<title>VICIDIAL, AGENTES REMOTOS: $LOGfullname - $PHP_AUTH_USER ";
|
||||
|
||||
if (!$ADD) {$ADD="31111";}
|
||||
if ($ADD==31111) {echo "Modifica Operatori Remoti";}
|
||||
if ($ADD==41111) {echo "Modifica Operatori Remoti";}
|
||||
if ($ADD==61111) {echo "Remote Agent Status";}
|
||||
if ($ADD==71111) {echo "Remote Agent Closer Stats";}
|
||||
|
||||
|
||||
if (strlen($ADD)>4)
|
||||
{
|
||||
##### get server listing for dynamic pulldown
|
||||
$stmt="SELECT server_ip,server_description from servers order by server_ip";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$servers_to_print = mysql_num_rows($rslt);
|
||||
$servers_list='';
|
||||
|
||||
$o=0;
|
||||
while ($servers_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
|
||||
$o++;
|
||||
}
|
||||
|
||||
##### get campaigns listing for dynamic pulldown
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$campaigns_list='';
|
||||
|
||||
$o=0;
|
||||
while ($campaigns_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
|
||||
$o++;
|
||||
}
|
||||
|
||||
##### get inbound groups listing for checkboxes
|
||||
if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) )
|
||||
{
|
||||
$stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = $row[0];
|
||||
$closer_campaigns = preg_replace("/ -$/","",$closer_campaigns);
|
||||
$groups = explode(" ", $closer_campaigns);
|
||||
}
|
||||
|
||||
$stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
$groups_list='';
|
||||
$groups_value='';
|
||||
|
||||
$o=0;
|
||||
while ($groups_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$group_id_value = $rowx[0];
|
||||
$group_name_value = $rowx[1];
|
||||
$groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\"";
|
||||
$p=0;
|
||||
while ($p<50)
|
||||
{
|
||||
if ($group_id_value == $groups[$p])
|
||||
{
|
||||
$groups_list .= " CHECKED";
|
||||
$groups_value .= " $group_id_value";
|
||||
}
|
||||
$p++;
|
||||
}
|
||||
$groups_list .= "> $group_id_value - $group_name_value<BR>\n";
|
||||
$o++;
|
||||
}
|
||||
if (strlen($groups_value)>2) {$groups_value .= " -";}
|
||||
}
|
||||
|
||||
?>
|
||||
</title>
|
||||
</head>
|
||||
<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
<CENTER>
|
||||
<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> VICIDIAL, AGENTES REMOTOS: <? echo "$PHP_AUTH_USER " ?> <a href="<? echo $PHP_SELF ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Logout</a></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?> </TD></TR>
|
||||
<TR BGCOLOR=#F0F5FE><TD ALIGN=LEFT COLSPAN=2><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1> <a href="./vdremote.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>MODIFICA</a> | <a href="./vdremote.php?ADD=61111&user=<? echo "$PHP_AUTH_USER" ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>ESITO</a> | <a href="./vdremote.php?ADD=71111&user=<? echo "$PHP_AUTH_USER" ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>STATISTICHE INBOUND</a></TD></TR>
|
||||
|
||||
|
||||
<TR><TD ALIGN=LEFT COLSPAN=2>
|
||||
<?
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=31111 modify remote agents info in the system
|
||||
######################
|
||||
|
||||
if ($ADD==31111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$remote_agent_id = $row[0];
|
||||
$user_start = $row[1];
|
||||
$number_of_lines = $row[2];
|
||||
$server_ip = $row[3];
|
||||
$conf_exten = $row[4];
|
||||
$status = $row[5];
|
||||
$campaign_id = $row[6];
|
||||
|
||||
echo "<br>MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $row[0]<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=41111>\n";
|
||||
echo "<input type=hidden name=remote_agent_id value=\"$row[0]\">\n";
|
||||
echo "<center><TABLE width=600 cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Inizio ID Utente: </td><td align=left>$user_start</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Numero di Linee: </td><td align=left><input type=text name=number_of_lines size=3 maxlength=3 value=\"$number_of_lines\"> (solo cifre)</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>IP Server: </td><td align=left>$row[3]</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Numero Di Interno Remoto: </td><td align=left><input type=text name=conf_exten size=20 maxlength=20 value=\"$conf_exten\"> (number dialed to reach agents [i.e. 913125551212])</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Esito: </td><td align=left><select size=1 name=status><option SELECTED>ATTIVO</option><option>INACTIVE</option><option SELECTED>$status</option></select></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Campagna: </td><td align=left>$campaign_id</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Gruppi Inbound: </td><td align=left>\n";
|
||||
echo "$groups_list";
|
||||
echo "</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit value=submit></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
echo "NOTA: Potrebbero passare fino a 30 secondi prima che le modifiche qui effettuate possano essere accettate\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=41111 modify remote agents info in the system
|
||||
######################
|
||||
|
||||
if ($ADD==41111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) )
|
||||
{echo "<br>AGENTES ALEJADOS NO MODIFICADOS - Per favore torna indietro e ricontrolla i dati inseriti\n";}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_remote_agents set number_of_lines='" . mysql_real_escape_string($number_of_lines) . "', conf_exten='" . mysql_real_escape_string($conf_exten) . "', status='" . mysql_real_escape_string($status) . "', closer_campaigns='" . mysql_real_escape_string($groups_value) . "' where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
# echo "$stmt\n";
|
||||
echo "<br>LOS AGENTES ALEJADOS SE MODIFICARON\n";
|
||||
|
||||
### LOG CHANGES TO LOG FILE ###
|
||||
$fp = fopen ("./admin_changes_log.txt", "a");
|
||||
fwrite ($fp, "$date|MODIFY OPERATORI REMOTI ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n");
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
|
||||
$stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$remote_agent_id = $row[0];
|
||||
$user_start = $row[1];
|
||||
$number_of_lines = $row[2];
|
||||
$server_ip = $row[3];
|
||||
$conf_exten = $row[4];
|
||||
$status = $row[5];
|
||||
$campaign_id = $row[6];
|
||||
|
||||
echo "<br>MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $row[0]<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=41111>\n";
|
||||
echo "<input type=hidden name=remote_agent_id value=\"$row[0]\">\n";
|
||||
echo "<center><TABLE width=600 cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Inizio ID Utente: </td><td align=left>$user_start</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Numero di Linee: </td><td align=left><input type=text name=number_of_lines size=3 maxlength=3 value=\"$number_of_lines\"> (solo cifre)</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>IP Server: </td><td align=left>$row[3]</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Numero Di Interno Remoto: </td><td align=left><input type=text name=conf_exten size=20 maxlength=20 value=\"$conf_exten\"> (number dialed to reach agents [i.e. 913125551212])</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Esito: </td><td align=left><select size=1 name=status><option SELECTED>ATTIVO</option><option>INACTIVE</option><option SELECTED>$status</option></select></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Campagna: </td><td align=left>$campaign_id</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Gruppi Inbound: </td><td align=left>\n";
|
||||
echo "$groups_list";
|
||||
echo "</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit value=submit></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
echo "NOTA: Potrebbero passare fino a 30 secondi prima che le modifiche qui effettuate possano essere accettate\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=61111 status of remote agent in the system and active calls and queue
|
||||
######################
|
||||
|
||||
if ($ADD==61111)
|
||||
{
|
||||
echo "<FONT FACE=\"Courier\" COLOR=BLACK SIZE=2><PRE>";
|
||||
|
||||
if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
|
||||
{echo "<br>ERROR AGENTES REMOTOS – Por favor, vuelva atrás y compruebe los datos que introdujo\n";}
|
||||
else
|
||||
{
|
||||
|
||||
$users_list = '';
|
||||
$k=0;
|
||||
while($k < $number_of_lines)
|
||||
{
|
||||
$nextuser=($user + $k);
|
||||
$users_list .= "'" . mysql_real_escape_string($nextuser) . "',";
|
||||
$k++;
|
||||
}
|
||||
$users_list = preg_replace("/.$/","",$users_list);
|
||||
|
||||
echo "VICIDIAL: Remote Agent Time On Calls $NOW_TIME\n\n";
|
||||
echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n";
|
||||
echo "| STATION | USER | LEADID | CHANNEL | STATUS | START TIME | MINUTES |\n";
|
||||
echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n";
|
||||
|
||||
|
||||
$stmt="select extension,user,lead_id,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' and user IN($users_list) order by extension;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$talking_to_print = mysql_num_rows($rslt);
|
||||
if ($talking_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
while ($i < $talking_to_print)
|
||||
{
|
||||
$leadlink=0;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("READY|PAUSED",$row[4]))
|
||||
{
|
||||
$row[3]='';
|
||||
$row[5]='- IN ATTESA -';
|
||||
$row[6]=$row[7];
|
||||
}
|
||||
$extension = sprintf("%-10s", $row[0]);
|
||||
$user = sprintf("%-6s", $row[1]);
|
||||
$leadid = sprintf("%-12s", $row[2]);
|
||||
if ($row[2] > 0)
|
||||
{
|
||||
$leadidLINK=$row[2];
|
||||
$leadlink++;
|
||||
if ( eregi("QUEUE",$row[4]) ) {$row[6]=$STARTtime;}
|
||||
$leadid = "<a href=\"./remote_dispo.php?lead_id=$row[2]&call_began=$row[6]\" target=\"_blank\">$leadid</a>";
|
||||
}
|
||||
$channel = sprintf("%-10s", $row[3]);
|
||||
$cc=0;
|
||||
while ( (strlen($channel) > 10) and ($cc < 100) )
|
||||
{
|
||||
$channel = eregi_replace(".$","",$channel);
|
||||
$cc++;
|
||||
if (strlen($channel) <= 10) {$cc=101;}
|
||||
}
|
||||
$status = sprintf("%-6s", $row[4]);
|
||||
$start_time = sprintf("%-19s", $row[5]);
|
||||
$call_time_S = ($STARTtime - $row[6]);
|
||||
|
||||
$call_time_M = ($call_time_S / 60);
|
||||
$call_time_M = round($call_time_M, 2);
|
||||
$call_time_M_int = intval("$call_time_M");
|
||||
$call_time_SEC = ($call_time_M - $call_time_M_int);
|
||||
$call_time_SEC = ($call_time_SEC * 60);
|
||||
$call_time_SEC = round($call_time_SEC, 0);
|
||||
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
|
||||
$call_time_MS = "$call_time_M_int:$call_time_SEC";
|
||||
$call_time_MS = sprintf("%7s", $call_time_MS);
|
||||
$G = ''; $EG = '';
|
||||
if ($call_time_M_int >= 5) {$G='<SPAN class="yellow"><B>'; $EG='</B></SPAN>';}
|
||||
if ($call_time_M_int >= 10) {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';}
|
||||
|
||||
echo "| $G$extension$EG | $G$user$EG | $G$leadid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n";
|
||||
echo " $i Operatori collegati al server $server_ip\n\n";
|
||||
|
||||
echo " <SPAN class=\"yellow\"><B> </SPAN> - 5 o piu` minuti in conversazione</B>\n";
|
||||
echo " <SPAN class=\"orange\"><B> </SPAN> - Oltre 10 minuti in conversazione</B>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "**************************************************************************************\n";
|
||||
echo "********************************* NESSUN OPERATORE IN CONVERSAZIONE *********************************\n";
|
||||
echo "**************************************************************************************\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</PRE>\n\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=71111 stats for remote agents from closer logs(vicidial_closer_log)
|
||||
######################
|
||||
|
||||
if ($ADD==71111)
|
||||
{
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=ADD VALUE=\"71111\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=user VALUE=\"$user\">\n";
|
||||
echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "</FORM>\n\n";
|
||||
echo "<FONT FACE=\"Courier\" COLOR=BLACK SIZE=2><PRE>";
|
||||
|
||||
if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
|
||||
{echo "<br>ERROR AGENTES REMOTOS – Por favor, vuelva atrás y compruebe los datos que introdujo\n";}
|
||||
else
|
||||
{
|
||||
|
||||
$users_list = '';
|
||||
$k=0;
|
||||
while($k < $number_of_lines)
|
||||
{
|
||||
$nextuser=($user + $k);
|
||||
$users_list .= "'$nextuser',";
|
||||
$k++;
|
||||
}
|
||||
$users_list = preg_replace("/.$/","",$users_list);
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$in_calls = $row[0];
|
||||
$in_time = $row[1];
|
||||
$in_time_M = ($in_time / 60);
|
||||
$in_time_M = round($in_time_M, 2);
|
||||
$in_time_M_int = intval("$in_time_M");
|
||||
$in_time_SEC = ($in_time_M - $in_time_M_int);
|
||||
$in_time_SEC = ($in_time_SEC * 60);
|
||||
$in_time_SEC = round($in_time_SEC, 0);
|
||||
if ($in_time_SEC < 10) {$in_time_SEC = "0$in_time_SEC";}
|
||||
$in_time_MS = "$in_time_M_int:$in_time_SEC";
|
||||
$in_time_MS = sprintf("%7s", $in_time_MS);
|
||||
|
||||
echo "VICIDIAL: Stats de entrada del agente alejado $NOW_TIME\n\n";
|
||||
echo "\n";
|
||||
echo "Llamadas totales tomadas $query_date: $in_calls\n";
|
||||
echo "Tiempo total de conversacion$query_date: $in_time_MS (minutes:seconds)\n";
|
||||
echo "\n";
|
||||
echo "\n";
|
||||
echo "Lista la llamada para $query_date:\n";
|
||||
echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n";
|
||||
echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n";
|
||||
echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n";
|
||||
|
||||
|
||||
$stmt="select user,lead_id,campaign_id,phone_number,status,call_date,length_in_sec from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list) order by call_date;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$talking_to_print = mysql_num_rows($rslt);
|
||||
if ($talking_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
while ($i < $talking_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$user = sprintf("%-8s", $row[0]);
|
||||
$leadid = sprintf("%-10s", $row[1]);
|
||||
$group = sprintf("%-14s", $row[2]);
|
||||
$phone = sprintf("%-10s", $row[3]);
|
||||
$status = sprintf("%-6s", $row[4]);
|
||||
$start_time = sprintf("%-19s", $row[5]);
|
||||
$call_time_S = $row[6];
|
||||
|
||||
$call_time_M = ($call_time_S / 60);
|
||||
$call_time_M = round($call_time_M, 2);
|
||||
$call_time_M_int = intval("$call_time_M");
|
||||
$call_time_SEC = ($call_time_M - $call_time_M_int);
|
||||
$call_time_SEC = ($call_time_SEC * 60);
|
||||
$call_time_SEC = round($call_time_SEC, 0);
|
||||
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
|
||||
$call_time_MS = "$call_time_M_int:$call_time_SEC";
|
||||
$call_time_MS = sprintf("%7s", $call_time_MS);
|
||||
$G = ''; $EG = '';
|
||||
# if ($call_time_M_int >= 5) {$G='<SPAN class="yellow"><B>'; $EG='</B></SPAN>';}
|
||||
# if ($call_time_M_int >= 10) {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';}
|
||||
|
||||
echo "| $G$user$EG | $G$leadid$EG | $G$group$EG | $G$phone$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n";
|
||||
# echo " $i Operatori collegati al server $server_ip\n\n";
|
||||
|
||||
# echo " <SPAN class=\"yellow\"><B> </SPAN> - 5 o piu` minuti in conversazione</B>\n";
|
||||
# echo " <SPAN class=\"orange\"><B> </SPAN> - Oltre 10 minuti in conversazione</B>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "**************************************************************************************\n";
|
||||
echo "*********************************NESSUNA CHIAMATA IN QUESTO GIORNO*******************************\n";
|
||||
echo "**************************************************************************************\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</PRE>\n\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
|
||||
echo "\n\n\n<br><br><br>\n\n";
|
||||
|
||||
|
||||
echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds</font>";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</TD></TR><TABLE>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user