| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/(Del)pathways.org.hk/MIS20140127/old20140407/Payroll/ |
Upload File : |
<!DOCTYPE html>
<?php require_once 'PayRoll_Sql.php'; ?>
<?php
// ### User click search button ### //
if (isset($_GET['search'])) {
$start = $_GET['search']['start_date'];
$end = $_GET['search']['end_date'];
$sth = Search_daterange($start, $end);
$staff_array = array();
while ($ResultSet = $sth->fetch(PDO::FETCH_ASSOC)) {
array_push($staff_array, $ResultSet);
}
}
?>
<html>
<head>
<?php require_once '../include/head.php'; ?>
<?php require_once '../include/checkuser.php'; ?>
<?php require_once '../include/Nav_bar.php'; ?>
<script>
$(function() {
$("#start_date").datetimepicker({autoclose: true, pickTime: false, format: 'yyyy-MM-dd'})
$("#end_date").datetimepicker({autoclose: true, pickTime: false, format: 'yyyy-MM-dd'})
$('#start_date').datetimepicker().on('changeDate', function(ev) {
date = new Date($('#start_date_input').val());
$('#end_date').datetimepicker('setStartDate', date);
$('#end_date').datetimepicker('setDate', date);
$('#end_date').datetimepicker('show');
$('#start_date').datetimepicker('hide');
$('#end_date').datetimepicker('remove');
});
$('#end_date').datetimepicker().on('changeDate', function(ev) {
$('#end_date').datetimepicker('hide');
});
});
</script>
<style>
.div-search{
margin: 0;
padding: 5px 10px;
background-color: #F7F7F7;
border: 1px solid #E6E6E6;
border-radius: 5px;
box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
</style>
</head>
<body>
<div class="text-right">
<ul class="breadcrumb">
<li class="active">Payroll Generate List</li>
</ul>
</div>
<div class="container-fluid pathways-container">
<h3>Payroll Generate</h3>
<form class="form-inline" action="" method="get" autocomplete="off">
<div class="div-search">
<!-- ### Search Date ### -->
<table style="margin: 10px 10px 10px 10px;">
<tr>
<!-- ### Start Date ### -->
<td style="padding-top: 5px;"><label for="start_date">Start Date</label></td>
<td style="width: 15px;"></td>
<td>
<div id="start_date" class="input-append date form_datetime datetime_picker">
<input type="text" id="start_date_input" name="search[start_date]" value="<?= (isset($_GET['search'])) ? ($_GET['search']['start_date']) : "" ?>" />
<span class="add-on"><i class="icon-calendar"></i></span>
</div>
</td>
<td style="width: 30px;"></td>
<!-- ### End Date ### -->
<td style="padding-top: 5px;"><label for="">End Date</label></td>
<td style="width: 10px;"></td>
<td>
<div id="end_date" class="input-append date form_datetime datetime_picker">
<input type="text" id="end_date_input" name="search[end_date]" value="<?= (isset($_GET['search'])) ? ($_GET['search']['end_date']) : "" ?>"/>
<span class="add-on"><i class="icon-calendar"></i></span>
</div>
</td>
<td style="width: 30px;"></td>
<!-- ### Search Button ### -->
<td><button type="submit" class="btn" name="search['search_button']">Search</button></td>
</tr>
</table>
</div>
</form>
<div style="height: 15px;"></div>
<!-- ### ↓submit search && ↓User have input start date && ↓ User have input start date ### -->
<?php if (isset($_GET['search']) && !empty($_GET['search']['start_date']) && !empty($_GET['search']['end_date'])) { ?>
<form action="PayRoll_Generate_From.php" method="post" autocomplete="off">
<input type="hidden" name="startdate" value="<?= $start ?>"/>
<input type="hidden" name="enddate" value="<?= $end ?>" />
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<th style="width: 90px;">Generate</th>
<th style="width: 100px">Staff Code</th>
<th>Staff Name</th>
</tr>
</thead>
<tbody>
<?php if (!empty($staff_array)) { ?>
<?php foreach ($staff_array as $array) { ?>
<tr>
<td><button type="submit" name="root_id" class="btn" value="<?= $array['root_id'] ?>">Generate</button></td>
<td><?= $array['staff_code'] ?></td>
<td><?= $array['staffname'] ?> ( <?= $array['ch_name'] ?> )</td>
</tr>
<?php } ?>
<?php } else { ?>
<?php if (isset($_GET['back'])) echo '<script>location.href = \"PayRoll_List.php\";</script>'; ?>
<tr>
<td colspan="3"> No Payroll Generate !!</td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
<?php } ?>
</div> <!-- /container -->
</body>
</html>