LICENSE: AGPLv2 # # CHANGES # # 160305-0842 - First build # $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["api_date_D"])) {$api_date_D=$_GET["api_date_D"];} elseif (isset($_POST["api_date_D"])) {$api_date_D=$_POST["api_date_D"];} if (isset($_GET["api_date_end_D"])) {$api_date_end_D=$_GET["api_date_end_D"];} elseif (isset($_POST["api_date_end_D"])) {$api_date_end_D=$_POST["api_date_end_D"];} if (isset($_GET["api_date_T"])) {$api_date_T=$_GET["api_date_T"];} elseif (isset($_POST["api_date_T"])) {$api_date_T=$_POST["api_date_T"];} if (isset($_GET["api_date_end_T"])) {$api_date_end_T=$_GET["api_date_end_T"];} elseif (isset($_POST["api_date_end_T"])) {$api_date_end_T=$_POST["api_date_end_T"];} if (isset($_GET["users"])) {$users=$_GET["users"];} elseif (isset($_POST["users"])) {$users=$_POST["users"];} if (isset($_GET["agent_users"])) {$agent_users=$_GET["agent_users"];} elseif (isset($_POST["agent_users"])) {$agent_users=$_POST["agent_users"];} if (isset($_GET["functions"])) {$functions=$_GET["functions"];} elseif (isset($_POST["functions"])) {$functions=$_POST["functions"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} if (isset($_GET["results"])) {$results=$_GET["results"];} elseif (isset($_POST["results"])) {$results=$_POST["results"];} if (isset($_GET["order_by"])) {$order_by=$_GET["order_by"];} elseif (isset($_POST["order_by"])) {$order_by=$_POST["order_by"];} 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 (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];} elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} $report_name="API Log Report"; $NOW_DATE = date("Y-m-d"); if (!isset($api_date_D)) {$api_date_D=$NOW_DATE;} if (!isset($api_date_end_D)) {$api_date_end_D=$NOW_DATE;} if (!isset($api_date_T)) {$api_date_T="00:00:00";} if (!isset($api_date_end_T)) {$api_date_end_T="23:59:59";} if (!isset($order_by)) {$order_by="api_date";} $api_date_from="$api_date_D $api_date_T"; $api_date_to="$api_date_end_D $api_date_end_T"; $CSV_text="\"API ACCESS LOG REPORT\"\n"; $CSV_text.="\"API DATE RANGE:\",\"$api_date_from to $api_date_to\"\n"; $ASCII_rpt_header="API DATE RANGE: $api_date_from to $api_date_to\n"; #if (!isset($recording_date_D)) {$recording_date_D=$NOW_DATE;} #if (!isset($recording_date_end_D)) {$recording_date_end_D=$NOW_DATE;} #if (!isset($recording_date_T)) {$recording_date_T="00:00:00";} #if (!isset($recording_date_end_T)) {$recording_date_end_T="23:59:59";} ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$HTML_text.="$stmt\n";} if ($archive_tbl) {$agent_log_table="vicidial_api_log_archive";} else {$agent_log_table="vicidial_api_log";} $qm_conf_ct = mysqli_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysqli_fetch_row($rslt); $non_latin = $row[0]; $outbound_autodial_active = $row[1]; $slave_db_server = $row[2]; $reports_use_slave_db = $row[3]; $SSenable_languages = $row[4]; $SSlanguage_method = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### ### ARCHIVED DATA CHECK CONFIGURATION $archives_available="N"; $log_tables_array=array("vicidial_api_log"); for ($t=0; $t 0) { $row=mysqli_fetch_row($rslt); $VUselected_language = $row[0]; } $auth=0; $reports_auth=0; $admin_auth=0; $auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); if ($auth_message == 'GOOD') {$auth=1;} if ($auth > 0) { $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $admin_auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $reports_auth=$row[0]; if ($reports_auth < 1) { $VDdisplayMESSAGE = _QXZ("You are not allowed to view reports"); Header ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; exit; } if ( ($reports_auth > 0) and ($admin_auth < 1) ) { $ADD=999999; $reports_only_user=1; } } else { $VDdisplayMESSAGE = _QXZ("Login incorrect, please try again"); if ($auth_message == 'LOCK') { $VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes"); Header ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; exit; } Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\""); Header("HTTP/1.0 401 Unauthorized"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n"; exit; } ##### BEGIN log visit to the vicidial_report_log table ##### $LOGip = getenv("REMOTE_ADDR"); $LOGbrowser = getenv("HTTP_USER_AGENT"); $LOGscript_name = getenv("SCRIPT_NAME"); $LOGserver_name = getenv("SERVER_NAME"); $LOGserver_port = getenv("SERVER_PORT"); $LOGrequest_uri = getenv("REQUEST_URI"); $LOGhttp_referer = getenv("HTTP_REFERER"); if (preg_match("/443/i",$LOGserver_port)) {$HTTPprotocol = 'https://';} else {$HTTPprotocol = 'http://';} if (($LOGserver_port == '80') or ($LOGserver_port == '443') ) {$LOGserver_port='';} else {$LOGserver_port = ":$LOGserver_port";} $LOGfull_url = "$HTTPprotocol$LOGserver_name$LOGserver_port$LOGrequest_uri"; $LOGhostname = php_uname('n'); if (strlen($LOGhostname)<1) {$LOGhostname='X';} if (strlen($LOGserver_name)<1) {$LOGserver_name='X';} $stmt="SELECT webserver_id FROM vicidial_webservers where webserver='$LOGserver_name' and hostname='$LOGhostname' LIMIT 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $webserver_id_ct = mysqli_num_rows($rslt); if ($webserver_id_ct > 0) { $row=mysqli_fetch_row($rslt); $webserver_id = $row[0]; } else { ##### insert webserver entry $stmt="INSERT INTO vicidial_webservers (webserver,hostname) values('$LOGserver_name','$LOGhostname');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $affected_rows = mysqli_affected_rows($link); $webserver_id = mysqli_insert_id($link); } $stmt="INSERT INTO vicidial_report_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$LOGip', report_name='$report_name', browser='$LOGbrowser', referer='$LOGhttp_referer', notes='$LOGserver_name:$LOGserver_port $LOGscript_name |$group[0], $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url', webserver='$webserver_id';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $report_log_id = mysqli_insert_id($link); ##### END log visit to the vicidial_report_log table ##### if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) { mysqli_close($link); $use_slave_server=1; $db_source = 'S'; require("dbconnect_mysqli.php"); $HTML_text.="\n"; } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $LOGuser_group = $row[0]; $stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $LOGallowed_campaigns = $row[0]; $LOGallowed_reports = $row[1]; $LOGadmin_viewable_groups = $row[2]; $LOGadmin_viewable_call_times = $row[3]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\""); Header("HTTP/1.0 401 Unauthorized"); echo _QXZ("You are not allowed to view this report").": |$PHP_AUTH_USER|$report_name|\n"; exit; } $LOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL=''; if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) { $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; $whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; } $i=0; $users_string='|'; $users_ct = count($users); while($i < $users_ct) { $users_string .= "$users[$i]|"; $i++; } /* $i=0; $user_group_string='|'; $user_group_ct = count($user_group); while($i < $users_ct) { $user_group_string .= "$user_group[$i]|"; $i++; } $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysqli_num_rows($rslt); $i=0; while ($i < $user_groups_to_print) { $row=mysqli_fetch_row($rslt); $user_groups[$i] =$row[0]; # if (preg_match('/\-ALL/',$user_group_string)) {$user_group[$i]=$row[0];} $i++; } $stmt="select distinct user from vicidial_api_log where user!='' order by user"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysqli_num_rows($rslt); $i=0; while ($row=mysqli_fetch_row($rslt)) { $user_list[$i]=$row[0]; $name_stmt="select full_name from vicidial_users where user='$row[0]'"; $name_rslt=mysql_to_mysqli($name_stmt, $link); if (mysqli_num_rows($name_rslt)>0) { $name_row=mysqli_fetch_row($name_rslt); $user_names[$i]=" - ".$name_row[0]; } $i++; } */ $stmt="select user, full_name from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysqli_num_rows($rslt); $i=0; while ($i < $users_to_print) { $row=mysqli_fetch_row($rslt); $user_list[$i]=$row[0]; $user_names[$i]=$row[1]; $user_directory[$row[0]]=" - ".$row[1]; if ($all_users) {$user_list[$i]=$row[0];} $i++; } $i=0; $user_string='|'; $user_ct = count($users); while($i < $user_ct) { $user_string .= "$users[$i]|"; $userQS .= "&users[]=$users[$i]"; $user_SQL="and user in ('".implode("','", $users)."')"; $i++; } if ( (preg_match('/\-\-ALL\-\-/',$user_string) ) or ($user_ct < 1) ) {$vu_user_SQL = ""; $vra_user_SQL = ""; $user_SQL="";} else { $ASCII_rpt_header.="USERS: ".implode(", ", $users)."\n"; $CSV_text.="\"USERS:\",\"".implode(", ", $users)."\"\n"; $GRAPH_header.="SELECTED USERS"; } $i=0; $agent_user_string='|'; $agent_user_ct = count($agent_users); while($i < $agent_user_ct) { $agent_user_string .= "$agent_users[$i]|"; $agent_userQS .= "&agent_users[]=$agent_users[$i]"; $agent_user_SQL="and agent_user in ('".implode("','", $agent_users)."')"; $i++; } if ( (preg_match('/\-\-ALL\-\-/',$agent_user_string) ) or ($agent_user_ct < 1) ) {$vu_agent_user_SQL = ""; $vra_agent_user_SQL = ""; $agent_user_SQL="";} else { $ASCII_rpt_header.="AGENT USERS: ".implode(", ", $agent_users)."\n"; $CSV_text.="\"AGENT USERS:\",\"".implode(", ", $agent_users)."\"\n"; $GRAPH_header.="SELECTED AGENTS"; } $i=0; $function_string='|'; $function_ct = count($functions); while($i < $function_ct) { $function_string .= "$functions[$i]|"; $functionQS .= "&functions[]=$functions[$i]"; $function_SQL="and function in ('".implode("','", $functions)."')"; $i++; } if ( (preg_match('/\-\-ALL\-\-/',$function_string) ) or ($function_ct < 1) ) {$vu_function_SQL = ""; $vra_function_SQL = ""; $function_SQL="";} else { $ASCII_rpt_header.="FUNCTIONS: ".implode(", ", $functions)."\n"; $CSV_text.="\"FUNCTIONS:\",\"".implode(", ", $functions)."\"\n"; $GRAPH_header.="SELECTED FUNCTIONS"; } $i=0; $result_string='|'; $result_ct = count($results); while($i < $result_ct) { $result_string .= "$results[$i]|"; $resultQS .= "&results[]=$results[$i]"; $result_SQL="and result in ('".implode("','", $results)."')"; $i++; } if ( (preg_match('/\-\-ALL\-\-/',$result_string) ) or ($result_ct < 1) ) {$vu_result_SQL = ""; $vra_result_SQL = ""; $result_SQL="";} else { $ASCII_rpt_header.="RESULTS: ".implode(", ", $results)."\n"; $CSV_text.="\"RESULTS:\",\"".implode(", ", $results)."\"\n"; $GRAPH_header.="SELECTED RESULTS"; } /* $i=0; $user_group_string='|'; $user_group_ct = count($user_group); while($i < $user_group_ct) { $user_group_string .= "$user_group[$i]|"; $user_groupQS .= "&user_group[]=$user_group[$i]"; $user_group_SQL=" and user_group in ('".implode("','", $user_group)."') and vra.user=vu.user and "; $i++; } if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { $ASCII_rpt_header.=" User groups: ".implode(", ", $user_group)."\n"; $CSV_text.="\"User groups:\",\"".implode(", ", $user_group)."\"\n"; $GRAPH_header.="SELECTED USER GROUPS"; } */ $stmt="select distinct user from $vicidial_api_log_table where user!='' order by user"; if ($DB) {echo "$stmt
\n";} $rslt=mysql_to_mysqli($stmt, $link); $users_array=array(); $user_names_array=array(); while ($row=mysqli_fetch_array($rslt)) { array_push($users_array, $row["user"]); array_push($user_names_array, $user_directory[$row["user"]]); } $stmt="select distinct function from $vicidial_api_log_table where function!='' order by function"; if ($DB) {echo "$stmt
\n";} $rslt=mysql_to_mysqli($stmt, $link); $functions_array=array(); while ($row=mysqli_fetch_array($rslt)) { array_push($functions_array, $row["function"]); } $stmt="select distinct agent_user from $vicidial_api_log_table where agent_user!='' order by agent_user"; if ($DB) {echo "$stmt
\n";} $rslt=mysql_to_mysqli($stmt, $link); $agent_users_array=array(); $agent_user_names_array=array(); while ($row=mysqli_fetch_array($rslt)) { array_push($agent_users_array, $row["agent_user"]); array_push($agent_user_names_array, $user_directory[$row["agent_user"]]); } $stmt="select distinct result from $vicidial_api_log_table where result!='' order by result"; if ($DB) {echo "$stmt
\n";} $rslt=mysql_to_mysqli($stmt, $link); $results_array=array(); while ($row=mysqli_fetch_array($rslt)) { array_push($results_array, $row["result"]); } if ($DB) {echo "$user_group_string|$user_group_ct|$user_groupQS|$i
\n";} $LINKbase = "$PHP_SELF?DB=$DB&api_date_D=$api_date_D&api_date_T=$api_date_T&api_date_end_D=$api_date_end_D&api_date_end_T=$api_date_end_T$resultQS$functionQS$agent_userQS$userQS&shift=$shift&DB=$DB&show_percentages=$show_percentages&SUBMIT=1"; $NWB = "   \"HELP\""; $HTML_head.="\n"; $HTML_head.="\n"; $HTML_head.="\n"; $HTML_head.="\n"; $HTML_head.="\n"; $HTML_head.="\n"; $HTML_text.="\n"; $HTML_head.="\n"; $HTML_head.=""._QXZ("$report_name")."\n"; $short_header=1; # require("admin_header.php"); $HTML_text.="
"; $HTML_text.="
\n"; $HTML_text.=""; $HTML_text.="\n"; $HTML_text.="\n"; $HTML_text.="\n"; $HTML_text.="\n"; $HTML_text.=""; $HTML_text.="
"._QXZ("Access date range").":
"; $HTML_text.="\n"; $HTML_text.="\n"; $HTML_text.="\n"; $HTML_text.=""; $HTML_text.="\n"; $HTML_text.="   "; $HTML_text.="
"._QXZ("to")."
"; $HTML_text.="\n"; $HTML_text.="   "; $HTML_text.="
"._QXZ("Users").":
"; $HTML_text.="\n"; $HTML_text.="
"._QXZ("Agent users").":
"; $HTML_text.="\n"; $HTML_text.="
"._QXZ("Functions").":
"; $HTML_text.="\n"; $HTML_text.="
"._QXZ("Results").":
"; $HTML_text.="\n"; $HTML_text.="


