diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_days_time.php b/agc_2-X/trunk/www/vicidial/AST_agent_days_time.php new file mode 100644 index 00000000..6e43f27e --- /dev/null +++ b/agc_2-X/trunk/www/vicidial/AST_agent_days_time.php @@ -0,0 +1,721 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 150114-2158 - First build based on AST_agent_days_detail.php +# + +$startMS = microtime(); + +require("dbconnect_mysqli.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} + elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +if (strlen($shift)<2) {$shift='ALL';} + +$report_name = 'Single Agent Daily Time'; +$db_source = 'M'; +$JS_text="\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo ""._QXZ("$report_name")."\n"; + echo ""; + + $short_header=1; + + require("admin_header.php"); + + echo "\n"; + $ASCII_text.="\n"; + $ASCII_text.="
\n";
+	$GRAPH_text.="
\n";
+	}
+
+if (strlen($group[0]) < 1)
+	{
+	echo "\n";
+	echo _QXZ("PLEASE SELECT A USER AND DATE-TIME ABOVE AND CLICK SUBMIT")."\n";
+	echo " "._QXZ("NOTE: stats taken from shift specified")."\n";
+	}
+
+else
+	{
+	if ($shift == 'AM') 
+		{
+		$time_BEGIN=$AM_shift_BEGIN;
+		$time_END=$AM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+		if (strlen($time_END) < 6) {$time_END = "15:14:59";}
+		}
+	if ($shift == 'PM') 
+		{
+		$time_BEGIN=$PM_shift_BEGIN;
+		$time_END=$PM_shift_END;
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+		}
+	if ($shift == 'ALL') 
+		{
+		if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+		if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+		}
+	$query_date_BEGIN = "$query_date $time_BEGIN";   
+	$query_date_END = "$end_date $time_END";
+
+	if ($file_download < 1)
+		{
+		$ASCII_text.=_QXZ("Agent Days Time Report",24).": $user                     $NOW_TIME\n";
+		$ASCII_text.=_QXZ("Time range").": $query_date_BEGIN "._QXZ("to")." $query_date_END\n\n";
+		$ASCII_text.="---------- "._QXZ("AGENT Details")." -------------\n\n";
+		$GRAPH_text.=_QXZ("Agent Days Time Report",24).": $user                     $NOW_TIME\n";
+		$GRAPH_text.=_QXZ("Time range").": $query_date_BEGIN "._QXZ("to")." $query_date_END\n\n";
+		$GRAPH_text.="---------- "._QXZ("AGENT Details")." -------------\n";
+		}
+	else
+		{
+		$file_output .= _QXZ("Agent Days Time Report",24).": $user                     $NOW_TIME\n";
+		$file_output .= _QXZ("Time range").": $query_date_BEGIN "._QXZ("to")." $query_date_END\n\n";
+		}
+
+	$statuses='-';
+	$statusesTXT='';
+	$statusesHEAD='';
+	$statusesHTML='';
+	$statusesFILE='';
+	$statusesARY[0]='';
+	$j=0;
+	$dates='-';
+	$datesARY[0]='';
+	$date_namesARY[0]='';
+	$k=0;
+
+	$stmt="select date_format(event_time, '%Y-%m-%d') as date,count(*) as calls from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and vicidial_agent_log.user='$user' $group_SQL $user_group_SQL $vuLOGadmin_viewable_groupsSQL group by date order by date desc limit 500000;";
+	$rslt=mysql_to_mysqli($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$rows_to_print = mysqli_num_rows($rslt);
+	$i=0;
+	while ($i < $rows_to_print)
+		{
+		$row=mysqli_fetch_row($rslt);
+
+		if ( ($row[1] > 0) and (strlen($row[0]) > 0) )
+			{
+			$date[$i] =			$row[0];
+			$calls[$i] =		$row[1];
+			if (!preg_match("/\-$date[$i]\-/i", $dates))
+				{
+				$dates .= "$date[$i]-";
+				$datesARY[$k] = $date[$i];
+				$k++;
+				}
+			}
+		$i++;
+		}
+
+
+	$MAIN.="


\n"; + $MAIN.="\n"; + $MAIN.="\n"; + echo $MAIN; + + $i=0; + while ($i < $rows_to_print) + { + $MAIN=''; + $VALstart_time = "$date[$i] 00:00:00"; + $VALstop_time = "$date[$i] 23:59:59"; + + $stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='$user' and event_time >= '$VALstart_time' and event_time <= '$VALstop_time' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; + if ($DB) {$MAIN.="agent activity|$stmt|";} + $rslt=mysql_to_mysqli($stmt, $link); + $logs_to_print = mysqli_num_rows($rslt); + + $u=0; + $TOTALpauseSECONDS=0; + $TOTALwaitSECONDS=0; + $TOTALtalkSECONDS=0; + $TOTALdispoSECONDS=0; + $TOTALdeadSECONDS=0; + $TOTALcustomerSECONDS=0; + $TOTALtotalSECONDS=0; + + while ($logs_to_print > $u) + { + $row=mysqli_fetch_row($rslt); + $event_time = $row[0]; + $lead_id = $row[1]; + $campaign_id = $row[2]; + $pause_sec = $row[3]; + $wait_sec = $row[4]; + $talk_sec = $row[5]; + $dispo_sec = $row[6]; + $dead_sec = $row[7]; + $status = $row[8]; + $pause_code = $row[9]; + $user_group = $row[10]; + $customer_sec = ($talk_sec - $dead_sec); + if ($customer_sec < 0) + {$customer_sec=0;} + + if (preg_match("/1$|3$|5$|7$|9$/i", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); + $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); + $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); + $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); + $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); + $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + + if ($DB > 0) + { + $DBtotal_sec = ($pause_sec + $wait_sec + $talk_sec + $dispo_sec); + $DBdatetime = explode(" ",$event_time); + $DBdate = explode("-",$DBdatetime[0]); + $DBtime = explode(":",$DBdatetime[1]); + + $DBcall_end_sec = mktime($DBtime[0], $DBtime[1], ($DBtime[2] + $DBtotal_sec), $DBdate[1], $DBdate[2], $DBdate[0]); + $DBcall_end = date("Y-m-d H:i:s",$DBcall_end_sec); + # $MAIN.=""; + # $MAIN.=""; + # $MAIN.=""; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + } + + $u++; + # $MAIN.=""; + # $MAIN.=""; + # $MAIN.=""; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $CSV_text7.="\"\",\"$u\",\"$event_time\",\"$pause_sec\",\"$wait_sec\",\"$talk_sec\",\"$dispo_sec\",\"$dead_sec\",\"$customer_sec\",\"$status\",\"$lead_id\",\"$campaign_id\",\"$pause_code \"\n"; + } + + # $MAIN.=""; + # $MAIN.=""; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $MAIN.="\n"; + # $CSV_text7.="\"\",\"\",\""._QXZ("TOTALS")."\",\"$TOTALpauseSECONDS\",\"$TOTALwaitSECONDS\",\"$TOTALtalkSECONDS\",\"$TOTALdispoSECONDS\",\"$TOTALdeadSECONDS\",\"$TOTALcustomerSECONDS\"\n"; + + $TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); + $TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); + $TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); + $TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); + $TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); + $TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); + $TOTALtotalSECONDS = ($TOTALpauseSECONDS + $TOTALwaitSECONDS + $TOTALtalkSECONDS + $TOTALdispoSECONDS); + $TOTALtotalSECONDShh = sec_convert($TOTALtotalSECONDS,'H'); + + $MAIN.=""; + $MAIN.=""; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $MAIN.="\n"; + + echo $MAIN; + $MAIN=''; + + # $CSV_text7.="\"\",\"\",\""._QXZ("(in HH:MM:SS)")."\",\"$TOTALpauseSECONDShh\",\"$TOTALwaitSECONDShh\",\"$TOTALtalkSECONDShh\",\"$TOTALdispoSECONDShh\",\"$TOTALdeadSECONDShh\",\"$TOTALcustomerSECONDShh\"\n"; + + $i++; + } + + $MAIN.="
"._QXZ("DATE")." "._QXZ("PAUSE")." "._QXZ("WAIT")." "._QXZ("TALK")." "._QXZ("DISPO")." "._QXZ("DEAD")." "._QXZ("CUSTOMER")." "._QXZ("TOTAL")."
 $DBcall_end $DBtotal_sec                  
$u$event_time $pause_sec $wait_sec $talk_sec $dispo_sec $dead_sec $customer_sec $status $lead_id $campaign_id $pause_code
"._QXZ("TOTALS")." $TOTALpauseSECONDS $TOTALwaitSECONDS $TOTALtalkSECONDS $TOTALdispoSECONDS $TOTALdeadSECONDS $TOTALcustomerSECONDS  
$date[$i] $TOTALpauseSECONDShh $TOTALwaitSECONDShh $TOTALtalkSECONDShh $TOTALdispoSECONDShh $TOTALdeadSECONDShh $TOTALcustomerSECONDShh $TOTALtotalSECONDShh


\n"; + } + +echo $MAIN; + +echo "
\n"; +echo "
"._QXZ("Dates").":
"; +echo "\n"; +echo ""; + +?> + + "._QXZ("to")."
"; + +?> + +
"._QXZ("Campaigns").":
"; +echo "\n"; +echo "
"; +#echo _QXZ("Display as").":   
"; +#echo "\n

"; +echo "
"._QXZ("User").":
"; +echo "\n"; +echo "
"._QXZ("Shift").":
"; +echo "

\n"; +echo "\n"; +echo "
        "; +echo ""; +if (strlen($user) > 1) + { + echo " "._QXZ("USER")." | \n"; + echo " "._QXZ("USER STATS")." | \n"; + } +else + {echo " "._QXZ("USERS")." | \n";} +echo ""._QXZ("REPORTS")." \n"; +echo "
"; + +echo "
\n\n
$db_source"; + +echo "\n"; + +if ($report_display_type=="TEXT" || !$report_display_type) + { + echo "\n"; + echo "
\n\n\n\n\n\n\n\n\n\n";
+
+	$m=0;
+	while ($m < $k)
+		{
+		$sort_split = explode("-----",$TOPsort[$m]);
+		$i = $sort_split[1];
+		$sort_order[$m] = "$i";
+
+		if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
+			{echo "              \n";}
+		else
+			{
+			echo "              ";
+			$TOPsortPLOT = ( MathZDC($TOPsortTALLY[$i], $TOPsortMAX) * 120 );
+			$h=0;
+			while ($h <= $TOPsortPLOT)
+				{
+				echo " ";
+				$h++;
+				}
+			echo "\n";
+			}
+		$m++;
+		}
+
+	echo "\n";
+	}
+
+if ($db_source == 'S')
+	{
+	mysqli_close($link);
+	$use_slave_server=0;
+	$db_source = 'M';
+	require("dbconnect_mysqli.php");
+	}
+
+$endMS = microtime();
+$startMSary = explode(" ",$startMS);
+$endMSary = explode(" ",$endMS);
+$runS = ($endMSary[0] - $startMSary[0]);
+$runM = ($endMSary[1] - $startMSary[1]);
+$TOTALrun = ($runS + $runM);
+
+$stmt="UPDATE vicidial_report_log set run_time='$TOTALrun' where report_log_id='$report_log_id';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_to_mysqli($stmt, $link);
+
+
+?>
+
+
diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php
index 04f067e0..daf2bc4e 100644
--- a/agc_2-X/trunk/www/vicidial/admin.php
+++ b/agc_2-X/trunk/www/vicidial/admin.php
@@ -109,9 +109,9 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
 $PHP_SELF=$_SERVER['PHP_SELF'];
 $QUERY_STRING = getenv("QUERY_STRING");
 
