| 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/onesolution.com.hk/onesupport/others/ |
Upload File : |
<?php
require_once(__DIR__ . '/../checkuser.php');
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php require(__DIR__ . '/../inc/_head_meta.php'); ?>
<?php require(__DIR__ . '/../inc/_head_css.php'); ?>
<style type="text/css">
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
padding-bottom: 40px;
}
</style>
<?php require(__DIR__ . '/../inc/_head_script.php'); ?>
<script type="text/javascript">
$(function () {
$('#search_btn').click(function (event) {
event.preventDefault();
$('#search_form').toggle();
});
$('.date-picker').datetimepicker({ pickTime: false });
$('.time-picker').datetimepicker({ pickDate: false, pickSeconds: false });
$('.select2').select2();
$('#search_form').validate();
});
</script>
</head>
<body>
<?php require(__DIR__ . '/../inc/_navbar.php'); ?>
<div class="container">
<?php if (isset($_GET["message"]) && !empty($_GET["message"])): ?>
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">×</button>
<h5 class="alert-heading">Note:</h5>
<p><?= $_GET["message"] ?></p>
</div>
<?php endif; ?>
<h2>Public Holiday</h2>
<a href="http://www.gov.hk/tc/about/abouthk/holiday/" target="_blank"> Hong Kong Public Holiday Reference </a>
<br><br>
<div style="padding-bottom: 50px;">
<a href="holiday_add.php?addholiday=1" class="btn btn-primary pull-right">New Holiday</a>
<?php
$sql = "SELECT * FROM sup_public_holiday WHERE year = '" . date("Y") . "' order by holiday_date ASC";
$parameters = array(0);
if (!($sth = $dbh->prepare($sql))) {
throw new Exception("sql prepare statement failure: $sql");
}
$sth->setFetchMode(PDO::FETCH_ASSOC);
if (!$sth->execute($parameters)) {
throw new Exception("sql execute statement failure: $sql");
}
$holiday = $sth->fetchAll();
?>
<form action="holiday_modify.php" id="holiday_<?= $date["id"] ?>" name="holiday_<?= $date["id"] ?>" method="post" enctype="multipart/form-data">
<table class="table table-striped">
<thead>
<tr>
<th style="width: 400px;">Date</th>
<th>Remarks</th>
</tr>
</thead>
<tbody>
<?php
foreach ($holiday as $date){
?>
<tr>
<td>
<input type="hidden" name="holiday_id[]" value="<?= $date["id"] ?>"/>
<div class="controls" style="padding: 0;margin: 0;">
<div class="input-append date-picker">
<input type="text" id="holiday_date" name="holiday_date[<?= $date["id"] ?>]" value="<?= h(Util::value_to_date_string($date["holiday_date"])) ?>" class="dateISO" data-format="yyyy-MM-dd" placeholder="Date"/>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
</span>
</div>
</div>
</td>
<td>
<textarea name="remarks[<?= $date["id"] ?>]" class="span9"><?= $date["remarks"] ?></textarea>
<span class="btn" onclick="var r=confirm('Are you sure to delete this holiday date (<?= $date["holiday_date"] ?>)?');
if (r==true)
{
top.location.href='holiday_modify.php?delete_holiday=1&holiday_id=<?= $date["id"] ?>';
}
; "><i class="icon-remove"></i></span>
</td>
</form>
</tr>
<?php
}
?>
<tr>
<td colspan="2" style="text-align: center;">
<button type="submit" class="btn btn-primary">Save</button>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>