Esempio n. 1
0
 public function __construct()
 {
     parent::__construct('users', 'user_id');
     $this->sid = null;
     $this->uid = null;
     $this->onlineMap = null;
 }
Esempio n. 2
0
 public function delete($pk)
 {
     $pk = (int) $pk;
     $where = "aid = ?";
     $this->db->delete('poll_vote', $where, array($pk));
     return parent::delete($pk);
 }
Esempio n. 3
0
 public function delete_gallery($id_gallery)
 {
     $id_gallery = (int) $id_gallery;
     // удаляем файлы
     foreach ($this->get_images($id_gallery) as $image) {
         $this->delete_image($id_gallery, $image['fid']);
     }
     // чистим базу
     $this->db->Delete('gallery_mediafile', "gallery_id=?", array($id_gallery));
     parent::delete($id_gallery);
 }
Esempio n. 4
0
 public function delete($block_id)
 {
     if ($block_id <= 0) {
         return false;
     }
     if ($this->db->beginTransaction('block')) {
         $where = "block_id = ?";
         $this->db->Delete('regions_blocks', $where, array($block_id));
         if (parent::delete($block_id) == 1 && $this->db->commit('block')) {
         }
         return true;
         $this->db->rollBack('block');
     }
     return false;
 }
Esempio n. 5
0
 public function delete($pk)
 {
     $query = "SELECT count(*) c FROM menu_link WHERE menu_id = {$pk}";
     $children = $this->db->Select($query);
     if ($children[0]['c'] > 0) {
         $this->errors['has_children'] = "В меню находится" . $children[0]['c'] . "элемента(ов) ";
         die($this->errors['has_children']);
     }
     $menu = $this->get($pk);
     if ($this->db->beginTransaction('menu')) {
         if (parent::delete($pk) == 1) {
             M_Blocks::Instance()->delete($menu['block_id']);
             if ($this->db->commit('menu')) {
                 return true;
             }
         }
         $this->db->rollBack('menu');
     }
     return false;
 }
Esempio n. 6
0
 public function System()
 {
     parent::__construct();
     $this->table = 'settings_system';
 }
Esempio n. 7
0
 public function editItemList($fields)
 {
     foreach ($fields as $key => $value) {
         list($field_name, $mlid) = explode('_', $key);
         $obj = array($field_name => (int) $value);
         parent::edit($mlid, $obj);
     }
     $this->listItems = array();
     $this->treeArray = array();
     return true;
 }
Esempio n. 8
0
 public function delete($role_id)
 {
     $role_id = (int) $role_id;
     $this->db->beginTransaction('role_delete');
     $this->db->Delete('privs_roles', 'role_id = ?', array($role_id));
     parent::delete($role_id);
     $this->db->commit('role_delete');
 }
Esempio n. 9
0
 public function __construct()
 {
     parent::__construct();
     $this->table = 'clients';
 }
Esempio n. 10
0
 public function Users()
 {
     parent::__construct();
 }
Esempio n. 11
0
 public function __construct()
 {
     $this->table = TB_PREFIX . 'collect';
     parent::__construct();
 }
Esempio n. 12
0
 public function __construct()
 {
     $this->table = TB_PREFIX . 'study';
     parent::__construct();
 }
Esempio n. 13
0
 public function delete_mail($listid, $mail_id)
 {
     $dir = SITE_ROOT . '/' . MAILING_DIR . (int) $listid . '/' . (int) $mail_id . '/';
     parent::delete($mail_id);
     if (file_exists($dir)) {
         M_Files::Instance()->remove_directory($dir);
     }
     return true;
 }
Esempio n. 14
0
 function __construct()
 {
     parent::__construct('regions', 'regions_id');
 }
Esempio n. 15
0
 public function delete($post_id)
 {
     if ($post_id <= 0) {
         return false;
     }
     $mComments = new M_Comments();
     $sql = "SELECT mlid FROM posts WHERE post_id =" . (int) $post_id;
     $result = $this->db->Select($sql);
     $mlid = isset($result[0]['mlid']) ? $result[0]['mlid'] : 0;
     if ($mComments->deleteEntriesSubject($post_id) !== false && parent::delete($post_id) > 0) {
         unset($mComments);
         if ($mlid > 0) {
             M_MenuLink::Instance()->delete($mlid);
         }
         $path = $this->ckupload_dir . 'post_' . $post_id;
         if (is_dir($path)) {
             $this->removeDirectory($path);
         }
         return true;
     }
     return false;
 }
Esempio n. 16
0
 function __construct()
 {
     $this->table = TB_PREFIX . 'role';
     parent::__construct();
 }
Esempio n. 17
0
 public function __construct()
 {
     parent::__construct();
     $this->table = 'invoices';
 }
Esempio n. 18
0
 function __construct()
 {
     parent::__construct('options', 'option_name');
 }
Esempio n. 19
0
 function __construct($table)
 {
     $this->table = TB_PREFIX . $table;
     parent::__construct();
 }
Esempio n. 20
0
 public function __construct()
 {
     $this->table = TB_PREFIX . 'discuss';
     parent::__construct();
 }
Esempio n. 21
0
 function __construct()
 {
     $this->table = TB_PREFIX . "search";
     parent::__construct();
 }
Esempio n. 22
0
 public function addFile($files, $type, $fields = array())
 {
     $path = "";
     switch ($type) {
         case 'audio':
             $path = $this->audioDir;
             break;
         case 'video':
             $path = $this->videoDir;
             break;
     }
     if (empty($path)) {
         return false;
     }
     $folder = SITE_ROOT . '/' . $path;
     $mFiles = M_Files::Instance()->set_type($type);
     $_file = $mFiles->upload_file($files, $folder);
     if (!$_file) {
         $this->errors['file_error'] = $mFiles->error();
         return false;
     }
     $file['name'] = $_file['name'];
     $file['type'] = $type;
     //$title = mb_substr($files['name'], 0, (int)mb_strrpos($files['name'], '.'));
     $title = M_Files::get_name_without_ext($files['name']);
     $file['title'] = isset($field['title']) ? $field['title'] : $title;
     return parent::add($file);
 }
Esempio n. 23
0
 public function __construct()
 {
     parent::__construct('mailinglists', 'listid');
 }
Esempio n. 24
0
 public function delete($pk)
 {
     $pk = (int) $pk;
     $mPollAnswers = M_PollAnswers::Instance();
     $query = "SELECT pa.aid\n\t\t\t\t\t\t\t\tFROM poll p\n\t\t\t\t\t\t\tLEFT JOIN poll_answers pa\n\t\t\t\t\t\t\t\tUSING(pid) \n\t\t\t\t\t\t\tWHERE p.pid = ?";
     $result = $this->db->Select($query, array($pk), PDO::FETCH_COLUMN);
     if ($this->db->beginTransaction('poll_del')) {
         foreach ($result as $aid) {
             $mPollAnswers->delete($aid);
         }
         if (parent::delete($pk) && $this->db->commit('poll_del')) {
             return true;
         }
         $this->db->rollBack('poll_edit');
     }
     return false;
 }
Esempio n. 25
0
 /**
  * Close connection
  *
  * @param NULL
  * @return NULL
  */
 private function Close()
 {
     self::$conn = NULL;
 }
Esempio n. 26
0
 public function Company()
 {
     parent::__construct();
     $this->table = 'companies';
 }