<?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">Employee</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>

								Employee

							</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 -->



						<div class="row">

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

                            

								<!-- PAGE CONTENT BEGINS -->





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





<script>



function update_gross()

{

	

	var basic=$('.basic').val().replace("Rs.", "");

	var serviceweightage=$('.serviceweightage').val().replace("Rs.", "");

	var hra=$('.hra').val().replace("Rs.", "");

	var cca=$('.cca').val().replace("Rs.", "");

	

	var tot = (basic*1)+(serviceweightage*1)+(hra*1)+(cca*1);

	

	tot=tot.toFixed(2);

	

	$('.gross').val(tot);

	

}



$(document).ready(function(){

	

	

$('.basic').blur(update_gross);

$('.serviceweightage').blur(update_gross);

$('.hra').blur(update_gross);

$('.cca').blur(update_gross);

	



$(".department").change(function() {



		  var department=$(this).val();



		  var dataString = 'department='+ department;



		  //alert(dataString);



		  $.ajax



		  ({



		  type: "GET",



		  url: "getdesignation.php",



		  data: dataString,



		  cache: false,



		  success: function(resp)



		  {

			  

			  //alert(resp);

		  

		  $('.designation').html($('#designation',resp).html());

		  

		  }



		  });



});









$("input[type=checkbox]").change(function()

    {



        if ($(this).is(":checked")) {



            $(".swt").show();



	    }



        else{



            $(".swt").hide();



        }



    });



    $("input[type=checkbox]").change();

	

	

	

$('.designation').change(function(){

	

	var desig=$('.designation').val();

	var dept=$('.department').val();

	

	if(desig=='2' && dept=='1')

	{

		$('.exctve').show();			

	}

	else

	{

		$('.exctve').hide();

	}

	

});





$('.department').change(function(){

	

	var desig=$('.designation').val();

	var dept=$('.department').val();

	

	if(desig=='2' && dept=='1')

	{

		$('.exctve').show();			

	}

	else

	{

		$('.exctve').hide();

	}

	

});

	

	



});



</script>





<script>

	

jQuery(function($){

		   

	// simple jQuery validation script

	$('#course').submit(function(){

		

		var valid = true;

		var errormsg = 'This field is required!';

		var errorcn = 'error';

		

		$('.' + errorcn, this).remove();			

		

		$('#required', this).each(function(){

			var parent = $(this).parent();

			if( $(this).val() == '' ){

				var msg = $(this).attr('title');

				msg = (msg != '') ? msg : errormsg;

				$('<span style="font-size:13px;color:#FF0000; padding-left:3px;" class="'+ errorcn +'">'+ msg +'</span>')

					.appendTo(parent)

					.fadeIn('fast')

					.click(function(){ $(this).remove(); });

				valid = false;

			};

		});

		

		return valid;

		

		$('button:submit').prop('disabled', true);

		

	});

	

});	



</script>   

								

										

                                        

<?php



   if(isset($_POST['submit']))

   { 



    $id=$_POST['id'];



    $password=$_POST['password'];



    $password2=$_POST['password2'];



	if($_POST['password']==$_POST['password2'])

    {



      if($_POST['password'])

      {



        $password=md5($password);



        $cp="Update employee set password='$password' where ID='$id'";



        mysql_query($cp) or die("not1");



      }

	  

	  header("location:viewemployee.php?s=6");



    }

	else

    {



     print "<script type='text/javascript'>alert('Passwords did not match, please try again');</script>";



	 print "<META HTTP-EQUIV = 'Refresh' Content = '1; URL =viewemployee.php'>";



    }



	}

	else

	{



	$id=$_GET['id'];



	$ad=mysql_query("select * from employee where ID='$id'");

	$ad1=mysql_fetch_array($ad);



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

	{



		 $status=$_GET['s'];



		if($status=='1')

		{



				echo'<div class="alert alert-success alert-dismissable">



                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>



                <span style="text-align:left;">Password Changed Successfully</span>

				

                </div><br />';

		

		}



	}





		echo'<form action="changepass1.php" method="post" id="pass">



		<input type="hidden" name="id" readonly="true" value="'.$id.'" />



		<p><center><table width="60%" style="line-height:35px;">



		<tr><td id="page">User Name <span class="red">*</span> </td><td id="page">:</td><td id="page"><input type="text" name="username" readonly="true" value="'.$ad1['username'].'" /></td></tr>



		<tr><td id="page">Password <span class="red">*</span> </td><td id="page">:</td><td id="page"><input type="password" name="password" id="required" title="Enter Password" style="height:31px; width:220px;" /></td></tr>



        <tr><td id="page">Re-Type Password <span class="red">*</span> </td><td id="page">:</td><td id="page"><input type="password" name="password2" id="required" title="Enter Re-type Password" style="height:31px; width:220px;" /></td></tr>



        <tr><td id="page"></td><td id="page"></td><td id="page"><button id="save" type="submit" value="Change" name="submit" class="btn btn-sm btn-primary">Save</button></td></tr>



        </table></center></p>



		</form>';



  	}



?>









										<!-- 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();



?>