diff --git a/UPGRADE b/UPGRADE index 0a07474c..e2960a4d 100644 --- a/UPGRADE +++ b/UPGRADE @@ -462,6 +462,8 @@ OTHER CHANGES: If the User Group also has Call Log enabled, the agent can also see the call notes from previous calls. +109. Added the add-a-new-lead link to the admin interface + diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 25385d71..38e4bf1d 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -511,6 +511,9 @@ This option allows you to pre-set the My Callback checkbox on the agent schedule Call Notes Per Call|| Setting this option to ENABLED will allow agents to enter in notes for every call they handle in the agent interface. The notes entry field will appear below the Comments field in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for a lead at any time. Default is DISABLED|| If List Order Randomize is enabled, this option will be ignored|| +ERROR: Lead not added, please go back and look at what you entered|| +Lead has been added|| +Add A New Lead|| AST_LISTS_campaign_stats.php diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 7c790381..d86a739a 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -2643,12 +2643,13 @@ else # 110124-1134 - Small query fix for large queue_log tables # 110212-2048 - Added Scheduled Callback as status flag to allow for custom scheduled callback statuses # 110214-0001 - Added campaign settings for lead_order_secondary, per_call_notes and my_callback_option +# 110215-1721 - Added add-a-new-lead link to the lists submenu # # 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-299'; -$build = '110214-0001'; +$admin_version = '2.4-300'; +$build = '110215-1721'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); diff --git a/www/vicidial/admin_header.php b/www/vicidial/admin_header.php index 2cc62d1e..8f13706c 100644 --- a/www/vicidial/admin_header.php +++ b/www/vicidial/admin_header.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES @@ -28,6 +28,7 @@ # 100914-1311 - Removed other links for reports-only users # 101022-1323 - Added IGU_selectall function # 101107-1133 - Added auto-refresh code +# 110215-1720 - Added the Add a new lead link # @@ -1145,6 +1146,8 @@ $SScustom_fields_enabled = $row[3]; >   > Search For A Lead >   + > Add A New Lead + >   > >   > Load New Leads diff --git a/www/vicidial/admin_modify_lead.php b/www/vicidial/admin_modify_lead.php index 4ea21b8f..5b97561e 100644 --- a/www/vicidial/admin_modify_lead.php +++ b/www/vicidial/admin_modify_lead.php @@ -42,6 +42,7 @@ # 101127-1610 - Added ability to set a scheduled callback date and time # 110212-2041 - Added compatibility with definable scheduled callback statuses # 110215-1411 - Added display of call notes to log records +# 110215-1717 - Changed empty lead_id behavior to be add-a-lead functionality # require("dbconnect.php"); @@ -316,10 +317,29 @@ if ($scb_count_to_print > 0) ADMINISTRATION: Lead record modification
\n"; +if ($lead_id == 'NEW') + { + $stmt="INSERT INTO vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "', list_id='" . mysql_real_escape_string($list_id) . "'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + echo "Lead has been added: $lead_id

\n"; + $end_call=0; + } + else + {echo "ERROR: Lead not added, please go back and look at what you entered

\n";} + } + +if (strlen($lead_id) < 1) + {$lead_id = 'NEW';} + if ($end_call > 0) { ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "',vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -464,15 +484,6 @@ else } - - - - - - - - - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -680,7 +691,34 @@ else $owner = $row[33]; $entry_list_id = $row[34]; - echo "
Call information: $first_name $last_name - $phone_number

\n"; + if ($lead_id == 'NEW') + { + ##### create a select list of lists if a NEW lead_id ##### + $stmt="select list_id,campaign_id,list_name from vicidial_lists order by list_id limit 5000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + $Lc=0; + $select_list = '"; + + $list_id=$select_list; + } + + if ($lead_id == 'NEW') + {echo "
Add A New Lead\n";} + else + {echo "
Call information: $first_name $last_name - $phone_number\n";} + + echo "

