protected function permission($action = null) { if (!$this->permissions->checkUserCredentials()) { return Uri_helper::redirect('management'); } //get_class($this) }
public function __construct() { parent::__construct(); $this->language->load("commerce_orders"); $this->user = $this->permissions->getUserInformation(); if (!$this->user) { Uri_helper::redirect('users/register'); } }
public function __construct() { parent::__construct(); // CHECK THE SUITABLE HOME PAGE if ($setting = $this->module->getSettings($this->_module)) { if (isset($setting->default_home_page) && $setting->default_home_page != 'home') { Uri_helper::redirect($setting->default_home_page); } } }
public function indexAction() { $this->permission('index'); $settings = $this->module->getSettings($this->_module); if ($this->validation->validate($this)) { $this->module->saveSettings($this->_module, ['default_home_page' => $this->input->post('default_home_page')]); Uri_helper::redirect('management/' . $this->_module); } else { return $this->render('home/index', ['home_pages' => Form_helper::arrayToDropdown($this->Config->get('Home')), 'setting' => $settings]); } }
public function to_wishlistAction($id = false) { if (!$id) { return Brightery::error404(); } $userInfo = $this->permissions->getUserInformation(); $product_id = $this->cart->getProductId($id); $this->cart->remove($id); $this->database->insert('commerce_wishlist', ['commerce_product_id' => $product_id, 'user_id' => $userInfo->user_id]); Uri_helper::redirect("commerce_cart"); }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404("The page you requested is not found."); } $model = new \modules\pm\models\Pm_priorities(); $model->pm_priority_id = $id; if ($model->delete()) { Uri_helper::redirect("management/pm_priorities"); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $pm_issue_statues = new \modules\pm\models\Pm_issue_statues(); $pm_issue_statues->pm_issue_statues_id = $id; if ($pm_issue_statues->delete()) { Uri_helper::redirect("management/pm_issue_statues"); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $classfied = new \modules\classfied\models\Classfied_currencies(); $classfied->classfied_currency_id = $id; if ($classfied->delete()) { Uri_helper::redirect("management/classfied_currencies"); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $model = new \modules\pages\models\Pages(); $model->page_id = $id; if ($model->delete()) { Uri_helper::redirect("management/pages"); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $commerce_payment_method = new \modules\commerce\models\Commerce_payment_method(); $commerce_payment_method->commerce_payment_method_id = $id; if ($commerce_payment_method->delete()) { Uri_helper::redirect("management/commerce_payment_method"); } }
public function indexAction() { $this->permission('index'); $settings = $this->module->getSettings($this->_module); $status = Form_helper::queryToDropdown('Pm_issue_statues', 'Pm_issue_statues_id', 'title'); if ($this->validation->validate($this)) { $this->module->saveSettings($this->_module, ['creation_status' => $this->input->post('creation_status'), 'start_status' => $this->input->post('start_status'), 'pause_status' => $this->input->post('pause_status'), 'done_status' => $this->input->post('done_status')]); Uri_helper::redirect('management/' . $this->_module . '/pm_settings'); } else { return $this->render('pm_settings/index', ['status' => $status, 'setting' => $settings]); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $commerce_product_attributes = new \modules\commerce\models\Commerce_product_attributes(); $commerce_product_attributes->commerce_product_attribute_id = $id; if ($commerce_product_attributes->delete()) { Uri_helper::redirect("management/commerce_product_attributes"); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $model = new \modules\clinic\models\Clinic_doctor_reviews(); $model->clinic_doctor_review_id = $id; if ($model->delete()) { Uri_helper::redirect("management/clinic_doctor_reviews"); } }
public function to_cartAction($id = false) { if (!$id) { return Brightery::error404(); } $commerce_wishlist = new \modules\commerce\models\Commerce_wishlist(); $commerce_wishlist->commerce_wishlist_id = $id; $product_id = $commerce_wishlist->get()->commerce_product_id; $commerce_wishlist->delete(); $this->cart->add($product_id); Uri_helper::redirect("commerce_wishlist"); }
public function manageAction($id = false) { $this->permission('manage'); $model = new \modules\pm\models\Pm_roles(); $model->attributes = $this->Input->post(); if ($id) { $model->pm_role_id = $id; } if ($model->save()) { Uri_helper::redirect("management/pm_roles"); } return $this->render('pm_roles/manage', ['item' => $id ? $model->get() : null]); }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $model = new \modules\usergroups\models\Usergroups(); $model_user_group = new \modules\usergroups\models\Usergroup_zones(); $model->usergroup_id = $id; $model_user_group->usergroup_id = $id; if ($model_user_group->delete() && $model->delete()) { Uri_helper::redirect("management/usergroups"); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $this->model_instance->{$this->model_instance->getPrimaryKey()} = $id; if (!$this->model_instance->get()) { return Brightery::error404(); } if ($this->model_instance->delete()) { Uri_helper::redirect("management/" . $this->_controller); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $model = new \modules\classfied\models\Classfied_cities(); $model->classfied_city_id = $id; $city = $model->get(); $model->classfied_country_id = $city->classfied_country_id; if ($model->delete()) { Uri_helper::redirect("management/classfied_cities/index/{$city->classfied_country_id}"); } }
public function indexAction() { $userInfo = $this->permissions->getUserInformation(); if (!$userInfo) { Uri_helper::redirect("users"); } $commerce = new \modules\commerce\models\Commerce_shares('frontend_add'); $commerce->attributes = $this->Input->input['post']; $commerce->user_id = $userInfo->user_id; if ($commerce->save()) { Uri_helper::redirect("commerce_sharing"); } else { return $this->render('commerce_manage_sharing', ['item' => $commerce->get()]); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { Brightery::error404("The page you requested is not found."); } $model = new \modules\pm\models\Pm_issues(); $attach = new \modules\pm\models\Pm_attachments(); $model->pm_issue_id = $id; $attach->pm_issue_id = $id; $attach->pm_attachment_id; if ($model->delete()) { Uri_helper::redirect("management/pm_issues"); } if ($attach->delete()) { return json_encode(['sucess' => 1]); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { Brightery::error404("The page you requested is not found."); } $model = new Brightery_licenses(); $model->brightery_license_id = $id; if ($model->delete()) { Uri_helper::redirect("management/brightery_licenses"); } }
public function deleteAction($id = false) { $this->permission('delete'); if (!$id) { return Brightery::error404(); } $model_schedules = new \modules\clinic\models\Clinic_schedules(); $model_schedules->clinic_doctor_id = $id; $model_exceptions = new modules\clinic\models\Clinic_schedule_exceptions(); $model_exceptions->clinic_doctor_id = $id; $model = new \modules\clinic\models\Clinic_doctors(); $model->clinic_doctor_id = $id; $model_resevration_type = new \modules\clinic\models\Clinic_doctor_reservation_types(); $model_resevration_type->clinic_doctor_id = $id; $model_reservation = new \modules\clinic\models\Clinic_reservations(); $model_reservation->clinic_doctor_id = $id; if ($model->delete() && $model_exceptions->delete() && $model_schedules->delete() && $model_resevration_type->delete() && $model_reservation->delete()) { Uri_helper::redirect("management/clinic_doctors"); } }
public function logoutAction() { $this->input->deleteCookie('email'); $this->input->deleteCookie('fullname'); $this->input->deleteCookie('password'); Uri_helper::redirect('management'); }
public function approveAction($id = false) { if (!$id) { return Brightery::error404(); } echo 'iuui'; $classfied = new \modules\classfied\models\Classfied_jobs(null); $classfied->where('classfied_job_id', $id); $classfied->set('is_active', '1'); if ($classfied->save()) { Uri_helper::redirect("management/classfied_jobs"); } }