<?php

		class core_hms extends connection{
			function __construct()
			{
				parent::__construct("db_hr");
			}
			
			function login()
			{
				if(isset($_POST['login']))
				{
					$user_id = $_POST['user_id'];
					$password = $_POST['password'];
					
						$sql = "select *from tbl_registration where user_name='".$user_id."' and password='".$password."'";
						$result = $this->viewdata($sql);
						echo $msg = "Invalid user_id or password";		
							if($result->num_rows > 0){	
															
									$_SESSION["login"] = $result->fetch_assoc();
									header('location:dashboard.php');
								}	
							else
							{	
								$this->msg = "Invalid user_id or password";
							}
							
				}
			}
			
			
		}

?>