Added admin report logging to all reports on the system, and added the "Admin Report Log Viewer" linked from the "Admin Utilities" page which allows you to see the reports that have been run on the system. This change has affected almost every report in the system. Bugs were fixed for some exporting reports that were set to use a slave read-only database.
git-svn-id: svn://192.168.202.10@1959 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -248,6 +248,10 @@ OTHER CHANGES:
|
|||||||
make install
|
make install
|
||||||
(then stop and restart asterisk)
|
(then stop and restart asterisk)
|
||||||
|
|
||||||
|
42. Added admin report logging to all reports on the system, and added the
|
||||||
|
"Admin Report Log Viewer" linked from the "Admin Utilities" page which
|
||||||
|
allows you to see the reports that have been run on the system.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ install Mail::POP3Client
|
|||||||
install Mail::IMAPClient
|
install Mail::IMAPClient
|
||||||
install Mail::Message
|
install Mail::Message
|
||||||
install IO::Socket::SSL
|
install IO::Socket::SSL
|
||||||
|
install MIME::Base64
|
||||||
|
install MIME::QuotedPrint
|
||||||
quit
|
quit
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -460,6 +460,8 @@ following modules first: (say YES if asked to install prerequisites)
|
|||||||
- install Mail::IMAPClient
|
- install Mail::IMAPClient
|
||||||
- install Mail::Message
|
- install Mail::Message
|
||||||
- install IO::Socket::SSL
|
- install IO::Socket::SSL
|
||||||
|
- install MIME::Base64
|
||||||
|
- install MIME::QuotedPrint
|
||||||
- then quit cpan, you are done
|
- then quit cpan, you are done
|
||||||
5. Go to http://asterisk.gnuinter.net/ and download the asterisk-perl module
|
5. Go to http://asterisk.gnuinter.net/ and download the asterisk-perl module
|
||||||
(backup link: http://download.vicidial.com/packages/asterisk-perl-0.08.tar.gz)
|
(backup link: http://download.vicidial.com/packages/asterisk-perl-0.08.tar.gz)
|
||||||
|
|||||||
@@ -2867,6 +2867,22 @@ KEY vicidial_email_log_lead_id_key (lead_id),
|
|||||||
KEY vicidial_email_log_email_row_id_key (email_row_id)
|
KEY vicidial_email_log_email_row_id_key (email_row_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE vicidial_report_log (
|
||||||
|
report_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
|
event_date DATETIME NOT NULL,
|
||||||
|
user VARCHAR(20) NOT NULL,
|
||||||
|
ip_address VARCHAR(15) NOT NULL,
|
||||||
|
report_name VARCHAR(50) NOT NULL,
|
||||||
|
browser TEXT,
|
||||||
|
referer TEXT,
|
||||||
|
notes TEXT,
|
||||||
|
url TEXT,
|
||||||
|
run_time VARCHAR(20) default '0',
|
||||||
|
index (user),
|
||||||
|
index (report_name)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE vicidial_email_list MODIFY message text character set utf8;
|
ALTER TABLE vicidial_email_list MODIFY message text character set utf8;
|
||||||
|
|
||||||
ALTER TABLE vicidial_email_log MODIFY message text character set utf8;
|
ALTER TABLE vicidial_email_log MODIFY message text character set utf8;
|
||||||
@@ -3105,4 +3121,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
|
|||||||
|
|
||||||
UPDATE system_settings set vdc_agent_api_active='1';
|
UPDATE system_settings set vdc_agent_api_active='1';
|
||||||
|
|
||||||
UPDATE system_settings SET db_schema_version='1343',db_schema_update_date=NOW();
|
UPDATE system_settings SET db_schema_version='1344',db_schema_update_date=NOW();
|
||||||
|
|||||||
@@ -335,3 +335,20 @@ ALTER TABLE vicidial_carrier_log ADD caller_code VARCHAR(30) default '';
|
|||||||
ALTER TABLE vicidial_carrier_log_archive ADD caller_code VARCHAR(30) default '';
|
ALTER TABLE vicidial_carrier_log_archive ADD caller_code VARCHAR(30) default '';
|
||||||
|
|
||||||
UPDATE system_settings SET db_schema_version='1343',db_schema_update_date=NOW() where db_schema_version < 1343;
|
UPDATE system_settings SET db_schema_version='1343',db_schema_update_date=NOW() where db_schema_version < 1343;
|
||||||
|
|
||||||
|
CREATE TABLE vicidial_report_log (
|
||||||
|
report_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
|
event_date DATETIME NOT NULL,
|
||||||
|
user VARCHAR(20) NOT NULL,
|
||||||
|
ip_address VARCHAR(15) NOT NULL,
|
||||||
|
report_name VARCHAR(50) NOT NULL,
|
||||||
|
browser TEXT,
|
||||||
|
referer TEXT,
|
||||||
|
notes TEXT,
|
||||||
|
url TEXT,
|
||||||
|
run_time VARCHAR(20) default '0',
|
||||||
|
index (user),
|
||||||
|
index (report_name)
|
||||||
|
);
|
||||||
|
|
||||||
|
UPDATE system_settings SET db_schema_version='1344',db_schema_update_date=NOW() where db_schema_version < 1344;
|
||||||
|
|||||||
@@ -184,6 +184,11 @@ Level 8 Disable Add||
|
|||||||
This setting if enabled will prevent any level 8 user from adding or copying any record in the system, no matter what their user settings are. Excluded from these restrictions are the ability to add DNC and Filter Phone Groups numbers and the Add a New Lead page. Default is 0 for disabled||
|
This setting if enabled will prevent any level 8 user from adding or copying any record in the system, no matter what their user settings are. Excluded from these restrictions are the ability to add DNC and Filter Phone Groups numbers and the Add a New Lead page. Default is 0 for disabled||
|
||||||
You do not have permission to add records on this system||
|
You do not have permission to add records on this system||
|
||||||
These options allows you to limit the viewable callbacks in the agent callback alert section on the agent screen, to only LIVE callbacks. LIVE callbacks are user-only scheduled callbacks that have hit their trigger date and time. ACTIVE call backs are user-only callbacks that are active in the system but have not yet triggered. You can view both ACTIVE and LIVE callbacks by selecting ALL_ACTIVE. Default is ALL_ACTIVE||
|
These options allows you to limit the viewable callbacks in the agent callback alert section on the agent screen, to only LIVE callbacks. LIVE callbacks are user-only scheduled callbacks that have hit their trigger date and time. ACTIVE call backs are user-only callbacks that are active in the system but have not yet triggered. You can view both ACTIVE and LIVE callbacks by selecting ALL_ACTIVE. Default is ALL_ACTIVE||
|
||||||
|
VICIDIAL ADMIN REPORT LOG||
|
||||||
|
VICIDIAL USER ADMIN REPORT LOG||
|
||||||
|
VICIDIAL DETAIL ADMIN REPORT LOG||
|
||||||
|
ADMIN REPORT LOG||
|
||||||
|
Admin Report Log Viewer||
|
||||||
|
|
||||||
|
|
||||||
############################################################ CLIENT
|
############################################################ CLIENT
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_CLOSER_service_level.php
|
# AST_CLOSER_service_level.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -20,8 +20,11 @@
|
|||||||
# 110703-1756 - Added download option
|
# 110703-1756 - Added download option
|
||||||
# 111103-2300 - Added user_group restrictions for selecting in-groups
|
# 111103-2300 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130414-0104 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -69,15 +72,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||||
@@ -99,6 +93,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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, $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -1280,10 +1303,8 @@ if ($file_download > 0)
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
echo "$HEADER";
|
echo "$HEADER";
|
||||||
@@ -1293,6 +1314,26 @@ if ($file_download > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES:
|
||||||
#
|
|
||||||
# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat
|
# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat
|
||||||
# - Added required user/pass to gain access to this page
|
# - Added required user/pass to gain access to this page
|
||||||
# 60905-1326 - Added queue time stats
|
# 60905-1326 - Added queue time stats
|
||||||
@@ -37,8 +36,11 @@
|
|||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
# 120730-0724 - Small fix for HTML output
|
# 120730-0724 - Small fix for HTML output
|
||||||
# 130124-1719 - Added email report support
|
# 130124-1719 - Added email report support
|
||||||
|
# 130414-1429 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -96,15 +98,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -242,6 +235,37 @@ else
|
|||||||
}
|
}
|
||||||
if (strlen($group_SQL)<3) {$group_SQL="''";}
|
if (strlen($group_SQL)<3) {$group_SQL="''";}
|
||||||
|
|
||||||
|
##### 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";
|
||||||
|
|
||||||
|
$AMP='&';
|
||||||
|
$QM='?';
|
||||||
|
$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, $DID, $EMAIL, $file_download, $report_display_type|', url='".$LOGfull_url."?DB=".$DB."&DID=".$DID."&EMAIL=".$EMAIL."&query_date=".$query_date."&end_date=".$end_date."&shift=".$shift."&report_display_type=".$report_display_type."$groupQS';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="select vsc_id,vsc_name from vicidial_status_categories;";
|
$stmt="select vsc_id,vsc_name from vicidial_status_categories;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -2554,7 +2578,6 @@ if ($file_download>0) {
|
|||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
echo $HEADER;
|
echo $HEADER;
|
||||||
echo $JS_text;
|
echo $JS_text;
|
||||||
@@ -2564,6 +2587,27 @@ if ($file_download>0) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_CLOSERsummary_hourly.php
|
# AST_CLOSERsummary_hourly.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -15,8 +15,11 @@
|
|||||||
# 110703-1806 - Added download option
|
# 110703-1806 - Added download option
|
||||||
# 111103-2315 - Added user_group restrictions for selecting in-groups
|
# 111103-2315 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130414-0107 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -82,15 +85,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($DB) {$MAIN.="$stmt\n";}
|
if ($DB) {$MAIN.="$stmt\n";}
|
||||||
@@ -124,6 +118,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -938,6 +961,25 @@ else
|
|||||||
|
|
||||||
$ASCII_text.="INBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n";
|
$ASCII_text.="INBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -961,10 +1003,8 @@ if ($file_download > 0)
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($report_display_type=="HTML")
|
if ($report_display_type=="HTML")
|
||||||
@@ -998,5 +1038,24 @@ if ($file_download > 0)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_DIDstats.php
|
# AST_DIDstats.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -15,8 +15,11 @@
|
|||||||
# 110703-1809 - Added download option
|
# 110703-1809 - Added download option
|
||||||
# 111104-1133 - Added user_group restrictions for selecting in-groups
|
# 111104-1133 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130414-0113 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -67,15 +70,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||||
@@ -189,6 +183,36 @@ else
|
|||||||
if (strlen($group_SQL)<3) {$group_SQL="''";}
|
if (strlen($group_SQL)<3) {$group_SQL="''";}
|
||||||
|
|
||||||
|
|
||||||
|
##### 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";
|
||||||
|
|
||||||
|
$AMP='&';
|
||||||
|
$QM='?';
|
||||||
|
$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."?DB=".$DB."&file_download=".$file_download."&query_date=".$query_date."&end_date=".$end_date."&shift=".$shift."&report_display_type=".$report_display_type."$groupQS';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$HEADER.="<HTML>\n";
|
$HEADER.="<HTML>\n";
|
||||||
$HEADER.="<HEAD>\n";
|
$HEADER.="<HEAD>\n";
|
||||||
@@ -1070,6 +1094,25 @@ else
|
|||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
echo $HEADER;
|
echo $HEADER;
|
||||||
@@ -1079,5 +1122,25 @@ else
|
|||||||
echo $MAIN;
|
echo $MAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_GROUP_ALIASstats.php
|
# AST_GROUP_ALIASstats.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# If you are going to run this report I would recommend adding the following in MySQL:
|
# If you are going to run this report I would recommend adding the following in MySQL:
|
||||||
# CREATE INDEX extension on call_log (extension);
|
# CREATE INDEX extension on call_log (extension);
|
||||||
@@ -9,8 +9,13 @@
|
|||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
# 90914-1003 - First build
|
# 90914-1003 - First build
|
||||||
|
# 130414-0214 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='Group Alias Report';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -54,7 +59,6 @@ $rslt=mysql_query($stmt, $link);
|
|||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$auth=$row[0];
|
$auth=$row[0];
|
||||||
|
|
||||||
|
|
||||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||||
{
|
{
|
||||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||||
@@ -63,6 +67,26 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$query_date, $end_date|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
$NOW_DATE = date("Y-m-d");
|
$NOW_DATE = date("Y-m-d");
|
||||||
$NOW_TIME = date("Y-m-d H:i:s");
|
$NOW_TIME = date("Y-m-d H:i:s");
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
@@ -234,6 +258,25 @@ $ENDtime = date("U");
|
|||||||
$RUNtime = ($ENDtime - $STARTtime);
|
$RUNtime = ($ENDtime - $STARTtime);
|
||||||
echo "<BR><BR>\nRun Time: $RUNtime seconds\n";
|
echo "<BR><BR>\nRun Time: $RUNtime seconds\n";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_IVRfilter.php
|
# AST_IVRfilter.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -9,8 +9,13 @@
|
|||||||
# 90310-2054 - Admin header
|
# 90310-2054 - Admin header
|
||||||
# 90508-0644 - Changed to PHP long tags
|
# 90508-0644 - Changed to PHP long tags
|
||||||
# 120113-2022 - Added new columns for sent to queue and agent
|
# 120113-2022 - Added new columns for sent to queue and agent
|
||||||
|
# 130414-0257 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='IVR Filter Report';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -88,6 +93,26 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$campaign[0], $query_date, $end_date|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
$NOW_DATE = date("Y-m-d");
|
$NOW_DATE = date("Y-m-d");
|
||||||
$NOW_TIME = date("Y-m-d H:i:s");
|
$NOW_TIME = date("Y-m-d H:i:s");
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
@@ -494,8 +519,6 @@ if ($file_download == 0 || !$file_download) {
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
|
|
||||||
# $CSV_report=fopen("AST_pause_code_breakdown.csv", "w");
|
# $CSV_report=fopen("AST_pause_code_breakdown.csv", "w");
|
||||||
# fwrite($CSV_report, $CSV_header);
|
# fwrite($CSV_report, $CSV_header);
|
||||||
@@ -503,4 +526,26 @@ if ($file_download == 0 || !$file_download) {
|
|||||||
# fwrite($CSV_report, $CSV_total);
|
# fwrite($CSV_report, $CSV_total);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_IVRstats.php
|
# AST_IVRstats.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 81026-2026 - First build
|
# 81026-2026 - First build
|
||||||
@@ -20,8 +20,11 @@
|
|||||||
# 110703-1850 - Added download option
|
# 110703-1850 - Added download option
|
||||||
# 111103-2315 - Added user_group restrictions for selecting in-groups
|
# 111103-2315 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130114-0115 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -79,15 +82,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||||
@@ -109,6 +103,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -1001,6 +1024,25 @@ else
|
|||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$JS_onload.="}\n";
|
$JS_onload.="}\n";
|
||||||
@@ -1013,6 +1055,25 @@ else
|
|||||||
echo $MAIN;
|
echo $MAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -12,8 +12,11 @@
|
|||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
# 120524-1754 - Fixed status categories issue
|
# 120524-1754 - Fixed status categories issue
|
||||||
# 130221-1928 - small change to remove nested SQL query
|
# 130221-1928 - small change to remove nested SQL query
|
||||||
|
# 130414-0127 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -60,15 +63,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||||
@@ -90,6 +84,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -982,7 +1005,6 @@ else
|
|||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
$JS_onload.="}\n";
|
$JS_onload.="}\n";
|
||||||
$JS_text.=$JS_onload;
|
$JS_text.=$JS_onload;
|
||||||
@@ -995,5 +1017,25 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_LIST_UPDATEstats.php
|
# AST_LIST_UPDATEstats.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -10,8 +10,11 @@
|
|||||||
# 100712-1324 - Added system setting slave server option
|
# 100712-1324 - Added system setting slave server option
|
||||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||||
|
# 130414-0201 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -54,15 +57,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||||
@@ -84,6 +78,35 @@ if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -233,6 +256,24 @@ $RUNtime = ($ENDtime - $STARTtime);
|
|||||||
echo "</TABLE><BR>\nRun Time: $RUNtime seconds|$db_source\n";
|
echo "</TABLE><BR>\nRun Time: $RUNtime seconds|$db_source\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_OUTBOUNDsummary_interval.php
|
# AST_OUTBOUNDsummary_interval.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -15,8 +15,11 @@
|
|||||||
# 110703-1825 - Added download option
|
# 110703-1825 - Added download option
|
||||||
# 111104-1205 - Added user_group and calltime restrictions
|
# 111104-1205 - Added user_group and calltime restrictions
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130414-0119 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -82,15 +85,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($DB) {$MAIN.="$stmt\n";}
|
if ($DB) {$MAIN.="$stmt\n";}
|
||||||
@@ -132,6 +126,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$LOGallowed_campaignsSQL='';
|
$LOGallowed_campaignsSQL='';
|
||||||
$whereLOGallowed_campaignsSQL='';
|
$whereLOGallowed_campaignsSQL='';
|
||||||
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_call_times from vicidial_user_groups where user_group='$user_group';";
|
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_call_times from vicidial_user_groups where user_group='$user_group';";
|
||||||
@@ -1452,6 +1475,25 @@ else
|
|||||||
|
|
||||||
$ASCII_text.="INBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n";
|
$ASCII_text.="INBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1521,6 +1563,25 @@ else
|
|||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$JS_onload.="}\n";
|
$JS_onload.="}\n";
|
||||||
@@ -1555,6 +1616,24 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_VDADstats.php
|
# AST_VDADstats.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat
|
# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat
|
||||||
@@ -32,8 +32,11 @@
|
|||||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||||
# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log
|
# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130414-0117 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -103,15 +106,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
##### SERVER CARRIER LOGGING LOOKUP #####
|
##### SERVER CARRIER LOGGING LOOKUP #####
|
||||||
$stmt = "SELECT count(*) FROM servers where carrier_logging_active='Y' and max_vicidial_trunks > 0;";
|
$stmt = "SELECT count(*) FROM servers where carrier_logging_active='Y' and max_vicidial_trunks > 0;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -144,6 +138,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -1557,6 +1580,25 @@ else
|
|||||||
|
|
||||||
echo "OUTBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$outbound_rate = \$$outbound_cost</B>\n";
|
echo "OUTBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$outbound_rate = \$$outbound_cost</B>\n";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1792,6 +1834,25 @@ else
|
|||||||
$JS_text.="</script>\n";
|
$JS_text.="</script>\n";
|
||||||
echo $JS_text;
|
echo $JS_text;
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</PRE>
|
</PRE>
|
||||||
</TD></TR></TABLE>
|
</TD></TR></TABLE>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_VICIDIAL_hopperlist.php
|
# AST_VICIDIAL_hopperlist.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -16,8 +16,13 @@
|
|||||||
# 111103-1207 - Added admin_hide_phone_data and admin_hide_lead_data options
|
# 111103-1207 - Added admin_hide_phone_data and admin_hide_lead_data options
|
||||||
# 120210-1218 - Added vendor_lead_code to output
|
# 120210-1218 - Added vendor_lead_code to output
|
||||||
# 120221-0059 - Added User Group restriction settings
|
# 120221-0059 - Added User Group restriction settings
|
||||||
|
# 130414-0159 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='Hopper List Report';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -49,6 +54,26 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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, $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
@@ -226,6 +251,24 @@ else
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,17 @@
|
|||||||
#
|
#
|
||||||
# shows the agents logged into vicidial and set to take calls from in-group
|
# shows the agents logged into vicidial and set to take calls from in-group
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 100320-2102 - First Build
|
# 100320-2102 - First Build
|
||||||
|
# 130414-0222 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='In-Group User List';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -40,6 +45,26 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
$NOW_DATE = date("Y-m-d");
|
$NOW_DATE = date("Y-m-d");
|
||||||
$NOW_TIME = date("Y-m-d H:i:s");
|
$NOW_TIME = date("Y-m-d H:i:s");
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
@@ -205,6 +230,25 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</PRE>
|
</PRE>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_agent_days_detail.php
|
# AST_agent_days_detail.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -16,8 +16,10 @@
|
|||||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||||
# 111104-1302 - Added user_group restrictions for selecting in-groups
|
# 111104-1302 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130414-0143 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
@@ -71,15 +73,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -104,6 +97,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -718,6 +740,25 @@ if ($file_download > 0)
|
|||||||
|
|
||||||
echo "$file_output";
|
echo "$file_output";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -846,6 +887,27 @@ if ($report_display_type=="TEXT" || !$report_display_type)
|
|||||||
|
|
||||||
echo "</span>\n";
|
echo "</span>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</BODY></HTML>
|
</BODY></HTML>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_agent_performance_detail.php
|
# AST_agent_performance_detail.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -31,8 +31,11 @@
|
|||||||
# 111104-1249 - Added user_group restrictions for selecting in-groups
|
# 111104-1249 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
# 121130-0952 - Fix for user group permissions issue #588
|
# 121130-0952 - Fix for user group permissions issue #588
|
||||||
|
# 130414-0140 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -87,15 +90,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -120,6 +114,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$HTML_text.="|$stmt|\n";}
|
if ($DB) {$HTML_text.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -960,6 +983,25 @@ if ($file_download == 1)
|
|||||||
|
|
||||||
echo "$CSV_header$CSV_lines$CSV_total";
|
echo "$CSV_header$CSV_lines$CSV_total";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -974,11 +1016,6 @@ $ASCII_text.="\n\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$sub_statuses='-';
|
$sub_statuses='-';
|
||||||
$sub_statusesTXT='';
|
$sub_statusesTXT='';
|
||||||
$sub_statusesHEAD='';
|
$sub_statusesHEAD='';
|
||||||
@@ -1330,6 +1367,25 @@ if ($file_download == 2)
|
|||||||
|
|
||||||
echo "$CSV_header$CSV_lines$CSV_total";
|
echo "$CSV_header$CSV_lines$CSV_total";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$CSV_report=fopen("AST_pause_code_breakdown.csv", "w");
|
$CSV_report=fopen("AST_pause_code_breakdown.csv", "w");
|
||||||
@@ -1360,5 +1416,25 @@ if ($file_download == 0 || !$file_download) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_agent_status_detail.php
|
# AST_agent_status_detail.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -18,8 +18,10 @@
|
|||||||
# 111104-1248 - Added user_group restrictions for selecting in-groups
|
# 111104-1248 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
# 121130-0958 - Fix for user group permissions issue #588
|
# 121130-0958 - Fix for user group permissions issue #588
|
||||||
|
# 130414-0139 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
@@ -73,15 +75,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -106,6 +99,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -791,6 +813,25 @@ if ($file_download > 0)
|
|||||||
|
|
||||||
echo "$file_output";
|
echo "$file_output";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -933,6 +974,26 @@ if (!$report_display_type || $report_display_type=="TEXT")
|
|||||||
|
|
||||||
echo "</span>\n";
|
echo "</span>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</BODY></HTML>
|
</BODY></HTML>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
# Pulls time stats per agent selectable by campaign or user group
|
# Pulls time stats per agent selectable by campaign or user group
|
||||||
# should be most accurate agent stats of all of the reports
|
# should be most accurate agent stats of all of the reports
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 90522-0723 - First build
|
# 90522-0723 - First build
|
||||||
@@ -24,8 +24,11 @@
|
|||||||
# 111104-1248 - Added user_group restrictions for selecting in-groups
|
# 111104-1248 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
# 121130-0957 - Fix for user group permissions issue #588
|
# 121130-0957 - Fix for user group permissions issue #588
|
||||||
|
# 130414-0137 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -95,15 +98,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -128,6 +122,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -1126,6 +1149,25 @@ if ($file_download > 0)
|
|||||||
|
|
||||||
echo "$file_output";
|
echo "$file_output";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1282,6 +1324,25 @@ while ($m < $k)
|
|||||||
echo "</span>\n";
|
echo "</span>\n";
|
||||||
##### END horizontal yellow transparent bar graph overlay on top of agent stats
|
##### END horizontal yellow transparent bar graph overlay on top of agent stats
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</BODY></HTML>
|
</BODY></HTML>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_agent_time_sheet.php
|
# AST_agent_time_sheet.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -16,8 +16,11 @@
|
|||||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||||
# 110703-1848 - Added download option
|
# 110703-1848 - Added download option
|
||||||
# 111104-1308 - Added user_group restrictions for selecting in-groups
|
# 111104-1308 - Added user_group restrictions for selecting in-groups
|
||||||
|
# 130414-0148 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -42,14 +45,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||||
@@ -93,6 +88,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$user, $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -416,16 +440,33 @@ $MAIN.="</BODY></HTML>\n";
|
|||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
echo $HEADER;
|
echo $HEADER;
|
||||||
require("admin_header.php");
|
require("admin_header.php");
|
||||||
echo $MAIN;
|
echo $MAIN;
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_agent_time_sheet_archive.php
|
# AST_agent_time_sheet_archive.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
# 60619-1721 - Added variable filtering to eliminate SQL injection attack threat
|
# 60619-1721 - Added variable filtering to eliminate SQL injection attack threat
|
||||||
# - Added required user/pass to gain access to this page
|
# - Added required user/pass to gain access to this page
|
||||||
# 90508-0644 - Changed to PHP long tags
|
# 90508-0644 - Changed to PHP long tags
|
||||||
|
# 130414-0156 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='Agent Timesheet Archive';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -43,6 +48,26 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
$NOW_DATE = date("Y-m-d");
|
$NOW_DATE = date("Y-m-d");
|
||||||
$NOW_TIME = date("Y-m-d H:i:s");
|
$NOW_TIME = date("Y-m-d H:i:s");
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
@@ -278,6 +303,26 @@ $login_time = ($end - $start);
|
|||||||
echo "-----------------------------------------\n";
|
echo "-----------------------------------------\n";
|
||||||
echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n";
|
echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n";
|
||||||
|
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# Pulls all timeclock records for an agent
|
# Pulls all timeclock records for an agent
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 90602-2244 - First build
|
# 90602-2244 - First build
|
||||||
@@ -13,8 +13,10 @@
|
|||||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||||
# 111104-1315 - Added user_group restrictions for selecting in-groups
|
# 111104-1315 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130414-0154 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
@@ -67,15 +69,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -100,6 +93,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$user_group[0], $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -682,6 +704,25 @@ if ($file_download > 0)
|
|||||||
|
|
||||||
echo "$file_output";
|
echo "$file_output";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -816,6 +857,25 @@ $ENDtime = date("U");
|
|||||||
$RUNtime = ($ENDtime - $STARTtime);
|
$RUNtime = ($ENDtime - $STARTtime);
|
||||||
echo "<font size=1 color=white>$RUNtime|$db_source</font>\n";
|
echo "<font size=1 color=white>$RUNtime|$db_source</font>\n";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</BODY></HTML>
|
</BODY></HTML>
|
||||||
|
|||||||
@@ -4,14 +4,17 @@
|
|||||||
# This report is designed to show the breakdown by list_id of the calls and
|
# This report is designed to show the breakdown by list_id of the calls and
|
||||||
# their statuses for all lists within a campaign for a set time period
|
# their statuses for all lists within a campaign for a set time period
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
# 110815-2138 - First build
|
# 110815-2138 - First build
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130414-0129 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -64,15 +67,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
######################################
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = preg_replace("/[^0-9a-zA-Z]/","",$PHP_AUTH_PW);
|
||||||
@@ -97,6 +91,36 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$HTML_text.="|$stmt|\n";}
|
if ($DB) {$HTML_text.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -456,8 +480,6 @@ if ($file_download>0)
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -468,4 +490,26 @@ else
|
|||||||
echo $HTML_text;
|
echo $HTML_text;
|
||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,26 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_carrier_log_report.php
|
# AST_carrier_log_report.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 120210-2202 - First build
|
# 120210-2202 - First build
|
||||||
|
# 130413-2213 - Added SIP codes summary and fields, and report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
|
$report_name='Carrier Log Report';
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||||
if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];}
|
if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];}
|
||||||
elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];}
|
elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];}
|
||||||
if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];}
|
if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];}
|
||||||
elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];}
|
elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];}
|
||||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||||
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||||
if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];}
|
if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];}
|
||||||
@@ -54,14 +58,7 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
$NOW_DATE = date("Y-m-d");
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
@@ -84,10 +81,39 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
|
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
|
||||||
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
|
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
|
||||||
$NOW_DATE = date("Y-m-d");
|
|
||||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||||
|
|
||||||
$server_ip_string='|';
|
$server_ip_string='|';
|
||||||
@@ -223,7 +249,29 @@ if ($SUBMIT && $server_ip_ct>0) {
|
|||||||
}
|
}
|
||||||
$MAIN.="+--------------+-------------+---------+\n";
|
$MAIN.="+--------------+-------------+---------+\n";
|
||||||
$MAIN.="| TOTAL | ".sprintf("%-8s", $total_count)."|\n";
|
$MAIN.="| TOTAL | ".sprintf("%-8s", $total_count)."|\n";
|
||||||
$MAIN.="+--------------+-------------+---------+\n\n\n";
|
$MAIN.="+--------------+-------------+---------+\n\n";
|
||||||
|
|
||||||
|
$stmt="select sip_hangup_cause,sip_hangup_reason,count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL group by sip_hangup_cause,sip_hangup_reason order by sip_hangup_cause,sip_hangup_reason";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$MAIN.="<PRE><font size=2>\n";
|
||||||
|
if ($DB) {$MAIN.=$stmt."\n";}
|
||||||
|
if (mysql_num_rows($rslt)>0) {
|
||||||
|
$MAIN.="--- SIP ERROR REASON BREAKDOWN FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string\n";
|
||||||
|
$MAIN.="+----------+--------------------------------+---------+\n";
|
||||||
|
$MAIN.="| SIP CODE | SIP HANGUP REASON | COUNT |\n";
|
||||||
|
$MAIN.="+----------+--------------------------------+---------+\n";
|
||||||
|
$total_count=0;
|
||||||
|
while ($row=mysql_fetch_array($rslt)) {
|
||||||
|
$MAIN.="| ".sprintf("%8s", $row["sip_hangup_cause"])." ";
|
||||||
|
$MAIN.="| ".sprintf("%-31s", $row["sip_hangup_reason"]);
|
||||||
|
$MAIN.="| ".sprintf("%-8s", $row["ct"]);
|
||||||
|
$MAIN.="|\n";
|
||||||
|
$total_count+=$row["ct"];
|
||||||
|
}
|
||||||
|
$MAIN.="+----------+--------------------------------+---------+\n";
|
||||||
|
$MAIN.="| TOTAL | ".sprintf("%-8s", $total_count)."|\n";
|
||||||
|
$MAIN.="+-------------------------------------------+---------+\n\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL order by vicidial_carrier_log.call_date asc";
|
$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL order by vicidial_carrier_log.call_date asc";
|
||||||
$rpt_rslt=mysql_query($rpt_stmt, $link);
|
$rpt_rslt=mysql_query($rpt_stmt, $link);
|
||||||
@@ -233,10 +281,10 @@ if ($SUBMIT && $server_ip_ct>0) {
|
|||||||
if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
|
if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
|
||||||
|
|
||||||
$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, RECORDS #$lower_limit-$upper_limit <a href=\"$PHP_SELF?SUBMIT=$SUBMIT&DB=$DB&type=$type&query_date=$query_date&query_date_D=$query_date_D&query_date_T=$query_date_T$server_ipQS&lower_limit=$lower_limit&upper_limit=$upper_limit&file_download=1\">[DOWNLOAD]</a>\n";
|
$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, RECORDS #$lower_limit-$upper_limit <a href=\"$PHP_SELF?SUBMIT=$SUBMIT&DB=$DB&type=$type&query_date=$query_date&query_date_D=$query_date_D&query_date_T=$query_date_T$server_ipQS&lower_limit=$lower_limit&upper_limit=$upper_limit&file_download=1\">[DOWNLOAD]</a>\n";
|
||||||
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
|
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+----------+--------------------------------+--------------+\n";
|
||||||
$carrier_rpt.="| UNIQUE ID | CALL DATE | SERVER IP | LEAD ID | HANGUP CAUSE | DIAL STATUS | CHANNEL | DIAL TIME | ANSWERED TIME | PHONE NUMBER |\n";
|
$carrier_rpt.="| UNIQUE ID | CALL DATE | SERVER IP | LEAD ID | HANGUP CAUSE | DIAL STATUS | CHANNEL | DIAL TIME | ANSWERED TIME | SIP CODE | SIP HANGUP REASON | PHONE NUMBER |\n";
|
||||||
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
|
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+----------+--------------------------------+--------------+\n";
|
||||||
$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVER IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"ANSWERED TIME\",\"PHONE NUMBER\"\n";
|
$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVER IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"ANSWERED TIME\",\"SIP CODE\",\"SIP HANGUP REASON\",\"PHONE NUMBER\"\n";
|
||||||
|
|
||||||
for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
|
for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
|
||||||
$row=mysql_fetch_array($rpt_rslt);
|
$row=mysql_fetch_array($rpt_rslt);
|
||||||
@@ -255,7 +303,7 @@ if ($SUBMIT && $server_ip_ct>0) {
|
|||||||
$phone_number=$row["phone_number"];
|
$phone_number=$row["phone_number"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n";
|
$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$row[sip_hangup_cause]\",\"$row[sip_hangup_reason]\",\"$phone_number\"\n";
|
||||||
if ($i>=$lower_limit && $i<=$upper_limit) {
|
if ($i>=$lower_limit && $i<=$upper_limit) {
|
||||||
if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
|
if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
|
||||||
$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]);
|
$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]);
|
||||||
@@ -267,10 +315,12 @@ if ($SUBMIT && $server_ip_ct>0) {
|
|||||||
$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]);
|
$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]);
|
||||||
$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]);
|
$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]);
|
||||||
$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]);
|
$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]);
|
||||||
|
$carrier_rpt.="| ".sprintf("%8s", $row["sip_hangup_cause"])." ";
|
||||||
|
$carrier_rpt.="| ".sprintf("%-31s", $row["sip_hangup_reason"]);
|
||||||
$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n";
|
$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n";
|
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+----------+--------------------------------+--------------+\n";
|
||||||
|
|
||||||
$carrier_rpt_hf="";
|
$carrier_rpt_hf="";
|
||||||
$ll=$lower_limit-1000;
|
$ll=$lower_limit-1000;
|
||||||
@@ -315,11 +365,31 @@ if ($SUBMIT && $server_ip_ct>0) {
|
|||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
echo $HEADER;
|
echo $HEADER;
|
||||||
require("admin_header.php");
|
require("admin_header.php");
|
||||||
echo $MAIN;
|
echo $MAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_dialer_inventory_report.php
|
# AST_dialer_inventory_report.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||||
# Matt Florell <vicidial@gmail.com>
|
# Matt Florell <vicidial@gmail.com>
|
||||||
#
|
#
|
||||||
# NOTES:
|
# NOTES:
|
||||||
@@ -14,8 +14,11 @@
|
|||||||
# 111106-1327 - Reformatting, other minor changes
|
# 111106-1327 - Reformatting, other minor changes
|
||||||
# 111230-1145 - Debugging additions and more minor changes
|
# 111230-1145 - Debugging additions and more minor changes
|
||||||
# 120221-2237 - Added totals, list options, other small changes
|
# 120221-2237 - Added totals, list options, other small changes
|
||||||
|
# 130414-0131 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -77,15 +80,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
#$HTML_header.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$HTML_header.="|$stmt|\n";}
|
if ($DB) {$HTML_header.="|$stmt|\n";}
|
||||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||||
@@ -107,6 +101,34 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
#$HTML_header.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$HTML_header.="|$stmt|\n";}
|
if ($DB) {$HTML_header.="|$stmt|\n";}
|
||||||
@@ -882,8 +904,6 @@ if ($file_download>0)
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -894,6 +914,27 @@ else
|
|||||||
echo $HTML_text;
|
echo $HTML_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,13 @@
|
|||||||
#
|
#
|
||||||
# CHANGELOG:
|
# CHANGELOG:
|
||||||
# 130221-2117 - First build
|
# 130221-2117 - First build
|
||||||
|
# 130414-0132 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
$version = '2.6-1';
|
$startMS = microtime();
|
||||||
$build = '130221-2117';
|
|
||||||
|
$version = '2.6-2';
|
||||||
|
$build = '130414-0132';
|
||||||
|
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
@@ -73,15 +76,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($DB) {$MAIN.="$stmt\n";}
|
if ($DB) {$MAIN.="$stmt\n";}
|
||||||
@@ -115,6 +109,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -502,7 +525,6 @@ if ($file_download>0) {
|
|||||||
|
|
||||||
echo "$CSV_text1";
|
echo "$CSV_text1";
|
||||||
|
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
echo $HEADER;
|
echo $HEADER;
|
||||||
echo $JS_text;
|
echo $JS_text;
|
||||||
@@ -512,5 +534,26 @@ if ($file_download>0) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_carrier_log_report.php
|
# AST_carrier_log_report.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 120331-2301 - First build
|
# 120331-2301 - First build
|
||||||
|
# 130413-2348 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='Hangup Cause Report';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
@@ -56,15 +60,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||||
@@ -87,6 +82,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
##### 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";
|
||||||
|
|
||||||
|
$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', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
|
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
|
||||||
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
|
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
|
||||||
$NOW_DATE = date("Y-m-d");
|
$NOW_DATE = date("Y-m-d");
|
||||||
@@ -101,7 +125,7 @@ while($i < $server_ip_ct)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$server_stmt="select distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc";
|
$server_stmt="SELECT distinct s.server_ip, s.server_description from servers s, vicidial_carrier_log vcl where s.server_ip=vcl.server_ip order by server_ip asc";
|
||||||
$server_rslt=mysql_query($server_stmt, $link);
|
$server_rslt=mysql_query($server_stmt, $link);
|
||||||
$servers_to_print=mysql_num_rows($server_rslt);
|
$servers_to_print=mysql_num_rows($server_rslt);
|
||||||
$i=0;
|
$i=0;
|
||||||
@@ -161,7 +185,7 @@ while($i < $hangup_cause_ct)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hangupcause_stmt="select distinct hangup_cause, dialstatus from vicidial_carrier_log order by dialstatus, hangup_cause asc";
|
$hangupcause_stmt="SELECT distinct hangup_cause, dialstatus from vicidial_carrier_log order by dialstatus, hangup_cause asc";
|
||||||
$hangupcause_rslt=mysql_query($hangupcause_stmt, $link);
|
$hangupcause_rslt=mysql_query($hangupcause_stmt, $link);
|
||||||
$causes_to_print=mysql_num_rows($hangupcause_rslt);
|
$causes_to_print=mysql_num_rows($hangupcause_rslt);
|
||||||
$i=0;
|
$i=0;
|
||||||
@@ -292,7 +316,7 @@ $MAIN.="<TD ROWSPAN=2 VALIGN=middle align=center>\n";
|
|||||||
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT><BR/><BR/>\n";
|
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT><BR/><BR/>\n";
|
||||||
$MAIN.="</TD></TR></TABLE>\n";
|
$MAIN.="</TD></TR></TABLE>\n";
|
||||||
if ($SUBMIT && $server_ip_ct>0) {
|
if ($SUBMIT && $server_ip_ct>0) {
|
||||||
$stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus";
|
$stmt="SELECT hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$MAIN.="<PRE><font size=2>\n";
|
$MAIN.="<PRE><font size=2>\n";
|
||||||
if ($DB) {$MAIN.=$stmt."\n";}
|
if ($DB) {$MAIN.=$stmt."\n";}
|
||||||
@@ -313,7 +337,7 @@ if ($SUBMIT && $server_ip_ct>0) {
|
|||||||
$MAIN.="| TOTAL | ".sprintf("%-8s", $total_count)."|\n";
|
$MAIN.="| TOTAL | ".sprintf("%-8s", $total_count)."|\n";
|
||||||
$MAIN.="+--------------+-------------+---------+\n\n\n";
|
$MAIN.="+--------------+-------------+---------+\n\n\n";
|
||||||
|
|
||||||
$rpt_stmt="select vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL order by vicidial_carrier_log.call_date asc";
|
$rpt_stmt="SELECT vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL order by vicidial_carrier_log.call_date asc";
|
||||||
$rpt_rslt=mysql_query($rpt_stmt, $link);
|
$rpt_rslt=mysql_query($rpt_stmt, $link);
|
||||||
if ($DB) {$MAIN.=$rpt_stmt."\n";}
|
if ($DB) {$MAIN.=$rpt_stmt."\n";}
|
||||||
|
|
||||||
@@ -331,7 +355,7 @@ if ($SUBMIT && $server_ip_ct>0) {
|
|||||||
$phone_number=""; $phone_note="";
|
$phone_number=""; $phone_note="";
|
||||||
|
|
||||||
if (strlen($row["phone_number"])==0) {
|
if (strlen($row["phone_number"])==0) {
|
||||||
$stmt2="select phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
|
$stmt2="SELECT phone_number, alt_phone, address3 from vicidial_list where lead_id='$row[lead_id]'";
|
||||||
$rslt2=mysql_query($stmt2, $link);
|
$rslt2=mysql_query($stmt2, $link);
|
||||||
$channel=$row["channel"];
|
$channel=$row["channel"];
|
||||||
while ($row2=mysql_fetch_array($rslt2)) {
|
while ($row2=mysql_fetch_array($rslt2)) {
|
||||||
@@ -403,11 +427,31 @@ if ($SUBMIT && $server_ip_ct>0) {
|
|||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
echo $HEADER;
|
echo $HEADER;
|
||||||
require("admin_header.php");
|
require("admin_header.php");
|
||||||
echo $MAIN;
|
echo $MAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -13,8 +13,11 @@
|
|||||||
# 120819-0118 - Formatting changes
|
# 120819-0118 - Formatting changes
|
||||||
# 121115-0621 - Changed to multi-select for in-group selection
|
# 121115-0621 - Changed to multi-select for in-group selection
|
||||||
# 130322-2008 - Added Unique Agents column
|
# 130322-2008 - Added Unique Agents column
|
||||||
|
# 130414-0110 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
if (file_exists('options.php'))
|
if (file_exists('options.php'))
|
||||||
@@ -77,15 +80,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||||
@@ -107,6 +101,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -2205,18 +2228,42 @@ else
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
echo "$HEADER";
|
echo "$HEADER";
|
||||||
require("admin_header.php");
|
require("admin_header.php");
|
||||||
echo "$MAIN";
|
echo "$MAIN";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.php");
|
||||||
|
if ($file_download < 1)
|
||||||
|
{echo "<!-- Switching back to Master server to log report run time $VARDB_server $db_source -->\n";}
|
||||||
|
}
|
||||||
|
|
||||||
|
$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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function HourDifference($time_BEGIN, $time_END) {
|
function HourDifference($time_BEGIN, $time_END) {
|
||||||
global $hpd;
|
global $hpd;
|
||||||
$TB_array = explode(':',$time_BEGIN);
|
$TB_array = explode(':',$time_BEGIN);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_server_performance.php
|
# AST_server_performance.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -16,8 +16,11 @@
|
|||||||
# 100712-1324 - Added system setting slave server option
|
# 100712-1324 - Added system setting slave server option
|
||||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||||
|
# 130414-0157 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -59,15 +62,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -88,6 +82,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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, $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -397,6 +420,24 @@ echo "<!-- /usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile -->";
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
# QC statuses of QCFAIL, QCCANC and sales are defined by the Sale=Y status
|
# QC statuses of QCFAIL, QCCANC and sales are defined by the Sale=Y status
|
||||||
# flags being set on those statuses.
|
# flags being set on those statuses.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -15,8 +15,11 @@
|
|||||||
# 111104-1259 - Added user_group restrictions for selecting in-groups
|
# 111104-1259 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-1424 - Added new colums and PRECAL to System Time
|
# 120224-1424 - Added new colums and PRECAL to System Time
|
||||||
# 120307-1926 - Added additional statuses option and HTML display option
|
# 120307-1926 - Added additional statuses option and HTML display option
|
||||||
|
# 130414-0142 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -70,15 +73,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
######################################
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
@@ -104,6 +98,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$HTML_text.="|$stmt|\n";}
|
if ($DB) {$HTML_text.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -1301,8 +1324,6 @@ if ($file_download>0)
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1327,4 +1348,26 @@ else
|
|||||||
echo $HTML_text;
|
echo $HTML_text;
|
||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -4,13 +4,16 @@
|
|||||||
# This User-Group based report runs some very intensive SQL queries, so it is
|
# This User-Group based report runs some very intensive SQL queries, so it is
|
||||||
# not recommended to run this on long time periods.
|
# not recommended to run this on long time periods.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
# 120526-0803 - First build
|
# 120526-0803 - First build
|
||||||
|
# 130414-0145 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -51,16 +54,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
######################################
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -85,6 +78,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$HTML_text.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$HTML_text.="|$stmt|\n";}
|
if ($DB) {$HTML_text.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -270,8 +292,6 @@ if ($file_download>0)
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -296,4 +316,26 @@ else
|
|||||||
echo $HTML_text;
|
echo $HTML_text;
|
||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
|
|
||||||
@@ -107,7 +109,7 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
|||||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||||
$QUERY_STRING = getenv("QUERY_STRING");
|
$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, 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';
|
$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, 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';
|
||||||
|
|
||||||
$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, 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';
|
$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, 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';
|
||||||
|
|
||||||
@@ -3235,12 +3237,13 @@ else
|
|||||||
# 130130-1207 - Added new CPD AMD options for In-Groups and CallMenus
|
# 130130-1207 - Added new CPD AMD options for In-Groups and CallMenus
|
||||||
# 130221-1736 - Added Level 8 Disable Add option to system settings and new Email Log Report link, DID exten made non-editable
|
# 130221-1736 - Added Level 8 Disable Add option to system settings and new Email Log Report link, DID exten made non-editable
|
||||||
# 130402-2322 - Added user_group script variable
|
# 130402-2322 - Added user_group script variable
|
||||||
|
# 130414-1924 - Added report logging and display
|
||||||
#
|
#
|
||||||
|
|
||||||
# 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
|
# 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.6-396a';
|
$admin_version = '2.6-397a';
|
||||||
$build = '130402-2322';
|
$build = '130414-1924';
|
||||||
|
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
$SQLdate = date("Y-m-d H:i:s");
|
$SQLdate = date("Y-m-d H:i:s");
|
||||||
@@ -3835,6 +3838,9 @@ if ($ADD==700000000000000) {$hh='reports'; echo "VICIDIAL ADMIN CHANGE LOG";}
|
|||||||
if ($ADD==710000000000000) {$hh='reports'; echo "VICIDIAL USER ADMIN CHANGE LOG";}
|
if ($ADD==710000000000000) {$hh='reports'; echo "VICIDIAL USER ADMIN CHANGE LOG";}
|
||||||
if ($ADD==720000000000000) {$hh='reports'; echo "VICIDIAL SECTION ADMIN CHANGE LOG";}
|
if ($ADD==720000000000000) {$hh='reports'; echo "VICIDIAL SECTION ADMIN CHANGE LOG";}
|
||||||
if ($ADD==730000000000000) {$hh='reports'; echo "VICIDIAL DETAIL ADMIN CHANGE LOG";}
|
if ($ADD==730000000000000) {$hh='reports'; echo "VICIDIAL DETAIL ADMIN CHANGE LOG";}
|
||||||
|
if ($ADD==800000000000000) {$hh='reports'; echo "VICIDIAL ADMIN REPORT LOG";}
|
||||||
|
if ($ADD==810000000000000) {$hh='reports'; echo "VICIDIAL USER ADMIN REPORT LOG";}
|
||||||
|
if ($ADD==830000000000000) {$hh='reports'; echo "VICIDIAL DETAIL ADMIN REPORT LOG";}
|
||||||
if ($ADD==0) {$hh='users'; echo "Users List";}
|
if ($ADD==0) {$hh='users'; echo "Users List";}
|
||||||
if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";}
|
if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";}
|
||||||
if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "CallBacks Within Campaign";}
|
if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "CallBacks Within Campaign";}
|
||||||
@@ -3887,6 +3893,33 @@ if ($ADD==999993) {$hh='reports'; echo "SUMMARY STATS";}
|
|||||||
if ($ADD==999992) {$hh='reports'; echo "SYSTEM SUMMARY STATS";}
|
if ($ADD==999992) {$hh='reports'; echo "SYSTEM SUMMARY STATS";}
|
||||||
if ($ADD==999991) {$hh='reports'; echo "SERVERS VERSIONS";}
|
if ($ADD==999991) {$hh='reports'; echo "SERVERS VERSIONS";}
|
||||||
|
|
||||||
|
if ( ($ADD==999993) or ($ADD==999992) or ($ADD==730000000000000) or ($ADD==830000000000000) )
|
||||||
|
{
|
||||||
|
if ($ADD==999993) {$report_name = "SUMMARY STATS";}
|
||||||
|
if ($ADD==999992) {$report_name = "SYSTEM SUMMARY STATS";}
|
||||||
|
if ($ADD==730000000000000) {$report_name = "DETAIL ADMIN CHANGE LOG";}
|
||||||
|
if ($ADD==830000000000000) {$report_name = "DETAIL ADMIN REPORT LOG";}
|
||||||
|
|
||||||
|
##### 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";
|
||||||
|
|
||||||
|
$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, $query_date, $end_date, $shift, $stage, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
}
|
||||||
|
|
||||||
if ( ($ADD>9) and ($ADD < 99998) )
|
if ( ($ADD>9) and ($ADD < 99998) )
|
||||||
{
|
{
|
||||||
@@ -32537,7 +32570,7 @@ if ($ADD==311111111111111)
|
|||||||
|
|
||||||
echo "<tr bgcolor=#B6D3FC><td align=right>Slave Database Server: </td><td align=left><input type=text name=slave_db_server size=30 maxlength=50 value=\"$slave_db_server\">$NWB#settings-slave_db_server$NWE</td></tr>\n";
|
echo "<tr bgcolor=#B6D3FC><td align=right>Slave Database Server: </td><td align=left><input type=text name=slave_db_server size=30 maxlength=50 value=\"$slave_db_server\">$NWB#settings-slave_db_server$NWE</td></tr>\n";
|
||||||
|
|
||||||
echo "<tr bgcolor=#B6D3FC><td align=right>Reports to use Slave DB: </td><td align=left><select MULTIPLE size=4 name=reports_use_slave_db[]>\n";
|
echo "<tr bgcolor=#B6D3FC><td align=right>Reports to use Slave DB: </td><td align=left><select MULTIPLE size=5 name=reports_use_slave_db[]>\n";
|
||||||
|
|
||||||
$Vreports_ARY = explode(',',$Vreports);
|
$Vreports_ARY = explode(',',$Vreports);
|
||||||
$Vreports_ct = count($Vreports_ARY);
|
$Vreports_ct = count($Vreports_ARY);
|
||||||
@@ -32555,7 +32588,7 @@ if ($ADD==311111111111111)
|
|||||||
|
|
||||||
if ($SSallow_custom_dialplan > 0)
|
if ($SSallow_custom_dialplan > 0)
|
||||||
{
|
{
|
||||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Custom Dialplan Entry: $NWB#settings-custom_dialplan_entry$NWE <TEXTAREA NAME=custom_dialplan_entry ROWS=5 COLS=80>$custom_dialplan_entry</TEXTAREA></td></tr>\n";
|
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Custom Dialplan Entry: $NWB#settings-custom_dialplan_entry$NWE <TEXTAREA NAME=custom_dialplan_entry ROWS=8 COLS=80>$custom_dialplan_entry</TEXTAREA></td></tr>\n";
|
||||||
|
|
||||||
echo "<tr bgcolor=#B6D3FC><td align=right>Reload Dialplan On Servers: </td><td align=left><select size=1 name=reload_dialplan_on_servers><option>1</option><option selected>0</option></select>$NWB#settings-reload_dialplan_on_servers$NWE</td></tr>\n";
|
echo "<tr bgcolor=#B6D3FC><td align=right>Reload Dialplan On Servers: </td><td align=left><select size=1 name=reload_dialplan_on_servers><option>1</option><option selected>0</option></select>$NWB#settings-reload_dialplan_on_servers$NWE</td></tr>\n";
|
||||||
}
|
}
|
||||||
@@ -34751,22 +34784,22 @@ if ($ADD==700000000000000)
|
|||||||
echo "<TABLE><TR><TD>\n";
|
echo "<TABLE><TR><TD>\n";
|
||||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
if ($stage > 9999)
|
if ($stage > 4999)
|
||||||
{
|
{
|
||||||
$next_limit = ($stage + 10000);
|
$next_limit = ($stage + 5000);
|
||||||
$limitSQL = "10000 offset $stage";
|
$limitSQL = "5000 offset $stage";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$next_limit = "10000";
|
$next_limit = "5000";
|
||||||
$limitSQL = "10000";
|
$limitSQL = "5000";
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code,user_group from vicidial_admin_log $whereLOGadmin_viewable_groupsSQL order by event_date desc limit $limitSQL;";
|
$stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code,user_group from vicidial_admin_log $whereLOGadmin_viewable_groupsSQL order by event_date desc limit $limitSQL;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$logs_to_print = mysql_num_rows($rslt);
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
echo "<br>ADMIN CHANGE LOG: (Last 10000 records)\n";
|
echo "<br>ADMIN CHANGE LOG: (Last 5000 records)\n";
|
||||||
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||||
echo "<TR BGCOLOR=BLACK>";
|
echo "<TR BGCOLOR=BLACK>";
|
||||||
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>";
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>";
|
||||||
@@ -34848,7 +34881,7 @@ if ($ADD==710000000000000)
|
|||||||
$user_name = $row[0];
|
$user_name = $row[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code,user_group from vicidial_admin_log where user='$stage' $LOGadmin_viewable_groupsSQL order by event_date desc limit 10000;";
|
$stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code,user_group from vicidial_admin_log where user='$stage' $LOGadmin_viewable_groupsSQL order by event_date desc limit 5000;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$logs_to_print = mysql_num_rows($rslt);
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
@@ -34934,7 +34967,7 @@ if ($ADD==720000000000000)
|
|||||||
if (preg_match("/DIDS/",$category))
|
if (preg_match("/DIDS/",$category))
|
||||||
{$sectionSQL = "event_section IN('DIDS','DID_RA-EXTEN')";}
|
{$sectionSQL = "event_section IN('DIDS','DID_RA-EXTEN')";}
|
||||||
|
|
||||||
$stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code,user_group from vicidial_admin_log where $sectionSQL and record_id='$stage' $LOGadmin_viewable_groupsSQL order by event_date desc limit 10000;";
|
$stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code,user_group from vicidial_admin_log where $sectionSQL and record_id='$stage' $LOGadmin_viewable_groupsSQL order by event_date desc limit 5000;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$logs_to_print = mysql_num_rows($rslt);
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
@@ -35083,6 +35116,214 @@ if ($ADD==730000000000000)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
######################
|
||||||
|
# ADD=800000000000000 view all activity in the admin report log
|
||||||
|
######################
|
||||||
|
|
||||||
|
if ($ADD==800000000000000)
|
||||||
|
{
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
|
if ($stage > 4999)
|
||||||
|
{
|
||||||
|
$next_limit = ($stage + 5000);
|
||||||
|
$limitSQL = "5000 offset $stage";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$next_limit = "5000";
|
||||||
|
$limitSQL = "5000";
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt="SELECT report_log_id,event_date,user,ip_address,report_name,browser,referer,notes,url,run_time from vicidial_report_log order by event_date desc limit $limitSQL;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
|
|
||||||
|
echo "<br>ADMIN REPORT LOG: (Last 5000 records)\n";
|
||||||
|
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||||
|
echo "<TR BGCOLOR=BLACK>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DATE TIME</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>USER</B></TD>\n";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>IP</TD>\n";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>REPORT</TD>\n";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RUN TIME</TD>\n";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>GOTO</TD>\n";
|
||||||
|
echo "</TR>\n";
|
||||||
|
|
||||||
|
$logs_printed = '';
|
||||||
|
$o=0;
|
||||||
|
while ($logs_to_print > $o)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
|
||||||
|
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
|
||||||
|
$run_color='color=blue';
|
||||||
|
if ($row[9] > 5) {$run_color='color=black';}
|
||||||
|
if ($row[9] > 10) {$run_color='color=purple';}
|
||||||
|
if ($row[9] > 30) {$run_color='color=red';}
|
||||||
|
|
||||||
|
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=830000000000000&stage=$row[0]\">$row[0]</a></td>";
|
||||||
|
echo "<td><font size=1> $row[1]</td>";
|
||||||
|
echo "<td><font size=1> <a href=\"$PHP_SELF?ADD=810000000000000&stage=$row[2]\">$row[2]</a></td>";
|
||||||
|
echo "<td><font size=1> $row[3]</td>";
|
||||||
|
echo "<td><font size=1> $row[4]</td>";
|
||||||
|
echo "<td><font size=1 $run_color> $row[9]</td>";
|
||||||
|
echo "<td><font size=1> <a href=\"$PHP_SELF?ADD=830000000000000&stage=$row[0]\">GOTO</a></td>";
|
||||||
|
echo "</tr>\n";
|
||||||
|
$logs_printed .= "'$row[0]',";
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
echo "</TABLE><BR><BR>\n";
|
||||||
|
echo "<a href=\"$PHP_SELF?ADD=800000000000000&stage=$next_limit\">NEXT</a>\n";
|
||||||
|
echo "</center>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
######################
|
||||||
|
# ADD=810000000000000 view all activity in the report log made by one user
|
||||||
|
######################
|
||||||
|
|
||||||
|
if ($ADD==810000000000000)
|
||||||
|
{
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
|
$stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$names_to_print = mysql_num_rows($rslt);
|
||||||
|
if ($names_to_print > 0)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$user_name = $row[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt="SELECT report_log_id,event_date,user,ip_address,report_name,browser,referer,notes,url,run_time from vicidial_report_log where user='$stage' order by event_date desc limit 5000;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
|
echo "<br>ADMIN REPORT LOG: Changes made by $stage - $user_name\n";
|
||||||
|
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||||
|
echo "<TR BGCOLOR=BLACK>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DATE TIME</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>USER</B></TD>\n";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>IP</TD>\n";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>REPORT</TD>\n";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RUN TIME</TD>\n";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>GOTO</TD>\n";
|
||||||
|
echo "</TR>\n";
|
||||||
|
|
||||||
|
$logs_printed = '';
|
||||||
|
$o=0;
|
||||||
|
while ($logs_to_print > $o)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
|
||||||
|
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
|
||||||
|
$run_color='color=blue';
|
||||||
|
if ($row[9] > 5) {$run_color='color=black';}
|
||||||
|
if ($row[9] > 10) {$run_color='color=purple';}
|
||||||
|
if ($row[9] > 30) {$run_color='color=red';}
|
||||||
|
|
||||||
|
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=830000000000000&stage=$row[0]\">$row[0]</a></td>";
|
||||||
|
echo "<td><font size=1> $row[1]</td>";
|
||||||
|
echo "<td><font size=1> <a href=\"$PHP_SELF?ADD=810000000000000&stage=$row[2]\">$row[2]</a></td>";
|
||||||
|
echo "<td><font size=1> $row[3]</td>";
|
||||||
|
echo "<td><font size=1> $row[4]</td>";
|
||||||
|
echo "<td><font size=1 $run_color> $row[9]</td>";
|
||||||
|
echo "<td><font size=1> <a href=\"$PHP_SELF?ADD=830000000000000&stage=$row[0]\">GOTO</a></td>";
|
||||||
|
echo "</tr>\n";
|
||||||
|
$logs_printed .= "'$row[0]',";
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
echo "</TABLE><BR><BR>\n";
|
||||||
|
echo "\n";
|
||||||
|
echo "</center>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
######################
|
||||||
|
# ADD=830000000000000 detail view of one report log entry
|
||||||
|
######################
|
||||||
|
|
||||||
|
if ($ADD==830000000000000)
|
||||||
|
{
|
||||||
|
if ($LOGuser_level >= 9)
|
||||||
|
{
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
|
$stmt="SELECT report_log_id,event_date,vrl.user,ip_address,report_name,browser,referer,notes,url,full_name,val.user_group,run_time from vicidial_report_log vrl, vicidial_users val where report_log_id='$stage' and val.user=vrl.user $valLOGadmin_viewable_groupsSQL;";
|
||||||
|
if ($DB > 0) {echo "$stmt\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
|
if ($logs_to_print > 0)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
|
||||||
|
$run_color='color=blue';
|
||||||
|
if ($row[11] > 5) {$run_color='color=black';}
|
||||||
|
if ($row[11] > 10) {$run_color='color=purple';}
|
||||||
|
if ($row[11] > 30) {$run_color='color=red';}
|
||||||
|
|
||||||
|
echo "<br>ADMIN REPORT LOG: Record Detail - $stage<BR><BR>\n";
|
||||||
|
echo "<center><TABLE width=$section_width cellspacing=5 cellpadding=0>\n";
|
||||||
|
echo "<TR>";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>ID: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[0]</TD>";
|
||||||
|
echo "</TR><TR>\n";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>DATE TIME: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[1]</TD>";
|
||||||
|
echo "</TR><TR>\n";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>RUN TIME: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2><font $run_color>$row[11]</font> seconds</TD>";
|
||||||
|
echo "</TR><TR>\n";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>USER: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[2] - $row[9]</TD>";
|
||||||
|
echo "</TR><TR>\n";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>IP: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[3]</TD>";
|
||||||
|
echo "</TR><TR>\n";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>REPORT: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[4]</TD>";
|
||||||
|
echo "</TR><TR>\n";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>BROWSER: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=1>$row[5]</TD>";
|
||||||
|
echo "</TR><TR>\n";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>NOTES: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=1>$row[7]</TD>";
|
||||||
|
echo "</TR><TR>\n";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>REFERER: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT width=700><p style=\"width: 700; text-wrap: normal; word-wrap: break-word\"><FONT FACE=\"Arial,Helvetica\" size=1><a href=\"$row[6]\">$row[6]</a></TD>";
|
||||||
|
echo "</TR><TR>\n";
|
||||||
|
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>URL: </B></TD>";
|
||||||
|
echo "<TD ALIGN=LEFT width=700><p style=\"width: 700; text-wrap: normal; word-wrap: break-word\"><FONT FACE=\"Arial,Helvetica\" size=1><a href=\"$row[8]\">$row[8]</a></TD>";
|
||||||
|
echo "</TR>\n";
|
||||||
|
echo "</TABLE><BR><BR>\n";
|
||||||
|
echo "\n";
|
||||||
|
echo "</center>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo "You do not have permission to view this page\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# ADD=999999 display reports section
|
# ADD=999999 display reports section
|
||||||
######################
|
######################
|
||||||
@@ -35680,6 +35921,7 @@ if ($ADD==999994)
|
|||||||
echo "<LI><a href=\"$PHP_SELF?ADD=999991\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Servers Versions</a></FONT>\n";
|
echo "<LI><a href=\"$PHP_SELF?ADD=999991\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Servers Versions</a></FONT>\n";
|
||||||
echo "<LI><a href=\"AST_carrier_log_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Carrier Log Report</a></FONT>\n";
|
echo "<LI><a href=\"AST_carrier_log_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Carrier Log Report</a></FONT>\n";
|
||||||
echo "<LI><a href=\"AST_hangup_cause_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Hangup Cause Report</a></FONT>\n";
|
echo "<LI><a href=\"AST_hangup_cause_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Hangup Cause Report</a></FONT>\n";
|
||||||
|
echo "<LI><a href=\"admin.php?ADD=800000000000000\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Admin Report Log Viewer</a></FONT>\n";
|
||||||
echo "<LI><a href=\"admin_phones_bulk_insert.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Bulk Phone Insert Page</a></FONT>\n";
|
echo "<LI><a href=\"admin_phones_bulk_insert.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Bulk Phone Insert Page</a></FONT>\n";
|
||||||
echo "<LI><a href=\"lead_tools.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Basic Lead Management Tools</a></FONT>\n";
|
echo "<LI><a href=\"lead_tools.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Basic Lead Management Tools</a></FONT>\n";
|
||||||
echo "<LI><a href=\"callbacks_bulk_change.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Callbacks Transferral Page</a></FONT>\n";
|
echo "<LI><a href=\"callbacks_bulk_change.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Callbacks Transferral Page</a></FONT>\n";
|
||||||
@@ -35891,6 +36133,21 @@ if ($ADD==999992)
|
|||||||
}
|
}
|
||||||
##### END max system stats report #####
|
##### END max system stats report #####
|
||||||
|
|
||||||
|
##### If report run, update the time in the vicidial_report_log table #####
|
||||||
|
if ( ($ADD==999993) or ($ADD==999992) or ($ADD==730000000000000) or ($ADD==830000000000000) )
|
||||||
|
{
|
||||||
|
$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_query($stmt, $link);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# ADD=999991 display server version info
|
# ADD=999991 display server version info
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# and/or vicidial_closer_log information by status, list_id and date range.
|
# and/or vicidial_closer_log information by status, list_id and date range.
|
||||||
# downloads to a flat text file that is tab delimited
|
# downloads to a flat text file that is tab delimited
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -33,8 +33,11 @@
|
|||||||
# 110911-1445 - Added did fields to the EXTENDED format
|
# 110911-1445 - Added did fields to the EXTENDED format
|
||||||
# 111010-1930 - Added ALTERNATE_1 format
|
# 111010-1930 - Added ALTERNATE_1 format
|
||||||
# 111104-1240 - Added user_group restrictions for selecting in-groups
|
# 111104-1240 - Added user_group restrictions for selecting in-groups
|
||||||
|
# 130414-0122 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -79,6 +82,7 @@ if (strlen($shift)<2) {$shift='ALL';}
|
|||||||
|
|
||||||
$report_name = 'Export Calls Report';
|
$report_name = 'Export Calls Report';
|
||||||
$db_source = 'M';
|
$db_source = 'M';
|
||||||
|
$file_exported=0;
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||||
@@ -98,15 +102,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -131,6 +126,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$campaign[0], $query_date, $end_date|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -434,14 +458,6 @@ if ($run_export > 0)
|
|||||||
|
|
||||||
if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) )
|
if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) )
|
||||||
{
|
{
|
||||||
### LOG INSERTION Admin Log Table ###
|
|
||||||
$SQL_log = "$stmt|$stmtA|";
|
|
||||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
|
||||||
$SQL_log = addslashes($SQL_log);
|
|
||||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';";
|
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
|
||||||
$rslt=mysql_query($stmt, $link);
|
|
||||||
|
|
||||||
$TXTfilename = "EXPORT_CALL_REPORT_$FILE_TIME.txt";
|
$TXTfilename = "EXPORT_CALL_REPORT_$FILE_TIME.txt";
|
||||||
|
|
||||||
// We'll be outputting a TXT file
|
// We'll be outputting a TXT file
|
||||||
@@ -768,6 +784,7 @@ if ($run_export > 0)
|
|||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
$file_exported++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1067,6 +1084,37 @@ else
|
|||||||
echo "</FORM>\n\n";
|
echo "</FORM>\n\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
if ($file_exported > 0)
|
||||||
|
{
|
||||||
|
### LOG INSERTION Admin Log Table ###
|
||||||
|
$SQL_log = "$stmt|$stmtA|";
|
||||||
|
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||||
|
$SQL_log = addslashes($SQL_log);
|
||||||
|
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
# callbacks_bulk_change.php
|
# callbacks_bulk_change.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 120819-0119 - First build
|
# 120819-0119 - First build
|
||||||
|
# 130414-0021 - Added admin logging
|
||||||
#
|
#
|
||||||
|
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
@@ -146,9 +147,17 @@ while ($i < $groups_to_print)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($SUBMIT && $old_user && $new_user && $confirm_transfer) {
|
if ($SUBMIT && $old_user && $new_user && $confirm_transfer) {
|
||||||
$upd_stmt="update vicidial_callbacks set user='$new_user' where recipient='USERONLY' and status!='INACTIVE' and user='$old_user' $LOGadmin_viewable_groupsSQL";
|
$upd_stmt="UPDATE vicidial_callbacks set user='$new_user' where recipient='USERONLY' and status!='INACTIVE' and user='$old_user' $LOGadmin_viewable_groupsSQL";
|
||||||
$upd_rslt=mysql_query($upd_stmt, $link);
|
$upd_rslt=mysql_query($upd_stmt, $link);
|
||||||
if ($DB) {echo "$upd_stmt\n";}
|
if ($DB) {echo "$upd_stmt\n";}
|
||||||
|
|
||||||
|
### LOG INSERTION Admin Log Table ###
|
||||||
|
$SQL_log = "$upd_stmt|";
|
||||||
|
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||||
|
$SQL_log = addslashes($SQL_log);
|
||||||
|
$stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$new_user', event_code='ADMIN CALLBACK BULK CHANGE', event_sql=\"$SQL_log\", event_notes='Old user: $old_user';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
# campaign_debug.php
|
# campaign_debug.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 110514-1231 - First build
|
# 110514-1231 - First build
|
||||||
|
# 130413-2342 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='Campaign Debug';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -38,6 +43,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$NOW_DATE = date("Y-m-d");
|
$NOW_DATE = date("Y-m-d");
|
||||||
$NOW_TIME = date("Y-m-d H:i:s");
|
$NOW_TIME = date("Y-m-d H:i:s");
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
@@ -181,6 +215,24 @@ else
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# fcstats.php
|
# fcstats.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -21,8 +21,11 @@
|
|||||||
# 111104-1213 - Added user_group restrictions for selecting in-groups
|
# 111104-1213 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
# 120705-2007 - Changed SALES to use sales status flag
|
# 120705-2007 - Changed SALES to use sales status flag
|
||||||
|
# 130414-0126 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -73,15 +76,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$HTML_text.="|$stmt|\n";}
|
if ($DB) {$HTML_text.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -102,6 +96,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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, $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$HTML_text.="|$stmt|\n";}
|
if ($DB) {$HTML_text.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -907,10 +930,8 @@ if ($file_download > 0)
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$JS_onload.="}\n";
|
$JS_onload.="}\n";
|
||||||
$JS_text.=$JS_onload;
|
$JS_text.=$JS_onload;
|
||||||
@@ -930,10 +951,28 @@ if ($file_download > 0)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# group_hourly_stats.php
|
# group_hourly_stats.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -11,8 +11,13 @@
|
|||||||
# 90508-0644 - Changed to PHP long tags
|
# 90508-0644 - Changed to PHP long tags
|
||||||
# 120221-0159 - Added User Group restrictions
|
# 120221-0159 - Added User Group restrictions
|
||||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||||
|
# 130414-0224 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='User Group Hourly Stats';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -66,6 +71,26 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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, $status|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
$TODAY = date("Y-m-d");
|
$TODAY = date("Y-m-d");
|
||||||
$date_with_hour_default = date("Y-m-d H");
|
$date_with_hour_default = date("Y-m-d H");
|
||||||
@@ -269,7 +294,7 @@ echo "</TABLE></center>\n";
|
|||||||
echo "<br><br>\n";
|
echo "<br><br>\n";
|
||||||
|
|
||||||
|
|
||||||
echo "<br>Please enter the group you want to get hourly stats for: <form action=$PHP_SELF method=POST>\n";
|
echo "<br>Please enter the group you want to get hourly stats for: <form action=$PHP_SELF method=GET>\n";
|
||||||
echo "<input type=hidden name=DB value=$DB>\n";
|
echo "<input type=hidden name=DB value=$DB>\n";
|
||||||
echo "group: <select size=1 name=group>\n";
|
echo "group: <select size=1 name=group>\n";
|
||||||
|
|
||||||
@@ -312,7 +337,26 @@ echo "<font size=0>\n\n\n<br><br><br>\nscript runtime: $RUNtime seconds</font>";
|
|||||||
</html>
|
</html>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -5,14 +5,17 @@
|
|||||||
# vicidial_log and/or vicidial_closer_log information by status, list_id and
|
# vicidial_log and/or vicidial_closer_log information by status, list_id and
|
||||||
# date range. downloads to a flat text file that is tab delimited
|
# date range. downloads to a flat text file that is tab delimited
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
# 110624-0834 - First build, based upon calls_report_export.php
|
# 110624-0834 - First build, based upon calls_report_export.php
|
||||||
# 111104-1245 - Added user_group restrictions for selecting in-groups
|
# 111104-1245 - Added user_group restrictions for selecting in-groups
|
||||||
|
# 130414-0135 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -55,6 +58,7 @@ if (strlen($shift)<2) {$shift='ALL';}
|
|||||||
|
|
||||||
$report_name = 'Export Leads Report';
|
$report_name = 'Export Leads Report';
|
||||||
$db_source = 'M';
|
$db_source = 'M';
|
||||||
|
$file_exported=0;
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||||
@@ -74,15 +78,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -107,6 +102,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$campaign[0], $query_date, $end_date|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -387,14 +411,6 @@ if ($run_export > 0)
|
|||||||
|
|
||||||
if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) )
|
if ( ($outbound_to_print > 0) or ($inbound_to_print > 0) )
|
||||||
{
|
{
|
||||||
### LOG INSERTION Admin Log Table ###
|
|
||||||
$SQL_log = "$stmt|$stmtA|";
|
|
||||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
|
||||||
$SQL_log = addslashes($SQL_log);
|
|
||||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';";
|
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
|
||||||
$rslt=mysql_query($stmt, $link);
|
|
||||||
|
|
||||||
$TXTfilename = "EXPORT_LEAD_REPORT_$FILE_TIME.txt";
|
$TXTfilename = "EXPORT_LEAD_REPORT_$FILE_TIME.txt";
|
||||||
|
|
||||||
// We'll be outputting a TXT file
|
// We'll be outputting a TXT file
|
||||||
@@ -650,6 +666,7 @@ if ($run_export > 0)
|
|||||||
}
|
}
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
|
$file_exported++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -939,6 +956,37 @@ else
|
|||||||
echo "</FORM>\n\n";
|
echo "</FORM>\n\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
if ($file_exported > 0)
|
||||||
|
{
|
||||||
|
### LOG INSERTION Admin Log Table ###
|
||||||
|
$SQL_log = "$stmt|$stmtA|";
|
||||||
|
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||||
|
$SQL_log = addslashes($SQL_log);
|
||||||
|
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
# downloads the entire contents of a vicidial list ID to a flat text file
|
# downloads the entire contents of a vicidial list ID to a flat text file
|
||||||
# that is tab delimited
|
# that is tab delimited
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -22,8 +22,11 @@
|
|||||||
# 101004-2108 - Added generic custom column headers for custom fields
|
# 101004-2108 - Added generic custom column headers for custom fields
|
||||||
# 120713-2110 - Added extended_vl_fields option
|
# 120713-2110 - Added extended_vl_fields option
|
||||||
# 120907-1217 - Raised extended fields up to 99
|
# 120907-1217 - Raised extended fields up to 99
|
||||||
|
# 130414-0228 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -66,15 +69,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -93,6 +87,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$list_id, $group_id, $download_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
# echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -497,14 +520,6 @@ if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
### LOG INSERTION Admin Log Table ###
|
|
||||||
$SQL_log = "$stmt|$stmtA|";
|
|
||||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
|
||||||
$SQL_log = addslashes($SQL_log);
|
|
||||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';";
|
|
||||||
if ($DB) {echo "|$stmt|\n";}
|
|
||||||
$rslt=mysql_query($stmt, $link);
|
|
||||||
|
|
||||||
|
|
||||||
echo "$header_row$header_columns\r\n";
|
echo "$header_row$header_columns\r\n";
|
||||||
|
|
||||||
@@ -516,6 +531,33 @@ while ($i < $leads_to_print)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
### LOG INSERTION Admin Log Table ###
|
||||||
|
$SQL_log = "$stmt|$stmtA|";
|
||||||
|
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||||
|
$SQL_log = addslashes($SQL_log);
|
||||||
|
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -73,10 +73,11 @@
|
|||||||
# 121125-2210 - Added Other Campaign DNC option and list expiration date option
|
# 121125-2210 - Added Other Campaign DNC option and list expiration date option
|
||||||
# 130328-0949 - Added update_phone_number option to update_lead function, issue #653
|
# 130328-0949 - Added update_phone_number option to update_lead function, issue #653
|
||||||
# 130405-1539 - Added agent_status function
|
# 130405-1539 - Added agent_status function
|
||||||
|
# 130414-0311 - Added report logging for blind_monitor function
|
||||||
#
|
#
|
||||||
|
|
||||||
$version = '2.6-51';
|
$version = '2.6-52';
|
||||||
$build = '130405-1539';
|
$build = '130414-0311';
|
||||||
$api_url_log = 0;
|
$api_url_log = 0;
|
||||||
|
|
||||||
$startMS = microtime();
|
$startMS = microtime();
|
||||||
@@ -1486,6 +1487,18 @@ if ($function == 'blind_monitor')
|
|||||||
$stmt = "INSERT INTO vicidial_dial_log SET caller_code='$BMquery',lead_id='0',server_ip='$monitor_server_ip',call_date='$NOW_TIME',extension='$dialplan_number',channel='Local/$monitor_dialstring$stage$session_id@default',timeout='0',outbound_cid='\"VC Blind Monitor\" <$outbound_cid>',context='default';";
|
$stmt = "INSERT INTO vicidial_dial_log SET caller_code='$BMquery',lead_id='0',server_ip='$monitor_server_ip',call_date='$NOW_TIME',extension='$dialplan_number',channel='Local/$monitor_dialstring$stage$session_id@default',timeout='0',outbound_cid='\"VC Blind Monitor\" <$outbound_cid>',context='default';";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
|
##### BEGIN log visit to the vicidial_report_log table #####
|
||||||
|
$endMS = microtime();
|
||||||
|
$startMSary = explode(" ",$startMS);
|
||||||
|
$endMSary = explode(" ",$endMS);
|
||||||
|
$runS = ($endMSary[0] - $startMSary[0]);
|
||||||
|
$runM = ($endMSary[1] - $startMSary[1]);
|
||||||
|
$TOTALrun = ($runS + $runM);
|
||||||
|
$stmt="INSERT INTO vicidial_report_log set event_date=NOW(), user='$user', ip_address='1.1.1.1', report_name='API Blind Monitor', browser='API', referer='realtime_report.php', notes='$user, $monitor_server_ip, $dialplan_number, $session_id, $phone_login', url='REALTIME BLIND MONITOR',run_time='$TOTALrun';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
$result = 'SUCCESS';
|
$result = 'SUCCESS';
|
||||||
$result_reason = "blind_monitor HAS BEEN LAUNCHED";
|
$result_reason = "blind_monitor HAS BEEN LAUNCHED";
|
||||||
echo "$result: $result_reason - $phone_login|$monitor_dialstring$stage$session_id|$dialplan_number|$session_id|$man_id|$user\n";
|
echo "$result: $result_reason - $phone_login|$monitor_dialstring$stage$session_id|$dialplan_number|$session_id|$man_id|$user\n";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# realtime_report.php
|
# realtime_report.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# live real-time stats for the VICIDIAL Auto-Dialer all servers
|
# live real-time stats for the VICIDIAL Auto-Dialer all servers
|
||||||
#
|
#
|
||||||
@@ -21,10 +21,13 @@
|
|||||||
# 110526-1807 - Added webphone_auto_answer option
|
# 110526-1807 - Added webphone_auto_answer option
|
||||||
# 120223-1917 - Added multi-user-group options
|
# 120223-1917 - Added multi-user-group options
|
||||||
# 121129-2131 - Fixed Choose link position
|
# 121129-2131 - Fixed Choose link position
|
||||||
|
# 130414-0247 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
$version = '2.6-10';
|
$startMS = microtime();
|
||||||
$build = '121129-2131';
|
|
||||||
|
$version = '2.6-11';
|
||||||
|
$build = '130414-0247';
|
||||||
|
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
@@ -113,15 +116,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$webphone_width = '460';
|
$webphone_width = '460';
|
||||||
$webphone_height = '500';
|
$webphone_height = '500';
|
||||||
$webphone_left = '600';
|
$webphone_left = '600';
|
||||||
@@ -270,6 +264,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$groups[0]|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
if ($auth)
|
if ($auth)
|
||||||
{
|
{
|
||||||
$office_no=strtoupper($PHP_AUTH_USER);
|
$office_no=strtoupper($PHP_AUTH_USER);
|
||||||
@@ -1518,6 +1541,24 @@ echo "<span id=realtime_content name=realtime_content></span>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -3,12 +3,13 @@
|
|||||||
#
|
#
|
||||||
# Send calls with custom callerID numbers from web form
|
# Send calls with custom callerID numbers from web form
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
# 90714-1355 - First Build
|
# 90714-1355 - First Build
|
||||||
# 120831-1527 - Added vicidial_dial_log logging
|
# 120831-1527 - Added vicidial_dial_log logging
|
||||||
|
# 130414-0039 - Added admin logging
|
||||||
#
|
#
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -56,6 +57,7 @@ $auth=$row[0];
|
|||||||
$NOW_DATE = date("Y-m-d");
|
$NOW_DATE = date("Y-m-d");
|
||||||
$NOW_TIME = date("Y-m-d H:i:s");
|
$NOW_TIME = date("Y-m-d H:i:s");
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
|
$ip = getenv("REMOTE_ADDR");
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -127,6 +129,13 @@ else
|
|||||||
$stmt = "INSERT INTO vicidial_dial_log SET caller_code='TESTCIDCALL098765432',lead_id='0',server_ip='$server_ip',call_date='$NOW_TIME',extension='91$receiver',channel='Local/91$sender$Local_end',timeout='$Local_dial_timeout',outbound_cid='\"$cid_number\" <$cid_number>',context='default';";
|
$stmt = "INSERT INTO vicidial_dial_log SET caller_code='TESTCIDCALL098765432',lead_id='0',server_ip='$server_ip',call_date='$NOW_TIME',extension='91$receiver',channel='Local/91$sender$Local_end',timeout='$Local_dial_timeout',outbound_cid='\"$cid_number\" <$cid_number>',context='default';";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
|
### LOG INSERTION Admin Log Table ###
|
||||||
|
$SQL_log = "$stmt|";
|
||||||
|
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||||
|
$SQL_log = addslashes($SQL_log);
|
||||||
|
$stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='CIDSEND', event_type='OTHER', record_id='$PHP_AUTH_USER', event_code='ADMIN SEND CID CALL', event_sql=\"$SQL_log\", event_notes='Server: $server_ip';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
echo "<B>Call sent from $sender to $receiver using CIDnumber: $cid_number</B>";
|
echo "<B>Call sent from $sender to $receiver using CIDnumber: $cid_number</B>";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
# sph_report.php
|
# sph_report.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
# 80502-0857 - First build
|
# 80502-0857 - First build
|
||||||
# 80506-0228 - Added user field to search by
|
# 80506-0228 - Added user field to search by
|
||||||
# 90508-0644 - Changed to PHP long tags
|
# 90508-0644 - Changed to PHP long tags
|
||||||
|
# 130414-0235 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='SPH Report';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
##### Pull values from posted form variables #####
|
##### Pull values from posted form variables #####
|
||||||
@@ -79,6 +84,26 @@ $auth=$row[0];
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$campaign, $query_date, $end_date|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
$NOW_DATE = date("Y-m-d");
|
$NOW_DATE = date("Y-m-d");
|
||||||
$NOW_TIME = date("Y-m-d H:i:s");
|
$NOW_TIME = date("Y-m-d H:i:s");
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
@@ -560,6 +585,27 @@ echo "</TABLE>\n";
|
|||||||
|
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# timeclock_report.php
|
# timeclock_report.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -18,8 +18,11 @@
|
|||||||
# 110703-1830 - Added download option
|
# 110703-1830 - Added download option
|
||||||
# 111104-1314 - Added user_group restrictions for selecting in-groups
|
# 111104-1314 - Added user_group restrictions for selecting in-groups
|
||||||
# 120224-0910 - Added HTML display option with bar graphs
|
# 120224-0910 - Added HTML display option with bar graphs
|
||||||
|
# 130414-0150 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
##### Pull values from posted form variables #####
|
##### Pull values from posted form variables #####
|
||||||
@@ -73,15 +76,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -106,6 +100,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$user_group[0], $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -530,13 +553,31 @@ $MAIN.="</BODY></HTML>\n";
|
|||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
echo $HEADER;
|
echo $HEADER;
|
||||||
require("admin_header.php");
|
require("admin_header.php");
|
||||||
echo $MAIN;
|
echo $MAIN;
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# timeclock_status.php
|
# timeclock_status.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -15,10 +15,13 @@
|
|||||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||||
# 110703-1833 - Added download option
|
# 110703-1833 - Added download option
|
||||||
# 111104-1315 - Added user_group restrictions for selecting in-groups
|
# 111104-1315 - Added user_group restrictions for selecting in-groups
|
||||||
|
# 130414-0152 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
#header ("Content-type: text/html; charset=utf-8");
|
#header ("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -64,15 +67,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||||
|
|
||||||
@@ -113,6 +107,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$user_group, $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -233,6 +256,26 @@ if (strlen($user_group) < 1)
|
|||||||
echo "$HEADER";
|
echo "$HEADER";
|
||||||
require("admin_header.php");
|
require("admin_header.php");
|
||||||
echo "$MAIN";
|
echo "$MAIN";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -467,10 +510,8 @@ if ($file_download > 0)
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
echo "$HEADER";
|
echo "$HEADER";
|
||||||
@@ -478,6 +519,24 @@ if ($file_download > 0)
|
|||||||
echo "$MAIN";
|
echo "$MAIN";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -598,7 +657,25 @@ $MAIN.="</TD></TR><TABLE>\n";
|
|||||||
$MAIN.="</body>\n";
|
$MAIN.="</body>\n";
|
||||||
$MAIN.="</html>\n";
|
$MAIN.="</html>\n";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,10 @@
|
|||||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||||
# 121222-2152 - Added email log display
|
# 121222-2152 - Added email log display
|
||||||
# 130124-1740 - Added option to display first and last name of lead
|
# 130124-1740 - Added option to display first and last name of lead
|
||||||
|
# 130414-0146 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
require("functions.php");
|
require("functions.php");
|
||||||
@@ -72,15 +74,6 @@ if ($qm_conf_ct > 0)
|
|||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
|
||||||
{
|
|
||||||
mysql_close($link);
|
|
||||||
$use_slave_server=1;
|
|
||||||
$db_source = 'S';
|
|
||||||
require("dbconnect.php");
|
|
||||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||||
@@ -139,6 +132,35 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
exit;
|
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";
|
||||||
|
|
||||||
|
$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 |$user, $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_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)) )
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect.php");
|
||||||
|
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
$stmt="SELECT full_name,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
@@ -1292,8 +1314,6 @@ if ($file_download>0)
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
echo "$CSV_text";
|
echo "$CSV_text";
|
||||||
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1301,9 +1321,29 @@ else
|
|||||||
echo $HEADER;
|
echo $HEADER;
|
||||||
require("admin_header.php");
|
require("admin_header.php");
|
||||||
echo $MAIN;
|
echo $MAIN;
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# user_status.php
|
# user_status.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -20,10 +20,15 @@
|
|||||||
# 110224-2350 - Small QM logout fix
|
# 110224-2350 - Small QM logout fix
|
||||||
# 110420-0344 - Added DEAD/PARK agent statuses
|
# 110420-0344 - Added DEAD/PARK agent statuses
|
||||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||||
|
# 130414-0252 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
|
$report_name='User Status';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -95,6 +100,26 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
##### 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";
|
||||||
|
|
||||||
|
$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 |$user, $stage, $group|', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
if($auth>0)
|
if($auth>0)
|
||||||
{
|
{
|
||||||
$stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
$stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||||
@@ -486,7 +511,26 @@ if ($stage == "log_agent_out")
|
|||||||
{
|
{
|
||||||
echo "Agent $user is not logged in<BR>\n";
|
echo "Agent $user is not logged in<BR>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -652,6 +696,25 @@ if ( ( ($stage == "tc_log_user_OUT") or ($stage == "tc_log_user_IN") ) and ($mod
|
|||||||
|
|
||||||
echo "$VDdisplayMESSAGE\n";
|
echo "$VDdisplayMESSAGE\n";
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -768,6 +831,26 @@ echo "|$stage|$group|";
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# This script is designed to broadcast a recorded message or allow a person to
|
# This script is designed to broadcast a recorded message or allow a person to
|
||||||
# speak to all agents logged into a VICIDIAL campaign.
|
# speak to all agents logged into a VICIDIAL campaign.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
@@ -13,8 +13,13 @@
|
|||||||
# 70115-1246 - Added ability to define an exten to play
|
# 70115-1246 - Added ability to define an exten to play
|
||||||
# 90508-0644 - Changed to PHP long tags
|
# 90508-0644 - Changed to PHP long tags
|
||||||
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
|
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
|
||||||
|
# 130414-0045 - Added report logging
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
$report_name='Voice Lab';
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
|
|
||||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
@@ -52,24 +57,24 @@ $local_DEF = 'Local/';
|
|||||||
$local_AMP = '@';
|
$local_AMP = '@';
|
||||||
$ext_context = 'demo';
|
$ext_context = 'demo';
|
||||||
|
|
||||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;";
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$auth=$row[0];
|
$auth=$row[0];
|
||||||
|
|
||||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||||
$date = date("r");
|
$date = date("r");
|
||||||
$ip = getenv("REMOTE_ADDR");
|
$ip = getenv("REMOTE_ADDR");
|
||||||
$browser = getenv("HTTP_USER_AGENT");
|
$browser = getenv("HTTP_USER_AGENT");
|
||||||
|
|
||||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||||
{
|
{
|
||||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||||
Header("HTTP/1.0 401 Unauthorized");
|
Header("HTTP/1.0 401 Unauthorized");
|
||||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($auth>0)
|
if($auth>0)
|
||||||
{
|
{
|
||||||
@@ -94,6 +99,26 @@ $browser = getenv("HTTP_USER_AGENT");
|
|||||||
$full_name = $row[0];
|
$full_name = $row[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##### 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";
|
||||||
|
|
||||||
|
$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', url='$LOGfull_url';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$report_log_id = mysql_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
|
|
||||||
##### get server listing for dynamic pulldown
|
##### get server listing for dynamic pulldown
|
||||||
$stmt="SELECT server_ip,server_description from servers order by server_ip";
|
$stmt="SELECT server_ip,server_description from servers order by server_ip";
|
||||||
@@ -307,6 +332,25 @@ if ($KILL_VOICE_LAB > 1)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysql_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect.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_query($stmt, $link);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</BODY></HTML>
|
</BODY></HTML>
|
||||||
Reference in New Issue
Block a user