Esempio n. 1
0
 function cookie_check($cookie = null)
 {
     $cartDB = new CartDBAccess();
     $user = null;
     $cookie = $this->get_cookie();
     $user = $cartDB->User_read($cookie['password1'], $cookie['mailaddress1']);
     #if(!$user) {return Mypage_login(); }
     return $user;
 }
Esempio n. 2
0
 function change_tag($str = null, $commission = null, $personaldata)
 {
     $cartDB = new CartDBAccess();
     $pref = $GLOBALS['_pref'][$_POST['pref']];
     $order_number = time();
     $GLOBALS['order_number'] = $order_number;
     $GLOBALS['order_time'] = date('Y年m月d日 H時i分');
     $cart = $cartDB->Cart_calculation($commission, $personaldata);
     if (!$cart['postage']) {
         $cart['postage'] = 0;
     }
     $total = $cart['total'];
     $charge = $cart['charge_total'];
     $consumption_tax = $cart['consumption_tax'];
     for ($i = 0; $i < 4; $i++) {
         if ($commission[$i]['name']) {
             $comm .= $commission[$i]['name'] . ' ' . $commission[$i]['post_form'] . "\n";
         }
     }
     if ($_POST) {
         $str = preg_replace("/<#Payment#>/sm", $cart['payment_name'], $str);
         $str = preg_replace("/<#Commission#>/sm", $comm, $str);
         $str = preg_replace("/<#Comment#>/sm", $_POST['comment'], $str);
         $str = preg_replace("/<#OrderTime#>/sm", $GLOBALS['order_time'], $str);
         $str = preg_replace("/<#OrderNumber#>/sm", $order_number, $str);
         $str = preg_replace("/<#Postage#>/sm", $cart['postage'], $str);
         $str = preg_replace("/<#Charge#>/sm", $charge, $str);
         $str = preg_replace("/<#ConsumptionTax#>/sm", $consumption_tax, $str);
         $str = preg_replace("/<#TotalAll#>/sm", $total, $str);
         $str = preg_replace("/<#CustomerName#>/sm", $_POST['name'], $str);
         $str = preg_replace("/<#CustomerKana#>/sm", $_POST['kana'], $str);
         $str = preg_replace("/<#CustomerEmail#>/sm", $_POST['mailaddress1'], $str);
         $str = preg_replace("/<#CustomerZip#>/sm", $_POST['zip'], $str);
         $str = preg_replace("/<#CustomerAddress#>/sm", $pref . $_POST['address'], $str);
         $str = preg_replace("/<#CustomerTel#>/sm", $_POST['tel'], $str);
         $str = preg_replace("/<#CustomerFax#>/sm", $_POST['fax'], $str);
     }
     if (empty($_POST['name2'])) {
         $str = preg_replace("/<#DeliveryName#>/sm", $_POST['name'], $str);
         $str = preg_replace("/<#DeliveryZip#>/sm", $_POST['zip'], $str);
         $str = preg_replace("/<#DeliveryAddress#>/sm", $pref . $_POST['address'], $str);
         $str = preg_replace("/<#DeliveryTel#>/sm", $_POST['tel'], $str);
     } else {
         $pref2 = $GLOBALS['_pref'][$_POST['pref2']];
         $str = preg_replace("/<#DeliveryName#>/sm", $_POST['name2'], $str);
         $str = preg_replace("/<#DeliveryZip#>/sm", $_POST['zip2'], $str);
         $str = preg_replace("/<#DeliveryAddress#>/sm", $pref2 . $_POST['address2'], $str);
         $str = preg_replace("/<#DeliveryTel#>/sm", $_POST['tel2'], $str);
     }
     return $str;
 }
Esempio n. 3
0
 function step8()
 {
     $cartDB = new CartDBAccess();
     $cartmail = new CartMailAccess();
     $_POST['name'] = $_POST['customer_name'];
     $commission = $GLOBALS['fileread']->DBcommission_read();
     //Session check
     $session = $GLOBALS['session']->sission_cart();
     if (empty($session)) {
         return $this->step2();
     }
     if (empty($_POST['mailaddress1'])) {
         return $this->step3('post_error');
     }
     //User check
     if ($_POST['mode'] == 'send_user') {
         $_POST['name2'] = null;
     }
     if (empty($_POST)) {
         return $this->step2();
     }
     $cartmail->Send_mail('Customer', $commission, $session);
     $cartmail->Send_mail('Shop', $commission, $session);
     $cartDB->Order_insert($commission, $session);
     $order_number = $GLOBALS['order_number'];
     $order_list = $cartDB->Order_read($order_number);
     $print = $GLOBALS['fileread']->DBcart_read('', $_POST['payment']);
     $GLOBALS['fileread']->DBstock_update($session);
     $print['set04'] = preg_replace("/<#OrderNumber#>/sm", $order_number, $print['set04']);
     $print['set04'] = preg_replace("/<#TotalAll#>/sm", $order_list['total'], $print['set04']);
     $print['set04'] = preg_replace("/<#CustomerName#>/sm", $order_list['name'], $print['set04']);
     $print['set04'] = preg_replace("/<#CustomerTel#>/sm", $order_list['tel'], $print['set04']);
     $print['set04'] = preg_replace("/<#CustomerEmail#>/sm", $order_list['email'], $print['set04']);
     $GLOBALS['session']->sission_delete();
     $message = $print['set04'];
     require dirname(__FILE__) . '/' . $GLOBALS['cart_theme_type'] . '/cart-step8.php';
     $cartDB->Order_check();
 }