<?PHP

ob_start();

session_start();

include 'connect.php';

if(isset($_SESSION['adminemail']))

{

$user=$_SESSION['adminemail'];



$gtp=mysql_query("select * from admin where username='$user'");

$gtp1=mysql_fetch_array($gtp);



include 'top.php';

?>







<div class="main-content">

				<div class="main-content-inner">

					<div class="breadcrumbs ace-save-state" id="breadcrumbs">

						<ul class="breadcrumb">

							<li>

								<i class="ace-icon fa fa-home home-icon"></i>

								<a href="#">Home</a>

							</li>

							<li class="active">Resign</li>

						</ul><!-- /.breadcrumb -->

					</div>



					<div class="page-content">			



						<div class="page-header">



<?php



$aca=mysql_query("select * from financial where user='$user' order by ID desc");

$aca1=mysql_fetch_array($aca);



$financial=$aca1['financial'];



?>                        

                        

							<table style="width:100%;">

                        

                        <tr><td style="width:50%;">

                        

							<h1>

								Resign

							</h1>

                            

                            </td>

                            

                            <td style="width:50%; text-align:right; padding-right:15px; font-size:15px;">

                            

                            <i class="fa fa-calendar"></i>&nbsp; <?php echo $financial; ?>

                            

                            </td></tr></table>

                            

						</div><!-- /.page-header -->

<br />



						<div class="row">

							<div class="col-xs-12">

                            

								<!-- PAGE CONTENT BEGINS -->

                                

<script src="assets/js/jquery.js"></script>





<?php

if(isset($_GET['save']))

{

$employee=$_GET['employee'];

$date=$_GET['date'];

$remarks=$_GET['remarks'];



$date=date('Y-m-d',strtotime($date));



$up="update employee set status='resigned',dor='$date',reason='$remarks' where ID='$employee'";

$up1=mysql_query($up);



if($up1)

{

header("location:viewemployee.php?s=3" . urlencode($Message));

}



}

elseif(isset($_GET['no']))

{

header("location:viewemployee.php");

}



elseif($_GET['id'])

{

$emp=$_GET['id'];



$z=mysql_query("select * from employee where ID='$emp'");

$z1=mysql_fetch_array($z);



echo"<center>

<form action='resign.php' id='resign' method='get'><span style='color:red; font-weight:bold;'>Do You Really want to Update the status </span>

<br /><br />



<table style='line-height:35px;'>

<tr><td>Employee </td><td style='padding:0 7px;'>:</td><td><input type='hidden' name='employee' value='".$emp."'>".$z1['name']."</td></tr>

<tr><td>Date <span class='red'>*</span></td><td style='padding:0 7px;'>:</td><td> <input type='text' name='date' class='datepicker' id='reqiured' title='Select Date'></td></tr>

<tr><td>Remarks</td><td style='padding:0 7px;'>:</td><td> <textarea name='remarks' rows='5' cols='35'></textarea></td></tr>

</table>



<button type='submit' name='save' value='save'>Yes</button>&nbsp;

<button type='submit' name='no' value='no'>No</button></form></center>";



}



?>





							<br>

<br>

	



								<!-- PAGE CONTENT ENDS -->

							</div><!-- /.col -->

						</div><!-- /.row -->

					



					</div><!-- /.page-content -->

				</div>

			</div><!-- /.main-content -->





<?php



include 'bottom.php';



}

else

{



 header("location:login.php");

 

}



ob_flush();



?>