当前位置: 首页>>代码示例>>PHP>>正文


PHP Common::jsonError方法代码示例

本文整理汇总了PHP中Common::jsonError方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::jsonError方法的具体用法?PHP Common::jsonError怎么用?PHP Common::jsonError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Common的用法示例。


在下文中一共展示了Common::jsonError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run($id = false, $model = false, $forceDelete = false)
 {
     $modelName = $this->model && is_string($this->model) ? $this->model : (request()->getParam('model') ? request()->getParam('model') : $this->controller->model);
     if ($id) {
         //delete one model
         $result = $this->controller->loadModel($modelName, $id)->delete();
         if (!request()->isAjaxRequest && $result) {
             $this->controller->redirect(user()->gridIndex);
         }
         Common::jsonSuccess(true);
     } else {
         $items = Common::getChecked('items');
         if ($items) {
             if (!$forceDelete) {
                 foreach ($items as $id) {
                     $this->controller->loadModel($modelName, $id)->delete();
                 }
             } else {
                 $criteria = new SDbCriteria();
                 $criteria->compare('id', $items);
                 CActiveRecord::model($modelName)->deleteAll($criteria);
             }
             Common::jsonSuccess(true);
         }
     }
     Common::jsonError("Ошибка");
 }
开发者ID:amanukian,项目名称:test,代码行数:27,代码来源:DeleteAction.php

示例2: deleteHotelFetursList

