查看文件: body_mysale5.php
大小: 7.38 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php include "../config.data.php"; $sqltext=''; /* if (isset($_POST['s1'])){ if($_POST['s1']<>''){ $sqltext=sprintf(" AND order_check = '%s' ",$_POST['s1']); } if($_POST['s2']<>''){ $sqltext.=sprintf(" AND mem_name = '%s' ",$_POST['s2']); } if($_POST['s3']<>''){ $sqltext.=sprintf(" AND order_num = '%s' ",$_POST['s3']); } } */ $currentPage = "mysale5.html";//$_SERVER["PHP_SELF"]; $maxRows_Rt2 = 20; $pageNum_Rt2 = 0; if (isset($_GET['pageNum_Rt2'])) { $pageNum_Rt2 = $_GET['pageNum_Rt2']; } $startRow_Rt2 = $pageNum_Rt2 * $maxRows_Rt2; $colname_Rt2 = "-1"; if (isset( $_SESSION['login_memid'] )) { $colname_Rt2 = $_SESSION['login_memid'] ; } $colname_Rt2=-1; mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT a.* FROM order_datam as a,order_datas as b,product_data as c WHERE a.dcode=b.dcode AND b.mem_auto=c.mem_auto AND c.company_num='%s' %s ORDER BY a.dcode DESC",$_SESSION['login_memid'],$sqltext); ;//,$colname_Rt2 //$query_Rt2 = sprintf("SELECT * FROM product_order_data WHERE company_num='%s' %s ORDER BY mem_auto DESC",$_SESSION['login_memid'],$sqltext);//,$colname_Rt2 $query_limit_Rt2 = sprintf("%s LIMIT %d, %d", $query_Rt2, $startRow_Rt2, $maxRows_Rt2); $Rt2 = mysql_query($query_limit_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); if (isset($_GET['totalRows_Rt2'])) { $totalRows_Rt2 = $_GET['totalRows_Rt2']; } else { $all_Rt2 = mysql_query($query_Rt2); $totalRows_Rt2 = mysql_num_rows($all_Rt2); } $totalPages_Rt2 = ceil($totalRows_Rt2/$maxRows_Rt2)-1; $queryString_Rt2 = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Rt2") == false && // stristr($param, "act") == false && stristr($param, "totalRows_Rt2") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Rt2 = "&" . htmlentities(implode("&", $newParams)); } } $queryString_Rt2 = sprintf("&totalRows_Rt2=%d%s", $totalRows_Rt2, $queryString_Rt2); ?> <div class="main "> <div class="row"> <div class="col-lg-12"> <a style="cursor: pointer" ><b><font color="blue">產品資訊</font></b></a></p> <a href="#" class="btn btn-3d btn-blue btn-md">新增產品資訊</a> <a href="#" class="btn btn-3d btn-red btn-md" target="_blank">商品日、月報表</a> <? // echo $query_Rt21 ; ?> <div class="table-responsive"> <form action="mysale.html" method="POST" name="form2"> <table class="table table-bordered table-hover"> <tbody> <tr> <td>訂單狀態 <select class="form-control select" name="s1" id="s1"> <option value="">請選擇</option> <? for($i=0;$i<count($select_s1_ar);$i++){ ?> <option value="<?=$select_s1_ar[$i]?>"><?=$select_s1_ar[$i]?></option> <? }?> </select> </td> <td>訂購人姓名<input name="s2" type="text" id="s2" class="form-control"></td> <td>訂單編號<input name="s3" type="text" id="s3" class="form-control"></td> <td><br><input type="submit" name="Submit" value="搜尋" class="btn btn-3d btn-black btn-md"></td> </tr> </tbody> </table> </form> </div> <table class="table table-bordered table-striped table-condensed table-hover" style="min-width:1500px;"> <thead> <tr> <th width="76" nowrap="nowrap">訂單日期</th> <th width="76" nowrap="nowrap">廠商名稱.統編</th> <th width="12" nowrap="nowrap">訂單編號</th> <th width="12" nowrap="nowrap">會員編號</th> <th width="36" nowrap="nowrap">會員姓名</th> <th width="37" nowrap="nowrap">商品名稱</th> <th width="75" nowrap="nowrap">商品貨號</th> <th width="75" nowrap="nowrap">數量</th> <th width="36" nowrap="nowrap">單價</th> <th width="37" nowrap="nowrap">小計</th> <th width="75" nowrap="nowrap">運費</th> <th width="75" nowrap="nowrap">訂單總金額</th> <th width="27" nowrap="nowrap">收貨地址</th> <th width="28" nowrap="nowrap">付款日期</th> <th width="57" nowrap="nowrap">付款方式</th> <th width="57" nowrap="nowrap">金額</th> <th width="57" nowrap="nowrap">使用天空幣</th> <th width="57" nowrap="nowrap">付款總金額</th> <th width="57" nowrap="nowrap">出貨日期</th> <th width="38" nowrap="nowrap">物流查尋</th> <th width="76" nowrap="nowrap">2%回饋金</th> <th width="76" nowrap="nowrap">3%抽成獎金</th> <th width="38" nowrap="nowrap">2.8%金流</th> <th width="76" nowrap="nowrap">推薦物流公司</th> <th width="76" nowrap="nowrap">電子發票</th> <th width="76" nowrap="nowrap">出貨日期</th> <th width="177">管理</th> </tr> </thead> <tbody> <?php if($totalRows_Rt2>0){ do { ?> <tr> <td><?= $row_Rt2['ddate'];?></td> <td> </td> <td><?= $row_Rt2['dcode'];?></td> <td> </td> <td><?= $row_Rt2['duser'] ;?></td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td><?= $row_Rt2['dexpess'];?></td> <td><?= $row_Rt2['dmoney'];?></td> <td> </td> <td> </td> <td><?= $pay_ar[$row_Rt2['dpay']];?></td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td><?= $row_Rt2['dall'] ;?></td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td><a href="#" target="_self">訂單明細</a> <a href="#" target="_self">編輯訂</a> <a href="#" target="_self">刪除</a> </td> </tr> <?php } while ($row_Rt2 = mysql_fetch_assoc($Rt2)); } ?> <tbody> </table> </div> <ul class="pagination"> <? if( $totalPages_Rt2 >1){ //分頁程式 if($totalPages_Rt2<5){ $start=0; $end=$totalPages_Rt2; }else{ $start=$pageNum_Rt2-5; $end=$pageNum_Rt2+5; if ($start<0){ $start=0; $end=10; } else { $end=$start+10 ;} if ($end>$totalPages_Rt2){ $start = $end-$totalPages_Rt2-5; $end=$totalPages_Rt2; } if ($end-$start>10){ $start = $end-10; } } ?> <?php if ($pageNum_Rt2 > 0) { // Show if not first page ?> <li><a href="<?php printf("%s?pageNum_Rt2=%d%s", $currentPage, max(0, $pageNum_Rt2 - 1), $queryString_Rt2); ?>">上一頁</a></li><?php } // Show if not first page ?> <? for($i=$start;$i<=$end;$i++){ if($i==$pageNum_Rt2){ echo '<li class="active"><a href="#">'.($i+1).'</a></li>';} else {?> <li><a href="<?php printf("%s?pageNum_Rt2=%d%s", $currentPage, min($totalPages_Rt2, $i), $queryString_Rt2); ?>"><? echo $i+1 ;?></a></li> <? } } ?> <?php if ($pageNum_Rt2 < $totalPages_Rt2) { // Show if not last page ?> <li><a href="<?php printf("%s?pageNum_Rt2=%d%s", $currentPage, min($totalPages_Rt2, $pageNum_Rt2 + 1), $queryString_Rt2); ?>">下一頁</a></li> <?php } } ?> </ul> </div> </div> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表