public function getAdd()
 {
     $result['title'] = 'Shop';
     $result['action'] = '/promotion/add';
     $result['submit'] = 'add';
     $categories = $this->category->getCategories();
     $result['categories'][] = array('text' => 'No category', 'options' => array('value' => 0));
     foreach ($categories as $c) {
         $currentCategory = array();
         $currentCategory['text'] = $c['name'];
         $currentCategory['options'] = array('value' => $c['id']);
         $result['categories'][] = $currentCategory;
     }
     $products = $this->product->getProducts();
     $result['products'][] = array('text' => 'No product', 'options' => array('value' => 0));
     foreach ($products as $c) {
         $currentProduct = array();
         $currentProduct['text'] = $c['name'];
         $currentProduct['options'] = array('value' => $c['id']);
         $result['products'][] = $currentProduct;
     }
     View::make('promotion.add', $result);
     if (Auth::isAuth()) {
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
 public function EditUser3()
 {
     $r = new Index();
     $ra = new uuu();
     $r->aeee = 'stani e';
     View\View::useType(array('Controllers\\Admin\\Index'))->make('test', array('model' => $r))->render();
     //View::useType(array('Controllers\Admin\Index'))->make('test', array('model'=>$r,'wrong' => $ra))->render();
 }
 public function getUsers()
 {
     $result['users'] = $this->user->getUsersWithRoles();
     $result['title'] = 'Users';
     View::make('admin.roles', $result);
     View::appendTemplateToLayout('topBar', 'top_bar/user');
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
 public function getUsers()
 {
     $result['users'] = $this->user->getUsersWithRoles();
     $result['title'] = 'Shop';
     $result['isEditor'] = Auth::isUserInRole(array('editor', 'admin'));
     $result['isAdmin'] = Auth::isUserInRole(array('admin'));
     View::make('admin.roles', $result);
     View::appendTemplateToLayout('topBar', 'top_bar/user');
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
 public function getEdit($id)
 {
     $result = array('city' => $this->city->getCity($id));
     $result['title'] = 'Edit city';
     $result['action'] = '/admin/city/' . $result['city']->id . '/edit';
     $result['submit'] = 'Edit';
     View::make('city.add', $result);
     if (Auth::isAuth()) {
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
 public function getAdd($id)
 {
     $result['title'] = 'Send Messages';
     /* @var $estate \Models\ViewModels\EstateViewModel */
     $estate = $this->estate->getEstate($id);
     $result['estateInfo'] = 'ID: ' . $estate->id . '; Category: ' . $estate->category . '; Type: ' . ($estate->ad_type == 1 ? 'For Sale' : 'For Rent') . '; City: ' . $estate->city . '; Location: ' . $estate->location . '; Price: ' . $estate->price . ' EUR';
     View::make('message.add', $result);
     if (Auth::isAuth()) {
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
 public function getAll()
 {
     $cart = array();
     if (Session::containKey('cart')) {
         $cart = Session::get('cart');
     }
     $result['title'] = 'Shop';
     $result['products'] = $this->getProductsFromCart($cart);
     $result['isEditor'] = Auth::isUserInRole(array('editor', 'admin'));
     $result['isAdmin'] = Auth::isUserInRole(array('admin'));
     $result['user_cash'] = $this->user->getUserMoney(Auth::getUserId());
     View::make('cart', $result);
     if (Auth::isAuth()) {
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->appendTemplateToLayout('catMenu', 'side_bar/category_menu')->render();
 }
Esempio n. 8
0
            </div>

        </div>

    </div>
    <!-- /.container -->

    <div class="container">

        <hr>

        <!-- Footer -->
        <footer>
            <div class="row">
                <div class="col-lg-12">
                    <p>Copyright &copy; Your Website 2015</p>
                </div>
            </div>
        </footer>

    </div>
    <!-- /.container -->

    <!-- jQuery -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>
<?php 
echo View::getLayoutData('footer');
 public function getEdit($id)
 {
     $result['isEditor'] = Auth::isUserInRole(array('editor', 'admin'));
     $result['isAdmin'] = Auth::isUserInRole(array('admin'));
     if ($result['isEditor']) {
         $result = array('product' => $this->product->getProductWitnUnavailable($id));
     } else {
         $result = array('product' => $this->product->getProduct($id));
     }
     $result['title'] = 'Shop';
     $result['action'] = '/product/edit/' . $result['product']['id'];
     $result['submit'] = 'edit';
     $categories = $this->category->getCategories();
     foreach ($categories as $c) {
         $currentCategory = array();
         $currentCategory['text'] = $c['name'];
         $currentCategory['options'] = array('value' => $c['id']);
         if ($id == $c['id']) {
             $currentCategory['options']['selected'] = 'true';
         }
         $result['categories'][] = $currentCategory;
     }
     View::make('product.add', $result);
     if (Auth::isAuth()) {
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
Esempio n. 10
0
echo Form::script('https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js');
?>
    <?php 
echo Form::script('https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js');
?>
    <![endif]-->
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="<?php 
echo Common::getBaseURL();
?>
">Shop</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <?php 
echo View::getLayoutData('topBar');
?>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>
 public function getItem($index)
 {
     $help = new HelpPage(Route::getRouters());
     $helpData = $help->getByIndex($index);
     View::make('Help/itemPage', array('title' => $helpData['url'], 'data' => $helpData))->render();
 }
 public function getEdit($id)
 {
     $result = array('category' => $this->category->getCategory($id));
     $result['title'] = 'Shop';
     $result['action'] = '/category/edit/' . $result['category']['id'];
     $result['submit'] = 'edit';
     View::make('category.add', $result);
     if (Auth::isAuth()) {
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
Esempio n. 13
0
 public function index2()
 {
     View\View::make('test')->with('username', 'aaaaaaaazzzzzzzz')->with('data', array('c' => array(1, 2, 3, 4, 8)))->render();
 }
 public function getFavourites()
 {
     $result['title'] = 'User Favorites';
     $userFavourite = array();
     if (Auth::isAuth()) {
         $favorites = $this->user->getFavourites(Auth::getUserId());
         foreach ($favorites as $f) {
             $userFavourite[] = $f['estate_id'];
         }
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         $userFavourite = Session::get('favourites');
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     /* @var $estates \Models\ViewModels\EstateBasicViewModel[] */
     if (!empty($userFavourite)) {
         $estates = $this->estate->getFavoritesEstates($userFavourite);
         foreach ($estates as $estate) {
             $estate->image = EstateController::setEstateMainImage($estate);
             $estate->thumbnailName = EstateController::setImageThumb($estate->image);
         }
         $result['estates'] = $estates;
     } else {
         $result['estates'] = array();
     }
     View::make('user.favorites', $result);
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
Esempio n. 15
0
 public function displayError($error)
 {
     try {
         View::make('errors.' . $error)->render();
     } catch (\Exception $exc) {
         Common::headerStatus($error);
         echo '<h1>' . $error . '</h1>';
         exit;
     }
 }
 public function getProducts($id)
 {
     if (!(Auth::isUserInRole(array('admin')) || $id == Auth::getUserId())) {
         Redirect::back();
     }
     $result['products'] = $this->user->getProducts($id);
     $result['isEditor'] = Auth::isUserInRole(array('editor', 'admin'));
     $result['isAdmin'] = Auth::isUserInRole(array('admin'));
     View::make('user.products', $result);
     View::appendTemplateToLayout('topBar', 'top_bar/user');
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
 public function getEdit($id)
 {
     $result['title'] = 'Edit';
     /* @var $estate \Models\ViewModels\EstateViewModel */
     $estate = $this->estate->getEstate($id);
     if ($estate == null) {
         Session::setError('The estate id is incorrect');
         Redirect::to('');
     }
     $estate->images = $this->image->getImagesByEstate($id);
     foreach ($estate->images as $i) {
         $i->thumbnailName = $this->setImageThumb($i->name);
     }
     $result['estate'] = $estate;
     $result['action'] = '/admin/estate/' . $estate->id . '/edit';
     $result['submit'] = 'Edit';
     $result['categories'] = $this->setCategoryFormOptions($this->category->getCategories(), $estate);
     $result['cities'] = $this->setCityFormOptions($this->city->getCities(), $estate);
     View::make('estate.add', $result);
     if (Auth::isAuth()) {
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }