<?php include ('header1f.php');?>
<?php 
ob_start();   
session_start();
include ('connection.php') ;

  if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }
	date_default_timezone_set('Asia/Calcutta');
$today = date("d/m/Y");
$today3 = date("Y-m-d");
$today1 = date("d/m");

?>
<div class="content-page">
<div class="content">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Add User</h3>
</div>
<div class="panel-body">
<div class="row">
<form id="frm_add_category" method="post" action="insert_user.php" >


<div class="box-body">
<div class="row">
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label for="middle_name" class="control-label">First Name</label>
<input class="form-control" type="text" name="first_name"  value="<?php echo $first_name?>"/>
</div>
</div>
</div>
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label for="last_name" class="control-label">Last Name</label>
<input class="form-control" type="text" name="last_name"  value="<?php echo $last_name?>"/>
</div>
</div>
</div>
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label for="last_name" class="control-label">Mobile No</label>
<input class="form-control" type="text" name="mobileno"  value="<?php echo $mobileno?>"/>
</div>
</div>
</div>
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label for="last_name" class="control-label">Login Type</label>
<select name="login_type" class="form-control" required>
<?php if($login_type!=''){?>
<option value="<?php echo $login_type?>" selected="selected"><?php echo $login_type?></option>
<?php }else{?>
<option value="" selected="selected">Select Designation</option>
<?php } ?>
<option value="Super Admin">Super Admin</option>
<option value="User">User</option>
</select>
</div>
</div>
</div>
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label for="last_name" class="control-label">Designation</label>
<select name="designation" class="form-control" required>
<?php if($designation!=''){?>
<option value="<?php echo $designation?>" selected="selected"><?php echo $designation?></option>
<?php }else{?>
<option value="" selected="selected">Select Designation</option>
<?php } ?>
<?php 
$querynp = "select * from designation_master where status='1'";
$resultmp = mysqli_query($conn,$querynp);
while($row=mysqli_fetch_array($resultmp))
{
$designation = $row['designation'];
?>
<option value="<?php echo $designation?>"><?php echo $designation?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label for="last_name" class="control-label">Department</label>
<select name="department" class="form-control" required>
<?php if($department!=''){?>
<option value="<?php echo $department?>" selected="selected"><?php echo $department?></option>
<?php }else{?>
<option value="" selected="selected">Select Department</option>
<?php } ?>
<?php 
$querynp = "select * from department_master where status='1'";
$resultmp = mysqli_query($conn,$querynp);
while($row=mysqli_fetch_array($resultmp))
{
$department = $row['department'];
?>
<option value="<?php echo $department?>"><?php echo $department?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label for="last_name" class="control-label">Username </label>
<input class="form-control" type="text" name="username"  value="<?php echo $username?>" required />
</div>
</div>
</div>
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label for="last_name" class="control-label">Password</label>
<input class="form-control" type="text" name="password"  value="<?php echo $password?>" required />
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<div>
<button type="submit" class="btn btn-primary waves-effect waves-light" style="float:right"> Submit </button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include 'footer1a.php';?>
