Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/divers/db_mgt_script.php
<?php
include_once('../../config.inc.php');
if (!isset($_SESSION['oreon'])) Session::Start();
$oreon=$_SESSION['oreon'];
$dbmgt=$_GET["dbmgt"];

if ($dbmgt=='dallacct') {
  $query="select UserName from  userinfo where LocationID='".$_SESSION['locID']."'";
  $result=$_SESSION["oreon"]->database->database->query($query);
  while ($row = $oreon->database->database->fetch_object($result)) {
	  $array[] = $row;
	  $uname = ($row->UserName);
	  delete_user($uname);
  }
  echo "Successull delete all user for the current location !";
}

if($dbmgt=='dal') {
	$result = getLocationNameHeader($oreon->user);
	while ($row= $oreon->database->database->fetch_object($result)) {
		$array[] = $row;
		$id = ($row->ID);
		$loc = ($row->LocationName);
		del_loc($loc);
	}
	echo "Successull delete all location who belong to current user";
	
}

if($dbmgt=='dap') {
	del_all_ap($_SESSION['locID']);
	echo "Successull delete all access point from current location";
}

if($dbmgt=='dabp') {
	$q1="DELETE From BillingPlan Where LocationID='". $_SESSION['locID'] ."'";
	
        $result=$_SESSION["oreon"]->database->database->query($q1);
	echo "Successull delete all billing plan from current location";
}

if ($dbmgt=='dexpacct') {
	$loc=$_SESSION['locID'];
	$expu=0;
	$query3 = "SELECT UserName,Type from userinfo where locationID='$loc'";
        $array=expiredUser("del",$query3);
	$expu+=count($array['time']);
	//DELETE EXPIRED OCTET
        $query4 = "SELECT UserName,Type from userinfo where locationID='$loc'";
        $array=expiredUser("del",$query4);
	$expu+=count($array['octet']);
	//DELETE EXPIRED EXPIRATION 
        $query5 = "SELECT UserName,Type from userinfo where locationID='$loc'";
        $array=expiredUser("del",$query5);
	$expu+=count($array['expiration']);
	if ($expu==0)
		echo "<br>Coundn't find any account to delete !!!!!";
	else 
		echo "<br>Successful delete expired account !!";
}

if($dbmgt=='dauacct') {
	$query="select UserName from  userinfo where LocationID='".$_SESSION['locID']."'";
	$result=$_SESSION["oreon"]->database->database->query($query);
	while ($row = $oreon->database->database->fetch_object($result)) {
		$array[] = $row;
		$uname = ($row->UserName);
		delete_user_acct($name);
	}
	echo "Successull delete all user accounting for the current location !";
}

?>
Return current item: phpMyPrepaid