<?php
include('../headertop.php');
include('../db.php');
//include('../datepicker.php');

$disp = '';
$pagetitle = 'Delete Employee';

if(!isset($_GET['id']))
{
echo '<meta http-equiv="refresh" content="0;URL=viewemployees.php">';
exit;
}

$id = $_GET['id'];


$q = "select * from employee where id='$id'";

$res = mysqli_query($dbcon,$q) or die(mysqli_error($dbcon));
if(mysqli_num_rows($res)<1)
{
echo '<meta http-equiv="refresh" content="0;URL=viewemployees.php?sm=Employee details not found. Pleas try again!">';
exit;
}

$row = mysqli_fetch_array($res);

$disp .= '

<div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             <strong>Are you sure you want to delete the following employee?</strong> 
                        </div>
						</div>
										
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <tbody>
                                       <tr><th>Photo</th><Td><img src="'.$row['photopath'].'" style="width:100px;height:100px"></td></td>
                                            <tr><th>Employee Name</th><td>'.$row['name'].'</td></tr>
											<tr><th>Gender</th><td>'.$row['gender'].'</td></tr>
                                            <tr><th>Father/Husband Name</th><td>'.$row['fname'].'</td></tr>
											<tr><th>Qualification</th><td>'.$row['qualification'].'</td></tr>
											<tr><th>Mobile</th><td>'.$row['mobile'].'</td></tr>
											<tr><th>Address</th><td>'.$row['address'].'</td></tr>
											<tr><th>Date of Joining</th><td>'.$row['doj'].'</td></tr>
											<tr><th>Salary</th><td>'.$row['salary'].'</td></tr>
											
                                        
                                    </tbody>
                                    
									</table>
									<form method="post" action="deleteemployee2.php" id="deleteemployeeform">
									<input type="hidden" name="id" value="'.$id.'">
									<button type="submit" class="btn btn-primary" name="deleteemployeesubmit"  style="margin-top:25px">Confirm Delete</button>
									</form>
                            </div>
                            
                        </div>
                    </div>
					</div>
									';
									

									   
									   include('../template.php');