001.
<?php
002.
session_start();
003.
header(
"Content-type:text/html; charset=UTF-8"
);
004.
header(
"Cache-Control: no-store, no-cache, must-revalidate"
);
005.
header(
"Cache-Control: post-check=0, pre-check=0"
, false);
006.
include
(
"dbconnect.php"
);
007.
?>
008.
<?php
009.
date_default_timezone_set(
'Asia/Bangkok'
);
010.
$date
=
date
(
"d/m/Y"
);
011.
$time
= time(
"H:i:s"
);
012.
?>
013.
<table cellspacing=
"0"
cellpadding=
"1"
border=
"0"
style=
"width:1000px;"
>
014.
<thead>
015.
<tr>
016.
<th height=
"60"
colspan=
"2"
> BKK GROUP G58 </th>
017.
<th width=
"129"
height=
"60"
> </th>
018.
<th width=
"141"
height=
"27"
> </th>
019.
<th width=
"134"
height=
"27"
> </th>
020.
<th width=
"133"
> </th>
021.
<th width=
"107"
height=
"27"
> </th>
022.
<th width=
"156"
height=
"27"
>หน้าที่ </th>
023.
</tr>
024.
<tr>
025.
<th height=
"28"
colspan=
"2"
> โทรศัพท์</th>
026.
<th height=
"28"
> </th>
027.
<th height=
"28"
> </th>
028.
<th height=
"28"
> </th>
029.
<th> </th>
030.
<th height=
"28"
> </th>
031.
<th height=
"28"
> </th>
032.
</tr>
033.
<tr>
034.
<th height=
"28"
colspan=
"3"
> รายงานการสั่งซื้อสินค้าประจำเดือน</th>
035.
<th height=
"28"
> </th>
036.
<th height=
"28"
> </th>
037.
<th> </th>
038.
<th height=
"28"
> </th>
039.
<th height=
"28"
> </th>
040.
</tr>
041.
<tr>
042.
<th height=
"28"
colspan=
"2"
> วันที่/
Date
: <?php
echo
$date
; ?></th>
043.
<th height=
"28"
colspan=
"2"
>เวลา/Time : <?php
echo
$time
; ?> </th>
044.
<th height=
"28"
> </th>
045.
<th> </th>
046.
<th height=
"28"
> </th>
047.
<th height=
"28"
> </th>
048.
</tr>
049.
<tr>
050.
<th width=
"50"
height=
"27"
align=
"center"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
>รหัสสินค้า</th>
051.
<th width=
"100"
align=
"center"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
>ราคาสินค้า</th>
052.
<th width=
"100"
align=
"left"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
>โปรโมชั่น</th>
053.
<th width=
"80"
align=
"left "
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
>จำนวน</th>
054.
<th width=
"100"
align=
"left"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
>ราคารวม</th>
055.
<th width=
"80"
align=
"left"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
>ชื่อลูกค้า</th>
056.
<th width=
"80"
align=
"center"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
>วันที่</th>
057.
<th width=
"100"
align=
"center"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
>พนักงาน</th>
058.
</tr>
059.
</thead>
060.
<?php
061.
$i
=1;
062.
$sql
=
"SELECT * FROM total WHERE 1 "
;
063.
$result
=
$mysqli
->query(
$sql
);
064.
if
(
$result
&&
$result
->num_rows>0){
065.
066.
while
(
$row
=
$result
->fetch_assoc()){
067.
?>
068.
<tr>
069.
<td width=
"50"
align=
"center"
><?php
echo
$row
[
"tcode"
];?> </td>
070.
<td width=
"100"
align=
"center"
><?php
echo
number_format(
$row
[
"tprice"
], 2);?> </td>
071.
<td width=
"100"
align=
"left"
><?php
echo
number_format(
$row
[
"tpro"
]);?> </td>
072.
<td width=
"80"
align=
"left "
><?php
echo
number_format(
$row
[
"tunit"
], 2);?> </td>
073.
<td width=
"100"
align=
"left"
><?php
echo
number_format(
$row
[
"tqty"
]);?> </td>
074.
<td width=
"80"
align=
"left"
><?php
echo
number_format(
$row
[
"tname"
], 2);?></td>
075.
<td width=
"80"
align=
"center"
><?php
echo
number_format(
$row
[
"tdate"
], 2);?> </td>
076.
<td width=
"100"
align=
"center"
><?php
echo
number_format(
$row
[
"tsave"
], 2);?> </td>
077.
</tr>
078.
<?php
079.
$tprice
+=
$row
[
"tprice"
];
080.
$tunit
+=
$row
[
"tunit"
];
081.
$tqty
+=
$row
[
"tqty"
];
082.
}
083.
084.
?>
085.
086.
<tr>
087.
<td height=
"5"
colspan=
"8"
align=
"left"
> </td>
088.
</tr>
089.
<tr
class
=
".north_top"
>
090.
<td align=
"center"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
>รวม </td>
091.
<td align=
"center"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
><?php
echo
number_format(
$tprice
, 2);?> </td>
092.
<td align=
"left"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
> <?php
echo
number_format(
$tunit
, 2);?> </td>
093.
<td align=
"left"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
> </td>
094.
<td align=
"left"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
> <?php
echo
number_format(
$tqty
, 2);?> </td>
095.
<td align=
"left"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
> </td>
096.
<td align=
"center"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
> </td>
097.
<td align=
"center"
style=
"border-top:2px solid #000;border-bottom:2px solid #000;"
> </td>
098.
</tr>
099.
<?php
$i
++; } ?>
100.
</table>