$statev = "已打印"; break; case 2: $statev = "TEL"; break; case 3: $statev = "成交"; break; case 4: $statev = "未成交"; break; case 5: $statev = "打印未成交"; break; } $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . $i, $row['orderid'])->setCellValue('B' . $i, $statev)->setCellValue('C' . $i, iconv('gb2312', 'utf-8', $row['address']))->setCellValue('D' . $i, "'" . $row['telphone'])->setCellValue('E' . $i, iconv('gb2312', 'utf-8', $row['sctime']))->setCellValue('F' . $i, iconv('gb2312', 'utf-8', $row['beizhu']))->setCellValue('G' . $i, $row['total_price'])->setCellValue('H' . $i, $row['orderdate'])->setCellValue('I' . $i, iconv('gb2312', 'utf-8', get_shopname($db, $row['shopid']))); } else { $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . $i, '')->setCellValue('B' . $i, '')->setCellValue('C' . $i, '')->setCellValue('D' . $i, '')->setCellValue('E' . $i, '')->setCellValue('F' . $i, '')->setCellValue('G' . $i, '')->setCellValue('H' . $i, '')->setCellValue('I' . $i, ''); } $objPHPExcel->setActiveSheetIndex(0)->setCellValue('J' . $i, iconv('gb2312', 'utf-8', $row['dinname']))->setCellValue('K' . $i, iconv('gb2312', 'utf-8', $row['dinnum']))->setCellValue('L' . $i, iconv('gb2312', 'utf-8', $row['dinprice'])); $mark = $row['orderid']; } // Rename sheet $objPHPExcel->getActiveSheet()->setTitle('Simple'); // Set active sheet index to the first sheet, so Excel opens this as the first sheet $objPHPExcel->setActiveSheetIndex(0); // Redirect output to a client’s web browser (Excel5) header('Content-Type: application/vnd.ms-excel'); header("Content-Disposition: attachment;filename=我饿啦外卖报表" . $shopname . ".xls"); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
//print_r($shops);exit; $tjms = get_tuijianms($db, $bulid); $rmms = get_remaimeishi($db, $bulid); foreach ($tjms as $tjrow) { $tjshopname[$tjrow['dinid']] = get_shopname($db, $tjrow['shopid']); } foreach ($rmms as $rmrow) { $rmshopname[$rmrow['dinid']] = get_shopname($db, $rmrow['shopid']); } $active = get_activeorder($db, $bulid); $acinfo = array(); foreach ($active as $i => $row) { $user = get_user($db, $row['user_id']); $acinfo[$i]['nickname'] = $user['nickname']; $acinfo[$i]['shopid'] = $row['shopid']; $acinfo[$i]['shopname'] = get_shopname($db, $row['shopid']); $acinfo[$i]['total_price'] = $row['total_price']; } //ÓÅ»ÝÐÅÏ¢¿ªÊ¼ $psql = "select `shopid`,`shopname`,`yhcontent`,`yhdate`,`linktime` from wm_shopinfo where `shopid` IN (SELECT `shopid` FROM `wm_shoplinkbul` {$where}) and shopid<>1 and yhcontent<>'' order by `linktime` desc limit 0,2"; $promotions = $db->query($psql)->fetchall(); $smarty->assign("shops", $shops); $smarty->assign("district", $area['d']); $smarty->assign("build", $area['b']); $smarty->assign('promotions', $promotions); //ÓÅ»ÝÐÅÏ¢½áÊø $smarty->assign("tjms", $tjms); $smarty->assign("rmms", $rmms); $smarty->assign("tjshopname", $tjshopname); $smarty->assign("rmshopname", $rmshopname); $smarty->assign("acinfo", $acinfo);
$tag[4] = "class='current'"; } elseif (strpos($_SERVER['REQUEST_URI'], 'graduate')) { $tag[6] = $tag[4] = $tag[3] = $tag[5] = $tag[1] = 0; $tag[2] = "class='current'"; } elseif (strpos($_SERVER['REQUEST_URI'], 'supermarket')) { $tag[6] = $tag[4] = $tag[2] = $tag[5] = $tag[1] = 0; $tag[3] = "class='current'"; } if (isset($_COOKIE['renrenid'])) { $_SESSION['email'] = $_COOKIE['renrenid']; $mark = 1; } else { $mark = 0; } if (isset($_GET['shopid'])) { $smarty->assign('shopname', get_shopname($db, $_GET['shopid'])); } if (isset($_SESSION['email']) && isset($_COOKIE['renrenid'])) { $user = get_user($db, $_SESSION['email']); $nc = "<img src='./images/ico_renren.gif' align='bottom'/><a href='http://www.renren.com' target='_blank'>" . $user['nickname'] . "</a> 积分:" . $user['jifen'] . " <a id='feed_link' href='javascript:void(0);'>告诉好友</a>"; } elseif (isset($_SESSION['email']) && !isset($_COOKIE['renrenid'])) { $user = get_user($db, $_SESSION['email']); $nc = $user['nickname'] . " 积分:" . $user['jifen']; } else { $nc = NULL; } $city = get_city($db, $bulid); $area = get_area($db, $bulid); $shopcount = getshopcounts($db, $bulid); $dinnercount = getdinnercounts($db, $bulid); $smarty->assign("city", $city);
?> </td> <td style="border-top:1px solid #666;line-height:30px"><?php $user = get_user($db, $row['user_id']); echo $user['nickname'] ? $user['nickname'] : "游客"; ?> </td> <td style="border-top:1px solid #666;line-height:30px"><?php echo substr($row['orderdate'], 5, 20); ?> </td> <?php if ($unex[0] == 0) { ?> <td style="border-top:1px solid #666;line-height:30px"><?php echo get_shopname($db, $row['shopid']); ?> </td> <?php } } else { if ($unex[0] == 0) { ?> <td colspan="4"></td> <?php } else { ?> <td colspan="3"></td> <?php } }
if ($cart->get_contents()) { $fee = $cart->get_shopfee(); $orderdate = date("Y-m-d H:i:s"); foreach ($cart->get_contents() as $item) { $total_price[$item['shop']] += $item['price'] * $item['qty']; $contents[$item['shop']][] = $item; } try { $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->beginTransaction(); foreach ($contents as $shopid => $content) { $tprice = $total_price[$shopid] + $fee[$shopid]; $orderid = "1" . $shopid . get_orders($db, $shopid) . rand(0, 9); $query = "insert into wm_orders set `orderid`='{$orderid}',`user_id`='{$email}',`shopid`='{$shopid}',`fee`='{$fee[$shopid]}',`address`='{$address}',`telphone`='{$telphone}',`otherphone`='{$otherphone}',`orderdate`='{$orderdate}',`sctime`='{$deliver_time}',`state`='0',`total_price`='{$tprice}',`beizhu`='{$bzxx}'"; $db->exec($query); $temp .= "<font size='3'><b>" . get_shopname($db, $shopid) . ":订单号为:{$orderid}" . "</b></font><br>"; /*if($shopid!=1){ $msg.=get_shopname($db,$shopid).":订单号为:$orderid"; }*/ $mark[] = $shopid; foreach ($content as $item) { $item_id = $item['id']; $detail = get_din_details($db, $item_id); $item_name = $item['name']; $item_price = $item['price']; $item_qty = $item['qty']; $shopid = $item['shop']; $type = get_dintypename($db, $shopid, $detail['dintype']); //$sqlquery = "insert into wm_order_items values('$orderid','$item_id','".$shopid."','".$item['name']."','".$type."',$item_qty ,'".$item_price*$item_qty ."','".$item_price."' , '".$orderdate."','','')"; $price = $item_price * $item_qty; $sqlquery = "insert into wm_order_items set `orderid`='{$orderid}',`dinid`='{$item_id}',`shopid`='{$shopid}',`dinname`='{$item['name']}',`dintype`='{$type}',`dinnum`='{$item_qty}',`dinprice`='{$price}',`unitprice`='{$item_price}',`orderdate`='{$orderdate}'";
<?php include_once './global.php'; include "./header.php"; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $orderid = $_POST['orderid']; if (is_numeric($orderid)) { $cksql = "SELECT `wm_orders`.*,`wm_order_items`.dinname,`wm_order_items`.dintype,`wm_order_items`.dinnum,`wm_order_items`.dinprice,`wm_order_items`.unitprice FROM `wm_orders` right join `wm_order_items` on `wm_orders`.`orderid` = `wm_order_items`.`orderid` where `wm_orders`.`orderid`='" . $orderid . "'"; $order = $db->query($cksql)->fetchall(); $shopname = get_shopname($db, $order[0]['shopid']); $smarty->assign('shopname', $shopname); if ($order) { $smarty->assign('order', $order); } else { echo "对不起,您输入的订单号不存在"; } } else { echo "对不起,您输入的不是有效订单号!"; } } $smarty->display("check_order.tpl"); include "./footer.php";
$unex = explode('|', $_SESSION['uname']); $sid = $unex[0]; $shopinfo = get_shop_details($db, $sid); $shoptype = $shopinfo['shoptype']; ?> <!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=gb2312" /> <title>无标题文档</title> <link rel="stylesheet" href="./css/main.css" type="text/css" /> </head> <body> <table cellpadding="10px"> <tr><td><font style="color:#FF6600; font-weight:bold";><?php echo get_shopname($db, $sid); ?> </font></td></tr> <tr><td>欢迎您,<?php echo $unex[1]; ?> <A href="loginout.php" target=_parent>退出</A></td></tr> <tr><td><font style="color:#FF6600; font-weight:bold";>订单管理</font></td></tr> <tr><td><a href="list.php" target=mainFrame>订单查询</a></td></tr> <?php if ($sid == 0) { ?> <tr><td><a href="member.php" target=mainFrame>会员管理</a></td></tr> <tr><td><a href="dinmanage.php" target=mainFrame>餐品管理</a></td></tr> <tr><td><a href="area.php" target=mainFrame>区域管理</a></td></tr> <tr><td><a href="shops.php" target=mainFrame>餐店管理</a></td></tr>
<?php include_once './global.php'; include "./header.php"; function get_items($db, $orderid) { $sql = "SELECT * FROM `wm_order_items` WHERE `orderid`='{$orderid}'"; return $db->query($sql)->fetchall(); } if (isset($_SESSION['email'])) { $smarty->assign("tag", 1); $orders = get_userhistroyorders($db, $_SESSION['email']); foreach ($orders as $row) { $shopnames[$row['orderid']] = get_shopname($db, $row['shopid']); $orderitems[$row['orderid']] = get_items($db, $row['orderid']); } $smarty->assign("orderitems", $orderitems); $smarty->assign("shopnames", $shopnames); $smarty->assign("orders", $orders); } $smarty->display("ordercenter.tpl"); include "./footer.php";