<?php
	include "db_connection/db_connection.php";
	include "config/config.php";
	
	if($_SESSION['admin_login_id'] == '')
	{
		echo "<script>window.location='index.php';</script>";
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title><?php echo $PROJECT_TITLE ?></title>

<script type="text/javascript" src="js/employee_add_JS.js"></script>
<link href="css/styles.css" rel="stylesheet" type="text/css" />
<!--[if IE]> <link href="css/ie.css" rel="stylesheet" type="text/css"> <![endif]-->

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>

<script type="text/javascript" src="js/plugins/forms/ui.spinner.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.mousewheel.js"></script>
 
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

<script type="text/javascript" src="js/plugins/charts/excanvas.min.js"></script>
<script type="text/javascript" src="js/plugins/charts/jquery.flot.js"></script>
<script type="text/javascript" src="js/plugins/charts/jquery.flot.orderBars.js"></script>
<script type="text/javascript" src="js/plugins/charts/jquery.flot.pie.js"></script>
<script type="text/javascript" src="js/plugins/charts/jquery.flot.resize.js"></script>
<script type="text/javascript" src="js/plugins/charts/jquery.sparkline.min.js"></script>

<script type="text/javascript" src="js/plugins/tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="js/plugins/tables/jquery.sortable.js"></script>
<script type="text/javascript" src="js/plugins/tables/jquery.resizable.js"></script>

<script type="text/javascript" src="js/plugins/forms/autogrowtextarea.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.uniform.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.inputlimiter.min.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.maskedinput.min.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.autotab.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.chosen.min.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.dualListBox.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.cleditor.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.ibutton.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.validationEngine-en.js"></script>
<script type="text/javascript" src="js/plugins/forms/jquery.validationEngine.js"></script>

<script type="text/javascript" src="js/plugins/uploader/plupload.js"></script>
<script type="text/javascript" src="js/plugins/uploader/plupload.html4.js"></script>
<script type="text/javascript" src="js/plugins/uploader/plupload.html5.js"></script>
<script type="text/javascript" src="js/plugins/uploader/jquery.plupload.queue.js"></script>

<script type="text/javascript" src="js/plugins/wizards/jquery.form.wizard.js"></script>
<script type="text/javascript" src="js/plugins/wizards/jquery.validate.js"></script>
<script type="text/javascript" src="js/plugins/wizards/jquery.form.js"></script>

<script type="text/javascript" src="js/plugins/ui/jquery.collapsible.min.js"></script>
<script type="text/javascript" src="js/plugins/ui/jquery.breadcrumbs.js"></script>
<script type="text/javascript" src="js/plugins/ui/jquery.tipsy.js"></script>
<script type="text/javascript" src="js/plugins/ui/jquery.progress.js"></script>
<script type="text/javascript" src="js/plugins/ui/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="js/plugins/ui/jquery.colorpicker.js"></script>
<script type="text/javascript" src="js/plugins/ui/jquery.jgrowl.js"></script>
<script type="text/javascript" src="js/plugins/ui/jquery.fancybox.js"></script>
<script type="text/javascript" src="js/plugins/ui/jquery.fileTree.js"></script>
<script type="text/javascript" src="js/plugins/ui/jquery.sourcerer.js"></script>

<script type="text/javascript" src="js/plugins/others/jquery.fullcalendar.js"></script>
<script type="text/javascript" src="js/plugins/others/jquery.elfinder.js"></script>

<script type="text/javascript" src="js/plugins/ui/jquery.easytabs.min.js"></script>
<script type="text/javascript" src="js/files/bootstrap.js"></script>
<script type="text/javascript" src="js/files/functions1.js"></script>
<style type="text/css">
#mask {
	display: none;
	background: #000; 
	position: fixed; left: 0; top: 0; 
	z-index: 10;
	width: 100%; height: 100%;
	opacity: 0.8;
	z-index: 999;
}

.login-popup{
	width:450px;
	height:350px;
	
	display:none;
	background: #333;
	padding: 10px; 	
	border: 2px solid #ddd;
	float: left;
	font-size: 1.2em;
	position: fixed;
	top: 50%; left: 50%;
	z-index: 99999;
	box-shadow: 0px 0px 20px #999;
	-moz-box-shadow: 0px 0px 20px #999; /* Firefox */
    -webkit-box-shadow: 0px 0px 20px #999; /* Safari, Chrome */
	border-radius:3px 3px 3px 3px;
    -moz-border-radius: 3px; /* Firefox */
    -webkit-border-radius: 3px; /* Safari, Chrome */
}

