Added fields to call export

limited called count to 100 in list display

git-svn-id: svn://192.168.202.10@1261 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-11-21 08:47:54 +00:00
parent b471e8df0c
commit 3969a93db3
6 changed files with 149 additions and 104 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ preview -
YES - preview the lead in the vicidial screen without dialing
NO - do not preview the lead, place call immediately
focus -
YES - change the focus of the screen to the vicidial.php agent interface
YES - change the focus of the screen to the vicidial.php agent interface, brings up an alert in the browser window
NO - do not change focus
vendor_id -
Any valid Vendor lead code
+1 -1
View File
@@ -639,7 +639,7 @@ ln -s /dev/null /usr/local/apache2/htdocs/agc/vicidial_auth_entries.txt
ln -s /dev/null /usr/local/apache2/htdocs/agc/astguiclient_auth_entries.txt
ln -s /dev/null /usr/local/apache2/htdocs/vicidial/admin_changes_log.txt
- Change the WWW writable in the admin.php server settings to "0"
- Change the WWW writable in the admin.php system settings to "0"
- Change the default admin user "6666" or it's password from the default
- Change the Default secret(password) for the default SIP and IAX accounts that are set up with astGUIclient
- Change the default password for the Asterisk manager connection in manager.conf then change it in the server modification screen
+61 -65
View File
@@ -82,12 +82,12 @@ echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
#echo "<INPUT TYPE=HIDDEN NAME=server_ip VALUE=\"$server_ip\">\n";
#echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
echo "<SELECT SIZE=1 NAME=group>\n";
$o=0;
while ($campaigns_to_print > $o)
$o=0;
while ($campaigns_to_print > $o)
{
if ($campaign_id[$o] == $group) {echo "<option selected value=\"$campaign_id[$o]\">$campaign_id[$o] - $campaign_name[$o]</option>\n";}
else {echo "<option value=\"$campaign_id[$o]\">$campaign_id[$o] - $campaign_name[$o]</option>\n";}
$o++;
if ($campaign_id[$o] == $group) {echo "<option selected value=\"$campaign_id[$o]\">$campaign_id[$o] - $campaign_name[$o]</option>\n";}
else {echo "<option value=\"$campaign_id[$o]\">$campaign_id[$o] - $campaign_name[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
@@ -98,74 +98,70 @@ echo "<PRE><FONT SIZE=2>\n\n";
if (!$group)
{
echo "\n\n";
echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
}
else
{
echo "Live Current Hopper List $NOW_TIME\n";
echo "\n";
echo "---------- TOTALS\n";
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
$TOTALcalls = sprintf("%10s", $row[0]);
echo "Total leads in hopper right now: $TOTALcalls\n";
##############################
######### LEAD STATS
echo "\n";
echo "---------- LEADS IN HOPPER\n";
echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
echo "|ORDER |PRIORITY| LEAD ID | LIST ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n";
echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.status='READY' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$users_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $users_to_print)
{
$row=mysql_fetch_row($rslt);
$FMT_i = sprintf("%-4s", $i);
$lead_id = sprintf("%-9s", $row[0]);
$phone_number = sprintf("%-10s", $row[1]);
$state = sprintf("%-5s", $row[2]);
$status = sprintf("%-6s", $row[3]);
$count = sprintf("%-5s", $row[4]);
$gmt = sprintf("%-6s", $row[5]);
$hopper_id = sprintf("%-6s", $row[6]);
$alt_dial = sprintf("%-5s", $row[7]);
$list_id = sprintf("%-10s", $row[8]);
$priority = sprintf("%-6s", $row[9]);
if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";}
else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";}
$i++;
echo "\n\n";
echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
}
echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
else
{
echo "Live Current Hopper List $NOW_TIME\n";
echo "\n";
echo "---------- TOTALS\n";
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
$TOTALcalls = sprintf("%10s", $row[0]);
echo "Total leads in hopper right now: $TOTALcalls\n";
}
##############################
######### LEAD STATS
echo "\n";
echo "---------- LEADS IN HOPPER\n";
echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
echo "|ORDER |PRIORITY| LEAD ID | LIST ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n";
echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.status='READY' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$users_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $users_to_print)
{
$row=mysql_fetch_row($rslt);
$FMT_i = sprintf("%-4s", $i);
$lead_id = sprintf("%-9s", $row[0]);
$phone_number = sprintf("%-10s", $row[1]);
$state = sprintf("%-5s", $row[2]);
$status = sprintf("%-6s", $row[3]);
$count = sprintf("%-5s", $row[4]);
$gmt = sprintf("%-6s", $row[5]);
$hopper_id = sprintf("%-6s", $row[6]);
$alt_dial = sprintf("%-5s", $row[7]);
$list_id = sprintf("%-10s", $row[8]);
$priority = sprintf("%-6s", $row[9]);
if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";}
else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";}
$i++;
}
echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
}
?>
</PRE>
</BODY></HTML>
</BODY></HTML>
+3 -3
View File
@@ -59,7 +59,7 @@
# 91102-2013 - Changed in-group color styles for incoming calls waiting
#
$version = '2.0.5-48';
$version = '2.2.0-48';
$build = '91102-2013';
header ("Content-type: text/html; charset=utf-8");
@@ -166,12 +166,12 @@ function get_server_load($windows = false)
{
$load = file_get_contents("/proc/loadavg");
$load = explode(' ', $load);
return $load[0];
return $load[0] . ' ' . $load[1] . ' ' . $load[2];
}
elseif(function_exists("shell_exec"))
{
$load = explode(' ', `uptime`);
return $load[count($load)-1];
return $load[count($load)-3] . ' ' . $load[count($load)-2] . ' ' . $load[count($load)-1];
}
else
{
+28 -25
View File
@@ -1987,11 +1987,12 @@ else
# 90930-2107 - Added agent territory selection options for ViciDial agents
# 91026-1050 - Added AREACODE DNC option for campaigns
# 91031-1232 - Added carrier_description field, campaigns links from in-group screen, server links on reports page, agent ranks listing active only
# 91121-0334 - Limited list called count display to 100+
#
# 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.2.0-222';
$build = '91031-1232';
$admin_version = '2.2.0-223';
$build = '91121-0334';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -18653,7 +18654,7 @@ if ($ADD==311)
$leads_in_list = 0;
$leads_in_list_N = 0;
$leads_in_list_Y = 0;
$stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count";
$stmt="SELECT status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list where list_id='$list_id' group by status, if(called_count >= 100, 100, called_count) order by status,called_count";
$rslt=mysql_query($stmt, $link);
$status_called_to_print = mysql_num_rows($rslt);
@@ -18663,28 +18664,28 @@ if ($ADD==311)
$all_called_first=1000;
$all_called_last=0;
while ($status_called_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$leads_in_list = ($leads_in_list + $rowx[2]);
$count_statuses[$o] = "$rowx[0]";
$count_called[$o] = "$rowx[1]";
$count_count[$o] = "$rowx[2]";
$all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]);
if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") )
{
if ($first_row) {$first_row=0;}
else {$sts++;}
$status[$sts] = "$rowx[0]";
$status_called_first[$sts] = "$rowx[1]";
if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];}
}
$leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]);
$status_called_last[$sts] = "$rowx[1]";
if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];}
$rowx=mysql_fetch_row($rslt);
$leads_in_list = ($leads_in_list + $rowx[2]);
$count_statuses[$o] = $rowx[0];
$count_called[$o] = $rowx[1];
$count_count[$o] = $rowx[2];
$all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]);
$o++;
}
if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") )
{
if ($first_row) {$first_row=0;}
else {$sts++;}
$status[$sts] = "$rowx[0]";
$status_called_first[$sts] = "$rowx[1]";
if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];}
}
$leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]);
$status_called_last[$sts] = "$rowx[1]";
if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];}
$o++;
}
echo "<center>\n";
@@ -18696,7 +18697,9 @@ if ($ADD==311)
{
if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';}
else{$AB='bgcolor="#E0FFFF"';}
echo "<td align=center $AB><font size=1>$first</td>";
if ($first >= 100) {$Fplus='+';}
else {$Fplus='';}
echo "<td align=center $AB><font size=1>$first$Fplus</td>";
$first++;
}
echo "<td align=center><font size=1>SUBTOTAL</td></tr>\n";
@@ -19993,7 +19996,7 @@ if ($ADD==311111)
echo "<input type=\"checkbox\" name=\"agent_status_viewable_groups[]\" value=\"--CAMPAIGN-AGENTS--\"";
if (ereg(" --CAMPAIGN-AGENTS-- ", $VGROUP_vgroups))
{echo " CHECKED";}
echo "><B>CAMPAIGN-AGENTS</B> - All users logged into the same camapaign as the agent<BR>\n";
echo "><B>CAMPAIGN-AGENTS</B> - All users logged into the same campaign as the agent<BR>\n";
$stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group";
$rslt=mysql_query($stmt, $link);
+55 -9
View File
@@ -13,6 +13,7 @@
# 90330-1343 - Added more debug info, bug fixes
# 90508-0644 - Changed to PHP long tags
# 90721-1137 - Added rank and owner as vicidial_list fields
# 91121-0253 - Added list name, list description and status name
#
require("dbconnect.php");
@@ -51,12 +52,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$i++;
$non_latin = $row[0];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -212,9 +211,10 @@ if ($run_export > 0)
}
$outbound_calls=0;
$export_rows='';
$k=0;
if ($RUNcampaign > 0)
{
$export_campaign_rows='';
$stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
@@ -231,8 +231,11 @@ if ($run_export > 0)
{
$row=mysql_fetch_row($rslt);
$export_campaign_rows .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\r\n";
$export_status[$k] = $row[2];
$export_list_id[$k] = $row[8];
$export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t";
$i++;
$k++;
$outbound_calls++;
}
}
@@ -240,7 +243,6 @@ if ($run_export > 0)
if ($RUNgroup > 0)
{
$export_group_rows='';
$stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;";
$rslt=mysql_query($stmtA, $link);
if ($DB) {echo "$stmt\n";}
@@ -257,8 +259,11 @@ if ($run_export > 0)
{
$row=mysql_fetch_row($rslt);
$export_group_rows .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\r\n";
$export_status[$k] = $row[2];
$export_list_id[$k] = $row[8];
$export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t";
$i++;
$k++;
}
}
}
@@ -287,7 +292,48 @@ if ($run_export > 0)
ob_clean();
flush();
echo "$export_campaign_rows$export_group_rows";
$i=0;
while ($k > $i)
{
$ex_list_name='';
$ex_list_description='';
$stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ex_list_ct = mysql_num_rows($rslt);
if ($ex_list_ct > 0)
{
$row=mysql_fetch_row($rslt);
$ex_list_name = $row[0];
$ex_list_description = $row[1];
}
$ex_status_name='';
$stmt = "SELECT status_name FROM vicidial_statuses where status='$export_status[$i]';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ex_list_ct = mysql_num_rows($rslt);
if ($ex_list_ct > 0)
{
$row=mysql_fetch_row($rslt);
$ex_status_name = $row[0];
}
else
{
$stmt = "SELECT status_name FROM vicidial_campaign_statuses where status='$export_status[$i]';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ex_list_ct = mysql_num_rows($rslt);
if ($ex_list_ct > 0)
{
$row=mysql_fetch_row($rslt);
$ex_status_name = $row[0];
}
}
echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name\r\n";
$i++;
}
}
else
{