You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
859 lines
36 KiB
859 lines
36 KiB
<?php
|
|
|
|
/**
|
|
* 流程規則:(需更改)
|
|
* 1.A:工務主管確認中 B:營業員確認中 C:設計部門人員確認中 D:生管主管確認中 Z:生管確認完成
|
|
*
|
|
* 新梯 543 筆 (已匯入)
|
|
* 舊改 141 筆 (資料未洗入)
|
|
* 已簽回 684 筆 (共計)
|
|
*/
|
|
|
|
// error_reporting(0);
|
|
include "header.php";
|
|
|
|
// 載入db.php來連結資料庫
|
|
require_once "database.php";
|
|
|
|
|
|
// 所屬部門
|
|
$sql = "select department_id from account where accountid = '$user_id'";
|
|
$res = mysqli_query($link, $sql);
|
|
$row = mysqli_fetch_row($res);
|
|
$department_id = $row[0];
|
|
mysqli_free_result($res);
|
|
// 生管及資訊才可以訪問
|
|
if ($department_id == "321" || $department_id == "220") {
|
|
|
|
/**
|
|
* 檢查作番是否重複 true:重複 false:沒重複
|
|
* @param mysqli $link 資料庫連線檔
|
|
* @param string $facilityno 檢查的作番號
|
|
*/
|
|
function checkFacilitynoRepeat($link, $facilityno)
|
|
{
|
|
$sql = "
|
|
SELECT
|
|
COUNT(*)
|
|
FROM wipwholestatus
|
|
WHERE facilityno = '$facilityno'
|
|
";
|
|
$result = mysqli_query($link, $sql);
|
|
$row = mysqli_fetch_array($result);
|
|
return $row['0'] > 0 ? true : false;
|
|
}
|
|
|
|
// 預設新梯代碼 A
|
|
$contract_type = '';
|
|
// 合約號
|
|
$contractno = '';
|
|
// 營業員ID
|
|
$salesid = '';
|
|
// 工務人員ID
|
|
$warehouseid = '';
|
|
// 客戶姓名
|
|
$custom = '';
|
|
// 工地負責人
|
|
$site_manager = '';
|
|
// 客戶id
|
|
$accountid = '';
|
|
// 作番號
|
|
$facilityno = '';
|
|
// 號機
|
|
$facility_temp_no = '';
|
|
// 緯度
|
|
$latitude = '';
|
|
// 經度
|
|
$longitude = '';
|
|
// 載重
|
|
$weight = '';
|
|
// 人乘
|
|
$numberofpassenger = '';
|
|
// 樓停
|
|
$numberofstop = '';
|
|
// 樓層
|
|
$numberoffloor = '';
|
|
// 開門方式
|
|
$opentype = '';
|
|
// 速度
|
|
$speed = '';
|
|
// 機型
|
|
$facility_kind = '';
|
|
// 地址
|
|
$address = '';
|
|
// 合約到貨日
|
|
$contract_arrival_date = '';
|
|
// 實際到貨日
|
|
$real_contract_arrival_date = '';
|
|
|
|
// 營業規格確認
|
|
$sales_spec_verify = '';
|
|
// 營業規格附件
|
|
$sales_spec_verify_file = '';
|
|
// 營業規格確認時間
|
|
$sales_spec_verify_at = '';
|
|
// 營業規格確認人
|
|
$sales_spec_verify_owner = '';
|
|
|
|
// 客戶計劃圖確認
|
|
$customer_planning_verify = '';
|
|
// 客戶計劃圖附件
|
|
$customer_planning_verify_file = '';
|
|
// 客戶計劃圖確認時間
|
|
$customer_planning_verify_at = '';
|
|
// 客戶計劃圖確認人
|
|
$customer_planning_verify_owner = '';
|
|
|
|
// 客戶顏色確認
|
|
$customer_color_verify = '';
|
|
// 客戶顏色附件
|
|
$customer_color_verify_file = '';
|
|
// 客戶顏色確認時間
|
|
$customer_color_verify_at = '';
|
|
// 客戶顏色確認人
|
|
$customer_color_verify_owner = '';
|
|
|
|
// 工勘聯絡表
|
|
$site_survey_contact_form_verify = '';
|
|
// 工勘聯絡表附件
|
|
$site_survey_contact_form_verify_file = '';
|
|
// 工勘聯絡表確認時間
|
|
$site_survey_contact_form_verify_at = '';
|
|
// 工勘聯絡表確認人
|
|
$site_survey_contact_form_verify_owner = '';
|
|
|
|
// 設計規格確認
|
|
$desin_spec_verify = '';
|
|
// 設計規格確認附件
|
|
$desin_spec_verify_file = '';
|
|
// 設計規格確認時間
|
|
$desin_spec_verify_at = '';
|
|
// 設計規格確認確認人
|
|
$desin_spec_verify_owner = '';
|
|
|
|
// 設計計劃圖確認
|
|
$desin_planning_verify = '';
|
|
// 設計計劃圖確認附件
|
|
$desin_planning_verify_file = '';
|
|
// 設計計劃圖確認時間
|
|
$desin_planning_verify_at = '';
|
|
// 設計計劃圖確認人
|
|
$desin_planning_verify_owner = '';
|
|
|
|
// 設計顏色確認
|
|
$desin_color_verify = '';
|
|
// 設計顏色確認附件
|
|
$desin_color_verify_file = '';
|
|
// 設計顏色確認時間
|
|
$desin_color_verify_at = '';
|
|
// 設計顏色確認人
|
|
$desin_color_verify_owner = '';
|
|
|
|
// 設計仕樣確認
|
|
$desin_style_verify = '';
|
|
// 設計仕樣確認附件
|
|
$desin_style_verify_file = '';
|
|
// 設計仕樣確認時間
|
|
$desin_style_verify_at = '';
|
|
// 設計仕樣確認人
|
|
$desin_style_verify_owner = '';
|
|
|
|
// 設計主管確認
|
|
$desin_leader_verify = '';
|
|
// 設計主管確認附件
|
|
$desin_leader_verify_file = '';
|
|
// 設計主管確認時間
|
|
$desin_leader_verify_at = '';
|
|
// 設計主管確認人
|
|
$desin_leader_verify_owner = '';
|
|
|
|
// 樓高通報
|
|
$building_heigh_verify = '';
|
|
// 樓高通報附件
|
|
$building_heigh_verify_file = '';
|
|
// 樓高通報時間
|
|
$building_heigh_verify_at = '';
|
|
// 樓高通報確認人
|
|
$building_heigh_verify_owner = '';
|
|
|
|
// 電氣發貨明細
|
|
$electrical_design_publish = '';
|
|
// 電氣資料發行時間
|
|
$electrical_design_publish_at = '';
|
|
// 電氣資料發行人
|
|
$electrical_design_publish_owner = '';
|
|
|
|
// 機械資料發行
|
|
$mechanical_design_publish = '';
|
|
// 機械資料發行時間
|
|
$mechanical_design_publish_at = '';
|
|
// 機械資料發行人
|
|
$mechanical_design_publish_owner = '';
|
|
|
|
// 電氣發貨明細
|
|
$electrical_shipping_date_publish = '';
|
|
// 電氣發貨明細時間
|
|
$electrical_shipping_date_publish_at = '';
|
|
// 電氣發貨明細發行人
|
|
$electrical_shipping_date_publish_owner = '';
|
|
|
|
// 機械發貨明細
|
|
$mechanical_shipping_date_publish = '';
|
|
// 機械發貨明細時間
|
|
$mechanical_shipping_date_publish_at = '';
|
|
// 機械發貨明細發行人
|
|
$mechanical_shipping_date_publish_owner = '';
|
|
|
|
// 下單日(普來特富)
|
|
$prattford_order_date = '';
|
|
// 預計發貨日(到港日)
|
|
$estimated_shipping_date = '';
|
|
// 發貨類別(A.全級發貨、G.欠件發貨)
|
|
$goods_type = '';
|
|
// 實際到貨日(到觀音廠日)
|
|
$actual_tofactory_date = '';
|
|
// 發貨確認人
|
|
$shipping_date_owner = '';
|
|
// 預計船期
|
|
$estimated_shipping_schedule_date = '';
|
|
// 實際到貨日(到港日)
|
|
$actual_arrival_date = '';
|
|
// 到貨確認人
|
|
$arrival_date_owner = '';
|
|
|
|
// 是否齊備
|
|
$shengguanok_status = '';
|
|
// 生管確認附件
|
|
$shengguanok_status_file = '';
|
|
// 已備齊時間
|
|
$shengguanok_status_at = '';
|
|
// 已備齊檢查人
|
|
$shengguanok_status_owner = '';
|
|
|
|
// 建立人
|
|
$creater = '';
|
|
// 建立時間
|
|
$create_at = '';
|
|
|
|
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
|
|
// 預設新梯代碼 A
|
|
$contract_type = postCheck('contract_type', 'A');
|
|
// 合約號
|
|
$contractno = postCheck('contractno');
|
|
// 營業員ID
|
|
$salesid = postCheck('salesid');
|
|
// 工務人員ID
|
|
$warehouseid = postCheck('warehouseid');
|
|
// 客戶姓名
|
|
$custom = postCheck('custom');
|
|
// 工地負責人
|
|
$site_manager = postCheck('site_manager');
|
|
// 客戶id
|
|
$accountid = postCheck('accountid');
|
|
// 作番號
|
|
$facilityno = postCheck('facilityno');
|
|
// 作番號
|
|
$facility_temp_no = postCheck('facility_temp_no');
|
|
// 緯度
|
|
$latitude = postCheck('latitude');
|
|
// 經度
|
|
$longitude = postCheck('longitude');
|
|
// 載重
|
|
$weight = postCheck('weight');
|
|
// 人乘
|
|
$numberofpassenger = postCheck('numberofpassenger');
|
|
// 樓停
|
|
$numberofstop = postCheck('numberofstop');
|
|
// 樓層
|
|
$numberoffloor = postCheck('numberoffloor');
|
|
// 開門方式
|
|
$opentype = postCheck('opentype');
|
|
// 速度
|
|
$speed = postCheck('speed');
|
|
// 機型
|
|
$facility_kind = postCheck('facility_kind');
|
|
// 地址
|
|
$address = postCheck('address');
|
|
// 合約到貨日
|
|
$contract_arrival_date = postCheck('contract_arrival_date');
|
|
// 實際到貨日
|
|
$real_contract_arrival_date = postCheck('real_contract_arrival_date');
|
|
|
|
// 營業規格確認
|
|
$sales_spec_verify = postCheck('sales_spec_verify');
|
|
// 營業規格附件
|
|
$sales_spec_verify_file = postCheck('sales_spec_verify_file');
|
|
// 營業規格確認時間
|
|
$sales_spec_verify_at = postCheck('sales_spec_verify_at');
|
|
// 營業規格確認人
|
|
$sales_spec_verify_owner = postCheck('sales_spec_verify_owner');
|
|
|
|
// 客戶計劃圖確認
|
|
$customer_planning_verify = postCheck('customer_planning_verify');
|
|
// 客戶計劃圖附件
|
|
$customer_planning_verify_file = postCheck('customer_planning_verify_file');
|
|
// 客戶計劃圖確認時間
|
|
$customer_planning_verify_at = postCheck('customer_planning_verify_at');
|
|
// 客戶計劃圖確認人
|
|
$customer_planning_verify_owner = postCheck('customer_planning_verify_owner');
|
|
|
|
// 客戶顏色確認
|
|
$customer_color_verify = postCheck('customer_color_verify');
|
|
// 客戶顏色附件
|
|
$customer_color_verify_file = postCheck('customer_color_verify_file');
|
|
// 客戶顏色確認時間
|
|
$customer_color_verify_at = postCheck('customer_color_verify_at');
|
|
// 客戶顏色確認人
|
|
$customer_color_verify_owner = postCheck('customer_color_verify_owner');
|
|
|
|
// 工勘聯絡表
|
|
$site_survey_contact_form_verify = postCheck('site_survey_contact_form_verify');
|
|
// 工勘聯絡表附件
|
|
$site_survey_contact_form_verify_file = postCheck('site_survey_contact_form_verify_file');
|
|
// 工勘聯絡表確認時間
|
|
$site_survey_contact_form_verify_at = postCheck('site_survey_contact_form_verify_at');
|
|
// 工勘聯絡表確認人
|
|
$site_survey_contact_form_verify_owner = postCheck('site_survey_contact_form_verify_owner');
|
|
|
|
// 設計規格確認
|
|
$desin_spec_verify = postCheck('desin_spec_verify');
|
|
// 設計規格確認附件
|
|
$desin_spec_verify_file = postCheck('desin_spec_verify_file');
|
|
// 設計規格確認時間
|
|
$desin_spec_verify_at = postCheck('desin_spec_verify_at');
|
|
// 設計規格確認確認人
|
|
$desin_spec_verify_owner = postCheck('desin_spec_verify_owner');
|
|
|
|
// 設計計劃圖確認
|
|
$desin_planning_verify = postCheck('desin_planning_verify');
|
|
// 設計計劃圖確認附件
|
|
$desin_planning_verify_file = postCheck('desin_planning_verify_file');
|
|
// 設計計劃圖確認時間
|
|
$desin_planning_verify_at = postCheck('desin_planning_verify_at');
|
|
// 設計計劃圖確認人
|
|
$desin_planning_verify_owner = postCheck('desin_planning_verify_owner');
|
|
|
|
// 設計顏色確認
|
|
$desin_color_verify = postCheck('desin_color_verify');
|
|
// 設計顏色確認附件
|
|
$desin_color_verify_file = postCheck('desin_color_verify_file');
|
|
// 設計顏色確認時間
|
|
$desin_color_verify_at = postCheck('desin_color_verify_at');
|
|
// 設計顏色確認人
|
|
$desin_color_verify_owner = postCheck('desin_color_verify_owner');
|
|
|
|
// 設計仕樣確認
|
|
$desin_style_verify = postCheck('desin_style_verify');
|
|
// 設計仕樣確認附件
|
|
$desin_style_verify_file = postCheck('desin_style_verify_file');
|
|
// 設計仕樣確認時間
|
|
$desin_style_verify_at = postCheck('desin_style_verify_at');
|
|
// 設計仕樣確認人
|
|
$desin_style_verify_owner = postCheck('desin_style_verify_owner');
|
|
|
|
// 設計主管確認
|
|
$desin_leader_verify = postCheck('desin_leader_verify');
|
|
// 設計主管確認附件
|
|
$desin_leader_verify_file = postCheck('desin_leader_verify_file');
|
|
// 設計主管確認時間
|
|
$desin_leader_verify_at = postCheck('desin_leader_verify_at');
|
|
// 設計主管確認人
|
|
$desin_leader_verify_owner = postCheck('desin_leader_verify_owner');
|
|
|
|
// 樓高通報
|
|
$building_heigh_verify = postCheck('building_heigh_verify');
|
|
// 樓高通報附件
|
|
$building_heigh_verify_file = postCheck('building_heigh_verify_file');
|
|
// 樓高通報時間
|
|
$building_heigh_verify_at = postCheck('building_heigh_verify_at');
|
|
// 樓高通報確認人
|
|
$building_heigh_verify_owner = postCheck('building_heigh_verify_owner');
|
|
|
|
// 電氣發貨明細
|
|
$electrical_design_publish = postCheck('electrical_design_publish');
|
|
// 電氣資料發行時間
|
|
$electrical_design_publish_at = postCheck('electrical_design_publish_at');
|
|
// 電氣資料發行人
|
|
$electrical_design_publish_owner = postCheck('electrical_design_publish_owner');
|
|
|
|
// 機械資料發行
|
|
$mechanical_design_publish = postCheck('mechanical_design_publish');
|
|
// 機械資料發行時間
|
|
$mechanical_design_publish_at = postCheck('mechanical_design_publish_at');
|
|
// 機械資料發行人
|
|
$mechanical_design_publish_owner = postCheck('mechanical_design_publish_owner');
|
|
|
|
// 電氣發貨明細
|
|
$electrical_shipping_date_publish = postCheck('electrical_shipping_date_publish');
|
|
// 電氣發貨明細時間
|
|
$electrical_shipping_date_publish_at = postCheck('electrical_shipping_date_publish_at');
|
|
// 電氣發貨明細發行人
|
|
$electrical_shipping_date_publish_owner = postCheck('electrical_shipping_date_publish_owner');
|
|
|
|
// 機械發貨明細
|
|
$mechanical_shipping_date_publish = postCheck('mechanical_shipping_date_publish');
|
|
// 機械發貨明細時間
|
|
$mechanical_shipping_date_publish_at = postCheck('mechanical_shipping_date_publish_at');
|
|
// 機械發貨明細發行人
|
|
$mechanical_shipping_date_publish_owner = postCheck('mechanical_shipping_date_publish_owner');
|
|
|
|
// 普來特富(下單日)
|
|
$prattford_order_date = postCheck('prattford_order_date');
|
|
// 預計發貨日(到港日)
|
|
$estimated_shipping_date = postCheck('estimated_shipping_date');
|
|
// 發貨類別(A.全級發貨、G.欠件發貨)
|
|
$goods_type = postCheck('goods_type');
|
|
// 實際到貨日(到觀音廠日)
|
|
$actual_tofactory_date = postCheck('actual_tofactory_date');
|
|
// 發貨確認人
|
|
$shipping_date_owner = postCheck('shipping_date_owner');
|
|
// 預計船期
|
|
$estimated_shipping_schedule_date = postCheck('estimated_shipping_schedule_date');
|
|
// 實際到貨日(到港日)
|
|
$actual_arrival_date = postCheck('actual_arrival_date');
|
|
// 到貨確認人
|
|
$arrival_date_owner = postCheck('arrival_date_owner');
|
|
|
|
// 是否齊備
|
|
$shengguanok_status = postCheck('shengguanok_status');
|
|
// 生管確認附件
|
|
$shengguanok_status_file = postCheck('shengguanok_status_file');
|
|
// 已備齊時間
|
|
$shengguanok_status_at = postCheck('shengguanok_status_at');
|
|
// 已備齊檢查人
|
|
$shengguanok_status_owner = postCheck('shengguanok_status_owner');
|
|
|
|
// 建立人
|
|
$creater = postCheck('creater');
|
|
// 建立時間
|
|
$create_at = postCheck('create_at');
|
|
|
|
|
|
//插入數據庫數據 gary_version
|
|
$insertsql = "
|
|
INSERT INTO wipwholestatus (
|
|
contract_type,
|
|
contractno,
|
|
salesid,
|
|
custom,
|
|
site_manager,
|
|
accountid,
|
|
facilityno,
|
|
facility_temp_no,
|
|
latitude,
|
|
longitude,
|
|
weight,
|
|
numberofpassenger,
|
|
numberofstop,
|
|
numberoffloor,
|
|
opentype,
|
|
speed,
|
|
facility_kind,
|
|
address,
|
|
contract_arrival_date,
|
|
real_contract_arrival_date,
|
|
sales_spec_verify,
|
|
sales_spec_verify_file,
|
|
sales_spec_verify_at,
|
|
sales_spec_verify_owner,
|
|
customer_planning_verify,
|
|
customer_planning_verify_file,
|
|
customer_planning_verify_at,
|
|
customer_planning_verify_owner,
|
|
customer_color_verify,
|
|
customer_color_verify_file,
|
|
customer_color_verify_at,
|
|
customer_color_verify_owner,
|
|
site_survey_contact_form_verify,
|
|
site_survey_contact_form_verify_file,
|
|
site_survey_contact_form_verify_at,
|
|
site_survey_contact_form_verify_owner,
|
|
desin_spec_verify,
|
|
desin_spec_verify_file,
|
|
desin_spec_verify_at,
|
|
desin_spec_verify_owner,
|
|
desin_planning_verify,
|
|
desin_planning_verify_file,
|
|
desin_planning_verify_at,
|
|
desin_planning_verify_owner,
|
|
desin_color_verify,
|
|
desin_color_verify_file,
|
|
desin_color_verify_at,
|
|
desin_color_verify_owner,
|
|
desin_style_verify,
|
|
desin_style_verify_file,
|
|
desin_style_verify_at,
|
|
desin_style_verify_owner,
|
|
desin_leader_verify,
|
|
desin_leader_verify_file,
|
|
desin_leader_verify_at,
|
|
desin_leader_verify_owner,
|
|
building_heigh_verify,
|
|
building_heigh_verify_file,
|
|
building_heigh_verify_at,
|
|
building_heigh_verify_owner,
|
|
electrical_design_publish,
|
|
electrical_design_publish_at,
|
|
electrical_design_publish_owner,
|
|
mechanical_design_publish,
|
|
mechanical_design_publish_at,
|
|
mechanical_design_publish_owner,
|
|
electrical_shipping_date_publish,
|
|
electrical_shipping_date_publish_at,
|
|
electrical_shipping_date_publish_owner,
|
|
mechanical_shipping_date_publish,
|
|
mechanical_shipping_date_publish_at,
|
|
mechanical_shipping_date_publish_owner,
|
|
prattford_order_date,
|
|
estimated_shipping_date,
|
|
goods_type,
|
|
actual_tofactory_date,
|
|
shipping_date_owner,
|
|
estimated_shipping_schedule_date,
|
|
actual_arrival_date,
|
|
arrival_date_owner,
|
|
shengguanok_status,
|
|
shengguanok_status_file,
|
|
shengguanok_status_at,
|
|
shengguanok_status_owner,
|
|
creater,
|
|
create_at
|
|
) VALUES (
|
|
'$contract_type',
|
|
'$contractno',
|
|
'$salesid',
|
|
'$custom',
|
|
'$site_manager',
|
|
'$accountid',
|
|
'$facilityno',
|
|
'$facility_temp_no',
|
|
'$latitude',
|
|
'$longitude',
|
|
'$weight',
|
|
'$numberofpassenger',
|
|
'$numberofstop',
|
|
'$numberoffloor',
|
|
'$opentype',
|
|
'$speed',
|
|
'$facility_kind',
|
|
'$address',
|
|
'$contract_arrival_date',
|
|
'$contract_arrival_date',
|
|
'$sales_spec_verify',
|
|
'$sales_spec_verify_file',
|
|
'$sales_spec_verify_at',
|
|
'$sales_spec_verify_owner',
|
|
'$customer_planning_verify',
|
|
'$customer_planning_verify_file',
|
|
'$customer_planning_verify_at',
|
|
'$customer_planning_verify_owner',
|
|
'$customer_color_verify',
|
|
'$customer_color_verify_file',
|
|
'$customer_color_verify_at',
|
|
'$customer_color_verify_owner',
|
|
'$site_survey_contact_form_verify',
|
|
'$site_survey_contact_form_verify_file',
|
|
'$site_survey_contact_form_verify_at',
|
|
'$site_survey_contact_form_verify_owner',
|
|
'$desin_spec_verify',
|
|
'$desin_spec_verify_file',
|
|
'$desin_spec_verify_at',
|
|
'$desin_spec_verify_owner',
|
|
'$desin_planning_verify',
|
|
'$desin_planning_verify_file',
|
|
'$desin_planning_verify_at',
|
|
'$desin_planning_verify_owner',
|
|
'$desin_color_verify',
|
|
'$desin_color_verify_file',
|
|
'$desin_color_verify_at',
|
|
'$desin_color_verify_owner',
|
|
'$desin_style_verify',
|
|
'$desin_style_verify_file',
|
|
'$desin_style_verify_at',
|
|
'$desin_style_verify_owner',
|
|
'$desin_leader_verify',
|
|
'$desin_leader_verify_file',
|
|
'$desin_leader_verify_at',
|
|
'$desin_leader_verify_owner',
|
|
'$building_heigh_verify',
|
|
'$building_heigh_verify_file',
|
|
'$building_heigh_verify_at',
|
|
'$building_heigh_verify_owner',
|
|
'$electrical_design_publish',
|
|
'$electrical_design_publish_at',
|
|
'$electrical_design_publish_owner',
|
|
'$mechanical_design_publish',
|
|
'$mechanical_design_publish_at',
|
|
'$mechanical_design_publish_owner',
|
|
'$electrical_shipping_date_publish',
|
|
'$electrical_shipping_date_publish_at',
|
|
'$electrical_shipping_date_publish_owner',
|
|
'$mechanical_shipping_date_publish',
|
|
'$mechanical_shipping_date_publish_at',
|
|
'$mechanical_shipping_date_publish_owner',
|
|
'$prattford_order_date',
|
|
'$estimated_shipping_date',
|
|
'$goods_type',
|
|
'$actual_tofactory_date',
|
|
'$shipping_date_owner',
|
|
'$estimated_shipping_schedule_date',
|
|
'$actual_arrival_date',
|
|
'$arrival_date_owner',
|
|
'$shengguanok_status',
|
|
'$shengguanok_status_file',
|
|
'$shengguanok_status_at',
|
|
'$shengguanok_status_owner',
|
|
'$creater',
|
|
'$create_at'
|
|
)
|
|
";
|
|
|
|
// 檢查作番號是否重複
|
|
if (checkFacilitynoRepeat($link, $facilityno)) {
|
|
echo "
|
|
<script>
|
|
alert('此作番號重複');
|
|
</script>
|
|
";
|
|
} else {
|
|
mysqli_query($link, $insertsql);
|
|
$last_form_id = mysqli_insert_id($link);
|
|
// 寫入待簽程狀態 A (營業)
|
|
do_wws_assign($salesid, $last_form_id, 'A');
|
|
// 寫入待簽程狀態 G (工務)
|
|
do_wws_assign($warehouseid, $last_form_id, 'G');
|
|
echo "
|
|
<script>
|
|
alert('新增完成');
|
|
</script>
|
|
";
|
|
}
|
|
}
|
|
|
|
// 開門方式 select => options
|
|
$sql = "
|
|
SELECT
|
|
code_name AS val ,
|
|
content AS label
|
|
FROM code F
|
|
WHERE field_name='open_kind'
|
|
ORDER BY label ASC
|
|
";
|
|
$opendoor_options = mysqli_query($link, $sql);
|
|
|
|
// 所有營業員 select => options
|
|
$sql = "
|
|
SELECT
|
|
accountid AS val ,
|
|
name AS label
|
|
FROM account
|
|
WHERE department_id IN ('311','312','313','314','315')
|
|
ORDER BY label ASC
|
|
";
|
|
$sales_options = mysqli_query($link, $sql);
|
|
|
|
// 所有工務人員 select => options
|
|
$sql = "
|
|
SELECT
|
|
accountid AS val ,
|
|
name AS label
|
|
FROM account
|
|
WHERE department_id IN ('521')
|
|
AND role_id IN ('3','4','5')
|
|
ORDER BY label ASC
|
|
";
|
|
$warehouse_options = mysqli_query($link, $sql);
|
|
|
|
?>
|
|
<form method="post" id="form" enctype="multipart/form-data">
|
|
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>">
|
|
<input class="form-control " type="hidden" name="sales_spec_verify" value="1">
|
|
<input class="form-control " type="hidden" name="customer_planning_verify" value="1">
|
|
<input class="form-control " type="hidden" name="customer_color_verify" value="1">
|
|
<input class="form-control " type="hidden" name="customer_style_verify" value="1">
|
|
<input class="form-control " type="hidden" name="site_survey_contact_form_verify" value="1">
|
|
<input class="form-control " type="hidden" name="desin_spec_verify" value="1">
|
|
<input class="form-control " type="hidden" name="desin_planning_verify" value="1">
|
|
<input class="form-control " type="hidden" name="desin_color_verify" value="1">
|
|
<input class="form-control " type="hidden" name="desin_style_verify" value="1">
|
|
<input class="form-control " type="hidden" name="desin_leader_verify" value="1">
|
|
<input class="form-control " type="hidden" name="building_heigh_verify" value="1">
|
|
<input class="form-control " type="hidden" name="electrical_design_publish" value="1">
|
|
<input class="form-control " type="hidden" name="mechanical_design_publish" value="1">
|
|
<input class="form-control " type="hidden" name="electrical_shipping_date_publish" value="1">
|
|
<input class="form-control " type="hidden" name="mechanical_shipping_date_publish" value="1">
|
|
<input class="form-control " type="hidden" name="shengguanok_status" value="1">
|
|
<input class="form-control " type="hidden" name="create_at" value="<?= date('Y/m/d H:i:s'); ?>">
|
|
<div class="container-fluid" id="accountadd">
|
|
<div class="text-center">
|
|
<h3>作番大日程</h3>
|
|
</div>
|
|
<div class="form-horizontal">
|
|
<table class="table" style="width:100%">
|
|
<thead style="margin-bottom: 20px">
|
|
<tr>
|
|
<td style="vertical-align: middle">合約號</td>
|
|
<td>
|
|
<input class="form-control " type="text" id="contractno" name="contractno" value="<?php echo $contractno; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">作番號</td>
|
|
<td>
|
|
<input class="form-control " type="text" id="facilityno" name="facilityno" value="<?php echo $facilityno; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">客戶名稱</td>
|
|
<td>
|
|
<input class="form-control " type="text" name="custom" value="<?php echo $custom; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">號機</td>
|
|
<td>
|
|
<input class="form-control " type="text" name="facility_temp_no" value="<?php echo $facility_temp_no; ?>">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: middle">緯度</td>
|
|
<td>
|
|
<input class="form-control " type="text" name="latitude" value="<?php echo $latitude; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">經度</td>
|
|
<td>
|
|
<input class="form-control " type="text" name="longitude" value="<?php echo $longitude; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">地址</td>
|
|
<td>
|
|
<input class="form-control " type="text" name="address" value="<?php echo $address; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">機型</td>
|
|
<td>
|
|
<input class="form-control " type="text" name="facility_kind" value="<?php echo $facility_kind; ?>">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: middle">載重</td>
|
|
<td>
|
|
<input class="form-control " type="number" min="0" name="weight" value="<?php echo $weight; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">人乘</td>
|
|
<td>
|
|
<input class="form-control " type="number" min="0" name="numberofpassenger" value="<?php echo $numberofpassenger; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">樓停</td>
|
|
<td>
|
|
<input class="form-control " type="number" min="0" name="numberofstop" value="<?php echo $numberofstop; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">樓層</td>
|
|
<td>
|
|
<input class="form-control " type="number" min="0" name="numberoffloor" value="<?php echo $numberoffloor; ?>">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: middle">開門方式</td>
|
|
<td style="vertical-align: middle">
|
|
<select class="form-control " name="opentype">
|
|
<option value="">未選擇</option>
|
|
<?php
|
|
foreach ($opendoor_options as $opendoor_option) :
|
|
if ($opendoor_option['label'] == $opentype) {
|
|
echo "<option selected value='" . $opendoor_option['label'] . "'>" . $opendoor_option['label'] . "</option>";
|
|
} else {
|
|
echo "<option value='" . $opendoor_option['label'] . "'>" . $opendoor_option['label'] . "</option>";
|
|
}
|
|
endforeach
|
|
?>
|
|
</select>
|
|
</td>
|
|
<td style="vertical-align: middle">速度</td>
|
|
<td>
|
|
<input class="form-control " type="number" name="speed" gt="0" min="0" value="<?php echo $speed; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">合約交期<br />(到工地)</td>
|
|
<td>
|
|
<input class="form-control " type="datetime-local" name="contract_arrival_date" value="<?php echo $contract_arrival_date; ?>">
|
|
</td>
|
|
<!-- <td style="vertical-align: middle">預計交期<br />(到工地)</td>
|
|
<td>
|
|
<input class="form-control " type="datetime-local" name="real_contract_arrival_date" value="<?php echo $real_contract_arrival_date; ?>">
|
|
</td> -->
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: middle">工地負責人</td>
|
|
<td>
|
|
<input class="form-control " type="text" name="site_manager" value="<?php echo $site_manager; ?>">
|
|
</td>
|
|
<td style="vertical-align: middle">營業員</td>
|
|
<td style="vertical-align: middle">
|
|
<select class="form-control " id="salesid" name="salesid">
|
|
<option value="">未選擇</option>
|
|
<?php
|
|
foreach ($sales_options as $sales_option) :
|
|
if ($sales_option['val'] == $salesid) {
|
|
echo "<option selected value='" . $sales_option['val'] . "'>" . $sales_option['val'] . $sales_option['label'] . "</option>";
|
|
} else {
|
|
echo "<option value='" . $sales_option['val'] . "'>" . $sales_option['val'] . $sales_option['label'] . "</option>";
|
|
}
|
|
endforeach
|
|
?>
|
|
</select>
|
|
</td>
|
|
<td style="vertical-align: middle">工務部門負責人</td>
|
|
<td style="vertical-align: middle">
|
|
<select class="form-control " id="warehouseid" name="warehouseid">
|
|
<option value="">未選擇</option>
|
|
<?php
|
|
foreach ($warehouse_options as $warehouse_option) :
|
|
if ($warehouse_option['val'] == $warehouseid) {
|
|
echo "<option selected value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>";
|
|
} else {
|
|
echo "<option value='" . $warehouse_option['val'] . "'>" . $warehouse_option['val'] . $warehouse_option['label'] . "</option>";
|
|
}
|
|
endforeach
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div class="col-md-12" style="margin-bottom:15px;">
|
|
<button onclick="savedata()" type="button" class="btn btn-primary btn-lg pull-right">確認後保存</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<script type="text/javascript">
|
|
function savedata() {
|
|
var savedataMessage = {
|
|
"0": "不明錯誤",
|
|
"1": "",
|
|
"2": "未選擇營業員",
|
|
"3": "合約編號未填寫",
|
|
"4": "作番號未填寫",
|
|
"5": "未選擇工務人員"
|
|
}
|
|
if (getSavedataStatus() == '1') {
|
|
$('#form').submit();
|
|
} else {
|
|
typeof savedataMessage[getSavedataStatus()] == 'string' ? alert(savedataMessage[getSavedataStatus()]) : alert("不明錯誤");
|
|
}
|
|
|
|
}
|
|
|
|
function getSavedataStatus() {
|
|
if ($("#salesid").val() == '')
|
|
return '2'
|
|
if ($("#contractno").val() == '')
|
|
return '3'
|
|
if ($("#facilityno").val() == '')
|
|
return '4'
|
|
if ($("#warehouseid").val() == '')
|
|
return '5'
|
|
return '1'
|
|
}
|
|
</script>
|
|
|
|
<?php
|
|
} else {
|
|
echo "錯誤的訪問";
|
|
}
|
|
|
|
?>
|