\n";
$HTML_text.="\n";
-$HTML_text.=" ";
+$HTML_text.="";
+$HTML_text.=_QXZ("Display as:")." ";
+$HTML_text.="";
+if ($report_display_type) {$HTML_text.="$report_display_type ";}
+$HTML_text.="TEXT HTML \n ";
$HTML_text.=" \n";
$HTML_text.=" "._QXZ("Show URLs, slower")."\n";
if ($archives_available=="Y")
@@ -638,7 +681,7 @@ $HTML_text.=" ";
$HTML_text.="";
$HTML_text.="\n\n";
-$HTML_text.="\n";
+$TEXT.="\n";
if ($SUBMIT && $api_date_D && $api_date_T && $api_date_end_D && $api_date_end_T)
{
@@ -653,23 +696,45 @@ if ($SUBMIT && $api_date_D && $api_date_T && $api_date_end_D && $api_date_end_T)
$ASCII_border="+---------------------+--------------------------------+------------+----------------------+--------------------------------+------------+----------------------+----------+-----------+-----------+----------------------+----------\n";
$URL_header=" REMOTE IP | URL";
}
- $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 |$URL_header\n";
- $HTML_text.=$ASCII_border;
+ $TEXT.=$ASCII_rpt_header;
+ $TEXT.=sprintf("%110s", " ");
+ $TEXT.=""._QXZ("DOWNLOAD")." \n";
+ $TEXT.=$ASCII_border;
+ $TEXT.="| API DATE | USER | API SCRIPT | FUNCTION | AGENT USER | RESULT | SOURCE | RUN TIME | WEBSERVER | API URL |$URL_header\n";
+ $TEXT.=$ASCII_border;
+
+ $HTML.="";
+ $HTML.="";
+ $HTML.="$ASCII_rpt_header ";
+ $HTML.=""._QXZ("DOWNLOAD")." ";
+ $HTML.=" \n";
+ $HTML.="";
+ $HTML.=""._QXZ("API DATE")." ";
+ $HTML.=""._QXZ("USER")." ";
+ $HTML.=""._QXZ("API SCRIPT")." ";
+ $HTML.=""._QXZ("FUNCTION")." ";
+ $HTML.=""._QXZ("AGENT USER")." ";
+ $HTML.=""._QXZ("RESULT")." ";
+ $HTML.=""._QXZ("SOURCE")." ";
+ $HTML.=""._QXZ("RUN TIME")." ";
+ $HTML.=""._QXZ("WEBSERVER")." ";
+ $HTML.=""._QXZ("API URL")." ";
+
if ($show_urls)
{
$CSV_text.="\n\"API DATE\",\"USER\",\"API SCRIPT\",\"FUNCTION\",\"AGENT USER\",\"VALUE\",\"RESULT\",\"RESULT REASON\",\"SOURCE\",\"DATA\",\"RUN TIME\",\"WEBSERVER\",\"API URL\",\"REMOTE IP\",\"FULL URL STRING\"\n";
+ $HTML.=""._QXZ("REMOTE IP")." ";
+ $HTML.=""._QXZ("FULL URL STRING")." ";
}
else
{
$CSV_text.="\n\"API DATE\",\"USER\",\"API SCRIPT\",\"FUNCTION\",\"AGENT USER\",\"VALUE\",\"RESULT\",\"RESULT REASON\",\"SOURCE\",\"DATA\",\"RUN TIME\",\"WEBSERVER\",\"API URL\"\n";
}
+ $HTML.=" \n";
+
$rslt=mysql_to_mysqli($stmt, $link);
$g=0;
while ($row=mysqli_fetch_array($rslt))
@@ -694,17 +759,30 @@ if ($SUBMIT && $api_date_D && $api_date_T && $api_date_end_D && $api_date_end_T)
$h=0;
while ($h < $g)
{
- $HTML_text.="| ";
- $HTML_text.=sprintf("%-19s", $api_date[$h])." | ";
- $HTML_text.=sprintf("%-30s", $full_user[$h])." | ";
- $HTML_text.=sprintf("%-10s", $api_script[$h])." | ";
- $HTML_text.=sprintf("%-20s", $function[$h])." | ";
- $HTML_text.=sprintf("%-30s", $full_agent_user[$h])." | ";
- $HTML_text.=sprintf("%-10s", $result[$h])." | ";
- $HTML_text.=sprintf("%-20s", $source[$h])." | ";
- $HTML_text.=sprintf("%-8s", $run_time[$h])." | ";
- $HTML_text.=sprintf("%-9s", $webserver[$h])." | ";
- $HTML_text.=sprintf("%-9s", $api_url[$h])." | ";
+ $TEXT.="| ";
+ $TEXT.=sprintf("%-19s", $api_date[$h])." | ";
+ $TEXT.=sprintf("%-30s", $full_user[$h])." | ";
+ $TEXT.=sprintf("%-10s", $api_script[$h])." | ";
+ $TEXT.=sprintf("%-20s", $function[$h])." | ";
+ $TEXT.=sprintf("%-30s", $full_agent_user[$h])." | ";
+ $TEXT.=sprintf("%-10s", $result[$h])." | ";
+ $TEXT.=sprintf("%-20s", $source[$h])." | ";
+ $TEXT.=sprintf("%-8s", $run_time[$h])." | ";
+ $TEXT.=sprintf("%-9s", $webserver[$h])." | ";
+ $TEXT.=sprintf("%-9s", $api_url[$h])." | ";
+
+ $HTML.="";
+ $HTML.="".$api_date[$h]." ";
+ $HTML.="".$full_user[$h]." ";
+ $HTML.="".$api_script[$h]." ";
+ $HTML.="".$function[$h]." ";
+ $HTML.="".$full_agent_user[$h]." ";
+ $HTML.="".$result[$h]." ";
+ $HTML.="".$source[$h]." ";
+ $HTML.="".$run_time[$h]." ";
+ $HTML.="".$webserver[$h]." ";
+ $HTML.="".$api_url[$h]." ";
+
if ($show_urls)
{
$stmt="select remote_ip,url from $vicidial_api_urls_table where api_id='$api_id[$h]';";
@@ -716,22 +794,35 @@ if ($SUBMIT && $api_date_D && $api_date_T && $api_date_end_D && $api_date_end_T)
$remote_ip = $row["remote_ip"];
if ( ($VUmodify_same_user_level < 1) or ($VUuser_level < 9) or ($VUmodify_users < 1) )
{$full_url = preg_replace("/&pass=[\s\S]+?&/",'&pass=XXXX&',$full_url);}
- $HTML_text.=sprintf("%-20s", $row["remote_ip"])." | ";
- $HTML_text.=sprintf("%-2000s", $full_url)." | ";
- $CSV_text.="\"$api_date[$h]\",\"$full_user[$h]\",\"$api_script[$h]\",\"$function[$h]\",\"$full_agent_user[$h]\",\"$value[$h]\",\"$result[$h]\",\"$result_reason[$h]\",\"$source[$h]\",\"$data[$h]\",\"$run_time[$h]\",\"$webserver[$h]\",\"$api_url[$h]\",\"$remote_ip\",\"$full_url\"\n";
+ $TEXT.=sprintf("%-20s", $row["remote_ip"])." | ";
+ $TEXT.=sprintf("%-2000s", $full_url)." | ";
}
+ $CSV_text.="\"$api_date[$h]\",\"$full_user[$h]\",\"$api_script[$h]\",\"$function[$h]\",\"$full_agent_user[$h]\",\"$value[$h]\",\"$result[$h]\",\"$result_reason[$h]\",\"$source[$h]\",\"$data[$h]\",\"$run_time[$h]\",\"$webserver[$h]\",\"$api_url[$h]\",\"$remote_ip\",\"$full_url\"\n";
+ $HTML.="".($remote_ip=="" ? " " : $remote_ip)." ";
+ $HTML.="".($full_url=="" ? " " : $full_url)." ";
}
else
{
$CSV_text.="\"$api_date[$h]\",\"$full_user[$h]\",\"$api_script[$h]\",\"$function[$h]\",\"$full_agent_user[$h]\",\"$value[$h]\",\"$result[$h]\",\"$result_reason[$h]\",\"$source[$h]\",\"$data[$h]\",\"$run_time[$h]\",\"$webserver[$h]\",\"$api_url[$h]\"\n";
}
- $HTML_text.="\n";
+ $TEXT.="\n";
+ $HTML.=" ";
$h++;
}
- $HTML_text.=$ASCII_border;
+ $TEXT.=$ASCII_border;
+ $HTML.="
";
}
-$HTML_text.="