Index of /home/htscrtms/newcrm.htshah.com/hslider
<?php
include('lib/db_connect.php');
include('lib/auth.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
<title>HT Shah</title>
<link rel="icon" type="image/x-icon" href="assets/img/favicon.ico"/>
<link href="assets/css/loader.css" rel="stylesheet" type="text/css" />
<script src="assets/js/loader.js"></script>
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="assets/css/plugins.css" rel="stylesheet" type="text/css" />
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL STYLES -->
<link rel="stylesheet" type="text/css" href="plugins/table/datatable/datatables.css">
<link rel="stylesheet" type="text/css" href="plugins/table/datatable/dt-global_style.css">
<!-- END PAGE LEVEL STYLES -->
</head>
<body>
<?php include("header.php"); ?>
<!-- BEGIN NAVBAR -->
<div class="sub-header-container">
<header class="header navbar navbar-expand-sm">
<a href="javascript:void(0);" class="sidebarCollapse" data-placement="bottom"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></a>
<ul class="navbar-nav flex-row">
<li>
<div class="page-header">
<nav class="breadcrumb-one" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0);">Admin</a></li>
<li class="breadcrumb-item active" aria-current="page"><span>Attendance Listing</span></li>
</ol>
</nav>
</div>
</li>
</ul>
</header>
</div>
<!-- END NAVBAR -->
<!-- BEGIN MAIN CONTAINER -->
<div class="main-container" id="container">
<?php include("sidebar-wrapper.php"); ?>
<!-- BEGIN CONTENT AREA -->
<div id="content" class="main-content">
<div class="layout-px-spacing">
<div class="row layout-top-spacing">
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
<div class="statbox widget box box-shadow">
<div class="widget-header">
<div class="row">
<div class="col-xl-12 col-md-12 col-sm-12 col-12">
<h4>Attendance Listing <a href="add_attendance.php" class="btn btn-info" style="float:right;">Add Attendance</a></h4>
</div>
</div>
</div>
<div class="widget-content widget-content-area br-6">
<form action="" method="POST" style="margin-top:20px;">
<div class="row">
<div class="col-md-4">
<div class="form-group"> <label>Select Principal Company</label>
<select class="form-control" name="officeId" required>
<!--<option value="2">Air Cargo Complex</option>-->
<option value="1" selected="selected">Wadala</option>
<option value="3">JNPT</option>
</select>
</div>
</div>
<div class="col-md-3">
<div class=""> <label>Start Date (yyyy-mm-dd)</label>
<input type="date" class="form-control" name="startdt" id="startdt" placeholder="Enter Start Date (yyyy-mm-dd)" required>
</div>
</div>
<div class="col-md-3">
<div class=""> <label>End Date (yyyy-mm-dd)</label>
<input type="date" class="form-control" name="enddt" id="enddt" placeholder="Enter End Date (yyyy-mm-dd)" required>
</div>
</div>
<div class="col-md-2" style="margin-top:30px;">
<div class="form-group">
<input name="submit" class="btn btn-primary" type="submit" value="Submit"/>
</div>
</div>
</div>
</form>
<?php
$fromDate=date('d',strtotime($_REQUEST['startdt']));
$toDate=date('d',strtotime($_REQUEST['enddt']));
$month=date('m',strtotime($_REQUEST['enddt']));
$year=date('Y',strtotime($_REQUEST['enddt']));
$date1=date_create($_REQUEST['startdt']);
$date2=date_create($_REQUEST['enddt']);
$diff=date_diff($date1,$date2);
$days_count = $diff->days;
?>
<?php if(isset($_SESSION['seln']) && $_SESSION['seln']=="Superadmin" || $_SESSION["name"]=="Vijaya Moopanar"){ ?>
<a href="attendance_dwnld.php?officeId=<?php echo $_REQUEST['officeId'];?>&startdt=<?php echo $_REQUEST['startdt'];?>&enddt=<?php echo $_REQUEST['enddt'];?>" class="btn btn-primary" style="margin-bottom:25px;">Download To Excel</a>
<?php } ?>
<table id="zero-config" class="table dt-table-hover" style="width:100%">
<thead>
<tr>
<th>Sr.</th>
<th>Emp Name</th>
<?php
//echo $month ;echo 'dates===='.$dates.'$fromDate=='.$fromDate;
// echo $sel;
for($qi=0;$qi<=$days_count;$qi++){
// echo date('d-m-Y' ,strtotime("+".$i." day"))."<br>";
$day = date("Y-m-d", strtotime($_REQUEST['startdt'] . '+ '.$qi.'days'));
// $day = date("Y-m-d", strtotime($_REQUEST['startdt'], "+" . $qi . " days"));
// print_r($qi . " = " . $day);
// $day = $year.'/'.$month.'/'.$qi;
$dName = date('d', strtotime($day));
$result = date("l", strtotime($day));
if($result == "Sunday"){
?> <th bgcolor="#FF0000" class="text-center"><?php echo $dName;?></th>
<?php
}else{ ?>
<th class="text-center"><?php echo $dName;?></th>
<?php
}
}
?>
<th>Totalc</th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
$reg_sel = "select * from `tabl_attendance` where officeId ='".$_REQUEST["officeId"]."' && att_date >= '".$_REQUEST['startdt']."' && att_date <= '".$_REQUEST['enddt']."' group by clientId order by att_date desc";
$reg_quer = mysqli_query($con,$reg_sel) or die(mysqli_error($con));
while($fetcharr = mysqli_fetch_array($reg_quer))
{
$i++;
if(isset($_SESSION['seln']) && $_SESSION['seln']=="Superadmin" || $_SESSION["name"]=="Vijaya Moopanar"){
$selc="select * from `tabl_employees` where id='".$fetcharr['clientId']."'";
}else{
$selc="select * from `tabl_employees` where id='".$fetcharr['clientId']."' && userName='".$_SESSION["name"]."'";
}
$qryc=mysqli_query($con,$selc) or die(mysqli_error($con));
$rowc=mysqli_fetch_array($qryc);
?>
<tr>
<td><?php echo $i?></td>
<td><a href="edit_attendance.php?id=<?php echo $fetcharr['id'];?>"><?php echo $rowc['firstName'];?></a></td>
<?php
for($j=0;$j<=$days_count;$j++)
{
$queryDate = date("Y-m-d", strtotime($_REQUEST['startdt'] . '+ '.$j.'days'));
$resultq = date("l", strtotime($queryDate));
$sqlGetRow="Select * from tabl_attendance where clientId ='".$rowc["id"]."' and att_date='$queryDate'";
$queryGetRow=mysqli_query($con,$sqlGetRow);
$dataRow=mysqli_fetch_assoc($queryGetRow);
if($resultq == "Sunday") {
?>
<td bgcolor="#FF0000"></td>
<?php } else {?>
<td bgcolor="<?php if($dataRow['att_status']=="P"){ echo "green"; }elseif($dataRow['att_status']=="LM"){ echo "orange"; }elseif($dataRow['att_status']=="CL"){ echo "yellow"; }elseif($dataRow['att_status']=="HD"){ echo "blue"; }elseif($dataRow['att_status']=="H"){ echo "#9B9BFF"; } ?>" class="text-white text-center"><strong><?php echo $dataRow['att_status'];?></strong></td>
<?php }
}
$tRow="Select count(*) as tcount from tabl_attendance where clientId ='".$rowc["id"]."' && att_status in ('P','LM','HD')";
$qtRow=mysqli_query($con,$tRow);
$dtRow=mysqli_fetch_assoc($qtRow);
?>
<td><?php echo $dtRow['tcount']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php include("footer.php"); ?>
</div>
<!-- END CONTENT AREA -->
</div>
<!-- END MAIN CONTAINER -->
<!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
<script src="assets/js/libs/jquery-3.1.1.min.js"></script>
<script src="bootstrap/js/popper.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
<script src="assets/js/app.js"></script>
<script>
$(document).ready(function() {
App.init();
});
</script>
<script src="assets/js/custom.js"></script>
<!-- END GLOBAL MANDATORY SCRIPTS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="plugins/table/datatable/datatables.js"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<style>
.table > thead > tr > th,.table > tbody > tr > td {
padding:5px 0 6px 0;
}
</style>
</body>
</html>