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.
153 lines
5.8 KiB
153 lines
5.8 KiB
<?php
|
|
include "header.php";
|
|
|
|
$id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.');
|
|
|
|
$data = array();
|
|
// sql語法存在變數中
|
|
$db_query = "SELECT * FROM facility WHERE id=$id";
|
|
|
|
// 用mysqli_query方法執行(sql語法)將結果存在變數中
|
|
$data = mysqli_query($link,$db_query);
|
|
/*
|
|
include "inc/record_update.php";
|
|
|
|
try {
|
|
// 設置一個空陣列來放資料
|
|
$data = array();
|
|
// sql語法存在變數中
|
|
$db_query = "SELECT * FROM expert WHERE id=$id";
|
|
|
|
// 用mysqli_query方法執行(sql語法)將結果存在變數中
|
|
$data = mysqli_query($link,$db_query);
|
|
}catch (Exception $e) {
|
|
echo 'Caught exception: ', $e->getMessage(), "\n";
|
|
}
|
|
*/
|
|
foreach($data as $data) :
|
|
?>
|
|
|
|
<div class="container">
|
|
<form class="form-inline" method="post" action="facility-record-update.php" enctype="multipart/form-data">
|
|
<input type="hidden" name="id" value="<?php echo $id; ?>">
|
|
|
|
<div>
|
|
<label for="contractno">合約號</label>
|
|
<input type="text" name="contractno" id="contractno" value="<?php echo $data['contractno']; ?>" required>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="facilityno">作番號</label>
|
|
<input type="text" name="facilityno" id="facilityno" value="<?php echo $data['facilityno']; ?>" required>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="customerid">客戶編號</label>
|
|
<input type="text" name="customerid" id="customerid" value="<?php echo $data['customerid']; ?>" required>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="weight">重量</label>
|
|
<input type="text" name="weight" id="weight" value="<?php echo $data['weight']; ?>" onkeyup="if(value<0)value=0;if(value.length>4)value=value.slice(0,4);value=value.replace(/^\D*(\d*(?:\.\d)?).*$/g, '$1')" required>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="numberofstop">停數</label>
|
|
<input type="text" name="numberofstop" id="numberofstop" value="<?php echo $data['numberofstop']; ?>" onkeyup="if(value<0)value=0;if(value.length>3)value=value.slice(0,3);value=value.replace(/^\D*(\d*(?:\.\d)?).*$/g, '$1')" required>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="numberoffloor">樓層數</label>
|
|
<input type="text" name="numberoffloor" id="numberoffloor" value="<?php echo $data['numberoffloor']; ?>" onkeyup="if(value<0)value=0;if(value.length>3)value=value.slice(0,3);value=value.replace(/^\D*(\d*(?:\.\d)?).*$/g, '$1')" required>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="opentype">開門方式</label>
|
|
<Select name="opentype" id="opentype" required>
|
|
<?php
|
|
switch ($data['opentype']) {
|
|
case "CO":
|
|
echo "<Option Value='CO' selected='selected'>CO</Option> <Option Value='OS'>SO</Option> <Option Value='CO-SO'>CO-SO</Option>";
|
|
break;
|
|
case "SO":
|
|
echo "<Option Value='CO'>CO</Option> <Option Value='SO' selected='selected'>SO</Option> <Option Value='CO-SO'>CO-SO</Option>";
|
|
break;
|
|
case "CO-SO":
|
|
echo "<Option Value='CO'>CO</Option> <Option Value='SO'>SO</Option> <Option Value='CO-SO' selected='selected'>CO-SO</Option>";
|
|
break;
|
|
}
|
|
?>
|
|
</Select>
|
|
<!-- <input type="text" name="opentype" id="opentype" value=""> -->
|
|
</div>
|
|
|
|
<div>
|
|
<label for="speed">速度</label>
|
|
<input type="text" name="speed" id="speed" value="<?php echo $data['speed']; ?>" onkeyup="if(value<0)value=0;if(value.length>4)value=value.slice(0,4);value=value.replace(/^\D*(\d*(?:\.\d{0,1})?).*$/g, '$1')" required>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="repairtype">維修型態</label>
|
|
<Select name="repairtype" id="repairtype" required>
|
|
<?php
|
|
switch ($data['repairtype']) {
|
|
case "A":
|
|
echo "<Option Value='A' selected='selected'>定期保養</Option> <Option Value='B'>單次保養</Option> <Option Value='C'>單次維修</Option>";
|
|
break;
|
|
case "B":
|
|
echo "<Option Value='A'>定期保養</Option> <Option Value='B' selected='selected'>單次保養</Option> <Option Value='C'>單次維修</Option>";
|
|
break;
|
|
case "C":
|
|
echo "<Option Value='A'>定期保養</Option> <Option Value='B'>單次保養</Option> <Option Value='C' selected='selected'>單次維修</Option>";
|
|
break;
|
|
}
|
|
?>
|
|
</Select>
|
|
<!-- <input type="text" name="repairtype" id="repairtype" value=""> -->
|
|
</div>
|
|
|
|
<div>
|
|
<label for="longitude">經度(必填)</label>
|
|
<input type="text" name="longitude" id="longitude" value="<?php echo $data['longitude']; ?>">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="latitude">緯度(必填)</label>
|
|
<input type="latitude" name="latitude" id="latitude" value="<?php echo $data['latitude']; ?>"d>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="address">地址</label>
|
|
<input type="text" name="address" id="address" value="<?php echo $data['address']; ?>">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="repairerid">維修人員工號</label>
|
|
<input type="text" name="repairerid" id="repairerid" value="<?php echo $data['repairerid']; ?>">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="repairername">維修人員姓名</label>
|
|
<input type="text" name="repairername" id="repairername" value="<?php echo $data['repairername']; ?>">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="creater">建檔人</label>
|
|
<input type="text" name="creater" id="creater" value="<?php echo $data['creater']; ?>" readonly>
|
|
</div>
|
|
|
|
<div>
|
|
<button type="submit" name="update">確定</button>
|
|
</div>
|
|
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
|
</form>
|
|
</div>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
|
|
|
include "footer.php";
|
|
|
|
?>
|
|
|
|
|