0
function view_amshops_order_details()
{
session_start();
if($_SESSION['UserId']<=0)
{
signin();
}
//here fetch your signup form for session//
$rs2=mysql_query("select *from user where u_id='$_SESSION[UserId]'");
$data2=mysql_fetch_assoc($rs2);
$smarty=new smarty();
$smarty->assign($data2);
global $View_Path;
$i=0;
$amshops=mysql_query("select * from payment_amshops join order_amshops on payment_om_id=om_id join delivery_address on om_dl_id=dl_id join payment_status on payment_status_id = status_id WHERE payment_om_id=om_id AND payment_u_id='$_SESSION[UserId]'");
$records=array();
$smarty->assign(array("act"=>"view_amshops_order_details"));
while($detail=mysql_fetch_assoc($amshops))
{
$order_number=$detail['om_order_number'];
$detail['size']=strlen($i);
array_push($records,$detail);
//$inner_records=array();
$inner_amshops=mysql_query("select * from addtocart_2 join category2 on cart_cg_id=cg_id where cart_cg_id=cg_id AND order_number='$order_number'");
while($inner_detail=mysql_fetch_assoc($inner_amshops))
{
if($inner_detail[cg_pic]!='')$file=$View_Path.$inner_detail[cg_pic];
if(!file_exists($Upload_Path.$inner_detail[cg_pic]))$file='';
array_push($records[$i],$inner_detail);
}
//$detail['size']=$i+1;
//array_push($records[0],$i);
$i++;
}
// echo "<pre>";
// print_r($records);
// exit;
$smarty->assign(array("records"=>$records, "file"=>$file));
$smarty->display("templates/view_amshops_order_details_2.tpl");
}
and my tpl file
{foreach $records as $detail}
<table class="table table-responsive" style="border:solid #BBBBBB 1px;">
<thead>
<tr bgcolor="#E8E8E8">
<td colspan="4" align="left" >
<a href="#" class="btn btn-primary">OrderID - {$detail.om_order_number}</a></td>
<td colspan="4" align="center">
<a href="#" class="btn btn-success"><b> Payment - {$detail.status_name} </b></a>
</td>
</tr>
</thead>
{for $i=0 to $detail['size']}
{if $detail[$i].order_number}
<tbody>
<tr >
<td><br />
<a href="index.php?act=bigview_men_cloth&cg_id={urlencode(base64_encode($detail[$i].cg_id))}">
<img src="admin_panel/images/category/{$detail[$i].cg_pic}" class="img-thumbnail" style="width:50px;; height:70px;"/>
</a>
</td>
<td align="left"><br />
{$detail[$i].cg_name} {$detail[$i].cg_type}<br />
{if $detail[$i].cart_size}Size: {$detail[$i].cart_size}{else}{/if}
<br />
Seller: {$detail[$i].cg_seller}
</td>
<td align="left"><br /> {$detail[$i].cart_size}</td>
<td align="left"><br />Rs. {$detail[$i].cart_total}</td>
<td align="left"><br /> {$detail[$i].cg_dldetail}</td>
<td align="left"><br /> </b><br /><br /><br /><br /></td>
</tr>
</tbody>
{/if}
{/for}
<thead>
<tr bgcolor="#F5F5F5">
<td colspan="4" align="left" >
</td>
<td colspan="4">
<a href="#" class="btn btn-danger"><b> Order Total : Rs. {$detail.om_price} </b></a>
</td>
</tr>
</thead>
</table>
{/foreach}
我要像我的網站上說filpcart訂單詳細信息頁面,但我有一些問題.....我有四個記錄到一個ORDER_NUMBER而且,當我觀看到所有記錄,然後只看到這兩個記錄order_number ...請幫助我...如何查看所有記錄到ORDER_NUMBER
**警告**:如果你剛剛學習PHP,請不要使用[ mysql_query'](http://php.net/manual/en/function.mysql-query.php)接口。這是非常可怕和危險的,它在PHP 7中被刪除了。[PDO的替代品並不難學](http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps -pdo-for-database-access /)以及[PHP The Right Way](http://www.phptherightway.com/)等指南介紹了最佳實踐。你的用戶數據是**不是** [正確轉義](http://bobby-tables.com/php.html),並有[SQL注入漏洞](http://bobby-tables.com/),並且可以被利用。 – tadman