public function Delete() { Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id); try { $this->db->delete("ge_ads", $this->input->getInt("id")); Messages::getInstance()->logSuccess('تبلیغ مورد نظر با موفقیت حذف شد'); } catch (Exception $ex) { Messages::getInstance()->logError('هیچ تبلیغی حذف شد'); } $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/admin/ads/show"); }
function saveSettings() { Factory::getUser()->authorise("setting", ResponseRegistery::getInstance()->site_id); $object = $this->input->get('POST'); $object['id'] = Session::getInstance()->weblog_id; $user->account_no = $object['account_no']; $user->cellphone = $object['cellphone']; $user->id = Factory::getUser()->id; unset($object['account_no']); unset($object['cellphone']); $this->db->StoreObject("wb_weblogs", $object); $this->db->StoreObject("ge_users", $user); $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . '/dashboard/blog/settings'); }
private function showLinks($linkType) { Factory::getUser()->authorise("link", ResponseRegistery::getInstance()->site_id); $weblog_id = Session::getInstance()->weblog_id; $dailyLinks = $this->db->SimpleSelect("wb_links", "id,url,title", "weblog_id={$weblog_id} AND type='{$linkType}'")->fetchAll(); $this->tmpl->loadPage("dailyLinks"); $this->tmpl->assign("dailyLinks", $dailyLinks); $this->tmpl->assign("type", $linkType); $linkInfo = $this->db->SimpleSelect("wb_links", "id,url,title", array("weblog_id" => $weblog_id, "id" => $this->input->getInt("id"), "type" => $linkType))->fetch(); if (!$linkInfo) { $linkInfo = new istdClass(); } $this->tmpl->assign("linkInfo", $linkInfo); $this->reponse->setTemplate($this->tmpl); }
public function saveStatus() { Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id); fb($this->input->getInt('RequestID')); if ($this->input->getInt('RequestID') != 0) { $data->id = $this->input->getInt('RequestID'); $data->status = $this->input->getString('status'); try { $this->db->StoreObject("sh_requests", $data); Messages::getInstance()->logSuccess('تغییر مورد نظر با موفقیت انجام شد'); } catch (Exception $ex) { Messages::getInstance()->logError('در انجام عملیات خطایی رخ داده است'); } } $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopRequest/showrequest"); }
public function saveCode() { Factory::getUser()->authorise("template", ResponseRegistery::getInstance()->site_id); $db = Factory::getDBO(); $data->main = $this->input->getString('main'); $data->id = $this->getWebLogTemplateId(); $db->StoreObject("ge_templates", $data); //Messages::getInstance()->logSuccess('قالب با موفقیت ذخیره و اعمال شد'); $msg = Messages::getInstance(); $msg->logSuccess('قالب با موفقیت ذخیره شد'); if ($this->compile($data->main, $data->id)) { $msg->logSuccess('قالب با موفقیت اعمال شد'); } else { $msg->logError('در ساختار قالب خطا وجود دارد لطفا قبل از نمایش وبلاگ این خطاها را بررسی کنید'); } $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/template/show"); }
public function findWeblogAddress() { $db = Factory::getDBO(); $sql = 'SELECT site.id, sub_domain FROM ge_subdomains sub JOIN ge_sites as site ON(sub.site_id=site.id) JOIN ge_users_sites as us ON(site.id=us.site_id) WHERE us.user_id=' . intval(Factory::getUser()->id); fb(Factory::getUser()->id, 'user_id'); $sub = $db->query($sql)->fetch(); if ($sub) { ResponseRegistery::getInstance()->site_id = $sub->id; return $sub->sub_domain; } return false; }
public function deleteSubgroup() { Factory::getUser()->authorise("group", ResponseRegistery::getInstance()->site_id); try { $this->db->delete("sh_subgroups", $this->input->getInt('id')); Messages::getInstance()->logSuccess("زیر گروه مورد نظر با موفقیت حذف شد"); } catch (Exception $e) { Messages::getInstance()->logError("هیچ زیر گروهی حذف نشد"); } $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopGroup/showGroups"); }
public function logout() { Factory::getUser()->logout(); $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL); }
public function delete() { Factory::getUser()->authorise("item", ResponseRegistery::getInstance()->site_id); try { $item_id = $this->input->getInt('id'); $query = "DELETE FROM sh_subgroups_items WHERE item_id = {$item_id}"; $this->db->execute($query); $query = "DELETE FROM sh_images WHERE item_id = {$item_id}"; $this->db->execute($query); $query = "DELETE FROM sh_items WHERE id = {$item_id}"; $this->db->execute($query); // [FIXIT] images file not delete Messages::getInstance()->logSuccess("کالای مورد نظر با موفقیت حذف شد"); } catch (Exception $e) { Messages::getInstance()->logError("هیچ کالایی حذف نشد"); Messages::getInstance()->logError($e); } $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopItem/showItem"); }
public function disban() { Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id); $site_id = $this->input->getInt('id'); $tmp->id = $site_id; $tmp->active = 1; Factory::getDBO()->StoreObject("ge_sites", $tmp); Messages::getInstance()->logSuccess('سایت مورد نظر با موفقیت فعال شد'); $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/admin/blog/show"); }
public function commentDelete() { Factory::getUser()->authorise("comment", ResponseRegistery::getInstance()->site_id); try { $sql = 'DELETE FROM wb_comment WHERE id=' . $this->input->getInt('id'); //FIXME. ' and weblog_id=' . Session::getInstance()->weblog_id; $this->db->execute($sql); } catch (MySQLException $e) { if ($e->getCode() == 1451) { fb($e); Messages::getInstance()->logWarning('یک یا چند پست با این موضع وجود دارد ابتدا انها را ویرایش کنید'); } else { throw $e; } } $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/post/comment"); }
function current() { $id = $this->ids[$this->index]['id']; return Factory::getUser($id); }