Ejemplo n.º 1
0
}
if (isset($_POST['getGoodsInf'])) {
    $query = pdoQuery('g_inf_tbl', array('inf'), array('id' => $_POST['g_id']), ' limit 1');
    $row = $query->fetch();
    echo $row['inf'];
    exit;
}
if (isset($_POST['addToCart'])) {
    if (isset($_SESSION['customerId'])) {
        //            mylog(('insert'));
        $cartId = pdoInsert('cart_tbl', array('c_id' => $_SESSION['customerId'], 'g_id' => $_POST['g_id'], 'd_id' => $_POST['d_id'], 'number' => $_POST['number']), 'update');
        $value = array();
        foreach ($_SESSION['buyNow']['partsList'] as $k => $v) {
            $value[] = array('cart_id' => $cartId, 'part_id' => $k, 'part_number' => $v);
        }
        pdoBatchInsert('part_cart_tbl', $value);
        if (isset($_SESSION['tempCart'])) {
        }
        if (!isset($_SESSION['customerLogin'])) {
            pdoInsert('custom_login_tbl', array('id' => $_SESSION['customerId']), ' ignore');
            $_SESSION['customerLogin'] = true;
        }
    } else {
        $_SESSION['tempCart'][] = array('g_id' => $_POST['g_id'], 'd_id' => $_POST['d_id'], 'number' => $_POST['number']);
    }
}
if (isset($_POST['adFilter'])) {
    $adQuery = pdoQuery('(select * from user_ad_filt_view order by sale asc) p', null, array('mc_id' => $_POST['mc_id']), ' group by g_id limit 10');
    $inf = array();
    foreach ($adQuery as $row) {
        $inf[] = $row;
Ejemplo n.º 2
0
                         $readyInsert[$prow['part_d_id']]['number'] += $row['number'];
                         $readyInsert[$prow['part_d_id']]['total'] = $readyInsert[$prow['part_d_id']]['number'] * $prow['part_sale'];
                     }
                     $total_fee += $prow['part_sale'] * $prow['part_number'];
                 }
             }
             if (0 == $readyInsert[$row['d_id']]['number']) {
                 unset($readyInsert[$row['d_id']]);
             }
         }
         if ($readyInsert == null) {
             header('location:index.php');
             exit;
         }
         pdoInsert('order_tbl', array('id' => $orderId, 'c_id' => $_SESSION['customerId'], 'a_id' => $_GET['addrId'], 'total_fee' => $total_fee, 'customer_remark' => $_SESSION['customer_remark']));
         pdoBatchInsert('order_detail_tbl', $readyInsert);
         if ('buy_now' == $to) {
             unset($_SESSION['buyNow']);
         } else {
             pdoDelete('cart_tbl', array('c_id' => $_SESSION['customerId']));
         }
         $orderStu = 0;
         include 'view/order_inf.html.php';
     } else {
         header('location:controller.php?editAddress=1&from=' . $to);
     }
     exit;
 }
 if (isset($_GET['pay_order'])) {
     $orderId = $_GET['order_id'];
     $orderStu = $_GET['order_stu'];