\n"; echo "\n"; echo "\n"; echo "\n"; @@ -694,8 +732,9 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + if ($lead_id == 'NEW') {$list_id='';} echo "\n"; @@ -715,475 +754,485 @@ else echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; } - $stmt="SELECT scheduled_callback from vicidial_campaign_statuses where status='$dispo';"; - $rslt=mysql_query($stmt, $link); - $scb_count_to_print = mysql_num_rows($rslt); - if ($scb_count_to_print > 0) + else { - $row=mysql_fetch_row($rslt); - if (strlen($row[0])>0) {$scheduled_callback = $row[0];} + echo "\n"; } - $list_campaign=''; - $stmt="SELECT campaign_id from vicidial_lists where list_id='$list_id'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $Cstatuses_to_print = mysql_num_rows($rslt); - if ($Cstatuses_to_print > 0) - { - $row=mysql_fetch_row($rslt); - $list_campaign = $row[0]; - } - - $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_statuses where selectable='Y' order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $statuses_list=''; - - $o=0; - $DS=0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) - {$statuses_list .= "\n"; $DS++;} - else - {$statuses_list .= "\n";} - $o++; - } - - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where selectable='Y' and campaign_id='$list_campaign' order by status"; - $rslt=mysql_query($stmt, $link); - $CAMPstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - $CBhold_set=0; - while ($CAMPstatuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) - {$statuses_list .= "\n"; $DS++;} - else - {$statuses_list .= "\n";} - if ($rowx[0] == 'CBHOLD') {$CBhold_set++;} - $o++; - } - - if ($dispo == 'CBHOLD') {$CBhold_set++;} - - if ($DS < 1) - {$statuses_list .= "\n";} - if ($CBhold_set < 1) - {$statuses_list .= "\n";} - echo "$statuses_list"; - echo "(with $list_campaign statuses)\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; echo "
$label_vendor_lead_code: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     List ID: $list_id     Called Count: $called_count
Lead ID: $lead_id     List ID: $list_id
Fronter: $tsr     Called Count: $called_count
$label_title:   \n"; echo "$label_first_name:
$label_alt_phone :
$label_email :
$label_security_phrase :
$label_vendor_lead_code :
Rank :
Owner :
$label_comments :
Disposition:
Disposition: (with $list_campaign statuses)
Modify vicidial log
Modify agent log
Modify closer log
Add closer log record
Modify vicidial log
Modify agent log
Modify closer log
Add closer log record
\n"; echo "


\n"; - echo "
\n"; - echo "Callback Details:
\n"; - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') or ($scheduled_callback == 'Y') ) + if ($lead_id != 'NEW') { - ### find any vicidial_callback records for this lead - $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group,lead_status from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) + echo "
\n"; + echo "Callback Details:
\n"; + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') or ($scheduled_callback == 'Y') ) { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group,lead_status from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UserID: \n"; + echo "

\n"; + } + else + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UserID: \n"; + echo "

\n"; + } + $callback_id = $rowx[0]; + $CBcomments = $rowx[10]; + $lead_status = $rowx[12]; + $appointment_datetimeARRAY = explode(" ",$rowx[6]); + $appointment_date = $appointment_datetimeARRAY[0]; + $appointment_timeARRAY = explode(":",$appointment_datetimeARRAY[1]); + $appointment_hour = $appointment_timeARRAY[0]; + $appointment_min = $appointment_timeARRAY[1]; + + + + $stmt="SELECT status,status_name from vicidial_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + $statuses_list=''; + + $o=0; + $DS=0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + $stmt="SELECT status,status_name from vicidial_campaign_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') and campaign_id='$list_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + $CBhold_set=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) + {$statuses_list .= "\n";} + + ?> + +
+
Change Scheduled Callback Date:
+ + + + + + + + + + + + + + + + + +
+ > + + + + +
CallBack Date/Time: + + +     + + : + + +
+ Callback Disposition: +
+ Comments: + + +
+ + + + +
+ +
+ +
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - $callback_id = $rowx[0]; - $CBcomments = $rowx[10]; - $lead_status = $rowx[12]; - $appointment_datetimeARRAY = explode(" ",$rowx[6]); - $appointment_date = $appointment_datetimeARRAY[0]; - $appointment_timeARRAY = explode(":",$appointment_datetimeARRAY[1]); - $appointment_hour = $appointment_timeARRAY[0]; - $appointment_min = $appointment_timeARRAY[1]; - - - - $stmt="SELECT status,status_name from vicidial_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $statuses_list=''; - - $o=0; - $DS=0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) - {$statuses_list .= "\n"; $DS++;} - else - {$statuses_list .= "\n";} - $o++; + echo "
No Callback records found
\n"; } - $stmt="SELECT status,status_name from vicidial_campaign_statuses where scheduled_callback='Y' and selectable='Y' and status NOT IN('CBHOLD') and campaign_id='$list_campaign' order by status"; - $rslt=mysql_query($stmt, $link); - $CAMPstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - $CBhold_set=0; - while ($CAMPstatuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) - {$statuses_list .= "\n"; $DS++;} - else - {$statuses_list .= "\n";} - $o++; - } - - if ($DS < 1) - {$statuses_list .= "\n";} - - ?> - -
-
Change Scheduled Callback Date:
- - - - - - - - - - - - - - - - - -
- > - - - - -
CallBack Date/Time: - - -     - - : - - -
- Callback Disposition: -
- Comments: - - -
- - - - -
- -
- - No Callback records found
\n"; + echo "
If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time.
\n"; + } + echo "
\n"; + + echo "

