public function __construct() { parent::__construct('users', 'user_id'); $this->sid = null; $this->uid = null; $this->onlineMap = null; }
public function delete($pk) { $pk = (int) $pk; $where = "aid = ?"; $this->db->delete('poll_vote', $where, array($pk)); return parent::delete($pk); }
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); }
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; }
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; }
public function System() { parent::__construct(); $this->table = 'settings_system'; }
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; }
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'); }
public function __construct() { parent::__construct(); $this->table = 'clients'; }
public function Users() { parent::__construct(); }
public function __construct() { $this->table = TB_PREFIX . 'collect'; parent::__construct(); }
public function __construct() { $this->table = TB_PREFIX . 'study'; parent::__construct(); }
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; }
function __construct() { parent::__construct('regions', 'regions_id'); }
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; }
function __construct() { $this->table = TB_PREFIX . 'role'; parent::__construct(); }
public function __construct() { parent::__construct(); $this->table = 'invoices'; }
function __construct() { parent::__construct('options', 'option_name'); }
function __construct($table) { $this->table = TB_PREFIX . $table; parent::__construct(); }
public function __construct() { $this->table = TB_PREFIX . 'discuss'; parent::__construct(); }
function __construct() { $this->table = TB_PREFIX . "search"; parent::__construct(); }
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); }
public function __construct() { parent::__construct('mailinglists', 'listid'); }
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; }
/** * Close connection * * @param NULL * @return NULL */ private function Close() { self::$conn = NULL; }
public function Company() { parent::__construct(); $this->table = 'companies'; }