"; $HTML_text.="\n"; if ($archives_available=="Y") { $HTML_text.="

"._QXZ("Search archived data")."\n"; } $HTML_text.="
"; $HTML_text.="
\n\n"; $HTML_text.="
\n";

if ($SUBMIT && $api_date_D && $api_date_T && $api_date_end_D && $api_date_end_T) 
	{
	$stmt="select * from $vicidial_api_log_table where api_date>='$api_date_D $api_date_T' and api_date<='$api_date_end_D $api_date_end_T' $result_SQL $function_SQL $agent_user_SQL $user_SQL order by $order_by asc";
	if ($DB) {print $stmt."\n";}
	# print $stmt."\n";

	$ASCII_border="+---------------------+--------------------------------+------------+----------------------+--------------------------------+------------+----------------------+----------+-----------+-----------+\n";
	$HTML_text.=$ASCII_rpt_header;
	$HTML_text.=sprintf("%110s", " ");
	$HTML_text.=""._QXZ("DOWNLOAD")."\n";

	$HTML_text.=$ASCII_border;
	$HTML_text.="| API DATE            | USER                           | API SCRIPT | FUNCTION             | AGENT USER                     | RESULT     | SOURCE               | RUN TIME | WEBSERVER | API URL   |\n";
	$HTML_text.=$ASCII_border;

	$CSV_text.="\n\"API DATE\",\"USER\",\"API SCRIPT\",\"FUNCTION\",\"AGENT USER\",\"VALUE\",\"RESULT\",\"RESULT REASON\",\"SOURCE\",\"DATA\",\"RUN TIME\",\"WEBSERVER\",\"API URL\"\n";

	$rslt=mysql_to_mysqli($stmt, $link);
	while ($row=mysqli_fetch_array($rslt)) 
		{
		$full_user=substr($row["user"].$user_directory[$row["user"]], 0, 30);
		$full_agent_user=substr($row["agent_user"].$user_directory[$row["agent_user"]], 0, 30);
		$HTML_text.="| ";
		$HTML_text.=sprintf("%-19s", $row["api_date"])." | ";
		$HTML_text.=sprintf("%-30s", $full_user)." | ";
		$HTML_text.=sprintf("%-10s", $row["api_script"])." | ";
		$HTML_text.=sprintf("%-20s", $row["function"])." | ";
		$HTML_text.=sprintf("%-30s", $full_agent_user)." | ";
		$HTML_text.=sprintf("%-10s", $row["result"])." | ";
		$HTML_text.=sprintf("%-20s", $row["source"])." | ";
		$HTML_text.=sprintf("%-8s", substr($row["run_time"],0,8))." | ";
		$HTML_text.=sprintf("%-9s", $row["webserver"])." | ";
		$HTML_text.=sprintf("%-9s", $row["api_url"])." |\n";
		$CSV_text.="\"$row[api_date]\",\"$full_user\",\"$row[api_script]\",\"$row[function]\",\"$full_agent_user\",\"$row[value]\",\"$row[result]\",\"$row[result_reason]\",\"$row[source]\",\"$row[data]\",\"$row[run_time]\",\"$row[webserver]\",\"$row[api_url]\"\n";
		}
	$HTML_text.=$ASCII_border;
	}
$HTML_text.="
"; if ($file_download == 0 || !$file_download) { echo $HTML_head; require("admin_header.php"); echo $HTML_text; } else { $FILE_TIME = date("Ymd-His"); $CSVfilename = "AST_recording_access_log_report_$US$FILE_TIME.csv"; $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); $CSV_text=preg_replace('/\" +/', '"', $CSV_text); // We'll be outputting a TXT file header('Content-type: application/octet-stream'); // It will be called LIST_101_20090209-121212.txt header("Content-Disposition: attachment; filename=\"$CSVfilename\""); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); ob_clean(); flush(); echo "$CSV_text"; } 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); ?>