Modified fcstats.php to use sales status flag for SALES

Updated vicidial Firefox plugin for click-to-dial to work with newer versions of Firefox
Added --temp_dir= flag to the AST_VDsales_export.pl script to fix concurrency issues

git-svn-id: svn://192.168.202.10@1837 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2012-07-06 12:08:58 +00:00
parent 36ffd13a87
commit b34ea7bcbc
4 changed files with 31 additions and 5 deletions
+13 -1
View File
@@ -29,6 +29,7 @@
# 101022-1022 - Added hours minutes seconds to filename variables
# 110829-1045 - Changed recording lookup to try to find by vicidial_id first
# 120511-2029 - Added CLI options for FTP login details
# 120705-1954 - Added --temp-dir=XXX option
#
$txt = '.txt';
@@ -176,6 +177,7 @@ if (length($ARGV[0])>1)
print " [--ftp-pass=XXXXXXXX] = FTP pass\n";
print " [--ftp-dir=XXXXXXXX] = remote FTP server directory to post files to\n";
print " [--with-transfer-audio] = Different method for finding audio, also grabs transfer audio filenames\n";
print " [--temp-dir=XXX] = If running more than one instance at a time, specify a unique temp directory suffix\n";
print " [--with-did-lookup] = Looks up the DID pattern and name the call came in on if possible\n";
print " [--email-list=test@test.com:test2@test.com] = send email results to these addresses\n";
print " [--email-sender=vicidial@localhost] = sender for the email results\n";
@@ -338,6 +340,16 @@ if (length($ARGV[0])>1)
if (!$Q)
{print "\n----- IGNORE CALLTIME FOR OUTBOUND -----\n\n";}
}
if ($args =~ /--temp-dir=/i)
{
@data_in = split(/--temp-dir=/,$args);
$temp_dir = $data_in[1];
$temp_dir =~ s/ .*//gi;
$temp_dir =~ s/:/,/gi;
if ($DB > 0) {print "\n----- TEMP DIR: $temp_dir -----\n\n";}
}
else
{$temp_dir = '';}
if ($args =~ /-ftp-transfer/i)
{
if (!$Q)
@@ -382,7 +394,7 @@ if (length($ARGV[0])>1)
}
}
}
$tempdir = '/root/tempaudioexport';
$tempdir = "/root/tempaudioexport$temp_dir";
if (!-e "$tempdir")
{`mkdir -p $tempdir`;}
## remove old audio files from directory
@@ -14,7 +14,7 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
<em:minVersion>3.0</em:minVersion>
<em:maxVersion>3.9</em:maxVersion>
<em:maxVersion>99.9</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
+17 -3
View File
@@ -20,6 +20,7 @@
# 110703-1828 - Added download option
# 111104-1213 - Added user_group restrictions for selecting in-groups
# 120224-0910 - Added HTML display option with bar graphs
# 120705-2007 - Changed SALES to use sales status flag
#
require("dbconnect.php");
@@ -279,7 +280,18 @@ $HTML_text.="In-Group Fronter-Closer Stats Report $NOW_TIME
$HTML_text.="\n";
$HTML_text.="---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n";
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status = 'SALE';";
$sale_dispo_stmt="select distinct status from vicidial_campaign_statuses where sale='Y' and campaign_id in (SELECT campaign_id from vicidial_campaigns where closer_campaigns LIKE \"% " . mysql_real_escape_string($group) . " %\" $LOGallowed_campaignsSQL) UNION select distinct status from vicidial_statuses where sale='Y'";
if ($DB) {$HTML_text.="$sale_dispo_stmt\n";}
$sale_dispo_rslt=mysql_query($sale_dispo_stmt, $link);
$sale_dispos="'SALE'"; $sale_dispo_str="|SALE";
while ($ssrow=mysql_fetch_row($sale_dispo_rslt)) {
$sale_dispos.=",'$ssrow[0]'";
$sale_dispo_str.="|$ssrow[0]";
}
$sale_dispo_str.="|";
if ($DB) {$HTML_text.="Sale dispo string: $sale_dispo_str\n";}
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status in ($sale_dispos);";
$rslt=mysql_query($stmt, $link);
if ($DB) {$HTML_text.="$stmt\n";}
$row=mysql_fetch_row($rslt);
@@ -665,12 +677,13 @@ while ($i < $users_to_print)
{
$row=mysql_fetch_row($rslt);
$recL=0;
if ( ($row[0]=='SALE') and ($recL < 1) )
if ( preg_match("/\|$row[0]\|/", $sale_dispo_str) and ($recL < 1) )
{
$A1=$row[1]; $recL++;
$sales=($sales + $row[1]);
$points = ($points + ($row[1] * 1) );
}
/*
if ( ($row[0]=='A2') and ($recL < 1) )
{
$A2=$row[1]; $recL++;
@@ -693,6 +706,7 @@ while ($i < $users_to_print)
$uBOT=($uBOT + $row[1]);
$points = ($points + ($row[1] * 3) );
}
*/
# if ( ($row[0]=='A5') and ($recL < 1) ) {$A5=$row[1]; $recL++;}
# if ( ($row[0]=='A6') and ($recL < 1) ) {$A6=$row[1]; $recL++;}
# if ( ($row[0]=='A7') and ($recL < 1) ) {$A7=$row[1]; $recL++;}
@@ -745,7 +759,7 @@ while ($i < $users_to_print)
if ($A1>$max_sales) {$max_sales=$A1;}
if ($DROP>$max_drops) {$max_drops=$DROP;}
if ($OTHER>$max_other) {$max_other=$OTHER;}
if ($sales>$max_sales2) {$max_sales=$sales;}
if ($sales>$max_sales2) {$max_sales2=$sales;}
if ($Cpct>$max_conv_pct) {$max_conv_pct=$Cpct;}
$graph_stats[$i][0]="$user[$i] - $full_name[$i]";
$graph_stats[$i][1]=$USERcalls[$i];