public function u10000Action() { $this->action = $this->getRequest()->getActionName(); if ($this->action == "u15000") { $price = 15000; } else { if ($this->action == "u20000") { $price = 20000; } else { if ($this->action == "u25000") { $price = 25000; } else { $price = 10000; } } } $res_array = common_util::categorize_info($this->vindb, $price); for ($i = 0; $i < count($res_array); $i++) { $res_array[$i]["logo_url"] = split(",", $res_array[$i]["CarImageUrl"]); $res_array[$i]["SalePrice"] = number_format($res_array[$i]["SalePrice"]); $res_array[$i]["Mileage"] = number_format($res_array[$i]["Mileage"]); } $this->view->res_obj = json_encode($res_array); $this->view->inventory_obj = json_encode($res_array); $this->view->inventory_info = $res_array; }
public static function vindb_connect() { if (self::$_vindb == null) { $vin_config = new Zend_Config_Ini(dirname(__FILE__) . "/../config.ini", "vin-db"); $vin_params = array('host' => $vin_config->vin_params->host, 'username' => $vin_config->vin_params->username, 'password' => $vin_config->vin_params->password, 'dbname' => $vin_config->vin_params->dbname, 'charset' => 'utf8', 'profiler' => true); self::$_vindb = Zend_Db::factory($vin_config->adapter, $vin_params); Zend_Db_Table_Abstract::setDefaultAdapter(self::$_vindb); } return self::$_vindb; }
public function preDispatch() { $this->config = new Zend_Config_Ini(dirname(__FILE__) . "/../config.ini", "default"); $this->vindb = common_util::vindb_connect(); //$this->action = $this->getRequest()->getActionName(); $this->config_info = new Zend_Config_Ini(dirname(__FILE__) . "/../config.ini", "information"); $header = array(); $header["title"] = $this->config_info->page_tile; $header["phone"] = $this->config_info->page_phone; $header["address"] = $this->config_info->page_address; $header["weekdays"] = $this->config_info->weekdays; $header["saturday"] = $this->config_info->saturday; $header["sunday"] = $this->config_info->sunday; $this->view->header_info = $header; }
public function preDispatch() { $this->config = new Zend_Config_Ini(dirname(__FILE__) . "/../config.ini", "information"); $header = array(); $header["title"] = $this->config->page_tile; $header["phone"] = $this->config->page_phone; $header["address"] = $this->config->page_address; $header["weekdays"] = $this->config->weekdays; $header["saturday"] = $this->config->saturday; $header["sunday"] = $this->config->sunday; $this->vindb = common_util::vindb_connect(); $deatail_id = ""; //$slider_array = common_util::load_slider_info($this->vindb, $deatail_id); $this->view->header_info = $header; //$this->view->slider_info = json_encode($slider_array); }
<?php require_once dirname(__FILE__) . '/prepare.php'; $status = 1; $db = common_util::db_connect(); $requests = $_POST; $contact_id = common_util::select_max_id($db); common_util::insert_contact_us($db, $requests, $contact_id, $type = 3); $val = array("status" => $status); $json = common_util::create_json($val); header('Content-type: text/javascript; charset=utf-8'); echo $json;
public function applyAction() { //var_dump($_SERVER['REQUEST_URI']); common_util::force_https(); }
<?php error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 0); date_default_timezone_set('America/New_York'); $app_path = "../app/"; set_include_path('.' . PATH_SEPARATOR . $app_path . 'libs/ZendFramework-1.11.2/library/' . PATH_SEPARATOR . get_include_path()); require_once 'Zend/Loader.php'; require_once 'Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->setFallbackAutoloader(true); $config = new Zend_Config_Ini($app_path . "config.ini", "path"); require_once $config->smarty . 'Smarty.class.php'; require_once $config->views . 'Zend_View_Smarty.class.php'; require_once $config->common . "common_util.php"; Zend_Session::setOptions(); Zend_Session::start(); $device_type = common_util::check_device(); $config_route = new Zend_Config_Ini($app_path . "config.ini", "routing"); $router = new Zend_Controller_Router_Rewrite(); $router->addConfig($config_route, 'routes'); $frontController = Zend_Controller_Front::getInstance(); $frontController->throwExceptions(true); $frontController->setControllerDirectory($app_path . '/controllers'); $frontController->setParam('useDefaultControllerAlways', true); $frontController->setRouter($router); $view = new Zend_View_Smarty($config->views . 'templates', array('compile_dir' => $config->views . 'templates_c', 'config_dir' => $config->views . 'configs', 'cache_dir' => $config->views . 'cache')); $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer'); $viewRenderer->setView($view)->setViewBasePathSpec($view->getEngine()->template_dir)->setViewScriptPathSpec(':controller/' . $device_type . '_' . ':action.:suffix')->setViewScriptPathNoControllerSpec($device_type . '_' . ':action.:suffix')->setViewSuffix('html'); $frontController->dispatch();