001.
<?
002.
include
"headlog.php"
;
003.
include
"connect.php"
;
004.
include
"func.php"
;
005.
006.
$strSQL
= "SELECT * FROM user u,req_loan r,prefix p,pay a
007.
WHERE u.prefix = p.prefix_id AND u.user_id = r.user_id AND u.user_id=
'".$_GET['
uID
']."'
";
008.
$uID
=
$_GET
[
"uID"
];
009.
010.
$objQuery
= mysql_query(
$strSQL
);
011.
$objResult
= mysql_fetch_array(
$objQuery
);
012.
if
(!
$objResult
)
013.
{
014.
echo
"Not found user_id="
.
$_GET
[
"uID"
];
015.
}
016.
else
017.
{
018.
?>
019.
<title>..:::ระบบจัดการกลุ่มออมทรัพย์เพื่อการผลิต:::..</title>
020.
<link href=
"style.css"
rel=
"stylesheet"
type=
"text/css"
/>
021.
<link href=
"main_style.css"
rel=
"stylesheet"
type=
"text/css"
/>
022.
<style type=
"text/css"
>
023.
<!--
024.
.style1 {color: #0000FF}
025.
.style2 {color: #FF0000}
026.
-->
027.
</style>
028.
</head>
029.
030.
<body>
031.
<div
class
=
"warp"
>
032.
<div
class
=
"body"
>
033.
<div id=
"left_block1"
>
034.
<p style=
" clear:both;margin:10px 0 0;"
>
035.
<div
class
=
"manu_list"
style=
"margin-top:1px;"
>
036.
<td colspan=
"2"
><img src=
"images/menu.gif"
width=
"220"
height=
"30"
/></td>
037.
<a href=
"authloanindex.php"
>หน้าแรก</a>
038.
<a href=
"authloanprofile.php"
>ข้อมูลส่วนตัว</a>
039.
<a href=
"changepassloan.php"
>เปลี่ยนรหัสผ่าน</a>
040.
<a href=
"authloancontract"
>ข้อมูลสัญญาเงินกู้</a>
041.
<a href=
"authloanpay.php"
>ชำระเงินกู้</a>
042.
<a href=
"authloanremain"
>ข้อมูลการค้างชำระเงินกู้</a>
043.
<a href=
"authloancal"
>คำนวณการผ่อนชำระเงินกู้</a>
044.
<a href=
"authloannews"
>จัดการข้อมูลข่าวประชาสัมพันธ์</a>
045.
<a href=
"logout.php"
>ออกจากระบบ</a>
046.
</div>
047.
</p>
048.
</div>
049.
</div>
050.
<div id=
"right_block"
><br>
051.
<font size=
"18"
color=
"#993300"
><b><center> ชำระค่างวดเงินกู้ </center></b></font>
052.
<br/>
053.
<table width =
"744"
border=
"0"
cellpadding=
"3"
cellspacing=
"1"
align=
"center"
>
054.
<tr>
055.
<th width=
"141"
bgcolor=
"#CCCCCC"
><div align=
"right"
>สมาชิกเลขที่ :</div></th>
056.
<td width=
"158"
bgcolor=
"#CCFFCC"
><input type=
"text"
value=
"<?=$objResult["
user_id
"];?>"
size=
"3"
readonly=
"readonly"
></td>
057.
<th width=
"231"
bgcolor=
"#CCCCCC"
><div align=
"right"
class
=
"style1"
>ชำระงวดที่ :</div></th>
058.
<td width=
"185"
bgcolor=
"#CCFFCC"
><input type=
"text"
class
=
"style1"
value=
"<?=$capital."
/
".$objResult["
capital
"];?>"
size=
"3"
readonly=
"readonly"
></td>
059.
</tr>
060.
<tr>
061.
062.
<?
063.
$strSQL2
=
"SELECT * FROM rateloan a,req_loan r WHERE r.interest = a.loa_id"
;
064.
$objQuery2
= mysql_query(
$strSQL2
);
065.
$n
=mysql_num_rows(
$objQuery2
);
066.
067.
while
(
$row2
=mysql_fetch_array(
$objQuery2
)){
068.
$loa_name
=
$row2
[
"loa_name"
];
069.
070.
$loan_mount
=
$objResult
[
'loan_mount'
];
071.
$interest_pay
=
$loa_name
*
$loan_mount
;
072.
$total_pay
=
$loan_mount
+
$interest_pay
;
073.
$capital
=
$objResult
[
'capital'
];
074.
$capital1
=
$_POST
[
'txtcapital'
];
075.
$period_pay
=
$total_pay
/
$capital
;
076.
$pay_remain
=
$total_pay
-
$pay_remain
;
077.
$capital1
=0;
078.
$capital1
=
$capital1
+1;
079.
080.
}
081.
?>
082.
<th bgcolor=
"#CCCCCC"
><div align=
"right"
>เลขที่สัญญาเงินกู้ :</div></th>
083.
<td bgcolor=
"#CCFFCC"
><input type=
"text"
value=
"<?=$objResult["
loan_id
"];?>"
size=
"3"
readonly=
"readonly"
></td>
084.
<th bgcolor=
"#CCCCCC"
><div align=
"right"
>ยอดเงินคงเหลือทั้งหมดก่อนชำระ :</div></th>
085.
<td bgcolor=
"#CCFFCC"
><input type=
"text"
value=
"<?=number_format($total_pay,2,'.',',')?>"
readonly=
"readonly"
size=
"6"
> บาท</td>
086.
<?
087.
$pay_due_date
=
$objResult
[
"pay_due_date"
];
088.
$pay_due_date
=displaydate(
$pay_due_date
);
089.
?>
090.
</tr>
091.
<tr>
092.
<th bgcolor=
"#CCCCCC"
><div align=
"right"
>ชื่อผู้กู้ :</div></th>
093.
<td bgcolor=
"#CCFFCC"
><input type=
"text"
value=
"<?=$objResult["
prefix_name
"].$objResult["
fname
"]."
".$objResult["
lname
"];?>"
readonly=
"readonly"
></td>
094.
<th bgcolor=
"#CCCCCC"
><div align=
"right"
>วันที่ครบกำหนดชำระเงิน :</div></th>
095.
<td bgcolor=
"#CCFFCC"
><input type=
"text"
value=
"<?=$pay_due_date?>"
size=
"13"
readonly=
"readonly"
></td>
096.
</tr>
097.
<tr>
098.
<?
099.
$capital
=
$objResult
[
"capital"
];
100.
$loan_mount
=
$objResult
[
"loan_mount"
];
101.
$capital
= 1;
102.
?>
103.
<th bgcolor=
"#CCCCCC"
><div align=
"right"
>จำนวนเงินที่กู้ :</div></th>
104.
<td bgcolor=
"#CCFFCC"
><input type=
"text"
value=
"<?=number_format($loan_mount,2,'.',',')?>"
size=
"3"
>
105.
บาท</td>
106.
<?
107.
108.
$pay_date
=
date
(
'Y-m-d '
);
109.
$pay_date
=displaydate(
$pay_date
);
110.
?>
111.
<th bgcolor=
"#CCCCCC"
><div align=
"right"
class
=
"style2"
>วันที่จ่ายจริง :</div></th>
112.
<td bgcolor=
"#CCFFCC"
><input name=
"pay_date"
type=
"text"
id=
"pay_date"
value=
"<?=$pay_date?>"
size=
"13"
> </td>
113.
</tr>
114.
<tr>
115.
<th> </th>
116.
<td> </td>
117.
<th bgcolor=
"#CCCCCC"
><div align=
"right"
>จำนวนเงินที่ชำระ :</div></th>
118.
<td bgcolor=
"#CCFFCC"
><input type=
"text"
name=
"pay_date"
id=
"pay_date"
size=
"7"
value=
"<?=number_format($period_pay,2,'.',',')?>"
>
119.
บาท
120.
<td> </td>
121.
</tr>
122.
<tr>
123.
<th> </th>
124.
<td> </td>
125.
<th bgcolor=
"#CCCCCC"
><div align=
"right"
class
=
"style2"
>ค่าปรับ :</div></th>
126.
<td bgcolor=
"#CCFFCC"
><span
class
=
"style2"
>
127.
<input type=
"text"
name=
"pay_date"
id=
"pay_date"
size=
"7"
value=
"<?=number_format($fine,2,'.',',')?>"
>
128.
บาท
129.
</span>
130.
<td> </td>
131.
</tr>
132.
<tr>
133.
<th> </th>
134.
<td> </td>
135.
<th bgcolor=
"#CCCCCC"
><div align=
"right"
class
=
"style1"
>จำนวนเงินที่ต้องชำระทั้งสิ้น :</div></th>
136.
<?
137.
$fine
=
$fine
+
$period_pay
;
138.
?>
139.
<td bgcolor=
"#CCFFCC"
><span
class
=
"style1"
>
140.
<input type=
"text"
name=
"pay_date"
id=
"pay_date"
size=
"7"
value=
"<?=number_format($fine,2,'.',',')?>"
>
141.
บาท
142.
</span>
143.
<td> </td>
144.
</tr>
145.
<tr>
146.
<th colspan=
"4"
> </th>
147.
</tr>
148.
<tr>
149.
<th colspan=
"4"
>
150.
151.
<div align=
"center"
>
152.
<input type=
"button"
value=
"ชำระเงิน"
>
153.
<input type=
"submit"
value=
"พิมพ์เอกสารการชำระ"
>
154.
</div></th>
155.
</tr>
156.
</table>
157.
<?
158.
}
159.
mysql_close(
$objConnect
);
160.
?>
161.
</div>
162.
<div
class
=
"footer_page"
>
163.
</div>