  <?php require_once('../Connections/BE2.php'); ?>

<?php
include "../config.data.php";
 
 
$currentPage = "showdecode.html";//$_SERVER["PHP_SELF"];  
  
$decode = "-1";
if (isset( $_GET['decode']  )) {
 $decode =  $_GET['decode']  ;
}
 
mysql_select_db($database_BE2, $BE2);
//$query_Rt2 = sprintf("SELECT a.*,d.mem_name FROM order_datam as a,member as b,product_data as c,member as d WHERE a.dcode=b.dcode AND b.mem_auto=c.mem_auto AND a.duser=d.mem_auto AND c.company_num='%s' %s ORDER BY a.dcode DESC",$_SESSION['login_memid'],$sqltext); ;//,$colname_Rt2

$query_Rt2 = sprintf("SELECT a.did,a.coid,a.duser,a.ddate,a.dcode,c.*,b.p_num,b.p_title,b.p_new,b.company_num,b.meta_img,b.p_tag FROM order_datam as a,order_datas as c,product_data as b WHERE a.dcode=c.dcode AND c.mem_auto=b.mem_auto AND a.dcode='%s' ",$decode);  //,$colname_Rt2
$Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error());
$row_Rt2 = mysql_fetch_assoc($Rt2);
$totalRows_Rt2 = mysql_num_rows($Rt2);
 
// echo $query_Rt2;
 
?> 
					    
 <div class="main "> 
  <div class="row">
				<div class="col-lg-12">
					<h3 class="page-header"><i class="fa fa-indent"></i>訂購清單</h3>
					<ol class="breadcrumb">
						<li><i class="fa fa-home"></i><a href="index.html">首頁</a></li>
						<li><i class="fa fa-list-alt"></i><a href="#">訂單管理</a></li>
						<li><i class="fa fa-indent"></i>訂購清單</li>				
					</ol>
				</div>
			</div>
 
 <div class="row">
 <div class="col-lg-12">				    
 
 <div class="table-responsive">
 
</div>
<div style="overflow:scroll;">
<table class="table table-bordered table-striped table-condensed table-hover" style="min-width:1000px;">
	<thead>
		<tr>
			<th width="76">訂單日期</th>
			<th width="76">訂單編號</th>
			<th width="95">商品編號</th>
			<th width="65">商品說明</th>
			<th width="65">商品圖檔</th>
			<th width="65">商品售價</th>
			<th width="38" nowrap="nowrap">購買數量</th>
			<th width="76" nowrap="nowrap">購買金額</th>
			</tr>
	</thead>
	<tbody>
    <?php 
 	do { 
	   $imagepath = "/admin/upload_image/".$row_Rt2['meta_img'];
   	    if($row_Rt2['p_new']==1){
			  $imagepath = "/admin/upload2_image/".sprintf("%07d",$row_Rt2['company_num']).'/'.$row_Rt2['meta_img'].'.'.$row_Rt2['p_tag'];  
		}
	  ?>
  <tr>
    <td><?= $row_Rt2['ddate'];?></td>
    <td><?= $row_Rt2['dcode'];?></td>
    <td><?= $row_Rt2['p_num'] ;?></td>
    <td><?= substr($row_Rt2['p_title'],0,30) ;?></td>
    <td><img class="d-inline-block g-width-60 mr-4" src="<?= $imagepath;?>" alt="<?= $row_Rt2['p_title'];?>" width="80px"></td>
    <td><?= $row_Rt2['p_money'];?></td>
    <td><?= $row_Rt2['p_count'];?></td>
    <td><?= $row_Rt2['p_money']*$row_Rt2['p_count'];?>
      <? /*
      <a href="VVVmysale_edit-<?= $row_Rt2['did'];?>.html" target="_self">出貨編輯</a>
      | <a href="#" target="_self">刪除</a> 
       */ ?></td>
    <? //config ?>
    </tr>

    <?php } while ($row_Rt2 = mysql_fetch_assoc($Rt2)); ?>
   <tr>
     <td colspan="8"> <ul class="pagination">        
 
     <input type="button" onclick="history.back()" value="回到上一頁"></input>
    </tr>
	 
    <tbody>
</table>
</div>

 </div>
 
   </div> 
		</div>
 
     
<?php
 
mysql_free_result($Rt2);
  
?>        
        
 