-$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Hangup Cause Report, Lists Pass Report, Called Counts List IDs Report';
+$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Hangup Cause Report, Lists Pass Report, Called Counts List IDs Report';
 
-$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound Email Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report , Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report, Called Counts List IDs Report, Front Page System Summary';
+$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound Email Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report , Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report, Called Counts List IDs Report, Front Page System Summary';
 
 $Vtables = 'NONE,log_noanswer,did_agent_log,contact_information';
 
@@ -3427,12 +3427,13 @@ else
 # 150107-1938 - Added ignore_group_on_search user option
 # 150111-1543 - Added Lists local call time option(Issue #812) and a campaign option for manual_dial_search_filter
 # 150112-2005 - Added flag to delete voicemail greeting when changed from an audio file to empty
+# 150114-2249 - Added Single Agent Daily Time report
 #
 
 # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
 
-$admin_version = '2.10-468a';
-$build = '150112-2005';
+$admin_version = '2.10-469a';
+$build = '150114-2249';
 
 $STARTtime = date("U");
 $SQLdate = date("Y-m-d H:i:s");
@@ -33346,8 +33347,10 @@ if ($ADD==999999)
 			{echo "
  • "._QXZ("Team Performance Detail")."\n";} if ( (preg_match("/Performance Comparison Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • "._QXZ("Performance Comparison Report")."\n";} - if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + if ( (preg_match("/Single Agent Daily$/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • "._QXZ("Single Agent Daily")."\n";} + if ( (preg_match("/Single Agent Daily Time/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo " - "._QXZ("Time")."\n";} if ( (preg_match("/User Group Login Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • "._QXZ("User Group Login Report")."\n";} if ( (preg_match("/User Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) @@ -33609,6 +33612,10 @@ if ($ADD==999998) { echo "
  • "._QXZ("Contacts")." \n"; } + if ($SSenable_languages > 0) + { + echo "
  • "._QXZ("Languages")." \n"; + } echo "\n"; echo "   \n"; 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 88917af4..c6db358c 100644 --- a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php @@ -65,6 +65,7 @@ # 141128-0859 - Code cleanup for QXZ functions # 141229-1745 - Added code for on-the-fly language translations display # 150107-1729 - Added ignore_group_on_search user option +# 150114-2321 - Added date_of_birth as editable field # require("dbconnect_mysqli.php"); @@ -179,6 +180,9 @@ if (isset($_GET["archive_search"])) {$archive_search=$_GET["archive_search"];} elseif (isset($_POST["archive_search"])) {$archive_search=$_POST["archive_search"];} if (isset($_GET["archive_log"])) {$archive_log=$_GET["archive_log"];} elseif (isset($_POST["archive_log"])) {$archive_log=$_POST["archive_log"];} +if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} + elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} + if ($archive_search=="Yes") {$vl_table="vicidial_list_archive";} else {$vl_table="vicidial_list"; $archive_search="No";} @@ -394,7 +398,7 @@ if ($lead_id == 'NEW') { $comments = preg_replace("/\n/",'!N',$comments); $comments = preg_replace("/\r/",'',$comments); - $stmt="INSERT INTO vicidial_list set status='" . mysqli_real_escape_string($link, $status) . "',title='" . mysqli_real_escape_string($link, $title) . "',first_name='" . mysqli_real_escape_string($link, $first_name) . "',middle_initial='" . mysqli_real_escape_string($link, $middle_initial) . "',last_name='" . mysqli_real_escape_string($link, $last_name) . "',address1='" . mysqli_real_escape_string($link, $address1) . "',address2='" . mysqli_real_escape_string($link, $address2) . "',address3='" . mysqli_real_escape_string($link, $address3) . "',city='" . mysqli_real_escape_string($link, $city) . "',state='" . mysqli_real_escape_string($link, $state) . "',province='" . mysqli_real_escape_string($link, $province) . "',postal_code='" . mysqli_real_escape_string($link, $postal_code) . "',country_code='" . mysqli_real_escape_string($link, $country_code) . "',alt_phone='" . mysqli_real_escape_string($link, $alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysqli_real_escape_string($link, $email) . "',security_phrase='" . mysqli_real_escape_string($link, $security) . "',comments='" . mysqli_real_escape_string($link, $comments) . "',rank='" . mysqli_real_escape_string($link, $rank) . "',owner='" . mysqli_real_escape_string($link, $owner) . "',vendor_lead_code='" . mysqli_real_escape_string($link, $vendor_id) . "', list_id='" . mysqli_real_escape_string($link, $list_id) . "',entry_date=NOW();"; + $stmt="INSERT INTO vicidial_list set status='" . mysqli_real_escape_string($link, $status) . "',title='" . mysqli_real_escape_string($link, $title) . "',first_name='" . mysqli_real_escape_string($link, $first_name) . "',middle_initial='" . mysqli_real_escape_string($link, $middle_initial) . "',last_name='" . mysqli_real_escape_string($link, $last_name) . "',address1='" . mysqli_real_escape_string($link, $address1) . "',address2='" . mysqli_real_escape_string($link, $address2) . "',address3='" . mysqli_real_escape_string($link, $address3) . "',city='" . mysqli_real_escape_string($link, $city) . "',state='" . mysqli_real_escape_string($link, $state) . "',province='" . mysqli_real_escape_string($link, $province) . "',postal_code='" . mysqli_real_escape_string($link, $postal_code) . "',country_code='" . mysqli_real_escape_string($link, $country_code) . "',alt_phone='" . mysqli_real_escape_string($link, $alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysqli_real_escape_string($link, $email) . "',security_phrase='" . mysqli_real_escape_string($link, $security) . "',comments='" . mysqli_real_escape_string($link, $comments) . "',rank='" . mysqli_real_escape_string($link, $rank) . "',owner='" . mysqli_real_escape_string($link, $owner) . "',vendor_lead_code='" . mysqli_real_escape_string($link, $vendor_id) . "', list_id='" . mysqli_real_escape_string($link, $list_id) . "',date_of_birth='" . mysqli_real_escape_string($link, $date_of_birth) . "',entry_date=NOW();"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $affected_rows = mysqli_affected_rows($link); @@ -435,7 +439,7 @@ if ($end_call > 0) $comments = preg_replace("/\n/",'!N',$comments); $comments = preg_replace("/\r/",'',$comments); ### update the lead record in the vicidial_list table - $stmt="UPDATE $vl_table set status='" . mysqli_real_escape_string($link, $status) . "',title='" . mysqli_real_escape_string($link, $title) . "',first_name='" . mysqli_real_escape_string($link, $first_name) . "',middle_initial='" . mysqli_real_escape_string($link, $middle_initial) . "',last_name='" . mysqli_real_escape_string($link, $last_name) . "',address1='" . mysqli_real_escape_string($link, $address1) . "',address2='" . mysqli_real_escape_string($link, $address2) . "',address3='" . mysqli_real_escape_string($link, $address3) . "',city='" . mysqli_real_escape_string($link, $city) . "',state='" . mysqli_real_escape_string($link, $state) . "',province='" . mysqli_real_escape_string($link, $province) . "',postal_code='" . mysqli_real_escape_string($link, $postal_code) . "',country_code='" . mysqli_real_escape_string($link, $country_code) . "',alt_phone='" . mysqli_real_escape_string($link, $alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysqli_real_escape_string($link, $email) . "',security_phrase='" . mysqli_real_escape_string($link, $security) . "',comments='" . mysqli_real_escape_string($link, $comments) . "',rank='" . mysqli_real_escape_string($link, $rank) . "',owner='" . mysqli_real_escape_string($link, $owner) . "',vendor_lead_code='" . mysqli_real_escape_string($link, $vendor_id) . "' where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "'"; + $stmt="UPDATE $vl_table set status='" . mysqli_real_escape_string($link, $status) . "',title='" . mysqli_real_escape_string($link, $title) . "',first_name='" . mysqli_real_escape_string($link, $first_name) . "',middle_initial='" . mysqli_real_escape_string($link, $middle_initial) . "',last_name='" . mysqli_real_escape_string($link, $last_name) . "',address1='" . mysqli_real_escape_string($link, $address1) . "',address2='" . mysqli_real_escape_string($link, $address2) . "',address3='" . mysqli_real_escape_string($link, $address3) . "',city='" . mysqli_real_escape_string($link, $city) . "',state='" . mysqli_real_escape_string($link, $state) . "',province='" . mysqli_real_escape_string($link, $province) . "',postal_code='" . mysqli_real_escape_string($link, $postal_code) . "',country_code='" . mysqli_real_escape_string($link, $country_code) . "',alt_phone='" . mysqli_real_escape_string($link, $alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysqli_real_escape_string($link, $email) . "',security_phrase='" . mysqli_real_escape_string($link, $security) . "',comments='" . mysqli_real_escape_string($link, $comments) . "',rank='" . mysqli_real_escape_string($link, $rank) . "',owner='" . mysqli_real_escape_string($link, $owner) . "',vendor_lead_code='" . mysqli_real_escape_string($link, $vendor_id) . "',date_of_birth='" . mysqli_real_escape_string($link, $date_of_birth) . "' where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); @@ -1081,7 +1085,8 @@ else echo " $label_postal_code: $postal_code \n"; echo "$label_province : $province\n"; - echo ""._QXZ("Country")." : $country_code\n"; + echo ""._QXZ("Country")." : $country_code   \n"; + echo " "._QXZ("Date of Birth").": $date_of_birth \n"; echo "$label_phone_number : $phone_number\n"; echo "$label_phone_code : $phone_code\n"; echo "$label_alt_phone : $alt_phone\n"; @@ -1106,7 +1111,8 @@ else echo " $label_postal_code: \n"; echo "$label_province : \n"; - echo ""._QXZ("Country")." : \n"; + echo ""._QXZ("Country")." :   \n"; + echo " "._QXZ("Date of Birth").": \n"; echo "$label_phone_number : \n"; echo "$label_phone_code : \n"; echo "$label_alt_phone : \n";