<?php 
include ('config.php');
if(!isset($_SESSION['emp_name']))
	 {
	  echo("<script language='javascript'>window.location.href='index.php'</script>");
	  exit;
	 }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="css/grid.css" tppabs="" media="screen" />
        <link rel="stylesheet" type="text/css" href="thickbox.css" tppabs="http://www.xooom.pl/work/magicadmin/css/thickbox.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="css/styles.css" tppabs="" media="screen" />
           <link rel="stylesheet" type="text/css" href="jquery.wysiwyg.css" tppabs="http://www.xooom.pl/work/magicadmin/css/jquery.wysiwyg.css" media="screen" />
        
        <!-- Table sorter stylesheet -->
        <link rel="stylesheet" type="text/css" href="tablesorter.css" tppabs="http://www.xooom.pl/work/magicadmin/css/tablesorter.css" media="screen" />
        
	</head>
	<body>
    	<!-- Header -->
        <div id="header">
             <div id="header-main1">
                <div class="container_12">
                    <div class="grid_12">
                        <div id="logo">
                            <ul id="nav">
                                <li style="background:#5E5E5E;"><a  style="background:#5E5E5E;" href="changepassword.php">Change Password</a></li>
                                <li  style="background:#5E5E5E;"><a  style="background:#5E5E5E;" href="logout.php">Logout</a></li>
                               
                            </ul>
                        </div><!-- End. #Logo -->
                    </div><!-- End. .grid_12-->
                    </div> 
       </div>
       </div>
        </div> <!-- End #header -->
		<div class="container_12">
                   <div class="grid_12">
                   
            
                <div class="module">
                     <h2><span>Add Staffs</span></h2>
                        
                     <div class="module-body">
                        <form action="add_staff.php" method="post">
                            <p>
                                <label>Employee Name</label>
                                <input type="text" name="emp_name" />
                            </p>
                            <p>
                                <label>Employee Acc.No</label>
                                <input type="text" name="emp_accno" />
                            </p>
                          <p>
                                <label> Password</label>
                                <input type="text" name="emp_password"/>
                            </p>
                            <p>
                                <label> Gender</label>
                                <input type="radio" name="gender" value="male"/>Male
                                 <input type="radio" name="gender"  value="female"/>Female
                            </p>
                                <input  type="submit" name="submit"value="Submit" /> 
                            
                        </form>
                     </div> <!-- End .module-body -->

                </div>  <!-- End .module -->
        		<div style="clear:both;"></div>
            </div> <!-- End .grid_12 -->
            <?php
			if(isset($_REQUEST['submit']))
{
			$emp_name=$_REQUEST['emp_name'];
			$emp_accno=$_REQUEST['emp_accno'];
			$emp_password=$_REQUEST['emp_password'];
			$gender=$_REQUEST['gender'];
			$emp_status='Y';
			//echo "insert into tbl_admin (emp_name,emp_accno,emp_password,gender) values('$emp_name','$emp_accno','$emp_password','$gender')";exit;
			$select=mysqli_query($conn,"insert into tbl_admin (emp_name,emp_accno,emp_password,gender,emp_status) 				                                                                       values('$emp_name','$emp_accno','$emp_password','$gender','$emp_status')");
			echo'<script language=javascript>alert("Record Inserted successfully");</script>';
echo '<script language=javascript> window.location="staffdetails.php"; </script>';
			
		
			}
			?>
                