public function __construct($table,$cols) { $this->objSQL = new ClsAuieoSQL(); parent::__construct($cols); $objSession=ClsNaanalSession::getInstance(); $this->_siteID=$objSession->getPanelData("client_id"); $this->table=$table; }
public static function setInstance(&$instance) { self::$objNaanalSession = $instance; }
/** * returns current database ID * @return int */ public static function getCurrentDatabaseID() { $objNaanalSession = ClsNaanalSession::getInstance(); return $objNaanalSession->isPanelDataSet("dynamicdatabase") ? $objNaanalSession->getPanelData("dynamicdatabase") : 0; }
public function byAll($sortBy, $sortDirection) { $from=false; $this->buildFilter($this->objSQL); $this->objSQL->addOrderBy($sortBy,$sortDirection=="ASC"?true:false); ClsNaanalSession::getInstance()->setPanelData("search_sql", $this->objSQL->render()); $arrPager=ClsNaanalRequest::getInstance()->getPager(); $this->objSQL->setLimit($arrPager["start"],$arrPager["items_per_page"]); $sql=$this->objSQL->render(); $count_sql=$this->objSQL->render(true); $arr=$this->_db->getAllAssoc($count_sql); $totalRecords=$arr[0]["count"]; $rs=$this->_db->getAllAssoc($sql); foreach ($rs as $rowNumber => $row) { $this->setValue($row["companyID"],$rowNumber,0); $this->setValue($row["name"],$rowNumber,1); $this->setValue($row["phone1"],$rowNumber,2); $this->setValue($row["keyTechnologies"],$rowNumber,3); $this->setValue($row["dateCreated"],$rowNumber,4); $this->setValue($row["ownerFirstName"]." ".$row["ownerLastName"],$rowNumber,5); } $this->render(); }