Added Reset Lead-Called-Status for Campaigns page to Admin Utilities
Added System Summary screen as default admin.php screen instead of User List git-svn-id: svn://192.168.202.10@2000 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -102,11 +102,15 @@ OTHER CHANGES:
|
||||
exten => _598600XXX,1,Dial(${TRUNKblind}/57${EXTEN:2},55)
|
||||
exten => _598600XXX,n,Hangup()
|
||||
|
||||
9. Added Reset Lead-Called-Status for Campaigns page to Admin Utilities
|
||||
|
||||
10. Added System Summary screen as default admin.php screen instead of User List
|
||||
|
||||
|
||||
|
||||
|
||||
########## UPGRADING FROM 2.4 TO 2.6 ##########
|
||||
|
||||
########## UPGRADING FROM 2.4 TO 2.6 (2.7 release branch) ##########
|
||||
|
||||
OPTIONAL STEPS(But highly recommended) - Backup existing system:
|
||||
|
||||
|
||||
@@ -205,6 +205,23 @@ This is the action that will be taken when a new email is found in the account.
|
||||
The custom template maker allows you to define your own file layouts for use with the list loader and also delete them, if necessary. If you frequently upload files that are in a consistent layout other than the standard layout, you may find this tool helpful. The saved layout will work on any uploaded file it matches, regardless of file type or delimiter||
|
||||
Once you have loaded a sample lead file matching the layout you want to make into a template and select a list ID to load leads into, all of the available columns from the list table and the custom table for the list you selected (if any) will be displayed here. Columns highlighted in blue are standard columns from the list table. Columns highlighted in pink belong to the custom table for the selected list. Each column listed has a drop-down menu, which should be populated with the fields from the first row of the sample lead file you uploaded. Assign the appropriate fields to the appropriate columns and press SUBMIT TEMPLATE to create your template. You do not need to assign every field to a column, and you do not need to assign every column a field. For details on the standard list columns, click||
|
||||
The Quality Control - QC function has its own set of status codes separate from those within the call handling functions of the system. QC status codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length. For these functions to work, you must have QC enabled in the System Settings||
|
||||
SYSTEM SNAPSHOT STATS||
|
||||
Reset Lead-Called-Status for Campaigns||
|
||||
Total Stats for Today||
|
||||
Total Stats for Yesterday||
|
||||
Total Calls||
|
||||
Total Inbound Calls||
|
||||
Total Outbound Calls||
|
||||
Maximum Agents||
|
||||
System Summary||
|
||||
Agents Logged In||
|
||||
Agents In Calls||
|
||||
Active Calls||
|
||||
Calls Ringing||
|
||||
Records ||
|
||||
Active ||
|
||||
Inactive ||
|
||||
Total ||
|
||||
|
||||
|
||||
########################## CHANGES TO EXISTING PHRASES IN ADMIN TRANSLATION
|
||||
|
||||
+197
-5
@@ -3220,12 +3220,13 @@ else
|
||||
# 130615-2124 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
|
||||
# 130627-0745 - Added url log, lagged log and user group login reports to admin utilities page
|
||||
# 130709-1350 - Changes for encrypted password compatibility, added Dial Log Report
|
||||
# 130711-2208 - Added SYSTEM SNAPSHOT STATS as new welcome screen, and added new
|
||||
#
|
||||
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
|
||||
|
||||
$admin_version = '2.8-407a';
|
||||
$build = '130709-1350';
|
||||
$admin_version = '2.8-408a';
|
||||
$build = '130711-2208';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -3619,8 +3620,8 @@ if ( ($SSadmin_modify_refresh > 1) and (preg_match("/^3/",$ADD)) )
|
||||
echo "<title>ADMINISTRATION: ";
|
||||
|
||||
### set the default screen to the user list
|
||||
if ( (!isset($ADD)) or (strlen($ADD)<1) ) {$ADD="0A";}
|
||||
if ($ADD=='0') {$ADD="0A";}
|
||||
if ( (!isset($ADD)) or (strlen($ADD)<1) ) {$ADD="999990";}
|
||||
if ($ADD=='0') {$ADD="999990";}
|
||||
|
||||
### set the sections and headers
|
||||
if ($ADD=="1") {$hh='users'; echo "Add New User";}
|
||||
@@ -3961,6 +3962,7 @@ if ($ADD==999994) {$hh='reports'; echo "ADMIN UTILITIES";}
|
||||
if ($ADD==999993) {$hh='reports'; echo "SUMMARY STATS";}
|
||||
if ($ADD==999992) {$hh='reports'; echo "SYSTEM SUMMARY STATS";}
|
||||
if ($ADD==999991) {$hh='reports'; echo "SERVERS VERSIONS";}
|
||||
if ($ADD==999990) {$hh='reports'; echo "SYSTEM SNAPSHOT STATS";}
|
||||
|
||||
if ( ($ADD==999993) or ($ADD==999992) or ($ADD==730000000000000) or ($ADD==830000000000000) )
|
||||
{
|
||||
@@ -17076,7 +17078,7 @@ if ($ADD==411)
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
$SQL_log = "$stmtB|";
|
||||
$SQL_log = preg_replace('/;/', '', $SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';";
|
||||
@@ -36287,6 +36289,7 @@ if ($ADD==999994)
|
||||
echo "<BR><BR>\n";
|
||||
echo "<LI><a href=\"admin_phones_bulk_insert.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Bulk Phone Insert Page</a></FONT>\n";
|
||||
echo "<LI><a href=\"lead_tools.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Basic Lead Management Tools</a></FONT>\n";
|
||||
echo "<LI><a href=\"reset_campaign_lists.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Reset Campaign Lists</a></FONT>\n";
|
||||
echo "<LI><a href=\"callbacks_bulk_change.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Callbacks Transferral Page</a></FONT>\n";
|
||||
echo "<LI><a href=\"send_CID_call.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Send a Call With Custom CID Page</a></FONT>\n";
|
||||
echo "<LI><a href=\"voice_lab.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Speech Voice Lab Page</a></FONT>\n";
|
||||
@@ -36496,6 +36499,195 @@ if ($ADD==999992)
|
||||
}
|
||||
##### END max system stats report #####
|
||||
|
||||
######################
|
||||
# ADD=999990 - new main landing page with system stats
|
||||
######################
|
||||
if ($ADD==999990)
|
||||
{
|
||||
$section_width=640;
|
||||
echo "<BR><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
echo "<center><TABLE width=$section_width cellspacing=2>\n";
|
||||
echo "<tr>";
|
||||
echo "<td align='left' colspan='4'>System Summary:</td>";
|
||||
echo "</tr>";
|
||||
|
||||
$stmt="select closer_campaigns from vicidial_campaigns;";
|
||||
$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 (call_type='OUT') );";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$active_calls=mysql_num_rows($rslt);
|
||||
$ringing_calls=0;
|
||||
if ($active_calls>0) {
|
||||
while ($row=mysql_fetch_row($rslt)) {
|
||||
if (!preg_match("/LIVE|CLOSER/i",$row[0]))
|
||||
{$ringing_calls++;}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$active_stmt="select active from vicidial_users";
|
||||
$active_rslt=mysql_query($active_stmt, $link);
|
||||
while ($active_row=mysql_fetch_array($active_rslt)) {
|
||||
$users[$active_row["active"]]++;
|
||||
}
|
||||
|
||||
$active_stmt="select active from vicidial_campaigns";
|
||||
$active_rslt=mysql_query($active_stmt, $link);
|
||||
while ($active_row=mysql_fetch_array($active_rslt)) {
|
||||
$campaigns[$active_row["active"]]++;
|
||||
}
|
||||
|
||||
$active_stmt="select active from vicidial_lists";
|
||||
$active_rslt=mysql_query($active_stmt, $link);
|
||||
while ($active_row=mysql_fetch_array($active_rslt)) {
|
||||
$lists[$active_row["active"]]++;
|
||||
}
|
||||
|
||||
$active_stmt="select did_active from vicidial_inbound_dids";
|
||||
$active_rslt=mysql_query($active_stmt, $link);
|
||||
while ($active_row=mysql_fetch_array($active_rslt)) {
|
||||
$dids[$active_row["did_active"]]++;
|
||||
}
|
||||
|
||||
$active_stmt="select active from vicidial_inbound_groups";
|
||||
$active_rslt=mysql_query($active_stmt, $link);
|
||||
while ($active_row=mysql_fetch_array($active_rslt)) {
|
||||
$ingroups[$active_row["active"]]++;
|
||||
}
|
||||
|
||||
$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$agent_incall=0; $agent_total=0;
|
||||
while($row=mysql_fetch_array($rslt)) {
|
||||
$status=$row[3];
|
||||
$agent_total++;
|
||||
if ( (preg_match("/INCALL/i",$status)) or (preg_match("/QUEUE/i",$status)) ) {$agent_incall++; }
|
||||
}
|
||||
echo "<tr bgcolor=black>";
|
||||
echo "<td nowrap><font size='+1' color=white><B> Agents Logged In </B></font></td>";
|
||||
echo "<td nowrap><font size='+1' color=white><B> Agents In Calls </B></font></td>";
|
||||
echo "<td nowrap><font size='+1' color=white><B> Active Calls </B></font></td>";
|
||||
echo "<td nowrap><font size='+1' color=white><B> Calls Ringing </B></font></td>";
|
||||
echo "</tr>";
|
||||
echo "<tr bgcolor='#B9CBFD'>";
|
||||
echo "<td align='center'><font size='+1'> $agent_total </font></td>";
|
||||
echo "<td align='center'><font size='+1'> $agent_incall </font></td>";
|
||||
echo "<td align='center'><font size='+1'> $active_calls </font></td>";
|
||||
echo "<td align='center'><font size='+1'> $ringing_calls </font></td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td align='left' colspan='4'> </td>"; # Padding
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr bgcolor=black>";
|
||||
echo "<td align='center'><font color=white><B> Records </B></font></td>";
|
||||
echo "<td align='center'><font color=white><B> Active </B></font></td>";
|
||||
echo "<td align='center'><font color=white><B> Inactive </B></font></td>";
|
||||
echo "<td align='center'><font color=white><B> Total </B></font></td>";
|
||||
echo "</tr>";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right><a href='$PHP_SELF?ADD=0A'>Users: </a></td><td align=center><b>".($users["Y"]+0)."</b></td><td align=center><b>".($users["N"]+0)."</b></td><td align=center><b>".($users["Y"]+$users["N"]+0)."</b></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right><a href='$PHP_SELF?ADD=10'>Campaigns: </a></td><td align=center><b>".($campaigns["Y"]+0)."</b></td><td align=center><b>".($campaigns["N"]+0)."</b></td><td align=center><b>".($campaigns["Y"]+$campaigns["N"]+0)."</b></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right><a href='$PHP_SELF?ADD=100'>Lists: </a></td><td align=center><b>".($lists["Y"]+0)."</b></td><td align=center><b>".($lists["N"]+0)."</b></td><td align=center><b>".($lists["Y"]+$lists["N"]+0)."</b></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right><a href='$PHP_SELF?ADD=1000'>In-Groups: </a></td><td align=center><b>".($ingroups["Y"]+0)."</b></td><td align=center><b>".($ingroups["N"]+0)."</b></td><td align=center><b>".($ingroups["Y"]+$ingroups["N"]+0)."</b></td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right><a href='$PHP_SELF?ADD=1300'>DIDs: </a></td><td align=center><b>".($dids["Y"]+0)."</b></td><td align=center><b>".($dids["N"]+0)."</b></td><td align=center><b>".($dids["Y"]+$dids["N"]+0)."</b></td></tr>\n";
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
echo "<BR>\n";
|
||||
|
||||
|
||||
$today=date("Y-m-d");
|
||||
$yesterday=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||
$thirtydays=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-29,date("Y")));
|
||||
|
||||
$total_calls=0;
|
||||
$total_inbound=0;
|
||||
$total_outbound=0;
|
||||
$stmt="SELECT stats_type,sum(total_calls) from vicidial_daily_max_stats where campaign_id!='' and stats_flag='OPEN' and stats_date='$today' group by stats_type;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
if ($rows_to_print > 0)
|
||||
{
|
||||
while ($rowx=mysql_fetch_row($rslt))
|
||||
{
|
||||
$total_calls += $rowx[1];
|
||||
if (preg_match('/INGROUP/', $rowx[0])) {$total_inbound+=$rowx[1];}
|
||||
if (preg_match('/CAMPAIGN/', $rowx[0])) {$total_outbound+=$rowx[1];}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$stmt="select * from vicidial_daily_max_stats where stats_date='$today' and stats_flag='OPEN' and stats_type='TOTAL' order by stats_date, campaign_id asc";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr>";
|
||||
echo "<td align='left' colspan='3'>Total Stats for Today:</td>";
|
||||
echo "<td align='right'><font size=1><a href='$PHP_SELF?query_date=$thirtydays&end_date=$today&max_system_stats_submit=ADJUST+DATE+RANGE&ADD=999992&stage=TOTAL'>[view max stats]</a></font></td>";
|
||||
echo "</tr>";
|
||||
echo "<tr bgcolor=black>";
|
||||
# echo "<td><font size=1 color=white align=left><B>CAMPAIGN ID</B></font></td>";
|
||||
echo "<td><font size=1 color=white><B> Total Calls </B></font></td>";
|
||||
echo "<td><font size=1 color=white><B> Total Inbound Calls </B></font></td>";
|
||||
echo "<td><font size=1 color=white><B> Total Outbound Calls </B></font></td>";
|
||||
echo "<td><font size=1 color=white><B> Maximum Agents </B></font></td>";
|
||||
|
||||
if (mysql_num_rows($rslt)>0) {
|
||||
while ($row=mysql_fetch_array($rslt)) {
|
||||
echo "<tr bgcolor='#B9CBFD'>";
|
||||
# echo "<td align='left'><font size=1>".$row["campaign_id"]."</font></td>";
|
||||
echo "<td align='center'><font size=1>".($total_calls+0)."</font></td>";
|
||||
echo "<td align='center'><font size=1>".($total_inbound+0)."</font></td>";
|
||||
echo "<td align='center'><font size=1>".($total_outbound+0)."</font></td>";
|
||||
echo "<td align='center'><font size=1>".($row["max_agents"]+0)."</font></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
} else {
|
||||
echo "<tr bgcolor='#B9CBFD'>";
|
||||
echo "<td align='center' colspan='4'><font size=1>*** NO ACTIVITY FOR $today ***</font></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
$stmt="select * from vicidial_daily_max_stats where stats_date='$yesterday' and stats_type='TOTAL' order by stats_date, campaign_id asc";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr>";
|
||||
echo "<td align='left' colspan='3'>Total Stats for Yesterday:</td>";
|
||||
echo "<td align='right'><font size=1><a href='$PHP_SELF?query_date=$thirtydays&end_date=$today&max_system_stats_submit=ADJUST+DATE+RANGE&ADD=999992&stage=TOTAL'>[view max stats]</a></font></td>";
|
||||
echo "</tr>";
|
||||
echo "<tr bgcolor=black>";
|
||||
# echo "<td><font size=1 color=white align=left><B>CAMPAIGN ID</B></font></td>";
|
||||
echo "<td><font size=1 color=white><B> Total Calls </B></font></td>";
|
||||
echo "<td><font size=1 color=white><B> Total Inbound Calls </B></font></td>";
|
||||
echo "<td><font size=1 color=white><B> Total Outbound Calls </B></font></td>";
|
||||
echo "<td><font size=1 color=white><B> Maximum Agents </B></font></td>";
|
||||
|
||||
if (mysql_num_rows($rslt)>0) {
|
||||
while ($row=mysql_fetch_array($rslt)) {
|
||||
echo "<tr bgcolor='#B9CBFD'>";
|
||||
#echo "<td align='left'><font size=1>".$row["campaign_id"]."</font></td>";
|
||||
echo "<td align='center'><font size=1>".($row["total_calls"]+0)."</font></td>";
|
||||
echo "<td align='center'><font size=1>".($row["max_inbound"]+0)."</font></td>";
|
||||
echo "<td align='center'><font size=1>".($row["max_outbound"]+0)."</font></td>";
|
||||
echo "<td align='center'><font size=1>".($row["max_agents"]+0)."</font></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
} else {
|
||||
echo "<tr bgcolor='#B9CBFD'>";
|
||||
echo "<td align='center' colspan='4'><font size=1>*** NO ACTIVITY FOR $today ***</font></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
echo "</FONT><BR><BR>";
|
||||
|
||||
}
|
||||
|
||||
##### If report run, update the time in the vicidial_report_log table #####
|
||||
if ( ($ADD==999993) or ($ADD==999992) or ($ADD==730000000000000) or ($ADD==830000000000000) )
|
||||
{
|
||||
|
||||
@@ -1093,7 +1093,7 @@ $SSlevel_8_disable_add = $row[5];
|
||||
<TABLE BGCOLOR=white cellpadding=0 cellspacing=0>
|
||||
<!-- BEGIN SIDEBAR NAVIGATION -->
|
||||
<TR><TD VALIGN=TOP WIDTH=170 BGCOLOR=#015B91 ALIGN=CENTER>
|
||||
<IMG SRC="./vicidial_admin_web_logo.gif" WIDTH=170 HEIGHT=45 ALT="System logo">
|
||||
<A HREF="./admin.php"><IMG SRC="./vicidial_admin_web_logo.gif" WIDTH=170 HEIGHT=45 BORDER=0 ALT="System logo"></A>
|
||||
<B><FONT FACE="ARIAL,HELVETICA" COLOR=white>ADMINISTRATION</FONT></B><BR>
|
||||
<TABLE CELLPADDING=2 CELLSPACING=0 BGCOLOR=#015B91 WIDTH=160>
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,334 @@
|
||||
<?php
|
||||
# reset_campaign_lists.php - VICIDIAL administration page
|
||||
#
|
||||
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 130711-2051 - First build
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
require("functions.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
$QUERY_STRING = getenv("QUERY_STRING");
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_refresh,nocache_admin,webroot_writable,allow_emails,hosted_settings FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
if ($qm_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$SSauto_dial_limit = $row[1];
|
||||
$SSuser_territories_active = $row[2];
|
||||
$SSallow_custom_dialplan = $row[3];
|
||||
$SScallcard_enabled = $row[4];
|
||||
$SSadmin_modify_refresh = $row[5];
|
||||
$SSnocache_admin = $row[6];
|
||||
$SSwebroot_writable = $row[7];
|
||||
$SSemail_enabled = $row[8];
|
||||
$SShosted_settings = $row[9];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_PW);
|
||||
}
|
||||
else
|
||||
{
|
||||
$PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
|
||||
$PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
$user_auth=0;
|
||||
$auth=0;
|
||||
$reports_auth=0;
|
||||
$qc_auth=0;
|
||||
$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1);
|
||||
if ($auth_message == 'GOOD')
|
||||
{$user_auth=1;}
|
||||
|
||||
if ($user_auth > 0)
|
||||
{
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 6 and view_reports > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$reports_auth=$row[0];
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 1 and qc_enabled > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$qc_auth=$row[0];
|
||||
|
||||
$reports_only_user=0;
|
||||
$qc_only_user=0;
|
||||
if ( ($reports_auth > 0) and ($auth < 1) )
|
||||
{
|
||||
$ADD=999999;
|
||||
$reports_only_user=1;
|
||||
}
|
||||
if ( ($qc_auth > 0) and ($reports_auth < 1) and ($auth < 1) )
|
||||
{
|
||||
if ( ($ADD != '881') and ($ADD != '100000000000000') )
|
||||
{
|
||||
$ADD=100000000000000;
|
||||
}
|
||||
$qc_only_user=1;
|
||||
}
|
||||
if ( ($qc_auth < 1) and ($reports_auth < 1) and ($auth < 1) )
|
||||
{
|
||||
$VDdisplayMESSAGE = "You do not have permission to be here";
|
||||
Header ("Content-type: text/html; charset=utf-8");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$VDdisplayMESSAGE = "Login incorrect, please try again";
|
||||
if ($auth_message == 'LOCK')
|
||||
{
|
||||
$VDdisplayMESSAGE = "Too many login attempts, try again in 15 minutes";
|
||||
Header ("Content-type: text/html; charset=utf-8");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$admin_version = '2.8-407a';
|
||||
$build = '130709-1350';
|
||||
|
||||
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,modify_contacts,modify_same_user_level from vicidial_users where user='$PHP_AUTH_USER';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfull_name =$row[3];
|
||||
$LOGuser_level =$row[4];
|
||||
$LOGuser_group =$row[5];
|
||||
$LOGdelete_users =$row[8];
|
||||
$LOGdelete_user_groups =$row[9];
|
||||
$LOGdelete_lists =$row[10];
|
||||
$LOGdelete_campaigns =$row[11];
|
||||
$LOGdelete_ingroups =$row[12];
|
||||
$LOGdelete_remote_agents =$row[13];
|
||||
$LOGload_leads =$row[14];
|
||||
$LOGcampaign_detail =$row[15];
|
||||
$LOGast_admin_access =$row[16];
|
||||
$LOGast_delete_phones =$row[17];
|
||||
$LOGdelete_scripts =$row[18];
|
||||
$LOGdelete_filters =$row[29];
|
||||
$LOGalter_agent_interface =$row[30];
|
||||
$LOGdelete_call_times =$row[32];
|
||||
$LOGmodify_call_times =$row[33];
|
||||
$LOGmodify_users =$row[34];
|
||||
$LOGmodify_campaigns =$row[35];
|
||||
$LOGmodify_lists =$row[36];
|
||||
$LOGmodify_scripts =$row[37];
|
||||
$LOGmodify_filters =$row[38];
|
||||
$LOGmodify_ingroups =$row[39];
|
||||
$LOGmodify_usergroups =$row[40];
|
||||
$LOGmodify_remoteagents =$row[41];
|
||||
$LOGmodify_servers =$row[42];
|
||||
$LOGview_reports =$row[43];
|
||||
$LOGmodify_dids =$row[56];
|
||||
$LOGdelete_dids =$row[57];
|
||||
$LOGmanager_shift_enforcement_override=$row[61];
|
||||
$LOGexport_reports =$row[64];
|
||||
$LOGdelete_from_dnc =$row[65];
|
||||
$LOGcallcard_admin =$row[70];
|
||||
$LOGforce_change_password =$row[71];
|
||||
$LOGmodify_shifts =$row[72];
|
||||
$LOGmodify_phones =$row[73];
|
||||
$LOGmodify_carriers =$row[74];
|
||||
$LOGmodify_labels =$row[75];
|
||||
$LOGmodify_statuses =$row[76];
|
||||
$LOGmodify_voicemail =$row[77];
|
||||
$LOGmodify_audiostore =$row[78];
|
||||
$LOGmodify_moh =$row[79];
|
||||
$LOGmodify_tts =$row[80];
|
||||
$LOGmodify_contacts =$row[81];
|
||||
$LOGmodify_same_user_level =$row[82];
|
||||
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGallowed_campaigns = $row[0];
|
||||
$LOGallowed_reports = $row[1];
|
||||
$LOGadmin_viewable_groups = $row[2];
|
||||
$LOGadmin_viewable_call_times = $row[3];
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
if (isset($_GET["reset_lead_called_campaigns"])) {$reset_lead_called_campaigns=$_GET["reset_lead_called_campaigns"];}
|
||||
elseif (isset($_POST["reset_lead_called_campaigns"])) {$reset_lead_called_campaigns=$_POST["reset_lead_called_campaigns"];}
|
||||
if (isset($_GET["all_or_active_only"])) {$all_or_active_only=$_GET["all_or_active_only"];}
|
||||
elseif (isset($_POST["all_or_active_only"])) {$all_or_active_only=$_POST["all_or_active_only"];}
|
||||
if (isset($_GET["submit_campaign_reset"])) {$submit_campaign_reset=$_GET["submit_campaign_reset"];}
|
||||
elseif (isset($_POST["submit_campaign_reset"])) {$submit_campaign_reset=$_POST["submit_campaign_reset"];}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<title>ADMINISTRATION: Campaign Lists Reset
|
||||
|
||||
<?php
|
||||
|
||||
##### BEGIN Set variables to make header show properly #####
|
||||
$ADD = '311111';
|
||||
$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='';
|
||||
$usergroups_color = '#FFFF99';
|
||||
$usergroups_font = 'BLACK';
|
||||
$usergroups_color = '#E6E6E6';
|
||||
$subcamp_color = '#C6C6C6';
|
||||
##### END Set variables to make header show properly #####
|
||||
|
||||
require("admin_header.php");
|
||||
|
||||
if ( ($LOGuser_level >= 9) and $LOGmodify_campaigns>0 and $LOGmodify_lists>0 and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) )
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$campaign_stmt="select vl.campaign_id, vc.campaign_name, count(*) as ct from vicidial_lists vl, vicidial_campaigns vc where vc.active='Y' and vc.campaign_id=vl.campaign_id $LOGallowed_campaignsSQL group by campaign_id order by campaign_id, campaign_name asc";
|
||||
$campaign_rslt=mysql_query($campaign_stmt, $link);
|
||||
|
||||
echo "<br><B>Reset Lead-Called-Status for Campaigns:</B><BR><BR>\n";
|
||||
echo "<form action='$PHP_SELF?ADD=200000000000' method='post'>";
|
||||
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1 BGCOLOR=#D9E6FE>\n";
|
||||
echo "<tr bgcolor=black>";
|
||||
echo "<td><font size=1 color=white align=left><B>Select campaign:</B></td>";
|
||||
echo "<td><font size=1 color=white><B>Reset all/active only</B></td>";
|
||||
echo "<td align=center><font size=1 color=white><B> </B></td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor='#B9CBFD'>";
|
||||
echo "<td align='left'>";
|
||||
echo "<select name='reset_lead_called_campaigns'>\n";
|
||||
while ($campaign_row=mysql_fetch_array($campaign_rslt)) {
|
||||
if ($campaign_row["ct"]>0) {
|
||||
$selected="";
|
||||
if ($reset_lead_called_campaigns==$campaign_row["campaign_id"]) {
|
||||
$selected="selected";
|
||||
}
|
||||
echo "<option value='$campaign_row[campaign_id]' $selected>$campaign_row[campaign_id] - $campaign_row[campaign_name], $campaign_row[ct] list(s)</option>\n";
|
||||
}
|
||||
}
|
||||
echo "</select></td>";
|
||||
echo "<td><select name='all_or_active_only'>";
|
||||
echo "<option value='Y'>Active lists only</option>";
|
||||
echo "<option value=''>All lists</option>";
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "<td align='right'><input type='submit' name='submit_campaign_reset' value='SUBMIT'></td></tr>";
|
||||
echo "<tr ><td colspan='3'>";
|
||||
|
||||
if ($submit_campaign_reset && $reset_lead_called_campaigns) {
|
||||
if ($all_or_active_only=="Y") {$list_id_clause="and active='Y'"; $verbiage="(active lists only)";}
|
||||
|
||||
$list_id_stmt="select list_id from vicidial_lists where campaign_id='$reset_lead_called_campaigns' $list_id_clause order by list_id asc";
|
||||
$list_id_rslt=mysql_query($list_id_stmt, $link);
|
||||
if (mysql_num_rows($list_id_rslt)>0) {
|
||||
echo "CAMPAIGN <B>$reset_lead_called_campaigns</B> LISTS RESETTING $verbiage:<BR>\n<UL>";
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQLdate=date("Y-m-d H:i:s");
|
||||
$SQL_log = "$list_id_stmt|";
|
||||
$SQL_log = preg_replace('/;/', '', $SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$reset_lead_called_campaigns', event_code='ADMIN RESET CAMPAIGN LISTS', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
|
||||
while ($list_id_row=mysql_fetch_array($list_id_rslt)) {
|
||||
$list_id=$list_id_row["list_id"];
|
||||
$upd_stmt="UPDATE vicidial_list SET called_since_last_reset='N' where list_id='$list_id';";
|
||||
$upd_rslt=mysql_query($upd_stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQLdate=date("Y-m-d H:i:s");
|
||||
$SQL_log = "$upd_stmt|";
|
||||
$SQL_log = preg_replace('/;/', '', $SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<LI>LIST ID $list_id - ";
|
||||
if (mysql_affected_rows()>0) {echo "RESET<BR>";} else {echo "<B>NOT</B> RESET<BR>";}
|
||||
}
|
||||
if (mysql_num_rows($list_id_rslt)>0) {echo "</UL>";}
|
||||
if (mysql_num_rows($list_id_rslt)<7) {
|
||||
for ($j=mysql_num_rows($list_id_rslt); $j<7; $j++) {echo "<BR>";}
|
||||
}
|
||||
} else {
|
||||
echo "<BR><BR><BR><BR><BR><BR><BR> ";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
echo "</TABLE></center></form>\n";
|
||||
|
||||
echo "</TABLE></center>";
|
||||
|
||||
echo "</TD></TR>\n";
|
||||
echo "<TR><TD BGCOLOR=#015B91 ALIGN=CENTER>\n";
|
||||
echo "<font size=0 color=white><br><br><!-- RUNTIME: $RUNtime seconds<BR> -->";
|
||||
echo "VERSION: $admin_version<BR>";
|
||||
echo "BUILD: $build\n";
|
||||
if (!preg_match("/_BUILD_/",$SShosted_settings))
|
||||
{echo "<BR><a href=\"$PHP_SELF?ADD=999995\"><font color=white>© 2013 ViciDial Group</font></a><BR><img src=\"images/pixel.gif\">";}
|
||||
echo "</font>\n";
|
||||
?>
|
||||
|
||||
</TD><TD BGCOLOR=#D9E6FE>
|
||||
</TD></TR><TABLE>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
} else {
|
||||
echo "You are not authorized to view this page.";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user