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.
162 lines
11 KiB
162 lines
11 KiB
<?php
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
//print_r($_POST);exit;
|
|
foreach ($_POST as $k => $v) {
|
|
$$k = htmlspecialchars(stripslashes(trim($v)));
|
|
}
|
|
|
|
$create_at = date("Y-m-d H:i:s");
|
|
$pr_item_id = explode(",", $pritem)[0];
|
|
$pr_item_id = (!$pr_item_id) ? 0 : $pr_item_id;
|
|
$top_height = (!$top_height) ? 0 : $top_height;
|
|
$bottom_height = (!$bottom_height) ? 0 : $bottom_height;
|
|
$vdist = (!$vdist) ? 0 : $vdist;
|
|
$tunnel_width = (!$tunnel_width) ? 0 : $tunnel_width;
|
|
$tunnel_depth = (!$tunnel_depth) ? 0 : $tunnel_depth;
|
|
$theight = (!$theight) ? 0 : $theight;
|
|
$car_width = (!$car_width) ? 0 : $car_width;
|
|
$car_depth = (!$car_depth) ? 0 : $car_depth;
|
|
$car_height = (!$car_height) ? 0 : $car_height;
|
|
$dooropen_width = (!$dooropen_width) ? 0 : $dooropen_width;
|
|
$dooropen_height = (!$dooropen_height) ? 0 : $dooropen_height;
|
|
$top_height = str_replace(",", "", $top_height);
|
|
$bottom_height = str_replace(",", "", $bottom_height);
|
|
$vdist = str_replace(",", "", $vdist);
|
|
$tunnel_width = str_replace(",", "", $tunnel_width);
|
|
$tunnel_depth = str_replace(",", "", $tunnel_depth);
|
|
$theight = str_replace(",", "", $theight);
|
|
$car_width = str_replace(",", "", $car_width);
|
|
$car_depth = str_replace(",", "", $car_depth);
|
|
$car_height = str_replace(",", "", $car_height);
|
|
|
|
$pre_weight = str_replace(",", "", $pre_weight);
|
|
$pre_weight = (!$pre_weight) ? 0 : $pre_weight;
|
|
$lop_info = json_encode([$lop_info1, $lop_info2, $lop_info3, $lop_info4], JSON_UNESCAPED_UNICODE);
|
|
$opb1_info = json_encode([$opb1_info1, $opb1_info2, $opb1_info3], JSON_UNESCAPED_UNICODE);
|
|
$opb2_info = json_encode([$opb2_info1, $opb2_info2, $opb2_info3], JSON_UNESCAPED_UNICODE);
|
|
$handicap_opb1 = json_encode([$handicap_opb1_1, $handicap_opb1_2], JSON_UNESCAPED_UNICODE);
|
|
$handicap_opb2 = json_encode([$handicap_opb2_1, $handicap_opb2_2], JSON_UNESCAPED_UNICODE);
|
|
$side_info[0] = [$side_type_f, $side_thick_f, $side_color_f, $side_memo_f];
|
|
$side_info[1] = [$side_type_se, $side_thick_se, $side_color_se, $side_memo_se];
|
|
$side_info[2] = [$side_type_lm, $side_thick_lm, $side_color_lm, $side_memo_lm];
|
|
$side_info[3] = [$side_type_rm, $side_thick_rm, $side_color_rm, $side_memo_rm];
|
|
$side_info[4] = [$side_type_be, $side_thick_be, $side_color_be, $side_memo_be];
|
|
$side_info[5] = [$side_type_bm, $side_thick_bm, $side_color_bm, $side_memo_bm];
|
|
$side_info[6] = [$side_type_d, $side_thick_d, $side_color_d, $side_memo_d];
|
|
$side_info = json_encode($side_info, JSON_UNESCAPED_UNICODE);
|
|
$indicator_light = json_encode([$indicator_light1, $indicator_light2, $indicator_light3], JSON_UNESCAPED_UNICODE);
|
|
$position_indicator = json_encode([$position_indicator1, $position_indicator2, $position_indicator3], JSON_UNESCAPED_UNICODE);
|
|
$floor_prethick = (!$floor_prethick) ? 0 : $floor_prethick;
|
|
|
|
$equip_info_layer[0] = [$equip_info_layer11, $equip_info_layer12, $equip_info_layer13, $equip_info_layer14];
|
|
$equip_info_layer[1] = [$equip_info_layer21, $equip_info_layer22, $equip_info_layer23, $equip_info_layer24, $equip_info_layer25];
|
|
$equip_info_layer[2] = [$equip_info_layer31, $equip_info_layer32, $equip_info_layer33, $equip_info_layer34, $equip_info_layer35];
|
|
$equip_info_layer = json_encode($equip_info_layer, JSON_UNESCAPED_UNICODE);
|
|
|
|
$equip_info_sfram[0] = [$equip_info_sfram11, $equip_info_sfram12, $equip_info_sfram13, $equip_info_sfram14];
|
|
$equip_info_sfram[1] = [$equip_info_sfram21, $equip_info_sfram22, $equip_info_sfram23, $equip_info_sfram24, $equip_info_sfram25];
|
|
$equip_info_sfram[2] = [$equip_info_sfram31, $equip_info_sfram32, $equip_info_sfram33, $equip_info_sfram34, $equip_info_sfram35];
|
|
$equip_info_sfram = json_encode($equip_info_sfram, JSON_UNESCAPED_UNICODE);
|
|
|
|
$equip_info_bfram[0] = [$equip_info_bfram11, $equip_info_bfram12, $equip_info_bfram13, $equip_info_bfram14];
|
|
$equip_info_bfram[1] = [$equip_info_bfram21, $equip_info_bfram22, $equip_info_bfram23, $equip_info_bfram24, $equip_info_bfram25];
|
|
$equip_info_bfram[2] = [$equip_info_bfram31, $equip_info_bfram32, $equip_info_bfram33, $equip_info_bfram34, $equip_info_bfram35];
|
|
$equip_info_bfram = json_encode($equip_info_bfram, JSON_UNESCAPED_UNICODE);
|
|
|
|
$auto_back = ($auto_back) ? "Y" : "N";
|
|
$design = (isset($design) && $design == "on") ? "Y" : "N";
|
|
|
|
$ib = json_encode([$ib_y, $ib1, $ib2], JSON_UNESCAPED_UNICODE);
|
|
$kanban = json_encode([$kanban_y, $kanban], JSON_UNESCAPED_UNICODE);
|
|
$face_rec = json_encode([$face_rec_y, $face_rec], JSON_UNESCAPED_UNICODE);
|
|
$smart_call = json_encode([$smart_call_y, $smart_call], JSON_UNESCAPED_UNICODE);
|
|
$access_car = json_encode([$access_car_y, $access_car, $access_car_cards], JSON_UNESCAPED_UNICODE);
|
|
$voice = json_encode([$voice_y, $voice], JSON_UNESCAPED_UNICODE);
|
|
$access_hall = json_encode([$access_hall_y, $access_hall, $access_hall_cards], JSON_UNESCAPED_UNICODE);
|
|
$car_cam = json_encode([$car_cam_y, $car_cam], JSON_UNESCAPED_UNICODE);
|
|
$painting = json_encode([$painting_y, $painting], JSON_UNESCAPED_UNICODE);
|
|
|
|
// 基本規格 specsurvey_main
|
|
$db_query = "insert into specsurvey_main(mid, pr_item_id, sub_item_id, version, contractno, company, facilitok_date, serial, rtype, ";
|
|
$db_query .= "weight, speed, numberoffloor, numberofstop, numberofdoor, floor_name, door_type, usefor, class, oper_method, ";
|
|
$db_query .= "serial_duplex_group, area, address, use_situ, mpower, lpower, top_height, bottom_height, vdist, ";
|
|
$db_query .= "tunnel_width, tunnel_depth, theight, tunnel, car_width, car_depth, car_height, ";
|
|
$db_query .= "dooropen_type, dooropen_width, dooropen_height, creater, create_at) values (";
|
|
$db_query .= "'$mid', '$pr_item_id', '$sub_item_id', '$version', '$contractno', '$company', '$facilitok_date', '$serial_no', '$rtype', ";
|
|
$db_query .= "'$weight', '$speed', '$numberoffloor', '$numberofstop', '$numberofdoor', '$floor_name', '$door_type', '$usefor', '$class', '$oper_method', ";
|
|
$db_query .= "'$serial_duplex_group', '$area', '$address', '$use_situ', '$mpower', '$lpower', '$top_height', '$bottom_height', '$vdist', ";
|
|
$db_query .= "'$tunnel_width', '$tunnel_depth', '$theight', '$tunnel', '$car_width', '$car_depth', '$car_height', ";
|
|
$db_query .= "'$dooropen_type', '$dooropen_width', '$dooropen_height', '$user_id', '$create_at')";
|
|
//echo $db_query;exit;
|
|
$result = mysqli_query($link, $db_query);
|
|
|
|
if ($mid = mysqli_insert_id($link)) {
|
|
// 轎廂 specsurvey_car
|
|
$db_query = "insert into specsurvey_car (mid, car_kind, car_kind_standard, well, material, floor, floor_type, ";
|
|
$db_query .= "floor_prethick, side_info, pre_weight, pre_thick, car_handrail, car_handrail_loc, mirror, ";
|
|
$db_query .= "opb1_info, opb2_info, handicap_opb1, handicap_opb2, lop_info, indicator_light, position_indicator) values (";
|
|
$db_query .= "'$mid', '$car_kind', '$car_kind_standard', '$well', '$material', '$floor', '$floor_type', ";
|
|
$db_query .= "'$floor_prethick', '$side_info', '$pre_weight', '$pre_thick', '$car_handrail', '$car_handrail_loc', '$mirror', ";
|
|
$db_query .= "'$opb1_info', '$opb2_info', '$handicap_opb1', '$handicap_opb2', '$lop_info', '$indicator_light', '$position_indicator')";
|
|
//echo $db_query;exit;
|
|
$result = mysqli_query($link, $db_query);
|
|
|
|
if (mysqli_affected_rows($link) > 0) {
|
|
// 門系統 specsurvey_door
|
|
$db_query = "insert into specsurvey_door (mid, door_f_floor, door_r_floor, door_safety, firedoor, firestop, firefloor, ";
|
|
$db_query .= "equip_info_layer, equip_info_sfram, equip_info_bfram) values (";
|
|
$db_query .= "'$mid', '$door_f_floor', '$door_r_floor', '$door_safety', '$firedoor', '$firestop', '$firefloor', ";
|
|
$db_query .= "'$equip_info_layer', '$equip_info_sfram', '$equip_info_bfram')";
|
|
$result = mysqli_query($link, $db_query);
|
|
|
|
if (mysqli_affected_rows($link) > 0) {
|
|
// 功能 specsurvey_function
|
|
$db_query = "insert into specsurvey_function (mid, warranty, foreign_three, gate_corbel, ";
|
|
$db_query .= "safety_gear, air_kolin, purifier, is_units_pos, is_units, crt, face_rec, gong, eq_control, voice, ";
|
|
$db_query .= "ard, energy_feedback, rs485, car_cam, painting, ins, ib, ibd, fire_alarm, ";
|
|
$db_query .= "kanban, uv, voice_control, auto_back, smart_call, access_car, access_hall, ";
|
|
$db_query .= "opec_spec, opec_spec_driver, guides, note, prddetail, design) values (";
|
|
$db_query .= "'$mid', '$warranty', '$foreign_three', '$gate_corbel', ";
|
|
$db_query .= "'$safety_gear', '$air_kolin', '$purifier', '$is_units_pos', '$is_units', '$crt', '$face_rec', '$gong', '$eq_control', '$voice', ";
|
|
$db_query .= "'$ard', '$energy_feedback', '$rs485', '$car_cam', '$painting', '$ins', '$ib', '$ibd', '$fire_alarm', ";
|
|
$db_query .= "'$kanban', '$uv', '$voice_control', '$auto_back', '$smart_call', '$access_car', '$access_hall', ";
|
|
$db_query .= "'$opec_spec', '$opec_spec_driver', '$guides', '$note', '$prddetail', '$design')";
|
|
//echo $db_query;exit;
|
|
$result = mysqli_query($link, $db_query);
|
|
if (mysqli_affected_rows($link) > 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('新增成功');";
|
|
echo "location.href = 'specsurvey-index.php?function_name=specsurvey&".$token_link."';";
|
|
echo "</script>";
|
|
} else {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('新增失敗,請重新操作[F]');";
|
|
echo "history.go(-1);";
|
|
//echo "location.href = 'specsurvey-index.php?function_name=specsurvey&".$token_link."';";
|
|
echo "</script>";
|
|
}
|
|
} else {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('新增失敗,請重新操作[D]');";
|
|
echo "history.go(-1);";
|
|
//echo "location.href = 'specsurvey-index.php?function_name=specsurvey&".$token_link."';";
|
|
echo "</script>";
|
|
}
|
|
} else {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('新增失敗,請重新操作[C]');";
|
|
echo "history.go(-1);";
|
|
//echo "location.href = 'specsurvey-index.php?function_name=specsurvey&".$token_link."';";
|
|
echo "</script>";
|
|
}
|
|
} else {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('新增失敗,請重新操作[M]');";
|
|
echo "history.go(-1);";
|
|
//echo "location.href = 'specsurvey-index.php?function_name=specsurvey&".$token_link."';";
|
|
echo "</script>";
|
|
}
|
|
|
|
mysqli_close($link);
|
|
}
|
|
?>
|