Exemple #1
0
 /**
  * 
  * @param string $message
  * @param string $heading
  * @param int $status
  */
 function showError($message = NULL, $heading = NULL, $status = 404)
 {
     // set http status
     http_response_code($status);
     // set view data
     $data = array('message' => $message ? $message : 'The page that you requested not found.', 'heading' => $heading ? $heading : 'Page Not Found');
     // clear before
     @ob_clean();
     // load core classes if has not loaded before
     Loader::core('Config');
     Loader::core('View');
     Loader::core('Layout');
     // render template
     Layout::change('layout/vErrorLayout');
     Layout::view('error/vError', $data);
     // exit script
     exit;
 }
Exemple #2
0
 /**
  * 
  * @return void
  */
 public function index()
 {
     $data = array();
     $type = Config::get('searchType', 'search');
     if ($type) {
         $data['makes'] = $this->mHome->getMakes($type);
     } else {
         $data['carMakes'] = $this->mHome->getMakes('car');
         $data['boatMakes'] = $this->mHome->getMakes('boat');
         $data['motoMakes'] = $this->mHome->getMakes('moto');
         $data['atvMakes'] = $this->mHome->getMakes('atv');
         $data['rvMakes'] = $this->mHome->getMakes('rv');
         $data['trailerMakes'] = $this->mHome->getMakes('trailer');
     }
     $data['latestTags'] = $this->mHome->getTags('latest');
     $data['randomTags'] = $this->mHome->getTags('random');
     Layout::view('vHome', $data);
 }
Exemple #3
0
 /**
  * 
  * @return void
  */
 public function contact()
 {
     $this->loadModel('content');
     Loader::library('Form');
     $data = array();
     if (Input::post()) {
         Form::rule('name', 'trim|required|alpha|maxLength:100');
         Form::rule('email', 'trim|required|validEmail|maxLength:100');
         Form::rule('message', 'trim|required|maxLength:5000');
         Form::rule('captcha', 'trim|required|numeric|verifyCaptcha');
         if (Form::run() === TRUE) {
             $sendData = array('name' => Input::post('name'), 'email' => Input::post('email'), 'message' => Input::post('message'));
             $data = $this->mContent->sendMessage($sendData);
         } else {
             $data = array('success' => FALSE, 'result' => Form::errors());
         }
     }
     $data['sidebarLayout'] = View::render('content/vSidebar', array('page' => 'contact'), TRUE);
     Layout::title('Contact');
     Layout::desc('Contact us.');
     Layout::view('content/vContact', $data);
 }
Exemple #4
0
 /**
  * 
  * @param string $tag Default is NULL
  * @param int $page Default is NULL
  * @return void
  */
 public function index($tag = NULL, $page = NULL)
 {
     $getData = array('query' => $tag ? $tag : Input::get('query'), 'type' => Input::get('type'), 'country' => Input::get('country'), 'make' => Input::get('make'), 'model' => Input::get('model'), 'year_min' => Input::get('year_min'), 'year_max' => Input::get('year_max'), 'price_min' => Input::get('price_min'), 'price_max' => Input::get('price_max'), 'currency' => Input::get('currency'), 'condition' => Input::get('condition'), 'color' => Input::get('color'), 'mileage_min' => Input::get('mileage_min'), 'mileage_max' => Input::get('mileage_max'), 'vehicle' => Input::get('vehicle'), 'vin' => Input::get('vin'), 'state' => Input::get('state'), 'city' => Input::get('city'), 'location' => Input::get('location'), 'order' => Input::get('order'), 'page' => $page ? $page : Input::get('page'));
     $getData = $this->mSearch->fixDashes($getData);
     $getData = $this->mSearch->fixLower($getData);
     $data = $this->mSearch->apiResults($getData);
     $data['params'] = $getData;
     $data['yearMin'] = $getData['year_min'] ? $getData['year_min'] : 1980;
     $data['yearMax'] = $getData['year_max'] ? $getData['year_max'] : (int) date('Y');
     $data['priceMin'] = $getData['price_min'] ? $getData['price_min'] : 0;
     $data['priceMax'] = $getData['price_max'] ? $getData['price_max'] : 50000;
     $data['mileageMin'] = $getData['mileage_min'] ? $getData['mileage_min'] : 0;
     $data['mileageMax'] = $getData['mileage_max'] ? $getData['mileage_max'] : 200000;
     $this->mSearch->saveTags($getData['query'], $data['total']);
     $data['latestTags'] = $this->mSearch->getTags('latest');
     $data['randomTags'] = $this->mSearch->getTags('random');
     if ($tag !== NULL) {
         Pagination::setQueryString(FALSE);
         Pagination::setURL(tagLink($getData['query']));
         $seoData = $this->mSearch->setSeo('tags', $getData, $data['total']);
         Layout::title(getSeo($seoData, 'tagsTitle'));
         Layout::desc(getSeo($seoData, 'tagsDesc'));
         Layout::heading(getSeo($seoData, 'tagsHeading'));
     } else {
         Pagination::setQueryString(TRUE);
         Pagination::setURL(searchLink($getData, FALSE));
         $seoData = $this->mSearch->setSeo('search', $getData, $data['total']);
         Layout::title(getSeo($seoData, 'searchTitle'));
         Layout::desc(getSeo($seoData, 'searchDesc'));
         Layout::heading(getSeo($seoData, 'searchHeading'));
     }
     Pagination::setTotal($data['total'], Config::get('searchResultsLimit', 'limit'), Config::get('searchPaginaLimit', 'limit'));
     Pagination::setCurrent($getData['page']);
     Pagination::setNumLinks(3);
     Pagination::run();
     $data['pagination'] = Pagination::getPagina();
     Layout::view('vSearch', $data);
 }