| 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('../inc/configure.php');
session_start();
if(!empty($_SESSION['webadmin'])){
$nowdate = date("Y-m-d H:i:s");
$holiday_ids = $_POST["holiday_id"];
$remarks= $_POST["remarks"];
$holiday_dates= $_POST["holiday_date"];
foreach($holiday_ids as $holiday_id){
$sql = "update sup_public_holiday set holiday_date=?, remarks=?, lastupdate=?, lastupby=? where id=?";
$parameters = array($holiday_dates[$holiday_id],$remarks[$holiday_id],$nowdate,$_SESSION['webadmin']['id'],$holiday_id);
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");
}
}
//delete this holiday
if(isset($_GET["delete_holiday"]) && $_GET["delete_holiday"] == 1){
$holiday_id = (int)$_GET["holiday_id"];
$sql = "delete from sup_public_holiday where id = ?";
$parameters = array($holiday_id);
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");
}
header("Location: holiday_index.php" );
}
header("Location: holiday_index.php" );
}
?>