Moved Admmin HELP section to help.php

Several tweaks to the admin NANPA page
Added User selection to Agent Performance Detail report

git-svn-id: svn://192.168.202.10@2039 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2013-10-19 15:18:59 +00:00
parent e05bea9efa
commit 1a6e8005e9
17 changed files with 5029 additions and 4742 deletions
+2
View File
@@ -159,6 +159,8 @@ OTHER CHANGES:
22. Added Advanced lead tools management, access from the Admin Utilities page
23. Admin HELP text moved to separate help.php script
+9 -9
View File
@@ -206,7 +206,7 @@ $admDIR = "$HTTPprotocol$server_name$script_name";
$admDIR = preg_replace('/AST_admin_template_maker\.php/i', '',$admDIR);
$admDIR = "/vicidial/";
$admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
?>
@@ -389,10 +389,10 @@ if ($success_msg)
<tr valign="top">
<td align="left" width='50%'>
<form id="listloader_file_primer" action="leadloader_template_display.php?form_action=prime_file" method="post" enctype="multipart/form-data" target="file_holder">
<font class="standard">Sample file fitting template:<BR><font size="-2">(needed for field assignation)</font></font><?php echo "$NWB#vicidial_template_maker-create_template$NWE"; ?><BR><BR><input type=file name="sample_template_file" value="<?php echo $sample_template_file; ?>" onChange="loadIFrame('prime_file', this.value); this.form.submit();">
<font class="standard">Sample file fitting template:<BR><font size="-2">(needed for field assignation)</font></font><?php echo "$NWB#template_maker-create_template$NWE"; ?><BR><BR><input type=file name="sample_template_file" value="<?php echo $sample_template_file; ?>" onChange="loadIFrame('prime_file', this.value); this.form.submit();">
</form>
</td>
<td align="left" width='50%'><form action="<?php echo $PHP_SELF; ?>" method="post"><font class="standard">Select template to delete:</font><?php echo "$NWB#vicidial_template_maker-delete_template$NWE"; ?><BR><select name="template_id" onChange="loadIFrame('hide_new_template_form', '')">
<td align="left" width='50%'><form action="<?php echo $PHP_SELF; ?>" method="post"><font class="standard">Select template to delete:</font><?php echo "$NWB#template_maker-delete_template$NWE"; ?><BR><select name="template_id" onChange="loadIFrame('hide_new_template_form', '')">
<?php
$template_stmt="select template_id, template_name from vicidial_custom_leadloader_templates order by template_id asc";
$template_rslt=mysql_to_mysqli($template_stmt, $link);
@@ -424,15 +424,15 @@ if (mysqli_num_rows($template_rslt)>0) {
</tr>
<tr bgcolor="#D9E6FE">
<td align="right" width='25%'><font class="standard">Template ID:</font></td>
<td align="left" width='75%'><input type='text' name='template_id' size='15' maxlength='20'><?php echo "$NWB#vicidial_template_maker-template_id$NWE"; ?></td>
<td align="left" width='75%'><input type='text' name='template_id' size='15' maxlength='20'><?php echo "$NWB#template_maker-template_id$NWE"; ?></td>
</tr>
<tr bgcolor="#D9E6FE">
<td align="right" width='25%'><font class="standard">Template Name:</font></td>
<td align="left" width='75%'><input type='text' name='template_name' size='15' maxlength='30'><?php echo "$NWB#vicidial_template_maker-template_name$NWE"; ?></td>
<td align="left" width='75%'><input type='text' name='template_name' size='15' maxlength='30'><?php echo "$NWB#template_maker-template_name$NWE"; ?></td>
</tr>
<tr bgcolor="#D9E6FE">
<td align="right" width='25%'><font class="standard">Template Description:</font></td>
<td align="left" width='75%'><input type='text' name='template_description' size='50' maxlength='255'><?php echo "$NWB#vicidial_template_maker-template_description$NWE"; ?></td>
<td align="left" width='75%'><input type='text' name='template_description' size='50' maxlength='255'><?php echo "$NWB#template_maker-template_description$NWE"; ?></td>
</tr>
<tr bgcolor="#D9E6FE">
<td width='25%' align="right"><font class="standard">List ID template will load into:</font></td>
@@ -452,7 +452,7 @@ if (mysqli_num_rows($template_rslt)>0) {
$count++;
}
?>
</select></font><?php echo "$NWB#vicidial_template_maker-list_id$NWE"; ?>
</select></font><?php echo "$NWB#template_maker-list_id$NWE"; ?>
</td>
</tr>
<tr bgcolor="#D9E6FE">
@@ -474,7 +474,7 @@ if (mysqli_num_rows($template_rslt)>0) {
$count++;
}
?>
</select></font><?php echo "$NWB#vicidial_template_maker-list_id$NWE"; ?>
</select></font><?php echo "$NWB#template_maker-list_id$NWE"; ?>
</span>
</td>
</tr>
@@ -484,7 +484,7 @@ if (mysqli_num_rows($template_rslt)>0) {
<tr bgcolor="#D9E6FE"><td align="center" colspan=2>
<table border=0 cellpadding=3 cellspacing=1 width="100%" align="center">
<tr>
<th colspan="2" bgcolor="#330099"><font class="standard" color="white">Assign columns to file fields<BR/><font size='-2'>(selecting a different list will reset columns)</font></font><?php echo "$NWB#vicidial_template_maker-assign_columns$NWE"; ?></th>
<th colspan="2" bgcolor="#330099"><font class="standard" color="white">Assign columns to file fields<BR/><font size='-2'>(selecting a different list will reset columns)</font></font><?php echo "$NWB#template_maker-assign_columns$NWE"; ?></th>
</tr>
<tr valign="top">
<td border="1" align="center" bgcolor="#D9E6FE" width="50%"><font class="standard">Standard Field</font></td>
+40 -16
View File
@@ -38,6 +38,7 @@
# 130829-2012 - Changed to mysqli PHP functions
# 131002-2015 - Added user group to report output
# 131010-1930 - Expanded user group column, added most recent user group
# 131019-1111 - Added user select
#
$startMS = microtime();
@@ -308,9 +309,9 @@ $i=0;
while ($i < $users_to_print)
{
$row=mysqli_fetch_row($rslt);
$users[$i]=$row[0];
$user_list[$i]=$row[0];
$user_names[$i]=$row[1];
if ($all_users) {$user[$i]=$row[0];}
if ($all_users) {$user_list[$i]=$row[0];}
$i++;
}
@@ -355,13 +356,31 @@ else
$user_group_SQL = "and vicidial_users.user_group IN($user_group_SQL)";
}
$i=0;
$user_string='|';
$user_ct = count($users);
while($i < $user_ct)
{
$user_string .= "$users[$i]|";
$user_SQL .= "'$users[$i]',";
$userQS .= "&users[]=$users[$i]";
$i++;
}
if ( (preg_match('/\-\-ALL\-\-/',$user_string) ) or ($user_ct < 1) )
{$user_SQL = "";}
else
{
$user_SQL = preg_replace('/,$/i', '',$user_SQL);
$user_agent_log_SQL = "and vicidial_agent_log.user IN($user_SQL)";
$user_SQL = "and vicidial_users.user IN($user_SQL)";
}
if ($DB) {$HTML_text.="$user_group_string|$user_group_ct|$user_groupQS|$i<BR>";}
$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date$groupQS$user_groupQS&shift=$shift&DB=$DB";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('/vicidial/admin.php?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
$HTML_head.="<HTML>\n";
@@ -461,8 +480,8 @@ else
$o=0;
while ($users_to_print > $o)
{
if (preg_match("/$users[$o]\|/i",$users_string)) {$HTML_text.="<option selected value=\"$users[$o]\">$users[$o] - $user_names[$o]</option>\n";}
else {$HTML_text.="<option value=\"$users[$o]\">$users[$o] - $user_names[$o]</option>\n";}
if (preg_match("/$user_list[$o]\|/i",$users_string)) {$HTML_text.="<option selected value=\"$user_list[$o]\">$user_list[$o] - $user_names[$o]</option>\n";}
else {$HTML_text.="<option value=\"$user_list[$o]\">$user_list[$o] - $user_names[$o]</option>\n";}
$o++;
}
$HTML_text.="</SELECT>\n";
@@ -549,14 +568,19 @@ $usersARY[0]='';
$user_namesARY[0]='';
$k=0;
$recent_UG_stmt="select max(event_time), user, user_group from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL group by user";
$recent_UG_stmt="select max(agent_log_id), user from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL $user_agent_log_SQL group by user";
if ($DB) {$HTML_text.="$recent_UG_stmt\n";}
$recent_UG_rslt=mysql_to_mysqli($recent_UG_stmt, $link);
while ($UG_row=mysqli_fetch_row($recent_UG_rslt)) {
$recent_user_groups[$UG_row[1]]=$UG_row[2];
$agent_log_id=$UG_row[0];
$al_stmt="select user_group from vicidial_agent_log where agent_log_id='$agent_log_id'";
if ($DB) {$HTML_text.="$al_stmt\n";}
$al_rslt=mysql_to_mysqli($al_stmt, $link);
$Ugrp_row=mysqli_fetch_row($al_rslt);
$recent_user_groups[$UG_row[1]]=$Ugrp_row[0];
}
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec), vicidial_users.user_group 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 pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL group by user,full_name,user_group,status order by full_name,user,status desc limit 500000;";
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec), vicidial_users.user_group 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 pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL $user_SQL group by user,full_name,user_group,status order by full_name,user,status desc limit 500000;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$HTML_text.="$stmt\n";}
$rows_to_print = mysqli_num_rows($rslt);
@@ -657,13 +681,13 @@ while ($m < $k)
$Suser=$usersARY[$m];
$Slast_user_group=$recent_user_groups[$Suser];
$recent_UG_stmt="select max(event_time) as most_recent_event, user_group from vicidial_agent_log where user='$Suser' and event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL group by user_group order by most_recent_event desc limit 1";
if ($DB) {$HTML_text.="$recent_UG_stmt\n";}
$recent_UG_rslt=mysql_to_mysqli($recent_UG_stmt, $link);
while ($UG_row=mysqli_fetch_row($recent_UG_rslt)) {
$Slast_user_group=$UG_row[1];
$recent_user_groups[$Suser]=$UG_row[1];
}
# $recent_UG_stmt="select max(event_time) as most_recent_event, user_group from vicidial_agent_log where user='$Suser' and event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL group by user_group order by most_recent_event desc limit 1";
# if ($DB) {$HTML_text.="$recent_UG_stmt\n";}
# $recent_UG_rslt=mysql_to_mysqli($recent_UG_stmt, $link);
# while ($UG_row=mysqli_fetch_row($recent_UG_rslt)) {
# $Slast_user_group=$UG_row[1];
# $recent_user_groups[$Suser]=$UG_row[1];
# }
$Sfull_name=$user_namesARY[$m];
$Suser_group=$user_groupsARY[$m];
@@ -1153,7 +1177,7 @@ $TOTAL_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL </th></tr>";
$NONPAUSE_graph=$graph_header."<th class='thgraph' scope='col'>NONPAUSE</th></tr>";
$PAUSE_graph=$graph_header."<th class='thgraph' scope='col'>PAUSE</th></tr>";
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec), vicidial_users.user_group 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 pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec), vicidial_users.user_group 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 pause_sec<65000 $group_SQL $user_group_SQL $user_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$ASCII_text.="$stmt\n";}
$subs_to_print = mysqli_num_rows($rslt);
@@ -56,6 +56,8 @@ 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["users"])) {$users=$_GET["users"];}
elseif (isset($_POST["users"])) {$users=$_POST["users"];}
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
@@ -258,6 +260,15 @@ while($i < $group_ct)
$i++;
}
$i=0;
$users_string='|';
$users_ct = count($users);
while($i < $users_ct)
{
$users_string .= "$users[$i]|";
$i++;
}
$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$HTML_text.="$stmt\n";}
@@ -289,6 +300,21 @@ while ($i < $user_groups_to_print)
$i++;
}
$stmt="select user, full_name from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$HTML_text.="$stmt\n";}
$users_to_print = mysqli_num_rows($rslt);
$i=0;
while ($i < $users_to_print)
{
$row=mysqli_fetch_row($rslt);
$user_list[$i]=$row[0];
$user_names[$i]=$row[1];
if ($all_users) {$user_list[$i]=$row[0];}
$i++;
}
$i=0;
$group_string='|';
$group_ct = count($group);
@@ -329,11 +355,31 @@ else
$user_group_SQL = "and vicidial_users.user_group IN($user_group_SQL)";
}
$i=0;
$user_string='|';
$user_ct = count($users);
while($i < $user_ct)
{
$user_string .= "$users[$i]|";
$user_SQL .= "'$users[$i]',";
$userQS .= "&users[]=$users[$i]";
$i++;
}
if ( (preg_match('/\-\-ALL\-\-/',$user_string) ) or ($user_ct < 1) )
{$user_SQL = "";}
else
{
$user_SQL = preg_replace('/,$/i', '',$user_SQL);
$user_agent_log_SQL = "and vicidial_agent_log.user IN($user_SQL)";
$user_SQL = "and vicidial_users.user IN($user_SQL)";
}
if ($DB) {$HTML_text.="$user_group_string|$user_group_ct|$user_groupQS|$i<BR>";}
$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date$groupQS$user_groupQS&shift=$shift&DB=$DB";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('/vicidial/admin.php?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
$HTML_head.="<HTML>\n";
@@ -423,6 +469,21 @@ while ($user_groups_to_print > $o)
$o++;
}
$HTML_text.="</SELECT>\n";
$HTML_text.="</TD><TD VALIGN=TOP>Users: <BR>";
$HTML_text.="<SELECT SIZE=5 NAME=users[] multiple>\n";
if (preg_match('/\-\-ALL\-\-/',$users_string))
{$HTML_text.="<option value=\"--ALL--\" selected>-- ALL USERS --</option>\n";}
else
{$HTML_text.="<option value=\"--ALL--\">-- ALL USERS --</option>\n";}
$o=0;
while ($users_to_print > $o)
{
if (preg_match("/$user_list[$o]\|/i",$users_string)) {$HTML_text.="<option selected value=\"$user_list[$o]\">$user_list[$o] - $user_names[$o]</option>\n";}
else {$HTML_text.="<option value=\"$user_list[$o]\">$user_list[$o] - $user_names[$o]</option>\n";}
$o++;
}
$HTML_text.="</SELECT>\n";
$HTML_text.="</TD><TD VALIGN=TOP>Shift:<BR>";
$HTML_text.="<SELECT SIZE=1 NAME=shift>\n";
$HTML_text.="<option selected value=\"$shift\">$shift</option>\n";
@@ -522,14 +583,19 @@ $usersARY[0]='';
$user_namesARY[0]='';
$k=0;
$recent_UG_stmt="select max(event_time), user, user_group from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL group by user";
$recent_UG_stmt="select max(agent_log_id), user from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL $user_agent_log_SQL group by user";
if ($DB) {$HTML_text.="$recent_UG_stmt\n";}
$recent_UG_rslt=mysql_to_mysqli($recent_UG_stmt, $link);
while ($UG_row=mysqli_fetch_row($recent_UG_rslt)) {
$recent_user_groups[$UG_row[1]]=$UG_row[2];
$agent_log_id=$UG_row[0];
$al_stmt="select user_group from vicidial_agent_log where agent_log_id='$agent_log_id'";
if ($DB) {$HTML_text.="$al_stmt\n";}
$al_rslt=mysql_to_mysqli($al_stmt, $link);
$Ugrp_row=mysqli_fetch_row($al_rslt);
$recent_user_groups[$UG_row[1]]=$Ugrp_row[0];
}
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec), vicidial_users.user_group 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 pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL group by user,full_name,user_group,status order by full_name,user,status desc limit 500000;";
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec), vicidial_users.user_group 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 pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_SQL $user_SQL group by user,full_name,user_group,status order by full_name,user,status desc limit 500000;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$HTML_text.="$stmt\n";}
$rows_to_print = mysqli_num_rows($rslt);
@@ -585,7 +651,7 @@ while ($i < $rows_to_print)
$user_group[$i] = $row[9];
$customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]);
if (preg_match("/\|$row[7]\|/i", $sale_pattern_match)) {
if (preg_match("/\|$status[$i]\|/i", $sale_pattern_match)) {
$sale_counts[$row[3]]+=$row[0];
}
@@ -596,15 +662,18 @@ while ($i < $rows_to_print)
{$customer_sec[$i]=0;}
if ( (!preg_match("/\-$status[$i]\-/i", $statuses)) and (strlen($status[$i])>0) )
{
$statusesTXT = sprintf("%8s", $status[$i]);
$statusesHEAD .= "----------+";
$statusesHTML .= " $statusesTXT |";
if (preg_match("/\|$status[$i]\|/i", $sale_pattern_match))
{
$statusesTXT = sprintf("%8s", $status[$i]);
$statusesHEAD .= "----------+";
$statusesHTML .= " $statusesTXT |";
$CSV_header.=",\"$status[$i]\"";
$CSV_header.=",\"$status[$i]\"";
}
$statuses .= "$status[$i]-";
$statusesARY[$j] = $status[$i];
$j++;
$statuses .= "$status[$i]-";
$statusesARY[$j] = $status[$i];
$j++;
}
if (!preg_match("/\-$user[$i]\-/i", $users))
{
@@ -634,13 +703,13 @@ while ($m < $k)
$Suser=$usersARY[$m];
$Slast_user_group=$recent_user_groups[$Suser];
$recent_UG_stmt="select max(event_time) as most_recent_event, user_group from vicidial_agent_log where user='$Suser' and event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL group by user_group order by most_recent_event desc limit 1";
if ($DB) {$HTML_text.="$recent_UG_stmt\n";}
$recent_UG_rslt=mysql_to_mysqli($recent_UG_stmt, $link);
while ($UG_row=mysqli_fetch_row($recent_UG_rslt)) {
$Slast_user_group=$UG_row[1];
$recent_user_groups[$Suser]=$UG_row[1];
}
# $recent_UG_stmt="select max(event_time) as most_recent_event, user_group from vicidial_agent_log where user='$Suser' and event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL group by user_group order by most_recent_event desc limit 1";
# if ($DB) {$HTML_text.="$recent_UG_stmt\n";}
# $recent_UG_rslt=mysql_to_mysqli($recent_UG_stmt, $link);
# while ($UG_row=mysqli_fetch_row($recent_UG_rslt)) {
# $Slast_user_group=$UG_row[1];
# $recent_user_groups[$Suser]=$UG_row[1];
# }
$Sfull_name=$user_namesARY[$m];
$Suser_group=$user_groupsARY[$m];
@@ -680,19 +749,23 @@ while ($m < $k)
$Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]);
$Sdead_sec = ($Sdead_sec + $dead_sec[$i]);
$Scustomer_sec = ($Scustomer_sec + $customer_sec[$i]);
$SstatusTXT = sprintf("%8s", $calls[$i]);
$SstatusesHTML .= " $SstatusTXT |";
if (preg_match("/\|$Sstatus\|/i", $sale_pattern_match))
{
$SstatusTXT = sprintf("%8s", $calls[$i]);
$SstatusesHTML .= " $SstatusTXT |";
$CSVstatuses.=",\"$calls[$i]\"";
}
if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];}
$graph_stats[$m][(15+$n)]=($calls[$i]+0);
$CSVstatuses.=",\"$calls[$i]\"";
$status_found++;
}
$i++;
}
if ($status_found < 1)
if ($status_found < 1 and preg_match("/\|$Sstatus\|/i", $sale_pattern_match))
{
$SstatusesHTML .= " 0 |";
$CSVstatuses.=",\"0\"";
@@ -887,17 +960,20 @@ while ($n < $j)
$i++;
}
### END loop through each stat line ###
if ($status_found < 1)
if (preg_match("/\|$Sstatus\|/i", $sale_pattern_match))
{
$SUMstatusesHTML .= " 0 |";
$$total_var=0;
}
else
{
$SUMstatusTXT = sprintf("%8s", $Scalls);
$SUMstatusesHTML .= " $SUMstatusTXT |";
$CSVSUMstatuses.=",\"$Scalls\"";
$$total_var=$Scalls;
if ($status_found < 1)
{
$SUMstatusesHTML .= " 0 |";
$$total_var=0;
}
else
{
$SUMstatusTXT = sprintf("%8s", $Scalls);
$SUMstatusesHTML .= " $SUMstatusTXT |";
$CSVSUMstatuses.=",\"$Scalls\"";
$$total_var=$Scalls;
}
}
$n++;
}
@@ -1070,7 +1146,7 @@ $GRAPH3="<tr><td colspan='".(14+count($statusesARY))."' class='graph_span_cell'>
$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3;
$CSV_total=preg_replace('/\s/', '', "\"\",\"\",\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses");
$CSV_total=preg_replace('/\s/', '', "\"\",\"\",\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$STOTsales_per_call\",\"$STOTsales_per_hour\",\"$Sgrand_total_sales\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses");
if ($file_download == 1)
{
@@ -1146,7 +1222,7 @@ $TOTAL_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL </th></tr>";
$NONPAUSE_graph=$graph_header."<th class='thgraph' scope='col'>NONPAUSE</th></tr>";
$PAUSE_graph=$graph_header."<th class='thgraph' scope='col'>PAUSE</th></tr>";
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec), vicidial_users.user_group 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 pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec), vicidial_users.user_group 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 pause_sec<65000 $group_SQL $user_group_SQL $user_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$ASCII_text.="$stmt\n";}
$subs_to_print = mysqli_num_rows($rslt);
+2 -2
View File
@@ -891,7 +891,7 @@ else
echo $ASCII_text;
}
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('/vicidial/admin.php?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
@@ -1038,4 +1038,4 @@ $rslt=mysql_to_mysqli($stmt, $link);
?>
</BODY></HTML>
</BODY></HTML>
+1 -1
View File
@@ -1305,7 +1305,7 @@ if ($file_download > 0)
exit;
}
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('/vicidial/admin.php?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
############################################################################
+3 -3
View File
@@ -137,12 +137,12 @@ for ($i=0; $i<$oc_ct; $i++)
$oc_SQL=substr($oc_SQL, 0, -1);
if (!$show_history) {
$process_stmt="select * from vicidial_nanpa_filter_log where output_code in ($oc_SQL) and status!='COMPLETED'";
$process_stmt="SELECT output_code,status,server_ip,list_id,start_time,update_time,user,leads_count,filter_count,status_line,script_output from vicidial_nanpa_filter_log where output_code in ($oc_SQL) and status!='COMPLETED'";
$process_rslt=mysqli_query($link, $process_stmt);
$report_title="Currently running NANPA scrubs";
} else {
if (!$process_limit) {$process_limit=10;}
$process_stmt="SELECT * from vicidial_nanpa_filter_log where user='$PHP_AUTH_USER' and status='COMPLETED' order by start_time desc limit $process_limit";
$process_stmt="SELECT output_code,status,server_ip,list_id,start_time,update_time,user,leads_count,filter_count,status_line,script_output from vicidial_nanpa_filter_log where user='$PHP_AUTH_USER' and status='COMPLETED' order by start_time desc limit $process_limit";
$process_rslt=mysqli_query($link, $process_stmt);
$report_title="Past NANPA scrubs for user $PHP_AUTH_USER";
@@ -178,7 +178,7 @@ if (mysqli_num_rows($process_rslt)>0) {
echo "<td align='left' bgcolor='$bgcolor' width='100'><FONT FACE=\"ARIAL,HELVETICA\" COLOR='#000000' size='1'>$row[update_time]</th>";
echo "<td align='left' bgcolor='$bgcolor' width='80'><FONT FACE=\"ARIAL,HELVETICA\" COLOR='#000000' size='1'>$row[leads_count]</th>";
echo "<td align='left' bgcolor='$bgcolor' width='80'><FONT FACE=\"ARIAL,HELVETICA\" COLOR='#000000' size='1'>$row[filter_count]</th>";
echo "<td align='left' bgcolor='$bgcolor' width='180'><FONT FACE=\"ARIAL,HELVETICA\" COLOR='#000000' size='1'>$row[status_line]</th>";
echo "<td align='left' bgcolor='$bgcolor' width='180'><FONT FACE=\"ARIAL,HELVETICA\" COLOR='#000000' size='1'>List: $row[list_id]\n<BR>$row[status_line]</th>";
echo "<td align='left' bgcolor='$bgcolor' width='170'><FONT FACE=\"ARIAL,HELVETICA\" COLOR='#000000' size='1'>$row[script_output]</th>";
echo "</tr>";
}
+10 -4661
View File
File diff suppressed because it is too large Load Diff
+19 -6
View File
@@ -9,10 +9,11 @@
# CHANGELOG:
# 130919-1503 - First build of script
# 131005-2035 - Added exclusion options
# 131019-1112 - Added help text and several small tweaks
#
$version = '2.8-2';
$build = '131005-2035';
$version = '2.8-3';
$build = '131019-1112';
$startMS = microtime();
require("dbconnect_mysqli.php");
@@ -318,17 +319,26 @@ function ShowPastProcesses(limit) {
}
}
}
function openNewWindow(url)
{
window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes');
}
</script>
<?php
echo "</head>\n";
$ADMIN=$PHP_SELF;
$short_header=1;
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
echo "\n<BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onLoad='RefreshNANPA(\"$iframe_url\"); StartRefresh()'>\n";
require("admin_header.php");
echo "<form action='$PHP_SELF' method='get' enctype='multipart/form-data'>";
echo "<BR> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF\">CLICK HERE TO REFRESH THE PAGE</a>\n";
echo "<BR> <table align=left width='770' border=1 cellpadding=0 cellspacing=0 bgcolor=#D9E6FE>";
if (mysqli_num_rows($schedule_rslt)>0 || (mysqli_num_rows($running_rslt)>0)) {
@@ -336,7 +346,7 @@ if (mysqli_num_rows($schedule_rslt)>0 || (mysqli_num_rows($running_rslt)>0)) {
if (mysqli_num_rows($schedule_rslt)>0) {
echo "<tr><td>";
echo "<table width='770' cellpadding=5 cellspacing=0>";
echo "<tr><th colspan='5' bgcolor='#015B91'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2>Your scheduled NANPA scrubs</th></tr>";
echo "<tr><th colspan='5' bgcolor='#015B91'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2>Your scheduled NANPA scrubs &nbsp; $NWB#nanpa-running$NWE</th></tr>";
echo "<tr>";
echo "<td align='left' bgcolor='#015B91' width='150'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2>Date/time</th>";
echo "<td align='left' bgcolor='#015B91' width='300'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2>Lists</th>";
@@ -420,7 +430,7 @@ else
echo "<tr><td>";
echo "<table width='770' cellpadding=5 cellspacing=0>";
echo "<tr><th colspan='5' bgcolor='#015B91'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2>NANPA scrub scheduler</th></tr>";
echo "<tr><th colspan='5' bgcolor='#015B91'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE SIZE=2>NANPA scrub scheduler &nbsp; $NWB#nanpa-settings$NWE</th></tr>";
echo "<tr>";
echo "<td align='left' valign='top' rowspan='4'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inactive lists:<BR/>\n";
@@ -443,7 +453,10 @@ else
while ($fieldinfo=mysqli_fetch_field($rslt))
{
$fieldname=$fieldinfo->name;
echo "<option value='$fieldname'>$fieldname</option>\n";
if (!preg_match("/lead_id|list_id|status|gmt_offset_now|entry_date|modify_date|gender|entry_list_id|date_of_birth|called_since_last_reset|called_count/",$fieldname))
{
echo "<option value='$fieldname'>$fieldname</option>\n";
}
}
echo "</select></font></td>";
@@ -498,7 +511,7 @@ else
echo "<tr><td>";
echo "<table width='770' cellpadding=0 cellspacing=0 bgcolor='#FFFFFF'>";
echo "<tr><td align='center'>";
echo "<span id='past_NANPA_scrubs'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=1><a name='past_scrubs' href='#past_scrubs' onClick='ShowPastProcesses(10)'>View past scrubs</font></span>";
echo "<span id='past_NANPA_scrubs'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=1><a name='past_scrubs' href='#past_scrubs' onClick='ShowPastProcesses(10)'>View past scrubs &nbsp; $NWB#nanpa-log$NWE</font></span>";
echo "</td></tr>";
echo "</table>";
echo "</td></tr>";
+1 -1
View File
@@ -295,7 +295,7 @@ if ($SSemail_enabled < 1)
}
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('admin.php?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
+1 -1
View File
@@ -276,7 +276,7 @@ $admDIR = "$HTTPprotocol$server_name$script_name";
$admDIR = preg_replace('/admin_listloader_fourth_gen\.php/i', '',$admDIR);
$admDIR = "/vicidial/";
$admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
$secX = date("U");
+1 -1
View File
@@ -263,7 +263,7 @@ if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
$admDIR = "$HTTPprotocol$server_name$script_name";
$admDIR = preg_replace('/admin_listloader_third_gen\.php/i', '',$admDIR);
$admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
$secX = date("U");
+1 -1
View File
@@ -370,7 +370,7 @@ if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
$admDIR = "$HTTPprotocol$server_name:$server_port$script_name";
$admDIR = preg_replace('/audio_store\.php/i', '',$admDIR);
$admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
$secX = date("U");
+1 -1
View File
@@ -302,7 +302,7 @@ if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
$admDIR = "$HTTPprotocol$server_name:$server_port$script_name";
$admDIR = preg_replace('/callcard_admin\.php/i', '',$admDIR);
$admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
$secX = date("U");
+1 -1
View File
@@ -232,7 +232,7 @@ function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$met
$link_text='';
$max_count=0;
$i=0;
$NWB = "$download_link &nbsp; <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999";
$NWB = "$download_link &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -192,7 +192,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integrati
echo "$users_list";
echo "</select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Update List Owner: </td><td align=left><select size=1 name=vl_owner>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n";
echo "<option SELECTED>YES</option>\n";
echo "<option>NO</option>\n";
echo "</select></td></tr>\n";
@@ -349,7 +349,7 @@ if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
$admDIR = "$HTTPprotocol$server_name:$server_port$script_name";
$admDIR = preg_replace('/user_territories\.php/i', '',$admDIR);
$admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
$secX = date("U");
@@ -404,7 +404,7 @@ if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0)
echo "$users_list";
echo "</select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Update List Owner: </td><td align=left><select size=1 name=vl_owner>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n";
echo "<option SELECTED>YES</option>\n";
echo "<option>NO</option>\n";
echo "</select></td></tr>\n";