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.
 
 
 
 
 
 

115 lines
4.0 KiB

<?php
include "header.php";
$id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.');
$data = array();
// sql語法存在變數中
$db_query = "SELECT * FROM receivable 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="receivable-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']; ?>">
</div>
<div>
<label for="facilityno">作番號</label>
<input type="text" name="facilityno" id="facilityno" value="<?php echo $data['facilityno']; ?>">
</div>
<div>
<label for="receivable_date">應繳款日</label>
<input type="text" data-date-format="yyyy-mm-dd" name="receivable_date" id="receivable_date" value="<?php echo $data['receivable_date']; ?>">
</div>
<div>
<label for="actual_date">實繳款日</label>
<input type="text" data-date-format="yyyy-mm-dd" name="actual_date" id="actual_date" value="<?php echo $data['actual_date']; ?>">
</div>
<div>
<label for="receivable">應繳款金額</label>
<input type="text" name="receivable" id="receivable" value="<?php echo $data['receivable']; ?>" onkeyup="if(value<0)value=0;value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" required>
</div>
<div>
<label for="actual">實繳款金額</label>
<input type="text" name="actual" id="actual" value="<?php echo $data['actual']; ?>" onkeyup="if(value<0)value=0;value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" required>
</div>
<div>
<label for="currency">幣別</label>
<input type="text" name="currency" id="currency" value="<?php echo $data['currency']; ?>">
</div>
<div>
<label for="owner">款項負責人工號</label>
<input type="text" name="owner" id="owner" value="<?php echo $data['owner']; ?>">
</div>
<div>
<label for="status">收款狀態</label>
<Select name="status" id="status" required>
<?php
switch ($data['status']) {
case "P":
echo "<Option Value='P' selected='selected'>待結案</Option> <Option Value='E'>已結案</Option>";
break;
case "E":
echo "<Option Value='P'>待結案</Option> <Option Value='E' selected='selected'>已結案</Option>";
break;
}
?>
</Select>
<!-- <input type="text" name="status" id="status" value=""> -->
</div>
<div>
<label for="note">備註</label>
<input type="text" name="note" id="note" value="<?php echo $data['note']; ?>">
</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";
?>