001.
<?php
002.
if
((
$_SESSION
[
'comUsernm'
] !=
""
) AND (
$_SESSION
[
'comPrio'
] > 0)){
003.
?>
004.
<div
class
=
"content_box"
>
005.
<h2>เพิ่มบัญชีธนาคาร</h2>
006.
<?php
007.
if
(
$p_todo
==
""
){
008.
?>
009.
<script language=
"javascript"
>
010.
$(document).ready(
function
(){
011.
$(
"#add"
).validate();
012.
});
013.
</script>
014.
<form id=
"SelectType"
method=
"post"
action=
"index.php?mod=addbank&path=member<?=$_GET[id]?>&todo=bank"
>
015.
<div
class
=
"space1"
align=
"center"
>
016.
<input type=
"hidden"
name=
"tmpid"
value=
"1"
/>
017.
<select name=
"txtType"
class
=
"textfield"
>
018.
<option value=
"Bank"
>ชำระเงินผ่านบัญชีธนาคาร</option>
019.
<option value=
"Credit"
>ชำระเงินผ่านบัตรเครดิต</option>
020.
</select>
021.
<input type=
"submit"
value=
"เลือกวิธีการชำระเงิน"
class
=
"btn"
/>
022.
</div>
023.
</form>
024.
<?
025.
}
026.
?>
027.
028.
029.
<br><br>
030.
<?
031.
if
(
$p_todo
==
"bank"
){
032.
033.
if
(
$p_txtType
==
"Bank"
) {
034.
?>
035.
<table width=
"100%"
>
036.
<tr>
037.
<td>
038.
<fieldset>
039.
<legend> ชำระเงินผ่านบัญชีธนาคาร</legend>
040.
041.
<table border=
"0"
width=
"80%"
>
042.
<tr valign=
"middle"
height=
"30"
>
043.
<td width=
"30%"
align=
"right"
><label>ธนาคาร: </label></td>
044.
<td>
045.
<select name=
"txtBank"
class
=
"textfield"
>
046.
<option value=
"ธนาคารกรุงเทพ"
>ธนาคารกรุงเทพ</option>
047.
<option value=
"ธนาคารกรุงไทย"
>ธนาคารกรุงไทย</option>
048.
<option value=
"ธนาคารกรุงศรี"
>ธนาคารกรุงศรี</option>
049.
<option value=
"ธนาคารทหารไทย"
>ธนาคารทหารไทย</option>
050.
<option value=
"ธนาคารกสิกรไทย"
>ธนาคารกสิกรไทย</option>
051.
<option value=
"ธนาคารไทยพานิชย์"
>ธนาคารไทยพานิชย์</option>
052.
<option value=
"ธนาคารยูโอบี"
>ธนาคารยูโอบี</option>
053.
<option value=
"ธนาคารออมสิน"
>ธนาคารออมสิน</option>
054.
<option value=
"ธนาคารสแตนดาร์ดชาร์เตอร์"
>ธนาคารสแตนดาร์ดชาร์เตอร์</option>
055.
</select>
056.
</td>
057.
</tr>
058.
<tr valign=
"top"
>
059.
<td align=
"right"
><label>เลขที่บัญชี: </label></td>
060.
<td> <input type=
"text"
id=
"txtAc1"
name=
"txtAc1"
size=
"1"
maxlength =
"3"
class
=
"required"
/> -
061.
<input type=
"text"
id=
"txtAc2"
name=
"txtAc2"
size=
"5"
maxlength =
"6"
class
=
"required"
/> -
062.
<input type=
"text"
id=
"txtAc3"
name=
"txtAc3"
size=
"1"
maxlength =
"1"
class
=
"required"
/> * หมายเลขบัญชี 10 หลัก
063.
</td>
064.
</tr>
065.
<tr valign=
"top"
>
066.
<td align=
"right"
><label>ประเภทบัญชี: </label></td>
067.
<td> <select name=
"txtbtype"
class
=
"textfield"
>
068.
<option value=
"ออมทรัพย์"
>ออมทรัพย์</option>
069.
<option value=
"กระแสรายวัน"
>กระแสรายวัน</option>
070.
<option value=
"ฝากประจำ"
>ฝากประจำ</option>
071.
</select>
072.
</td>
073.
</tr>
074.
<tr valign=
"top"
>
075.
<td align=
"right"
><label>ผู้ถือบัตร: </label></td>
076.
<td> <input type=
"text"
id=
"txtOwner"
name=
"txtOwner"
size=
"25"
class
=
"required"
/> </td>
077.
</tr>
078.
<tr valign=
"top"
>
079.
<td align=
"right"
><label>จำนวนเงิน: </label></td>
080.
<td> <input type=
"text"
id=
"txtAmount"
name=
"txtAmount"
size=
"5"
class
=
"required"
/> บาท </td>
081.
</tr>
082.
<tr valign=
"top"
>
083.
<td align=
"right"
><label>หมายเหตุ: </label></td>
084.
<td> <input type=
"text"
id=
"txtPS"
name=
"txtPS"
size=
"25"
class
=
"required"
/></td>
085.
</tr>
086.
</table>
087.
<br />
088.
</fieldset>
089.
</td>
090.
</tr>
091.
</table>
092.
093.
<?
094.
}
else
{
095.
096.
?>
097.
<table width=
"100%"
>
098.
<tr>
099.
<td>
100.
<fieldset>
101.
<legend> ชำระเงินผ่านบัตรเครดิต</legend>
102.
103.
<table border=
"0"
width=
"80%"
>
104.
<tr valign=
"middle"
height=
"30"
>
105.
<td width=
"30%"
align=
"right"
><label>เลขที่บัญชี: </label></td>
106.
<td> <input type=
"text"
id=
"txtAc1"
name=
"txtAc1"
size=
"2"
class
=
"required"
maxlength =
"4"
/>
107.
<input type=
"text"
id=
"txtAc2"
name=
"txtAc2"
size=
"2"
class
=
"required"
maxlength =
"4"
/>
108.
<input type=
"text"
id=
"txtAc3"
name=
"txtAc3"
size=
"2"
class
=
"required"
maxlength =
"4"
/>
109.
<input type=
"text"
id=
"txtAc4"
name=
"txtAc4"
size=
"2"
class
=
"required"
maxlength =
"4"
/> * หมายเลขบัตร 16 หลัก
110.
<input type=
"hidden"
id=
"txtBank"
name=
"txtBank"
size=
"25"
value=
"Credit"
/>
111.
</td>
112.
</tr>
113.
<tr valign=
"top"
>
114.
<td align=
"right"
><label>ประเภทบัตร: </label></td>
115.
<td> <select name=
"txtbtype"
class
=
"textfield"
>
116.
<option value=
"VISA"
>VISA</option>
117.
<option value=
"Master Card"
>Master Card</option>
118.
</select>
119.
</td>
120.
</tr>
121.
<tr valign=
"top"
>
122.
<td align=
"right"
><label>ผู้ถือบัตร: </label></td>
123.
<td> <input type=
"text"
id=
"txtOwner"
name=
"txtOwner"
size=
"25"
class
=
"required"
/> </td>
124.
</tr>
125.
<tr valign=
"top"
>
126.
<td align=
"right"
><label>จำนวนเงิน: </label></td>
127.
<td> <input type=
"text"
id=
"txtAmount"
name=
"txtAmount"
size=
"5"
class
=
"required"
/> บาท </td>
128.
</tr>
129.
<tr valign=
"top"
>
130.
<td align=
"right"
><label>รหัสหลังบัตร: </label></td>
131.
<td> <input type=
"text"
id=
"txtPS"
name=
"txtPS"
size=
"5"
maxlength =
"3"
class
=
"required"
/> * หมายเลขหลังบัตร 3 หลัก</td>
132.
</tr>
133.
</table>
134.
<br />
135.
136.
</fieldset>
137.
</td>
138.
</tr>
139.
</table>
140.
<?
141.
}
142.
?>
143.
<div
class
=
"space1"
align=
"center"
>
144.
<br />
145.
<input type=
"hidden"
id=
"txtID"
name=
"txtID"
size=
"25"
value=
"<?=$p_id?>"
/>
146.
<input
class
=
"btn"
type=
"submit"
value=
"ยืนยันการชำระเงิน"
/>
147.
</div>
148.
</form>
149.
</p>
150.
151.
<?php
152.
153.
}
154.
else
if
(
$p_todo
==
"save"
){
155.
156.
157.
if
(
$myClass
->chkUniqDate(
"tb_credit"
,
"crad_no"
,
$p_txtBank
)){
158.
159.
if
(
$p_txtBank
==
"Credit"
){
160.
$account
=
$p_txtAc1
.
"-"
.
$p_txtAc2
.
"-"
.
$p_txtA3
.
"-"
.
$p_txtAc4
;
161.
$ndate
= time();
162.
$sqladd
=
" Insert Into tb_credit(card_no,pin,name,card_date,credit)Values('$ndate','$txtAmount',"
;
163.
$sqladd
.=
"'$p_txtBank','$p_txtOwner','$txtAmount'$p_txtPS'"
;
164.
$sqladd
.=
"'$ndate',)"
;
165.
}
else
{
166.
$account
=
$p_txtAc1
.
"-"
.
$p_txtAc2
.
"-"
.
$p_txtAc3
;
167.
$sqlcre
=
" Insert Into tb_credit(account_no,account_name,account_date,bankname,banktype,amount)Values('$ndate','$txtAmount',"
;
168.
$sqlcre
.=
"'$p_txtBank','$p_txtOwner','$txtAmount'$p_txtPS'"
;
169.
$sqlcre
.=
"'$ndate',)"
;
170.
echo
$sqladd
;
171.
echo
$sqlcre
;
172.
if
(
$myClass
->query(
$sqladd
))
173.
echo
'<div class="loading">บันทึกเรียบร้อย รอสักครู่...</div>'
;
174.
else
175.
echo
'<div class="loading">บันทึกไม่สำเร็จ รอสักครู่...</div>'
;
176.
}
177.
echo
"<meta http-equiv='refresh' content='3;url=index.php?mod=addbank&path=member'>"
;
178.
}
179.
}
180.
181.
?>
182.
<?php
183.
}
else
{
184.
echo
"<meta http-equiv='refresh' content='0;url=index.php?mod=error&path=main'>"
;
185.
}
186.
187.
?>
188.
</div>