function deleteHotelFetursList()
{
    $hotelfeatureslist = new HotelFetursList();
    $hotelfeatureslist->setHotelFeatureListId($_REQUEST['id']);
    if ($hotelfeatureslist->deleteHotelFeatureList()) {
        Common::jsonSuccess("Hotel Features List Deleted Successfully");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:10,代码来源:hotelfeturslist-controller.php

示例3: deleteRoomFeatures

function deleteRoomFeatures()
{
    $room_features = new RoomFeatures();
    $room_features->setRoomFeatureId($_REQUEST['id']);
    if ($room_features->deleteRoomFeatures()) {
        Common::jsonSuccess("Room Features Deleted Successfully");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:10,代码来源:roomfeatures-controller.php

示例4: deleteCategory

function deleteCategory()
{
    $category = new Category();
    $category->setCategoryId($_REQUEST['id']);
    if ($category->deleteCategory()) {
        Common::jsonSuccess("Category Deleted Successfully");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:10,代码来源:category-controller.php

示例5: subscribe

function subscribe()
{
    $subscribe = new Subscribe();
    $subscribe->setValues($_REQUEST);
    if ($subscribe->newSubscribe()) {
        Common::jsonSuccess("Subscribe Successfully!");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:10,代码来源:subscribe-controller.php

示例6: deleteHotelFetursType

function deleteHotelFetursType()
{
    $hotelfeat_type = new HotelFetursType();
    $hotelfeat_type->setHotelFeatureTypeId($_REQUEST['id']);
    if ($hotelfeat_type->deleteHotelFeatureType()) {
        Common::jsonSuccess("Feturs Type Deleted Successfully");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:10,代码来源:hotelfeturstype-controller.php

示例7: deleteAdministrator

function deleteAdministrator()
{
    $admin = new Administrators();
    $admin->setId($_REQUEST['id']);
    if ($admin->deleteAdministrator()) {
        Common::jsonSuccess("Adminstrators Deleted Successfully");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:10,代码来源:administrators-controller.php

示例8: deleteMemberBankDetail

function deleteMemberBankDetail()
{
    $member_bank_details = new MemberBankDetails();
    $member_bank_details->setBankId($_REQUEST['id']);
    if ($member_bank_details->deleteMemberBankDetails()) {
        Common::jsonSuccess("Member Bank Details Deleted Successfully");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:10,代码来源:memberbankdetails-controller.php

示例9: deleteCurrency

function deleteCurrency()
{
    $currency = new Currency();
    $currency->setCurrId($_REQUEST['id']);
    if ($currency->deleteCurrency()) {
        Common::jsonSuccess("Currency Deleted Successfully");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:10,代码来源:currency-controller.php

示例10: deleteAccommodation

function deleteAccommodation()
{
    $accommodation = new Accommodation();
    $accommodation->setAccommodationId($_REQUEST['id']);
    if ($accommodation->deleteAccommodation()) {
        Common::jsonSuccess("Accommodation Deleted Successfully");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:10,代码来源:accommodation-controller.php

示例11: updateSettings

function updateSettings()
{
    $sysSettings = new systemSetting();
    $get_edited = array();
    foreach ($_REQUEST as $k => $v) {
        $get_edited[$k] = $v;
    }
    $sysSettings->setValues($get_edited);
    if ($sysSettings->editSetting()) {
        Common::jsonSuccess("Settings Update Successfully!");
    } else {
        Common::jsonError("Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:14,代码来源:settings-controller.php

示例12: adminLoginNow

function adminLoginNow()
{
    $username = $_REQUEST['login_user'];
    $password = $_REQUEST['login_password'];
    $admin = new administrator();
    $admin->setUsername($username);
    $data = $admin->getAdminFromUsername();
    if (count($data) > 0) {
        $admin->extractor($data);
        if ($admin->password() == md5($password)) {
            $session = new Sessions();
            $session->setAdminLoginSessions($admin->id(), $admin->name(), $admin->email());
            Common::jsonSuccess("Success");
        } else {
            Common::jsonError("Login Error");
        }
    } else {
        Common::jsonError("Login Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:20,代码来源:login-controller.php

示例13: actionAddComment

 /**
  * Добавить комментарий
  */
 public function actionAddComment()
 {
     $commentsModelName = request()->getParam('commentsModelName');
     $commentsForeignKey = request()->getParam('commentsForeignKey');
     $idOwner = request()->getParam('idOwner');
     $additionalFields = request()->getParam('additionalFields');
     $model = $this->owner->loadModel($commentsModelName);
     $this->owner->performAjaxValidation($model);
     $model->id_user = user()->id;
     $model->comment = request()->getParam('comment');
     $model->{$commentsForeignKey} = $idOwner;
     $model->date = date('y-m-d H:i:s');
     if ($additionalFields) {
         $additionalFields = CJSON::decode($additionalFields);
         foreach ($additionalFields as $field => $value) {
             $model->{$field} = $value;
         }
     }
     if ($model->save()) {
         Common::jsonSuccess(true, ['data' => $model->render()]);
     } else {
         Common::jsonError("Ошибка при сохранении");
     }
 }
开发者ID:amanukian,项目名称:test,代码行数:27,代码来源:CommentsActions.php

示例14: loginClient

function loginClient()
{
    $username = $_REQUEST['client_username_log'];
    $password = $_REQUEST['client_password_log'];
    $client = new Clients();
    $session = new Sessions();
    $client->setClientUsername($username);
    $data = $client->getClientFromUsername();
    if (count($data) > 0) {
        $client->extractor($data);
        if (strcmp($client->clientPassword(), md5($password)) == 0) {
            $session->setClientLoginSessions($client->clientId(), $client->clientTitle(), $client->clientFirstName(), $client->clientLastName());
            Common::jsonSuccess("Success");
        } else {
            Common::jsonError("Login Error");
        }
    } else {
        Common::jsonError("Login Error");
    }
}
开发者ID:jcodesdotme,项目名称:pp,代码行数:20,代码来源:clients-controller_original.php

示例15: actionChangePassword

 public function actionChangePassword()
 {
     $model = $this->loadModel($this->model, user()->id);
     $model->scenario = 'changePassword';
     $model->password = null;
     $this->performAjaxValidation($model);
     if (isset($_POST[$this->model])) {
         $model->attributes = $_POST;
         //save new password and salt
         if ($model->validate()) {
             if ($model->save(array('password'))) {
                 Common::jsonSuccess(true);
             }
         } else {
             Common::jsonError('Ошибка авторизации');
         }
     }
 }
开发者ID:amanukian,项目名称:test,代码行数:18,代码来源:AuthController.php


注:本文中的Common::jsonError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。