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.
169 lines
9.4 KiB
169 lines
9.4 KiB
<?php
|
|
require_once "database.php";
|
|
include "header.php";
|
|
|
|
$id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.');
|
|
$data = array();
|
|
$db_query = "select * from maintance_contract_detail where id = '$id'";
|
|
$res = mysqli_query($link, $db_query);
|
|
foreach ($res as $data) {
|
|
$dataarray=explode('_',$data["contractsigningperiod"]);
|
|
?>
|
|
<div class="container">
|
|
<form class="form-horizontal" method="post" action="facility-record-update.php" enctype="multipart/form-data">
|
|
<input type="hidden" name="id" value="<?=$id;?>">
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<label for="maintance_contract_id">價審單編號</label>
|
|
<input type="text" name="maintance_contract_id" id="maintance_contract_id" maxlength="20" value="<?=$data["maintance_contract_id"];?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="facilityno">電梯編號</label>
|
|
<input type="text" name="facilityno" id="facilityno" value="<?=$data["facilityno"];?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="brand">品牌</label>
|
|
<select name="brand" id="brand" style="margin-top: 10px" value="<?=$data["brand"];?>">
|
|
<option <?php if ($data["brand"]=="三菱") echo " selected"; ?> value="三菱">三菱</option>
|
|
<option <?php if ($data["brand"]=="日立") echo " selected"; ?> value="日立">日立</option>
|
|
<option <?php if ($data["brand"]=="迅達") echo " selected"; ?> value="迅達">迅達</option>
|
|
<option <?php if ($data["brand"]=="永大") echo " selected"; ?> value="永大">永大</option>
|
|
|
|
<option <?php if ($data["brand"]=="奧的斯機電") echo " selected"; ?> value="奧的斯機電">奧的斯機電</option>
|
|
<option <?php if ($data["brand"]=="通力") echo " selected"; ?> value="通力">通力</option>
|
|
<option <?php if ($data["brand"]=="杭州西奧") echo " selected"; ?> value="杭州西奧">杭州西奧</option>
|
|
<option <?php if ($data["brand"]=="康力") echo " selected"; ?> value="康力">康力</option>
|
|
|
|
<option <?php if ($data["brand"]=="帝奧") echo " selected"; ?> value="帝奧">帝奧</option>
|
|
<option <?php if ($data["brand"]=="帝森") echo " selected"; ?> value="帝森">帝森</option>
|
|
<option <?php if ($data["brand"]=="東芝") echo " selected"; ?> value="東芝">東芝</option>
|
|
<option <?php if ($data["brand"]=="廣日") echo " selected"; ?> value="廣日">廣日</option>
|
|
|
|
<option <?php if ($data["brand"]=="富士達") echo " selected"; ?> value="富士達">富士達</option>
|
|
<option <?php if ($data["brand"]=="富士") echo " selected"; ?> value="富士">富士</option>
|
|
<option <?php if ($data["brand"]=="江南嘉捷") echo " selected"; ?> value="江南嘉捷">江南嘉捷</option>
|
|
<option <?php if ($data["brand"]=="巨人通力") echo " selected"; ?> value="巨人通力">巨人通力</option>
|
|
|
|
<option <?php if ($data["brand"]=="許繼迅達") echo " selected"; ?> value="許繼迅達">許繼迅達</option>
|
|
<option <?php if ($data["brand"]=="快速") echo " selected"; ?> value="快速">快速</option>
|
|
<option <?php if ($data["brand"]=="現代") echo " selected"; ?> value="現代">現代</option>
|
|
<option <?php if ($data["brand"]=="其他") echo " selected"; ?> value="其他">其他</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="type">型號</label>
|
|
<input type="text" name="type" id="type" value="<?=$data["type"];?>">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<label for="speed">速度</label>
|
|
<input type="text" name="speed" id="speed" value="<?=$data["speed"];?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="weight">載重</label>
|
|
<input type="text" name="weight" id="weight" value="<?=$data["weight"];?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="address">電梯使用性質</label>
|
|
<select name="usednature" id="usednature" style="margin-top: 10px" value="<?=$data["usednature"];?>" >
|
|
|
|
<option <?php if ($data["usednature"]=="住宅") echo "selected"; ?> value="住宅">住宅</option>
|
|
<option <?php if ($data["usednature"]=="工廠") echo "selected"; ?> value="工廠">工廠</option>
|
|
<option <?php if ($data["usednature"]=="酒店") echo "selected"; ?> value="酒店">酒店</option>
|
|
<option <?php if ($data["usednature"]=="商務樓") echo "selected"; ?> value="商務樓">商務樓</option>
|
|
|
|
<option <?php if ($data["usednature"]=="公共交通") echo "selected"; ?> value="公共交通">公共交通</option>
|
|
<option <?php if ($data["usednature"]=="政府辦公") echo "selected"; ?> value="政府辦公">政府辦公</option>
|
|
<option <?php if ($data["usednature"]=="學校") echo "selected"; ?> value="學校">學校</option>
|
|
<option <?php if ($data["usednature"]=="醫院") echo "selected"; ?> value="醫院">醫院</option>
|
|
|
|
<option <?php if ($data["usednature"]=="商場") echo "selected"; ?> value="商場">商場</option>
|
|
<option <?php if ($data["usednature"]=="個人") echo "selected"; ?> value="個人">個人</option>
|
|
<option <?php if ($data["usednature"]=="其他") echo "selected"; ?> value="其他">其他</option>
|
|
|
|
</select>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="address">使用年限</label>
|
|
<input type="text" name="usedage" id="usedage" value="<?=$data["usedage"];?>">
|
|
</div>
|
|
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<label for="speed">層站門-層</label>
|
|
<input type="text" name="numberoffloor" id="numberoffloor" value="<?=$data["numberoffloor"];?>" >
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="weight">層站門-站</label>
|
|
<input type="text" name="numberofstop" id="numberofstop" value="<?=$data["numberofstop"];?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="address">層站門-門</label>
|
|
<input type="text" name="numberofdoor" id="numberofdoor" value="<?=$data["numberofdoor"];?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="address">台數</label>
|
|
<input type="text" name="tai_count" id="tai_count" value="<?=$data["tai_count"];?>">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-2">
|
|
<label for="yearlyinspectiondate">年檢日期</label>
|
|
<input type="date" name="yearlyinspectiondate" id="yearlyinspectiondate" value="<?=$data["yearlyinspectiondate"];?>" >
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label for="standardprice">標準價</label>
|
|
<input type="text" name="standardprice" id="standardprice" value="<?=$data["standardprice"];?>" >
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label for="address">議定價</label>
|
|
<input type="text" name="discusspricing" id="discusspricing" onchange="sumfeemethod()" value="<?=$data["discusspricing"];?>">
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label for="address">校驗費</label>
|
|
<input type="text" name="calibrationfee" id="calibrationfee" onchange="sumfeemethod()" value="<?=$data["calibrationfee"];?>">
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label for="compete">年檢費</label>
|
|
<input type="text" name="yearlyinspectionfee" id="yearlyinspectionfee" onchange="sumfeemethod()" value="<?=$data["yearlyinspectionfee"];?>">
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label for="price_total_broken">小計</label>
|
|
<input type="text" name="sumfee" id="sumfee" value="<?=$data["sumfee"];?>">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-md-12 ">
|
|
<button type="submit" class="btn btn-primary btn-lg" >點擊後修改電梯資料</button>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
<?php
|
|
}
|
|
mysqli_free_result($res);
|
|
mysqli_close($link);
|
|
include "footer.php";
|
|
?>
|
|
<script>
|
|
|
|
function sumfeemethod(){
|
|
var discusspricing=$('#discusspricing').val(); //議定價
|
|
var calibrationfee=$('#calibrationfee').val();//校驗費
|
|
var yearlyinspectionfee=$('#yearlyinspectionfee').val();//年檢費
|
|
var sumfee=parseInt(discusspricing)-parseInt(calibrationfee)-parseInt(yearlyinspectionfee);
|
|
console.log('獲取的值');
|
|
console.log(discusspricing);
|
|
console.log(calibrationfee);
|
|
console.log(yearlyinspectionfee);
|
|
$('#sumfee').val(sumfee);
|
|
}
|
|
|
|
</script>
|