Location: PHPKode > projects > ChiCoMaS - Chilek CMS > chicomas/objects/obj_users.php
<?
/*********************************************************/
class CUser{

	var $user_id;
	var $active;
	var $name_surname;
	var $username;
	var $password;
	var $email;
	var $permission;
	var $reg_date;
	var $last_login;
	var $order_by;

	function CUser($row=""){
		$this->user_id = $row["user_id"];
		$this->active = $row["active"];
		$this->name_surname = $row["name_surname"];
		$this->username = $row["username"];
		$this->password = $row["password"];
		$this->email = $row["email"];
		$this->permission = $row["permission"];
		$this->reg_date = $row["reg_date"];
		$this->last_login = $row["last_login"];
		$this->order_by = "user_id";
	}
}

/*********************************************************/
class CUserArray{
	var $users=array();
	var $top=0;
	var $count=0;
	
	function get(){
		if ($this->top <= $this->count){
			$this->top++;			
			return $this->users[$this->top-1];
		}
		else 
			return false;
	}

	function add($CUser) {
		$this->users[$this->count] = $CUser;
		$this->count++;				
		return true;
	}
	
	function count() {
		return ($this->count);
	}
}

/*********************************************************/
class CUserEngine {
	function GetUsers(){
		$o_dataaccess = new CDataAccess();
		return $o_dataaccess->GetUsers();
	}

	function FindUser($CUser){
		$o_dataaccess = new CDataAccess();
		return $o_dataaccess->FindUser($CUser);
	}

	function FindUsername($username){
		$o_dataaccess = new CDataAccess();
		return $o_dataaccess->FindUsername($username);
	}

	function FindUserbyID($userid){
		$o_dataaccess = new CDataAccess();
		return $o_dataaccess->FindUserbyID($userid);
	}

	function InsertUser($CUser){
		$o_dataaccess = new CDataAccess();
		return $o_dataaccess->InsertUser($CUser);
	}

	function DeleteUser($userid){
		$o_dataaccess = new CDataAccess();
		return $o_dataaccess->DeleteUser($userid);
	}

	function UpdateUser($CUser){
		$o_dataaccess = new CDataAccess();
		return $o_dataaccess->UpdateUser($CUser);
	}

}
?>
 
Return current item: ChiCoMaS - Chilek CMS