Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/divers/pullUser.php
<?php
	if(isset($_POST['ID'])){ 
		$pullUser = $_POST['ID'];
		}
	if(isset($_GET['usr'])){
		$pullUser = $_GET['usr'];
	}
	if(isset($_POST['login'])){
		$pullUser = $_POST['login'];
	}
	if(isset($_POST['pullUser'])){
		$pullUser = $_POST['pullUser'];
	}
if ($debug) echo "USER ".$pullUser;
	$query = "SELECT Type, LocationID, creator, Value, FirstName, LastName, CustID,Note,BillingPlan,Mail,WorkPhone,HomePhone,Mobile,Department,Note, activeDate,CrDate FROM radcheck,userinfo where radcheck.username=userinfo.username AND userinfo.UserName='$pullUser' AND Attribute='User-Password'";
	//$result = $oreon->database->database->query($query) or die("Query database error !");
	$result = $_SESSION["oreon"]->database->database->query($query);
	while($row = $oreon->database->database->fetch_object($result)) {
		$Type = ($row->Type);
		$locID = $row->LocationID;
		$Location = get_location_name(($row->LocationID));
		$creator = ($row->creator);
		$password = ($row->Value);
		$mobile = ($row->Mobile);
		$mail = ($row->Mail);
		$cid = ($row->CustID);
		
		$firstname = ($row->FirstName);
		$lastname = ($row->LastName);
		$workphone = ($row->WorkPhone);
		$homephone = ($row->HomePhone);
		$department = ($row->Department);
		$note = ($row->Note);
		$idBp = ($row->BillingPlan);
		$typeBp= get_plan_type($idBp);
		$adate = ($row->activeDate);
		$cdate = ($row->CrDate);
	}

$query = "SELECT Value FROM $expirationDateAttrdb WHERE Attribute='$expirationDateAttr' AND UserName='$pullUser'";
$result = $_SESSION["oreon"]->database->database->query($query);
$row = $oreon->database->database->fetch_array($result);
if (isset($row['Value']))
$edate=date_from_attribute($row['Value'],$dateFormat);
if ($Type=="Hourly" or $Type=="Subscription Time") 
{
  $query = "SELECT Value AS Max FROM $sessionTimeAttrdb where Attribute='$sessionTimeAttr' AND UserName='$pullUser'";
  $result = $_SESSION["oreon"]->database->database->query($query);
  while($row = $oreon->database->database->fetch_object($result)){
    $Max = ($row->Max);
  }
}
else if ($Type=="Octets" or $Type=="Subscription Octets")
{
	$tab= get_octet_type_attr($octet_type);
	$attr = $tab[0];
	$db= $tab[1];
	$query = "SELECT Value AS Max FROM $tab[1] where Attribute='$tab[0]' AND UserName='$pullUser'";
  $result = $_SESSION["oreon"]->database->database->query($query);
  while($row = $oreon->database->database->fetch_object($result)){
    $Max = ($row->Max);
    $Max=$Max;
    $Max=$Max;
  }
}
else if ($Type=="Subscription Mac")
{
	$query = "SELECT Value as Mac FROM $macAuthAttrdb where Attribute='$macAuthAttr' AND UserName='$pullUser'";
	  $result = $_SESSION["oreon"]->database->database->query($query);
	while($row = $oreon->database->database->fetch_object($result)){
		 $Max = ($row->Mac);

	}
}
else if ($Type=="Subscription Expiration" or $Type=="Expiration")
{
$query = "SELECT Value as Expiration FROM $expirationWisprAttrdb where Attribute='$expirationWisprAttr' AND UserName='$pullUser'";
$result = $_SESSION["oreon"]->database->database->query($query);
while($row = $oreon->database->database->fetch_object($result)){
 $Max = date_from_attribute(($row->Expiration),$dateFormat);
 }
	  
}

	
$query = "SELECT Value AS val3 FROM radcheck where Attribute='Simultaneous-Use' AND UserName='$pullUser'";
  $result = $_SESSION["oreon"]->database->database->query($query);
	while($row = $oreon->database->database->fetch_object($result)){
	  $Simultaneous = ($row->val3);
	  
	}

?>
																					
Return current item: phpMyPrepaid