diff --git a/www/agc/functions.php b/www/agc/functions.php
index 13945936..cd28b126 100644
--- a/www/agc/functions.php
+++ b/www/agc/functions.php
@@ -332,7 +332,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
$STARTtime = date("U");
$TODAY = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
-
+ $MT[0]='';
$server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT");
$CL=':';
@@ -357,14 +357,14 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
- if ($DB>0) {echo "$stmt";}
+ if ($DB>0) {$CFoutput .= "$stmt";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05002',$user,$server_ip,$session_name,$one_mysql_log);}
$tablecount_to_print = mysqli_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$stmt="SELECT count(*) from custom_$list_id;";
- if ($DB>0) {echo "$stmt";}
+ if ($DB>0) {$CFoutput .= "$stmt";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05003',$user,$server_ip,$session_name,$one_mysql_log);}
$fieldscount_to_print = mysqli_num_rows($rslt);
@@ -490,7 +490,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
$stmt="SELECT $select_SQL FROM custom_$list_id where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05005',$user,$server_ip,$session_name,$one_mysql_log);}
- if ($DB) {echo "$stmt\n";}
+ if ($DB) {$CFoutput .= "$stmt\n";}
$list_lead_ct = mysqli_num_rows($rslt);
}
if ($list_lead_ct > 0)
@@ -511,7 +511,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
}
else
{
- if ($DB) {echo _QXZ("ERROR: no custom data for this lead: ")."$lead_id\n";}
+ if ($DB) {$CFoutput .= _QXZ("ERROR: no custom data for this lead: ")."$lead_id\n";}
}
##### END grab the data from custom table for the lead_id
@@ -641,19 +641,10 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
$sourceselect_value = $row[0];
}
}
- $rslt=mysql_to_mysqli($stmt, $link);
- if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05XXX',$user,$server_ip,$session_name,$one_mysql_log);}
- if ($DB) {echo "$stmt\n";}
- $sourceselect_ct = mysqli_num_rows($rslt);
- if ($sourceselect_ct > 0)
- {
- $row=mysqli_fetch_row($rslt);
- $sourceselect_value = $row[0];
- }
+
$custom_refresh_fields .= "$sourceselect_field $sourceselect_type $sourceselect_default $A_field_label[$o] $A_field_type[$o]|";
$temp_sourcematch = "value=>$sourceselect_value";
if ($DB) {echo "Starting SOURCESELECT: |$sourceselect_field|$sourceselect_value|$temp_sourcematch| |$only_field|$source_field_value|$source_field|\n";}
- if ($DB) {echo "Starting SOURCESELECT: |$sourceselect_field|$sourceselect_value|$temp_sourcematch|\n";}
$temp_matchfound=0; $NFA=0;
while ( ($te < $field_options_count) and ($temp_matchfound < 2) )
{
@@ -671,7 +662,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
if (preg_match("/^$temp_sourcematch$/i",trim($field_options_array[$te])) )
{$temp_matchfound=1;}
- if ($DB) {echo "SOURCESELECT 2: $te|$field_options_array[$te]|$temp_matchfound|\n";}
+ if ($DB) {echo "SOURCESELECT 2: $te|$field_options_array[$te]($temp_sourcematch)|$temp_matchfound|\n";}
$te++;
}
@@ -930,6 +921,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
}
if ($A_field_type[$o]=='TIME')
{
+ if ( ($A_field_default[$o] == 'NULL') or (strlen($A_field_default[$o]) < 1) ) {$A_field_default[$o]=0;}
$minute_diff = $A_field_default[$o];
$default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
$default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
@@ -1029,7 +1021,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
if ( (preg_match('/--A--user_custom_|--U--user_custom_/i',$CFoutput)) or (preg_match('/--A--fullname|--U--fullname/i',$CFoutput)) )
{
$stmt = "select custom_one,custom_two,custom_three,custom_four,custom_five,full_name from vicidial_users where user='$user';";
- if ($DB) {echo "$stmt\n";}
+ if ($DB) {$CFoutput .= "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05006',$user,$server_ip,$session_name,$one_mysql_log);}
$VUC_ct = mysqli_num_rows($rslt);
@@ -1054,7 +1046,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
### find the dialed number and label for this call
$stmt = "SELECT phone_number,alt_dial from vicidial_log where uniqueid='$uniqueid';";
- if ($DB) {echo "$stmt\n";}
+ if ($DB) {$CFoutput .= "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05008',$user,$server_ip,$session_name,$one_mysql_log);}
$vl_dialed_ct = mysqli_num_rows($rslt);
@@ -1246,7 +1238,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05007',$user,$server_ip,$session_name,$one_mysql_log);}
- if ($DB) {echo "$stmt\n";}
+ if ($DB) {$CFoutput .= "$stmt\n";}
$list_lead_ct = mysqli_num_rows($rslt);
if ($list_lead_ct > 0)
{
@@ -1290,7 +1282,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
$row=mysqli_fetch_row($rslt);
### find the dialed number and label for this call
$stmt="SELECT list_name,list_description from vicidial_lists where list_id='$list_id';";
- if ($DB) {echo "$stmt\n";}
+ if ($DB) {$CFoutput .= "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05021',$user,$server_ip,$session_name,$one_mysql_log);}
$li_ct = mysqli_num_rows($rslt);
@@ -1308,7 +1300,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
$row=mysqli_fetch_row($rslt);
### find the did_carrier_description for this call
$stmt="SELECT did_carrier_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$did_id';";
- if ($DB) {echo "$stmt\n";}
+ if ($DB) {$CFoutput .= "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05022',$user,$server_ip,$session_name,$one_mysql_log);}
$dcd_ct = mysqli_num_rows($rslt);
@@ -1505,16 +1497,16 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
}
}
- if ($DB > 0) {echo "$CFoutput
\n";}
+ if ($DB > 0) {$CFoutput .= "$CFoutput
\n";}
}
##### END parsing for vicidial variables #####
if (strlen($only_field) < 1)
{
- echo "\n";
- echo "\n";
- echo "\n";
- echo "\n";
- echo "\n";
+ $CFoutput .= "\n";
+ $CFoutput .= "\n";
+ $CFoutput .= "\n";
+ $CFoutput .= "\n";
+ $CFoutput .= "\n";
}
return $CFoutput;
diff --git a/www/agc/vdc_form_display.php b/www/agc/vdc_form_display.php
index 42b13cb9..c21e7205 100644
--- a/www/agc/vdc_form_display.php
+++ b/www/agc/vdc_form_display.php
@@ -908,7 +908,7 @@ if ($SUBMIT_only < 1)
{
LSview_query = "only_field=" + temp_field + "&source_field=" + temp_source + "&source_field_value=" + temp_source_value + "&stage=REFRESH_SINGLE_FIELD&";
//document.getElementById("debugbottomspan2").innerHTML = LSview_query;
- xmlhttp.open('POST', '');
+ xmlhttp.open('POST', 'vdc_form_display.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(LSview_query);
xmlhttp.onreadystatechange = function()
@@ -922,7 +922,7 @@ if ($SUBMIT_only < 1)
if (custom_refresh_fields.match(REFRESHfieldREG))
{
//debug_append = debug_append + "\n" + temp_field + ' timeout: ' + task_timeout;
- document.getElementById("debugbottomspan2").insertAdjacentHTML('beforeend',debug_append);
+ //document.getElementById("debugbottomspan2").insertAdjacentHTML('beforeend',debug_append);
setTimeout(field_refresh, 100, temp_field);
}
}