<?php
	require_once "pageBase.php";
	require_once "../../bin/system/conver.php";
	require_once "../../dal/userDAL.php";
	class _user extends pageBase{
		private $dal;
		public function load(){
			$this->dal = new userDAL();
			$action = conver::toDbString(trim($_POST["do"]));
			switch(trim(strtolower($action))){
				case "del":
					$this->delete();
					break;
				default:
					break;
			}
			parent::load();
		}
		private function delete(){
			$id = conver::toDbString(trim($_POST["id"]));
			if($this->dal->deleteRecord($id))
				echo "1";
			else
				echo "-1";
		}
	}

	$page = new _user();
	$page->load();
?>