|
@ -1,149 +1,104 @@ |
|
|
<?php |
|
|
<?php |
|
|
ini_set('display_errors', 'on'); |
|
|
|
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
if ($_POST['form_name'] == 'main_form') { |
|
|
include("class/Cnotice.php"); |
|
|
|
|
|
$cn = new Cnotice(); |
|
|
|
|
|
|
|
|
|
|
|
if ($_POST['form_name'] == 'main_form') { |
|
|
foreach ($_POST as $k => $v) { |
|
|
foreach ($_POST as $k => $v) { |
|
|
if ($k !== 'desin_taiwan_items_no' && $k !== 'desin_taiwan_items_name') |
|
|
if ($k !== 'desin_taiwan_items_no' && $k !== 'desin_taiwan_items_name') |
|
|
$$k = htmlspecialchars(stripslashes(trim($v))); |
|
|
$$k = htmlspecialchars(stripslashes(trim($v))); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 時間戳記 |
|
|
|
|
|
$datetime = date("Y-m-d H:i:s"); |
|
|
$datetime = date("Y-m-d H:i:s"); |
|
|
|
|
|
|
|
|
// 合約號 |
|
|
|
|
|
$contractno = $_POST['contractno']; |
|
|
$contractno = $_POST['contractno']; |
|
|
// 號機 |
|
|
|
|
|
$facility_temp_no = $_POST['facility_temp_no']; |
|
|
$facility_temp_no = $_POST['facility_temp_no']; |
|
|
// 作番號 |
|
|
|
|
|
$facilityno = $_POST['facilityno']; |
|
|
$facilityno = $_POST['facilityno']; |
|
|
// 客戶名稱 |
|
|
|
|
|
$custom = $_POST['custom']; |
|
|
$custom = $_POST['custom']; |
|
|
// 工地負責人 |
|
|
|
|
|
$site_manager = $_POST['site_manager']; |
|
|
$site_manager = $_POST['site_manager']; |
|
|
// 緯度 |
|
|
|
|
|
$latitude = $_POST['latitude']; |
|
|
$latitude = $_POST['latitude']; |
|
|
// 經度 |
|
|
|
|
|
$longitude = $_POST['longitude']; |
|
|
$longitude = $_POST['longitude']; |
|
|
$weight = $_POST['weight']; |
|
|
$weight = $_POST['weight']; |
|
|
// 人乘 |
|
|
|
|
|
$numberofpassenger = $_POST['numberofpassenger']; |
|
|
$numberofpassenger = $_POST['numberofpassenger']; |
|
|
// 樓停 |
|
|
|
|
|
$numberofstop = $_POST['numberofstop']; |
|
|
$numberofstop = $_POST['numberofstop']; |
|
|
// 樓層 |
|
|
|
|
|
$numberoffloor = $_POST['numberoffloor']; |
|
|
$numberoffloor = $_POST['numberoffloor']; |
|
|
// 開門方式 |
|
|
|
|
|
$opentype = $_POST['opentype']; |
|
|
$opentype = $_POST['opentype']; |
|
|
// 速度 |
|
|
|
|
|
$speed = $_POST['speed']; |
|
|
$speed = $_POST['speed']; |
|
|
// 機型 |
|
|
|
|
|
$facility_kind = $_POST['facility_kind']; |
|
|
$facility_kind = $_POST['facility_kind']; |
|
|
// 地址 |
|
|
|
|
|
$address = $_POST['address']; |
|
|
$address = $_POST['address']; |
|
|
// 工地地址 |
|
|
|
|
|
$real_address = $_POST['real_address']; |
|
|
$real_address = $_POST['real_address']; |
|
|
//合約到貨日 |
|
|
|
|
|
$contract_arrival_date = $_POST['contract_arrival_date']; |
|
|
$contract_arrival_date = $_POST['contract_arrival_date']; |
|
|
//合約到貨日 |
|
|
|
|
|
$real_contract_arrival_date = $_POST['real_contract_arrival_date']; |
|
|
$real_contract_arrival_date = $_POST['real_contract_arrival_date']; |
|
|
|
|
|
|
|
|
//营业规格确认 |
|
|
|
|
|
$sales_spec_verify = $_POST['sales_spec_verify']; |
|
|
$sales_spec_verify = $_POST['sales_spec_verify']; |
|
|
$sales_spec_verify_at = $_POST['sales_spec_verify_at'] ?: $row['sales_spec_verify_at']; |
|
|
$sales_spec_verify_at = $_POST['sales_spec_verify_at'] ?: $row['sales_spec_verify_at']; |
|
|
$sales_spec_verify_owner = $_POST['sales_spec_verify_owner'] ?: $row['sales_spec_verify_owner']; |
|
|
$sales_spec_verify_owner = $_POST['sales_spec_verify_owner'] ?: $row['sales_spec_verify_owner']; |
|
|
//客户计划图确认 |
|
|
|
|
|
$real_custom_name = $_POST['real_custom_name'] ?: $row['real_custom_name']; |
|
|
$real_custom_name = $_POST['real_custom_name'] ?: $row['real_custom_name']; |
|
|
$customer_planning_verify = $_POST['customer_planning_verify']; |
|
|
$customer_planning_verify = $_POST['customer_planning_verify']; |
|
|
$customer_planning_verify_at = $_POST['customer_planning_verify_at'] ?: $row['customer_planning_verify_at']; |
|
|
$customer_planning_verify_at = $_POST['customer_planning_verify_at'] ?: $row['customer_planning_verify_at']; |
|
|
$customer_planning_verify_owner = $_POST['customer_planning_verify_owner'] ?: $row['customer_planning_verify_owner']; |
|
|
$customer_planning_verify_owner = $_POST['customer_planning_verify_owner'] ?: $row['customer_planning_verify_owner']; |
|
|
//客户颜色确认 |
|
|
|
|
|
$customer_color_verify = $_POST['customer_color_verify']; |
|
|
$customer_color_verify = $_POST['customer_color_verify']; |
|
|
$customer_color_verify_at = $_POST['customer_color_verify_at'] ?: $row['customer_color_verify_at']; |
|
|
$customer_color_verify_at = $_POST['customer_color_verify_at'] ?: $row['customer_color_verify_at']; |
|
|
$customer_color_verify_owner = $_POST['customer_color_verify_owner'] ?: $row['customer_color_verify_owner']; |
|
|
$customer_color_verify_owner = $_POST['customer_color_verify_owner'] ?: $row['customer_color_verify_owner']; |
|
|
//客户颜色确认 |
|
|
|
|
|
$customer_style_verify = $_POST['customer_style_verify']; |
|
|
$customer_style_verify = $_POST['customer_style_verify']; |
|
|
$customer_style_verify_at = $_POST['customer_style_verify_at'] ?: $row['customer_style_verify_at']; |
|
|
$customer_style_verify_at = $_POST['customer_style_verify_at'] ?: $row['customer_style_verify_at']; |
|
|
$customer_style_verify_owner = $_POST['customer_style_verify_owner'] ?: $row['customer_style_verify_owner']; |
|
|
$customer_style_verify_owner = $_POST['customer_style_verify_owner'] ?: $row['customer_style_verify_owner']; |
|
|
//工勘聯絡表 |
|
|
|
|
|
$site_survey_contact_form_verify = $_POST['site_survey_contact_form_verify']; |
|
|
$site_survey_contact_form_verify = $_POST['site_survey_contact_form_verify']; |
|
|
$site_survey_contact_form_verify_at = $_POST['site_survey_contact_form_verify_at'] ?: $row['site_survey_contact_form_verify_at']; |
|
|
$site_survey_contact_form_verify_at = $_POST['site_survey_contact_form_verify_at'] ?: $row['site_survey_contact_form_verify_at']; |
|
|
$site_survey_contact_form_verify_owner = $_POST['site_survey_contact_form_verify_owner'] ?: $row['site_survey_contact_form_verify_owner']; |
|
|
$site_survey_contact_form_verify_owner = $_POST['site_survey_contact_form_verify_owner'] ?: $row['site_survey_contact_form_verify_owner']; |
|
|
|
|
|
|
|
|
//设计规格确认 |
|
|
|
|
|
$desin_spec_verify = $_POST['desin_spec_verify']; |
|
|
$desin_spec_verify = $_POST['desin_spec_verify']; |
|
|
$desin_spec_verify_at = $_POST['desin_spec_verify_at'] ?: $row['desin_spec_verify_at']; |
|
|
$desin_spec_verify_at = $_POST['desin_spec_verify_at'] ?: $row['desin_spec_verify_at']; |
|
|
$desin_spec_verify_owner = $_POST['desin_spec_verify_owner'] ?: $row['desin_spec_verify_owner']; |
|
|
$desin_spec_verify_owner = $_POST['desin_spec_verify_owner'] ?: $row['desin_spec_verify_owner']; |
|
|
//设计计划图确认 |
|
|
|
|
|
$desin_planning_verify = $_POST['desin_planning_verify']; |
|
|
$desin_planning_verify = $_POST['desin_planning_verify']; |
|
|
$desin_planning_verify_at = $_POST['desin_planning_verify_at'] ?: $row['desin_planning_verify_at']; |
|
|
$desin_planning_verify_at = $_POST['desin_planning_verify_at'] ?: $row['desin_planning_verify_at']; |
|
|
$desin_planning_verify_owner = $_POST['desin_planning_verify_owner'] ?: $row['desin_planning_verify_owner']; |
|
|
$desin_planning_verify_owner = $_POST['desin_planning_verify_owner'] ?: $row['desin_planning_verify_owner']; |
|
|
//设计颜色确认 |
|
|
|
|
|
$desin_color_verify = $_POST['desin_color_verify']; |
|
|
$desin_color_verify = $_POST['desin_color_verify']; |
|
|
$desin_color_verify_at = $_POST['desin_color_verify_at'] ?: $row['desin_color_verify_at']; |
|
|
$desin_color_verify_at = $_POST['desin_color_verify_at'] ?: $row['desin_color_verify_at']; |
|
|
$desin_color_verify_owner = $_POST['desin_color_verify_owner'] ?: $row['desin_color_verify_owner']; |
|
|
$desin_color_verify_owner = $_POST['desin_color_verify_owner'] ?: $row['desin_color_verify_owner']; |
|
|
//设计仕样确认 |
|
|
|
|
|
$desin_style_verify = $_POST['desin_style_verify']; |
|
|
$desin_style_verify = $_POST['desin_style_verify']; |
|
|
$desin_style_verify_at = $_POST['desin_style_verify_at'] ?: $row['desin_style_verify_at']; |
|
|
$desin_style_verify_at = $_POST['desin_style_verify_at'] ?: $row['desin_style_verify_at']; |
|
|
$desin_style_verify_owner = $_POST['desin_style_verify_owner'] ?: $row['desin_style_verify_owner']; |
|
|
$desin_style_verify_owner = $_POST['desin_style_verify_owner'] ?: $row['desin_style_verify_owner']; |
|
|
//设计主管確認 |
|
|
|
|
|
$desin_leader_verify = $_POST['desin_leader_verify']; |
|
|
$desin_leader_verify = $_POST['desin_leader_verify']; |
|
|
$desin_leader_verify_at = $_POST['desin_leader_verify_at'] ?: $row['desin_leader_verify_at']; |
|
|
$desin_leader_verify_at = $_POST['desin_leader_verify_at'] ?: $row['desin_leader_verify_at']; |
|
|
$desin_leader_verify_owner = $_POST['desin_leader_verify_owner'] ?: $row['desin_leader_verify_owner']; |
|
|
$desin_leader_verify_owner = $_POST['desin_leader_verify_owner'] ?: $row['desin_leader_verify_owner']; |
|
|
//楼高通报 |
|
|
|
|
|
$building_heigh_verify = $_POST['building_heigh_verify']; |
|
|
$building_heigh_verify = $_POST['building_heigh_verify']; |
|
|
$building_heigh_verify_at = $_POST['building_heigh_verify_at'] ?: $row['building_heigh_verify_at']; |
|
|
$building_heigh_verify_at = $_POST['building_heigh_verify_at'] ?: $row['building_heigh_verify_at']; |
|
|
$building_heigh_verify_owner = $_POST['building_heigh_verify_owner'] ?: $row['building_heigh_verify_owner']; |
|
|
$building_heigh_verify_owner = $_POST['building_heigh_verify_owner'] ?: $row['building_heigh_verify_owner']; |
|
|
//工勘 |
|
|
|
|
|
$site_survey_contact_verify = $_POST['site_survey_contact_verify']; |
|
|
$site_survey_contact_verify = $_POST['site_survey_contact_verify']; |
|
|
$site_survey_contact_verify_at = $_POST['site_survey_contact_verify_at'] ?: $row['site_survey_contact_verify_at']; |
|
|
$site_survey_contact_verify_at = $_POST['site_survey_contact_verify_at'] ?: $row['site_survey_contact_verify_at']; |
|
|
$site_survey_contact_verify_owner = $_POST['site_survey_contact_verify_owner'] ?: $row['site_survey_contact_verify_owner']; |
|
|
$site_survey_contact_verify_owner = $_POST['site_survey_contact_verify_owner'] ?: $row['site_survey_contact_verify_owner']; |
|
|
$old_site_survey_contact_verify = $_POST['old_site_survey_contact_verify']; |
|
|
$old_site_survey_contact_verify = $_POST['old_site_survey_contact_verify']; |
|
|
|
|
|
|
|
|
//是否齊備 |
|
|
|
|
|
$shengguanok_status = $_POST['shengguanok_status']; |
|
|
$shengguanok_status = $_POST['shengguanok_status']; |
|
|
$shengguanok_status_at = $_POST['shengguanok_status_at']; |
|
|
$shengguanok_status_at = $_POST['shengguanok_status_at']; |
|
|
$shengguanok_status_owner = $_POST['shengguanok_status_owner'] ?: $row['shengguanok_status_owner']; |
|
|
$shengguanok_status_owner = $_POST['shengguanok_status_owner'] ?: $row['shengguanok_status_owner']; |
|
|
//下單日(普萊特富) |
|
|
|
|
|
$prattford_order_date_verify = $_POST['prattford_order_date_verify']; |
|
|
$prattford_order_date_verify = $_POST['prattford_order_date_verify']; |
|
|
$prattford_order_date = $_POST['prattford_order_date']; |
|
|
$prattford_order_date = $_POST['prattford_order_date']; |
|
|
$prattford_order_date_owner = $_POST['prattford_order_date_owner'] ?: $row['prattford_order_date_owner']; |
|
|
$prattford_order_date_owner = $_POST['prattford_order_date_owner'] ?: $row['prattford_order_date_owner']; |
|
|
// 預計發貨日(到港日) |
|
|
|
|
|
$estimated_shipping_date_verify = $_POST['estimated_shipping_date_verify']; |
|
|
$estimated_shipping_date_verify = $_POST['estimated_shipping_date_verify']; |
|
|
$estimated_shipping_date = $_POST['estimated_shipping_date']; |
|
|
$estimated_shipping_date = $_POST['estimated_shipping_date']; |
|
|
$estimated_shipping_date_owner = $_POST['estimated_shipping_date_owner'] ?: $row['estimated_shipping_date_owner']; |
|
|
$estimated_shipping_date_owner = $_POST['estimated_shipping_date_owner'] ?: $row['estimated_shipping_date_owner']; |
|
|
// 預計船期(改成預計到廠日) |
|
|
|
|
|
$estimated_shipping_schedule_date_verify = $_POST['estimated_shipping_schedule_date_verify']; |
|
|
$estimated_shipping_schedule_date_verify = $_POST['estimated_shipping_schedule_date_verify']; |
|
|
$estimated_shipping_schedule_date = $_POST['estimated_shipping_schedule_date']; |
|
|
$estimated_shipping_schedule_date = $_POST['estimated_shipping_schedule_date']; |
|
|
$estimated_shipping_schedule_date_owner = $_POST['estimated_shipping_schedule_date_owner'] ?: $row['estimated_shipping_schedule_date_owner']; |
|
|
$estimated_shipping_schedule_date_owner = $_POST['estimated_shipping_schedule_date_owner'] ?: $row['estimated_shipping_schedule_date_owner']; |
|
|
// 普來特富發貨類別 |
|
|
|
|
|
$goods_type = $_POST['goods_type'] ?: $row['goods_type']; |
|
|
$goods_type = $_POST['goods_type'] ?: $row['goods_type']; |
|
|
$goods_type_date = $_POST['goods_type_date'] ?: $row['goods_type_date']; |
|
|
$goods_type_date = $_POST['goods_type_date'] ?: $row['goods_type_date']; |
|
|
$goods_type_owner = $_POST['goods_type_owner'] ?: $row['goods_type_owner']; |
|
|
$goods_type_owner = $_POST['goods_type_owner'] ?: $row['goods_type_owner']; |
|
|
// 台灣自理發貨類別 |
|
|
|
|
|
$taiwan_goods_type = $_POST['taiwan_goods_type'] ?: $row['taiwan_goods_type']; |
|
|
$taiwan_goods_type = $_POST['taiwan_goods_type'] ?: $row['taiwan_goods_type']; |
|
|
$taiwan_goods_type_date = $_POST['taiwan_goods_type_date']; |
|
|
$taiwan_goods_type_date = $_POST['taiwan_goods_type_date']; |
|
|
$taiwan_goods_type_owner = $_POST['taiwan_goods_type_owner'] ?: $row['taiwan_goods_type_owner']; |
|
|
$taiwan_goods_type_owner = $_POST['taiwan_goods_type_owner'] ?: $row['taiwan_goods_type_owner']; |
|
|
// 實際到貨日 |
|
|
|
|
|
$arrival_date_verify = $_POST['arrival_date_verify'] ?: $row['arrival_date_verify']; |
|
|
$arrival_date_verify = $_POST['arrival_date_verify'] ?: $row['arrival_date_verify']; |
|
|
$actual_tofactory_date = $_POST['actual_tofactory_date']; |
|
|
$actual_tofactory_date = $_POST['actual_tofactory_date']; |
|
|
$arrival_date_owner = $_POST['arrival_date_owner'] ?: $row['arrival_da |
|
|
$arrival_date_owner = $_POST['arrival_date_owner'] ?: $row['arrival_da |
|
|
te_owner']; |
|
|
te_owner']; |
|
|
|
|
|
|
|
|
// 各部門備註 |
|
|
|
|
|
$marketing_remark = $_POST['marketing_remark'] ?: $row['marketing_remark']; |
|
|
$marketing_remark = $_POST['marketing_remark'] ?: $row['marketing_remark']; |
|
|
$desin_remark = $_POST['desin_remark'] ?: $row['desin_remark']; |
|
|
$desin_remark = $_POST['desin_remark'] ?: $row['desin_remark']; |
|
|
$desin_leader_remark = $_POST['desin_leader_remark'] ?: $row['desin_leader_remark']; |
|
|
$desin_leader_remark = $_POST['desin_leader_remark'] ?: $row['desin_leader_remark']; |
|
|
$warehouse_remark = $_POST['warehouse_remark'] ?: $row['warehouse_remark']; |
|
|
$warehouse_remark = $_POST['warehouse_remark'] ?: $row['warehouse_remark']; |
|
|
$yewu_remark = $_POST['yewu_remark'] ?: $row['yewu_remark']; |
|
|
$yewu_remark = $_POST['yewu_remark'] ?: $row['yewu_remark']; |
|
|
$shengguan_remark = $_POST['shengguan_remark'] ?: $row['shengguan_remark']; |
|
|
$shengguan_remark = $_POST['shengguan_remark'] ?: $row['shengguan_remark']; |
|
|
|
|
|
|
|
|
// 台製件 |
|
|
|
|
|
$desin_taiwan_items_no = json_encode($_POST['desin_taiwan_items_no'], JSON_UNESCAPED_UNICODE); |
|
|
$desin_taiwan_items_no = json_encode($_POST['desin_taiwan_items_no'], JSON_UNESCAPED_UNICODE); |
|
|
$desin_taiwan_items_name = json_encode($_POST['desin_taiwan_items_name'], JSON_UNESCAPED_UNICODE); |
|
|
$desin_taiwan_items_name = json_encode($_POST['desin_taiwan_items_name'], JSON_UNESCAPED_UNICODE); |
|
|
$desin_taiwan_items_no = $desin_taiwan_items_no == 'null' ? null : $desin_taiwan_items_no; |
|
|
$desin_taiwan_items_no = $desin_taiwan_items_no == 'null' ? null : $desin_taiwan_items_no; |
|
|
$desin_taiwan_items_name = $desin_taiwan_items_name == 'null' ? null : $desin_taiwan_items_name; |
|
|
$desin_taiwan_items_name = $desin_taiwan_items_name == 'null' ? null : $desin_taiwan_items_name; |
|
|
|
|
|
|
|
|
// 品証部 |
|
|
|
|
|
$qc_date = $_POST['qc_date'] ?: $row['qc_date']; |
|
|
$qc_date = $_POST['qc_date'] ?: $row['qc_date']; |
|
|
$qc_date_owner = $_POST['qc_date_owner'] ?: $row['qc_date_owner']; |
|
|
$qc_date_owner = $_POST['qc_date_owner'] ?: $row['qc_date_owner']; |
|
|
$end_qc_date = $_POST['end_qc_date'] ?: $row['end_qc_date']; |
|
|
$end_qc_date = $_POST['end_qc_date'] ?: $row['end_qc_date']; |
|
@ -154,8 +109,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
$delivery_date = $_POST['delivery_date'] ?: $row['delivery_date']; |
|
|
$delivery_date = $_POST['delivery_date'] ?: $row['delivery_date']; |
|
|
$delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner']; |
|
|
$delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner']; |
|
|
$qc_official_type = $_POST['qc_official_type'] ?: $row['qc_official_type']; |
|
|
$qc_official_type = $_POST['qc_official_type'] ?: $row['qc_official_type']; |
|
|
|
|
|
|
|
|
// 工務助理 |
|
|
|
|
|
$outsourcer_type = $_POST['outsourcer_type']; |
|
|
$outsourcer_type = $_POST['outsourcer_type']; |
|
|
$install_outsourcer = $_POST['install_outsourcer']; |
|
|
$install_outsourcer = $_POST['install_outsourcer']; |
|
|
$install_outsourcer_owner = $_POST['install_outsourcer_owner']; |
|
|
$install_outsourcer_owner = $_POST['install_outsourcer_owner']; |
|
@ -175,8 +128,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
$estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner']; |
|
|
$estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner']; |
|
|
$warehouse_assistant_remark = $_POST['warehouse_assistant_remark']; |
|
|
$warehouse_assistant_remark = $_POST['warehouse_assistant_remark']; |
|
|
|
|
|
|
|
|
$creater = $_POST['creater']; |
|
|
// $creater = $_POST['creater']; |
|
|
$create_at = date("Y-m-fd H:i:s"); |
|
|
$creater = $user_id; |
|
|
|
|
|
$create_at = date("Y-m-d H:i:s"); |
|
|
|
|
|
|
|
|
// 上傳附件 |
|
|
// 上傳附件 |
|
|
include "wipwhole-rec-invoice-edit-fileupload.php"; |
|
|
include "wipwhole-rec-invoice-edit-fileupload.php"; |
|
@ -197,29 +151,16 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
$content = "客戶:$custom |
|
|
$content = "客戶:$custom |
|
|
作番:$facilityno |
|
|
作番:$facilityno |
|
|
官檢日 $old_official_check_date => $official_check_date"; |
|
|
官檢日 $old_official_check_date => $official_check_date"; |
|
|
|
|
|
$data = array( |
|
|
$sql = " |
|
|
'kind' => 1, |
|
|
INSERT INTO notice( |
|
|
'related_id' => $id, |
|
|
kind, |
|
|
'title' => $title, |
|
|
related_id, |
|
|
'content' => $content, |
|
|
title, |
|
|
'permission' => $permission, |
|
|
content, |
|
|
'creater' => $creater, |
|
|
haveread, |
|
|
'create_at' => date("Y-m-d H:i:s") |
|
|
permission, |
|
|
|
|
|
creater, |
|
|
|
|
|
create_at |
|
|
|
|
|
)VALUES( |
|
|
|
|
|
'1', |
|
|
|
|
|
'$id', |
|
|
|
|
|
'$title', |
|
|
|
|
|
'$content', |
|
|
|
|
|
null, |
|
|
|
|
|
'$permission', |
|
|
|
|
|
'$creater', |
|
|
|
|
|
'" . date("Y-m-d H:i:s") . "' |
|
|
|
|
|
); |
|
|
); |
|
|
"; |
|
|
$cn->sendx($data); |
|
|
mysqli_query($link, $sql); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -265,62 +206,44 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
作番:$facilityno |
|
|
作番:$facilityno |
|
|
工勘狀態 $site_survey_status[$old_site_survey_contact_verify] => $site_survey_status[$site_survey_contact_verify]"; |
|
|
工勘狀態 $site_survey_status[$old_site_survey_contact_verify] => $site_survey_status[$site_survey_contact_verify]"; |
|
|
|
|
|
|
|
|
$sql = " |
|
|
$data = array( |
|
|
INSERT INTO notice( |
|
|
'kind' => 1, |
|
|
kind, |
|
|
'related_id' => $id, |
|
|
related_id, |
|
|
'title' => $title, |
|
|
title, |
|
|
'content' => $content, |
|
|
content, |
|
|
'permission' => $permission, |
|
|
haveread, |
|
|
'creater' => $creater, |
|
|
permission, |
|
|
'create_at' => date("Y-m-d H:i:s") |
|
|
creater, |
|
|
|
|
|
create_at |
|
|
|
|
|
)VALUES( |
|
|
|
|
|
'1', |
|
|
|
|
|
'$id', |
|
|
|
|
|
'$title', |
|
|
|
|
|
'$content', |
|
|
|
|
|
null, |
|
|
|
|
|
'$permission', |
|
|
|
|
|
'$creater', |
|
|
|
|
|
'$create_at' |
|
|
|
|
|
); |
|
|
); |
|
|
"; |
|
|
$cn->sendx($data); |
|
|
mysqli_query($link, $sql); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!empty($desin_documents_verify_file)) { |
|
|
if (!empty($desin_documents_verify_file)) { |
|
|
echo $sql = " |
|
|
$title = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件"; |
|
|
INSERT INTO notice( |
|
|
$content = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件"; |
|
|
kind, |
|
|
$data = array( |
|
|
related_id, |
|
|
'kind' => 1, |
|
|
title, |
|
|
'related_id' => $id, |
|
|
content, |
|
|
'title' => $title, |
|
|
haveread, |
|
|
'content' => $content, |
|
|
permission, |
|
|
'permission' => "M0168", |
|
|
creater, |
|
|
'creater' => $creater, |
|
|
create_at |
|
|
'create_at' => date("Y-m-d H:i:s") |
|
|
)VALUES( |
|
|
|
|
|
'1', |
|
|
|
|
|
'$id', |
|
|
|
|
|
'合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件', |
|
|
|
|
|
'合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件', |
|
|
|
|
|
null, |
|
|
|
|
|
'M0168', |
|
|
|
|
|
'$creater', |
|
|
|
|
|
'$create_at' |
|
|
|
|
|
); |
|
|
); |
|
|
"; |
|
|
$cn->sendx($data); |
|
|
mysqli_query($link, $sql); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$updatesql = " |
|
|
$updatesql = " |
|
|
UPDATE wipwholestatus |
|
|
UPDATE wipwholestatus |
|
|
SET |
|
|
SET |
|
|
"; |
|
|
"; |
|
|
if (in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545])) { |
|
|
|
|
|
// 工務更新; |
|
|
if ( |
|
|
|
|
|
in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117', 'M0054']) |
|
|
|
|
|
|| in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545]) |
|
|
|
|
|
) { |
|
|
|
|
|
// 工務助理 工務更新 |
|
|
$updatesql .= " |
|
|
$updatesql .= " |
|
|
building_heigh_verify = '$building_heigh_verify', |
|
|
building_heigh_verify = '$building_heigh_verify', |
|
|
building_heigh_verify_at = '$building_heigh_verify_at', |
|
|
building_heigh_verify_at = '$building_heigh_verify_at', |
|
@ -339,7 +262,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
$updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', "; |
|
|
$updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', "; |
|
|
if (!empty($site_survey_contact_verify_file)) |
|
|
if (!empty($site_survey_contact_verify_file)) |
|
|
$updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', "; |
|
|
$updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', "; |
|
|
} else if ($user_department_id == 311 || $user_department_id == 312 || $user_department_id == 313 || $user_department_id == 314 || $user_department_id == 315) { |
|
|
} else if (in_array($user_department_id, [311, 312, 313, 314, 315])) { |
|
|
// 營業更新; |
|
|
// 營業更新; |
|
|
$updatesql .= " |
|
|
$updatesql .= " |
|
|
sales_spec_verify = '$sales_spec_verify', |
|
|
sales_spec_verify = '$sales_spec_verify', |
|
@ -430,26 +353,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
$updatesql .= "desin_documents_verify_file = '$desin_documents_verify_file', "; |
|
|
$updatesql .= "desin_documents_verify_file = '$desin_documents_verify_file', "; |
|
|
} |
|
|
} |
|
|
} else if ($user_department_id == 321) { |
|
|
} else if ($user_department_id == 321) { |
|
|
// 共用更新 |
|
|
|
|
|
// $updatesql .= " |
|
|
|
|
|
// contractno = '$contractno', |
|
|
|
|
|
// facility_temp_no = '$facility_temp_no', |
|
|
|
|
|
// facilityno = '$facilityno', |
|
|
|
|
|
// custom='$custom' , |
|
|
|
|
|
// latitude = '$latitude', |
|
|
|
|
|
// longitude = '$longitude', |
|
|
|
|
|
// weight = '$weight', |
|
|
|
|
|
// numberofpassenger = '$numberofpassenger', |
|
|
|
|
|
// numberofstop = '$numberofstop', |
|
|
|
|
|
// numberoffloor = '$numberoffloor', |
|
|
|
|
|
// opentype = '$opentype', |
|
|
|
|
|
// speed = '$speed', |
|
|
|
|
|
// site_manager = '$site_manager', |
|
|
|
|
|
// address = '$address', |
|
|
|
|
|
// real_address = '$real_address', |
|
|
|
|
|
// contract_arrival_date = '$contract_arrival_date', |
|
|
|
|
|
// facility_kind = '$facility_kind', |
|
|
|
|
|
// "; |
|
|
|
|
|
// 業務更新 |
|
|
// 業務更新 |
|
|
$updatesql .= " |
|
|
$updatesql .= " |
|
|
prattford_order_date_verify = '$prattford_order_date_verify' , |
|
|
prattford_order_date_verify = '$prattford_order_date_verify' , |
|
@ -540,9 +443,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
|
|
|
|
|
|
// 工務助理 |
|
|
// 工務助理 |
|
|
if ( |
|
|
if ( |
|
|
in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117']) |
|
|
in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117', 'M0054']) |
|
|
|| in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545]) |
|
|
|| in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545]) |
|
|
|| $user_id == 'M0054' |
|
|
|
|
|
) { |
|
|
) { |
|
|
|
|
|
|
|
|
$qc_official_type = $_POST['qc_official_type2'] ?: $row['qc_official_type']; |
|
|
$qc_official_type = $_POST['qc_official_type2'] ?: $row['qc_official_type']; |
|
@ -566,9 +468,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
$tryrun_end_date_owner = $_POST['tryrun_end_date2_owner'] ?: $row['tryrun_end_date_owner']; |
|
|
$tryrun_end_date_owner = $_POST['tryrun_end_date2_owner'] ?: $row['tryrun_end_date_owner']; |
|
|
|
|
|
|
|
|
$updatesql .= " |
|
|
$updatesql .= " |
|
|
|
|
|
|
|
|
qc_official_type = '$qc_official_type', |
|
|
qc_official_type = '$qc_official_type', |
|
|
|
|
|
|
|
|
install_start_date = '$install_start_date', |
|
|
install_start_date = '$install_start_date', |
|
|
install_start_date_owner = '$install_start_date_owner', |
|
|
install_start_date_owner = '$install_start_date_owner', |
|
|
install_end_date = '$install_end_date', |
|
|
install_end_date = '$install_end_date', |
|
@ -577,7 +477,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
tryrun_start_date_owner = '$tryrun_start_date_owner', |
|
|
tryrun_start_date_owner = '$tryrun_start_date_owner', |
|
|
tryrun_end_date = '$tryrun_end_date', |
|
|
tryrun_end_date = '$tryrun_end_date', |
|
|
tryrun_end_date_owner = '$tryrun_end_date_owner', |
|
|
tryrun_end_date_owner = '$tryrun_end_date_owner', |
|
|
|
|
|
|
|
|
delivery_date = '$delivery_date', |
|
|
delivery_date = '$delivery_date', |
|
|
delivery_date_owner = '$delivery_date_owner', |
|
|
delivery_date_owner = '$delivery_date_owner', |
|
|
qc_date = '$qc_date', |
|
|
qc_date = '$qc_date', |
|
@ -586,7 +485,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
end_qc_date_owner = '$end_qc_date_owner', |
|
|
end_qc_date_owner = '$end_qc_date_owner', |
|
|
official_check_date = '$official_check_date', |
|
|
official_check_date = '$official_check_date', |
|
|
official_check_date_owner = '$official_check_date_owner', |
|
|
official_check_date_owner = '$official_check_date_owner', |
|
|
|
|
|
|
|
|
outsourcer_type = '$outsourcer_type', |
|
|
outsourcer_type = '$outsourcer_type', |
|
|
install_outsourcer = '$install_outsourcer', |
|
|
install_outsourcer = '$install_outsourcer', |
|
|
install_outsourcer_owner = '$install_outsourcer_owner', |
|
|
install_outsourcer_owner = '$install_outsourcer_owner', |
|
@ -739,6 +637,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
|
|
|
|
|
|
if ($_POST['form_name'] == 'update_contract_date_form') { |
|
|
if ($_POST['form_name'] == 'update_contract_date_form') { |
|
|
foreach ($_POST as $k => $v) |
|
|
foreach ($_POST as $k => $v) |
|
|
$$k = htmlspecialchars(stripslashes(trim($v))); |
|
|
$$k = htmlspecialchars(stripslashes(trim($v))); |
|
@ -746,8 +645,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
$contractno = $_POST['contractno']; |
|
|
$contractno = $_POST['contractno']; |
|
|
$facilityno = $_POST['facilityno']; |
|
|
$facilityno = $_POST['facilityno']; |
|
|
$custom = $_POST['custom']; |
|
|
$custom = $_POST['custom']; |
|
|
$creater = $_POST['creater']; |
|
|
// $creater = $_POST['creater']; |
|
|
$create_at = $_POST['create_at']; |
|
|
$creater = $user_id; |
|
|
|
|
|
// $create_at = $_POST['create_at']; |
|
|
|
|
|
$create_at = date("Y-m-d H:i:s"); |
|
|
$old_real_contract_arrival_date = $_POST['old_real_contract_arrival_date']; |
|
|
$old_real_contract_arrival_date = $_POST['old_real_contract_arrival_date']; |
|
|
$real_contract_arrival_date = $_POST['real_contract_arrival_date']; |
|
|
$real_contract_arrival_date = $_POST['real_contract_arrival_date']; |
|
|
$salesid = $_POST['salesid']; |
|
|
$salesid = $_POST['salesid']; |
|
@ -762,54 +663,33 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
"; |
|
|
"; |
|
|
mysqli_query($link, $updatesql); |
|
|
mysqli_query($link, $updatesql); |
|
|
|
|
|
|
|
|
|
|
|
$title = "作番大日程(新梯)出貨日調整通知 > " . $facilityno; |
|
|
$content = "合約號 : $contractno |
|
|
$content = "合約號 : $contractno |
|
|
作番號 : $facilityno |
|
|
作番號 : $facilityno |
|
|
出貨日期微調: " . substr($old_real_contract_arrival_date, 0, 10) . " => " . substr($real_contract_arrival_date, 0, 10); |
|
|
出貨日期微調: " . substr($old_real_contract_arrival_date, 0, 10) . " => " . substr($real_contract_arrival_date, 0, 10); |
|
|
|
|
|
|
|
|
$sql = " |
|
|
|
|
|
INSERT INTO notice ( |
|
|
$data = array( |
|
|
kind, |
|
|
'kind' => 1, |
|
|
related_id, |
|
|
'related_id' => $id, |
|
|
title, |
|
|
'title' => $title, |
|
|
content, |
|
|
'content' => $content, |
|
|
haveread, |
|
|
'permission' => $salesid, |
|
|
permission, |
|
|
'creater' => 'system', |
|
|
creater, |
|
|
'create_at' => date("Y-m-d H:i:s") |
|
|
create_at |
|
|
); |
|
|
) VALUES( |
|
|
$cn->sendx($data); |
|
|
'1', |
|
|
|
|
|
'$id', |
|
|
$data = array( |
|
|
'作番大日程(新梯)出貨日調整通知 > " . $facilityno . "', |
|
|
'kind' => 1, |
|
|
'$content', |
|
|
'related_id' => $id, |
|
|
NULL, |
|
|
'title' => $title, |
|
|
'$salesid', |
|
|
'content' => $content, |
|
|
'system', |
|
|
'permission' => $gongWuokid, |
|
|
'" . date("Y-m-d H:i:s") . "' |
|
|
'creater' => 'system', |
|
|
) |
|
|
'create_at' => date("Y-m-d H:i:s") |
|
|
"; |
|
|
); |
|
|
mysqli_query($link, $sql); |
|
|
$cn->sendx($data); |
|
|
$sql = " |
|
|
|
|
|
INSERT INTO notice ( |
|
|
|
|
|
kind, |
|
|
|
|
|
related_id, |
|
|
|
|
|
title, |
|
|
|
|
|
content, |
|
|
|
|
|
haveread, |
|
|
|
|
|
permission, |
|
|
|
|
|
creater, |
|
|
|
|
|
create_at |
|
|
|
|
|
) VALUES( |
|
|
|
|
|
'1', |
|
|
|
|
|
'$id', |
|
|
|
|
|
'作番大日程(新梯)出貨日調整通知 > " . $facilityno . "', |
|
|
|
|
|
'$content', |
|
|
|
|
|
NULL, |
|
|
|
|
|
'$gongWuokid', |
|
|
|
|
|
'system', |
|
|
|
|
|
'" . date("Y-m-d H:i:s") . "' |
|
|
|
|
|
) |
|
|
|
|
|
"; |
|
|
|
|
|
mysqli_query($link, $sql); |
|
|
|
|
|
|
|
|
|
|
|
$sql = " |
|
|
$sql = " |
|
|
INSERT INTO wipwhole_change_contractdate_details ( |
|
|
INSERT INTO wipwhole_change_contractdate_details ( |
|
@ -839,6 +719,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
|
|
|
|
|
|
if ($_POST['form_name'] == 'update_date_form') { |
|
|
if ($_POST['form_name'] == 'update_date_form') { |
|
|
|
|
|
|
|
|
$creater = $user_id; |
|
|
$creater = $user_id; |
|
@ -874,28 +755,16 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
作番:$facilityno |
|
|
作番:$facilityno |
|
|
實際出貨日(到工地):$real_arrival_date"; |
|
|
實際出貨日(到工地):$real_arrival_date"; |
|
|
|
|
|
|
|
|
$sql = " |
|
|
$data = array( |
|
|
INSERT INTO notice( |
|
|
'kind' => 1, |
|
|
kind, |
|
|
'related_id' => $id, |
|
|
related_id, |
|
|
'title' => $title, |
|
|
title, |
|
|
'content' => $content, |
|
|
content, |
|
|
'permission' => $permission, |
|
|
haveread, |
|
|
'creater' => $creater, |
|
|
permission, |
|
|
'create_at' => date("Y-m-d H:i:s") |
|
|
creater, |
|
|
|
|
|
create_at |
|
|
|
|
|
)VALUES( |
|
|
|
|
|
'1', |
|
|
|
|
|
'$id', |
|
|
|
|
|
'$title', |
|
|
|
|
|
'$content', |
|
|
|
|
|
null, |
|
|
|
|
|
'$permission', |
|
|
|
|
|
'$creater', |
|
|
|
|
|
'" . date("Y-m-d H:i:s") . "' |
|
|
|
|
|
); |
|
|
); |
|
|
"; |
|
|
$cn->sendx($data); |
|
|
mysqli_query($link, $sql); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
echo "<script type ='text/JavaScript'>"; |
|
|
echo "<script type ='text/JavaScript'>"; |
|
@ -954,7 +823,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
foreach ($_POST as $k => $v) |
|
|
foreach ($_POST as $k => $v) |
|
|
$$k = htmlspecialchars(stripslashes(trim($v))); |
|
|
$$k = htmlspecialchars(stripslashes(trim($v))); |
|
|
|
|
|
|
|
|
$creater = $_POST['creater']; |
|
|
// $creater = $_POST['creater']; |
|
|
|
|
|
$creater = $user_id; |
|
|
$datetime = date("Y-m-d H:i:s"); |
|
|
$datetime = date("Y-m-d H:i:s"); |
|
|
$shengguan_remark = $_POST['shengguan_remark']; |
|
|
$shengguan_remark = $_POST['shengguan_remark']; |
|
|
$updatesql = " |
|
|
$updatesql = " |
|
@ -995,40 +865,6 @@ function write_note($link, $id, $user_id, $content) |
|
|
mysqli_query($link, $updatesql); |
|
|
mysqli_query($link, $updatesql); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// function getWipwholestatusDetail($link, $id) |
|
|
|
|
|
// { |
|
|
|
|
|
// $sql = " |
|
|
|
|
|
// SELECT * |
|
|
|
|
|
// FROM wipwholestatus |
|
|
|
|
|
// WHERE 1=1 |
|
|
|
|
|
// AND id = '$id' |
|
|
|
|
|
// AND status = '1' |
|
|
|
|
|
// "; |
|
|
|
|
|
// $result = mysqli_query($link, $sql); |
|
|
|
|
|
// $row = mysqli_fetch_assoc($result); |
|
|
|
|
|
// return $row; |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// 各區營銷(契約)經理判斷程式 |
|
|
|
|
|
function checkUseridIsManager($user_id) |
|
|
|
|
|
{ |
|
|
|
|
|
// 北區 劉永德 |
|
|
|
|
|
if (in_array($user_id, ['M0137'])) |
|
|
|
|
|
return true; |
|
|
|
|
|
// 中區 李烘銘 |
|
|
|
|
|
if (in_array($user_id, ['M0086'])) |
|
|
|
|
|
return true; |
|
|
|
|
|
// 桃竹 張莉凱 |
|
|
|
|
|
if (in_array($user_id, ['M0026'])) |
|
|
|
|
|
return true; |
|
|
|
|
|
// 宜花東 陳志文 |
|
|
|
|
|
if (in_array($user_id, ['M0054'])) |
|
|
|
|
|
return true; |
|
|
|
|
|
// 南區 吳育宗 |
|
|
|
|
|
if (in_array($user_id, ['M0033'])) |
|
|
|
|
|
return true; |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 表單簽核狀態檢查主程式 |
|
|
// 表單簽核狀態檢查主程式 |
|
|
function checkWwsAssianStatus($link, $user_id, $id = null) |
|
|
function checkWwsAssianStatus($link, $user_id, $id = null) |
|
|