Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/statistiques/GeneralStatistiques_html.php
<?php

echo "<form  action=\"phpmyprepaid.php\" method=\"post\">";
echo "<span style=\"font-weight: bold; font-family: Arial;\"></span>
	<hr><small>";
$resultloc = getLocationName($oreon->user);
echo '<table><tr><td>Choose your Locations : </td><td>';
echo("<input type=\"hidden\" name=\"buttonID\" value=\"general_stat\">");
echo ('<select name="lsid" onchange="this.form.submit()">');
$loctmp=$loc;
if ($oreon->user->get_status()=='3') {
	if ($_GET['lsid']=="All")
	{
		echo ("<option  selected value=\"All\">All");
		$loctmp="-1";
	}
	else
	echo ("<option  value=\"All\">All");

}
while ($row = $oreon->database->database->fetch_object($resultloc)) {
      if($loctmp==$row->ID )
	      echo ("<option selected=\"selected\" value=\"".$row->LocationName."\">".$row->LocationName);
      else
	      echo ("<option  value=\"".$row->LocationName."\">".$row->LocationName);
}
echo "</td></tr></table></select><br>";

echo '<table width=700 cellpadding="2" cellspacing="5"><tr>';
echo('<td><small>Plot : </small></td><td>');
echo ('<select name="plot_graphic" id="plot_graphic" onChange=\'this.form.submit()\' >');
if ($plot_graphic=="bars") echo ("<option selected value=\"bars\">Bars</option>");
else  echo ("<option value=\"bars\">Bars</option>");
if ($plot_graphic=="lines") echo ("<option selected value=\"lines\">Lines</option>");
else echo ("<option value=\"lines\">Lines</option>");
if ($plot_graphic=="linepoint") echo ("<option selected value=\"linepoint\">Lines point</option>");
else echo ("<option value=\"linepoint\">Lines point</option>");
if ($plot_graphic=="area") echo ("<option selected value=\"area\">Area</option>");
else echo ("<option value=\"area\">Area</option>");
if ($plot_graphic=="points") echo ("<option selected value=\"points\">Points</option>");
else echo ("<option value=\"points\">Points</option>");
if ($plot_graphic=="pie") echo ("<option selected value=\"pie\">Pie</option>"); 
else echo ("<option value=\"pie\">Pie</option>");
if ($plot_graphic=="thinbarline") echo ("<option selected value=\"thinbarline\">Thinbarline</option>");
else echo ("<option value=\"thinbarline\">Thinbarline</option>");
if ($plot_graphic=="squared") echo ("<option selected value=\"squared\">Squared</option>");
else echo ("<option value=\"squared\">Squared</option>");
if ($plot_graphic=="stackedbars") echo ("<option selected value=\"stackedbars\">Stacked bars</option>");
else echo ("<option value=\"stackedbars\">Stacked bars</option>");
echo '</select></td>';
echo('<td ><small>View by : </small></td><td>');
echo ('<select id="basetime"  name="basetime" onChange=\'this.form.submit()\'>');
if ($basetime=="Hours")
	echo ("<option selected value=\"Hours\">Hours</option>");
else
	echo ("<option value=\"Hours\">Hours</option>");

if ($basetime=="Week")
	echo ("<option selected value=\"Week\">Week</option>");
else
	echo ("<option value=\"Week\">Week</option>");

if ($basetime=="Months")
	echo ("<option selected value=\"Months\">Months</option>");
else
	echo ("<option value=\"Months\">Months</option>");

if ($basetime=="Year")
	echo ("<option selected value=\"Year\">Year</option>");
else
	echo ("<option  value=\"Year\">Year</option>");

if ($basetime=="Years")
	echo ("<option selected value=\"Years\">Years</option>");
else
	echo ("<option value=\"Years\">Years</option>");
echo '</select>';
echo('</td></tr><tr>');	
  echo ('<td >');
  echo '<small>Choose Billing plan :';
  echo ('</td>');
  echo ('<td>');
 
  echo '<select name="billing_plan_select" onChange="this.form.submit();">';
  $q1 = "select Id,NameBp,TimeBp,PriceBp,TypeBp,CurrencyBp From BillingPlan WHERE LocationID='".$_SESSION['locID']."' ORDER BY NameBp"; // get all the timed cards
  $result=$oreon->database->database->query($q1);
  if ($bpname=='' or $bpname=='All')  echo '<option "selected" value="All">All';
  else
	  echo '<option  value="All">All';
  echo '</option>'; 

  while ($row = $oreon->database->database->fetch_object($result)) {
	  if ($row->NameBp==$bpname) 
		  echo '<option "selected" value="'.$row->NameBp.'">'.$row->NameBp; 
	  else
	          echo '<option value="'.$row->NameBp.'">'.$row->NameBp; 
	 echo '</option>'; 
  }
  echo ('</select>');
  echo ('</td>');
  echo ('<td >');
  echo '<small> Choose Type :';
  echo ('</td><td>');
  $result2=$oreon->database->database->query("SELECT Type From userinfo $locstrwa GROUP BY Type");
  echo '<select name="type_select" onChange="this.form.submit();">';
  if ($type=='' or $type=='All')  echo '<option "selected" value="All">All</option>';
  else
