public function order()
 {
     if (Auth::guest()) {
         return Redirect::to('/koszyk')->with('message', 'Zaloguj się aby złożyć zamówienie.');
     }
     if (Cart::count() > 0) {
         $orderId = ORDER::makeOrder();
         return Redirect::to('/konto/zamowienie/' . $orderId)->with('message', 'Zamówienie zostało złożone.');
     } else {
         return Redirect::to('/koszyk');
     }
 }
Esempio n. 2
0
 public function actionIndex()
 {
     if (isset($_GET['id'])) {
         $request = Yii::$app->request;
         $id = $request->get('id');
         $Order = new Order();
         $order = ORDER::find()->where(['order_id' => $id])->one();
         $Orderlist = new OrderList();
         $product = $Orderlist->getAllProductsFromCard($id);
         return $this->render('index', ['order' => $order, 'product' => $product]);
     }
 }
Esempio n. 3
0
<?php
    if(session_id() == '') { //For versions of PHP < 5.4.0
        session_start();
    }

    //For versions of PHP >= 5.4.0
    /*if (session_status() == PHP_SESSION_NONE) {
    	session_start();
    }*/
    require_once('../../../_config/config.php');
    //require_once('../../../_controller/isset_controller.php');
    require_once('../../../_classes/order_class.php');
    require_once('../../../_classes/localisation_class.php');

    $classOrder = new ORDER;
    $classLocalisation = new LOCALISATION;

    $order_id = mysql_real_escape_string($_REQUEST['id']);

    $viewOrdersByIdCall = $classOrder->viewOrdersById($order_id);
    $rowOrder = mysql_fetch_array($viewOrdersByIdCall);

    $getVoucherByOrderIdCall = $classOrder->getVoucherByOrderId($order_id);
    $rowVoucherDet = mysql_fetch_array($getVoucherByOrderIdCall);

    $dateTime = new DateTime("now", new DateTimeZone('Asia/Colombo'));
    $submitted_date = $dateTime->format("Y-m-d H:i:s");

    $currentDate = date("F j, Y, g:i a");