001.
<?
002.
session_start();
003.
?>
004.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
005.
<?
006.
007.
if
(
$sess_adminid
<>session_id()) {
008.
echo
'<script language="javascript">'
.
"\n"
;
009.
echo
'<!--'
.
"\n"
;
010.
echo
"alert ('กรุณาลงชื่อเข้าใช้'); \n"
;
011.
echo
"window.location='index.php'"
;
012.
echo
'//-->'
.
"\n"
;
013.
echo
'</script>'
.
"\n"
;
014.
exit
();
015.
}
016.
?>
017.
018.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
019.
<title>ระบบหลังร้าน</title>
020.
<style type=
"text/css"
>
021.
<!--
022.
body,td,th {
023.
color: #99FFCC;
024.
}
025.
.style15 {font-size: larger;
026.
color: #663333;
027.
}
028.
.style28 {font-family: Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; }
029.
.style39 {font-family: Geneva, Arial, Helvetica, sans-serif}
030.
.style20 { font-family: Geneva, Arial, Helvetica, sans-serif;
031.
color: #000000;
032.
}
033.
.style59 {font-family:
"MS Sans Serif"
, Tahoma,
"Cordia New"
}
034.
.style41 {font-family: Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; font-weight: bold; }
035.
.style41 {color: #FFFFFF}
036.
.style64 {font-size: larger; color: #000000; }
037.
.style65 {color: #000000; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; }
038.
.style66 {font-weight: bold; font-family: Geneva, Arial, Helvetica, sans-serif;}
039.
a:link {
040.
color: #000000;
041.
text-decoration: none;
042.
}
043.
a:visited {
044.
text-decoration: none;
045.
color: #990066;
046.
}
047.
a:hover {
048.
text-decoration: none;
049.
color: #0000FF;
050.
}
051.
a:active {
052.
text-decoration: none;
053.
}
054.
.style72 {color: #000000; font-weight: bold; }
055.
.style18 { color: #663333;
056.
font-family: Geneva, Arial, Helvetica, sans-serif;
057.
}
058.
.style73 {color: #000000}
059.
.style74 {font-size: 14px}
060.
.style75 {font-weight: bold; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 14px; }
061.
.style77 {font-size: 16px; }
062.
.style78 {color: #000000; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 16px; }
063.
-->
064.
</style>
065.
</head>
066.
067.
<body>
068.
069.
<table width=
"1000"
border=
"0"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
>
070.
<!--DWLayoutTable-->
071.
<tr>
072.
<td width=
"1022"
height=
"161"
valign=
"top"
><div align=
"center"
><img src=
"head/header.jpg"
width=
"1000"
height=
"220"
></div></td>
073.
</tr>
074.
</table>
075.
<div align=
"center"
></div>
076.
<table width=
"1000"
border=
"0"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
>
077.
<!--DWLayoutTable-->
078.
<tr>
079.
<td width=
"1000"
height=
"800"
valign=
"top"
><table width=
"100%"
border=
"0"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
>
080.
<!--DWLayoutTable-->
081.
<tr>
082.
<td width=
"1000"
height=
"471"
valign=
"top"
><table width=
"999"
border=
"0"
>
083.
<tr>
084.
<td width=
"269"
valign=
"top"
bgcolor=
"#FFFFCC"
><table width=
"254"
height=
"182"
border=
"0"
align=
"center"
>
085.
<tr>
086.
<td bgcolor=
"#FFFFCC"
><table width=
"218"
border=
"0"
align=
"left"
cellpadding=
"0"
cellspacing=
"0"
>
087.
<tr>
088.
<td width=
"218"
height=
"66"
background=
"head/menu3_01.png"
> </td>
089.
</tr>
090.
<tr>
091.
<td background=
"head/menu3_02.png"
><table width=
"154"
border=
"0"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
>
092.
<tr>
093.
<td><div align=
"center"
><span
class
=
"style72"
>รายการ</span></div></td>
094.
</tr>
095.
<tr>
096.
<td
class
=
"style65"
><div align=
"left"
class
=
"style77"
> <img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
><a href=
"admin.php"
class
=
"style74"
> หน้าแรก </a></div></td>
097.
</tr>
098.
<tr>
099.
<td><div align=
"left"
class
=
"style78"
>
100.
<div align=
"left"
><img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"admin_mem.php"
class
=
"style74"
>ลูกค้า </a></div>
101.
</div></td>
102.
</tr>
103.
<tr>
104.
<td><div align=
"left"
class
=
"style78"
>
105.
<div align=
"left"
><img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"admin_product.php"
><span
class
=
"style74"
>สินค้า</span><br>
106.
</a><img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
><a href=
"add_product.php"
class
=
"style74"
> เพิ่มสินค้า</a><br>
107.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
><a href=
"seach_ordist.php"
class
=
"style74"
> เพิ่มจำนวนสินค้า</a><br>
108.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
><a href=
"admin_productonhand.php"
class
=
"style74"
> จำนวนสินค้าคงเหลือ </a><br>
109.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <span
class
=
"style75"
><a href=
"admin_buy.php"
>สั่งซื้อ</a></span><br>
110.
</div>
111.
</div></td>
112.
</tr>
113.
<tr>
114.
<td><div align=
"left"
class
=
"style78"
>
115.
<div align=
"left"
><img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"admin_dis.php"
class
=
"style74"
>ผู้จำหน่าย</a><br>
116.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
><a href=
"add_dis.php"
class
=
"style74"
> เพิ่มผู้จำหน่าย</a><br>
117.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"admin_em.php"
class
=
"style74"
>พนักงาน </a><br>
118.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"add_em.php"
class
=
"style74"
>เพิ่มพนักงาน </a><br>
119.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <span
class
=
"style74"
><a href=
"forget_question.php"
>คำถามกันลืม</a></span><br>
120.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"forget_question_add.php"
class
=
"style74"
>เพิ่มคำถามกันลืม</a><br>
121.
</div>
122.
</div></td>
123.
</tr>
124.
<tr>
125.
<td><div align=
"left"
class
=
"style78"
>
126.
<div align=
"left"
><img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"admin_show_order.php"
class
=
"style74"
>รายการสั่งซื้อลูกค้า</a><br>
127.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"admin_showorsdist.php"
class
=
"style74"
>รายการสั่งซื้อสินค้า</a></div>
128.
</div></td>
129.
</tr>
130.
<tr>
131.
<td height=
"76"
><div align=
"left"
class
=
"style78"
>
132.
<div align=
"left"
><img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"admin_payment.php"
class
=
"style74"
>รายการโอนเงิน</a> <br>
133.
<img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"report.php"
class
=
"style74"
>รายงาน</a> <br>
134.
<strong><span
class
=
"style39"
><span
class
=
"style66"
><img src=
"images/b-hana3-e.gif"
width=
"13"
height=
"14"
> <a href=
"logout.php"
class
=
"style74"
>ออกจากระบบ</a></span></span></strong><br>
135.
</div>
136.
</div></td>
137.
</tr>
138.
</table></td>
139.
</tr>
140.
<tr>
141.
<td height=
"35"
background=
"head/menu3_03.png"
> </td>
142.
</tr>
143.
</table></td>
144.
</tr>
145.
</table></td>
146.
147.
<td width=
"720"
colspan=
"2"
valign=
"top"
bgcolor=
"#FFFFCC"
><p align=
"center"
class
=
"style28"
><span
class
=
"style20 style41"
>
148.
</span><span
class
=
"style20"
> </span><span
class
=
"style20"
> </span></p>
149.
<div align=
"center"
>
150.
<p>
151.
<?
152.
include
"connect.php"
;
153.
mysql_query(
"SET NAMES utf8"
)
or
die
(mysql_error());
154.
155.
$sql
=
"SELECT * FROM product where amount <= miny"
;
156.
$re
=mysql_query(
$sql
)
or
die
(mysql_error());
157.
$Num_Rows
= mysql_num_rows(
$re
);
158.
159.
160.
if
(
$Num_Rows
== 0) {
161.
echo
"<br/><center><b style=color:red>ไม่มีสินค้าที่สั่งซื้อ</center></b>"
;
162.
echo
"<meta http-equiv='refresh' content='2;url=admin_product.php'>"
;
163.
}
164.
165.
$Per_Page
= 4;
166.
167.
$Page
=
$_GET
[
"Page"
];
168.
if
(!
$_GET
[
"Page"
])
169.
{
170.
$Page
=1;
171.
}
172.
173.
$Prev_Page
=
$Page
-1;
174.
$Next_Page
=
$Page
+1;
175.
176.
$Page_Start
= ((
$Per_Page
*
$Page
)-
$Per_Page
);
177.
if
(
$Num_Rows
<=
$Per_Page
)
178.
{
179.
$Num_Pages
=1;
180.
}
181.
else
if
((
$Num_Rows
%
$Per_Page
)==0)
182.
{
183.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
) ;
184.
}
185.
else
186.
{
187.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
)+1;
188.
$Num_Pages
= (int)
$Num_Pages
;
189.
}
190.
191.
$sql
.=
" order by id ASC LIMIT $Page_Start , $Per_Page"
;
192.
$re
=mysql_query(
$sql
)
or
die
(mysql_error());
193.
194.
195.
echo
"<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr>"
;
196.
$intRows
= 0;
197.
while
(
$rs
= mysql_fetch_array(
$re
))
198.
{
199.
echo
"<td>"
;
200.
$intRows
++;
201.
?>
202.
203.
</span> </p>
204.
<p> </p>
205.
206.
<div align=
"center"
class
=
"style42"
>
207.
<p align=
"center"
><a href=
"admin_detail.php?id=<?=$rs["
id
"]?>"
><img src=
"<?=$rs["
picture
"]?>"
border=
"0"
/><br>
208.
<br> </a> </div>
209.
<p align=
"center"
><span
class
=
"style73"
>รหัส<?=
$rs
[
"id"
];?>
210.
</span>
211.
<p align=
"center"
> <span
class
=
"style73"
><?=
$rs
[
"name_pr"
];?>
212.
</span>
213.
<p align=
"center"
><span
class
=
"style73"
>
214.
ราคา
215.
<?=
$rs
[
"price2"
];?> บาท
216.
</span>
217.
<p align=
"center"
><span
class
=
"style73"
>
218.
สินค้าที่มี
219.
<?=
$rs
[
"amount"
] ;?>
220.
221.
ตัว</span>
222.
<p align=
"center"
><span
class
=
"style73"
> <a href=
"admin_detail.php?id=<?=$rs["
id
"]?>"
></br>
223.
[สั่งซื้อ] </a> </span>
224.
225.
226.
227.
228.
229.
<?
230.
echo
"</td>"
;
231.
if
((
$intRows
)%2==0)
232.
{
233.
echo
"</tr>"
;
234.
}
235.
}
236.
echo
"</tr></table>"
;
237.
?>
238.
<p align=
"center"
><br>
239.
<span
class
=
"style73"
>ทั้งหมด
240.
<?=
$Num_Rows
;?>
241.
รายการ :
242.
<?=
$Num_Pages
;?>
243.
หน้า :
244.
<?
245.
if
(
$Prev_Page
)
246.
{
247.
echo
" <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< ก่อนหน้า</a> "
;
248.
}
249.
250.
for
(
$i
=1;
$i
<=
$Num_Pages
;
$i
++){
251.
if
(
$i
!=
$Page
)
252.
{
253.
echo
"[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"
;
254.
}
255.
else
256.
{
257.
echo
"<b> $i </b>"
;
258.
}
259.
}
260.
if
(
$Page
!=
$Num_Pages
)
261.
{
262.
echo
" <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>ถัดไป>></a> "
;
263.
}
264.
?>
265.
</span>
266.
</span> </div>
267.
<p align=
"center"
class
=
"style20"
> </p>
268.
<p align=
"center"
class
=
"style18"
></p>
269.
<h2
class
=
"style15 style20 style59"
> </h2>
270.
</div>
271.
272.
<tr bgcolor=
"#66CCFF"
>
273.
<td colspan=
"3"
bgcolor=
"#CC9966"
><div align=
"center"
>
274.
<p
class
=
"style64"
><br>
275.
RUNGARUN PANSEESUK</p>
276.
<p
class
=
"style64"
> </p>
277.
</div></td>
278.
</tr>
279.
</table>
280.
้</td>
281.
</tr>
282.
</table></td>
283.
</tr>
284.
</table></body>
285.
</html>