Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/divers/DeleteExpiredAccount.php
<?php
 /*     This file is used to display all cards that have been created
	It is expected that in production, this feature will be rather
	useless because of the number of accounts that will build up
	over time.  Some sort of method for clearing old accounts will
	need to be implemented.  For now, AllCards is the first step
	in building a reporting system.

	This file C. Carl H. Peterson 2004 and released under the GPL.
	If you didn't get a copy of the GPL with this, do a search for
	GPL and find it your self.  Remember, I copyrighted this so if
	you are using it you better have a license to use it.  GPl 
	works for me.
*/

	//////////////////////////////////////////////////////////
	//	THIS SCRIPT DISPLAYS ACCOUNTS FOR A LOCATION	//
	//	First we pull the session location ID and then	//
	//	use it to pull the correct cards.  		//
	//	we use the button ID to figure out which type	//
	//	of cards we want to pull			//
	//////////////////////////////////////////////////////////
	if(isset($msg)){ unset($msg);}

	if(isset($_SESSION['locID'])){
		$loc = $_SESSION['locID'];
		}else{
			$msg= "<p class=\"error\">Please Select a Location</p>";
			if(!isset($include)) { $include = "include/location/ShowLoc.php";}
			}
	if(!isset($buttonID)) {
		$msg= "$msg <p class=\"error\">No button ID was sent</p>"; // this shouldn't happen
		}
	

					
	//////////////////////////////////////////////////////////
	//	THIS WAS THE 0.1X CODE.  INCLUDED IF NO MSG	//
	//////////////////////////////////////////////////////////

	

	$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']);
echo $expu;
 if ($expu==0)
 echo "<br>Coundn't find any account to delete !!!!!";
 else 
 echo "<br>Successful delete account !!!";
?>		
Return current item: phpMyPrepaid