img.btn_close {
	float: right; 
	margin: -28px -28px 0 0;
}

</style>
<script type="text/javascript">
//$.noConflict();
$(document).ready(function() {
	$('a.login-window').click(function() {
		
		// Getting the variable's value from a link 
		var loginBox = $(this).attr('href');

		//Fade in the Popup and add close button
		$(loginBox).fadeIn(300);
		
		//Set the center alignment padding + border
		var popMargTop = ($(loginBox).height() + 24) / 2; 
		var popMargLeft = ($(loginBox).width() + 24) / 2; 
		
		$(loginBox).css({ 
			'margin-top' : -popMargTop,
			'margin-left' : -popMargLeft
		});
		
		// Add the mask to body
		$('body').append('<div id="mask"></div>');
		$('#mask').fadeIn(300);
		
		return false;
	});
	
	// When clicking on the button close or the mask layer the popup closed
	$('a.close, #mask').live('click', function() { 
	  $('#mask , .login-popup').fadeOut(300 , function() {
		$('#mask').remove();  
	}); 
	return false;
	});
});
</script>
<!-- Shared on MafiaShare.net  --><!-- Shared on MafiaShare.net  --></head>

<body onload="document.getElementById('listpage').focus();">

<!-- Top line begins -->
<?php include "header_footer/header.php"; ?>
<!-- Top line ends -->


<!-- Sidebar begins -->
<?php include "menus/left_menu.php"; ?>
<!-- Sidebar ends -->



