Added List name sorting in admin.php

Added options.php for real-time report to set display option defaults
minor bug fixes in real-time screen

git-svn-id: svn://192.168.202.10@1588 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-01-11 19:19:10 +00:00
parent 1b7d5f68a2
commit 2f84913a97
4 changed files with 327 additions and 235 deletions
@@ -2434,6 +2434,7 @@ $calls_to_list = mysql_num_rows($rslt);
$call_time_MS = sec_convert($call_time_S,'M');
$call_time_MS = sprintf("%7s", $call_time_MS);
$call_time_MS = " $call_time_MS";
$G = ''; $EG = '';
if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') )
{
@@ -2523,7 +2524,7 @@ $calls_to_list = mysql_num_rows($rslt);
if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";}
else {$UGD = "";}
if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";}
if ($SERVdisplay > 0) {$SVD = " $G$server_ip$EG | $G$call_server_ip$EG |";}
else {$SVD = "";}
if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";}
@@ -2553,11 +2554,11 @@ $calls_to_list = mysql_num_rows($rslt);
if ($realtime_block_user_info > 0)
{
$Aecho .= "|$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n";
$Aecho .= "|$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n";
}
if ($realtime_block_user_info < 1)
{
$Aecho .= "| $G$extension$EG |$phoneD<a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> <a href=\"javascript:ingroup_info('$Luser','$j');\">+</a> |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n";
$Aecho .= "| $G$extension$EG |$phoneD<a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> <a href=\"javascript:ingroup_info('$Luser','$j');\">+</a> |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n";
}
$j++;
}
+208 -196
View File
@@ -2630,12 +2630,13 @@ else
# 101216-1838 - Changed Realtime report links to go to new realtime_report
# 101227-1320 - Added dialplan off toggle options
# 110103-1135 - Added queuemetrics_dispo_pause and lead_order_randomize features
# 110111-1305 - Added sort by list name for list listings in list section and campaign screens
#
# 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.4-295';
$build = '110103-1135';
$admin_version = '2.4-296';
$build = '110111-1305';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -19309,6 +19310,7 @@ if ($ADD==31)
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$LISTlink='stage=LISTIDDOWN';
$NAMElink='stage=LISTNAMEDOWN';
$TALLYlink='stage=TALLYDOWN';
$ACTIVElink='stage=ACTIVEDOWN';
$CAMPAIGNlink='stage=CAMPAIGNDOWN';
@@ -19316,6 +19318,8 @@ if ($ADD==31)
$SQLorder='order by list_id';
if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';}
if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';}
if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';}
if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';}
if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';}
if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';}
if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';}
@@ -19331,7 +19335,7 @@ if ($ADD==31)
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$LISTlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST ID</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$NAMElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$TALLYlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LEADS COUNT</B></a></TD>\n";
echo "<TD COLSPAN=2><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$ACTIVElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVE</B></a></TD>";
@@ -20487,6 +20491,7 @@ if ($ADD==34)
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$LISTlink='stage=LISTIDDOWN';
$NAMElink='stage=LISTNAMEDOWN';
$TALLYlink='stage=TALLYDOWN';
$ACTIVElink='stage=ACTIVEDOWN';
$CAMPAIGNlink='stage=CAMPAIGNDOWN';
@@ -20494,6 +20499,8 @@ if ($ADD==34)
$SQLorder='order by list_id';
if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';}
if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';}
if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';}
if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';}
if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';}
if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';}
if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';}
@@ -20502,202 +20509,203 @@ if ($ADD==34)
if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';}
if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';}
if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';}
$stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
$stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$LISTlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST ID</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$TALLYlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LEADS COUNT</B></a></TD>\n";
echo "<TD COLSPAN=2><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$ACTIVElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVE</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$CALLDATElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST CALL DATE</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>MODIFY</TD>\n";
echo "</TR>\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&$LISTlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST ID</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&$NAMElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&$TALLYlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LEADS COUNT</B></a></TD>\n";
echo "<TD COLSPAN=2><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$ACTIVElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVE</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&$CALLDATElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST CALL DATE</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>MODIFY</TD>\n";
echo "</TR>\n";
$o=0;
while ($lists_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td>";
if (ereg('Y',$row[4]))
{
$active_lists++;
$camp_lists .= "'$row[0]',";
echo "<input type=\"checkbox\" name=\"list_active_change[]\" value=\"$row[0]\" CHECKED>";
}
else
{
$inactive_lists++;
echo "<input type=\"checkbox\" name=\"list_active_change[]\" value=\"$row[0]\"";
}
echo "</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "<TR><TD COLSPAN=7 ALIGN=CENTER><input type=submit value=\"SUBMIT ACTIVE LIST CHANGES\"></TD></TR>\n";
echo "</TABLE></center><BR></FORM>\n";
echo "<center><b>\n";
$filterSQL = $filtersql_list[$lead_filter_id];
$filterSQL = preg_replace("/\\\\/","",$filterSQL);
$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL);
if (strlen($filterSQL)>4)
{$fSQL = "and $filterSQL";}
else
{$fSQL = '';}
$camp_lists = eregi_replace(".$","",$camp_lists);
echo "This campaign has $active_lists active lists and $inactive_lists inactive lists<br><br>\n";
if ( ($display_leads_count == 'Y') and (strlen($camp_lists) > 3) )
{
# grab names of global statuses and statuses in the selected campaign
$stmt="SELECT status,status_name from vicidial_statuses order by status;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($lists_to_print > $o)
while ($statuses_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td>";
if (ereg('Y',$row[4]))
{
$active_lists++;
$camp_lists .= "'$row[0]',";
echo "<input type=\"checkbox\" name=\"list_active_change[]\" value=\"$row[0]\" CHECKED>";
}
else
{
$inactive_lists++;
echo "<input type=\"checkbox\" name=\"list_active_change[]\" value=\"$row[0]\"";
}
echo "</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">MODIFY</a></td></tr>\n";
$rowx=mysql_fetch_row($rslt);
$statuses_name_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
echo "<TR><TD COLSPAN=7 ALIGN=CENTER><input type=submit value=\"SUBMIT ACTIVE LIST CHANGES\"></TD></TR>\n";
echo "</TABLE></center><BR></FORM>\n";
echo "<center><b>\n";
$stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status;";
$rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rslt);
$filterSQL = $filtersql_list[$lead_filter_id];
$filterSQL = preg_replace("/\\\\/","",$filterSQL);
$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL);
if (strlen($filterSQL)>4)
{$fSQL = "and $filterSQL";}
else
{$fSQL = '';}
$camp_lists = eregi_replace(".$","",$camp_lists);
echo "This campaign has $active_lists active lists and $inactive_lists inactive lists<br><br>\n";
if ( ($display_leads_count == 'Y') and (strlen($camp_lists) > 3) )
$o=0;
while ($Cstatuses_to_print > $o)
{
# grab names of global statuses and statuses in the selected campaign
$stmt="SELECT status,status_name from vicidial_statuses order by status;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_name_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
$stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status;";
$rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($Cstatuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_name_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
# end grab status names
echo "<br><b>STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN:</b>\n";
echo " - <font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&stage=hide_leadscount\">HIDE</a></font><BR>";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>STATUS NAME</td><td>CALLED</td><td>NOT CALLED</td></tr>\n";
$leads_in_list = 0;
$leads_in_list_N = 0;
$leads_in_list_Y = 0;
$stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id IN($camp_lists) group by status,called_since_last_reset order by status,called_since_last_reset";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
$lead_list['count'] = 0;
$lead_list['Y_count'] = 0;
$lead_list['N_count'] = 0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N')
{
$since_reset = 'N';
$since_resetX = 'Y';
}
else
{
$since_reset = 'Y';
$since_resetX = 'N';
}
$lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]]))
{
$lead_list[$since_resetX][$rowx[0]]=0;
}
$o++;
}
$o=0;
if ($lead_list['count'] > 0)
{
while (list($dispo,) = each($lead_list[$since_reset]))
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
if ($dispo == 'CBHOLD')
{
$CLB="<a href=\"$PHP_SELF?ADD=811&list_id=$list_id\">";
$CLE="</a>";
}
else
{
$CLB='';
$CLE='';
}
echo "<tr $bgcolor><td><font size=1>$CLB$dispo$CLE</td><td><font size=1>$statuses_name_list[$dispo]</td><td><font size=1>".$lead_list['Y'][$dispo]."</td><td><font size=1>".$lead_list['N'][$dispo]." </td></tr>\n";
$o++;
}
}
echo "<tr><td colspan=2><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td></tr>\n";
echo "</table></center><br>\n";
unset($lead_list);
}
else
{
echo "<font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&stage=show_leadscount\">SHOW LEAD STATUSES IN THIS CAMPAIGN</a></font><BR><BR>";
}
if ($display_dialable_count == 'Y')
{
### call function to calculate and print dialable leads
dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL);
echo " - <font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&stage=hide_dialable\">HIDE</a></font><BR><BR>";
}
else
{
echo "<a href=\"$PHP_SELF?ADD=73&campaign_id=$campaign_id\" target=\"_blank\">Popup Dialable Leads Count</a>";
echo " - <font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&stage=show_dialable\">SHOW</a></font><BR><BR>";
}
$stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
$hopper_leads = "$rowx[0]";
$statuses_name_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
# end grab status names
echo "This campaign has $hopper_leads leads in the dial hopper<br><br>\n";
echo "<a href=\"./AST_VICIDIAL_hopperlist.php?group=$campaign_id\">Click here to see what leads are in the hopper right now</a><br><br>\n";
echo "<a href=\"./AST_VDADstats.php?group=$campaign_id\">Click here to see a VDAD report for this campaign</a><BR><BR>\n";
echo "<br><b>STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN:</b>\n";
echo " - <font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&stage=hide_leadscount\">HIDE</a></font><BR>";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>STATUS NAME</td><td>CALLED</td><td>NOT CALLED</td></tr>\n";
$leads_in_list = 0;
$leads_in_list_N = 0;
$leads_in_list_Y = 0;
$stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id IN($camp_lists) group by status,called_since_last_reset order by status,called_since_last_reset";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
$lead_list['count'] = 0;
$lead_list['Y_count'] = 0;
$lead_list['N_count'] = 0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N')
{
$since_reset = 'N';
$since_resetX = 'Y';
}
else
{
$since_reset = 'Y';
$since_resetX = 'N';
}
$lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]]))
{
$lead_list[$since_resetX][$rowx[0]]=0;
}
$o++;
}
$o=0;
if ($lead_list['count'] > 0)
{
while (list($dispo,) = each($lead_list[$since_reset]))
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
if ($dispo == 'CBHOLD')
{
$CLB="<a href=\"$PHP_SELF?ADD=811&list_id=$list_id\">";
$CLE="</a>";
}
else
{
$CLB='';
$CLE='';
}
echo "<tr $bgcolor><td><font size=1>$CLB$dispo$CLE</td><td><font size=1>$statuses_name_list[$dispo]</td><td><font size=1>".$lead_list['Y'][$dispo]."</td><td><font size=1>".$lead_list['N'][$dispo]." </td></tr>\n";
$o++;
}
}
echo "<tr><td colspan=2><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td></tr>\n";
echo "</table></center><br>\n";
unset($lead_list);
}
else
{
echo "<font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&stage=show_leadscount\">SHOW LEAD STATUSES IN THIS CAMPAIGN</a></font><BR><BR>";
}
if ($display_dialable_count == 'Y')
{
### call function to calculate and print dialable leads
dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL);
echo " - <font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&stage=hide_dialable\">HIDE</a></font><BR><BR>";
}
else
{
echo "<a href=\"$PHP_SELF?ADD=73&campaign_id=$campaign_id\" target=\"_blank\">Popup Dialable Leads Count</a>";
echo " - <font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&stage=show_dialable\">SHOW</a></font><BR><BR>";
}
$stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
$hopper_leads = "$rowx[0]";
echo "This campaign has $hopper_leads leads in the dial hopper<br><br>\n";
echo "<a href=\"./AST_VICIDIAL_hopperlist.php?group=$campaign_id\">Click here to see what leads are in the hopper right now</a><br><br>\n";
echo "<a href=\"./AST_VDADstats.php?group=$campaign_id\">Click here to see a VDAD report for this campaign</a><BR><BR>\n";
}
echo "<a href=\"$PHP_SELF?ADD=81&campaign_id=$campaign_id\">Click here to see all CallBack Holds in this campaign</a><BR><BR>\n";
if ($LOGuser_level >= 9)
@@ -20715,14 +20723,15 @@ if ($ADD==34)
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>USER</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS TODAY</td></tr>\n";
$stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
$stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
$o=0;
while ($users_to_print > $o) {
$rowx=mysql_fetch_row($rsltx);
$o++;
$o=0;
while ($users_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
@@ -26903,6 +26912,7 @@ if ($ADD==100)
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$LISTlink='stage=LISTIDDOWN';
$NAMElink='stage=LISTNAMEDOWN';
$TALLYlink='stage=TALLYDOWN';
$ACTIVElink='stage=ACTIVEDOWN';
$CAMPAIGNlink='stage=CAMPAIGNDOWN';
@@ -26910,6 +26920,8 @@ if ($ADD==100)
$SQLorder='order by list_id';
if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';}
if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';}
if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';}
if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';}
if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';}
if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';}
if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';}
@@ -26926,7 +26938,7 @@ if ($ADD==100)
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><a href=\"$PHP_SELF?ADD=100&$LISTlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST ID</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=100&$NAMElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RTIME</B></TD>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=100&$TALLYlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LEADS COUNT</B></a></TD>\n";
@@ -29,4 +29,19 @@ $webphone_clpos = "<BR> &nbsp; <a href=\"#\" onclick=\"hideDiv('webphone_conten
#$webphone_pad = '0';
#$webphone_clpos = ' ';
# used by the realtime report
$RS_DB = 0; # 1=debug on, 0=debug off
$RS_RR = 40; # refresh rate
$RS_group = 'ALL-ACTIVE'; # selected campaign(s)
$RS_usergroup = ''; # user group defined
$RS_UGdisplay = 0; # 0=no, 1=yes
$RS_UidORname = 1; # 0=id, 1=name
$RS_orderby = 'timeup';
$RS_SERVdisplay = 0; # 0=no, 1=yes
$RS_CALLSdisplay = 1; # 0=no, 1=yes
$RS_PHONEdisplay = 0; # 0=no, 1=yes
$RS_CUSTPHONEdisplay = 0; # 0=no, 1=yes
$RS_PAUSEcodes = 'N';
$RS_with_inbound = 'Y';
?>
+100 -36
View File
@@ -13,10 +13,11 @@
# CHANGELOG:
# 101216-1355 - First Build
# 101218-1520 - small time reload bug fix and formatting fixes
# 110111-1557 - Added options.php options, minor bug fixes
#
$version = '2.4-2';
$build = '101218-1520';
$version = '2.4-3';
$build = '110111-1557';
header ("Content-type: text/html; charset=utf-8");
@@ -112,28 +113,94 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
}
if (!isset($DB)) {$DB=0;}
if (!isset($RR)) {$RR=40;}
if (!isset($group)) {$group='ALL-ACTIVE';}
if (!isset($usergroup)) {$usergroup='';}
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name
if (!isset($orderby)) {$orderby='timeup';}
if (!isset($SERVdisplay)) {$SERVdisplay=0;} # 0=no, 1=yes
if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes
if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes
if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes
if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes
if (!isset($with_inbound))
$webphone_width = '460';
$webphone_height = '500';
$webphone_left = '600';
$webphone_top = '27';
$webphone_bufw = '250';
$webphone_bufh = '1';
$webphone_pad = '10';
$webphone_clpos = "<BR> &nbsp; <a href=\"#\" onclick=\"hideDiv('webphone_content');\">webphone -</a>";
if (file_exists('options.php'))
{
if ($outbound_autodial_active > 0)
{$with_inbound='Y';} # N=no, Y=yes, O=only
else
{$with_inbound='O';} # N=no, Y=yes, O=only
require('options.php');
}
if (!isset($DB))
{
if (!isset($RS_DB)) {$DB=0;}
else {$DB = $RS_DB;}
}
if (!isset($RR))
{
if (!isset($RS_RR)) {$RR=40;}
else {$RR = $RS_RR;}
}
if (!isset($group))
{
if (!isset($RS_group)) {$group='ALL-ACTIVE';}
else {$group = $RS_group;}
}
if (!isset($usergroup))
{
if (!isset($RS_usergroup)) {$usergroup='';}
else {$usergroup = $RS_usergroup;}
}
if (!isset($UGdisplay))
{
if (!isset($RS_UGdisplay)) {$UGdisplay=0;}
else {$UGdisplay = $RS_UGdisplay;}
}
if (!isset($UidORname))
{
if (!isset($RS_UidORname)) {$UidORname=1;}
else {$UidORname = $RS_UidORname;}
}
if (!isset($orderby))
{
if (!isset($RS_orderby)) {$orderby='timeup';}
else {$orderby = $RS_orderby;}
}
if (!isset($SERVdisplay))
{
if (!isset($RS_SERVdisplay)) {$SERVdisplay=0;}
else {$SERVdisplay = $RS_SERVdisplay;}
}
if (!isset($CALLSdisplay))
{
if (!isset($RS_CALLSdisplay)) {$CALLSdisplay=1;}
else {$CALLSdisplay = $RS_CALLSdisplay;}
}
if (!isset($PHONEdisplay))
{
if (!isset($RS_PHONEdisplay)) {$PHONEdisplay=0;}
else {$PHONEdisplay = $RS_PHONEdisplay;}
}
if (!isset($CUSTPHONEdisplay))
{
if (!isset($RS_CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;}
else {$CUSTPHONEdisplay = $RS_CUSTPHONEdisplay;}
}
if (!isset($PAUSEcodes))
{
if (!isset($RS_PAUSEcodes)) {$PAUSEcodes='N';}
else {$PAUSEcodes = $RS_PAUSEcodes;}
}
if (!isset($with_inbound))
{
if (!isset($RS_with_inbound))
{
if ($outbound_autodial_active > 0)
{$with_inbound='Y';} # N=no, Y=yes, O=only
else
{$with_inbound='O';} # N=no, Y=yes, O=only
}
else {$with_inbound = $RS_with_inbound;}
}
$ingroup_detail='';
if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group; $RR=40;}
if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group;}
else {$group = $groups[0];}
$NOW_TIME = date("Y-m-d H:i:s");
@@ -154,22 +221,6 @@ $epochTWENTYFOURhoursAGO = ($STARTtime - 86400);
$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO);
$webphone_content='';
$webphone_width = '460';
$webphone_height = '500';
$webphone_left = '600';
$webphone_top = '27';
$webphone_bufw = '250';
$webphone_bufh = '1';
$webphone_pad = '10';
$webphone_clpos = "<BR> &nbsp; <a href=\"#\" onclick=\"hideDiv('webphone_content');\">webphone -</a>";
if (file_exists('options.php'))
{
require('options.php');
}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
@@ -464,6 +515,10 @@ if ($presets_enabled > 0)
$select_list .= ">YES</option>";
$select_list .= "</SELECT></TD></TR>";
}
else
{
$select_list .= "<INPUT TYPE=HIDDEN NAME=PRESETstats ID=PRESETstats value=0>";
}
$select_list .= "<TR><TD align=right>";
$select_list .= "Agent Time Stats: </TD><TD align=left><SELECT SIZE=1 NAME=AGENTtimeSTATS ID=AGENTtimeSTATS>";
@@ -1041,8 +1096,17 @@ function update_variables(task_option,task_choice,force_reload)
NOLEADSalert = NOLEADSalertFORM[NOLEADSalertFORM.selectedIndex].value;
var CARRIERstatsFORM = document.getElementById('CARRIERstats');
CARRIERstats = CARRIERstatsFORM[CARRIERstatsFORM.selectedIndex].value;
<?php
if ($presets_enabled > 0)
{
?>
var PRESETstatsFORM = document.getElementById('PRESETstats');
PRESETstats = PRESETstatsFORM[PRESETstatsFORM.selectedIndex].value;
<?php
}
else
{echo "PRESETstats=0;\n";}
?>
var AGENTtimeSTATSFORM = document.getElementById('AGENTtimeSTATS');
AGENTtimeSTATS = AGENTtimeSTATSFORM[AGENTtimeSTATSFORM.selectedIndex].value;
var temp_monitor_phone = document.REALTIMEform.monitor_phone.value