13 changed files with 28041 additions and 11112 deletions
@ -1,212 +1,218 @@ |
|||||
<?php |
<?php |
||||
class IncludeCommon |
class IncludeCommon |
||||
{ |
{ |
||||
function CheckToken($token) { |
function CheckToken($token) |
||||
date_default_timezone_set("Asia/Taipei"); |
{ |
||||
$encryption_code = "MASADA!^***"; |
date_default_timezone_set("Asia/Taipei"); |
||||
$time = date("Y-m-d H:i:s"); |
$encryption_code = "MASADA!^***"; |
||||
|
$time = date("Y-m-d H:i:s"); |
||||
if (!isset($token) || empty($token)) { |
|
||||
$data['code'] = '400'; |
if (!isset($token) || empty($token)) { |
||||
$data['message'] = '非法请求'; |
$data['code'] = '400'; |
||||
return $data; |
$data['message'] = '非法请求'; |
||||
} |
return $data; |
||||
//对比token |
} |
||||
$explode = explode('.', $token); //以.分割token为数组 |
//对比token |
||||
if (!empty($explode[0]) && !empty($explode[1]) && !empty($explode[2]) && !empty($explode[3]) && !empty($explode[4])) { |
$explode = explode('.', $token); //以.分割token为数组 |
||||
$info = $explode[0] . '.' . $explode[1] . '.' . $explode[2] . '.' . $explode[3]; //信息部分 |
if (!empty($explode[0]) && !empty($explode[1]) && !empty($explode[2]) && !empty($explode[3]) && !empty($explode[4])) { |
||||
$true_signature = hash_hmac('md5', $info, $encryption_code); //正确的签名 |
$info = $explode[0] . '.' . $explode[1] . '.' . $explode[2] . '.' . $explode[3]; //信息部分 |
||||
if ($time > $explode[3]) { |
$true_signature = hash_hmac('md5', $info, $encryption_code); //正确的签名 |
||||
$data['user_id'] = ''; |
if ($time > $explode[3]) { |
||||
$data['code'] = '401'; |
$data['user_id'] = ''; |
||||
$data['message'] = 'Token已过期,请重新登录'; |
$data['code'] = '401'; |
||||
return $data; |
$data['message'] = 'Token已过期,请重新登录'; |
||||
} |
return $data; |
||||
if (($true_signature == $explode[4])) { |
} |
||||
$data['user_id'] = $explode[0]; |
if (($true_signature == $explode[4])) { |
||||
$data['code'] = '200'; |
$data['user_id'] = $explode[0]; |
||||
$data['message'] = 'Token合法'; |
$data['code'] = '200'; |
||||
return $data; |
$data['message'] = 'Token合法'; |
||||
} else { |
return $data; |
||||
$data['user_id'] = ''; |
} else { |
||||
$data['code'] = '400'; |
$data['user_id'] = ''; |
||||
$data['message'] = 'Token不合法'; |
$data['code'] = '400'; |
||||
return $data; |
$data['message'] = 'Token不合法'; |
||||
} |
return $data; |
||||
} else { |
} |
||||
$data['user_id'] = ''; |
} else { |
||||
$data['code'] = '400'; |
$data['user_id'] = ''; |
||||
$data['message'] = 'Token不合法'; |
$data['code'] = '400'; |
||||
return $data; |
$data['message'] = 'Token不合法'; |
||||
} |
return $data; |
||||
} |
} |
||||
//生成登录记录 |
} |
||||
function save_log_response($source_flag='web', $account, $response_result){ |
//生成登录记录 |
||||
# 储存纪录并输出 |
function save_log_response($account, $response_result, $source_flag = 'web') |
||||
#echo date("Y-m-d"); |
{ |
||||
$file_path = "account_log/" . $account . "-" . date("Y-m-d") . ".ini"; |
# 储存纪录并输出 |
||||
$data = serialize($response_result). date("H:i:s") . "\n"; |
#echo date("Y-m-d"); |
||||
$fp = fopen($file_path,"a"); # 如果档案不存在择尝试建立再写入 |
$file_path = "account_log/" . $account . "-" . date("Y-m-d") . ".ini"; |
||||
fwrite($fp, $data); |
$data = serialize($response_result) . date("H:i:s") . "\n"; |
||||
fclose($fp); |
$fp = fopen($file_path, "a"); # 如果档案不存在择尝试建立再写入 |
||||
if ($source_flag == "web"){ |
fwrite($fp, $data); |
||||
// header("Location: custom-create.php?function_list=" . serialize($response_result) . |
fclose($fp); |
||||
// "&token=" . $response_result["token"]); #请输入使用者名称密码 |
if ($source_flag == "web") { |
||||
// exit(); |
// header("Location: custom-create.php?function_list=" . serialize($response_result) . |
||||
return true; |
// "&token=" . $response_result["token"]); #请输入使用者名称密码 |
||||
}else{ |
// exit(); |
||||
// echo json_encode($response_result, JSON_UNESCAPED_UNICODE); |
return true; |
||||
return false; |
} else { |
||||
} |
// echo json_encode($response_result, JSON_UNESCAPED_UNICODE); |
||||
|
return false; |
||||
/* |
} |
||||
if ($source_flag == "app"){ |
|
||||
echo json_encode($response_result, JSON_UNESCAPED_UNICODE); |
/* |
||||
}elseif ($source_flag == "web"){ |
if ($source_flag == "app"){ |
||||
header("Location: api-account-reply-functions.php?function_list=" . serialize($response_result) . |
echo json_encode($response_result, JSON_UNESCAPED_UNICODE); |
||||
"&token=" . $response_result["token"]); #请输入使用者名称密码 |
}elseif ($source_flag == "web"){ |
||||
exit(); |
header("Location: api-account-reply-functions.php?function_list=" . serialize($response_result) . |
||||
} |
"&token=" . $response_result["token"]); #请输入使用者名称密码 |
||||
*/ |
exit(); |
||||
} |
} |
||||
|
*/ |
||||
//生成token |
} |
||||
function CreateToken($user_id, $user_name) { |
|
||||
date_default_timezone_set("Asia/Taipei"); |
//生成token |
||||
$start_time = date("Y-m-d H:i:s"); |
function CreateToken($user_id, $user_name) |
||||
$end_time = date('Y-m-d H:i:s',strtotime('+24 hour')); #设定24小时 |
{ |
||||
$info = $user_id . '.' . base64_encode(urlencode($user_name)) . '.' . $start_time . '.' . $end_time; //设置token过期时间为一天 |
date_default_timezone_set("Asia/Taipei"); |
||||
$encryption_code = "MASADA!^***"; |
$start_time = date("Y-m-d H:i:s"); |
||||
//根据以上信息信息生成签名(密钥为 SIGNATURE 自定义全局常量) |
$end_time = date('Y-m-d H:i:s', strtotime('+24 hour')); #设定24小时 |
||||
$signature = hash_hmac('md5', $info, $encryption_code); |
$info = $user_id . '.' . base64_encode(urlencode($user_name)) . '.' . $start_time . '.' . $end_time; //设置token过期时间为一天 |
||||
//最后将这两部分拼接起来,得到最终的Token字符串 |
$encryption_code = "MASADA!^***"; |
||||
return $token = $info . '.' . $signature; |
//根据以上信息信息生成签名(密钥为 SIGNATURE 自定义全局常量) |
||||
} |
$signature = hash_hmac('md5', $info, $encryption_code); |
||||
//生成菜单 |
//最后将这两部分拼接起来,得到最终的Token字符串 |
||||
|
return $token = $info . '.' . $signature; |
||||
/** |
} |
||||
* 將模擬帳號寫入token |
//生成菜单 |
||||
*/ |
|
||||
function FakeToken($fake_user_id, $token) { |
/** |
||||
date_default_timezone_set("Asia/Taipei"); |
* 將模擬帳號寫入token |
||||
$encryption_code = "MASADA!^***"; |
*/ |
||||
$time = date("Y-m-d H:i:s"); |
function FakeToken($fake_user_id, $token) |
||||
$explode = explode('.', $token); |
{ |
||||
$info = $fake_user_id . '.' . $explode[1] . '.' . $explode[2] . '.' . $explode[3]; // 欲模擬帳號.本人帳號.有效開始時間.失效時間 |
date_default_timezone_set("Asia/Taipei"); |
||||
$signature = hash_hmac('md5', $info, $encryption_code); |
$encryption_code = "MASADA!^***"; |
||||
return $token = $info . '.' . $signature; |
$time = date("Y-m-d H:i:s"); |
||||
} |
$explode = explode('.', $token); |
||||
|
$info = $fake_user_id . '.' . $explode[1] . '.' . $explode[2] . '.' . $explode[3]; // 欲模擬帳號.本人帳號.有效開始時間.失效時間 |
||||
function menu ($from='tw',$type){ |
$signature = hash_hmac('md5', $info, $encryption_code); |
||||
$function_type = array( |
return $token = $info . '.' . $signature; |
||||
"tw" => array( |
} |
||||
# F角色菜单 |
|
||||
"F" => array( |
function menu($type, $from = 'tw') |
||||
"language" => "tw", |
{ |
||||
"type" => "manage", |
$function_type = array( |
||||
"list" => array( |
"tw" => array( |
||||
array("name" => "批量导入", "path" => "http://192.168.0.12/wms/excel-upload"), |
# F角色菜单 |
||||
), |
"F" => array( |
||||
"note" => "none", |
"language" => "tw", |
||||
"token" => "" |
"type" => "manage", |
||||
), |
"list" => array( |
||||
) |
array("name" => "批量导入", "path" => "http://192.168.0.12/wms/excel-upload"), |
||||
); |
), |
||||
|
"note" => "none", |
||||
|
"token" => "" |
||||
return $function_type[$from][$type]; |
), |
||||
|
) |
||||
} |
); |
||||
|
|
||||
/** |
|
||||
* 依帳號類別檢視功能目錄 |
return $function_type[$from][$type]; |
||||
*/ |
} |
||||
function menu_v2($atype="") { |
|
||||
global $link; |
/** |
||||
|
* 依帳號類別檢視功能目錄 |
||||
if (!$atype) return; |
*/ |
||||
$sql = "select main_menu, sub_menu, sub_menu_eng, mlink from menu where accounttype = '$atype' and status = 'Y' order by main_menu_seq, sub_menu_seq"; |
function menu_v2($atype = "") |
||||
$res = mysqli_query($link, $sql); |
{ |
||||
while ($row = mysqli_fetch_assoc($res)) { |
global $link; |
||||
$arr[$row["main_menu"]][$row["sub_menu"]][$row["sub_menu_eng"]] = $row["mlink"]; |
|
||||
} |
if (!$atype) return; |
||||
mysqli_free_result($res); |
$sql = "select main_menu, sub_menu, sub_menu_eng, mlink from menu where accounttype = '$atype' and status = 'Y' order by main_menu_seq, sub_menu_seq"; |
||||
$str = json_encode($arr, JSON_UNESCAPED_UNICODE); |
$res = mysqli_query($link, $sql); |
||||
return $str; |
while ($row = mysqli_fetch_assoc($res)) { |
||||
} |
$arr[$row["main_menu"]][$row["sub_menu"]][$row["sub_menu_eng"]] = $row["mlink"]; |
||||
|
} |
||||
/** |
mysqli_free_result($res); |
||||
* 依帳號檢視功能目錄 |
$str = json_encode($arr, JSON_UNESCAPED_UNICODE); |
||||
* 管理者可看到全部選單 |
return $str; |
||||
* 其餘人員依account_auth決定可檢視的選單 |
} |
||||
*/ |
|
||||
function menu_v3($aid="", $accounttype) { |
/** |
||||
global $link; |
* 依帳號檢視功能目錄 |
||||
|
* 管理者可看到全部選單 |
||||
if (!$aid) return; |
* 其餘人員依account_auth決定可檢視的選單 |
||||
$str = ""; |
*/ |
||||
$arr = $menu_arr = []; |
function menu_v3($accounttype, $aid = "") |
||||
|
{ |
||||
$sql_cmd = ($accounttype == "E") ? "" : "where status = 'Y'"; |
global $link; |
||||
$sql = "select main_menu, sub_menu, sub_menu_eng, mlink from menu $sql_cmd order by main_menu_seq, sub_menu_seq"; |
|
||||
|
if (!$aid) return; |
||||
$res = mysqli_query($link, $sql); |
$str = ""; |
||||
while ($row = mysqli_fetch_assoc($res)) { |
$arr = $menu_arr = []; |
||||
$menu_arr[$row["mlink"]]["main_menu"] = $row["main_menu"]; |
|
||||
$menu_arr[$row["mlink"]]["sub_menu"] = $row["sub_menu"]; |
$sql_cmd = ($accounttype == "E") ? "" : "where status = 'Y'"; |
||||
$menu_arr[$row["mlink"]]["sub_menu_eng"] = $row["sub_menu_eng"]; |
$sql = "select main_menu, sub_menu, sub_menu_eng, mlink from menu $sql_cmd order by main_menu_seq, sub_menu_seq"; |
||||
} |
|
||||
mysqli_free_result($res); |
$res = mysqli_query($link, $sql); |
||||
|
while ($row = mysqli_fetch_assoc($res)) { |
||||
$sql = "select permission from account_auth where accountid = '$aid'"; |
$menu_arr[$row["mlink"]]["main_menu"] = $row["main_menu"]; |
||||
$res = mysqli_query($link, $sql); |
$menu_arr[$row["mlink"]]["sub_menu"] = $row["sub_menu"]; |
||||
$row = mysqli_fetch_row($res); |
$menu_arr[$row["mlink"]]["sub_menu_eng"] = $row["sub_menu_eng"]; |
||||
$permission = empty($row)? json_encode([]): $row[0]; // $permission = $row[0]; //P0044 修改于2023/6/13 16:30 |
} |
||||
|
mysqli_free_result($res); |
||||
$permission_arr = json_decode($permission, true); |
|
||||
foreach ($menu_arr as $key => $val) { |
$sql = "select permission from account_auth where accountid = '$aid'"; |
||||
if (($accounttype == "E") || !empty($permission_arr[$key])) { |
$res = mysqli_query($link, $sql); |
||||
$arr[$val["main_menu"]][$val["sub_menu"]][$val["sub_menu_eng"]] = $key; |
$row = mysqli_fetch_row($res); |
||||
} |
$permission = empty($row) ? json_encode([]) : $row[0]; // $permission = $row[0]; //P0044 修改于2023/6/13 16:30 |
||||
} |
|
||||
if (!empty($arr)) $str = json_encode($arr, JSON_UNESCAPED_UNICODE); |
$permission_arr = json_decode($permission, true); |
||||
/* |
foreach ($menu_arr as $key => $val) { |
||||
if ($permission_arr) { |
if (($accounttype == "E") || !empty($permission_arr[$key])) { |
||||
foreach ($menu_arr as $key => $val) { |
$arr[$val["main_menu"]][$val["sub_menu"]][$val["sub_menu_eng"]] = $key; |
||||
if ($permission_arr[$key]) { |
} |
||||
$arr[$val["main_menu"]][$val["sub_menu"]][$val["sub_menu_eng"]] = $key; |
} |
||||
} |
if (!empty($arr)) $str = json_encode($arr, JSON_UNESCAPED_UNICODE); |
||||
} |
/* |
||||
if (!empty($arr)) $str = json_encode($arr, JSON_UNESCAPED_UNICODE); |
if ($permission_arr) { |
||||
} |
foreach ($menu_arr as $key => $val) { |
||||
*/ |
if ($permission_arr[$key]) { |
||||
mysqli_free_result($res); |
$arr[$val["main_menu"]][$val["sub_menu"]][$val["sub_menu_eng"]] = $key; |
||||
|
} |
||||
return $str; |
} |
||||
/* |
if (!empty($arr)) $str = json_encode($arr, JSON_UNESCAPED_UNICODE); |
||||
$str = ""; |
} |
||||
$sql = "select a.id, a.accountid, m.auth_content from account a, menu_auth m where a.accountid = '$aid' and a.accountid = m.accountid and m.status = 'Y'"; |
*/ |
||||
$res = mysqli_query($link, $sql); |
mysqli_free_result($res); |
||||
if ($row = mysqli_fetch_row($res)) { |
|
||||
list($id, $accountid, $auth_content) = $row; |
return $str; |
||||
$auth_arr = json_decode($auth_content, true); |
/* |
||||
$menuid_arr = array_keys($auth_arr); |
$str = ""; |
||||
if ($menuid_arr) { |
$sql = "select a.id, a.accountid, m.auth_content from account a, menu_auth m where a.accountid = '$aid' and a.accountid = m.accountid and m.status = 'Y'"; |
||||
$arr = []; |
$res = mysqli_query($link, $sql); |
||||
$menuid_str = implode(",", $menuid_arr); |
if ($row = mysqli_fetch_row($res)) { |
||||
$sql2 = "select id, main_menu, sub_menu, sub_menu_eng, link from menu_tree where id in ($menuid_str) and status = 'Y' order by main_menu_seq, sub_menu_seq"; |
list($id, $accountid, $auth_content) = $row; |
||||
$res2 = mysqli_query($link, $sql2); |
$auth_arr = json_decode($auth_content, true); |
||||
while ($row2 = mysqli_fetch_assoc($res2)) { |
$menuid_arr = array_keys($auth_arr); |
||||
$arr[$row2["main_menu"]][$row2["sub_menu"]][$row2["sub_menu_eng"]] = $row2["link"]; // R+W |
if ($menuid_arr) { |
||||
if ($auth_arr[$row2["id"]] == "N") $arr[$row2["main_menu"]][$row2["sub_menu"]][$row2["sub_menu_eng"]] = "";//"/wms/forbidden.php"; // R |
$arr = []; |
||||
} |
$menuid_str = implode(",", $menuid_arr); |
||||
mysqli_free_result($res2); |
$sql2 = "select id, main_menu, sub_menu, sub_menu_eng, link from menu_tree where id in ($menuid_str) and status = 'Y' order by main_menu_seq, sub_menu_seq"; |
||||
$str = json_encode($arr, JSON_UNESCAPED_UNICODE); |
$res2 = mysqli_query($link, $sql2); |
||||
} |
while ($row2 = mysqli_fetch_assoc($res2)) { |
||||
} |
$arr[$row2["main_menu"]][$row2["sub_menu"]][$row2["sub_menu_eng"]] = $row2["link"]; // R+W |
||||
mysqli_free_result($res); |
if ($auth_arr[$row2["id"]] == "N") $arr[$row2["main_menu"]][$row2["sub_menu"]][$row2["sub_menu_eng"]] = "";//"/wms/forbidden.php"; // R |
||||
|
} |
||||
return $str; |
mysqli_free_result($res2); |
||||
*/ |
$str = json_encode($arr, JSON_UNESCAPED_UNICODE); |
||||
} |
} |
||||
} |
} |
||||
|
mysqli_free_result($res); |
||||
|
|
||||
|
return $str; |
||||
|
*/ |
||||
|
} |
||||
|
} |
||||
|
File diff suppressed because it is too large
@ -1,78 +1,78 @@ |
|||||
<?php |
<?php |
||||
//require_once "../database.php"; |
//require_once "../database.php"; |
||||
require_once './wf_common.php'; |
require_once './wf_common.php'; |
||||
require_once './model/ConMaintanceExamineApplyModel.php'; |
require_once './model/ConMaintanceExamineApplyModel.php'; |
||||
require_once './model/ConMaintanceExamineClearModel.php'; |
require_once './model/ConMaintanceExamineClearModel.php'; |
||||
//print_r($_POST);exit; |
//print_r($_POST);exit; |
||||
$request = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET : $_POST; |
$request = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET : $_POST; |
||||
$tosign = ($request["btn_save"] == "tosign") ? 1 : 0; // 1:提交 |
$tosign = ($request["btn_save"] == "tosign") ? 1 : 0; // 1:提交 |
||||
|
|
||||
if ($request["form_src"] == "apply_form" && $tosign && (!isset($request["register_code"]) || empty($request["register_code"][0]) || !isset($request["next_users"]) || empty($request["next_users"]))) { |
if ($request["form_src"] == "apply_form" && $tosign && (!isset($request["register_code"]) || empty($request["register_code"][0]) || !isset($request["next_users"]) || empty($request["next_users"]))) { |
||||
echo "<script type = 'text/JavaScript'>"; |
echo "<script type = 'text/JavaScript'>"; |
||||
echo "alert('請確認電梯資料或未選擇下位簽核者!');"; |
echo "alert('請確認電梯資料或未選擇下位簽核者!');"; |
||||
echo "history.go(-1);"; |
echo "history.go(-1);"; |
||||
echo "</script>"; |
echo "</script>"; |
||||
exit; |
exit; |
||||
} |
} |
||||
|
|
||||
//更新表单ConMaintanceExamineApplyModel |
//更新表单ConMaintanceExamineApplyModel |
||||
$cmea = new ConMaintanceExamineApplyModel(); |
$cmea = new ConMaintanceExamineApplyModel(); |
||||
$apply_key=$request['apply_key']; |
$apply_key = $request['apply_key']; |
||||
$cmea->update(['apply_key', $apply_key], array_diff_key($request, ['apply_key' => ''])); |
$cmea->update(['apply_key', $apply_key], array_diff_key($request, ['apply_key' => ''])); |
||||
//更新电梯列表 |
//更新电梯列表 |
||||
if (!empty($request["reg_del"])) { |
if (!empty($request["reg_del"])) { |
||||
$register_code_del_arr = explode(",", rtrim($request["reg_del"], ",")); |
$register_code_del_arr = explode(",", rtrim($request["reg_del"], ",")); |
||||
foreach ($register_code_del_arr as $val) { |
foreach ($register_code_del_arr as $val) { |
||||
$sql = "update con_maintance_examine_clear set cmstatus = 'D' where apply_key = '$apply_key' and register_code = '$val' and cmstatus <> 'D'"; |
$sql = "UPDATE con_maintance_examine_clear SET cmstatus = 'D' WHERE apply_key = '$apply_key' AND register_code = '$val' AND cmstatus <> 'D'"; |
||||
DB::query($sql); |
DB::query($sql); |
||||
} |
} |
||||
} |
} |
||||
if (!empty($request['register_code']) && count($request['register_code']) > 0) { |
if (!empty($request['register_code']) && count($request['register_code']) > 0) { |
||||
$cmec = new ConMaintanceExamineClearModel(); |
$cmec = new ConMaintanceExamineClearModel(); |
||||
for ($i = 0; $i < count($request['register_code']); $i++) { |
for ($i = 0; $i < count($request['register_code']); $i++) { |
||||
$data = [ |
$data = [ |
||||
'apply_key' => $request['apply_key'] |
'apply_key' => $request['apply_key'] |
||||
]; |
]; |
||||
$cols = array_diff($cmec->fillable, ['apply_key']); |
$cols = array_diff($cmec->fillable, ['apply_key']); |
||||
foreach ($cols as $col) { |
foreach ($cols as $col) { |
||||
$data[$col] = empty($request[$col][$i]) ? '' : $request[$col][$i]; |
$data[$col] = empty($request[$col][$i]) ? '' : $request[$col][$i]; |
||||
if ($col=="annual_survey_expense") $data[$col] = '0.00'; |
if ($col == "annual_survey_expense") $data[$col] = '0.00'; |
||||
} |
} |
||||
$cmec->create($data); |
$cmec->create($data); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
//var_dump($_POST); |
//var_dump($_POST); |
||||
//var_dump($_GET); |
//var_dump($_GET); |
||||
|
|
||||
if ($tosign) { |
if ($tosign) { |
||||
#流程开始,var_dump($request); |
#流程开始,var_dump($request); |
||||
$flow = new Flow($request['form_key']); |
$flow = new Flow($request['form_key']); |
||||
// 当前节点签核开始 |
// 当前节点签核开始 |
||||
$wf = new WorkFlow($flow->system_id, $flow->flow_id, $flow->form_id, $request['form_key']); |
$wf = new WorkFlow($flow->system_id, $flow->flow_id, $flow->form_id, $request['form_key']); |
||||
$wf->setFormData($request); |
$wf->setFormData($request); |
||||
$wf->submit($request['next_users'], $request['assign_status'], $request['assign_opinion']); |
$wf->submit($request['next_users'], $request['assign_status'], $request['assign_opinion']); |
||||
//当前节点签核结束 |
//当前节点签核结束 |
||||
$responses['flowName'] = $wf->getFlowName(); |
$responses['flowName'] = $wf->getFlowName(); |
||||
$responses['form_key'] = $request['form_key']; |
$responses['form_key'] = $request['form_key']; |
||||
//var_dump($request); |
//var_dump($request); |
||||
#結案發通知給營業員 |
#結案發通知給營業員 |
||||
if ($request['assign_status'] == 'F4') { |
if ($request['assign_status'] == 'F4') { |
||||
|
|
||||
list($salesman, $case_name ) = DB::fields("select salesman ,case_name from con_maintance_examine_apply where apply_key='" . $apply_key. "' "); |
list($salesman, $case_name) = DB::fields("select salesman ,case_name from con_maintance_examine_apply where apply_key='" . $apply_key . "' "); |
||||
$ins_notice_sql = "INSERT INTO `notice` ( `kind`,`title`, `content`, `permission`) |
$ins_notice_sql = "INSERT INTO `notice` ( `kind`,`title`, `content`, `permission`) |
||||
VALUES ( '1', '契約價審單結案通知(" .$case_name . ")', '契約價審單結案通知(" . $case_name . ")', ' $salesman')"; |
VALUES ( '1', '契約價審單結案通知(" . $case_name . ")', '契約價審單結案通知(" . $case_name . ")', ' $salesman')"; |
||||
DB::query($ins_notice_sql); |
DB::query($ins_notice_sql); |
||||
// echo $ins_notice_sql; |
// echo $ins_notice_sql; |
||||
} |
} |
||||
} |
} |
||||
echo "<script type = 'text/JavaScript'>"; |
echo "<script type = 'text/JavaScript'>"; |
||||
//echo "<h4 style='text-align:center'>成功提交<a href='https://www.masada.com.tw/wms/sign/list.php?function_name=show&token=" . $request['token'] . "'>返回待签 </a></h4>"; |
//echo "<h4 style='text-align:center'>成功提交<a href='https://www.masada.com.tw/wms/sign/list.php?function_name=show&token=" . $request['token'] . "'>返回待签 </a></h4>"; |
||||
if ($tosign) { |
if ($tosign) { |
||||
echo "alert('成功提交');"; |
echo "alert('成功提交');"; |
||||
echo "location.href='../cont/sign_list.php?function_name=sign_list&token=".$request['token']."';"; |
echo "location.href='../wms/index.php.php?function_name=sign_list&token=" . $request['token'] . "';"; |
||||
} else { |
} else { |
||||
echo "alert('資料已保存');"; |
echo "alert('資料已保存');"; |
||||
echo "location.href='../crm/crmm02-index.php?function_name=contract_customer&token=".$request['token']."';"; |
echo "location.href='../crm/crmm02-index.php?function_name=contract_customer&token=" . $request['token'] . "';"; |
||||
} |
} |
||||
echo "</script>"; |
echo "</script>"; |
||||
|
File diff suppressed because one or more lines are too long
@ -1,355 +1,361 @@ |
|||||
<?php |
<?php |
||||
// ini_set('display_errors', 'off'); |
// ini_set('display_errors', 'off'); |
||||
|
|
||||
// 維護專用 |
// 維護專用 |
||||
// include "maintenance.php"; |
// include "maintenance.php"; |
||||
// $maintenancePeriod = "2023-11-17 15:30 AM 至 17:30 PM"; |
// $maintenancePeriod = "2023-11-17 15:30 AM 至 17:30 PM"; |
||||
// $maintenancePage = new MaintenancePage($maintenancePeriod); |
// $maintenancePage = new MaintenancePage($maintenancePeriod); |
||||
// $maintenancePage->displayPage(); |
// $maintenancePage->displayPage(); |
||||
|
header("Expires: Mon, 26 Jul 1990 05:00:00 GMT"); |
||||
function CreateToken($user_id, $user_name) { |
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
||||
date_default_timezone_set("Asia/Taipei"); |
header("Cache-Control: no-store, no-cache, must-revalidate"); |
||||
$start_time = date("Y-m-d H:i:s"); |
header("Cache-Control: post-check=0, pre-check=0", false); |
||||
$end_time = date('Y-m-d H:i:s',strtotime('+24 hour')); #设定24小时 |
header("Pragma: no-cache"); |
||||
$info = $user_id . '.' . base64_encode(urlencode($user_name)) . '.' . $start_time . '.' . $end_time; //设置token过期时间为一天 |
|
||||
$encryption_code = "MASADA!^***"; |
function CreateToken($user_id, $user_name) |
||||
//根据以上信息信息生成签名(密钥为 SIGNATURE 自定义全局常量) |
{ |
||||
$signature = hash_hmac('md5', $info, $encryption_code); |
date_default_timezone_set("Asia/Taipei"); |
||||
//最后将这两部分拼接起来,得到最终的Token字符串 |
$start_time = date("Y-m-d H:i:s"); |
||||
return $token = $info . '.' . $signature; |
$end_time = date('Y-m-d H:i:s', strtotime('+24 hour')); #设定24小时 |
||||
} |
$info = $user_id . '.' . base64_encode(urlencode($user_name)) . '.' . $start_time . '.' . $end_time; //设置token过期时间为一天 |
||||
|
$encryption_code = "MASADA!^***"; |
||||
|
//根据以上信息信息生成签名(密钥为 SIGNATURE 自定义全局常量) |
||||
require_once dirname(__FILE__) . "/../mkt/database.php"; |
$signature = hash_hmac('md5', $info, $encryption_code); |
||||
include "fun_global.php"; |
//最后将这两部分拼接起来,得到最终的Token字符串 |
||||
if (isset($_REQUEST["function_name"])) { |
return $token = $info . '.' . $signature; |
||||
$function_name = $_REQUEST["function_name"]; |
} |
||||
$function_flag = True; |
|
||||
} else { |
|
||||
$function_name = ""; |
require_once dirname(__FILE__) . "/../mkt/database.php"; |
||||
$function_flag = False; |
include "fun_global.php"; |
||||
} |
if (isset($_REQUEST["function_name"])) { |
||||
/** |
$function_name = $_REQUEST["function_name"]; |
||||
* 連線T8 MSSQL |
$function_flag = True; |
||||
*/ |
} else { |
||||
// try { |
$function_name = ""; |
||||
// $conn = new PDO("sqlsrv:Server=10.10.145.2;Database=T8MASADA", "masada", "@m222222"); |
$function_flag = False; |
||||
// if ($conn) { |
} |
||||
// $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
/** |
||||
// } |
* 連線T8 MSSQL |
||||
// } catch (PDOException $e) { |
*/ |
||||
// //echo "fail"; |
// try { |
||||
// //echo $e->getMessage(); |
// $conn = new PDO("sqlsrv:Server=10.10.145.2;Database=T8MASADA", "masada", "@m222222"); |
||||
// } |
// if ($conn) { |
||||
|
// $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
||||
|
// } |
||||
|
// } catch (PDOException $e) { |
||||
/***************************** |
// //echo "fail"; |
||||
* global: |
// //echo $e->getMessage(); |
||||
* $token |
// } |
||||
* $token_link 含token的連結 |
|
||||
* $user_id 使用者ID |
|
||||
* $user_name 使用者姓名 |
|
||||
* $login_dt 登入時間 |
/***************************** |
||||
* $user_auth 使用權限:1,2,3 |
* global: |
||||
*****************************/ |
* $token |
||||
$token = $_REQUEST["token"]; |
* $token_link 含token的連結 |
||||
|
* $user_id 使用者ID |
||||
if (count(explode(".", $token)) > 1) { |
* $user_name 使用者姓名 |
||||
$token_link = "token=" . $_REQUEST["token"]; |
* $login_dt 登入時間 |
||||
list($user_id, $enc_user_name, $login_dt) = explode(".", $token); |
* $user_auth 使用權限:1,2,3 |
||||
$user_name = urldecode(base64_decode($enc_user_name)); |
*****************************/ |
||||
} else { |
$token = $_REQUEST["token"]; |
||||
$user_id = !empty($_GET["employee_no"]) ? $_GET["employee_no"] : $user_id; |
|
||||
$login_dt = !empty($_GET["timestamp"]) ? substr($_GET["timestamp"], 0, 10) : $login_dt; |
if (count(explode(".", $token)) > 1) { |
||||
$login_dt = date('Y-m-d H:i:s', $login_dt); |
$token_link = "token=" . $_REQUEST["token"]; |
||||
$user_name = accountid2name()[$user_id]; |
list($user_id, $enc_user_name, $login_dt) = explode(".", $token); |
||||
$token = CreateToken($user_id,$user_name); |
$user_name = urldecode(base64_decode($enc_user_name)); |
||||
$token_link = "token=" . $token; |
} else { |
||||
} |
$user_id = !empty($_GET["employee_no"]) ? $_GET["employee_no"] : $user_id; |
||||
|
$login_dt = !empty($_GET["timestamp"]) ? substr($_GET["timestamp"], 0, 10) : $login_dt; |
||||
|
$login_dt = date('Y-m-d H:i:s', $login_dt); |
||||
include 'IncludeCommon.php'; |
$user_name = accountid2name()[$user_id]; |
||||
$includecommon = new IncludeCommon(); |
$token = CreateToken($user_id, $user_name); |
||||
$accounttype = getAccounttype($link, $user_id); |
$token_link = "token=" . $token; |
||||
$login_json = null; |
} |
||||
if (strlen($accounttype) != 0) { |
|
||||
$jsonres['menu'] = $includecommon->menu_v3($user_id, $accounttype); |
|
||||
$login_json = json_encode($jsonres, JSON_UNESCAPED_UNICODE); |
include 'IncludeCommon.php'; |
||||
} |
$includecommon = new IncludeCommon(); |
||||
?> |
$accounttype = getAccounttype($link, $user_id); |
||||
<script> |
$login_json = null; |
||||
res = eval("(" + JSON.stringify(<?php echo $login_json; ?>) + ")"); |
if (strlen($accounttype) != 0) { |
||||
window.localStorage.setItem("menu_<?php echo $user_id; ?>", res.menu); |
$jsonres['menu'] = $includecommon->menu_v3($user_id, $accounttype); |
||||
</script> |
$login_json = json_encode($jsonres, JSON_UNESCAPED_UNICODE); |
||||
<?php |
} |
||||
|
?> |
||||
// echo $token; |
<script> |
||||
// exit; |
res = eval("(" + JSON.stringify(<?php echo $login_json; ?>) + ")"); |
||||
// uesr可操作權限 |
window.localStorage.setItem("menu_<?php echo $user_id; ?>", res.menu); |
||||
$user_auth = check_user_permission($user_id, $token); |
</script> |
||||
|
<?php |
||||
?> |
|
||||
<!DOCTYPE html> |
// echo $token; |
||||
<html> |
// exit; |
||||
|
// uesr可操作權限 |
||||
<head> |
$user_auth = check_user_permission($user_id, $token); |
||||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" /> |
?> |
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> |
<!DOCTYPE html> |
||||
<title>Masada後臺系統</title> |
<html> |
||||
<link rel="stylesheet" href="<?php dirname(__DIR__); ?>/wms/css/styles.css" /> |
|
||||
<link rel="stylesheet" href="<?php dirname(__DIR__); ?>/wms/css/bootstrap.min.css"> |
<head> |
||||
<style> |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||
a svg { |
<meta name="apple-mobile-web-app-capable" content="yes" /> |
||||
display: inline-block; |
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> |
||||
vertical-align: text-top; |
<title>Masada後臺系統</title> |
||||
} |
<link rel="stylesheet" href="<?php dirname(__DIR__); ?>/wms/css/styles.css" /> |
||||
|
<link rel="stylesheet" href="<?php dirname(__DIR__); ?>/wms/css/bootstrap.min.css"> |
||||
.nav .icon { |
<style> |
||||
display: none; |
a svg { |
||||
} |
display: inline-block; |
||||
|
vertical-align: text-top; |
||||
input:read-only { |
} |
||||
background-color: #eee5e5; |
|
||||
} |
.nav .icon { |
||||
|
display: none; |
||||
@media screen and (max-width: 992px) { |
} |
||||
.header-right { |
|
||||
float: left !important; |
input:read-only { |
||||
margin-top: -40px; |
background-color: #eee5e5; |
||||
margin-left: -15px; |
} |
||||
} |
|
||||
|
@media screen and (max-width: 992px) { |
||||
/*.nav.navbar-nav a:not(:last-child), .dropdown {*/ |
.header-right { |
||||
.nav.navbar-nav a, |
float: left !important; |
||||
.dropdown { |
margin-top: -40px; |
||||
display: none; |
margin-left: -15px; |
||||
} |
} |
||||
|
|
||||
.nav.navbar-nav .icon { |
/*.nav.navbar-nav a:not(:last-child), .dropdown {*/ |
||||
color: #fff; |
.nav.navbar-nav a, |
||||
display: block; |
.dropdown { |
||||
position: fixed; |
display: none; |
||||
right: 0; |
} |
||||
top: 0; |
|
||||
} |
.nav.navbar-nav .icon { |
||||
} |
color: #fff; |
||||
|
display: block; |
||||
@media screen and (max-width: 992px) { |
position: fixed; |
||||
.nav.navbar-nav.responsive { |
right: 0; |
||||
position: relative; |
top: 0; |
||||
} |
} |
||||
|
} |
||||
.nav.navbar-nav.responsive a.icon { |
|
||||
position: fixed; |
@media screen and (max-width: 992px) { |
||||
right: 0; |
.nav.navbar-nav.responsive { |
||||
top: 0; |
position: relative; |
||||
} |
} |
||||
|
|
||||
.nav.navbar-nav.responsive li { |
.nav.navbar-nav.responsive a.icon { |
||||
float: none; |
position: fixed; |
||||
display: block; |
right: 0; |
||||
text-align: left; |
top: 0; |
||||
} |
} |
||||
|
|
||||
.nav.navbar-nav.responsive .dropdown { |
.nav.navbar-nav.responsive li { |
||||
float: none; |
float: none; |
||||
} |
display: block; |
||||
|
text-align: left; |
||||
.nav.navbar-nav.responsive .dropdown li { |
} |
||||
position: relative; |
|
||||
} |
.nav.navbar-nav.responsive .dropdown { |
||||
|
float: none; |
||||
.nav.navbar-nav.responsive .dropdown a { |
} |
||||
display: block; |
|
||||
width: 100%; |
.nav.navbar-nav.responsive .dropdown li { |
||||
text-align: left; |
position: relative; |
||||
top: -10px; |
} |
||||
line-height: 10px; |
|
||||
} |
.nav.navbar-nav.responsive .dropdown a { |
||||
|
display: block; |
||||
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a { |
width: 100%; |
||||
color: #000; |
text-align: left; |
||||
} |
top: -10px; |
||||
|
line-height: 10px; |
||||
.nav.navbar-nav.responsive .dropdown ul { |
} |
||||
width: 200px; |
|
||||
background-color: #fff; |
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a { |
||||
} |
color: #000; |
||||
|
} |
||||
.navbar-nav .open .dropdown-menu { |
|
||||
position: absolute; |
.nav.navbar-nav.responsive .dropdown ul { |
||||
} |
width: 200px; |
||||
} |
background-color: #fff; |
||||
|
} |
||||
@media screen and (max-width: 992px) { |
|
||||
#member_content_phone { |
.navbar-nav .open .dropdown-menu { |
||||
display: inline-grid !important; |
position: absolute; |
||||
} |
} |
||||
} |
} |
||||
</style> |
|
||||
<script src="<?php dirname(__DIR__); ?>/wms/css/jquery.min.js"></script> |
@media screen and (max-width: 992px) { |
||||
<script src="<?php dirname(__DIR__); ?>/wms/css/bootstrap.min.js"></script> |
#member_content_phone { |
||||
<script src="<?php dirname(__DIR__); ?>/wms/css/jquery.dataTables.min.js"></script> |
display: inline-grid !important; |
||||
<script src="<?php dirname(__DIR__); ?>/wms/css/dataTables.bootstrap4.min.js"></script> |
} |
||||
<script src="<?php dirname(__DIR__); ?>/wms/css/function.js"></script> |
} |
||||
<script> |
</style> |
||||
$(document).ready(function() { |
<script src="<?php dirname(__DIR__); ?>/wms/css/jquery.min.js"></script> |
||||
if ($('#table_index').length !== 0) $('#table_index').DataTable(); |
<script src="<?php dirname(__DIR__); ?>/wms/css/bootstrap.min.js"></script> |
||||
|
<script src="<?php dirname(__DIR__); ?>/wms/css/jquery.dataTables.min.js"></script> |
||||
if (window.localStorage) { |
<script src="<?php dirname(__DIR__); ?>/wms/css/dataTables.bootstrap4.min.js"></script> |
||||
//var tokendata=window.localStorage.getItem("token"); |
<script src="<?php dirname(__DIR__); ?>/wms/css/function.js"></script> |
||||
//var namedata=window.localStorage.getItem("name"); |
<script> |
||||
//var logindata=window.localStorage.getItem("login"); |
$(document).ready(function() { |
||||
var menudata = window.localStorage.getItem("menu_<?php echo $user_id; ?>"); |
if ($('#table_index').length !== 0) $('#table_index').DataTable(); |
||||
//if(tokendata==null || namedata==null || menudata==null){ |
|
||||
if (menudata == null) { |
if (window.localStorage) { |
||||
window.location.href = "<?php dirname(__DIR__); ?>/wms/login.php"; |
//var tokendata=window.localStorage.getItem("token"); |
||||
} |
//var namedata=window.localStorage.getItem("name"); |
||||
} else { |
//var logindata=window.localStorage.getItem("login"); |
||||
// var tokendata=$.cookie("token"); |
var menudata = window.localStorage.getItem("menu_<?php echo $user_id; ?>"); |
||||
} |
//if(tokendata==null || namedata==null || menudata==null){ |
||||
|
if (menudata == null) { |
||||
|
window.location.href = "<?php dirname(__DIR__); ?>/wms/login.php"; |
||||
var url = "<?php dirname(__DIR__); ?>/wms/headerapi.php"; |
} |
||||
$.ajax({ |
} else { |
||||
method: 'post', |
// var tokendata=$.cookie("token"); |
||||
url: url, |
} |
||||
data: { |
|
||||
token: '<?php echo $token; ?>' |
|
||||
}, |
var url = "<?php dirname(__DIR__); ?>/wms/headerapi.php"; |
||||
success: function(data) { |
$.ajax({ |
||||
var res = eval('(' + data + ')'); |
method: 'post', |
||||
//console.log(res); |
url: url, |
||||
if (res.code != '200') { |
data: { |
||||
window.location.href = '<?php dirname(__DIR__); ?>/wms/login.php?errno=3'; |
token: '<?php echo $token; ?>' |
||||
} |
}, |
||||
} |
success: function(data) { |
||||
}); |
var res = eval('(' + data + ')'); |
||||
|
//console.log(res); |
||||
var mdata = JSON.parse(menudata); |
if (res.code != '200') { |
||||
var menuStr = ''; |
window.location.href = '<?php dirname(__DIR__); ?>/wms/login.php?errno=3'; |
||||
var checkAuth = 0; |
} |
||||
var m = 1; |
} |
||||
for (var i in mdata) { |
}); |
||||
menuStr += '<li class="dropdown">'; |
|
||||
menuStr += '<a class="dropdown-toggle" data-toggle="dropdown" href="#">' + i; |
var mdata = JSON.parse(menudata); |
||||
menuStr += '<span class="caret"></span></a>'; |
var menuStr = ''; |
||||
menuStr += '<ul class="dropdown-menu">'; |
var checkAuth = 0; |
||||
for (var j in mdata[i]) { |
var m = 1; |
||||
for (var k in mdata[i][j]) { |
for (var i in mdata) { |
||||
menuStr += '<li'; |
menuStr += '<li class="dropdown">'; |
||||
if (k == '<?php echo $function_name; ?>') menuStr += " class='active'"; |
menuStr += '<a class="dropdown-toggle" data-toggle="dropdown" href="#">' + i; |
||||
menuStr += '><a href="<?php dirname(__DIR__); ?>/wms/' + mdata[i][j][k] + '?function_name=' + k + '&<?php echo $token_link; ?>"'; |
menuStr += '<span class="caret"></span></a>'; |
||||
if (k.indexOf('open-') !== -1) menuStr += ' target="_blank"'; |
menuStr += '<ul class="dropdown-menu">'; |
||||
menuStr += '>' + j + '</a></li>'; |
for (var j in mdata[i]) { |
||||
if (mdata[i][j][k] == window.location.pathname) checkAuth = 1; |
for (var k in mdata[i][j]) { |
||||
m++; |
menuStr += '<li'; |
||||
} |
if (k == '<?php echo $function_name; ?>') menuStr += " class='active'"; |
||||
} |
menuStr += '><a href="<?php dirname(__DIR__); ?>/wms/' + mdata[i][j][k] + '?function_name=' + k + '&<?php echo $token_link; ?>"'; |
||||
menuStr += '</ul>'; |
if (k.indexOf('open-') !== -1) menuStr += ' target="_blank"'; |
||||
menuStr += '</li>'; |
menuStr += '>' + j + '</a></li>'; |
||||
} |
if (mdata[i][j][k] == window.location.pathname) checkAuth = 1; |
||||
menuStr += '<li><a href="javascript:void(0);" class="icon" onclick="myFunction()"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grid-3x3-gap-fill" viewBox="0 0 16 16"><path d="M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V2zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V7zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V7zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2z"/></svg></a></li>'; |
m++; |
||||
/* |
} |
||||
if (checkAuth == 0 && ('/wms/custom-create.php' != window.location.pathname)) { |
} |
||||
window.location.href='login.php?errno=4'; |
menuStr += '</ul>'; |
||||
} |
menuStr += '</li>'; |
||||
*/ |
} |
||||
$('#menu_content').html(menuStr); |
menuStr += '<li><a href="javascript:void(0);" class="icon" onclick="myFunction()"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grid-3x3-gap-fill" viewBox="0 0 16 16"><path d="M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V2zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V7zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V7zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2z"/></svg></a></li>'; |
||||
|
/* |
||||
$('.dropdown a').on('click', function() { |
if (checkAuth == 0 && ('/wms/custom-create.php' != window.location.pathname)) { |
||||
$('.dropdown').removeClass('open'); |
window.location.href='login.php?errno=4'; |
||||
}); |
} |
||||
}); |
*/ |
||||
|
$('#menu_content').html(menuStr); |
||||
function myFunction() { |
|
||||
var x = document.getElementById("menu_content"); |
$('.dropdown a').on('click', function() { |
||||
if (x.className === "nav navbar-nav") { |
$('.dropdown').removeClass('open'); |
||||
x.className += " responsive"; |
}); |
||||
} else { |
}); |
||||
x.className = "nav navbar-nav"; |
|
||||
} |
function myFunction() { |
||||
} |
var x = document.getElementById("menu_content"); |
||||
</script> |
if (x.className === "nav navbar-nav") { |
||||
</head> |
x.className += " responsive"; |
||||
|
} else { |
||||
<body> |
x.className = "nav navbar-nav"; |
||||
<nav class="navbar navbar-inverse"> |
} |
||||
<div class="container-fluid"> |
} |
||||
<div class="navbar-header"> |
</script> |
||||
<a class="navbar-brand" href="<?php dirname(__DIR__); ?>/wms/index.php?<?php echo $token_link; ?>">Masada</a> |
</head> |
||||
</div> |
|
||||
<ul class="nav navbar-nav" id="menu_content"> |
<body> |
||||
</ul> |
<nav class="navbar navbar-inverse"> |
||||
<!-- |
<div class="container-fluid"> |
||||
<div class="topnav" id="myTopnav"> |
<div class="navbar-header"> |
||||
<a href="#home" class="active">Home</a> |
<a class="navbar-brand" href="<?php dirname(__DIR__); ?>/wms/index.php?<?php echo $token_link; ?>">Masada</a> |
||||
<a href="#news">News</a> |
</div> |
||||
<a href="#contact">Contact</a> |
<ul class="nav navbar-nav" id="menu_content"> |
||||
<div class="dropdown"> |
</ul> |
||||
<button class="dropbtn">Dropdown |
<!-- |
||||
<span class="caret"></span></a> |
<div class="topnav" id="myTopnav"> |
||||
</button> |
<a href="#home" class="active">Home</a> |
||||
<div class="dropdown-content"> |
<a href="#news">News</a> |
||||
<a href="#">Link 1</a> |
<a href="#contact">Contact</a> |
||||
<a href="#">Link 2</a> |
<div class="dropdown"> |
||||
<a href="#">Link 3</a> |
<button class="dropbtn">Dropdown |
||||
</div> |
<span class="caret"></span></a> |
||||
</div> |
</button> |
||||
<a href="#about">About</a> |
<div class="dropdown-content"> |
||||
<a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="myFunction()">☰</a> |
<a href="#">Link 1</a> |
||||
</div> |
<a href="#">Link 2</a> |
||||
--> |
<a href="#">Link 3</a> |
||||
|
</div> |
||||
<div class="header-right"> |
</div> |
||||
<ul class="nav navbar-nav" id="member_content"> |
<a href="#about">About</a> |
||||
<li class="dropdown d-lg-none"> |
<a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="myFunction()">☰</a> |
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" style='padding:0px;padding-top:5px;'> |
</div> |
||||
<?php echo $user_name . "(" . $user_id . ")" . "<br/>" . $login_dt; ?> |
--> |
||||
<span class="caret"></span> |
|
||||
</a> |
<div class="header-right"> |
||||
<ul class="dropdown-menu"> |
<ul class="nav navbar-nav" id="member_content"> |
||||
<li> |
<li class="dropdown d-lg-none"> |
||||
<a style="color:#000;" href="<?php dirname(__DIR__); ?>/wms/change-password.php?<?php echo $token_link; ?>" class="navbar-brand" style="font-size:14px;line-height:34px;"> |
<a class="dropdown-toggle" data-toggle="dropdown" href="#" style='padding:0px;padding-top:5px;'> |
||||
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"> |
<?php echo $user_name . "(" . $user_id . ")" . "<br/>" . $login_dt; ?> |
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g> |
<span class="caret"></span> |
||||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g> |
</a> |
||||
<g id="SVGRepo_iconCarrier"> |
<ul class="dropdown-menu"> |
||||
<rect width="24" height="24" fill="white"></rect> |
<li> |
||||
<path d="M2.5 12C2.5 12.2761 2.72386 12.5 3 12.5C3.27614 12.5 3.5 12.2761 3.5 12H2.5ZM3.5 12C3.5 7.30558 7.30558 3.5 12 3.5V2.5C6.75329 2.5 2.5 6.75329 2.5 12H3.5ZM12 3.5C15.3367 3.5 18.2252 5.4225 19.6167 8.22252L20.5122 7.77748C18.9583 4.65062 15.7308 2.5 12 2.5V3.5Z" fill="#000000"></path> |
<a style="color:#000;" href="<?php dirname(__DIR__); ?>/wms/change-password.php?<?php echo $token_link; ?>" class="navbar-brand" style="font-size:14px;line-height:34px;"> |
||||
<path d="M20.4716 2.42157V8.07843H14.8147" stroke="#000000" stroke-linecap="round" stroke-linejoin="round"></path> |
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||
<path d="M21.5 12C21.5 11.7239 21.2761 11.5 21 11.5C20.7239 11.5 20.5 11.7239 20.5 12L21.5 12ZM20.5 12C20.5 16.6944 16.6944 20.5 12 20.5L12 21.5C17.2467 21.5 21.5 17.2467 21.5 12L20.5 12ZM12 20.5C8.66333 20.5 5.77477 18.5775 4.38328 15.7775L3.48776 16.2225C5.04168 19.3494 8.26923 21.5 12 21.5L12 20.5Z" fill="#000000"></path> |
<g id="SVGRepo_bgCarrier" stroke-width="0"></g> |
||||
<path d="M3.52844 21.5784L3.52844 15.9216L9.18529 15.9216" stroke="#000000" stroke-linecap="round" stroke-linejoin="round"></path> |
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g> |
||||
</g> |
<g id="SVGRepo_iconCarrier"> |
||||
</svg> |
<rect width="24" height="24" fill="white"></rect> |
||||
更改密碼 |
<path d="M2.5 12C2.5 12.2761 2.72386 12.5 3 12.5C3.27614 12.5 3.5 12.2761 3.5 12H2.5ZM3.5 12C3.5 7.30558 7.30558 3.5 12 3.5V2.5C6.75329 2.5 2.5 6.75329 2.5 12H3.5ZM12 3.5C15.3367 3.5 18.2252 5.4225 19.6167 8.22252L20.5122 7.77748C18.9583 4.65062 15.7308 2.5 12 2.5V3.5Z" fill="#000000"></path> |
||||
</a> |
<path d="M20.4716 2.42157V8.07843H14.8147" stroke="#000000" stroke-linecap="round" stroke-linejoin="round"></path> |
||||
</li> |
<path d="M21.5 12C21.5 11.7239 21.2761 11.5 21 11.5C20.7239 11.5 20.5 11.7239 20.5 12L21.5 12ZM20.5 12C20.5 16.6944 16.6944 20.5 12 20.5L12 21.5C17.2467 21.5 21.5 17.2467 21.5 12L20.5 12ZM12 20.5C8.66333 20.5 5.77477 18.5775 4.38328 15.7775L3.48776 16.2225C5.04168 19.3494 8.26923 21.5 12 21.5L12 20.5Z" fill="#000000"></path> |
||||
<li> |
<path d="M3.52844 21.5784L3.52844 15.9216L9.18529 15.9216" stroke="#000000" stroke-linecap="round" stroke-linejoin="round"></path> |
||||
<a style="color:#000;" href="<?php dirname(__DIR__); ?>/wms/logout.php?<?php echo $token_link; ?>" class="navbar-brand" style="font-size:14px;line-height:34px;"> |
</g> |
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16"> |
</svg> |
||||
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z" /> |
更改密碼 |
||||
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z" /> |
</a> |
||||
</svg> |
</li> |
||||
登出 |
<li> |
||||
</a> |
<a style="color:#000;" href="<?php dirname(__DIR__); ?>/wms/logout.php?<?php echo $token_link; ?>" class="navbar-brand" style="font-size:14px;line-height:34px;"> |
||||
</li> |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16"> |
||||
</ul> |
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z" /> |
||||
</li> |
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z" /> |
||||
</ul> |
</svg> |
||||
<div id="member_content_phone" style="display:none"> |
登出 |
||||
<span class="navbar-brand"> |
</a> |
||||
<h5><?php echo $user_name . "(" . $user_id . ")" . $login_dt; ?></h5> |
</li> |
||||
</span> |
</ul> |
||||
<a href="<?php dirname(__DIR__); ?>/wms/change-password.php?<?php echo $token_link; ?>" class="navbar-brand" style="font-size:14px;line-height:34px;"> |
</li> |
||||
更改密碼</a> |
</ul> |
||||
<a href="<?php dirname(__DIR__); ?>/wms/logout.php?<?php echo $token_link; ?>" class="navbar-brand" style="font-size:14px;line-height:34px;"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16"> |
<div id="member_content_phone" style="display:none"> |
||||
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z" /> |
<span class="navbar-brand"> |
||||
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z" /> |
<h5><?php echo $user_name . "(" . $user_id . ")" . $login_dt; ?></h5> |
||||
</svg> |
</span> |
||||
登出</a> |
<a href="<?php dirname(__DIR__); ?>/wms/change-password.php?<?php echo $token_link; ?>" class="navbar-brand" style="font-size:14px;line-height:34px;"> |
||||
</div> |
更改密碼</a> |
||||
</div> |
<a href="<?php dirname(__DIR__); ?>/wms/logout.php?<?php echo $token_link; ?>" class="navbar-brand" style="font-size:14px;line-height:34px;"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16"> |
||||
|
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z" /> |
||||
|
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z" /> |
||||
|
</svg> |
||||
|
登出</a> |
||||
|
</div> |
||||
|
</div> |
||||
</nav> |
</nav> |
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,218 +1,216 @@ |
|||||
<?php |
<?php |
||||
|
|
||||
use function PHPSTORM_META\type; |
use function PHPSTORM_META\type; |
||||
|
|
||||
include "./header.php"; |
include "./header.php"; |
||||
// 產生mysql單據編號 |
// 產生mysql單據編號 |
||||
$MaxBillNo = 0; |
$MaxBillNo = 0; |
||||
$curreny_date = date('ym'); |
$curreny_date = date('ym'); |
||||
$query_rib = array(); |
$query_rib = array(); |
||||
$sqlname = "C" . $user_id; |
$sqlname = "C" . $user_id; |
||||
$sqlname .= $curreny_date; |
$sqlname .= $curreny_date; |
||||
$date_sql = "SELECT BillNo from rib WHERE (BillNo LIKE '$sqlname%')"; |
$date_sql = "SELECT BillNo from rib WHERE (BillNo LIKE '$sqlname%')"; |
||||
$query_rib = mysqli_query($link, $date_sql); |
$query_rib = mysqli_query($link, $date_sql); |
||||
$myNo = mysqli_fetch_all($query_rib); |
$myNo = mysqli_fetch_all($query_rib); |
||||
foreach ($myNo as $thisMyNo) { |
foreach ($myNo as $thisMyNo) { |
||||
$thisMyNo = (int)substr($thisMyNo[0], -2); |
$thisMyNo = (int)substr($thisMyNo[0], -2); |
||||
if ($thisMyNo > $MaxBillNo) { |
if ($thisMyNo > $MaxBillNo) { |
||||
$MaxBillNo = $thisMyNo; |
$MaxBillNo = $thisMyNo; |
||||
} |
} |
||||
} |
} |
||||
$BillNo = $sqlname; |
$BillNo = $sqlname; |
||||
$today = (int)date('Ymd'); |
$today = (int)date('Ymd'); |
||||
|
|
||||
// 連線T8MASADA |
// 連線T8MASADA |
||||
|
|
||||
$member = array(); |
$member = array(); |
||||
//取得人員名單與使用者的部門 |
//取得人員名單與使用者的部門 |
||||
|
|
||||
$sql_mydept = "SELECT UserId, Username FROM capMembership WHERE ValidityToDate >$today"; |
$sql_mydept = "SELECT UserId, Username FROM capMembership WHERE ValidityToDate >$today"; |
||||
$deptmem = $conn->query($sql_mydept); |
$deptmem = $conn->query($sql_mydept); |
||||
foreach ($deptmem as $mem) { |
foreach ($deptmem as $mem) { |
||||
$userid = $mem['UserId']; |
$userid = $mem['UserId']; |
||||
$username = $mem['Username']; |
$username = $mem['Username']; |
||||
$member["$userid"] = [$username]; |
$member["$userid"] = [$username]; |
||||
}; |
}; |
||||
$sql_dept = "SELECT DeptId, PersonId FROM comPerson WHERE (DeptId!='0001')"; |
// print_r($member); |
||||
$allpeople = $conn->query($sql_dept); |
$sql_dept = "SELECT DeptId, PersonId FROM comPerson WHERE (DeptId!='0001')"; |
||||
foreach ($allpeople as $man) { |
$allpeople = $conn->query($sql_dept); |
||||
if ($man['PersonId'] == $user_id) { |
foreach ($allpeople as $man) { |
||||
$mydepart = $man['DeptId']; |
if ($man['PersonId'] == $user_id) { |
||||
} |
$mydepart = $man['DeptId']; |
||||
$personid = $man['PersonId']; |
} |
||||
$depart = $man['DeptId']; |
$personid = $man['PersonId']; |
||||
if (isset($member["$personid"])) { |
$depart = $man['DeptId']; |
||||
array_push($member["$personid"], "$depart"); |
if (isset($member["$personid"])) { |
||||
}; |
array_push($member["$personid"], "$depart"); |
||||
} |
}; |
||||
|
} |
||||
//取得部門代碼 |
|
||||
$sql_department = "SELECT DeptId,DeptName FROM comDepartment WHERE DeptId!='0001'"; |
//取得部門代碼 |
||||
$deptype = $conn->query($sql_department); |
$sql_department = "SELECT DeptId,DeptName FROM comDepartment WHERE DeptId!='0001'"; |
||||
|
$deptype = $conn->query($sql_department); |
||||
$MaxBillNo += 1; |
|
||||
if ($MaxBillNo < 10) { |
$MaxBillNo += 1; |
||||
$BillNo .= "0" . strval($MaxBillNo); |
if ($MaxBillNo < 10) { |
||||
} else { |
$BillNo .= "0" . strval($MaxBillNo); |
||||
$BillNo .= strval($MaxBillNo); |
} else { |
||||
} |
$BillNo .= strval($MaxBillNo); |
||||
|
} |
||||
?> |
|
||||
<div style="width: 90%;"> |
?> |
||||
|
<div style="width: 90%;"> |
||||
<div style="padding-left: 2rem; padding-bottom: 1rem;"> |
|
||||
<a href="rib01-index.php?<?php echo $token_link; ?>" class="btn btn-default btn-lg"> |
<div style="padding-left: 2rem; padding-bottom: 1rem;"> |
||||
<span class="glyphicon glyphicon-home"></span> |
<a href="rib01-index.php?<?php echo $token_link; ?>" class="btn btn-default btn-lg"> |
||||
</a> |
<span class="glyphicon glyphicon-home"></span> |
||||
</div> |
</a> |
||||
</div> |
</div> |
||||
<div class="container" id="ribadd"> |
</div> |
||||
<div class="text-center"> |
<div class="container" id="ribadd"> |
||||
<h3>報銷單據</h3> |
<div class="text-center"> |
||||
</div> |
<h3>報銷單據</h3> |
||||
<form class="form-horizontal" name="ribadd" id="ribadd" method="POST" action="rib01-submit.php?submit=add&state=0&<?= $token_link ?>" enctype="multipart/form-data"> |
</div> |
||||
<div class="form-group"> |
<form class="form-horizontal" name="ribadd" id="ribadd" method="POST" action="rib01-submit.php?submit=add&state=0&<?= $token_link ?>" enctype="multipart/form-data"> |
||||
<div class="col-md-3"> |
<div class="form-group"> |
||||
<label for="BillNo" style="color: red;">單據編號</label> |
<div class="col-md-3"> |
||||
<input class="form-control" type="text" name="BillNo" id="BillNo" value="<?php echo $BillNo ?>" disabled> |
<label for="BillNo" style="color: red;">單據編號</label> |
||||
|
<input class="form-control" type="text" name="BillNo" id="BillNo" value="<?php echo $BillNo ?>" disabled> |
||||
</div> |
|
||||
<div class="col-md-3"> |
</div> |
||||
<label for="BillDate" style="color: red;">單據日期</label> |
<div class="col-md-3"> |
||||
<input class="form-control" type="number" name="BillDate" id="BillDate" value=<?= date('Ymd') ?> placeholder="西元年(4碼)+月(2碼)+日(2碼)" disabled> |
<label for="BillDate" style="color: red;">單據日期</label> |
||||
</div> |
<input class="form-control" type="number" name="BillDate" id="BillDate" value=<?= date('Ymd') ?> placeholder="西元年(4碼)+月(2碼)+日(2碼)" disabled> |
||||
|
</div> |
||||
<div class="col-md-3"> |
|
||||
<label for="CurrId" style="color: red;">幣別</label> |
<div class="col-md-3"> |
||||
<select name="CurrId" id="CurrId" class="form-control"> |
<label for="CurrId" style="color: red;">幣別</label> |
||||
<option value="TWD" selected>台幣</option> |
<select name="CurrId" id="CurrId" class="form-control"> |
||||
<option value="CNY">人民幣</option> |
<option value="TWD" selected>台幣</option> |
||||
<option value="EUR">歐元</option> |
<option value="CNY">人民幣</option> |
||||
<option value="HKD">港幣</option> |
<option value="EUR">歐元</option> |
||||
<option value="USD">美元</option> |
<option value="HKD">港幣</option> |
||||
</select> |
<option value="USD">美元</option> |
||||
</div> |
</select> |
||||
|
</div> |
||||
<div class="col-md-3"> |
|
||||
<label for="TransactId" style="color: red;">經辦人</label> |
<div class="col-md-3"> |
||||
<select name="TransactId" class="form-control" required> |
<label for="TransactId" style="color: red;">經辦人</label> |
||||
|
<select name="TransactId" class="form-control" required> |
||||
<option value="<?php echo $user_id; ?>"> <?php echo $user_name; ?> </option> |
|
||||
|
<option value="<?php echo $user_id; ?>"> <?php echo $user_name; ?> </option> |
||||
</select> |
|
||||
</div> |
</select> |
||||
</div> |
</div> |
||||
|
</div> |
||||
<div class="form-group"> |
|
||||
<div class="col-md-3"> |
<div class="form-group"> |
||||
<label for="DeptId" style="color: red;">報銷單位</label> |
<div class="col-md-3"> |
||||
<select name="DeptId" id="DeptId" class="form-control" required> |
<label for="DeptId" style="color: red;">報銷單位</label> |
||||
<?php |
<select name="DeptId" id="DeptId" class="form-control" required> |
||||
foreach ($deptype as $dept) { ?> |
<?php |
||||
<option value="<?php echo $dept['DeptId']; ?>" <?php |
foreach ($deptype as $dept) { ?> |
||||
if ($dept['DeptId'] == $mydepart) { |
<option value="<?php echo $dept['DeptId']; ?>" <?php |
||||
echo "selected"; |
if ($dept['DeptId'] == $mydepart) { |
||||
} ?>><?php echo $dept['DeptName']; ?></option> |
echo "selected"; |
||||
<?php }; |
} ?>><?php echo $dept['DeptName']; ?></option> |
||||
?> |
<?php }; |
||||
</select> |
?> |
||||
</div> |
</select> |
||||
<div class="col-md-3"> |
</div> |
||||
<label for="WriteOffId" style="color: red;">報銷人</label> |
<div class="col-md-3"> |
||||
<select name="WriteOffId" id="WriteOffId" class="form-control" required> |
<label for="WriteOffId" style="color: red;">報銷人</label> |
||||
<option value="" style="display:flex" id="WriteOffoption">請選擇報銷人</option> |
<select name="WriteOffId" id="WriteOffId" class="form-control" required> |
||||
<?php |
<option value="" style="display:flex" id="WriteOffoption">請選擇報銷人</option> |
||||
foreach ($member as $key => $value) { ?> |
<?php |
||||
<!-- <option value="<?php echo $value['UserId']; ?>" style="display:none" id="<?= 'WriteOff' . $value['UserId'] . $key ?>" <?php if ($value['UserId'] == $user_id) { |
foreach ($member as $key => $value) { ?> |
||||
echo "selected"; |
<option value="<?php echo $key; ?>" id="<?= 'WriteOff' . $value[1] . "-" . $value[0] ?>" <?php if ($key == $user_id) { |
||||
} ?>> <?php echo $value['Username']; ?> </option> --> |
echo "selected"; |
||||
<option value="<?php echo $key; ?>" id="<?= 'WriteOff' . $value[1] . "-" . $value[0] ?>" <?php if ($key == $user_id) { |
} ?>> <?php echo $value[0]; ?> </option> |
||||
echo "selected"; |
<?php } |
||||
} ?>> <?php echo $value[0]; ?> </option> |
?> |
||||
<?php } |
</select> |
||||
?> |
</div> |
||||
</select> |
<div class="col-md-3"> |
||||
</div> |
<label for="pay_type">付款方式</label> |
||||
<div class="col-md-3"> |
<select name="pay_type" id="pay_type" class="form-control" required> |
||||
<label for="pay_type">付款方式</label> |
<option value=0>現金</option> |
||||
<select name="pay_type" id="pay_type" class="form-control" required> |
<option value=1 selected>銀行轉帳</option> |
||||
<option value=0>現金</option> |
</select> |
||||
<option value=1 selected>銀行轉帳</option> |
</div> |
||||
</select> |
<div class="col-md-3"> |
||||
</div> |
<label for="GatheringPersonId" style="color: red;">收款人</label> |
||||
<div class="col-md-3"> |
<select name="GatheringPersonId" id="GatheringPersonId" class="form-control"> |
||||
<label for="GatheringPersonId" style="color: red;">收款人</label> |
<option value="" style="display:flex" id="GatheringOption">請選擇收款人</option> |
||||
<select name="GatheringPersonId" id="GatheringPersonId" class="form-control"> |
<?php |
||||
<option value="" style="display:flex" id="GatheringOption">請選擇收款人</option> |
// foreach ($deptmem as $key => $value) { |
||||
<?php |
foreach ($member as $key => $value) { |
||||
// foreach ($deptmem as $key => $value) { |
?> |
||||
foreach ($member as $key => $value) { |
<!-- <option value="<?php echo $value['accountid']; ?>" id="<?= 'Gathering' . $value['department_id'] ?>" <?php if ($value['accountid'] == $user_id) { |
||||
?> |
echo "selected"; |
||||
<!-- <option value="<?php echo $value['accountid']; ?>" id="<?= 'Gathering' . $value['department_id'] ?>" <?php if ($value['accountid'] == $user_id) { |
} ?>> <?php echo $value['name']; ?> </option> --> |
||||
echo "selected"; |
<option value="<?php echo $key; ?>" id="<?= 'Gathering' . $value[1] . "-" . $value[0] ?>" <?php if ($key == $user_id) { |
||||
} ?>> <?php echo $value['name']; ?> </option> --> |
echo "selected"; |
||||
<option value="<?php echo $key; ?>" id="<?= 'Gathering' . $value[1] . "-" . $value[0] ?>" <?php if ($key == $user_id) { |
} ?>> <?php echo $value[0]; ?> </option> |
||||
echo "selected"; |
<?php }; ?> |
||||
} ?>> <?php echo $value[0]; ?> </option> |
</select> |
||||
<?php }; ?> |
</div> |
||||
</select> |
|
||||
</div> |
|
||||
|
</div> |
||||
|
|
||||
</div> |
<div class="form-group"> |
||||
|
|
||||
<div class="form-group"> |
|
||||
|
</div> |
||||
|
<hr> |
||||
</div> |
|
||||
<hr> |
|
||||
|
<input type="hidden" name="token" value="<?php echo $token; ?>"> |
||||
|
<input type="hidden" name="type" id="type" value="rib"> |
||||
<input type="hidden" name="token" value="<?php echo $token; ?>"> |
<div class="form-group"> |
||||
<input type="hidden" name="type" id="type" value="rib"> |
<div class="col-md-3"> |
||||
<div class="form-group"> |
|
||||
<div class="col-md-3"> |
</div> |
||||
|
<div class="col-md-9 "> |
||||
</div> |
<button onclick="send()" class="btn btn-primary btn-lg pull-right">下一步</button> |
||||
<div class="col-md-9 "> |
</div> |
||||
<button onclick="send()" class="btn btn-primary btn-lg pull-right">下一步</button> |
</div> |
||||
</div> |
</form> |
||||
</div> |
</div> |
||||
</form> |
<script> |
||||
</div> |
$(function() { |
||||
<script> |
$("#DeptId").change(function() { |
||||
$(function() { |
changeWriteOffId($('#DeptId').val()); |
||||
$("#DeptId").change(function() { |
}) |
||||
changeWriteOffId($('#DeptId').val()); |
}) |
||||
}) |
|
||||
}) |
function changeWriteOffId(SelectedDept) { |
||||
|
var GatheringSelectDeptId = 'Gathering' + SelectedDept + "-"; |
||||
function changeWriteOffId(SelectedDept) { |
var SelectDeptId = 'WriteOff' + SelectedDept + "-"; |
||||
var GatheringSelectDeptId = 'Gathering' + SelectedDept + "-"; |
for (var i = 0; i < WriteOffId.options.length; i++) { |
||||
var SelectDeptId = 'WriteOff' + SelectedDept + "-"; |
WriteOffId.options[i].selected = false; |
||||
for (var i = 0; i < WriteOffId.options.length; i++) { |
let thisid = WriteOffId.options[i].id |
||||
WriteOffId.options[i].selected = false; |
if (thisid.search(SelectDeptId) === 0) { |
||||
let thisid = WriteOffId.options[i].id |
WriteOffId.options[i].style['display'] = ''; |
||||
if (thisid.search(SelectDeptId) === 0) { |
} else { |
||||
WriteOffId.options[i].style['display'] = ''; |
WriteOffId.options[i].style['display'] = 'none'; |
||||
} else { |
}; |
||||
WriteOffId.options[i].style['display'] = 'none'; |
|
||||
}; |
}; |
||||
|
|
||||
}; |
for (var j = 0; j < GatheringPersonId.options.length; j++) { |
||||
|
let Gatherid = GatheringPersonId.options[j].id |
||||
for (var j = 0; j < GatheringPersonId.options.length; j++) { |
if (Gatherid.search(GatheringSelectDeptId) === 0 || GatheringPersonId.options[j].value === "<?= $user_id ?>") { |
||||
let Gatherid = GatheringPersonId.options[j].id |
GatheringPersonId.options[j].style['display'] = ''; |
||||
if (Gatherid.search(GatheringSelectDeptId) === 0 || GatheringPersonId.options[j].value === "<?= $user_id ?>") { |
} else { |
||||
GatheringPersonId.options[j].style['display'] = ''; |
GatheringPersonId.options[j].style['display'] = 'none'; |
||||
} else { |
}; |
||||
GatheringPersonId.options[j].style['display'] = 'none'; |
} |
||||
}; |
}; |
||||
} |
|
||||
}; |
function send() { |
||||
|
$("#BillNo").prop("disabled", false); |
||||
function send() { |
$('#ribadd').submit(); |
||||
$("#BillNo").prop("disabled", false); |
} |
||||
$('#ribadd').submit(); |
|
||||
} |
|
||||
</script> |
</script> |
Loading…
Reference in new issue