\n"; + + 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"; } - } - else - { - echo "
If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time.
\n"; - } - echo "
\n"; - echo "

\n"; - echo "
\n"; + ### iframe for custom fields display/editing + if ($custom_fields_enabled > 0) + { + $CLlist_id = $list_id; + if (strlen($entry_list_id) > 2) + {$CLlist_id = $entry_list_id;} + $stmt="SHOW TABLES LIKE \"custom_$CLlist_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; - if ($c > 0) - { - echo "EXTENDED ALTERNATE PHONE NUMBERS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; + echo "CUSTOM FIELDS FOR THIS LEAD:
\n"; + echo "\n"; + echo "

"; + } + } + } - echo "$alts_output\n"; + + echo "CALLS TO THIS LEAD:\n"; + echo "
# ALT PHONE ALT NOTE ALT COUNT ACTIVE
\n"; + echo "\n"; + + echo "$call_log\n"; echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD HANGUP REASON PHONE
\n"; echo "

\n"; - } + + echo "CLOSER RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + echo "$closer_log\n"; + + echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD WAIT HANGUP REASON
\n"; + echo "

\n"; + echo "AGENT LOG RECORDS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; - ### iframe for custom fields display/editing - if ($custom_fields_enabled > 0) - { - $CLlist_id = $list_id; - if (strlen($entry_list_id) > 2) - {$CLlist_id = $entry_list_id;} - $stmt="SHOW TABLES LIKE \"custom_$CLlist_id\";"; - if ($DB>0) {echo "$stmt";} + echo "$agent_log\n"; + + echo "
# DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
\n"; + echo "

\n"; + + + echo "RECORDINGS FOR THIS LEAD:\n"; + echo "\n"; + echo "\n"; + + $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; $rslt=mysql_query($stmt, $link); - $tablecount_to_print = mysql_num_rows($rslt); - if ($tablecount_to_print > 0) + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) { - $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; - if ($DB>0) {echo "$stmt";} - $rslt=mysql_query($stmt, $link); - $fieldscount_to_print = mysql_num_rows($rslt); - if ($fieldscount_to_print > 0) + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $location = $row[11]; + + if (strlen($location)>2) { - $rowx=mysql_fetch_row($rslt); - $custom_records_count = $rowx[0]; - - echo "CUSTOM FIELDS FOR THIS LEAD:
\n"; - echo "\n"; - echo "

"; - } - } - } - - - echo "CALLS TO THIS LEAD:\n"; - echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
\n"; - echo "\n"; - - echo "$call_log\n"; - - echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD HANGUP REASON PHONE
\n"; - echo "

\n"; - - echo "CLOSER RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$closer_log\n"; - - echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD WAIT HANGUP REASON
\n"; - echo "

\n"; - - - echo "AGENT LOG RECORDS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - echo "$agent_log\n"; - - echo "
# DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
\n"; - echo "

\n"; - - - echo "RECORDINGS FOR THIS LEAD:\n"; - echo "\n"; - echo "\n"; - - $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - if ($DB) {echo "$logs_to_print|$stmt|\n";} - - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $location = $row[11]; - - if (strlen($location)>2) - { - $URLserver_ip = $location; - $URLserver_ip = eregi_replace('http://','',$URLserver_ip); - $URLserver_ip = eregi_replace('https://','',$URLserver_ip); - $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); - $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - - if ($rowx[0] > 0) - { - $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; + $URLserver_ip = $location; + $URLserver_ip = eregi_replace('http://','',$URLserver_ip); + $URLserver_ip = eregi_replace('https://','',$URLserver_ip); + $URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); + $stmt="select count(*) from servers where server_ip='$URLserver_ip';"; $rsltx=mysql_query($stmt, $link); $rowx=mysql_fetch_row($rsltx); - if (eregi("ALT_IP",$rowx[0])) + if ($rowx[0] > 0) { - $location = eregi_replace($URLserver_ip, $rowx[1], $location); - } - if (eregi("EXTERNAL_IP",$rowx[0])) - { - $location = eregi_replace($URLserver_ip, $rowx[2], $location); + $stmt="select recording_web_link,alt_server_ip,external_server_ip from servers where server_ip='$URLserver_ip';"; + $rsltx=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rsltx); + + if (eregi("ALT_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[1], $location); + } + if (eregi("EXTERNAL_IP",$rowx[0])) + { + $location = eregi_replace($URLserver_ip, $rowx[2], $location); + } } } + + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + } - if (strlen($location)>30) - {$locat = substr($location,0,27); $locat = "$locat...";} - else - {$locat = $location;} - if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) - {$location = "$locat";} - else - {$location = $locat;} - $u++; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; + echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
$u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]
$u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]


\n"; + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $admin_display=$row[0]; + if ($admin_display > 0) + { + echo "Click here to see Lead Modify changes to this lead\n"; + } + + echo "\n"; } - - - echo "

\n"; - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; - if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $admin_display=$row[0]; - if ($admin_display > 0) - { - echo "Click here to see Lead Modify changes to this lead\n"; - } - - echo "\n"; } - $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime);