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.
 
 
 
 
 
 

180 lines
5.9 KiB

<?php
require_once "../database.php";
$id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.');
include "../header.php";
// 載入db.php來連結資料庫
require_once "../database.php";
// 設置一個空陣列來放資料
$data = array();
// sql語法存在變數中
$sql = "SELECT * FROM paid_customer_detail where id='$id' ";
// 用mysqli_query方法執行(sql語法)將結果存在變數中
$data = mysqli_query($link, $sql);
// sql語法存在變數中
$sql = "SELECT * FROM ec_purchase_order where ( substr(customerid,2),summary_price )
in( SELECT customer_id,amount_payable FROM paid_customer_detail where id='$id'
) ";
list($ec_id) = mysqli_fetch_row(mysqli_query($link, "SELECT ec_id FROM paid_customer_detail where id='$id'"));
if (!empty($ec_id)) {
$sql = "SELECT * FROM ec_purchase_order where id ='$ec_id'";
}
// 用mysqli_query方法執行(sql語法)將結果存在變數中
$ecdata = mysqli_query($link, $sql);
?>
<style>
table {
table-layout: fixed;
width: 100%;
}
td {
word-wrap: break-word;
}
img {
width: 125px;
}
.width_style_1 {
width: 125px;
}
table {
width: 100%;
margin: 0 auto;
}
#table_index_filter {
float: right;
}
#table_index_paginate {
float: right;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
</style>
<div style="overflow-x:auto;">
<div style="margin: 0 auto;width:500px;text-align:center">
<h2>銷賬單勾稽作業</h2>
</div>
<form class="form-inline" method="post" action="paid_order_relate_submit.php" enctype="multipart/form-data">
<table class="table table-striped table-bordered" style="width:90%">
<thead>
<tr>
<th colspan='10' style="text-align:center">銷賬單明細</th>
</tr>
<tr>
<th>項次</th>
<th>录入年月</th>
<th>繳款賬號</th>
<th>客戶代號</th>
<th>客戶名稱</th>
<th>客戶類別</th>
<th>繳款日期</th>
<th>應繳</th>
<th>應繳起始日</th>
<th>應交截止日</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $data) : ?>
<tr>
<td><?php echo $data['id'];
echo "<input name='pcd_id' type='hidden' value='" . $data['id'] . "' /> " ?></td>
<td><?php echo $data['yyyymm']; ?></td>
<td><?php echo $data['pay_account']; ?></td>
<td><?php echo $data['customer_id']; ?></td>
<td><?php echo $data['customer_name']; ?></td>
<td><?php echo $data['kind']; ?></td>
<td><?php echo $data['pay_date']; ?></td>
<td><?php echo $data['amount_payable']; ?></td>
<td><?php echo $data['start_date_payable']; ?></td>
<td><?php echo $data['end_date_payable']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<table class="table table-striped table-bordered" style="width:90%">
<thead>
<tr>
<th colspan='13' style="text-align:center">可勾稽請款單明細</th>
</tr>
<tr>
<th>選擇</th>
<th>項次</th>
<th>客戶號/供應商號</th>
<th>發票開立對象</th>
<th>發票開立對象名稱</th>
<th>客戶名稱</th>
<th>品項編碼</th>
<th>品項名稱</th>
<th>數量</th>
<th>單價</th>
<th>稅前價格</th>
<th>營業稅</th>
<th>合計價格</th>
</tr>
</thead>
<tbody>
<?php foreach ($ecdata as $data) : ?>
<tr>
<td><input name="ec_id" type='radio' checked='<?php echo empty($ec_id) ? false : true; ?>' value='<?php echo $data['id']; ?>'> </td>
<td><?php echo $data['id']; ?></td>
<td><?php echo $data['customerid']; ?></td>
<td><?php echo $data['inv_customer_id']; ?></td>
<td><?php echo $data['inv_customer_name']; ?></td>
<td><?php echo $data['customer_name']; ?></td>
<td><?php echo $data['item_no']; ?></td>
<td><?php echo $data['item_name']; ?></td>
<td><?php echo $data['num']; ?></td>
<td><?php echo $data['unit_price']; ?></td>
<td><?php echo $data['pre_tax_price']; ?></td>
<td><?php echo $data['business_tax']; ?></td>
<td><?php echo $data['summary_price']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfooter>
<tr>
<td colspan='13' style="text-align:center">
<?php echo (empty($ec_id) && $ecdata->num_rows!=0 )? "<button name='button' class='btn' type='submit' />勾稽請款單</button>" : ""; ?>
<?php //echo (!empty($ec_id) && $ecdata->num_rows!=0 )? "<button name='button' class='btn' type='submit' />变更請款單</button>" : ""; ?>
</td>
</tr>
</tfooter>
</table>
</form>
</div>
<?php
#代錶結束連線
mysqli_close($link);
include "../footer.php";
?>