Ejemplo n.º 1
0
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new baseModel();
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     // Needs to be here
     $this->load->database();
     date_default_timezone_set('UTC');
 }
Ejemplo n.º 3
0
 public function queryString($key)
 {
     /*         * * get the route from the url ** */
     $requestPath = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI'];
     if (substr($requestPath, strlen($requestPath) - 1, strlen($requestPath) - 1) == "/") {
         $requestPath = substr($requestPath, 0, strlen($requestPath) - 1);
     }
     $this->model = baseModel::getInstance();
     $rewriteModel = $this->model->get('rewrite');
     $rewriteInfo = $rewriteModel->getRewriteInfo($requestPath);
     if (count($rewriteInfo) > 0) {
         $route = $rewriteInfo['target_path'];
     } else {
         $route = $requestPath;
     }
     if (empty($route)) {
         return null;
     } else {
         /*             * * get the parts of the route ** */
         $parts = explode('/', $route);
         array_shift($parts);
         if (isset($parts[3])) {
             $count_args = count($parts);
             for ($i = 3; $i < $count_args; $i++) {
                 if ($parts[$i] == $key) {
                     if (isset($parts[$i + 1])) {
                         return $parts[$i + 1];
                     }
                 }
             }
         }
     }
     return null;
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     $this->pid = 0;
     $this->uid = 0;
     $this->uptime = time();
 }
Ejemplo n.º 5
0
 function __construct($registry)
 {
     $this->registry = $registry;
     $this->model = baseModel::getInstance();
     $this->view = baseView::getInstance();
     $this->request = request::getInstance();
     $this->init();
 }
Ejemplo n.º 6
0
 function __construct($projectid = null)
 {
     parent::__construct();
     $projectid = $projectid ? $projectid : JRequest::getInt('p');
     if ($projectid) {
         $this->setProjectId($projectid);
     }
 }
Ejemplo n.º 7
0
 public static function lastEntry($user_id)
 {
     parent::dbCOnnect();
     $query = "SELECT * FROM ad_list WHERE user_id = {$user_id} ORDER BY id DESC LIMIT 1;";
     $results = parent::$dbc->query($query)->fetch(PDO::FETCH_ASSOC);
     $ad_id = (int) $results['id'];
     return $ad_id;
 }
Ejemplo n.º 8
0
 function __construct($projectid = null)
 {
     parent::__construct();
     $projectid = $projectid ? $projectid : JFactory::getApplication()->input->getInt('p', 0);
     if ($projectid) {
         $this->setProjectId($projectid);
     }
 }
Ejemplo n.º 9
0
 public function __construct()
 {
     parent::__construct();
     $this->pid = 0;
     $this->uid = 0;
     $this->addtime = time();
     $this->received = false;
     $this->status = 0;
 }
Ejemplo n.º 10
0
 function __construct($blockName)
 {
     parent::__construct();
     $this->model = baseModel::getInstance();
     $this->name = $blockName;
     $this->request = request::getInstance();
     $this->init();
     $this->renderHtml();
 }
Ejemplo n.º 11
0
 /**
  * 
  * @global array $config
  * @return object database instance
  */
 public static function dbInstance()
 {
     global $config;
     //var_dump($config);
     if (self::$instance === NULL) {
         self::$instance = new PDO("mysql:host={$config['db']['host']};dbname={$config['db']['dbname']}", "{$config['db']['username']}", "{$config['db']['password']}");
         self::$instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     }
     //$this->conn = self::$instance;
     return self::$instance;
 }
Ejemplo n.º 12
0
 function __construct()
 {
     /*         * * get the route from the url ** */
     $requestPath = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI'];
     if (substr($requestPath, strlen($requestPath) - 1, strlen($requestPath) - 1) == "/") {
         $requestPath = substr($requestPath, 0, strlen($requestPath) - 1);
     }
     $this->model = baseModel::getInstance();
     $rewriteModel = $this->model->get('rewrite');
     $rewriteInfo = $rewriteModel->getRewriteInfo($requestPath);
     if (count($rewriteInfo) > 0) {
         $route = $rewriteInfo['target_path'];
     } else {
         $route = $requestPath;
     }
     $parts = explode('/', $route);
     array_shift($parts);
     if (empty($route)) {
         $route = 'default/index';
     } else {
         /* get the parts of the route */
         if (isset($parts[0])) {
             $this->module = $parts[0];
         }
         if (isset($parts[1])) {
             $this->controller = $parts[1];
         }
         if (isset($parts[2])) {
             $this->action = $parts[2];
         }
         if (isset($parts[3])) {
             $count_args = count($parts);
             $k = 1;
             $args = array();
             for ($i = 3; $i < $count_args; $i++) {
                 $args[$k++] = $parts[$i];
             }
             $this->args = $args;
         }
     }
     if (empty($this->module)) {
         $this->module = 'default';
     }
     if (empty($this->controller)) {
         $this->controller = 'index';
     }
     /* Get action */
     if (empty($this->action)) {
         $this->action = 'index';
     }
     $file = APP_PATH . '/modules/' . $this->module . '/controllers/' . $this->controller . 'Controller.php';
 }
Ejemplo n.º 13
0
 public function __construct()
 {
     parent::__construct(get_class());
     // Needs to be here
     $this->load->database();
 }
Ejemplo n.º 14
0
 function __construct()
 {
     parent::__construct();
     $this->_id = JRequest::getInt('i');
 }
Ejemplo n.º 15
0
 public function __construct()
 {
     parent::__construct();
 }
Ejemplo n.º 16
0
 public function homeControl()
 {
     parent::__construct();
     $this->loadModel('home');
 }
Ejemplo n.º 17
0
 /**
  * Constructor
  *
  * @param   array  $config  An array of configuration options (name, state, dbo, table_path, ignore_request).
  */
 public function __construct($config = array())
 {
     parent::__construct();
     $this->setProjectId(JFactory::getApplication()->input->getInt('p', 0));
 }
Ejemplo n.º 18
0
 public function homeControl()
 {
     parent::__construct();
     $this->loadModel('champion');
     $this->tpl->assign('appName', 'championPage');
 }
Ejemplo n.º 19
0
 protected function majWithXmlDatas()
 {
     parent::majWithXmlDatas();
     $this->reqLimit = (int) $this->xml["reqLimit"];
     $this->currentPaginationNumber = 1;
     //$this->refreshNumElements();
 }
Ejemplo n.º 20
0
 public function __construct()
 {
     $this->db = baseModel::getInstance();
 }