source: branches/feature-module-update/html/mobile/mypage/order.php @ 15532

Revision 15532, 1.5 KB checked in by nanasess, 15 years ago (diff)

svn:mime-type 修正

  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/**
3 *
4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
5 *
6 * http://www.lockon.co.jp/
7 *
8 *
9 * 履歴から注文を取得・登録し、カートに遷移する。
10 */
11require_once("../require.php");
12
13$objCustomer = new SC_Customer();
14$objCartSess = new SC_CartSession();
15
16//受注詳細データの取得
17$arrDisp = lfGetOrderDetail($_POST['order_id']);
18
19//ログインしていない、またはDBに情報が無い場合
20if (!$objCustomer->isLoginSuccess() or count($arrDisp) == 0){
21    sfDispSiteError(CUSTOMER_ERROR, "", false, "", true);
22}
23
24for($num = 0; $num < count($arrDisp); $num++) {
25    $product_id = $arrDisp[$num]['product_id'];
26    $cate_id1 = $arrDisp[$num]['classcategory_id1'];
27    $cate_id2 = $arrDisp[$num]['classcategory_id2'];
28    $quantity = $arrDisp[$num]['quantity'];
29
30    $objCartSess->addProduct(array($product_id, $cate_id1, $cate_id2), $quantity);
31}
32
33header("Location: " . gfAddSessionId(MOBILE_URL_CART_TOP));
34
35
36//-----------------------------------------------------------------------------------------------------------------------------------
37// 受注詳細データの取得
38function lfGetOrderDetail($order_id) {
39    $objQuery = new SC_Query();
40    $col = "product_id, classcategory_id1, classcategory_id2, quantity";
41    $where = "order_id = ?";
42    $objQuery->setorder("classcategory_id1, classcategory_id2");
43    $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
44    return $arrRet;
45}
46
47?>
Note: See TracBrowser for help on using the repository browser.