You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
3.0 KiB
71 lines
3.0 KiB
<?php
|
|
include "../header.php";
|
|
require_once './wf_common.php';
|
|
if(isset($_POST['update'])) {
|
|
|
|
function user_input( $data ) {
|
|
$data1 = trim($data);
|
|
$data2 = stripslashes($data1);
|
|
$data3 = htmlspecialchars($data2);
|
|
return $data3;
|
|
}
|
|
|
|
/***此段以下由系統自動產生
|
|
$id = $_POST['id'];
|
|
$creater = user_input($_POST["creater"]);
|
|
$create_at = date('Y/m/d H:i:s');
|
|
***/
|
|
$id = $_POST["id"];
|
|
$application_no = user_input($_POST["application_no"]);
|
|
$leave_staff_id = user_input($_POST["leave_staff_id"]);
|
|
$day_off_type = user_input($_POST["day_off_type"]);
|
|
$start_date = user_input($_POST["start_date"]);
|
|
$end_date = user_input($_POST["end_date"]);
|
|
$substitute_id = user_input($_POST["substitute_id"]);
|
|
$reason = user_input($_POST["reason"]);
|
|
$creater = user_input($_POST["creater"]);
|
|
$create_at = date("Y/m/d H:i:s");
|
|
|
|
|
|
/***此段以下由系統自動產生
|
|
$db_query = "UPDATE contract set contracttype = '$contracttype', contractno = '$contractno', company = '$company', taxid = '$taxid', address = '$address', tel = '$tel', promiser = '$promiser', customerid = '$customerid', contractperson = '$contractperson', contractaddress = '$contractaddress', contracttel = '$contracttel', contractemail = '$contractemail', contract_employee = '$contract_employee',start_date = '$start_date',end_date = '$end_date',create_at = '$create_at' WHERE id='$id'";
|
|
***/
|
|
$db_query = "UPDATE day_off set application_no = '$application_no', leave_staff_id = '$leave_staff_id', day_off_type = '$day_off_type', start_date = '$start_date', end_date = '$end_date', substitute_id = '$substitute_id', reason = '$reason', creater = '$creater', create_at = '$create_at' WHERE id='$id'";
|
|
|
|
|
|
mysqli_query($link, $db_query);
|
|
$affected = mysqli_affected_rows($link);
|
|
mysqli_close($link);
|
|
if ($affected > 0) {
|
|
$request = $_SERVER['REOUEST METHOD'] == "GET" ? $_GET : $_POST;
|
|
$flow = new Flow($request['form_key']);
|
|
/*** Front nodal point start ***/
|
|
$wf = new workFlow($flow->system_id, $flow->flow_id, $flow->form_id, $request['form_key']);
|
|
|
|
$wf->setFormData($request);
|
|
$wf->submit($request['next users'], $request['assign status'], $request['assign opinion']);
|
|
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('update成功');";
|
|
|
|
/***此段以下由系統自動產生
|
|
echo "location.href='contract-index.php?function_name=contract&".$token_link."';";
|
|
***/
|
|
echo "location.href='day_off-index.php?function_name=day_off&".$token_link."';";
|
|
|
|
echo "</script>";
|
|
} elseif ($affected == 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('無新增資料');";
|
|
|
|
/***此段以下由系統自動產生
|
|
echo "location.href='contract-index.php?function_name=contract&".$token_link."';";
|
|
***/
|
|
echo "location.href='day_off-index.php?function_name=day_off&".$token_link."';";
|
|
|
|
echo "</script>";
|
|
} else {
|
|
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link);
|
|
}
|
|
}
|
|
?>
|