001.
<?php
002.
include
(
"conn.php"
);
003.
?>
004.
005.
<?php
006.
include
'check_ADMIN.php'
007.
?>
008.
009.
<!doctype html>
010.
<html>
011.
<head>
012.
<meta charset=
"utf-8"
>
013.
<title>E-POST System NSRU</title>
014.
<link rel=
"icon"
href=
"favicon.ico"
type=
"image/x-icon"
>
015.
<style type=
"text/css"
>
016.
p.MsoNormal {margin-top:0cm;
017.
margin-right:0cm;
018.
margin-bottom:10.0pt;
019.
margin-left:0cm;
020.
line-height:200%;
021.
font-size:11.0pt;
022.
font-family:
"Calibri"
,
"sans-serif"
;
023.
}
024.
</style>
025.
</head>
026.
027.
<body OnLoad=
"window.print();"
>
028.
<?php
029.
$name
=
$_GET
[
"name"
];
030.
$sname
=
$_GET
[
"sname"
];
031.
$year
=
$_GET
[
"year"
];
032.
$Month
=
$_GET
[
"Month"
];
033.
$x
=
$_GET
[
"x"
];
034.
if
(
$name
==
""
&&
$sname
==
""
&&
$year
==
""
&&
$Month
==
""
)
035.
{
036.
$head
=
""
;
037.
}
038.
else
if
(
$name
!=
""
&&
$sname
==
""
&&
$year
==
"%"
&&
$Month
==
"%"
)
039.
{
040.
$head
=
"คุณ "
.
$name
;
041.
}
042.
else
if
(
$name
!=
""
&&
$sname
!=
""
&&
$year
==
"%"
&&
$Month
==
"%"
)
043.
{
044.
$head
=
"คุณ "
.
$name
.
" "
.
$sname
;
045.
}
046.
else
if
(
$name
==
""
&&
$sname
==
""
&&
$year
==
"%"
&&
$Month
!=
"%"
)
047.
{
048.
$head
=
"เดือน "
.
$Month
;
049.
}
050.
else
if
(
$name
==
""
&&
$sname
==
""
&&
$year
!=
"%"
&&
$Month
==
"%"
)
051.
{
052.
$head
=
"ปี "
.
$year
;
053.
}
054.
else
if
(
$name
!=
""
&&
$sname
==
""
&&
$year
==
"%"
&&
$Month
!=
"%"
)
055.
{
056.
$head
=
"คุณ "
.
$name
.
" เดือน "
.
$Month
;
057.
}
058.
else
if
(
$name
!=
""
&&
$sname
!=
""
&&
$year
==
"%"
&&
$Month
!=
"%"
)
059.
{
060.
$head
=
"คุณ "
.
$name
.
" "
.
$sname
.
" เดือน "
.
$Month
;
061.
}
062.
else
if
(
$name
!=
""
&&
$sname
==
""
&&
$year
!=
"%"
&&
$Month
==
"%"
)
063.
{
064.
$head
=
"คุณ "
.
$name
.
" ปี "
.
$year
;
065.
}
066.
else
if
(
$name
!=
""
&&
$sname
!=
""
&&
$year
!=
"%"
&&
$Month
==
"%"
)
067.
{
068.
$head
=
"คุณ "
.
$name
.
" "
.
$sname
.
" ปี "
.
$year
;
069.
}
070.
else
if
(
$name
==
""
&&
$sname
==
""
&&
$year
!=
"%"
&&
$Month
!=
"%"
)
071.
{
072.
$head
=
"เดือน "
.
$Month
.
" ปี "
.
$year
;
073.
}
074.
else
if
(
$name
!=
""
&&
$sname
==
""
&&
$year
!=
"%"
&&
$Month
!=
"%"
)
075.
{
076.
$head
=
"คุณ "
.
$name
.
" เดือน "
.
$Month
.
" ปี "
.
$year
;
077.
}
078.
else
if
(
$name
!=
""
&&
$sname
!=
""
&&
$year
!=
"%"
&&
$Month
!=
"%"
)
079.
{
080.
$head
=
"คุณ "
.
$name
.
" "
.
$sname
.
" เดือน "
.
$Month
.
" ปี "
.
$year
;
081.
}
082.
?>
083.
<form id=
"form1"
name=
"form1"
method=
"post"
>
084.
<table width=
"100%"
border=
"0"
>
085.
<tbody>
086.
<tr>
087.
<td align=
"center"
>
088.
<p
class
=
"MsoNormal"
align=
"center"
style=
"text-align:center;"
><strong><span style=
"line-height:100%; font-family:'TH SarabunPSK','sans-serif'; font-size:20.0pt; "
><img src=
"image/trademark_nsru.png"
width=
"170"
height=
"80"
alt=
""
/></span></strong></p>
089.
<p
class
=
"MsoNormal"
align=
"center"
style=
"text-align: center; font-weight: bold; font-style: normal;"
><span style=
"line-height: 30pt; font-family: 'TH SarabunPSK','sans-serif'; font-size: 20pt; color: black; font-style: normal; font-weight: bold;"
>รายงานข้อมูลพัสดุ<br> ระบบลงทะเบียนรับ - ส่งจดหมาย (e-post) มหาวิทยาลัย <br> <?php
echo
$head
?> </span></strong></span></p>
090.
091.
092.
<table width=
"1000"
border=
"0"
>
093.
<tbody>
094.
<tr>
095.
<td><table width=
"100%"
border=
"1"
cellpadding=
"0"
cellspacing=
"0"
bordercolor=
"#000000"
>
096.
<tbody>
097.
<tr
class
=
"table table-hover"
>
098.
<td width=
"15%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt; font-weight: bold;"
>รหัสพัสดุ</td>
099.
<td width=
"15%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt; font-weight: bold;"
>วันที่รับเข้า</td>
100.
<td width=
"15%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt; font-weight: bold;"
>วันที่นำจ่าย</td>
101.
<td width=
"12%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt; font-weight: bold;"
>ชื่อผู้ส่งพัสดุ</td>
102.
<td width=
"8%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt; font-weight: bold;"
>สถานะ</td>
103.
<td width=
"12%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt; font-weight: bold;"
>ประเภท</td>
104.
<td width=
"12%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt; font-weight: bold;"
>ชื่อผู้รับพัสดุ</td>
105.
<td width=
"25%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt; font-weight: bold;"
>ผู้รับเเทน</td>
106.
</tr>
107.
108.
<?php
109.
$sql
="SELECT parcles.parcle_id, parcles.parcle_dt_get, parcles.parcle_dt_send, parcles.parcle_from, parcles.parcle_tel,parcles.parcle_status,parcles.parcle_getreplaced,parcles.member_id,parcles.type_id, members.member_id,members.member_name, members.member_surname From parcles JOIN members ON parcles.member_id = members.member_id JOIN type ON parcles.type_id = type.type_id
110.
WHERE
$x
";
111.
$result
=mysqli_query(
$conn
,
$sql
);
112.
if
(mysqli_num_rows(
$result
)>0){
113.
while
(
$array
=mysqli_fetch_array(
$result
)){
114.
$parcle_id
=
$array
[
'parcle_id'
];
115.
$parcle_dt_get
=
$array
[
'parcle_dt_get'
];
116.
$parcle_dt_send
=
$array
[
'parcle_dt_send'
];
117.
$parcle_from
=
$array
[
'parcle_from'
];
118.
$parcle_tel
=
$array
[
'parcle_tel'
];
119.
$parcle_status
=
$array
[
'parcle_status'
];
120.
$parcle_getreplaced
=
$array
[
'parcle_getreplaced'
];
121.
$member_id
=
$array
[
'member_id'
];
122.
$member_name
=
$array
[
'member_name'
];
123.
$member_surname
=
$array
[
'member_surname'
];
124.
$type_id
=
$array
[
'type_id'
];
125.
?>
126.
127.
<tr>
128.
<td height=
"25%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt"
><?php
echo
$parcle_id
; ?></td>
129.
<td height=
"25%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt"
><?php
echo
$parcle_dt_get
; ?></td>
130.
<td align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt"
><?php
echo
$parcle_dt_send
; ?></td>
131.
<td height=
"25%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt"
><?php
echo
$parcle_from
; ?></td>
132.
<td height=
"25%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt"
><?php
if
(
$parcle_status
==1)
echo
"<font color='blue'>รอนำจ่าย</font>"
;
if
(
$parcle_status
==2)
echo
"<font color='green'>นำจ่ายแล้ว</font>"
; ?></td>
133.
134.
<?php
135.
$sql2
=
"SELECT type_id, type_name FROM type WHERE type_id=$type_id"
;
136.
$query2
=mysqli_query(
$conn
,
$sql2
);
137.
$array2
=mysqli_fetch_array(
$query2
);
138.
$t_id
=
$array2
[
'type_id'
];
139.
$t_name
=
$array2
[
'type_name'
];
140.
?>
141.
<td height=
"25%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt"
><?php
echo
$t_name
; ?></td>
142.
<td height=
"20%"
align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt"
><?php
echo
$member_name
;?> <?php
echo
$member_surname
;?></td>
143.
<td align=
"center"
style=
"font-style: normal; font-family: 'TH SarabunPSK','sans-serif'; font-size: 16pt"
><?php
echo
$parcle_getreplaced
; ?></td>
144.
</tr>
145.
<!--เป็น HTML ของแถวที่ 2 -->
146.
147.
<?php
148.
}}
else
{
149.
echo
"ไม่มีข้อมูลในฐานข้อมูล"
;
150.
}
151.
?>
152.
</table>
153.
<p
class
=
"MsoNormal"
align=
"center"
style=
"text-align:center;"
><br><br><br> </p></td>
154.
</tr>
155.
</tbody>
156.
</table>
157.
<h3
class
=
"MsoNormal"
align=
"center"
style=
"margin-bottom:.0001pt;text-align:center;"
> </h3>
158.
<p> </p>
159.
</form>
160.
</body>
161.
</html>