updated LANG_www code and other small fixes relating to that
git-svn-id: svn://192.168.202.10@585 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -27,7 +27,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
$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;";
|
||||
$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);
|
||||
@@ -86,7 +86,7 @@ echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./server_stats.php\">REPORTS</a> </FONT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
@@ -29,7 +29,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
$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;";
|
||||
$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);
|
||||
@@ -88,7 +88,7 @@ echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT type=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | <a href=\"./server_stats.php\">REPORTS</a> </FONT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
@@ -202,6 +202,82 @@ echo "Total NA calls -Busy,Disconnect,RingNoAnswer: $NAcalls $NApercent%\n";
|
||||
echo "Average Call Length for NA Calls in seconds: $average_na_seconds\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL STATUS STATS
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL STATUS STATS\n";
|
||||
echo "+--------+----------------------+------------+\n";
|
||||
echo "| STATUS | DESCRIPTION | CALLS |\n";
|
||||
echo "+--------+----------------------+------------+\n";
|
||||
|
||||
$stmt="SELECT * from vicidial_statuses 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);
|
||||
$statname_list["$rowx[0]"] = "$rowx[1]";
|
||||
$o++;
|
||||
}
|
||||
|
||||
$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='" . mysql_real_escape_string($group) . "' order by status";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$Cstatuses_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$o=0;
|
||||
while ($Cstatuses_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$statname_list["$rowx[0]"] = "$rowx[1]";
|
||||
$o++;
|
||||
}
|
||||
|
||||
$stmt="select count(*),status from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' 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);
|
||||
|
||||
$TOTALcalls = ($TOTALcalls + $row[0]);
|
||||
|
||||
$STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
|
||||
$RAWstatus = $row[1];
|
||||
$status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 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);}
|
||||
}
|
||||
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');}
|
||||
}
|
||||
|
||||
|
||||
echo "| $status | $status_name | $STATUScount |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
|
||||
echo "+--------+----------------------+------------+\n";
|
||||
echo "| TOTAL: | $TOTALcalls |\n";
|
||||
echo "+-------------------------------+------------+\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### USER STATS
|
||||
|
||||
@@ -217,6 +293,7 @@ echo "| AGENT | CALLS | TIME M | AVRG 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 00:00:01' and call_date <= '$query_date 23:59:59' 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 > 4 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);
|
||||
@@ -228,8 +305,15 @@ while ($i < $users_to_print)
|
||||
$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);}
|
||||
$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];
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -24,7 +25,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
$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;";
|
||||
$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);
|
||||
@@ -122,11 +123,11 @@ echo "Total leads in hopper right now: $TOTALcalls\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- LEADS IN HOPPER\n";
|
||||
echo "+------+-----------+------------+-------+--------+-------+--------+\n";
|
||||
echo "| | LEAD_ID | PHONE NUM | STATE | STATUS | COUNT | GMT |\n";
|
||||
echo "+------+-----------+------------+-------+--------+-------+--------+\n";
|
||||
echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n";
|
||||
echo "| | LEAD_ID | 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 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 hopper_id limit 2000;";
|
||||
$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 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 hopper_id limit 2000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
@@ -143,14 +144,15 @@ while ($i < $users_to_print)
|
||||
$count = sprintf("%-5s", $row[4]);
|
||||
$gmt = sprintf("%-6s", $row[5]);
|
||||
$hopper_id = sprintf("%-6s", $row[6]);
|
||||
$alt_dial = sprintf("%-5s", $row[7]);
|
||||
|
||||
if ($DB) {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";}
|
||||
else {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt |\n";}
|
||||
else {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+------+-----------+------------+-------+--------+-------+--------+\n";
|
||||
echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ $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;";
|
||||
$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);
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
<?
|
||||
### AST_agent_disposition.php
|
||||
### Date Range - Agent/Campaign Disposition (Perfect Network Corporation)
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
# CHANGES
|
||||
#
|
||||
# 70201-1213 - First build - from Marin Blu
|
||||
#
|
||||
#
|
||||
|
||||
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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
$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;";
|
||||
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 "Invalid Username/Password: |$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($begin_date)) {$begin_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_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 Disposition</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Date - From: <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 "<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 "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | <a href=\"./server_stats.php\">REPORTS</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n";
|
||||
echo "PLEASE SELECT A SERVER AND DATE ABOVE AND CLICK SUBMIT\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
echo "VICIDIAL: Agent Disposition $NOW_TIME\n";
|
||||
|
||||
echo "Time range: $begin_date to $end_date \n\n";
|
||||
echo "---------- Disposition Details -------------\n\n";
|
||||
|
||||
echo "+-----------------+------------+--------+--------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+\n";
|
||||
echo "| USER NAME | ID | CALLS | TALK | TALKAVG| A | B |CALLBK|CBHOLD| DEC | DC | DNC | DROP |INCALL| LB | N | NA | NI | NP | NQ |QUEUE | SALE | XFER |\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 >= '$begin_date 00:00:01' and call_date <= '$end_date 23:59:59' 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]);
|
||||
$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("%-10s", $row[3]); while(strlen($user[$i])>10) {$user[$i] = substr("$user[$i]", 0, -1);}
|
||||
$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 "; $ctINCALL[$k]="0 "; $ctDROP[$k]="0 "; $ctQUEUE[$k]="0 "; $ctNP[$k]="0 "; $ctDEC[$k]="0 "; $ctNQ[$k]="0 "; $ctNA[$k]="0 "; $ctXFER[$k]="0 "; $ctLB[$k]="0 "; $ctCALLBK[$k]="0 "; $ctCBHOLD[$k]="0 ";
|
||||
$stmt="select count(*),status from vicidial_log where call_date >= '$begin_date 00:00:01' and call_date <= '$end_date 23:59:59' 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') {$ctSALE[$k]=sprintf("%-4s", $row[0]); $TOT_SALE = ($TOT_SALE + $row[0]);}
|
||||
if ($row[1] == 'INCALL') {$ctINCALL[$k]=sprintf("%-4s", $row[0]); $TOT_INCALL = ($TOT_INCALL + $row[0]);}
|
||||
if ($row[1] == 'DROP') {$ctDROP[$k]=sprintf("%-4s", $row[0]); $TOT_DROP = ($TOT_DROP + $row[0]);}
|
||||
if ($row[1] == 'QUEUE') {$ctQUEUE[$k]=sprintf("%-4s", $row[0]); $TOT_QUEUE = ($TOT_QUEUE + $row[0]);}
|
||||
if ($row[1] == 'NP') {$ctNP[$k]=sprintf("%-4s", $row[0]); $TOT_NP = ($TOT_NP + $row[0]);}
|
||||
if ($row[1] == 'DEC') {$ctDEC[$k]=sprintf("%-4s", $row[0]); $TOT_DEC = ($TOT_DEC + $row[0]);}
|
||||
if ($row[1] == 'NQ') {$ctNQ[$k]=sprintf("%-4s", $row[0]); $TOT_NQ = ($TOT_NQ + $row[0]);}
|
||||
if ($row[1] == 'NA') {$ctNA[$k]=sprintf("%-4s", $row[0]); $TOT_NA = ($TOT_NA + $row[0]);}
|
||||
if ($row[1] == 'XFER') {$ctXFER[$k]=sprintf("%-4s", $row[0]); $TOT_XFER = ($TOT_XFER + $row[0]);}
|
||||
if ($row[1] == 'LB') {$ctLB[$k]=sprintf("%-4s", $row[0]); $TOT_LB = ($TOT_LB + $row[0]);}
|
||||
if ($row[1] == 'CALLBK') {$ctCALLBK[$k]=sprintf("%-4s", $row[0]); $TOT_CALLBK = ($TOT_CALLBK + $row[0]);}
|
||||
if ($row[1] == 'CBHOLD') {$ctCBHOLD[$k]=sprintf("%-4s", $row[0]); $TOT_CBHOLD = ($TOT_CBHOLD + $row[0]);}
|
||||
$m++;
|
||||
}
|
||||
echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctCALLBK[$k] | $ctCBHOLD[$k] | $ctDEC[$k] | $ctDC[$k] | $ctDNC[$k] | $ctDROP[$k] | $ctINCALL[$k] | $ctLB[$k] | $ctN[$k] | $ctNA[$k] | $ctNI[$k] | $ctNP[$k] | $ctNQ[$k] | $ctQUEUE[$k] | $ctSALE[$k] | $ctXFER[$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);
|
||||
$TOT_INCALL = sprintf("%-5s", $TOT_INCALL);
|
||||
$TOT_DROP = sprintf("%-5s", $TOT_DROP);
|
||||
$TOT_QUEUE = sprintf("%-5s", $TOT_QUEUE);
|
||||
$TOT_NP = sprintf("%-5s", $TOT_NP);
|
||||
$TOT_DEC = sprintf("%-5s", $TOT_DEC);
|
||||
$TOT_NQ = sprintf("%-5s", $TOT_NQ);
|
||||
$TOT_NA = sprintf("%-5s", $TOT_NA);
|
||||
$TOT_XFER = sprintf("%-5s", $TOT_XFER);
|
||||
$TOT_LB= sprintf("%-5s", $TOT_LB);
|
||||
$TOT_CALLBK = sprintf("%-5s", $TOT_CALLBK);
|
||||
$TOT_CBHOLD = sprintf("%-5s", $TOT_CBHOLD);
|
||||
|
||||
echo "+-----------------+------------+--------+--------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+\n";
|
||||
echo "| TOTALS | $TOTcalls| $TOTtotTALK_MS| | $TOT_A| $TOT_B| $TOT_CALLBK| $TOT_CBHOLD| $TOT_DEC| $TOT_DC| $TOT_DNC| $TOT_DROP| $TOT_INCALL| $TOT_LB| $TOT_N| $TOT_NA| $TOT_NI| $TOT_NP| $TOT_NQ| $TOT_QUEUE| $TOT_SALE| $TOT_XFER|\n";
|
||||
echo "+-----------------+------------+--------+--------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+\n";
|
||||
echo "\n";
|
||||
|
||||
}
|
||||
?>
|
||||
</BODY></HTML>
|
||||
@@ -7,6 +7,7 @@
|
||||
#
|
||||
# 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");
|
||||
@@ -28,8 +29,9 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
$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;";
|
||||
$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];
|
||||
@@ -49,6 +51,7 @@ 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);
|
||||
@@ -91,7 +94,7 @@ echo "<option selected value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | <a href=\"./server_stats.php\">REPORTS</a> </FONT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n";
|
||||
@@ -126,11 +129,12 @@ echo "VICIDIAL: Agent Performance $NOW_TIME\n";
|
||||
echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- AGENTS Details -------------\n\n";
|
||||
|
||||
echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
|
||||
echo "| USER NAME | ID | CALLS | TALK | TALKAVG| A | B | DC | DNC | N | NI | SALE |\n";
|
||||
echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\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);
|
||||
@@ -141,8 +145,25 @@ while ($i < $rows_to_print)
|
||||
$TOTcalls=($TOTcalls + $row[0]);
|
||||
$TOTtotTALK=($TOTtotTALK + $row[1]);
|
||||
$calls[$i] = sprintf("%-6s", $row[0]);
|
||||
$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]);
|
||||
|
||||
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];
|
||||
|
||||
@@ -173,6 +194,10 @@ 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);
|
||||
@@ -217,9 +242,9 @@ while($k < $i)
|
||||
$TOT_NI = sprintf("%-5s", $TOT_NI);
|
||||
$TOT_SALE = sprintf("%-5s", $TOT_SALE);
|
||||
|
||||
echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
|
||||
echo "| TOTALS | $TOTcalls| $TOTtotTALK_MS| | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
|
||||
echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
|
||||
echo "| TOTALS | $TOTcalls| $TOTtotTALK_MS| | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#
|
||||
# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 70118-1705 - Added user_group filtering option
|
||||
# 70201-1207 - Added non_latin UTF8 output code, widened USER ID to 8 chars
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -15,21 +17,26 @@ $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"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_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["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
$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;";
|
||||
$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];
|
||||
@@ -49,6 +56,7 @@ 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);
|
||||
@@ -59,6 +67,18 @@ while ($i < $campaigns_to_print)
|
||||
$groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
$stmt="select user_group from vicidial_user_groups;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$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>
|
||||
@@ -86,12 +106,25 @@ echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<SELECT SIZE=1 NAME=user_group>\n";
|
||||
echo "<option value=\"\">-- ALL USER GROUPS --</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=\"AM\">AM</option>\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=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | <a href=\"./server_stats.php\">REPORTS</a> </FONT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n";
|
||||
@@ -101,7 +134,7 @@ if (!$group)
|
||||
{
|
||||
echo "\n";
|
||||
echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
|
||||
echo " NOTE: stats taken from 6 hour shift specified\n";
|
||||
echo " NOTE: stats taken from shift specified\n";
|
||||
}
|
||||
|
||||
else
|
||||
@@ -120,17 +153,28 @@ if ($shift == 'PM')
|
||||
$time_BEGIN = "15:15:00";
|
||||
$time_END = "23:15:00";
|
||||
}
|
||||
if ($shift == 'ALL')
|
||||
{
|
||||
$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";
|
||||
}
|
||||
|
||||
if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
|
||||
else {$ugSQL='';}
|
||||
|
||||
echo "VICIDIAL: Agent Performance Detail $NOW_TIME\n";
|
||||
|
||||
echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- AGENTS Details -------------\n\n";
|
||||
|
||||
echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
|
||||
echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG| A | B | DC | DNC | N | NI | CB | SALE |\n";
|
||||
echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
|
||||
echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG| A | B | DC | DNC | N | NI | CB | SALE |\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
|
||||
|
||||
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) 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<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
|
||||
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) 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<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL 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);
|
||||
@@ -145,8 +189,25 @@ while ($i < $rows_to_print)
|
||||
$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
|
||||
$TOTtotDISPO=($TOTtotDISPO + $row[9]);
|
||||
$calls[$i] = sprintf("%-6s", $row[0]);
|
||||
$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]);
|
||||
|
||||
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]);
|
||||
$USERtime = ($row[1] + $row[5] + $row[7] + $row[9]);
|
||||
$USERtotTALK = $row[1];
|
||||
$USERavgTALK = $row[4];
|
||||
@@ -255,6 +316,7 @@ while($k < $i)
|
||||
{
|
||||
$ctA[$k]="0 "; $ctB[$k]="0 "; $ctDC[$k]="0 "; $ctDNC[$k]="0 "; $ctN[$k]="0 "; $ctNI[$k]="0 "; $ctSALE[$k]="0 "; $ctCB[$k]="0 ";
|
||||
$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$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);
|
||||
@@ -390,10 +452,11 @@ while($k < $i)
|
||||
$TOT_NI = sprintf("%-5s", $TOT_NI);
|
||||
$TOT_CB = sprintf("%-5s", $TOT_CB);
|
||||
$TOT_SALE = sprintf("%-5s", $TOT_SALE);
|
||||
$TOT_AGENTS = sprintf("%-4s", $k);
|
||||
|
||||
echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
|
||||
echo "| TOTALS | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
|
||||
echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
|
||||
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
$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;";
|
||||
$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);
|
||||
@@ -63,7 +63,11 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
<?
|
||||
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<BR>\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\">Modify User</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";
|
||||
|
||||
@@ -0,0 +1,286 @@
|
||||
<?
|
||||
### AST_agent_time_sheet_archive.php
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
# CHANGES
|
||||
#
|
||||
# 60619-1721 - 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["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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
$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 "Invalid Username/Password: |$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\">Modify User</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=SUBMIT VALUE=SUBMIT>\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 SUBMIT\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 "Time range: $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_archive 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 "TOTAL CALLS 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_archive 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_archive 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";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,400 @@
|
||||
<?
|
||||
# AST_inboundEXTstats.php
|
||||
#
|
||||
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60620-1322 - 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["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
$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 "Invalid Username/Password: |$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;}
|
||||
if (!isset($server_ip)) {$server_ip = '10.10.11.20';}
|
||||
|
||||
$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$inbound_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $inbound_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$inbound[$i] =$row[0];
|
||||
$fullnum[$i] =$row[1];
|
||||
$inbname[$i] =$row[2];
|
||||
$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=iso-8859-1\">\n";
|
||||
#echo"<META HTTP-EQUIV=Refresh CONTENT=\"7; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB\">\n";
|
||||
echo "<TITLE>ASTERISK: Inbound Calls Stats</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 ($inbound_to_print > $o)
|
||||
{
|
||||
if ($inbound[$o] == $group) {echo "<option selected value=\"$inbound[$o]\">$fullnum[$o] - $inbname[$o]</option>\n";}
|
||||
else {echo "<option value=\"$inbound[$o]\">$fullnum[$o] - $inbname[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo "PLEASE SELECT A NUMBER AND DATE ABOVE AND CLICK SUBMIT\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
echo "ASTERISK: Inbound Calls Stats $NOW_TIME\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- TOTALS\n";
|
||||
|
||||
$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
|
||||
if (eregi("\*",$group))
|
||||
{$extenSQL = "and extension LIKE \"%$group\"";}
|
||||
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $row[0]);
|
||||
$average_hold_seconds = ($row[1] / $row[0]);
|
||||
$average_hold_seconds = round($average_hold_seconds, 0);
|
||||
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
|
||||
|
||||
echo "Total Calls That came into this number: $TOTALcalls\n";
|
||||
echo "Average Call Length(seconds) for all Calls: $average_hold_seconds\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- DROPS\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 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]);
|
||||
$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
|
||||
$DROPpercent = round($DROPpercent, 0);
|
||||
|
||||
if ($row[0])
|
||||
{
|
||||
$average_hold_seconds = ($row[1] / $row[0]);
|
||||
$average_hold_seconds = round($average_hold_seconds, 0);
|
||||
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
|
||||
}
|
||||
else {$DROPpercent=0; $average_hold_seconds=0;}
|
||||
echo "Total DROP Calls: (less than 10 seconds) $DROPcalls $DROPpercent%\n";
|
||||
echo "Average Call Length(seconds) for DROP Calls: $average_hold_seconds\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### CALLS STATS
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL LISTINGS\n";
|
||||
echo "+----------------------+----------------------+--------+---------------------+\n";
|
||||
echo "| CALLERID | CALLERIDNAME | LENGTH | DATE TIME |\n";
|
||||
echo "+----------------------+----------------------+--------+---------------------+\n";
|
||||
|
||||
$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$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);
|
||||
|
||||
$CID = sprintf("%-20s", $row[0]);
|
||||
$CIDname = sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
|
||||
$datetime = sprintf("%-19s", $row[3]);
|
||||
$USERavgTALK = $row[2];
|
||||
|
||||
$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";
|
||||
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
|
||||
|
||||
echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+----------------------+----------------------+--------+---------------------+\n";
|
||||
|
||||
##############################
|
||||
######### TIME STATS
|
||||
|
||||
if ($output == 'FULL')
|
||||
{
|
||||
|
||||
echo "\n";
|
||||
echo "---------- TIME STATS\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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
$hour_multiplier = (100 / $hi_hour_count);
|
||||
#$hour_multiplier = round($hour_multiplier, 0);
|
||||
|
||||
echo "<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
|
||||
echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS\n";
|
||||
|
||||
$k=1;
|
||||
$Mk=0;
|
||||
$call_scale = '0';
|
||||
while ($k <= 102)
|
||||
{
|
||||
if ($Mk >= 5)
|
||||
{
|
||||
$Mk=0;
|
||||
$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";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,178 @@
|
||||
<?
|
||||
# AST_inboundEXTstats_department.php
|
||||
#
|
||||
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 70201-1710 - First Build
|
||||
#
|
||||
|
||||
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_query_date"])) {$end_query_date=$_GET["end_query_date"];}
|
||||
elseif (isset($_POST["end_query_date"])) {$end_query_date=$_POST["end_query_date"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
$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 "Invalid Username/Password: |$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;}
|
||||
if (!isset($end_query_date)) {$end_query_date = $NOW_DATE;}
|
||||
if (!isset($server_ip)) {$server_ip = '10.10.11.20';}
|
||||
|
||||
$stmt="select distinct department from inbound_numbers;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$dept_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $dept_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$dept[$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=iso-8859-1\">\n";
|
||||
#echo"<META HTTP-EQUIV=Refresh CONTENT=\"7; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB\">\n";
|
||||
echo "<TITLE>ASTERISK: Inbound Calls Stats - By Department</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 "<INPUT TYPE=TEXT NAME=end_query_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_query_date\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($dept_to_print > $o)
|
||||
{
|
||||
if ($dept[$o] == $group) {echo "<option selected value=\"$dept[$o]\">$dept[$o]</option>\n";}
|
||||
else {echo "<option value=\"$dept[$o]\">$dept[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo "PLEASE SELECT A DEPARTMENT AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$extSQL='';
|
||||
$stmt="select extension from inbound_numbers where department='$group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$inbound_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $inbound_to_print)
|
||||
{
|
||||
if (strlen($extSQL)> 1) {$extSQL .= ",";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$extensions[$i] =$row[0];
|
||||
$extSQL .= "'$extensions[$i]'";
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "ASTERISK: Inbound Calls Stats For $group from $query_date to $end_query_date\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- TOTALS\n";
|
||||
echo "\n";
|
||||
|
||||
echo "+----------------------+------------+------------+\n";
|
||||
echo "| NUMBER | CALLS | AVG TIME |\n";
|
||||
echo "+----------------------+------------+------------+\n";
|
||||
|
||||
$k=0;
|
||||
while ($k < $inbound_to_print)
|
||||
{
|
||||
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($end_query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' and extension='$extensions[$k]' ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$extensions[$k] = sprintf("%20s", $extensions[$k]);
|
||||
$TOTALcalls = sprintf("%10s", $row[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);
|
||||
}
|
||||
|
||||
$calls = ($TOTALcalls + $calls);
|
||||
$seconds = ($row[1] + $seconds);
|
||||
|
||||
echo "| $extensions[$k] | $TOTALcalls | $average_hold_seconds |\n";
|
||||
$k++;
|
||||
}
|
||||
|
||||
$calls = sprintf("%10s", $calls);
|
||||
$seconds = ($seconds / $calls);
|
||||
$seconds = round($seconds, 0);
|
||||
$seconds = sprintf("%5s", $seconds);
|
||||
echo "+----------------------+------------+------------+\n";
|
||||
echo "| TOTALS | $calls | AVG: $seconds |\n";
|
||||
echo "+----------------------+------------+------------+\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -28,7 +28,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
$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;";
|
||||
$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);
|
||||
@@ -96,7 +96,7 @@ echo "<option selected value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./server_stats.php\">REPORTS</a> </FONT>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n";
|
||||
|
||||
@@ -33,7 +33,7 @@ if (isset($_GET["closer_display"])) {$closer_display=$_GET["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;";
|
||||
$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);
|
||||
@@ -133,7 +133,7 @@ echo "SERVER: $server_ip\n";
|
||||
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=\"./server_stats.php\">REPORTS</a>\n\n";
|
||||
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\">REPORTS</a>\n\n";
|
||||
|
||||
if ($closer_display>0)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# STOP=4000, SLOW=40, GO=4 seconds refresh interval
|
||||
#
|
||||
# changes:
|
||||
# CHANGELOG:
|
||||
# 50406-0920 - Added Paused agents < 1 min (Chris Doyle)
|
||||
# 51130-1218 - Modified layout and info to show all servers in a vicidial system
|
||||
# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
@@ -21,7 +21,11 @@
|
||||
# 61002-1642 - Added TRUNK SHORT/FILL stats
|
||||
# 61101-1318 - Added SIP and IAX Listen and Barge links option
|
||||
# 61101-1647 - Added Usergroup column and user name option as well as sorting
|
||||
# 61102-1155 - made display of columns more modular, added ability to hide server info
|
||||
# 61102-1155 - Made display of columns more modular, added ability to hide server info
|
||||
# 61215-1131 - Added answered calls and drop percent taken from answered calls
|
||||
# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns
|
||||
# 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu
|
||||
# 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer)
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -113,8 +117,12 @@ $load_ave = get_server_load(true);
|
||||
$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;";
|
||||
$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];
|
||||
@@ -135,6 +143,10 @@ $epochSIXhoursAGO = ($STARTtime - 21600);
|
||||
$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO);
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns where active='Y';";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -148,6 +160,10 @@ while ($i < $groups_to_print)
|
||||
}
|
||||
|
||||
$stmt="select * from vicidial_user_groups;";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -242,18 +258,22 @@ echo "<a href=\"$PHP_SELF?group=$group&RR=40&DB=$DB&adastats=$adastats&SIPmonito
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay\">GO</a>";
|
||||
echo " <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | \n";
|
||||
echo "<a href=\"./AST_timeonVDADallSUMMARY.php?group=$group&RR=$RR&DB=$DB&adastats=$adastats\">SUMMARY</a> | \n";
|
||||
echo "<a href=\"./server_stats.php\">REPORTS</a> </FONT>\n";
|
||||
echo "<a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
echo "\n\n";
|
||||
|
||||
|
||||
if (!$group) {echo "<BR><BR>please select a campaign from the pulldown above</FORM>\n"; exit;}
|
||||
else
|
||||
{
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout) from vicidial_campaigns;";
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses) from vicidial_campaigns;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DIALlev = $row[0];
|
||||
@@ -274,12 +294,19 @@ $ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select count(*) from vicidial_hopper;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDhop = $row[0];
|
||||
@@ -289,6 +316,10 @@ if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today) from vicidial_campaign_stats;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DAleads = $row[0];
|
||||
@@ -311,6 +342,10 @@ if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$balanceSHORT = $row[0];
|
||||
@@ -351,7 +386,7 @@ echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>HOPPER LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED / ANSWERED:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatusA, $DIALstatusB, $DIALstatusC, $DIALstatusD, $DIALstatusE </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
@@ -401,9 +436,13 @@ echo "</FORM>\n\n";
|
||||
###################################################################################
|
||||
###### OUTBOUND CALLS
|
||||
###################################################################################
|
||||
if (eregi("CLOSER",$group))
|
||||
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group))
|
||||
{
|
||||
$stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = preg_replace("/^ | -$/","",$row[0]);
|
||||
@@ -419,6 +458,10 @@ else
|
||||
|
||||
$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$parked_to_print = mysql_num_rows($rslt);
|
||||
@@ -450,7 +493,7 @@ $parked_to_print = mysql_num_rows($rslt);
|
||||
if ($out_live > 9) {$F='<FONT class="r3">'; $FG='</FONT>';}
|
||||
if ($out_live > 14) {$F='<FONT class="r4">'; $FG='</FONT>';}
|
||||
|
||||
if (eregi("CLOSER",$group))
|
||||
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group))
|
||||
{echo "$NFB$out_total$NFE current active calls \n";}
|
||||
else
|
||||
{echo "$NFB$out_total$NFE calls being placed \n";}
|
||||
@@ -489,8 +532,8 @@ $HDsessionid = "------------------+";
|
||||
$HTsessionid = " SESSIONID |";
|
||||
$HDbarge = "-------+";
|
||||
$HTbarge = " BARGE |";
|
||||
$HDstatus = "--------+";
|
||||
$HTstatus = " STATUS |";
|
||||
$HDstatus = "----------+";
|
||||
$HTstatus = " STATUS |";
|
||||
$HDserver_ip = "-----------------+";
|
||||
$HTserver_ip = " SERVER IP |";
|
||||
$HDcall_server_ip = "-----------------+";
|
||||
@@ -553,10 +596,14 @@ else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";
|
||||
if (strlen($usergroup)<1) {$usergroupSQL = '';}
|
||||
else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";}
|
||||
|
||||
$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;";
|
||||
$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;";
|
||||
|
||||
#$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and campaign_id='" . mysql_real_escape_string($group) . "' order by $orderSQL;";
|
||||
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$talking_to_print = mysql_num_rows($rslt);
|
||||
@@ -567,13 +614,22 @@ $talking_to_print = mysql_num_rows($rslt);
|
||||
while ($i < $talking_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("READY|PAUSED",$row[4]))
|
||||
if (eregi("READY|PAUSED",$row[3]))
|
||||
{
|
||||
$row[5]=$row[6];
|
||||
}
|
||||
$extension = eregi_replace('Local/',"",$row[0]);
|
||||
$extension = sprintf("%-10s", $extension);
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$extension = eregi_replace('Local/',"",$row[0]);
|
||||
$extension = sprintf("%-10s", $extension);
|
||||
while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$extension = eregi_replace('Local/',"",$row[0]);
|
||||
$extension = sprintf("%-40s", $extension);
|
||||
while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');}
|
||||
}
|
||||
$Luser = $row[1];
|
||||
$user = sprintf("%-18s", $row[1]);
|
||||
$Lsessionid = $row[2];
|
||||
@@ -582,16 +638,48 @@ $talking_to_print = mysql_num_rows($rslt);
|
||||
$status = sprintf("%-6s", $row[3]);
|
||||
$server_ip = sprintf("%-15s", $row[4]);
|
||||
$call_server_ip = sprintf("%-15s", $row[7]);
|
||||
$campaign_id = sprintf("%-10s", $row[8]);
|
||||
$campaign_id = sprintf("%-10s", $row[8]);
|
||||
$comments= $row[11];
|
||||
|
||||
if (eregi("INCALL",$Lstatus))
|
||||
{
|
||||
if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) )
|
||||
{$CM='A';}
|
||||
else
|
||||
{
|
||||
if (eregi("INBOUND",$comments))
|
||||
{$CM='I';}
|
||||
else
|
||||
{$CM='M';}
|
||||
}
|
||||
}
|
||||
else {$CM=' ';}
|
||||
|
||||
if ($UGdisplay > 0)
|
||||
{
|
||||
$user_group = sprintf("%-12s", $row[9]);
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$user_group = sprintf("%-12s", $row[9]);
|
||||
while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$user_group = sprintf("%-40s", $row[9]);
|
||||
while(mb_strlen($user_group, 'utf-8')>12) {$user_group = mb_substr("$user_group", 0, -1,'utf8');}
|
||||
}
|
||||
}
|
||||
if ($UidORname > 0)
|
||||
{
|
||||
$user = sprintf("%-18s", $row[10]);
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$user = sprintf("%-18s", $row[10]);
|
||||
while(strlen($user)>18) {$user = substr("$user", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$user = sprintf("%-40s", $row[10]);
|
||||
while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');}
|
||||
}
|
||||
}
|
||||
if (!eregi("INCALL|QUEUE",$row[3]))
|
||||
{$call_time_S = ($STARTtime - $row[6]);}
|
||||
@@ -655,7 +743,7 @@ $talking_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$agentcount++;
|
||||
|
||||
$Aecho .= "| $G$extension$EG | <a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> |$UGD $G$sessionid$EG$L$R | $G$status$EG | $SVD$G$call_time_MS$EG | $G$campaign_id$EG |\n";
|
||||
$Aecho .= "| $G$extension$EG | <a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $SVD$G$call_time_MS$EG | $G$campaign_id$EG |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,943 @@
|
||||
<?
|
||||
# AST_timeonVDADall.php
|
||||
#
|
||||
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
#
|
||||
# live real-time stats for the VICIDIAL Auto-Dialer all servers
|
||||
#
|
||||
# STOP=4000, SLOW=40, GO=4 seconds refresh interval
|
||||
#
|
||||
# CHANGELOG:
|
||||
# 50406-0920 - Added Paused agents < 1 min (Chris Doyle)
|
||||
# 51130-1218 - Modified layout and info to show all servers in a vicidial system
|
||||
# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60511-1343 - Added leads and drop info at the top of the screen
|
||||
# 60608-1539 - Fixed CLOSER tallies for active calls
|
||||
# 60619-1658 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 60626-1453 - Added display of system load to bottom (Angelito Manansala)
|
||||
# 60901-1123 - Changed display elements at the top of the screen
|
||||
# 60905-1342 - Fixed non INCALL|QUEUE timer column
|
||||
# 61002-1642 - Added TRUNK SHORT/FILL stats
|
||||
# 61101-1318 - Added SIP and IAX Listen and Barge links option
|
||||
# 61101-1647 - Added Usergroup column and user name option as well as sorting
|
||||
# 61102-1155 - Made display of columns more modular, added ability to hide server info
|
||||
# 61215-1131 - Added answered calls and drop percent taken from answered calls
|
||||
# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns
|
||||
# 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu
|
||||
# 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer)
|
||||
#
|
||||
|
||||
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["RR"])) {$RR=$_GET["RR"];}
|
||||
elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["usergroup"])) {$usergroup=$_GET["usergroup"];}
|
||||
elseif (isset($_POST["usergroup"])) {$usergroup=$_POST["usergroup"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];}
|
||||
elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
if (isset($_GET["SIPmonitorLINK"])) {$SIPmonitorLINK=$_GET["SIPmonitorLINK"];}
|
||||
elseif (isset($_POST["SIPmonitorLINK"])) {$SIPmonitorLINK=$_POST["SIPmonitorLINK"];}
|
||||
if (isset($_GET["IAXmonitorLINK"])) {$IAXmonitorLINK=$_GET["IAXmonitorLINK"];}
|
||||
elseif (isset($_POST["IAXmonitorLINK"])) {$IAXmonitorLINK=$_POST["IAXmonitorLINK"];}
|
||||
if (isset($_GET["UGdisplay"])) {$UGdisplay=$_GET["UGdisplay"];}
|
||||
elseif (isset($_POST["UGdisplay"])) {$UGdisplay=$_POST["UGdisplay"];}
|
||||
if (isset($_GET["UidORname"])) {$UidORname=$_GET["UidORname"];}
|
||||
elseif (isset($_POST["UidORname"])) {$UidORname=$_POST["UidORname"];}
|
||||
if (isset($_GET["orderby"])) {$orderby=$_GET["orderby"];}
|
||||
elseif (isset($_POST["orderby"])) {$orderby=$_POST["orderby"];}
|
||||
if (isset($_GET["SERVdisplay"])) {$SERVdisplay=$_GET["SERVdisplay"];}
|
||||
elseif (isset($_POST["SERVdisplay"])) {$SERVdisplay=$_POST["SERVdisplay"];}
|
||||
|
||||
if (isset($_GET["RECmonitorLINK"])) {$RECmonitorLINK=$_GET["RECmonitorLINK"];}
|
||||
elseif (isset($_POST["RECmonitorLINK"])) {$RECmonitorLINK=$_POST["RECmonitorLINK"];}
|
||||
|
||||
if (!isset($RR)) {$gRRroup=4;}
|
||||
if (!isset($group)) {$group='';}
|
||||
if (!isset($usergroup)) {$usergroup='';}
|
||||
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
|
||||
if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name
|
||||
if (!isset($orderby)) {$orderby='timeup';}
|
||||
if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes
|
||||
|
||||
function get_server_load($windows = false) {
|
||||
$os = strtolower(PHP_OS);
|
||||
if(strpos($os, "win") === false) {
|
||||
if(file_exists("/proc/loadavg")) {
|
||||
$load = file_get_contents("/proc/loadavg");
|
||||
$load = explode(' ', $load);
|
||||
return $load[0];
|
||||
}
|
||||
elseif(function_exists("shell_exec")) {
|
||||
$load = explode(' ', `uptime`);
|
||||
return $load[count($load)-1];
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
elseif($windows) {
|
||||
if(class_exists("COM")) {
|
||||
$wmi = new COM("WinMgmts:\\\\.");
|
||||
$cpus = $wmi->InstancesOf("Win32_Processor");
|
||||
|
||||
$cpuload = 0;
|
||||
$i = 0;
|
||||
while ($cpu = $cpus->Next()) {
|
||||
$cpuload += $cpu->LoadPercentage;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$cpuload = round($cpuload / $i, 2);
|
||||
return "$cpuload%";
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$load_ave = get_server_load(true);
|
||||
|
||||
$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'");}
|
||||
if ($non_latin > 0) {$rslta=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 "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt="SELECT vicidial_recording 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'");}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$authrec=$row[0];
|
||||
if ($authrec=='1') {$RECmonitorLINK = 1;} else {$RECmonitorLINK = 0;}
|
||||
|
||||
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$FILE_TIME = date("Ymd-His");
|
||||
$NOW_DAY = date("Y-m-d");
|
||||
$NOW_HOUR = date("H:i:s");
|
||||
$STARTtime = date("U");
|
||||
$epochSIXhoursAGO = ($STARTtime - 21600);
|
||||
$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO);
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns where active='Y';";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
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 * from vicidial_user_groups;";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$usergroups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $usergroups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$usergroups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (!isset($RR)) {$RR=4;}
|
||||
|
||||
$NFB = '<b><font size=6 face="courier">';
|
||||
$NFE = '</font></b>';
|
||||
$F=''; $FG=''; $B=''; $BG='';
|
||||
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
|
||||
<script language="Javascript">
|
||||
|
||||
var filenamelog = '';
|
||||
var admuser = '<? echo $PHP_AUTH_USER ?>';
|
||||
var filedate = '<? echo $FILE_TIME ?>';
|
||||
var pass = '<? echo $PHP_AUTH_PW ?>';
|
||||
|
||||
var recording_exten = '8309';
|
||||
var ext_context = 'default';
|
||||
|
||||
|
||||
function conf_send_recording(taskconfrectype,sesname,taskconfrec,taskconffile,leadid,userid,campaignid,serverip,userpass)
|
||||
{
|
||||
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 channelrec = "Local/7" + taskconfrec + "@" + ext_context;
|
||||
|
||||
if (taskconfrectype=='MonitorConf'){
|
||||
filenamelog = "AUTO" + "_" + filedate + "_" + admuser + "_" + userid + "_" + campaignid ;
|
||||
}
|
||||
else {
|
||||
filenamelog = taskconffile;
|
||||
}
|
||||
|
||||
confmonitor_query = "server_ip=" + serverip + "&session_name=" + sesname + "&user=" + userid + "&pass=" + userpass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filenamelog + "&exten=" + recording_exten + "&ext_context=" + ext_context + "&ext_priority=1" + "&lead_id=" + leadid;
|
||||
xmlhttp.open('POST', 'manager_send.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(confmonitor_query);
|
||||
xmlhttp.onreadystatechange = function()
|
||||
{
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
|
||||
{
|
||||
Nactiveext = null;
|
||||
Nactiveext = xmlhttp.responseText;
|
||||
}
|
||||
}
|
||||
delete xmlhttp;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.lightblue {color: black; background-color: #ADD8E6}
|
||||
.blue {color: white; background-color: blue}
|
||||
.midnightblue {color: white; background-color: #191970}
|
||||
.purple {color: white; background-color: purple}
|
||||
.violet {color: black; background-color: #EE82EE}
|
||||
.thistle {color: black; background-color: #D8BFD8}
|
||||
.olive {color: white; background-color: #808000}
|
||||
.yellow {color: black; background-color: yellow}
|
||||
.khaki {color: black; background-color: #F0E68C}
|
||||
.orange {color: black; background-color: orange}
|
||||
|
||||
.r1 {color: black; background-color: #FFCCCC}
|
||||
.r2 {color: black; background-color: #FF9999}
|
||||
.r3 {color: black; background-color: #FF6666}
|
||||
.r4 {color: white; background-color: #FF0000}
|
||||
.b1 {color: black; background-color: #CCCCFF}
|
||||
.b2 {color: black; background-color: #9999FF}
|
||||
.b3 {color: black; background-color: #6666FF}
|
||||
.b4 {color: white; background-color: #0000FF}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo"<META HTTP-EQUIV=Refresh CONTENT=\"$RR; URL=$PHP_SELF?RR=$RR&DB=$DB&group=$group&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay\">\n";
|
||||
echo "<TITLE>VICIDIAL: Time On VDAD Campaign: $group</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "VICIDIAL Campaign: \n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=RR VALUE=\"$RR\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=adastats VALUE=\"$adastats\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=SIPmonitorLINK VALUE=\"$SIPmonitorLINK\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=IAXmonitorLINK VALUE=\"$IAXmonitorLINK\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=RECmonitorLINK VALUE=\"$RECmonitorLINK\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=usergroup VALUE=\"$usergroup\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=UGdisplay VALUE=\"$UGdisplay\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=UidORname VALUE=\"$UidORname\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=orderby VALUE=\"$orderby\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=SERVdisplay VALUE=\"$SERVdisplay\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
echo "<option value=\"XXXX-ALL-ACTIVE-XXXX\">ALL ACTIVE</option>\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";
|
||||
if ($UGdisplay > 0)
|
||||
{
|
||||
echo "<SELECT SIZE=1 NAME=usergroup>\n";
|
||||
echo "<option value=\"\">ALL USER GROUPS</option>\n";
|
||||
$o=0;
|
||||
while ($usergroups_to_print > $o)
|
||||
{
|
||||
if ($usergroups[$o] == $usergroup) {echo "<option selected value=\"$usergroups[$o]\">$usergroups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$usergroups[$o]\">$usergroups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
}
|
||||
echo "<INPUT type=submit NAME=SUBMIT VALUE=SUBMIT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> \n";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=4000&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay\">STOP</a> | ";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=40&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay\">SLOW</a> | ";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay\">GO</a>";
|
||||
echo " <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | \n";
|
||||
echo "<a href=\"./AST_timeonVDADallSUMMARY.php?group=$group&RR=$RR&DB=$DB&adastats=$adastats\">SUMMARY</a> | \n";
|
||||
echo "<a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
echo "\n\n";
|
||||
|
||||
|
||||
if (!$group) {echo "<BR><BR>please select a campaign from the pulldown above</FORM>\n"; exit;}
|
||||
else
|
||||
{
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses) from vicidial_campaigns;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DIALlev = $row[0];
|
||||
$DIALstatusA = $row[1];
|
||||
$DIALstatusB = $row[2];
|
||||
$DIALstatusC = $row[3];
|
||||
$DIALstatusD = $row[4];
|
||||
$DIALstatusE = $row[5];
|
||||
$DIALorder = $row[6];
|
||||
$DIALfilter = $row[7];
|
||||
$HOPlev = $row[8];
|
||||
$DIALmethod = $row[9];
|
||||
$maxDIALlev = $row[10];
|
||||
$DROPmax = $row[11];
|
||||
$targetDIFF = $row[12];
|
||||
$ADAintense = $row[13];
|
||||
$ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select count(*) from vicidial_hopper;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDhop = $row[0];
|
||||
|
||||
$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today) from vicidial_campaign_stats;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DAleads = $row[0];
|
||||
$callsTODAY = $row[1];
|
||||
$dropsTODAY = $row[2];
|
||||
$drpctTODAY = $row[3];
|
||||
$diffONEMIN = $row[4];
|
||||
$agentsONEMIN = $row[5];
|
||||
$balanceFILL = $row[6];
|
||||
$answersTODAY = $row[7];
|
||||
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
|
||||
{
|
||||
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
|
||||
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
|
||||
}
|
||||
else {$diffpctONEMIN = '0.00';}
|
||||
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$balanceSHORT = $row[0];
|
||||
|
||||
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $DIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TRUNK SHORT/FILL:</B></TD><TD ALIGN=LEFT><font size=2> $balanceSHORT / $balanceFILL </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>FILTER:</B></TD><TD ALIGN=LEFT><font size=2> $DIALfilter </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B> TIME:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
|
||||
if ($adastats>1)
|
||||
{
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=1\"><font size=1>- min </font></a><font size=2> <B>MAX LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $maxDIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED MAX:</B></TD><TD ALIGN=LEFT><font size=2> $DROPmax% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TARGET DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $targetDIFF </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>INTENSITY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAintense </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL TIMEOUT:</B></TD><TD ALIGN=LEFT><font size=2> $DIALtimeout </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TAPER TIME:</B></TD><TD ALIGN=LEFT><font size=2> $TAPERtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LOCAL TIME:</B></TD><TD ALIGN=LEFT><font size=2> $CALLtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>AVAIL ONLY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAavailonly </TD>";
|
||||
echo "</TR>";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIALABLE LEADS:</B></TD><TD ALIGN=LEFT><font size=2> $DAleads </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CALLS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>AVG AGENTS:</B></TD><TD ALIGN=LEFT><font size=2> $agentsONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL METHOD:</B></TD><TD ALIGN=LEFT><font size=2> $DIALmethod </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>HOPPER LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED / ANSWERED:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LEADS IN HOPPER:</B></TD><TD ALIGN=LEFT><font size=2> $VDhop </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> $drpctTODAY% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffpctONEMIN% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ORDER:</B></TD><TD ALIGN=LEFT><font size=2> $DIALorder </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=LEFT COLSPAN=8>";
|
||||
|
||||
if ($adastats<2)
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay\"><font size=1>+ VIEW MORE SETTINGS</font></a>";
|
||||
}
|
||||
if ($UGdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=0&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay\"><font size=1>HIDE USER GROUP</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=1&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay\"><font size=1>VIEW USER GROUP</font></a>";
|
||||
}
|
||||
if ($UidORname>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=0&orderby=$orderby&SERVdisplay=$SERVdisplay\"><font size=1>SHOW AGENT ID</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=1&orderby=$orderby&SERVdisplay=$SERVdisplay\"><font size=1>SHOW AGENT NAME</font></a>";
|
||||
}
|
||||
if ($SERVdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=0\"><font size=1>HIDE SERVER INFO</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=1\"><font size=1>SHOW SERVER INFO</font></a>";
|
||||
}
|
||||
echo "</TD>";
|
||||
echo "</TR>";
|
||||
echo "</TABLE>";
|
||||
|
||||
echo "</FORM>\n\n";
|
||||
}
|
||||
###################################################################################
|
||||
###### OUTBOUND CALLS
|
||||
###################################################################################
|
||||
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group))
|
||||
{
|
||||
$stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = preg_replace("/^ | -$/","",$row[0]);
|
||||
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
||||
$closer_campaigns = "'$closer_campaigns'";
|
||||
|
||||
$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';}
|
||||
else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";}
|
||||
|
||||
$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$parked_to_print = mysql_num_rows($rslt);
|
||||
if ($parked_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
$out_total=0;
|
||||
$out_ring=0;
|
||||
$out_live=0;
|
||||
while ($i < $parked_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
if (eregi("LIVE",$row[0]))
|
||||
{$out_live++;}
|
||||
else
|
||||
{
|
||||
if (eregi("CLOSER",$row[0]))
|
||||
{$nothing=1;}
|
||||
else
|
||||
{$out_ring++;}
|
||||
}
|
||||
$out_total++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($out_live > 0) {$F='<FONT class="r1">'; $FG='</FONT>';}
|
||||
if ($out_live > 4) {$F='<FONT class="r2">'; $FG='</FONT>';}
|
||||
if ($out_live > 9) {$F='<FONT class="r3">'; $FG='</FONT>';}
|
||||
if ($out_live > 14) {$F='<FONT class="r4">'; $FG='</FONT>';}
|
||||
|
||||
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group))
|
||||
{echo "$NFB$out_total$NFE current active calls \n";}
|
||||
else
|
||||
{echo "$NFB$out_total$NFE calls being placed \n";}
|
||||
|
||||
echo "$NFB$out_ring$NFE calls ringing \n";
|
||||
echo "$NFB$F $out_live $FG$NFE calls waiting for agents \n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " NO LIVE CALLS WAITING \n";
|
||||
}
|
||||
|
||||
|
||||
###################################################################################
|
||||
###### TIME ON SYSTEM
|
||||
###################################################################################
|
||||
|
||||
$agent_incall=0;
|
||||
$agent_ready=0;
|
||||
$agent_paused=0;
|
||||
$agent_total=0;
|
||||
|
||||
$Aecho = '';
|
||||
$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n\n";
|
||||
|
||||
|
||||
$HDbegin = "+";
|
||||
$HTbegin = "|";
|
||||
$HDstation = "------------+";
|
||||
$HTstation = " STATION |";
|
||||
$HDuser = "--------------------+";
|
||||
$HTuser = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=userup&SERVdisplay=$SERVdisplay\">USER</a> |";
|
||||
$HDusergroup = "--------------+";
|
||||
$HTusergroup = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=groupup&SERVdisplay=$SERVdisplay\">USER GROUP</a> |";
|
||||
$HDsessionid = "------------------+";
|
||||
$HTsessionid = " SESSIONID |";
|
||||
$HDbarge = "-------+";
|
||||
$HTbarge = " BARGE |";
|
||||
$HDrec = "---------+";
|
||||
$HTrec = " MONITOR |";
|
||||
$HDstatus = "----------+";
|
||||
$HTstatus = " STATUS |";
|
||||
$HDserver_ip = "-----------------+";
|
||||
$HTserver_ip = " SERVER IP |";
|
||||
$HDcall_server_ip = "-----------------+";
|
||||
$HTcall_server_ip = " CALL SERVER IP |";
|
||||
$HDtime = "---------+";
|
||||
$HTtime = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=timeup&SERVdisplay=$SERVdisplay\">MM:SS</a> |";
|
||||
$HDcampaign = "------------+";
|
||||
$HTcampaign = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&RECmonitorLINK=$RECmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=campaignup&SERVdisplay=$SERVdisplay\">CAMPAIGN</a> |";
|
||||
|
||||
if ($UGdisplay < 1)
|
||||
{
|
||||
$HDusergroup = '';
|
||||
$HTusergroup = '';
|
||||
}
|
||||
if ( ($SIPmonitorLINK<1) && ($IAXmonitorLINK<1) )
|
||||
{
|
||||
$HDsessionid = "-----------+";
|
||||
$HTsessionid = " SESSIONID |";
|
||||
}
|
||||
if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) )
|
||||
{
|
||||
$HDbarge = '';
|
||||
$HTbarge = '';
|
||||
}
|
||||
if ($SERVdisplay < 1)
|
||||
{
|
||||
$HDserver_ip = '';
|
||||
$HTserver_ip = '';
|
||||
$HDcall_server_ip = '';
|
||||
$HTcall_server_ip = '';
|
||||
}
|
||||
|
||||
if ( ($RECmonitorLINK<1) )
|
||||
{
|
||||
$HDrec = '';
|
||||
$HTrec = '';
|
||||
}
|
||||
|
||||
$Aline = "$HDbegin$HDstation$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDrec$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign\n";
|
||||
$Bline = "$HTbegin$HTstation$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTrec$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign\n";
|
||||
|
||||
$Aecho .= "$Aline";
|
||||
$Aecho .= "$Bline";
|
||||
$Aecho .= "$Aline";
|
||||
|
||||
if ($orderby=='timeup') {$orderSQL='status,last_call_time';}
|
||||
if ($orderby=='timedown') {$orderSQL='status desc,last_call_time desc';}
|
||||
if ($orderby=='campaignup') {$orderSQL='campaign_id,status,last_call_time';}
|
||||
if ($orderby=='campaigndown') {$orderSQL='campaign_id desc,status desc,last_call_time desc';}
|
||||
if ($orderby=='groupup') {$orderSQL='user_group,status,last_call_time';}
|
||||
if ($orderby=='groupdown') {$orderSQL='user_group desc,status desc,last_call_time desc';}
|
||||
if ($UidORname > 0)
|
||||
{
|
||||
if ($orderby=='userup') {$orderSQL='full_name,status,last_call_time';}
|
||||
if ($orderby=='userdown') {$orderSQL='full_name desc,status desc,last_call_time desc';}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($orderby=='userup') {$orderSQL='vicidial_live_agents.user';}
|
||||
if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';}
|
||||
}
|
||||
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';}
|
||||
else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";}
|
||||
if (strlen($usergroup)<1) {$usergroupSQL = '';}
|
||||
else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";}
|
||||
|
||||
$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,lead_id,vicidial_users.pass from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;";
|
||||
|
||||
#$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and campaign_id='" . mysql_real_escape_string($group) . "' order by $orderSQL;";
|
||||
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
$rslt=mysql_query("SET NAMES 'UTF8'");
|
||||
}
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$talking_to_print = mysql_num_rows($rslt);
|
||||
if ($talking_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
$agentcount=0;
|
||||
while ($i < $talking_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("READY|PAUSED",$row[3]))
|
||||
{
|
||||
$row[5]=$row[6];
|
||||
}
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$extension = eregi_replace('Local/',"",$row[0]);
|
||||
$extension = eregi_replace('IAX2/',"",$row[0]);
|
||||
$extension = sprintf("%-10s", $extension);
|
||||
while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$extension = eregi_replace('Local/',"",$row[0]);
|
||||
$extension = eregi_replace('IAX2/',"",$row[0]);
|
||||
$extension = sprintf("%-40s", $extension);
|
||||
while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');}
|
||||
}
|
||||
|
||||
$Luser = $row[1];
|
||||
$user = sprintf("%-18s", $row[1]);
|
||||
$Lsessionid = $row[2];
|
||||
$sessionid = sprintf("%-9s", $row[2]);
|
||||
$Lstatus = $row[3];
|
||||
$status = sprintf("%-6s", $row[3]);
|
||||
$Lserver_ip = $row[4];
|
||||
$server_ip = sprintf("%-15s", $row[4]);
|
||||
$call_server_ip = sprintf("%-15s", $row[7]);
|
||||
$campaign_id = sprintf("%-10s", $row[8]);
|
||||
$comments= $row[11];
|
||||
|
||||
$lead_id = $row[12];
|
||||
$user_pass = $row[13];
|
||||
|
||||
|
||||
if (eregi("INCALL",$Lstatus))
|
||||
{
|
||||
if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) )
|
||||
{$CM='A';}
|
||||
else
|
||||
{
|
||||
if (eregi("INBOUND",$comments))
|
||||
{$CM='I';}
|
||||
else
|
||||
{$CM='M';}
|
||||
}
|
||||
}
|
||||
else {$CM=' ';}
|
||||
|
||||
if ($UGdisplay > 0)
|
||||
{
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$user_group = sprintf("%-12s", $row[9]);
|
||||
while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$user_group = sprintf("%-40s", $row[9]);
|
||||
while(mb_strlen($user_group, 'utf-8')>12) {$user_group = mb_substr("$user_group", 0, -1,'utf8');}
|
||||
}
|
||||
}
|
||||
if ($UidORname > 0)
|
||||
{
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$user = sprintf("%-18s", $row[10]);
|
||||
while(strlen($user)>18) {$user = substr("$user", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$user = sprintf("%-40s", $row[10]);
|
||||
while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');}
|
||||
}
|
||||
}
|
||||
if (!eregi("INCALL|QUEUE",$row[3]))
|
||||
{$call_time_S = ($STARTtime - $row[6]);}
|
||||
else
|
||||
{$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 ($Lstatus=='INCALL')
|
||||
{
|
||||
if ($call_time_S >= 10) {$G='<SPAN class="thistle"><B>'; $EG='</B></SPAN>';}
|
||||
if ($call_time_M_int >= 1) {$G='<SPAN class="violet"><B>'; $EG='</B></SPAN>';}
|
||||
if ($call_time_M_int >= 5) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
|
||||
# if ($call_time_M_int >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
|
||||
}
|
||||
if (eregi("PAUSED",$row[3]))
|
||||
{
|
||||
if ($call_time_M_int >= 30)
|
||||
{$i++; continue;}
|
||||
else
|
||||
{
|
||||
$agent_paused++; $agent_total++;
|
||||
$G=''; $EG='';
|
||||
if ($call_time_S >= 10) {$G='<SPAN class="khaki"><B>'; $EG='</B></SPAN>';}
|
||||
if ($call_time_M_int >= 1) {$G='<SPAN class="yellow"><B>'; $EG='</B></SPAN>';}
|
||||
if ($call_time_M_int >= 5) {$G='<SPAN class="olive"><B>'; $EG='</B></SPAN>';}
|
||||
}
|
||||
}
|
||||
# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") )
|
||||
# {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';}
|
||||
|
||||
if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;}
|
||||
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;}
|
||||
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) )
|
||||
{
|
||||
$G='<SPAN class="lightblue"><B>'; $EG='</B></SPAN>';
|
||||
if ($call_time_M_int >= 1) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
|
||||
if ($call_time_M_int >= 5) {$G='<SPAN class="midnightblue"><B>'; $EG='</B></SPAN>';}
|
||||
}
|
||||
|
||||
$L='';
|
||||
$R='';
|
||||
$LL='';
|
||||
$EXTF='6';
|
||||
$servip= str_replace('.','',$Lserver_ip);
|
||||
if ($SIPmonitorLINK>0) {$L=" <a href=\"sip:6$Lsessionid@$server_ip\">LISTEN</a>"; $R='';}
|
||||
if ($IAXmonitorLINK>0) {$L=" <a href=\"tel:$servip$EXTF$Lsessionid\">LISTEN</a>"; $R='';}
|
||||
if ($SIPmonitorLINK>1) {$R=" | <a href=\"sip:$Lsessionid@$server_ip\">BARGE</a>";}
|
||||
if ($IAXmonitorLINK>1) {$R=" | <a href=\"tel:$servip$Lsessionid\">BARGE</a>";}
|
||||
|
||||
|
||||
if ($RECmonitorLINK>0)
|
||||
{
|
||||
|
||||
$stmt="select session_name from web_client_sessions where server_ip ='$server_ip' and extension ='$extension' limit 1;";
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslta=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$sess = mysql_num_rows($rslta);
|
||||
|
||||
if ($sess > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslta);
|
||||
$sessionname = $row[0];
|
||||
} else
|
||||
{
|
||||
$sessionname = "";
|
||||
}
|
||||
|
||||
|
||||
$stmt="select end_time,channel,extension,lead_id,user,server_ip,filename from recording_log where server_ip ='$server_ip' and user ='$Luser';";
|
||||
if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslta=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rec_channels = mysql_num_rows($rslta);
|
||||
|
||||
if ($rec_channels > 0)
|
||||
{
|
||||
$ii=0;
|
||||
while ($ii < $rec_channels)
|
||||
{
|
||||
$row=mysql_fetch_row($rslta);
|
||||
$pos=strpos($row[1], $Lsessionid);
|
||||
|
||||
if ($pos===false)
|
||||
{
|
||||
$LL=" <a href=\"#\" onclick=\"conf_send_recording('MonitorConf','$sessionname', '$Lsessionid','' ,$lead_id,'$Luser','$campaign_id','$Lserver_ip','$user_pass');return false;\">Rec </a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(is_null($row[0])) {
|
||||
$LL=" <a href=\"#\" onclick=\"conf_send_recording('StopMonitorConf','$sessionname', '$Lsessionid', '$row[6]', $lead_id,'$Luser','$campaign_id','$Lserver_ip','$user_pass');return false;\">Stop</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$LL=" <a href=\"#\" onclick=\"conf_send_recording('MonitorConf','$sessionname', '$Lsessionid','' ,$lead_id,'$Luser','$campaign_id','$Lserver_ip','$user_pass');return false;\">Rec </a>";
|
||||
}
|
||||
}
|
||||
|
||||
$ii++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$LL=" <a href=\"#\" onclick=\"conf_send_recording('MonitorConf','$sessionname','$Lsessionid', '' , $lead_id,'$Luser','$campaign_id','$Lserver_ip','$user_pass');return false;\">Rec </a>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";}
|
||||
else {$UGD = "";}
|
||||
|
||||
if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";}
|
||||
else {$SVD = "";}
|
||||
|
||||
$agentcount++;
|
||||
|
||||
$Aecho .= "| $G$extension$EG | <a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $LL | $SVD$G$call_time_MS$EG | $G$campaign_id$EG |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$Aecho .= "$Aline";
|
||||
$Aecho .= " $agentcount agents logged in on all servers\n";
|
||||
$Aecho .= " System Load Average: $load_ave\n\n";
|
||||
|
||||
# $Aecho .= " <SPAN class=\"orange\"><B> </SPAN> - Balanced call</B>\n";
|
||||
$Aecho .= " <SPAN class=\"lightblue\"><B> </SPAN> - Agent waiting for call</B>\n";
|
||||
$Aecho .= " <SPAN class=\"blue\"><B> </SPAN> - Agent waiting for call > 1 minute</B>\n";
|
||||
$Aecho .= " <SPAN class=\"midnightblue\"><B> </SPAN> - Agent waiting for call > 5 minutes</B>\n";
|
||||
$Aecho .= " <SPAN class=\"thistle\"><B> </SPAN> - Agent on call > 10 seconds</B>\n";
|
||||
$Aecho .= " <SPAN class=\"violet\"><B> </SPAN> - Agent on call > 1 minute</B>\n";
|
||||
$Aecho .= " <SPAN class=\"purple\"><B> </SPAN> - Agent on call > 5 minutes</B>\n";
|
||||
$Aecho .= " <SPAN class=\"khaki\"><B> </SPAN> - Agent Paused > 10 seconds</B>\n";
|
||||
$Aecho .= " <SPAN class=\"yellow\"><B> </SPAN> - Agent Paused > 1 minute</B>\n";
|
||||
$Aecho .= " <SPAN class=\"olive\"><B> </SPAN> - Agent Paused > 5 minutes</B>\n";
|
||||
|
||||
if ($agent_ready > 0) {$B='<FONT class="b1">'; $BG='</FONT>';}
|
||||
if ($agent_ready > 4) {$B='<FONT class="b2">'; $BG='</FONT>';}
|
||||
if ($agent_ready > 9) {$B='<FONT class="b3">'; $BG='</FONT>';}
|
||||
if ($agent_ready > 14) {$B='<FONT class="b4">'; $BG='</FONT>';}
|
||||
|
||||
|
||||
echo "\n<BR>\n";
|
||||
|
||||
echo "$NFB$agent_total$NFE agents logged in \n";
|
||||
echo "$NFB$agent_incall$NFE agents in calls \n";
|
||||
echo "$NFB$B $agent_ready $BG$NFE agents waiting \n";
|
||||
echo "$NFB$agent_paused$NFE paused agents \n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>";
|
||||
echo "";
|
||||
echo "$Aecho";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " NO AGENTS ON CALLS \n";
|
||||
}
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#
|
||||
# changes:
|
||||
# 61102-1616 - first build
|
||||
# 61215-1131 - added answered calls and drop percent taken from answered calls
|
||||
# 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -35,7 +37,7 @@ if (!isset($RR)) {$gRRroup=4;}
|
||||
$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;";
|
||||
$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);
|
||||
@@ -114,7 +116,7 @@ else
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=1\"><font size=1>- VIEW LESS SETTINGS</font></a>";
|
||||
}
|
||||
echo " <a href=\"./server_stats.php\">REPORTS</a>";
|
||||
echo " <a href=\"./admin.php?ADD=999999\">REPORTS</a>";
|
||||
echo "<BR><BR>\n\n";
|
||||
|
||||
$k=0;
|
||||
@@ -128,7 +130,7 @@ $group = $groups[$k];
|
||||
echo "<b><a href=\"./AST_timeonVDADall.php?group=$group&RR=$RR&DB=$DB&adastats=$adastats\">$group</a></b> - ";
|
||||
echo "<a href=\"./admin.php?ADD=34&campaign_id=$group\">Modify</a>\n";
|
||||
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DIALlev = $row[0];
|
||||
@@ -149,6 +151,9 @@ $ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -214,7 +219,7 @@ echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>HOPPER LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED / ANSWERED:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatusA, $DIALstatusB, $DIALstatusC, $DIALstatusD, $DIALstatusE </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
@@ -240,7 +245,7 @@ echo "<TD ALIGN=LEFT COLSPAN=8>";
|
||||
################################################################################
|
||||
###### OUTBOUND CALLS
|
||||
################################################################################
|
||||
if (eregi("CLOSER",$group))
|
||||
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group))
|
||||
{
|
||||
$stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -289,7 +294,7 @@ $parked_to_print = mysql_num_rows($rslt);
|
||||
if ($out_live > 9) {$F='<FONT class="r3">'; $FG='</FONT>';}
|
||||
if ($out_live > 14) {$F='<FONT class="r4">'; $FG='</FONT>';}
|
||||
|
||||
if (eregi("CLOSER",$group))
|
||||
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group))
|
||||
{echo "$NFB$out_total$NFE current active calls \n";}
|
||||
else
|
||||
{echo "$NFB$out_total$NFE calls being placed \n";}
|
||||
@@ -323,7 +328,7 @@ $talking_to_print = mysql_num_rows($rslt);
|
||||
while ($i < $talking_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("READY|PAUSED",$row[4]))
|
||||
if (eregi("READY|PAUSED",$row[3]))
|
||||
{
|
||||
$row[5]=$row[6];
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
# 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");
|
||||
|
||||
@@ -18,6 +23,23 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
$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 "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
$timeONEhoursAGO = ($STARTtime - 3600);
|
||||
@@ -67,7 +89,7 @@ echo"<META HTTP-EQUIV=Refresh CONTENT=\"7; URL=$PHP_SELF?server_ip=$server_ip&DB
|
||||
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\n\n";
|
||||
echo "VICIDIAL: Time On Park $NOW_TIME <a href=\"./admin.php?ADD=999999\">REPORTS</a>\n\n";
|
||||
echo "+------------+-----------------+---------------------+---------+\n";
|
||||
echo "| CHANNEL | GROUP | START TIME | MINUTES |\n";
|
||||
echo "+------------+-----------------+---------------------+---------+\n";
|
||||
@@ -76,7 +98,7 @@ echo "+------------+-----------------+---------------------+---------+\n";
|
||||
# $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='$server_ip' order by uniqueid;";
|
||||
$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);
|
||||
@@ -138,7 +160,7 @@ echo "| STATION | USER | CHANNEL | GROUP | START TIME
|
||||
echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
|
||||
|
||||
|
||||
$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='$server_ip' order by uniqueid;";
|
||||
$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);
|
||||
|
||||
+10721
-9037
File diff suppressed because it is too large
Load Diff
@@ -85,6 +85,8 @@ 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"];}
|
||||
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
@@ -105,6 +107,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
# 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
|
||||
#
|
||||
|
||||
$STARTtime = date("U");
|
||||
@@ -112,7 +115,7 @@ $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;";
|
||||
$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);
|
||||
@@ -216,6 +219,17 @@ $call_length = ($STARTtime - $call_began);
|
||||
|
||||
echo "<BR>Lead added to DNC List: $lead_id - $phone_number<BR>\n";
|
||||
}
|
||||
### update last record in vicidial_agent_log and vicidial_log tables
|
||||
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);
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
@@ -346,7 +360,9 @@ else
|
||||
echo "</select></td></tr>\n";
|
||||
|
||||
|
||||
echo "<tr><td colspan=2><input type=submit name=submit value=\"SUBMIT\"></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=left>Modify agent and vicidial logs </td><td align=left><input type=checkbox name=modify_logs value=\"1\" CHECKED></td></tr>\n";
|
||||
|
||||
echo "<tr><td colspan=2 align=center><input type=submit name=submit value=\"SUBMIT\"></td></tr>\n";
|
||||
echo "</table></form>\n";
|
||||
echo "<BR><BR><BR>\n";
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ $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;";
|
||||
$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);
|
||||
|
||||
@@ -44,5 +44,6 @@ $local_AMP = '@';
|
||||
$ext_context = 'demo';
|
||||
$recording_exten = '8309';
|
||||
$WeBRooTWritablE = '1';
|
||||
$non_latin = '0'; # set to 1 for UTF rules
|
||||
|
||||
?>
|
||||
|
||||
@@ -28,7 +28,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
$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;";
|
||||
$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);
|
||||
|
||||
@@ -15,12 +15,13 @@
|
||||
# 60906-1059 - added filter of non-digits in alt_phone field
|
||||
# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme
|
||||
# 61128-1046 - added postal code GMT lookup and duplicate check options
|
||||
# 70205-1703 - Defaulted phone_code to 1 if not populated
|
||||
#
|
||||
# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time.
|
||||
#
|
||||
|
||||
$version = '2.0.2';
|
||||
$build = '61128-1046';
|
||||
$version = '2.0.3';
|
||||
$build = '70205-1703';
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
@@ -60,7 +61,7 @@ $admDIR = "$HTTPprotocol$server_name$script_name";
|
||||
$admDIR = eregi_replace('listloader.php','',$admDIR);
|
||||
$admSCR = 'admin.php';
|
||||
$NWB = " <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
|
||||
$NWE = "')\"><IMG SRC=\"../astguiclient/help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
|
||||
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
|
||||
|
||||
|
||||
$secX = date("U");
|
||||
@@ -141,7 +142,7 @@ function ShowProgress(good, bad, total, dup, post) {
|
||||
<td align=left width="75%"><font face="arial, helvetica" size=1><select size=1 name=dupcheck><option selected value="NONE">NO DUPLICATE CHECK</option><option value="DUP">CHECK FOR DUPLICATES BY PHONE IN LIST ID</option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right width="25%"><font face="arial, helvetica" size=2>Lead Timezone Lookup: </font></td>
|
||||
<td align=right width="25%"><font face="arial, helvetica" size=2>Lead Time Zone Lookup: </font></td>
|
||||
<td align=left width="75%"><font face="arial, helvetica" size=1><select size=1 name=postalgmt><option selected value="AREA">COUNTRY CODE AND AREA CODE ONLY</option><option value="POSTAL">POSTAL CODE FIRST</option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -872,6 +873,7 @@ if ($leadfile and filesize($LF_path)<=8388608) {
|
||||
}
|
||||
|
||||
|
||||
if (strlen($phone_code)<1) {$phone_code = '1';}
|
||||
if ($multi_insert_counter > 8) {
|
||||
### insert good deal into pending_transactions table ###
|
||||
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# 60906-1058 - added filter of non-digits in alt_phone field
|
||||
# 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme
|
||||
# 61128-1215 - added postal code GMT lookup and duplicate check options
|
||||
# 70205-1703 - Defaulted phone_code to 1 if not populated
|
||||
#
|
||||
|
||||
### begin parsing run-time options ###
|
||||
@@ -434,6 +435,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
|
||||
$AC_processed++;
|
||||
}
|
||||
|
||||
if (length($phone_code)<1) {$phone_code = '1';}
|
||||
if ($multi_insert_counter > 8) {
|
||||
### insert good deal into pending_transactions table ###
|
||||
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);";
|
||||
@@ -454,7 +456,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
|
||||
}
|
||||
$total++;
|
||||
if ($total%100==0) {
|
||||
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total)</script>";
|
||||
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup_lead, $postalgmt_found)</script>";
|
||||
sleep(1);
|
||||
# flush();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#
|
||||
# changes:
|
||||
# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 60822-1105 - fixed for nonwritable directories
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -30,7 +31,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
@@ -59,13 +60,19 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
echo "You do not have permissions to load leads\n";
|
||||
exit;
|
||||
}
|
||||
fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# 60906-1056 - added filter of non-digits in alt_phone field
|
||||
# 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme
|
||||
# 61128-1207 - added postal code GMT lookup and duplicate check options
|
||||
# 70205-1703 - Defaulted phone_code to 1 if not populated
|
||||
#
|
||||
|
||||
### begin parsing run-time options ###
|
||||
@@ -436,6 +437,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
|
||||
$AC_processed++;
|
||||
}
|
||||
|
||||
if (length($phone_code)<1) {$phone_code = '1';}
|
||||
if ($multi_insert_counter > 8) {
|
||||
### insert good deal into pending_transactions table ###
|
||||
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$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',0);";
|
||||
@@ -456,7 +458,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
|
||||
}
|
||||
$total++;
|
||||
if ($total%100==0) {
|
||||
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total)</script>";
|
||||
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup_lead, $postalgmt_found)</script>";
|
||||
sleep(1);
|
||||
# flush();
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ $admDIR = "$HTTPprotocol$server_name$script_name";
|
||||
$admDIR = eregi_replace('new_listloader_superL.php','',$admDIR);
|
||||
$admSCR = 'admin.php';
|
||||
$NWB = " <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
|
||||
$NWE = "')\"><IMG SRC=\"../astguiclient/help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
|
||||
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
|
||||
|
||||
$secX = date("U");
|
||||
$hour = date("H");
|
||||
@@ -307,7 +307,7 @@ function ParseFileName() {
|
||||
<td align=left width="75%"><font face="arial, helvetica" size=1><select size=1 name=dupcheck><option selected value="NONE">NO DUPLICATE CHECK</option><option value="DUP">CHECK FOR DUPLICATES BY PHONE IN LIST ID</option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right width="25%"><font face="arial, helvetica" size=2>Lead Timezone Lookup: </font></td>
|
||||
<td align=right width="25%"><font face="arial, helvetica" size=2>Lead Time Zone Lookup: </font></td>
|
||||
<td align=left width="75%"><font face="arial, helvetica" size=1><select size=1 name=postalgmt><option selected value="AREA">COUNTRY CODE AND AREA CODE ONLY</option><option value="POSTAL">POSTAL CODE FIRST</option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -38,7 +39,7 @@ $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;";
|
||||
$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];
|
||||
@@ -111,6 +112,11 @@ 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\">Modify User</a>\n";
|
||||
|
||||
|
||||
echo "</B></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n";
|
||||
|
||||
@@ -173,10 +179,10 @@ echo "<br><br>\n";
|
||||
echo "<center>\n";
|
||||
|
||||
echo "<B>LOGIN/LOGOUT TIME:</B>\n";
|
||||
echo "<TABLE width=400 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n";
|
||||
echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n";
|
||||
|
||||
$stmt="SELECT event,event_epoch,event_date,campaign_id 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'";
|
||||
$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);
|
||||
|
||||
@@ -197,6 +203,7 @@ echo "<tr><td><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td
|
||||
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]))
|
||||
@@ -216,6 +223,7 @@ echo "<tr><td><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td
|
||||
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='';
|
||||
@@ -256,8 +264,8 @@ echo "<br><br>\n";
|
||||
echo "<center>\n";
|
||||
|
||||
echo "<B>CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||
echo "<TABLE width=550 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> CAMPAIGN</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\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> PHONE</td><td align=right><font size=2> CAMPAIGN</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></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);
|
||||
@@ -279,13 +287,14 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left
|
||||
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></tr>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
echo "</TABLE></center><BR><BR>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ $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;";
|
||||
$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];
|
||||
@@ -75,10 +75,11 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "';";
|
||||
$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);
|
||||
@@ -198,9 +199,12 @@ else
|
||||
}
|
||||
|
||||
|
||||
echo " $user - $full_name - \n";
|
||||
echo " $user - $full_name \n";
|
||||
echo " GROUP: $user_group <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\">Modify User</a>\n";
|
||||
|
||||
echo "</B></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n";
|
||||
|
||||
@@ -0,0 +1,312 @@
|
||||
<?
|
||||
### voice_lab.php
|
||||
###
|
||||
### This script is designed to broadcast a recorded message or allow a person to
|
||||
### speak to all agents logged into a VICIDIAL campaign.
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 61220-1050 - First Build
|
||||
# 70115-1246 - Added ability to define an exten to play
|
||||
#
|
||||
|
||||
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["message"])) {$message=$_GET["message"];}
|
||||
elseif (isset($_POST["message"])) {$message=$_POST["message"];}
|
||||
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
|
||||
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
|
||||
if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];}
|
||||
elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];}
|
||||
if (isset($_GET["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_GET["NEW_VOICE_LAB"];}
|
||||
elseif (isset($_POST["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_POST["NEW_VOICE_LAB"];}
|
||||
if (isset($_GET["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_GET["KILL_VOICE_LAB"];}
|
||||
elseif (isset($_POST["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_POST["KILL_VOICE_LAB"];}
|
||||
if (isset($_GET["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_GET["PLAY_MESSAGE"];}
|
||||
elseif (isset($_POST["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_POST["PLAY_MESSAGE"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
$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");
|
||||
$MYSQL_datetime = date("Y-m-d H:i:s");
|
||||
$FILE_datetime = date("Ymd-His_");
|
||||
$secX = $STARTtime;
|
||||
|
||||
$local_DEF = 'Local/';
|
||||
$local_AMP = '@';
|
||||
$ext_context = 'demo';
|
||||
|
||||
$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 "Invalid Username/Password: |$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);
|
||||
}
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
|
||||
}
|
||||
|
||||
|
||||
##### 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++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>VICIDIAL VOICE LAB: Admin</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>
|
||||
|
||||
<?
|
||||
if ($NEW_VOICE_LAB > 0)
|
||||
{
|
||||
if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) )
|
||||
{
|
||||
echo "<br><br><br>TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW<br>\n";
|
||||
|
||||
echo "<br>or, you can enter an extension that you want played below<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=PLAY_MESSAGE value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "<input type=hidden name=server_ip value=$server_ip>\n";
|
||||
echo "<input type=hidden name=campaign_id value=$campaign_id>\n";
|
||||
echo "Message Extension<input type=text name=message>\n";
|
||||
echo "<input type=submit name=submit value='PLAY THIS MESSAGE'>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
|
||||
$S='*';
|
||||
$D_s_ip = explode('.', $server_ip);
|
||||
if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
$remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id";
|
||||
|
||||
$thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y"));
|
||||
$past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old);
|
||||
|
||||
$stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$agents_to_loop = mysql_num_rows($rslt);
|
||||
$agents_sessions[0]='';
|
||||
$agents_servers[0]='';
|
||||
$agents_users[0]='';
|
||||
|
||||
$o=0;
|
||||
while ($agents_to_loop > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$agents_sessions[$o] = "$rowx[0]";
|
||||
$agents_servers[$o] = "$rowx[1]";
|
||||
$agents_users[$o] = "$rowx[2]";
|
||||
$o++;
|
||||
}
|
||||
|
||||
$o=0;
|
||||
while ($agents_to_loop > $o)
|
||||
{
|
||||
if ($agents_servers[$o] == "$server_ip")
|
||||
{$dial_string = $session_id;}
|
||||
else
|
||||
{$dial_string = $remote_dialstring;}
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')";
|
||||
echo "|$stmt|\n<BR><BR>\n";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n";
|
||||
|
||||
$o++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo "<br>Kill a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=KILL_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "<input type=hidden name=server_ip value=$server_ip>\n";
|
||||
echo "<input type=hidden name=campaign_id value=$campaign_id>\n";
|
||||
echo "<input type=submit name=submit value='KILL THIS VOICE LAB'>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ERROR!!!! Not all info entered properly\n<BR><BR>\n";
|
||||
echo "|$server_ip| |$session_id| |$campaign_id|\n<BR><BR>\n";
|
||||
echo "<a href=\"$PHP_SELF\">Back to main voicelab screen</a>\n<BR><BR>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($PLAY_MESSAGE > 0)
|
||||
{
|
||||
if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) )
|
||||
{
|
||||
echo "<br><br><br>TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW<br>\n";
|
||||
|
||||
echo "<br>or, you can enter an extension that you want played below<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=PLAY_MESSAGE value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "<input type=hidden name=server_ip value=$server_ip>\n";
|
||||
echo "<input type=hidden name=campaign_id value=$campaign_id>\n";
|
||||
echo "Message Extension<input type=text name=message>\n";
|
||||
echo "<input type=submit name=submit value='PLAY THIS MESSAGE'>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
|
||||
$nn='99';
|
||||
$n='9';
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')";
|
||||
echo "|$stmt|\n<BR><BR>\n";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "MESSAGE $message played at session $session_id on server $server_ip\n";
|
||||
|
||||
echo "<br>Kill a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=KILL_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "<input type=hidden name=server_ip value=$server_ip>\n";
|
||||
echo "<input type=hidden name=campaign_id value=$campaign_id>\n";
|
||||
echo "<input type=submit name=submit value='KILL THIS VOICE LAB'>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ERROR!!!! Not all info entered properly\n<BR><BR>\n";
|
||||
echo "|$server_ip| |$session_id| |$campaign_id|\n<BR><BR>\n";
|
||||
echo "<a href=\"$PHP_SELF\">Back to main voicelab screen</a>\n<BR><BR>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br>Start a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=NEW_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "Your Server: <select size=1 name=server_ip>$servers_list</select>\n";
|
||||
echo "<BR>\n";
|
||||
echo "Campaign: <select size=1 name=campaign_id>$campaigns_list</select>";
|
||||
echo "<BR>\n";
|
||||
echo "<input type=submit name=submit value=submit>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
|
||||
|
||||
echo "<br>Kill a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=KILL_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "Your Server: <select size=1 name=server_ip>$servers_list</select>\n";
|
||||
echo "<BR>\n";
|
||||
echo "Campaign: <select size=1 name=campaign_id>$campaigns_list</select>";
|
||||
echo "<BR>\n";
|
||||
echo "<input type=submit name=submit value=submit>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($KILL_VOICE_LAB > 1)
|
||||
{
|
||||
if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) )
|
||||
{
|
||||
$kill_dial_string = "5555$session_id";
|
||||
$hangup_exten='8300';
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')";
|
||||
echo "|$stmt|\n<BR><BR>\n";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ERROR!!!! Not all info entered properly\n<BR><BR>\n";
|
||||
echo "|$server_ip| |$session_id| |$campaign_id|\n<BR><BR>\n";
|
||||
echo "<a href=\"$PHP_SELF\">Back to main voicelab screen</a>\n<BR><BR>\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?
|
||||
# welcome.php - VICIDIAL welcome page
|
||||
#
|
||||
#
|
||||
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
#
|
||||
|
||||
echo "<title>VICIDIAL Welcome</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
|
||||
echo "<BR><BR><BR><BR><BR><CENTER><TABLE WIDTH=300 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#E0C2D6\"><TR BGCOLOR=WHITE>";
|
||||
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vdc_tab_vicidial.gif\" BORDER=0></TD>";
|
||||
echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Welcome </TD>";
|
||||
echo "</TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=3><b> <a href=\"../agc/vicidial.php\">Agent Login</a> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=3><b> <a href=\"../vicidial/admin.php\">Administration</a> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> </TD></TR>\n";
|
||||
echo "</TABLE>\n";
|
||||
echo "</FORM>\n\n";
|
||||
echo "</body>\n\n";
|
||||
echo "</html>\n\n";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user