Ejemplo n.º 1
0
 /**
  * @return  TCVM_User_Interface
  */
 public static function Factory()
 {
     if (!self::$_instance) {
         self::$_instance = new TCVM_User_Imple();
     }
     return self::$_instance;
 }
Ejemplo n.º 2
0
 public function orderAction()
 {
     $order = TCVM_Order_Factory::Factory();
     $user = TCVM_User_Factory::Factory();
     $loginUser = $user->getLoginedUser();
     $orders = $order->getsUserOrder($loginUser['id']);
     $this->assign("orders", $orders);
 }
Ejemplo n.º 3
0
 private function _assignGlobalVal()
 {
     $userMod = TCVM_User_Factory::Factory();
     $isLogin = $userMod->isLogined();
     if ($isLogin) {
         $loginUser = $userMod->getLoginedUser();
         $this->assign("loginUser", $loginUser);
     }
     Zend_Registry::set("IS_LOGIN", $isLogin);
     $this->assign("isLogin", $isLogin);
 }
Ejemplo n.º 4
0
 public function executeAction()
 {
     //hack check
     $user = TCVM_User_Factory::Factory()->getLoginedUser();
     if ($user["email"] != "*****@*****.**") {
         echo "Sorry, TCVM is in the testing phase. you can't do payment right now.";
         die;
     }
     $orderId = $this->_getParam("order_id");
     $order = TCVM_Order_Factory::Factory()->getOrder($orderId);
     if ($order["cart_info"][TCVM_Cart_Imple::STEP_PAYINFO]["paymethod"] == TCVM_Payment_Imple::PAYMENT_ELECTRONIC_TRANSFER) {
         $this->redirect("electronic-finish");
     } else {
         $this->_pay->payOrder($orderId);
     }
 }
Ejemplo n.º 5
0
 private function _myReTokenCourse($id)
 {
     //customer don't wanna this
     return false;
     $user = TCVM_User_Factory::Factory()->getLoginedUser();
     if (!$user) {
         throw new Exception("sorry, you are not login");
     }
     $sql = "SELECT `order`.id\n\t\t\t\t\tFROM  `order` \n\t\t\t\t\tLEFT JOIN order_product ON `order`.id = order_product.order_id\n\t\t\t\t\tWHERE `order`.user_id = " . WeFlex_Db::QuoteInto("?", $user["id"]) . "\n\t\t\t\t\tAND order_product.product_id = " . WeFlex_Db::QuoteInto("?", $id) . " AND `order`.status = " . TCVM_Order_Imple::STATUS_SUCCESS;
     $rtn = WeFlex_Db::Query($sql);
     if (!empty($rtn)) {
         return true;
     } else {
         return false;
     }
 }
Ejemplo n.º 6
0
 public function init()
 {
     $this->_user = TCVM_User_Factory::Factory();
 }
Ejemplo n.º 7
0
 private function _gets($conditions, $order = null, $pageNo = null, $pageSize = null)
 {
     $rtn = array();
     $product = TCVM_Product_Factory::Factory();
     $user = TCVM_User_Factory::Factory();
     $orderDatas = $this->_orderModel->getAllByConditions($conditions, $order, $pageNo, $pageSize);
     foreach ($orderDatas as $orderData) {
         $orderProductDatas = $this->_orderProductModel->getAllByConditions(array("order_id" => $orderData['id']));
         $orderInfo = $orderData;
         $orderInfo["cart_info"] = unserialize($orderInfo["cart_info"]);
         $orderInfo['products'] = array();
         $userInfo = $user->getUserById($orderInfo["user_id"]);
         $orderInfo["email"] = $userInfo["email"];
         foreach ($orderProductDatas as $orderProductData) {
             $productEntity = $product->getById($orderProductData['product_id']);
             $orderProductInfo = array();
             $orderProductInfo["id"] = $orderProductData['product_id'];
             $orderProductInfo["name"] = $productEntity['name'];
             $orderProductInfo["price"] = $orderProductData['price'];
             $orderInfo['products'][] = new TCVM_Order_Entity_OrderProduct($orderProductInfo);
         }
         $rtn[] = new TCVM_Order_Entity_Order($orderInfo);
     }
     return $rtn;
 }