<?php
require_once(dirname(__FILE__).'/../../config.php');
$t	=	$prepare->sanitize($_GET['t'],'input');



if ( $t	==	'auth' ){

	$admin_email	=	$prepare->sanitize($_POST['email'],'input');
	$up				=	$prepare->sanitize($_POST['password'],'input');
	$admin_password	=	md5($up);

	$V_ADMIN = $db->Query("select `admin_id`, `admin_name`, `admin_email`, `admin_username`, `admin_password`, `admin_session_id` from administrator where admin_email=? and admin_password=?","ss",$admin_email,$admin_password);


	if ( empty ( $V_ADMIN ) ) {
			echo '<div id="mode">2</div><div id="message">'. $LANG["WBS_ADMIN_LOGIN_ERROR"] .'</div>';
	} else {
		session_destroy();
		session_start();
		//** CREATE SESSION AND SEND THE REDIRECT COMM **//
		$_SESSION[ADMIN_SESSION] = $V_ADMIN;
			echo '<div id="mode">1</div>';
	}

}





if ( $t	==	'out' ){
	session_destroy();
	echo '<div id="mode">1</div>';
}




?>