2006-06-16 snapshot

git-svn-id: svn://192.168.202.10@9 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2006-07-07 15:27:12 +00:00
parent 7b2622b826
commit ca8e640156
30 changed files with 4284 additions and 450 deletions
+56 -28
View File
@@ -66,7 +66,7 @@
# - $CallBackDatETimE - ('2006-04-21 14:30:00',...)
# - $recipient - ('ANYONE,'USERONLY')
# - $callback_id - ('12345','12346',...)
#
# - $use_internal_dnc - ('Y','N')
# changes
# 50629-1044 - First build of script
@@ -101,10 +101,11 @@
# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE
# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60427-1236 - Fixed closer_choice error for CLOSER campaigns
# 60609-1148 - Added ability to check for manual dial numbers in DNC
#
$version = '0.0.31';
$build = '60427-1236';
$version = '0.0.32';
$build = '60609-1148';
require("dbconnect.php");
@@ -368,40 +369,56 @@ if ($ACTION == 'manDiaLnextCaLL')
{
if (strlen($phone_number)>3)
{
if ($stage=='lookup')
if ($use_internal_dnc=='Y')
{
$stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;";
$stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$man_leadID_ct = mysql_num_rows($rslt);
if ($man_leadID_ct > 0)
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$row=mysql_fetch_row($rslt);
$affected_rows=1;
$lead_id =$row[0];
$CBleadIDset=1;
echo "DNC NUMBER\n";
exit;
}
else
{
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$lead_id = mysql_insert_id();
$CBleadIDset=1;
if ($stage=='lookup')
{
$stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$man_leadID_ct = mysql_num_rows($rslt);
if ($man_leadID_ct > 0)
{
$row=mysql_fetch_row($rslt);
$affected_rows=1;
$lead_id =$row[0];
$CBleadIDset=1;
}
else
{
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$lead_id = mysql_insert_id();
$CBleadIDset=1;
}
}
else
{
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$lead_id = mysql_insert_id();
$CBleadIDset=1;
}
}
}
else
{
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$lead_id = mysql_insert_id();
$CBleadIDset=1;
}
}
else
{
@@ -1254,6 +1271,17 @@ if ($ACTION == 'updateDISPO')
$stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') )
{
$stmt = "select phone_number from vicidial_list where lead_id='$lead_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
}
}
$dispo_sec=0;