예제 #1
0
 /**
  * @param	int		$page
  * @param	int		$pageCnt
  * @param	string	$orderBy[optional] = null
  * @param	bool	$asc[optional] = null
  * @param	string	$condition[optional] = null
  * @return	array | false
  */
 function GetSubAdminsList($page, $pageCnt, $orderBy = null, $asc = null, $condition = null)
 {
     if ($this->_connector->Execute($this->_commandCreator->GetSubAdminsList($page, $pageCnt, $orderBy, $asc, $condition))) {
         $subAdmins = array();
         while (($row = $this->_connector->GetNextRecord()) != false) {
             $subAdmins[$row->id_admin] = array($row->login, $row->description);
         }
         return $subAdmins;
     }
     return false;
 }
예제 #2
0
 function SessionRead($hash)
 {
     $data = false;
     $time = time() - 7200;
     if (!$this->_dbConnection->Execute($this->_commandCreator->SessionRead($hash, $time))) {
         return $data;
     }
     if ($this->_dbConnection->ResultCount() > 0) {
         $row = $this->_dbConnection->GetNextRecord();
         if ($row) {
             $data = $row->sess_data;
             // $data = base64_decode($row->sess_data);
         }
     } else {
         if (!$this->_dbConnection->Execute($this->_commandCreator->SessionInsertNew($hash))) {
             return false;
         }
     }
     return $data;
 }
예제 #3
0
 /**
  * @param Folder $folder
  * @return bool
  */
 function CreateFolder(&$folder)
 {
     if (!$this->_dbConnection->Execute($this->_commandCreator->SelectForCreateFolder($folder))) {
         return false;
     } else {
         $row = $this->_dbConnection->GetNextRecord();
         $folder->FolderOrder = $row && isset($row->norder) ? (int) ($row->norder + 1) : 0;
     }
     if (!$this->_dbConnection->Execute($this->_commandCreator->CreateFolder($folder))) {
         return false;
     }
     $folder->IdDb = $this->_dbConnection->GetLastInsertId();
     if (!$this->_dbConnection->Execute($this->_commandCreator->CreateFolderTree($folder))) {
         return false;
     }
     if (!$this->_dbConnection->Execute($this->_commandCreator->SelectForCreateFolderTree($folder))) {
         return false;
     } else {
         $result = array();
         while ($row = $this->_dbConnection->GetNextRecord()) {
             $IdParent = $row && isset($row->id_parent) ? (int) $row->id_parent : -1;
             $Level = $row && isset($row->folder_level) ? (int) ($row->folder_level + 1) : 0;
             $result[] = array($IdParent, $Level);
         }
         if ($result) {
             foreach ($result as $folderData) {
                 if (!is_array($folderData)) {
                     continue;
                 }
                 $folder->IdParent = $folderData[0];
                 $folder->Level = $folderData[1];
                 if (!$this->_dbConnection->Execute($this->_commandCreator->CreateSelectFolderTree($folder))) {
                     return false;
                 }
             }
         }
     }
     return true;
 }