| 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/staff/ |
Upload File : |
<?php
include_once '../include/DBConnect.php';
$search = "";
$name = "";
if (isset($_GET['search'])) {
$search = $_GET['search'];
$name = $search['Staff_ID'];
if ($name != "") {
$query = "SELECT root_id FROM `staff` WHERE concat(last_name,' ',first_name,'(',ch_name,')') Like '%$name%'";
$result = $dbh->prepare($query);
$result->execute();
if ($ResultSet = $result->fetch(PDO::FETCH_ASSOC)) {
//var_dump($ResultSet['root_id']);
$RootID = $ResultSet['root_id'];
};
}
}
if (isset($_GET['root_id'])) {
$RootID = $_GET['root_id'];
$query = 'SELECT CONCAT( last_name, " ", first_name, "(", ch_name, ")" ) AS name FROM staff WHERE deleted =0 and root_id=' . $RootID . ' GROUP BY name';
$result = $dbh->prepare($query);
$result->execute();
if ($ResultSet = $result->fetch(PDO::FETCH_ASSOC)) {
$name = $ResultSet['name'];
};
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="js/select2/select2.css" rel="stylesheet"/>
<script src="js/select2/select2.js"></script>
<?php require_once '../include/head.php'; ?>
<?php require_once '../include/checkuser.php'; ?>
<?php require_once '../include/Nav_bar.php'; ?>
<script>
$(document).ready(function() {
$('div input').height(20);
$('.date-picker').datetimepicker({pickTime: false});
$("#myselect").select2({
placeholder: "Select a Name",
minimumInputLength: 2,
allowClear: true
});
$("#myselect").on("select2-selecting", function(e) {
//alert("selecting val=" + e.val);
$('#Staff_ID').val(e.val);
});
$(function() {
$('#myselect').select2().select2('val', '<?= $name ?>');
$('#Staff_ID').val('<?= $name ?>');
});
});
</script>
</head>
<body>
<div class="text-right">
<ul class="breadcrumb">
<!--<li><a href="#">Master</a> <span class="divider">></span></li>-->
<li><a href="index.php">Staff</a> <span class="divider">></span></li>
<li class="active">Staff Salary History</li>
</ul>
</div>
<div class="container-fluid pathways-container">
<a class="btn pull-right" <?= ($name != "") ? 'href="historyfrom.php?root_id=' . $RootID . '&action=Insert"' : 'disabled="disabled"' ?> ><i class="icon-plus"></i>Add</a>
<h2>Staff Salary History</h2>
<div class="pathways-search">
<form id="search_form" class="form-inline" action="" method="">
<div class="pathways-inline-block">
Search by Name:
<select id="myselect" style="width:300px">
<option value=""></option>
<?php
$query = 'SELECT CONCAT( last_name, " ", first_name, "(", ch_name, ")" ) AS name FROM staff WHERE deleted =0 GROUP BY name';
$result = $dbh->prepare($query);
$result->execute();
while ($ResultSet = $result->fetch(PDO::FETCH_ASSOC)) {
?>
<option value="<?= $ResultSet['name'] ?>"><?= $ResultSet['name'] ?></option>
<?php
}
?>
</select>
</div>
<div class="pathways-inline-block">
<input type="hidden" id="Staff_ID" name="search[Staff_ID]" value="0" />
<button type="submit" class="btn" style="margin-left:30px">GO</button>
</div>
</form>
</div>
<form id="form" action="" method="post">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<!-- <th style="min-width:130px; width:50px">View</th>-->
<th style="min-width:50px; width:50px">Edit</th>
<th>CreateDate</th>
<th>Position</th>
<th>Salary</th>
<th>Rate1</th>
<th>Rate2</th>
<th>Rate3</th>
<th>Rate4</th>
<th>Rate5</th>
<th>Rate6</th>
<!-- <th>AdminEdit</th>-->
</tr>
</thead>
<tbody>
<?php
if (isset($RootID)) {
$query = "SELECT sh.*,p.position_name FROM staff_salary_history sh,position p WHERE sh.staff_id = '$RootID' AND sh.deleted = '0' and sh.position_id = p.position_id order by `version`";
//$query = "SELECT * FROM `staff_salary_history` WHERE `staff_id` = '$staff_id' AND `deleted` = '$deleted' order by `version`"; //
$result = $dbh->prepare($query);
$result->execute();
while ($ResultSet = $result->fetch(PDO::FETCH_ASSOC)) {
?>
<tr>
<td><a href="historyfrom.php?root_id=<?= $ResultSet['staff_id'] ?>&action=Edit&version=<?= $ResultSet['version'] ?>" class="btn">Edit</a></td>
<td><?= substr($ResultSet['createdate'], 0, 10) ?></td>
<td><?= $ResultSet['position_name'] ?></td>
<td><?= $ResultSet['salary'] ?></td>
<td><?= $ResultSet['rate1'] ?></td>
<td><?= $ResultSet['rate2'] ?></td>
<td><?= $ResultSet['rate3'] ?></td>
<td><?= $ResultSet['rate4'] ?></td>
<td><?= $ResultSet['rate5'] ?></td>
<td><?= $ResultSet['rate6'] ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</form>
</div>
</body>
</html>