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.
85 lines
3.8 KiB
85 lines
3.8 KiB
<?php
|
|
|
|
function fileIUpload($post_name)
|
|
{
|
|
if (empty($_FILES[$post_name]["error"])) {
|
|
$datetime = date("YmdHis");
|
|
$file_name = empty($_FILES[$post_name]["name"]) ? "" : str_replace("#", "", $_FILES[$post_name]["name"]);
|
|
if (!empty($file_name)) {
|
|
$temp_file_name = $_FILES[$post_name]["tmp_name"];
|
|
$target_dir = empty($file_name) ? "" : "public-wipwhole/";
|
|
$real_file_name = strtolower($target_dir . basename($datetime . $file_name));
|
|
if (file_exists($real_file_name))
|
|
unlink($real_file_name);
|
|
move_uploaded_file($temp_file_name, $real_file_name);
|
|
return strtolower($target_dir . basename($datetime . $file_name));
|
|
} else {
|
|
return "";
|
|
}
|
|
} else {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
function fileIUploads($post_name)
|
|
{
|
|
$file_arr = [];
|
|
if (isset($_FILES[$post_name])) {
|
|
foreach ($_FILES[$post_name]['tmp_name'] as $key => $tmp_name) {
|
|
$file_name = $_FILES[$post_name]['name'][$key];
|
|
$temp_file_name = $_FILES[$post_name]['tmp_name'][$key];
|
|
$target_dir = empty($file_name) ? "" : "public-wipwhole/";
|
|
$datetime = date("YmdHis");
|
|
$sales_spec_verify_file = strtolower($target_dir . basename($datetime . $file_name));
|
|
if (file_exists($sales_spec_verify_file))
|
|
unlink($sales_spec_verify_file);
|
|
move_uploaded_file($temp_file_name, $sales_spec_verify_file);
|
|
if (!empty($file_name)) {
|
|
array_push($file_arr, strtolower($target_dir . basename($datetime . $file_name)));
|
|
}
|
|
}
|
|
}
|
|
if (count($file_arr) !== 0)
|
|
return json_encode($file_arr, JSON_UNESCAPED_UNICODE);
|
|
return "";
|
|
}
|
|
|
|
// 營業
|
|
$sales_spec_verify_file = fileIUpload("sales_spec_verify_file");
|
|
$customer_planning_verify_file = fileIUpload("customer_planning_verify_file");
|
|
$customer_color_verify_file = fileIUpload("customer_color_verify_file");
|
|
$customer_style_verify_file = fileIUpload("customer_style_verify_file");
|
|
$site_survey_contact_form_verify_file = fileIUpload("site_survey_contact_form_verify_file");
|
|
|
|
$official_check_1_file= fileIUpload("official_check_1_file");
|
|
$official_check_2_file= fileIUpload("official_check_2_file");
|
|
$official_check_3_file= fileIUpload("official_check_3_file");
|
|
$official_check_4_file= fileIUpload("official_check_4_file");
|
|
$official_check_5_file= fileIUpload("official_check_5_file");
|
|
$official_check_6_file= fileIUpload("official_check_6_file");
|
|
$official_check_7_file= fileIUpload("official_check_7_file");
|
|
$official_check_8_file= fileIUpload("official_check_8_file");
|
|
$official_check_9_file= fileIUpload("official_check_9_file");
|
|
|
|
// 設計
|
|
$desin_spec_verify_file = fileIUpload("desin_spec_verify_file");
|
|
$desin_planning_verify_file = fileIUpload("desin_planning_verify_file");
|
|
$desin_color_verify_file = fileIUpload("desin_color_verify_file");
|
|
$desin_style_verify_file = fileIUpload("desin_style_verify_file");
|
|
$desin_documents_verify_file = fileIUpload("desin_documents_verify_file");
|
|
// 設計主管
|
|
$desin_leader_verify_file = fileIUpload("desin_leader_verify_file");
|
|
// 工務
|
|
$building_heigh_verify_file = fileIUpload("building_heigh_verify_file");
|
|
$site_survey_contact_verify_file = fileIUpload("site_survey_contact_verify_file");
|
|
$plan_diagram_file = fileIUpload("plan_diagram_file");
|
|
$completion_acceptance_file = fileIUpload("completion_acceptance_file");
|
|
$delivery_date_file = fileIUpload("delivery_date_file");
|
|
|
|
// 生管
|
|
$shengguanok_status_file = fileIUpload("shengguanok_status_file");
|
|
// 工務助理
|
|
$outsourcer_contract_file = fileIUploads("outsourcer_contract_file");
|
|
$delivery_date_file2 = fileIUpload("delivery_date_file2");
|
|
// 品證
|
|
$official_check_file = fileIUpload("official_check_file");
|
|
|