/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/ConfigurationController.php (10564B)
loadConfig(); return $this->render('social-media', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Tabao Credit Setting") */ public function actionTaoboCredit() { $model = new Configuration(); $model->loadConfig(); return $this->render('tabaogo-credit', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Recaptcha Setting") */ public function actionRecaptcha() { $model = new Configuration(); $model->loadConfig(); return $this->render('recaptcha', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Tabao Wallet Management") */ public function actionTaoboWallet() { $model = new Configuration(); $model->loadConfig(); return $this->render('tabaogo-wallet', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Loaylity Point Redeem") */ public function actionLoyalityPoint() { $model = new Configuration(); $model->loadConfig(); return $this->render('loyality-point', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Sms Setting") */ public function actionSms() { $model = new Configuration(); $model->loadConfig(); return $this->render('sms', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Qr Setting") */ public function actionQr() { $model = new Configuration(); $model->loadConfig(); return $this->render('qr', ['model' => $model]); } /** * @return string * @throws \yii\base\InvalidParamException * * @Title("SMTP setting") */ public function actionSmtp() { $model = new Configuration(); $model->loadConfig(); return $this->render('smtp', ['model' => $model]); } /** * @return string * @throws \yii\base\InvalidParamException * * @Title("Distance Time Setting") */ public function actionDistanceTime() { $model = new Configuration(); $model->loadConfig(); return $this->render('distance-time', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Referral Point Setting") */ public function actionReferralPoint() { $model = new Configuration(); $model->loadConfig(); return $this->render('referral-point', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("App Configuration") */ public function actionAppConfig() { $model = new Configuration(); $modelUploadForm = new ConfigurationUploadForm(); $model->loadConfig(); return $this->render('app-config', ['model' => $model, 'modelUploadForm' => $modelUploadForm]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Payumoney Configuration") */ public function actionPayumoneyConfig() { $model = new Configuration(); $model->loadConfig(); return $this->render('payumoney-config', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Delivery Boy Setting") */ public function actionDeliveryBoySetting() { $model = new Configuration(); $model->loadConfig(); return $this->render('delivery-boy-setting', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("Delivery Charge Setting") */ public function actionDeliveryChargeSetting() { $model = new Configuration(); $model->loadConfig(); return $this->render('delivery-charge-setting', ['model' => $model]); } /** * * @return string * @throws \yii\base\InvalidParamException * * @Title("One Signal Setting") */ public function actionOneSignalSetting() { $model = new Configuration(); $model->loadConfig(); return $this->render('one-signal-setting', ['model' => $model]); } /** * @return string * @throws \yii\base\InvalidParamException * * @Title("Currency Setting") */ public function actionCurrencySetting() { $model = new Configuration(); $model->loadConfig(); return $this->render('currency-setting', ['model' => $model]); } /** * @return string * @throws \yii\base\InvalidParamException * * @Title("Strip Setting") */ public function actionStripe() { $model = new Configuration(); $model->loadConfig(); return $this->render('stripe_config', ['model' => $model]); } /** * @return string * @throws \yii\base\InvalidParamException * * @Title("Strip Setting") */ public function actionPayment() { $model = new Configuration(); $model->loadConfig(); return $this->render('payment', ['model' => $model]); } /** * @param bool $redirect * @return \yii\web\Response * @throws \yii\base\Exception * @throws \yii\base\InvalidParamException */ public function actionSave($redirect = false) { $model = new Configuration(); $post = Yii::$app->request->post(); if ($model->load($post)) { $modelUploadForm = new ConfigurationUploadForm(); $appLogoFile = UploadedFile::getInstance($modelUploadForm,'app_logo'); $favLogoFile = UploadedFile::getInstance($modelUploadForm, 'fav_logo'); $offerImageFile = UploadedFile::getInstance($modelUploadForm, 'offer_image'); $placeholderImageFile = UploadedFile::getInstance($modelUploadForm, 'placeholder_image'); if(isset($model->PAYMENT_TYPE)) { $model->PAYMENT_TYPE = implode(',', $model->PAYMENT_TYPE); } $uploadHelper = UploadHelper::getInstance(); if(!empty($appLogoFile)) { $uploadHelper->setPath($uploadHelper::SITE_IMAGES); $uploadHelper->setUploadedFile($appLogoFile); $path = $uploadHelper->getPath(true); $appLogoFile->saveAs($path); $realpath = $uploadHelper->getRealPath($path); $model['APP_LOGO_PATH'] = '/'. $realpath; } if(!empty($favLogoFile)) { $uploadHelper->setPath($uploadHelper::SITE_IMAGES); $uploadHelper->setUploadedFile($favLogoFile); $path = $uploadHelper->getPath(true); $favLogoFile->saveAs($path); $realpath = $uploadHelper->getRealPath($path); $model['FAV_LOGO_PATH'] = '/'. $realpath; } if(!empty($offerImageFile)) { $uploadHelper->setPath($uploadHelper::SITE_IMAGES); $uploadHelper->setUploadedFile($offerImageFile); $path = $uploadHelper->getPath(true); $offerImageFile->saveAs($path); $realpath = $uploadHelper->getRealPath($path); $model['OFFER_IMAGE_PATH'] = '/'. $realpath; } if(!empty($placeholderImageFile)) { $uploadHelper->setPath($uploadHelper::SITE_IMAGES); $uploadHelper->setUploadedFile($placeholderImageFile); $path = $uploadHelper->getPath(true); $placeholderImageFile->saveAs($path); $realpath = $uploadHelper->getRealPath($path); $model['APP_PLACEHOLDER_PATH'] = '/'. $realpath; } $model->save(); //echo "
";
            //print_r($post); die;
            if(isset($post['Configuration']['APP_VAT'])) {
                $modelVendor = Vendor::find()->where(['vendor_status' => Vendor::ACTIVE])->one();
                if($modelVendor != null) {
                    $modelVendor->cgst = $post['Configuration']['APP_VAT'];
                    $modelVendor->save(false);      
                }
            }
            // 
            Com::successFlash("Updated Successfully");
        }
        
        $redirect = $redirect === false ? 'index' : $redirect;

        $configData = $model->getConfigData();
        $responseData = Com::getJsonData('POST',
            Configuration::get(Configuration::DELIVERY_BOY_ACCESS_URL) . "company?company_id=".Configuration::get(Configuration::COMPANY_KEY),
            $configData, 1);
        
        if ($responseData == null) {
            Yii::$app->session->setFlash('danger', Yii::t('backend', "Server is down! try again some time."));
            $redirect = $redirect === false ? 'index' : $redirect;
        } else {
            Yii::$app->session->setFlash('success', Yii::t('backend', "Details saved successfully"));
            $model->save();

            //print_r($model); die;
        }

        return $this->redirect([$redirect]);
    }  
}