diff --git a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php index 093e967e..0da9e029 100644 --- a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php @@ -32,6 +32,7 @@ # 90508-0644 - Changed to PHP long tags # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields +# 90917-2355 - Added extended alt phone entries # require("dbconnect.php"); @@ -341,6 +342,30 @@ else if ($lead_count > 0) { + ##### grab vicidial_list_alt_phones records ##### + $stmt="select phone_code,phone_number,alt_phone_note,alt_phone_count,active from vicidial_list_alt_phones where lead_id='" . mysql_real_escape_string($lead_id) . "' order by alt_phone_count limit 500;"; + $rslt=mysql_query($stmt, $link); + $alts_to_print = mysql_num_rows($rslt); + + $c=0; + $alts_output = ''; + while ($alts_to_print > $c) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $c)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $c++; + $alts_output .= ""; + $alts_output .= "$c"; + $alts_output .= "$row[0] $row[1]"; + $alts_output .= " $row[2]\n"; + $alts_output .= " $row[3]\n"; + $alts_output .= " $row[4] \n"; + } + ##### grab vicidial_log records ##### $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; $rslt=mysql_query($stmt, $link); @@ -619,6 +644,18 @@ else echo "
\n"; + if ($c > 0) + { + echo "EXTENDED ALTERNATE PHONE NUMBERS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$alts_output\n"; + + echo "
# ALT PHONE ALT NOTE ALT COUNT ACTIVE
\n"; + echo "

\n"; + } + echo "CALLS TO THIS LEAD:\n"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/www/vicidial/admin_search_lead.php b/agc_2-X/trunk/www/vicidial/admin_search_lead.php index 840e16f8..de6e60b9 100644 --- a/agc_2-X/trunk/www/vicidial/admin_search_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_search_lead.php @@ -19,6 +19,7 @@ # 90309-1828 - Added admin_log logging # 90310-2146 - Added admin header # 90508-0644 - Changed to PHP long tags +# 90917-2307 - Added alternate phone number searching option # require("dbconnect.php"); @@ -44,21 +45,24 @@ if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} + elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $phone = ereg_replace("[^0-9]","",$phone); +if (strlen($alt_phone_search) < 2) {$alt_phone_search='No';} $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; - 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 pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} @@ -67,25 +71,24 @@ $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } - else +else { - - if($auth>0) + if ($auth>0) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; + $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfullname = $row[0]; + $LOGmodify_leads = $row[1]; if ($WeBRooTWritablE > 0) { @@ -132,12 +135,8 @@ $subcamp_color = '#C6C6C6'; require("admin_header.php"); - - - echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user
\n"; - if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) )) { echo date("l F j, Y G:i:s A"); @@ -145,7 +144,8 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "\n"; echo "\n"; echo "Please enter a:
Vendor ID(vendor lead code): or \n"; - echo "
a Home Phone Number: or\n"; + echo "
a Home Phone Number: Alt phone search: \n"; + echo " or \n"; echo "
a lead ID: or\n"; echo "
status:   \n"; echo "list ID:   \n"; @@ -161,19 +161,26 @@ else if ($vendor_id) { - $stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' order by modify_date desc limit 1000"; + $stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; } else { if ($phone) { - $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' order by modify_date desc limit 1000"; + if ($alt_phone_search=="Yes") + { + $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' or alt_phone='" . mysql_real_escape_string($phone) . "' or address3='" . mysql_real_escape_string($phone) . "'"; + } + else + { + $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "'"; + } } else { if ($lead_id) { - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' order by modify_date desc limit 1000"; + $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; } else { @@ -196,7 +203,7 @@ else if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';} $userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; } - $stmt="SELECT * from vicidial_list where $statusSQL $list_idSQL $userSQL order by modify_date desc limit 1000"; + $stmt="SELECT * from vicidial_list where $statusSQL $list_idSQL $userSQL"; } else { @@ -206,14 +213,38 @@ else } } } + + $stmt_alt=''; + $results_to_printX=0; + if ( ($alt_phone_search=="Yes") and (strlen($phone) > 4) ) + { + $stmtX="SELECT lead_id from vicidial_list_alt_phones where phone_number='" . mysql_real_escape_string($phone) . "' limit 1000;"; + $rsltX=mysql_query($stmtX, $link); + $results_to_printX = mysql_num_rows($rsltX); + if ($DB) + {echo "\n\n$results_to_printX|$stmtX\n\n";} + $o=0; + while ($results_to_printX > $o) + { + $row=mysql_fetch_row($rsltX); + if ($o > 0) {$stmt_alt .= ",";} + $stmt_alt .= "'$row[0]'"; + $o++; + } + if (strlen($stmt_alt) > 2) + {$stmt_alt = "or lead_id IN($stmt_alt)";} + } + + $stmt = "$stmt$stmt_alt order by modify_date desc limit 1000;"; + if ($DB) { echo "\n\n$stmt\n\n"; } - - $rslt=mysql_query($stmt, $link); + + $rslt=mysql_query("$stmt", $link); $results_to_print = mysql_num_rows($rslt); - if ($results_to_print < 1) + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) { echo date("l F j, Y G:i:s A"); echo "\n

\n";
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD HANGUP REASON PHONE