003.
<head>
004.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
005.
<title>Unicity</title>
006.
<style type=
"text/css"
>
007.
<!--
008.
body {
009.
background-color: #EBFEFE;
010.
}
011.
-->
012.
</style></head>
013.
014.
<body>
015.
016.
<?php
017.
018.
$hostname
=
"localhost"
;
019.
$user
=
"root"
;
020.
$password
=
"1234"
;
021.
$dbname
=
"unicity"
;
022.
$tblname
=
"customer"
;
023.
024.
mysql_connect(
$hostname
,
$user
,
$password
)
or
die
(
"ติดต่อฐานข้อมูลไม่ได้"
);
025.
026.
mysql_select_db(
$dbname
)
or
die
(
"เลือกฐานข้อมูลไม่ได้"
);
027.
028.
029.
mysql_query(
"SET NAMES tis620"
);
030.
031.
$sql
= "insert into
$tblname
(id, name, surname, address, province, tel,
date
)
032.
values (
'$id'
,
'$name'
,
'$surname'
,
'$address'
,
'$province'
,
'$tel'
,
'$date'
)";
033.
$dbquery
= mysql_db_query(
$dbname
,
$sql
);
034.
035.
mysql_close();
036.
037.
echo
"<Font Size=4><B></B>"
;
038.
?>
039.
040.
<form action=
""
method=
"post"
enctype=
"multipart/form-data"
name=
"form1"
id=
"form1"
>
041.
<table width=
"950"
border=
"0"
align=
"center"
cellpadding=
"3"
cellspacing=
"2"
>
042.
<tr>
043.
<td colspan=
"5"
><img src=
"Unicitylogo.png"
width=
"139"
height=
"78"
align=
"right"
/></td>
044.
</tr>
045.
<tr>
046.
<td width=
"120"
> </td>
047.
<td width=
"120"
> </td>
048.
<td width=
"120"
> </td>
049.
<td width=
"120"
> </td>
050.
<td width=
"428"
align=
"right"
>ฺ<< Back</td>
051.
</tr>
052.
</table>
053.
<p> </p>
054.
<table width=
"950"
border=
"0"
align=
"center"
cellpadding=
"3"
cellspacing=
"2"
>
055.
<tr>
056.
<td colspan=
"3"
><h2><strong>การเพิ่มลูกค้า</strong></h2></td>
057.
</tr>
058.
<tr>
059.
<td colspan=
"2"
align=
"right"
valign=
"top"
>เลขประจำตัว / Distributor No.</td>
060.
<td width=
"707"
><label>
061.
<input name=
"id"
type=
"text"
id=
"id"
size=
"15"
/>
062.
</label> </td>
063.
</tr>
064.
<tr>
065.
<td colspan=
"2"
align=
"right"
valign=
"top"
>ชื่อ / Name</td>
066.
<td><label>
067.
<input name=
"name"
type=
"text"
id=
"name"
size=
"25"
/>
068.
</label> </td>
069.
</tr>
070.
<tr>
071.
<td colspan=
"2"
align=
"right"
valign=
"top"
>นามสกุล / Surname</td>
072.
<td><label>
073.
<input name=
"surname"
type=
"text"
id=
"surname"
size=
"25"
/>
074.
</label></td>
075.
</tr>
076.
<tr>
077.
<td colspan=
"2"
align=
"right"
valign=
"top"
>ที่อยู่ / Address</td>
078.
<td><label>
079.
<textarea name=
"address"
id=
"address"
cols=
"45"
rows=
"5"
></textarea>
080.
</label></td>
081.
</tr>
082.
<tr>
083.
<td colspan=
"2"
align=
"right"
valign=
"top"
>จังหวัด / Province</td>
084.
<td><label>
085.
<input name=
"province"
type=
"text"
id=
"province"
size=
"30"
/>
086.
</label> </td>
087.
</tr>
088.
<tr>
089.
<td colspan=
"2"
align=
"right"
valign=
"top"
>เบอร์โทร / Tel.</td>
090.
<td><label>
091.
<input name=
"tel"
type=
"text"
id=
"tel"
size=
"15"
/>
092.
</label> </td>
093.
</tr>
094.
<tr>
095.
<td colspan=
"2"
align=
"right"
valign=
"top"
>วันที่สมัคร /
Date
.</td>
096.
<td><label>
097.
<input name=
"date"
type=
"text"
id=
"date"
size=
"20"
/>
098.
</label> </td>
099.
</tr>
100.
</table>
101.
<p> </p>
102.
<table width=
"50"
border=
"0"
align=
"center"
cellpadding=
"3"
cellspacing=
"2"
>
103.
<tr>
104.
<td><label>
105.
<input type=
"reset"
name=
"Clear"
id=
"button"
value=
"Clear"
/>
106.
</label></td>
107.
<td><label>
108.
<input type=
"submit"
name=
"Submit"
id=
"Submit"
value=
"Submit"
/>
109.
</label></td>
110.
</tr>
111.
</table>
112.
113.
</form>
114.
115.
</body>
116.
</html>