001.
<HTML>
002.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
003.
<title>แสดงจดหมาย</title>
004.
<style type=
"text/css"
>
005.
<!--
006.
body,td,th {
007.
color: #000000;
008.
}
009.
body {
010.
background-color: #CCCCCC;
011.
}
012.
-->
013.
</style><BODY><center>
014.
<p><img src=
"../Head/head.gif"
width=
"1000"
height=
"150"
> </p>
015.
<p>
016.
<?
017.
include
"connect.php"
;
018.
019.
$sql
=
"select * from email order by id asc"
;
020.
$result
=mysql_db_query(
$dbname
,
$sql
);
021.
echo
"<br>"
;
022.
023.
echo
"
024.
<a href=
'letter_view3.php'
><font color=
'#0443AA'
><b>[จัดการข้อมูลสมาชิก]</a></font> <a href=
'../webboard/login.php'
><font color=
'#0443AA'
>[เว็บบอร์ด]</a></font></b><p>
025.
<table width=
'800'
border=
'1'
>
026.
<tr bgcolor=
'color='
#0443AA'>
027.
<td width=
'50'
><center><b><font size=
'2'
face=
'MS Sans Serif'
color=
'#FFFFFF'
>ลำดับที่
028.
</font></b></center></td>
029.
<td width=
'150'
><center><b><font size=
'2'
face=
'MS Sans Serif'
color=
'#FFFFFF'
>หมายเลขจดหมาย
030.
</font></b></center></td>
031.
<td width=
'250'
><center><b><font size=
'2'
face=
'MS Sans Serif'
color=
'#FFFFFF'
>ชื่อผู้รับ
032.
</font></b></center></td>
033.
<td width=
'150'
><center><b><font size=
'2'
face=
'MS Sans Serif'
color=
'#FFFFFF'
>ประเภทจดหมาย</font></b></center></td>
034.
<td width=
'250'
><center><b><font size=
'2'
face=
'MS Sans Serif'
color=
'#FFFFFF'
>วันที่ได้รับ
035.
</font></b></center></td>
036.
<td width=
'100'
><center><b><font size=
'2'
face=
'MS Sans Serif'
color=
'#FFFFFF'
>สถานะ
037.
</font></b></center></td>
038.
<td width=
'100'
><center><b><font size=
'2'
face=
'MS Sans Serif'
color=
'#FFFFFF'
>แก้ไข</font></b></center></td>
039.
<td width=
'100'
><center><b><font size=
'2'
face=
'MS Sans Serif'
color=
'#FFFFFF'
>ลบ</font></b></center></td></tr>";
040.
041.
while
(
$record
=mysql_fetch_array(
$result
))
042.
{
043.
044.
$id
=
$record
[id];
045.
$iddoc
=
$record
[iddoc];
046.
$name
=
$record
[name];
047.
$lastname
=
$record
[lastname];
048.
$doctype
=
$record
[doctype];
049.
$day
=
$record
[day];
050.
$status
=
$record
[status];
051.
052.
053.
054.
echo
"<tr bgcolor=
'#FFFFFF'
>
055.
<td width=
'50'
><center><font size=
'2'
face=
'MS Sans Serif'
color=
'#0443AA'
>
$id
</font></center></td>
056.
<td width=
'150'
><center><font size=
'2'
face=
'MS Sans Serif'
color=
'#0443AA'
>
$iddoc
</font></center></td>
057.
<td width=
'250'
><center><font size=
'2'
face=
'MS Sans Serif'
color=
'#0443AA'
>
$name
$lastname
</font></center></td>
058.
<td width=
'150'
><center><font size=
'2'
face=
'MS Sans Serif'
color=
'#0443AA'
>
$doctype
</font><center></td>
059.
<td width=
'250'
><center><font size=
'2'
face=
'MS Sans Serif'
color=
'#0443AA'
>
$day
</font></center></td>
060.
<td width=
'100'
><center><font size=
'2'
face=
'MS Sans Serif'
color=
'#0443AA'
>
$status
</font></center></td>
061.
<TD width=
'100'
><A HREF=\
"letter_edit2.php?id_edit=$id\"onclick=\" return confirm('ยืนยันแก้ไข$name ออกจากระบบ')\"
><center>แก้ไข</A></TD></center>
062.
<TD width=
'100'
><A HREF=\
"admin_type_delete.php?id_del=$id\"onclick=\" return confirm('ยืนยันลบ$name ออกจากระบบ')\"
><center>ลบ</A></TD></center>
063.
</tr>";
064.
065.
}
066.
echo
"</table>"
;
067.
?>
068.
</p>
069.
<p><a href=
"adminlogout.php"
><center>[ออกจากระบบ]</center><br></a></p>
070.
</center>
071.
</center>
072.
<tr>
073.
<td><h2 align=
"center"
class
=
"style1"
> </h2>
074.
<h3 align=
"center"
class
=
"style1"
><font color=
"#0000FF"
>เพิ่มจดหมาย</font></h3>
075.
<form name=
"checkForm"
method=
"POST"
action=
"letter_save.php"
onSubmit=
"return check()"
>
076.
<table width=
"512"
border=
"0"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
bgcolor=
"#99FFFF"
size =
"10"
>
077.
<tr>
078.
<td>ประเภทจดหมาย</td>
079.
<td><font size=
"2"
face=
"MS Sans Serif, Tahoma, sans-serif"
>
080.
<select name=doctype >
081.
<option selected value=
""
>เลือกประเภท</option>
082.
<option value=
"จดหมาย"
>จดหมาย</option>
083.
<option value=
"EMS"
>EMS</option>
084.
<option value=
"พัสดุ"
>พัสดุ</option>
085.
</select>
086.
</font></td>
087.
</tr>
088.
<tr>
089.
<td> </td>
090.
<td> </td>
091.
</tr>
092.
<tr>
093.
<td width=
"120"
>หมายเลข</td>
094.
<td width=
"382"
><input name=
"iddoc"
type=
"text"
id=
"iddoc"
size=
"30"
maxlength=
"13"
></td>
095.
</tr>
096.
<tr>
097.
<td> </td>
098.
<td> </td>
099.
</tr>
100.
<tr>
101.
<td>ชื่อ-นามสกุล</td>
102.
<td><label
for
=
"name"
></label>
103.
<input name=
"name"
type=
"text"
id=
"name"
size=
"25"
>
104.
-
105.
<label
for
=
"lastname"
></label>
106.
<input name=
"lastname"
type=
"text"
id=
"lastname"
size=
"25"
></td>
107.
</tr>
108.
<tr>
109.
<td> </td>
110.
<td> </td>
111.
</tr>
112.
<tr>
113.
<td>วันที่ได้รับ</td>
114.
115.
<td><font size=
"2"
face=
"MS Sans Serif, Tahoma, sans-serif"
>
116.
<label
for
=
"year"
></label>
117.
</font><?
118.
$c_date
=
date
(
"d"
);
119.
$m_app
=
array
(
"ม.ค."
,
"ก.พ."
,
"มี.ค."
,
"เม.ย."
,
"พ.ค."
,
"มิ.ย."
,
"ก.ค."
,
"ส.ค."
,
"ก.ย."
,
"ต.ค."
,
"พ.ย."
,
"ธ.ค."
);
120.
$mounth_app
=
$m_app
[
date
(
"n"
) - 1];
121.
$y_app
=
date
(
"Y"
) + 543;
122.
$c_time
=
date
(
"H:i"
);
123.
$day
=
"$c_date $mounth_app $y_app เวลา$c_time น."
;
124.
?>
125.
126.
<input name=
"day"
type=
"text"
id=
"day"
value=
"<?=$day ?>"
/></td>
127.
</tr>
128.
<tr>
129.
<td> </td>
130.
<td> </td>
131.
</tr>
132.
<tr>
133.
<td>สถานะ</td>
134.
<td><select name=status >
135.
<option selected value=
""
>เลือกสถานะ</option>
136.
<option value=
"ยังไม่รับ"
>ยังไม่รับ</option>
137.
<option value=
"รับแล้ว"
>รับแล้ว</option>
138.
</select></td>
139.
</tr>
140.
</table>
141.
<script language=
"javascript"
>
142.
function
check() {
143.
if
(document.checkForm.doctype.value==
""
) {
144.
alert(
"กรุณาเลือกประเภท"
) ;
145.
document.checkForm.doctype .focus() ;
146.
return
false ;
147.
}
148.
if
(document.checkForm.iddoc.value==
""
) {
149.
alert(
"กรุณาใสหมายเลขจดหมาย"
) ;
150.
document.checkForm.iddoc .focus() ;
151.
return
false ;
152.
}
153.
if
(document.checkForm.name.value==
""
) {
154.
alert(
"กรุณาใส่ชื่อผู้รับ"
) ;
155.
document.checkForm.doctype .focus() ;
156.
return
false ;
157.
}
158.
if
(document.checkForm.lastname.value==
""
) {
159.
alert(
"กรุณาใส่นามสกุลผู้รับ"
) ;
160.
document.checkForm.doctype .focus() ;
161.
return
false ;
162.
}
163.
if
(document.checkForm.status.value==
""
) {
164.
alert(
"กรุณาเลือกสถานะ"
) ;
165.
document.checkForm.doctype .focus() ;
166.
return
false ;
167.
}
168.
169.
else
170.
return
true ;
171.
}
172.
</script>
173.
<div align=
"center"
><br>
174.
<input name=
"submit"
type=
"submit"
value=
"ตกลง"
>
175.
<input name=
"reset"
type=
"reset"
value=
"ยกเลิก"
>
176.
</div>
177.
</form>
178.
</BODY>
179.
</HTML>