/var/www/vhosts/nabawater/backend/controllers
NameSizeModeActions
ActivityLogController.php16500644editdlrm
AddressTypeController.php64660644editdlrm
AdminOrderReportController.php35920644editdlrm
AdminUserController.php125230644editdlrm
AdsController.php97430644editdlrm
AreaController.php70190644editdlrm
BannerController.php71000644editdlrm
BranchController.php339890644editdlrm
BranchReviewController.php22090644editdlrm
CashBackPromotionsController.php120510644editdlrm
CategoryController.php87950644editdlrm
CityController.php55180644editdlrm
CmsController.php60260644editdlrm
ConfigurationController.php105640644editdlrm
CountryController.php52340644editdlrm
CouponController.php152450644editdlrm
CuisineController.php82070644editdlrm
DashboardController.php58050644editdlrm
DeliveryAreaController.php75060644editdlrm
DeliveryboyController.php76620644editdlrm
DeliveryChargeSettingsController.php45560644editdlrm
DriverOrderController.php35850644editdlrm
EnquiryController.php25410644editdlrm
FaqController.php65710644editdlrm
IngredientController.php69540644editdlrm
ItemController.php341500644editdlrm
ItemImportController.php38480644editdlrm
ItemIngredientGroupController.php111050644editdlrm
ItemMappingController.php121600644editdlrm
ItemTypeController.php74450644editdlrm
LanguageController.php38470644editdlrm
LoginController.php16840644editdlrm
LoyalityPointController.php66550644editdlrm
MallProductController.php63980644editdlrm
MetaTagController.php50390644editdlrm
MobileTranslationController.php44510644editdlrm
NewsLetterController.php52070664editdlrm
NewsletterController.php52070644editdlrm
NewsletterSubscriberController.php17470644editdlrm
NotificationController.php83820644editdlrm
OrderController.php937130644editdlrm
OrderMallProductController.php76610644editdlrm
OrderParcelController.php27520644editdlrm
OrderReportController.php39040644editdlrm
ParcelItemTypeController.php43570644editdlrm
PromotionController.php67100644editdlrm
PushNotificationController.php29900644editdlrm
RatingController.php6230644editdlrm
RefundRequestController.php29640644editdlrm
reject-index.php429310644editdlrm
RejectedOrderReportController.php5660644editdlrm
ReportController.php422320644editdlrm
RoleController.php52300644editdlrm
SiteController.php3570644editdlrm
StockController.php20670644editdlrm
TaxController.php45680644editdlrm
TodaySpecialController.php74730644editdlrm
TopOrderItemReportController.php38660644editdlrm
TopupController.php46190644editdlrm
UnitController.php71150644editdlrm
UserController.php135660644editdlrm
UserLevelController.php37870644editdlrm
VendorBankController.php28800644editdlrm
VendorController.php244910644editdlrm
VendorOrderReportController.php51460644editdlrm
VendorPaymentController.php60940644editdlrm
VendorTypeController.php84280644editdlrm
WalletController.php17910644editdlrm
WalletTranscationController.php22820644editdlrm
WebpushNotificationController.php25630644editdlrm
Edit: /var/www/vhosts/nabawater/backend/controllers/RoleController.php (5230B)
search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); } /** * @return string * @throws \yii\base\InvalidParamException * * @Title("Create") */ public function actionCreate() { $model = new Role(); if ($model->load(Yii::$app->request->post()) && $model->save()) { Com::successFlash(Yii::t('backend','Created Successfully')); return $this->redirect(['index']); } else { return $this->render('create', [ 'model' => $model, 'ruleList' => $this->getRoles(), ]); } } /** * @return array * @throws \yii\base\InvalidParamException * * @Title("Update") */ public function actionUpdate($id) { $Request = Yii::$app->request->post(); /*print_r($Request); die;*/ $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save(false)) { Com::successFlash(Yii::t('backend','Updated Successfully')); return $this->redirect(['index']); } else { return $this->render('update', [ 'model' => $model, 'ruleList' => $this->getRoles(), ]); } } /** * @return array */ public function getRoles() { $rules = (array)AccessRules::getRulesIndex()['methods']; $ruleList = []; foreach ($rules as $module) { $item = [ 'id' => $module['slug'], 'text' => $module['title'], 'children' => [], 'state' => [ 'opened' => true, ] ]; foreach ((array)$module['methods'] as $method) { $item['children'][] = [ 'text' => $method['title'], 'id' => $method['slug'], 'state' => [ // 'selected' => 0 ] ]; } $ruleList[] = $item; } return $ruleList; } /** * Finds the Role model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Role the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if ( ($model = Role::find()->where([ 'or', ['role_key' => $id], ['role_name' => $id] ]) ->one()) !== null ) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } } /** * Deletes an existing Role model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed * * @Title("Delete") */ public function actionDelete($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); } /** * @throws \yii\base\InvalidParamException * @throws \yii\base\Exception * * @Title("role status") */ public function actionChangeStatus() { $params = ['id', 'status']; $post = Yii::$app->getRequest()->post(); $result = ['status' => STATUS_FAIL, 'msg' => '']; foreach ($params as $param) { if (!array_key_exists($param, $post)) { $result['msg'] = Yii::t('backend', 'Required param missing'); goto skip; } } $model = Role::findOne(['role_key' => $post['id']]); if ($model === null) { $result['msg'] = Yii::t('backend', 'Unable to find the requested Role'); goto skip; } $model->role_status = $post['status']; $model->save(false); $result['msg'] = Yii::t('backend', 'Role deactivated successfully'); if ((int)$model->role_status === $model::ACTIVE) { $result['msg'] = Yii::t('backend', 'Role activated successfully'); } $result['status'] = STATUS_SUCCESS; skip: return $this->asJson($result); } }