| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/usagrantapplications.org/vsa/ |
Upload File : |
<?php
/*
Copyright (c) 2007-present InnAnTech Industries
Author: Dave Guindon
Web: www.VirtualSmartAgent.com
Support: www.DaveGuindonSupport.com
Please send bug reports, suggestions and/or feedback to the support
website given above.
Virtual Smart Agent is a commercial software. Any distribution is strictly prohibited
unless a resale rights license was delivered along with this software.
*/
include('modfiles/db.php');
include('globals.php');
include('charts/charts.php');
include('charts/chartfunctions.php');
include('charts/tables.php');
include('charts/html_table.class.php');
//get posted data
$type = $_GET['type'];
$cid = $_GET['cid'];
$sd = $_GET['sd'];
$ed = $_GET['ed'];
//build date string for unqiue filename
$dt = date('d_m_y__H_i_s');
//connect to database here
$conn = mysql_connect("$dbhost", "$dblogin", "$dbpass") or die ('I cannot connect to the database.');
mysql_select_db($dbname, $conn);
$data = doReportsTable($cid,$sd,$ed,1);
$dout = '';
foreach($data as $value){
$dout .= $value;
}
$fname = 'stats_'.$dt.'.'.$type; //filename
DownloadFile($fname, $dout, $type); //tell browser to download file
/*==================================================================*/
function DownloadFile($fname, $dout, $ctype){
header ('Cache-Control: must-revalidate, post-check=0, pre-check=0');
if ($ctype == 'csv'){
//header ("Content-type: application/x-msdownload"); //maybe try this one if other type doesn't work?
header ("Content-type: application/vnd.ms-excel");
}else{
header ('Content-Type: application/octet-stream');
}
header ("Content-Disposition: attachment; filename=\"$fname\"");
header ('Pragma: no-cache');
header ('Expires: 0');
echo $dout;
return true;
}
/*==================================================================*/
?>