<?php
//Srinivas Tamada http://9lessons.info
//User

class AdminUser
{
     
	 /* User Login Check */
     public function User_Login($username,$password)
     {
     $username=mysql_real_escape_string($username);
     $password=mysql_real_escape_string($password);
     $md5_password=md5($password);

     $query=mysql_query("SELECT admin_id FROM admin WHERE (admin_username='$username' or admin_email='$username') and admin_password='$md5_password'");
     if(mysql_num_rows($query)==1)
     {
     $row=mysql_fetch_array($query);
     return $row['admin_id'];
     }
     else
     {
     return false;
     }
     }

	 	 /* Admin Password Change*/
     public function ChangePassword($newPassword,$session_admin_uid)
     {
     $newPassword=md5(mysql_real_escape_string($newPassword));

     $query=mysql_query("UPDATE admin SET admin_password='$newPassword' WHERE admin_id='$session_admin_uid'") or die(mysql_error());
     return true;
     }

}

?>
