Пример #1
0
 public function deleteAction($id = false)
 {
     $this->permission('delete');
     if (!$id) {
         return Brightery::error404();
     }
     $model = new \modules\sliders\models\Slides();
     $model->slide_id = $id;
     if ($model->delete()) {
         Uri_helper::redirect("management/sliders");
     }
 }
Пример #2
0
 public function indexAction()
 {
     $this->language->load('home');
     //      --------start sliders---------
     $this->language->load('sliders');
     $slides = new \modules\sliders\models\Slides();
     $slides->_select = 'slide_id, title, caption, url, image';
     $slides->where('slider_id', '1');
     //      -----------end sliders--------------
     //      ----------start news home-----------
     $this->Language->load('blog_posts');
     $posts = new \modules\blog\models\Blog_posts();
     $posts->_select = 'blog_post_id,title,image,short_content,seo,created';
     $posts->_limit = 4;
     //        $posts->_orderby = 4;
     $post = $posts->get();
     //      ----------end news home------------
     //      -------start testonmials home------
     $this->Language->load('testimonials');
     $testimonials = new \modules\testimonials\models\Testimonials();
     $testimonials->_select = 'testimonial_id,client_name,client_position,message,image';
     $testimonial = $testimonials->get();
     //      --------end testonmials home-------
     //      ----------start clients home-----------
     $this->Language->load('clients');
     $clients = new \modules\clients\models\Clients();
     $clients->_select = 'client_id, name, image';
     $client = $clients->get();
     //      ----------end clients home------------
     $this->Language->load('portfolio_categories');
     $portfolio_categories = new \modules\portfolio\models\Portfolio_categories();
     $portfolio_categories->_select = 'portfolio_category_id, title';
     $portfolio_categories = $portfolio_categories->get();
     $recent_portfolio = $this->Database->query("SELECT portfolio.*" . "FROM `portfolio` " . "ORDER BY portfolio.portfolio_id DESC LIMIT 4")->result();
     $recent_portfolio_ = $this->Database->query("SELECT portfolio.*" . "FROM `portfolio` " . "ORDER BY portfolio.portfolio_id ASC LIMIT 4")->result();
     return $this->render('home', ['slides' => $slides->get(), 'post' => $post, 'testimonial' => $testimonial, 'client' => $client, 'recent_portfolio' => $recent_portfolio, 'recent_portfolio_' => $recent_portfolio_, 'portfolio_category' => $portfolio_categories]);
 }