Added Calls Export Utility allowing exporting of call and lead data by defining the following parameters: date range, campaigns, in-groups, statuses, lists and user groups. A flat tab-delimited text file is exported git-svn-id: svn://192.168.202.10@1070 3d104415-ff17-0410-8863-d5cf3c621b8a
691 lines
25 KiB
PHP
691 lines
25 KiB
PHP
<?
|
|
# user_stats.php
|
|
#
|
|
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
|
#
|
|
# CHANGES
|
|
#
|
|
# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat
|
|
# 61201-1136 - Added recordings display and changed calls to time range with 10000 limit
|
|
# 70118-1605 - Added user group column to login/out and calls lists
|
|
# 70702-1231 - Added recording location link and truncation
|
|
# 80117-0316 - Added vicidial_user_closer_log entries to display
|
|
# 80501-0506 - Added Hangup Reason to logs display
|
|
# 80523-2012 - Added vicidial timeclock records display
|
|
# 80617-1402 - Fixed timeclock total logged-in time
|
|
# 81210-1634 - Added server recording display options
|
|
# 90208-0504 - Added link to multi-day report and fixed call status summary section
|
|
# 90305-1226 - Added user_call_log manual dial logs
|
|
# 90310-0734 - Added admin header
|
|
#
|
|
|
|
header ("Content-type: text/html; charset=utf-8");
|
|
|
|
require("dbconnect.php");
|
|
|
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
|
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
|
$PHP_SELF=$_SERVER['PHP_SELF'];
|
|
if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];}
|
|
elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];}
|
|
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
|
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
|
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
|
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
|
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
|
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
|
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
|
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
|
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
|
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
|
if (isset($_GET["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");
|
|
|
|
if (!isset($begin_date)) {$begin_date = $TODAY;}
|
|
if (!isset($end_date)) {$end_date = $TODAY;}
|
|
|
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$row=mysql_fetch_row($rslt);
|
|
$auth=$row[0];
|
|
|
|
$fp = fopen ("./project_auth_entries.txt", "a");
|
|
$date = date("r");
|
|
$ip = getenv("REMOTE_ADDR");
|
|
$browser = getenv("HTTP_USER_AGENT");
|
|
|
|
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|
{
|
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
|
Header("HTTP/1.0 401 Unauthorized");
|
|
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
|
exit;
|
|
}
|
|
else
|
|
{
|
|
|
|
if($auth>0)
|
|
{
|
|
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$row=mysql_fetch_row($rslt);
|
|
$LOGfullname=$row[0];
|
|
|
|
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
|
fclose($fp);
|
|
}
|
|
else
|
|
{
|
|
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
|
fclose($fp);
|
|
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
|
exit;
|
|
}
|
|
|
|
$stmt="SELECT full_name from vicidial_users where user='$user';";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$row=mysql_fetch_row($rslt);
|
|
$full_name = $row[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|
|
<html>
|
|
<head>
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
|
<title>VICIDIAL ADMIN: User Stats
|
|
<?
|
|
|
|
|
|
##### BEGIN Set variables to make header show properly #####
|
|
$ADD = '3';
|
|
$hh = 'users';
|
|
$LOGast_admin_access = '1';
|
|
$ADMIN = 'admin.php';
|
|
$page_width='770';
|
|
$section_width='750';
|
|
$header_font_size='3';
|
|
$subheader_font_size='2';
|
|
$subcamp_font_size='2';
|
|
$header_selected_bold='<b>';
|
|
$header_nonselected_bold='';
|
|
$users_color = '#FFFF99';
|
|
$users_font = 'BLACK';
|
|
$users_color = '#E6E6E6';
|
|
$subcamp_color = '#C6C6C6';
|
|
##### END Set variables to make header show properly #####
|
|
|
|
require("admin_header.php");
|
|
|
|
|
|
|
|
?>
|
|
<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B> User Stats for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2> </TD></TR>
|
|
|
|
|
|
|
|
|
|
<?
|
|
|
|
echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B> \n";
|
|
|
|
echo "<form action=$PHP_SELF method=POST>\n";
|
|
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
|
echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10> to \n";
|
|
echo "<input type=text name=end_date value=\"$end_date\" size=10 maxsize=10> \n";
|
|
if (strlen($user)>1)
|
|
{echo "<input type=hidden name=user value=\"$user\">\n";}
|
|
else
|
|
{echo "<input type=text name=user size=12 maxlength=10>\n";}
|
|
echo "<input type=submit name=submit value=submit>\n";
|
|
|
|
|
|
echo " $user - $full_name<BR><BR>\n";
|
|
|
|
echo "<center>\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 " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">User multiple day status detail report</a>";
|
|
echo "</center>\n";
|
|
|
|
|
|
echo "</B></TD></TR>\n";
|
|
echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n";
|
|
|
|
echo "<br><center>\n";
|
|
|
|
##### vicidial agent talk time and status #####
|
|
|
|
echo "<B>VICIDIAL TALK TIME AND STATUS:</B>\n";
|
|
|
|
echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n";
|
|
echo "<tr><td><font size=2>STATUS</td><td align=right><font size=2>COUNT</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n";
|
|
|
|
$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$VLstatuses_to_print = mysql_num_rows($rslt);
|
|
$total_calls=0;
|
|
$o=0; $p=0;
|
|
while ($VLstatuses_to_print > $o)
|
|
{
|
|
$row=mysql_fetch_row($rslt);
|
|
$counts[$p] = $row[0];
|
|
$status[$p] = $row[1];
|
|
$call_sec[$p] = $row[2];
|
|
$p++;
|
|
$o++;
|
|
}
|
|
|
|
$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$VCLstatuses_to_print = mysql_num_rows($rslt);
|
|
$o=0;
|
|
while ($VCLstatuses_to_print > $o)
|
|
{
|
|
$status_match=0;
|
|
$r=0;
|
|
$row=mysql_fetch_row($rslt);
|
|
while ($VLstatuses_to_print > $r)
|
|
{
|
|
if ($status[$r] == $row[1])
|
|
{
|
|
$counts[$r] = ($counts[$r] + $row[0]);
|
|
$call_sec[$r] = ($call_sec[$r] + $row[2]);
|
|
$status_match++;
|
|
}
|
|
$r++;
|
|
}
|
|
if ($status_match < 1)
|
|
{
|
|
$counts[$p] = $row[0];
|
|
$status[$p] = $row[1];
|
|
$call_sec[$p] = $row[2];
|
|
$VLstatuses_to_print++;
|
|
$p++;
|
|
}
|
|
$o++;
|
|
}
|
|
|
|
$o=0;
|
|
$total_sec=0;
|
|
while ($o < $p)
|
|
{
|
|
if (eregi("1$|3$|5$|7$|9$", $o))
|
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
|
else
|
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
|
|
|
$call_seconds = $call_sec[$o];
|
|
$call_hours = ($call_seconds / 3600);
|
|
$call_hours_int = round($call_hours, 2);
|
|
$call_hours_int = intval("$call_hours_int");
|
|
$call_minutes = ($call_hours - $call_hours_int);
|
|
$call_minutes = ($call_minutes * 60);
|
|
$call_minutes_int = round($call_minutes, 0);
|
|
if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";}
|
|
|
|
echo "<tr $bgcolor><td><font size=2>$status[$o]</td>";
|
|
echo "<td align=right><font size=2> $counts[$o]</td>\n";
|
|
echo "<td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n";
|
|
$total_calls = ($total_calls + $counts[$o]);
|
|
$total_sec = ($total_sec + $call_sec[$o]);
|
|
$call_seconds=0;
|
|
$o++;
|
|
}
|
|
|
|
$call_seconds = $total_sec;
|
|
$call_hours = ($call_seconds / 3600);
|
|
$call_hours_int = round($call_hours, 2);
|
|
$call_hours_int = intval("$call_hours_int");
|
|
$call_minutes = ($call_hours - $call_hours_int);
|
|
$call_minutes = ($call_minutes * 60);
|
|
$call_minutes_int = round($call_minutes, 0);
|
|
if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";}
|
|
|
|
echo "<tr><td><font size=2>TOTAL CALLS </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n";
|
|
echo "</TABLE></center>\n";
|
|
|
|
|
|
##### Login and Logout time from vicidial agent interface #####
|
|
|
|
echo "<br><br>\n";
|
|
|
|
echo "<center>\n";
|
|
|
|
echo "<B>VICIDIAL AGENT LOGIN/LOGOUT TIME:</B>\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,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$events_to_print = mysql_num_rows($rslt);
|
|
|
|
$total_calls=0;
|
|
$o=0;
|
|
$event_start_seconds='';
|
|
$event_stop_seconds='';
|
|
while ($events_to_print > $o) {
|
|
$row=mysql_fetch_row($rslt);
|
|
if (eregi("LOGIN", $row[0]))
|
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
|
else
|
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
|
|
|
if (ereg("LOGIN", $row[0]))
|
|
{
|
|
$event_start_seconds = $row[1];
|
|
echo "<tr $bgcolor><td><font size=2>$row[0]</td>";
|
|
echo "<td align=right><font size=2> $row[2]</td>\n";
|
|
echo "<td align=right><font size=2> $row[3]</td>\n";
|
|
echo "<td align=right><font size=2> $row[4]</td>\n";
|
|
echo "<td align=right><font size=2> </td></tr>\n";
|
|
}
|
|
if (ereg("LOGOUT", $row[0]))
|
|
{
|
|
if ($event_start_seconds)
|
|
{
|
|
$event_stop_seconds = $row[1];
|
|
$event_seconds = ($event_stop_seconds - $event_start_seconds);
|
|
$total_login_time = ($total_login_time + $event_seconds);
|
|
$event_hours = ($event_seconds / 3600);
|
|
$event_hours_int = round($event_hours, 2);
|
|
$event_hours_int = intval("$event_hours_int");
|
|
$event_minutes = ($event_hours - $event_hours_int);
|
|
$event_minutes = ($event_minutes * 60);
|
|
$event_minutes_int = round($event_minutes, 0);
|
|
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
|
|
echo "<tr $bgcolor><td><font size=2>$row[0]</td>";
|
|
echo "<td align=right><font size=2> $row[2]</td>\n";
|
|
echo "<td align=right><font size=2> $row[3]</td>\n";
|
|
echo "<td align=right><font size=2> $row[4]</td>\n";
|
|
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n";
|
|
$event_start_seconds='';
|
|
$event_stop_seconds='';
|
|
}
|
|
else
|
|
{
|
|
echo "<tr $bgcolor><td><font size=2>$row[0]</td>";
|
|
echo "<td align=right><font size=2> $row[2]</td>\n";
|
|
echo "<td align=right><font size=2> $row[3]</td>\n";
|
|
echo "<td align=right><font size=2> </td></tr>\n";
|
|
}
|
|
}
|
|
|
|
$total_calls = ($total_calls + $row[0]);
|
|
|
|
$call_seconds=0;
|
|
$o++;
|
|
}
|
|
|
|
$total_login_hours = ($total_login_time / 3600);
|
|
$total_login_hours_int = round($total_login_hours, 2);
|
|
$total_login_hours_int = intval("$total_login_hours_int");
|
|
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
|
|
$total_login_minutes = ($total_login_minutes * 60);
|
|
$total_login_minutes_int = round($total_login_minutes, 0);
|
|
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
|
|
|
|
echo "<tr><td><font size=2>TOTAL</td>";
|
|
echo "<td align=right><font size=2> </td>\n";
|
|
echo "<td align=right><font size=2> </td>\n";
|
|
echo "<td align=right><font size=2> </td>\n";
|
|
echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int</td></tr>\n";
|
|
|
|
echo "</TABLE></center>\n";
|
|
|
|
|
|
|
|
|
|
|
|
##### vicidial_timeclock log records for user #####
|
|
|
|
$total_login_time=0;
|
|
$SQday_ARY = explode('-',$begin_date);
|
|
$EQday_ARY = explode('-',$end_date);
|
|
$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
|
|
$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
|
|
|
|
echo "<br><br>\n";
|
|
|
|
echo "<center>\n";
|
|
|
|
echo "<B>TIMECLOCK LOGIN/LOGOUT TIME:</B>\n";
|
|
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
|
|
echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</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,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';";
|
|
if ($DB>0) {echo "|$stmt|";}
|
|
$rslt=mysql_query($stmt, $link);
|
|
$events_to_print = mysql_num_rows($rslt);
|
|
|
|
$total_logs=0;
|
|
$o=0;
|
|
while ($events_to_print > $o) {
|
|
$row=mysql_fetch_row($rslt);
|
|
if ( ($row[0]=='START') or ($row[0]=='LOGIN') )
|
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
|
else
|
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
|
|
|
$TC_log_date = date("Y-m-d H:i:s", $row[1]);
|
|
|
|
$manager_edit='';
|
|
if (strlen($row[6])>0) {$manager_edit = ' * ';}
|
|
|
|
if (ereg("LOGIN", $row[0]))
|
|
{
|
|
$login_sec='';
|
|
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
|
echo "<td align=right><font size=2>$manager_edit</td>";
|
|
echo "<td align=right><font size=2>$row[0]</td>";
|
|
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
|
echo "<td align=right><font size=2> $row[4]</td>\n";
|
|
echo "<td align=right><font size=2> $row[2]</td>\n";
|
|
echo "<td align=right><font size=2> </td></tr>\n";
|
|
}
|
|
if (ereg("LOGOUT", $row[0]))
|
|
{
|
|
$login_sec = $row[3];
|
|
$total_login_time = ($total_login_time + $login_sec);
|
|
$event_hours = ($login_sec / 3600);
|
|
$event_hours_int = round($event_hours, 2);
|
|
$event_hours_int = intval("$event_hours_int");
|
|
$event_minutes = ($event_hours - $event_hours_int);
|
|
$event_minutes = ($event_minutes * 60);
|
|
$event_minutes_int = round($event_minutes, 0);
|
|
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
|
|
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
|
|
echo "<td align=right><font size=2>$manager_edit</td>";
|
|
echo "<td align=right><font size=2>$row[0]</td>";
|
|
echo "<td align=right><font size=2> $TC_log_date</td>\n";
|
|
echo "<td align=right><font size=2> $row[4]</td>\n";
|
|
echo "<td align=right><font size=2> $row[2]</td>\n";
|
|
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int";
|
|
if ($DB) {echo " - $total_login_time - $login_sec";}
|
|
echo "</td></tr>\n";
|
|
}
|
|
$o++;
|
|
}
|
|
if (strlen($login_sec)<1)
|
|
{
|
|
$login_sec = ($STARTtime - $row[1]);
|
|
$total_login_time = ($total_login_time + $login_sec);
|
|
if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";}
|
|
}
|
|
$total_login_hours = ($total_login_time / 3600);
|
|
$total_login_hours_int = round($total_login_hours, 2);
|
|
$total_login_hours_int = intval("$total_login_hours_int");
|
|
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
|
|
$total_login_minutes = ($total_login_minutes * 60);
|
|
$total_login_minutes_int = round($total_login_minutes, 0);
|
|
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
|
|
|
|
if ($DB) {echo " - $total_login_time - $login_sec";}
|
|
|
|
echo "<tr><td align=right><font size=2> </td>";
|
|
echo "<td align=right><font size=2> </td>\n";
|
|
echo "<td align=right><font size=2> </td>\n";
|
|
echo "<td align=right><font size=2> </td>\n";
|
|
echo "<td align=right><font size=2><font size=2>TOTAL </td>\n";
|
|
echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n";
|
|
|
|
echo "</TABLE></center>\n";
|
|
|
|
|
|
##### closer in-group selection logs #####
|
|
|
|
echo "<br><br>\n";
|
|
|
|
echo "<center>\n";
|
|
|
|
echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n";
|
|
echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n";
|
|
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAIGN</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td></tr>\n";
|
|
|
|
$stmt="select * from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$logs_to_print = mysql_num_rows($rslt);
|
|
|
|
$u=0;
|
|
while ($logs_to_print > $u) {
|
|
$row=mysql_fetch_row($rslt);
|
|
if (eregi("1$|3$|5$|7$|9$", $u))
|
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
|
else
|
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
|
|
|
$u++;
|
|
echo "<tr $bgcolor>";
|
|
echo "<td><font size=1>$u</td>";
|
|
echo "<td><font size=2>$row[2]</td>";
|
|
echo "<td align=left><font size=2> $row[1]</td>\n";
|
|
echo "<td align=left><font size=2> $row[3]</td>\n";
|
|
echo "<td align=left><font size=2> $row[4] </td>\n";
|
|
echo "</tr>\n";
|
|
|
|
}
|
|
|
|
|
|
echo "</TABLE><BR><BR>\n";
|
|
|
|
|
|
##### vicidial agent outbound calls for this time period #####
|
|
|
|
echo "<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
|
echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n";
|
|
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> 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><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
|
|
|
$stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$logs_to_print = mysql_num_rows($rslt);
|
|
|
|
$u=0;
|
|
while ($logs_to_print > $u) {
|
|
$row=mysql_fetch_row($rslt);
|
|
if (eregi("1$|3$|5$|7$|9$", $u))
|
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
|
else
|
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
|
|
|
$u++;
|
|
echo "<tr $bgcolor>";
|
|
echo "<td><font size=1>$u</td>";
|
|
echo "<td><font size=2>$row[4]</td>";
|
|
echo "<td align=left><font size=2> $row[7]</td>\n";
|
|
echo "<td align=left><font size=2> $row[8]</td>\n";
|
|
echo "<td align=left><font size=2> $row[10] </td>\n";
|
|
echo "<td align=right><font size=2> $row[3] </td>\n";
|
|
echo "<td align=right><font size=2> $row[14] </td>\n";
|
|
echo "<td align=right><font size=2> $row[2] </td>\n";
|
|
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n";
|
|
echo "<td align=right><font size=2> $row[15] </td></tr>\n";
|
|
|
|
}
|
|
|
|
|
|
echo "</TABLE><BR><BR>\n";
|
|
|
|
|
|
##### vicidial agent inbound calls for this time period #####
|
|
|
|
echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
|
echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n";
|
|
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
|
|
|
$stmt="select * from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$logs_to_print = mysql_num_rows($rslt);
|
|
|
|
$u=0;
|
|
while ($logs_to_print > $u) {
|
|
$row=mysql_fetch_row($rslt);
|
|
if (eregi("1$|3$|5$|7$|9$", $u))
|
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
|
else
|
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
|
|
|
$u++;
|
|
echo "<tr $bgcolor>";
|
|
echo "<td><font size=1>$u</td>";
|
|
echo "<td><font size=2>$row[4]</td>";
|
|
echo "<td align=left><font size=2> $row[7]</td>\n";
|
|
echo "<td align=left><font size=2> $row[8]</td>\n";
|
|
echo "<td align=left><font size=2> $row[10] </td>\n";
|
|
echo "<td align=right><font size=2> $row[3] </td>\n";
|
|
echo "<td align=right><font size=2> $row[14] </td>\n";
|
|
echo "<td align=right><font size=2> $row[2] </td>\n";
|
|
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n";
|
|
echo "<td align=right><font size=2> $row[17] </td></tr>\n";
|
|
|
|
}
|
|
|
|
|
|
echo "</TABLE></center><BR><BR>\n";
|
|
|
|
|
|
##### vicidial recordings for this time period #####
|
|
|
|
echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
|
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
|
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> RECID</td><td align=center><font size=2>FILENAME</td><td align=center><font size=2>LOCATION </td></tr>\n";
|
|
|
|
$stmt="select * from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$logs_to_print = mysql_num_rows($rslt);
|
|
|
|
$u=0;
|
|
while ($logs_to_print > $u)
|
|
{
|
|
$row=mysql_fetch_row($rslt);
|
|
if (eregi("1$|3$|5$|7$|9$", $u))
|
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
|
else
|
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
|
|
|
$location = $row[11];
|
|
|
|
if (strlen($location)>2)
|
|
{
|
|
$URLserver_ip = $location;
|
|
$URLserver_ip = eregi_replace('http://','',$URLserver_ip);
|
|
$URLserver_ip = eregi_replace('https://','',$URLserver_ip);
|
|
$URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip);
|
|
$stmt="select count(*) from servers where server_ip='$URLserver_ip';";
|
|
$rsltx=mysql_query($stmt, $link);
|
|
$rowx=mysql_fetch_row($rsltx);
|
|
|
|
if ($rowx[0] > 0)
|
|
{
|
|
$stmt="select recording_web_link,alt_server_ip from servers where server_ip='$URLserver_ip';";
|
|
$rsltx=mysql_query($stmt, $link);
|
|
$rowx=mysql_fetch_row($rsltx);
|
|
|
|
if (eregi("ALT_IP",$rowx[0]))
|
|
{
|
|
$location = eregi_replace($URLserver_ip, $rowx[1], $location);
|
|
}
|
|
}
|
|
}
|
|
|
|
if (strlen($location)>30)
|
|
{$locat = substr($location,0,27); $locat = "$locat...";}
|
|
else
|
|
{$locat = $location;}
|
|
if (eregi("http",$location))
|
|
{$location = "<a href=\"$location\">$locat</a>";}
|
|
else
|
|
{$location = $locat;}
|
|
$u++;
|
|
echo "<tr $bgcolor>";
|
|
echo "<td><font size=1>$u</td>";
|
|
echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>";
|
|
echo "<td align=left><font size=2> $row[4] </td>\n";
|
|
echo "<td align=left><font size=2> $row[8] </td>\n";
|
|
echo "<td align=left><font size=2> $row[0] </td>\n";
|
|
echo "<td align=center><font size=2> $row[10] </td>\n";
|
|
echo "<td align=right><font size=2> $location </td>\n";
|
|
echo "</tr>\n";
|
|
|
|
}
|
|
|
|
|
|
echo "</TABLE><BR><BR>\n";
|
|
|
|
|
|
##### vicidial agent outbound user manual calls for this time period #####
|
|
|
|
echo "<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
|
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
|
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td></tr>\n";
|
|
|
|
$stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
|
$rslt=mysql_query($stmt, $link);
|
|
$logs_to_print = mysql_num_rows($rslt);
|
|
|
|
$u=0;
|
|
while ($logs_to_print > $u) {
|
|
$row=mysql_fetch_row($rslt);
|
|
if (eregi("1$|3$|5$|7$|9$", $u))
|
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
|
else
|
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
|
|
|
$u++;
|
|
echo "<tr $bgcolor>";
|
|
echo "<td><font size=1>$u</td>";
|
|
echo "<td><font size=2>$row[0]</td>";
|
|
echo "<td align=left><font size=2> $row[1]</td>\n";
|
|
echo "<td align=left><font size=2> $row[2]</td>\n";
|
|
echo "<td align=left><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> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n";
|
|
echo "<td align=right><font size=2> $row[6] </td>\n";
|
|
echo "<td align=right><font size=2> $row[7] </td></tr>\n";
|
|
|
|
}
|
|
|
|
|
|
echo "</TABLE><BR><BR>\n";
|
|
|
|
|
|
|
|
$ENDtime = date("U");
|
|
|
|
$RUNtime = ($ENDtime - $STARTtime);
|
|
|
|
echo "\n\n\n<br><br><br>\n\n";
|
|
|
|
|
|
echo "<font size=0>\n\n\n<br><br><br>\nscript runtime: $RUNtime seconds</font>";
|
|
|
|
|
|
?>
|
|
|
|
|
|
</TD></TR><TABLE>
|
|
</body>
|
|
</html>
|
|
|
|
<?
|
|
|
|
exit;
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|