|
|
|
รบกวนพี่ๆหน่อยค่า จะออกรายงานแล้วข้อมูลมันไม่ยอมโชว์ให้อ่ะค่า |
|
|
|
|
|
|
|
Code (PHP)
<?php
session_start();
include_once "../../config.php";
include_once "../../script/function.php";
import_request_variables("pG","p_");
$myClass = new MyClass();
$total = 0;
$sql = "Select * From tb_orderlist ol left join tb_vender vd on ol.order_vd = vd.vd_id Order By order_sn";
$rec = $myClass->selQuery($sql);
if($rec != null){
?>
<!DOCTYPE html PUBLIC :-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<titel> ใบสั่งซื้อสินค้าเข้าร้าน</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css" media="print">
.linkx{
color:#FFFFFF;
}
</style>
<style type="text/css" media"screen">
.linkx{
color:#000;
text-decoration: none;
}
.linkx:hover{
font-weight: bold;
</style>
</head>
<body>
<div id="content" style="width: 95%; min-height: 1024px; background-color:#FFFFFF align ="left">
<div style="color: #9D0000;font-size:1.5em;font-weight: bold;" align="right"><?=$CONFIG["shop"]?></div>
<div align="right"><?=$CONFIG["shopAddr"]?></div>
<br>
<div class="titleText">รหัสใบสั่งซื้อ</div><div style="height:25px;line-hieght: 25px;" align="left"><?=$rec[0]['order_sn']?></div><div class="clear"></div>
<div class="titleText">ชื่อบริษัทจำหน่าย</div><div style="hight:25px;line-hight: 25px;" algn="left"><?=$rec[0]['vd_name']?></div><div class="clear"></div>
<div class="titleText">วันที่สั่งซื้อเข้าร้าน</div><div style="hieght:25px;line-hight: 25px;" align="left"><?=$rec[0]['order_date']?></div><div class="clear"></div>
<div align="left"><br/><br>
<table border="1" bordercolor="#626262" cellpadding="3" cellspaving="0" widht="98%">
<tr algn="center" valign="middle" height="25">
<td width="7%"><strong>รหัสสินค้า</strong></td>
<td width="13%"><strong>ชื่อสินค้า</strong></td>
<td width="40%"><strong>หมวดหมู่</strong></td>
<td><strong>ชื่อยี่ห้อ</strong></td>
<td><strong>จำนวน</strong></td>
<td><strong>ราคา</strong></td>
<td><strong>รวมราคา</strong></td>
</tr>
<?php
$sqlit ="Select ol.order_sn , ol.order_date, ol.order_vd , vd.vd_name , vd.vd_tel , ol.order_price From tb_orderlist ol, tb_itemorderlist iol ,tb_vender vd where ol.order_sn =iol.order_sn
and ol.order_vd = vd.vd_id
and ol.order_sn = '".$p_txtOR."'";
/*$sqlit="Select * From tb_product pd, tb_category cate, tb_itemorderlist iodl where iodl.prod_id = pd.prod_id and pd.cate_id = cate_id = cate_id and iodl.order_sn='".$rec[0]['order_sn']."'";*/
$row = $myClass->selQuery($sqlit);
$num=sizeof($rsit);
if($row!=null){
$count = 1;
$sumPrice = 0;
$total_price = 0;
foreach($row as $key){
$total_price=$key['prod_price']*$key['list_qty'];
$sum_price+= $total_price;
echo '<tr valign="middle" height="20">
<td>'.$key['prod_id'].'</td>
<td> '.$key['prod_title'].'</td>
<td align="center"'.$key['cate_name'].'</td>
<td align="center"'.$key['prod_brand'].'</td>
<td align="center">'.$key['list_qty'].'</td>
<td align="right">฿'.number_format($key['prod_cost']).' </td>
<td align="right">฿'.number_format($total_price).' </td>
<tr>';
$count +=1;
}
}
?>
</table>
<div align="center"><a href="javascript: window.print();" class="linkx">[ พิมพ์ ]</a> <a href="javascript: window.close();" class="linkx">[ ปิด ]</a></div>
</div>
</body
></html>
<?php
}
?>
อันนี้โค๊ดตามรูปค่ะ แต่ดุงข้อมูลแล้วมันไม่ยอมโขว์ค่ะ
Tag : PHP
|
|
|
|
|
|
Date :
2012-03-31 11:27:12 |
By :
hikarujun |
View :
901 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
echo $sqlit;
เอา Query ที่ได้ไปทดสอบบน phpMyAdmin ดูครับ
|
|
|
|
|
Date :
2012-03-31 19:08:29 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|