Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/reports/UsefulReports.php
<?php
if  (isset($_GET['lsid'])) 
{
	$loc=getLocationID($_GET['lsid']);
	$LocName=$_GET['lsid'];
}
else {
	$loc=$_SESSION['locID'];
	$LocName = $_SESSION['LocName'];
}
$LocName = $_SESSION['LocName'];

if (isset($_GET['lsid']) AND ($_GET['lsid']!="All"))
	{
		$locstr=" AND LocationID='$loc'";
		$locstrwa=" WHERE LocationID='$loc'";
	}
	else 
		$locstr="";
$LocName = $_SESSION['LocName'];
if(!isset($buttonID)) {
	$msg= "$msg <p class=\"error\">No button ID was sent</p>"; // this shouldn't happen
	}
	
echo "<body>";


$y=date('Y');
$m=date('m');



if ($fromdate=='')  {
	 $after=$y."-".$m."-01 00:00:00";
	$startf=date($dateFormat,strtotime($after));
	}
	 else
	{ 
	 $after=date_to_attribute($fromdate,"mysql");
	$startf=$fromdate;
	}
	if ($todate=='') 
	{
	$before=date("Y-m-d")." 23:59:59";
	 $stopf=date($dateFormat,strtotime($before));
	}
else
	{
	 $before=date_to_attribute($todate,"mysql");
	$stopf=$todate; 
	} 


//$date = strftime('%A, %e %B %Y, %T %Z');
//$now = date("Y")."/".date("m")."/00";

//if ($before == '') $before = date($sql_date_format, $now);
//$after = ($after != '') ? "$after" : date($sql_date_format, $now );

$search="SELECT Id,NameBp From BillingPlan $locstrwa";
$search2="SELECT Type From userinfo $locstrwa GROUP BY Type ";

$result = $oreon->database->database->query($search) or die("Query database error !");
$result2 = $oreon->database->database->query($search2) or die("Query database error !");	

require('UsefulReports_html.php');
?>
Return current item: phpMyPrepaid