<!-- Content begins -->
<div id="content">
    <!--<div class="contentTop">
        <span class="pageTitle"><span class="icon-key-2"></span>Form validation engines</span>
        <ul class="quickStats">
            <li>
                <a href="" class="blueImg"><img src="images/icons/quickstats/plus.png" alt="" /></a>
                <div class="floatR"><strong class="blue">5489</strong><span>visits</span></div>
            </li>
            <li>
                <a href="" class="redImg"><img src="images/icons/quickstats/user.png" alt="" /></a>
                <div class="floatR"><strong class="blue">4658</strong><span>users</span></div>
            </li>
            <li>
                <a href="" class="greenImg"><img src="images/icons/quickstats/money.png" alt="" /></a>
                <div class="floatR"><strong class="blue">1289</strong><span>orders</span></div>
            </li>
        </ul>
        <div class="clear"></div>
    </div>-->
    <?php include "menus/top_menu.php"; ?> 
    <!-- Breadcrumbs line -->
    <div class="breadLine">
        <div class="bc">
            <ul id="breadcrumbs" class="breadcrumbs">
                <li><a href="home.php">Dashboard</a></li>
                <li><a href="javascritp:">Employee</a></li>
                
            </ul>
        </div>        
        <?php include "menus/top_left_menu.php"; ?>  
    </div>
    
    <!-- Main content -->
    <div class="wrapper">
        <ul class="middleNavR">
            <!--<li><a href="#" title="Add an article" class="tipN"><img src="images/icons/middlenav/create.png" alt="" /></a></li>
            <li><a href="#" title="Upload files" class="tipN"><img src="images/icons/middlenav/upload.png" alt="" /></a></li>
            <li><a href="#" title="Add something" class="tipN"><img src="images/icons/middlenav/add.png" alt="" /></a></li>
            <li><a href="#" title="Messages" class="tipN"><img src="images/icons/middlenav/dialogs.png" alt="" /></a><strong>8</strong></li>-->
            <li><a href="employee_list.php" id="listpage" title="List Employee" class="tipN"><img src="images/icons/middlenav/stats.png" alt="" /></a></li>
        </ul>
    	<?php
		$emp_id	= base64_decode(base64_decode(base64_decode($_GET['emp_id']))); //EMPLOYEE ID
			
		//this is for getting the values from employee basice details table for update date the value
		$SLCT = "SELECT  * FROM emp_det  WHERE emp_det_id='$emp_id'";
		$QURY = mysqli_query($connect,$SLCT);						 
		$FTCH_e = mysqli_fetch_object($QURY);
			
		//$page_id= base64_encode(base64_encode(base64_encode(1))); //THIS IS FOR PAGE IDENTIFICATION IN BL FILE for add		 
					 
		?>

        <div class="fluid"><!--style="width:600px; margin-left:150px;"-->
            <form id="validate" name="fm" class="main" method="post" enctype="multipart/form-data">
                <fieldset>
                
                	<div class="widget">
                        <div class="whead"><h6>Employee View</h6><div class="clear"></div></div>
                        
                		<div class="formRow">
                            <div class="grid2"><label>Select Department:<span class="req"></span></label></div>
                            <div class="grid4 searchDrop">
                                <select data-placeholder="Choose a Department..." multiple="multiple" class="select" name="dept_name" id="dept_name" style="width:350px;" tabindex="2" disabled="disabled">
                                    <option value=""></option>
                                    <?php
									$mas_dept = '';
									$SLCT_DPT = "SELECT  * FROM master_dept ORDER BY master_dept_id ASC";
									$QURY_DPT = mysqli_query($connect,$SLCT_DPT);
									while($FTCH_DPT = mysqli_fetch_object($QURY_DPT))
									{
										$mas_dept .= $FTCH_DPT->master_dept_id.",";
									}
									$dept_id = explode(",",rtrim($FTCH_e->master_dept_id,",")) ;
									$mas_dept_id = explode(",",rtrim($mas_dept,",")) ;
									foreach ($mas_dept_id as $x) 
									{
										$SLCT_MDP = "SELECT  * FROM master_dept WHERE master_dept_id = '$x'";
										$QURY_MDP = mysqli_query($connect,$SLCT_MDP);
										$FTCH_MDP = mysqli_fetch_object($QURY_MDP);
										if($x!=0)
										{
											echo "<option ".(in_array($x, $dept_id)?"selected":"")." value='$x'>$FTCH_MDP->master_dept_name</option>";
										}
										else
										{
										}
									}
									?>
                                        
                                </select>
                            </div>
                            
                            <div class="grid2"><label>Employee Name:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" class="" value="<?php echo $FTCH_e->name ?>" name="e_name" id="e_name" readonly="readonly" disabled="disabled"/></div>
                            
                            <div class="clear"></div>
                        </div>
                        
                    	<!--<div class="formRow">
                            </div><div class="clear"></div>
                        </div>-->
                        
                        <div class="formRow">
                        <div class="grid2"><label>Date of Birth:<span class="req"></span></label></div>
                        <div class="grid4"><input type="text" value="<?php echo str_replace("-", "/",$FTCH_e->dob); ?>" name="dob" id="dob" class="datepicker" disabled="disabled"/></div>
                        
                        <div class="grid2"><label>Blood Group:<span class="req"></span></label></div>
                        <div class="grid2"><input type="text" value="<?php echo $FTCH_e->blood_gp ?>" name="bg" id="bg"  readonly="readonly" disabled="disabled"/></div>
                        
                        <div class="clear"></div>
                    	</div>
                        
                        <div class="formRow">
                            <div class="grid2"><label>Mobile No 1:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" value="<?php echo $FTCH_e->mobile ?>" name="mob1" id="mob1" readonly="readonly" disabled="disabled"/></div>
                            
                            <div class="grid2"><label>Mobile No 2:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" value="<?php echo $FTCH_e->mobile2 ?>" name="mob2" id="mob2" readonly="readonly" disabled="disabled"/></div>
                            
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
							
                            <div class="grid2"><label>Email ID:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" value="<?php echo $FTCH_e->email_id ?>" name="e_id" id="e_id" readonly="readonly" disabled="disabled"/></div><div class="clear"></div>
                        </div> 
						<div style="border: #949494 solid 1px; ">
                        <div class="formRow">
                            <div class="grid2"><label>Contact Person Name:<span class="req">*</span></label></div>
                            <div class="grid4"><input type="text" class="" name="per_nm" id="per_nm" value="<?php echo $FTCH_e->cont_per_name ?>" readonly="readonly" disabled="disabled"/></div>
                            
                            <div class="grid2"><label>Contact Person Mob:<span class="req">*</span></label></div>
                            <div class="grid4"><input type="text" class="" maxlength="10" value="<?php echo $FTCH_e->cont_per_mobile ?>"  name="mob3" id="mob3" readonly="readonly" disabled="disabled"/></div>
                            
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
							<div class="grid2"><label>Relationship:<span class="req">*</span></label></div>
                            <div class="grid4"><input type="text" class="" name="relan" id="relan" value="<?php echo $FTCH_e->cont_relan ?>" readonly="readonly" disabled="disabled"/></div>
							
                            <div class="clear"></div>
                        </div> 
						</div>                       
                                               
                         <!--<div class="formRow">
                            <div class="grid3"><label>Address:<span class="req">*</span></label></div>
                            <div class="grid6"><textarea rows="6" cols="" name="add" id="add"></textarea> </div>
                            <div class="clear"></div>
                        </div>-->
                        
                         <div class="formRow">
                            <div class="grid2"><label>Perminant Address:<span class="req"></span></label></div>
                            <div class="grid4"><textarea rows="6" cols="" name="of_add" id="of_add" readonly="readonly" disabled="disabled"><?php echo $FTCH_e->add ?></textarea> </div>
                            
                            <div class="grid2"><label>Recidential Address:<span class="req"></span></label> <br/><br/>
                            </div>
                            
                            <div class="grid4"><textarea rows="6" cols="" name="co_add" id="co_add" readonly="readonly" disabled="disabled"><?php echo $FTCH_e->res_add ?></textarea> </div>
                            
                            <div class="clear"></div>
                        </div>
						
						
						<div class="formRow">
                            <div class="grid2"><label>Bank Name:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" class=""  name="bnk_name" id="bnk_name" value="<?php echo $FTCH_e->bank_name ?>"/></div>
                            
                            <div class="grid2"><label>Branch Name:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" class="" name="brn_name" id="brn_name" value="<?php echo $FTCH_e->branch_name ?>"/></div>
                            
                            <div class="clear"></div>
                        </div>
						
						
						<div class="formRow">
                            <div class="grid2"><label>Ac/ Holder Name:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" class=""  name="ach_name" id="ach_name" value="<?php echo $FTCH_e->ac_name ?>"/></div>
                            
                            <div class="grid2"><label>Ac / No:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" class="" name="acno" id="acno" value="<?php echo $FTCH_e->ac_no ?>"/></div>
                            
                            <div class="clear"></div>
                        </div>
						
						
						<div class="formRow">
                            <div class="grid2"><label>IFSC Code:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" class=""  name="ifsc" id="ifsc" value="<?php echo $FTCH_e->ifsc_code ?>"/></div>
                                                    
                            
                            <div class="clear"></div>
                        </div>
                        
                        <div class="formRow">
                            <div class="grid2"><label>Resume:<span class="req"></span></label></div>
                            <div class="grid9">
                                <span class="help-inline" id="resume_div"><?php if($FTCH_e->resume_ext!=''){ ?><a href="employee_resumes/<?php echo $FTCH_e->resume_ext; ?>" id="resume" target="_blank" onfocus="foc(this.id)" onblur="stnon(this.id)">View Resume</a><?php }else{ ?>Add Your Resume Here.. <?php } ?></span>
                            </div>
                            <div class="clear"></div>
                        </div>
                        
                        <div class="formRow">
                            <div class="grid2"><label>Remarks:<span class="req"></span></label></div>
                            <div class="grid4"><input type="text" value="<?php echo $FTCH_e->remark_s ?>" name="remak" id="remak"/ disabled="disabled"></div>
                            <div class="clear"></div>
                        </div>
                        <?php
						$SLCTsal = "SELECT * FROM emp_sal_det  WHERE emp_det_id='$emp_id'";
						$QURYsal = mysqli_query($connect,$SLCTsal);	
						if(mysqli_num_rows($QURYsal)>0)					 
						{
							$lpl =1 ;
							while($FTCHsal = mysqli_fetch_object($QURYsal))
							{						
						?>						
								<div style="border: #949494 solid 1px; ">
								 	<div class="formRow" >
			                            <div class="grid2" style="margin-top:6px;"><label>From Date:<span class="req"></span></label></div>
										<div class="grid4" style="margin-left:-50px;">
			                               <input type="text" disabled="" name="fmd_<?php echo $lpl; ?>" value="<?php echo $FTCHsal->from_date ?>"  id="fmd_<?php echo $lpl; ?>" style="width:100px;"  <?php if($FTCHsal->from_date!=''){?> readonly="readonly" <?php }else {?> class="datepicker" <?php } ?>/>
			                               <input type="hidden" name="sal_det_<?php echo $lpl; ?>" value="<?php echo $FTCHsal->emp_sal_det_id ?>"  id="sal_det_<?php echo $lpl; ?>" style="width:100px;" />
			                            </div>
			                            
			                            <div class="grid2" style="width:100px; margin-left:-100px; margin-top:6px;"><label>To Date:<span class="req"></span></label></div>
			                            <div class="grid4" style="margin-left:-50px;"><input type="text" readonly="" value="<?php echo $FTCHsal->to_date ?>" name="tod_<?php echo $lpl; ?>" id="tod_<?php echo $lpl; ?>" style="width:100px;" <?php if($FTCHsal->to_date!=''){?> readonly="readonly" <?php } else {?> class="datepicker" <?php } ?> /></div>
										
										<div class="grid2" style="width:100px; margin-left:-50px; margin-top:6px;"><label>Salary:<span class="req"></span></label></div>
			                            <div class="grid4" style="margin-left:-50px;"><input type="text" readonly="" value="<?php echo $FTCHsal->sal_amt ?>" id="sal_amt_<?php echo $lpl; ?>"  name="sal_amt_<?php echo $lpl; ?>" style="width:100px; text-align:right;" <?php if($FTCHsal->sal_amt!='0'){?> readonly="readonly" <?php }  ?>/></div>
										<div class="clear"></div>
			                        </div>
									<div class="formRow">
			                           	<div class="grid2" style="margin-top:6px;"><label>Remarks:<span class="req"></span></label></div>
			                            <div class="grid4" style="margin-left:-50px;"><input type="text" readonly="" class="" value="<?php echo $FTCHsal->remarks ?>" name="rem_<?php echo $lpl; ?>"  id="rem_<?php echo $lpl; ?>" style="width:200px;" <?php if($FTCHsal->remarks!=''){?> readonly="readonly" <?php } ?>/></div>	                          	
			                            <div class="clear"></div>
			                        </div>
								</div>
					<?php 
								$lpl++; 
							} 
						}
					?>
					</div>
					<?php
						$SLCT = "SELECT MCC.master_cad_cat_id,MCC.cad_cat_name,ECD.fm_date,ECD.cat_hrs FROM master_cad_cat MCC,emp_cad_det ECD WHERE ECD.master_cad_cat_id = MCC.master_cad_cat_id AND ECD.emp_det_id = '$emp_id' AND ECD.updated = 'no' ORDER BY MCC.cad_cat_name ASC";
						$QURY = mysqli_query($connect,$SLCT);
						$loop=1;
						if(mysqli_num_rows($QURY)>0)
						{
					?>					
							<div class="widget"> 
								<div class="whead"><h6>Cad Time</h6><div class="clear"></div></div>
								<div id="dyn" class="hiddenpars">
									<a href="javascript:0" id="searchlink" onfocus="foc(this.id)" onblur="stnon(this.id)" class="tOptions" title="Options"><img src="images/icons/options.png" alt="" /></a>
									<div style="max-height:400px; overflow-y:auto;"> 
										<table cellpadding="0" cellspacing="0" width="100%" class="dTable check" id="checkAll">
											<thead>
											<tr>
												<th width="12%">S.No<span class="sorting" style="display: block;"></span></th>
												<th width="22%">Points</th>
												<th width="22%">From Date </th>
												<th width="22%">Time</th>            
												<th width="22%">View</th>
											</tr>
											</thead>
											<tbody>
											<?php															
												while($FTCH = mysqli_fetch_object($QURY))
												{
													$cate_id	=	base64_encode(base64_encode(base64_encode($FTCH->master_cad_cat_id)));												

													if($loop%2 != "0")
														$bg = "gradeX";
													else
														$bg = "class='gradeC'";
										?>
													<tr <?php echo $bg ?>>
														<td align="center"><?php echo $loop ?><input name="cat_id[<?php echo $loop ?>]" id="cat_id<?php echo $loop ?>" type="hidden" value="<?php echo $FTCH->master_cad_cat_id ?>" /></td>
														<td align="center"><?php echo $FTCH->cad_cat_name; ?></td>
														<td align="center"><?php echo $FTCH->fm_date; ?></td>
														<td align="center"><?php echo $FTCH->cat_hrs ?></td>
														<td align="center" >
															<a href="#login-box" onclick="redir_pg(<?php echo $emp_id.",".$FTCH->master_cad_cat_id; ?>)" class="login-window"><input type="button" class="buttonM bDefault ml10" value="Log" /></a>                  
														</td>
													</tr>
										<?php
													$loop++;
												}
											?>		
											</tbody>
										</table> 
									</div>
								</div>
							</div>
                  	<?php
                       	}
                    ?>
                </fieldset>
            </form>
        
            <form id="usualValidate" class="main" method="post" action="">
                <fieldset>
                </fieldset>
            </form>
             <div id="login-box" class="login-popup">
	            <a href="#" class="close"><img src="images/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
	            <div id="main_div" style=""></div>
	        </div>
        </div>
    </div>
</div>
<!-- Content ends -->    
        
</body>
</html>