echo	  '<option  value="All">All</option>';
  while ($row = $oreon->database->database->fetch_object($result2)) {
	  if ($row->Type==$type) 
		  echo '<option "selected" value="'.$row->Type.'">'.$row->Type.'</option>'; 
	  else
		  echo '<option value="'.$row->Type.'">'.$row->Type.'</option>';
  }
  echo ('</select>');
			
  echo ('</td >');

  echo ('</tr><tr><td ><small>');
  echo ' Choose Creation date :';
  echo ('</small></td><td>');
  $result2=$oreon->database->database->query("SELECT CrDate From userinfo Where LocationID='".$_SESSION['locID']."' GROUP BY CrDate ORDER BY CrDate");
  echo '<select name="crdate_select" onChange="this.form.submit();">';
  if ($crdate=='' or $crdate=='All')  echo '<option "selected" value="All">All</option>';
  else
echo	  '<option  value="All">All</option>';
  while ($row = $oreon->database->database->fetch_object($result2)) {
	  if ($row->CrDate==$crdate) 
		  echo '<option "selected" value="'.$row->CrDate.'">'.$row->CrDate.'</option>'; 
	  else
		  echo '<option value="'.$row->CrDate.'">'.$row->CrDate.'</option>';
  }
  echo ('</select>');
			
  echo ('</tr><tr><td ><small>');
  echo ' Nas ip address :';
  echo ('</small></td><td>');
  $result2=$oreon->database->database->query("SELECT NASIPAddress From radacct GROUP BY NASIPAddress");
  echo '<select name="nasip_select" onChange="this.form.submit();">';
  if ($nasip=='' or $nasip=='All')  echo '<option "selected" value="All">All</option>';
  else
echo	  '<option  value="All">All</option>';
  while ($row = $oreon->database->database->fetch_object($result2)) {
	  if ($row->NASIPAddress==$nasip) 
		  echo '<option "selected" value="'.$row->NASIPAddress.'">'.$row->NASIPAddress.'</option>'; 
	  else
		  echo '<option value="'.$row->NASIPAddress.'">'.$row->NASIPAddress.'</option>';
  }
  echo ('</select>');
  echo ('</td >');
  echo ('</tr><tr><td ><small>');
  echo ' Nas port Type :';
  echo ('</small></td><td>');
  $result2=$oreon->database->database->query("SELECT NASPortType From radacct GROUP BY NASPortType");
  echo '<select name="naspt_select" onChange="this.form.submit();">';
  if ($naspt=='' or $naspt=='All')  echo '<option "selected" value="All">All</option>';
  else
echo	  '<option  value="All">All</option>';
  while ($row = $oreon->database->database->fetch_object($result2)) {
	  if ($row->NASPortType==$naspt) 
		  echo '<option "selected" value="'.$row->NASPortType.'">'.$row->NASPortType.'</option>'; 
	  else
		  echo '<option value="'.$row->NASPortType.'">'.$row->NASPortType.'</option>';
  }
  echo ('</select>');
  echo ('</td >');
  echo ('</tr><tr><td ><small>');
  echo ' Realm :';
  echo ('</small></td><td>');
  $result2=$oreon->database->database->query("SELECT Realm From radacct GROUP BY Realm");
  echo '<select name="realm_select" onChange="this.form.submit();">';
  if ($realm=='' or $realm=='All')  echo '<option "selected" value="All">All</option>';
  else
echo	  '<option  value="All">All</option>';
  while ($row = $oreon->database->database->fetch_object($result2)) {
	  if ($row->Realm==$realm) 
		  echo '<option "selected" value="'.$row->Realm.'">'.$row->Realm.'</option>'; 
	  else
		  echo '<option value="'.$row->Realm.'">'.$row->Realm.'</option>';
  }
  echo ('</select>');
  echo ('</td >');


echo ('</tr></table></form>');

echo "<hr>
	<br>";
echo '<table><tr><td>By time for this '.$basetime;
echo '<img src="include/statistiques/GenerateStat.php?title='.htmlspecialchars("Stat for users based on time").'&&width=680&&height=250&&plot_type='.$plot_graphic.'&&typegr=Time&&basetime='.$basetime.'&&crdate='.$crdate.'&&naspt='.$naspt.'&&nasip='.$nasip.'&&realm='.$realm.'&&type='.$type.'&&bpname='.$bpname.'" alt="User statistiques">';
echo "</td></tr><tr>";
echo '<td>By octet for this '.$basetime ;
echo '<img src="include/statistiques/GenerateStat.php?title='.htmlspecialchars("Stat for users based on time").'&&width=680&&height=250&&plot_type='.$plot_graphic.'&&typegr=Octet&&basetime='.$basetime.'&&crdate='.$crdate.'&&naspt='.$naspt.'&&nasip='.$nasip.'&&realm='.$realm.'&&type='.$type.'&&bpname='.$bpname.'" alt="User statistiques">';

echo '</tr></td></table>';
?>

Return current item: phpMyPrepaid