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


PHP AF::isAjaxRequestModels方法代码示例

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


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

示例1: viewAction

 function viewAction()
 {
     $clearArray = array();
     $this->filter($clearArray);
     $stateCode = AF::get($this->params, 'state_code', null);
     $countryID = AF::get($this->params, 'country_id', null);
     $defaultCheck = $countryID ? null : AF::get($this->params, 'searchdefaultCountryCheck', null);
     $stateModel = new State();
     if ($stateCode && !$countryID) {
         $stateModel->fillFromStateCode($stateCode);
         $countryID = $stateModel->country_id;
         $this->params['country_id'] = $countryID;
     }
     $pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params, 'ajax' => true));
     // pass in blank model with possible location info to be used in pre-selecting fields during tax creation on the modal form
     $model = new Tax();
     $model->state_code = $stateCode;
     $model->country_id = $countryID;
     $models = AFActiveDataProvider::models('Tax', $this->params, $pagination);
     $dataProvider = $defaultCheck ? $models->getDefaultCountries() : $models->getAll();
     $filterFields = $models->getoutFilterFields($clearArray);
     // set ajax table
     if (AF::isAjaxRequestModels()) {
         $this->view->includeFile('_table', array('application', 'views', 'taxes'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields));
         die;
     }
     $countries = Country::model()->cache()->findAllInArray();
     $states = State::model()->cache()->findAllInArray();
     $countryDefault = Taxs::getCountryDefault($countryID);
     Assets::js('jquery.form');
     Assets::js('ajax_table');
     Assets::js('af_input_field');
     $this->addToPageTitle('Taxes');
     $this->render('view', array('dataProvider' => $dataProvider, 'pagination' => $pagination, 'models' => $models, 'countries' => $countries, 'states' => $states, 'countryDefault' => $countryDefault, 'countryID' => $countryID, 'model' => $model, 'filterFields' => $filterFields));
 }
开发者ID:,项目名称:,代码行数:35,代码来源:

示例2: welcomeAction

 function welcomeAction()
 {
     $filterFields = array();
     $dataProvider = array();
     if ($this->access->actionAccess('dashboard')) {
         if (!isset($this->params['dates'])) {
             //$dataFrom=mktime(0, 0, 0, date("m"), date("d")-1, date("Y"));
             $fromDate = date("d.m.Y");
             $this->params['dates'] = $fromDate . '-' . $fromDate;
         }
         $models = AFActiveDataProvider::models('Order', $this->params);
         $dataProvider = $models->dashboard();
         $filterFields = $models->getoutFilterFields(array(), array('dates'));
         // set ajax table
         if (AF::isAjaxRequestModels()) {
             $this->view->includeFile('_dashboard', array('application', 'views', 'home'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'filterFields' => $filterFields));
             die;
         }
         Assets::css('jquery-ui');
         Assets::js('jquery-ui');
         Assets::js('dateRange/jquery.daterange');
         Assets::js('ajax_table');
         Assets::js('//www.google.com/jsapi');
     }
     $this->addToPageTitle(__('welcome'));
     $this->render('welcome', array('dataProvider' => $dataProvider, 'filterFields' => $filterFields));
 }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例3: ordersAction

 public function ordersAction()
 {
     $from = AF::get($this->params, 'from', false);
     $clearArray = array();
     $this->filter($clearArray);
     if (!isset($this->params['r_dates'])) {
         $today = date("d.m.Y");
         $this->params['r_dates'] = $today . '-' . $today;
     }
     $pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params, 'ajax' => true));
     $models = AFActiveDataProvider::models('Attempt', $this->params, $pagination);
     $dataProvider = $models->getDeclineOrdersReport();
     $filterFields = Attempt::$FilterFields = $models->getoutFilterFields($clearArray, array('r_dates'));
     $fields = array('order_formatted', 'type_formatted', 'status_note', 'created_formatted');
     $gateways = $models->getDSearchGateways();
     $reasons = $models->getDSearchReasons();
     // set ajax table
     if (AF::isAjaxRequestModels()) {
         $this->view->includeFile('_orders_table', array('application', 'views', 'declinedreports'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields, 'fields' => $fields, 'gateways' => $gateways, 'reasons' => $reasons));
         die;
     }
     Assets::css('jquery-ui');
     Assets::js('//code.jquery.com/ui/1.10.3/jquery-ui.js');
     Assets::js('dateRange/jquery.daterange');
     Assets::js('ajax_table');
     $this->render('orders', array('dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields, 'fields' => $fields, 'gateways' => $gateways, 'reasons' => $reasons, 'from' => $from));
 }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例4: emailAction

 function emailAction()
 {
     $model = new CampaignEmail();
     if (isset($_POST['ajax'])) {
         if (isset($_POST['model']) && $_POST['model'] == 'prospects') {
             // Uncomment the following line if AJAX validation is needed
             $this->performAjaxValidation($model);
             $model->fillFromArray($_POST);
             /*
             $model->user_id_created = $this->user->user_id;
             $model->user_id_updated = $this->user->user_id;
             $model->updated = 'NOW():sql';
             $model->created = 'NOW():sql';
             $model->model_uset_id = $this->user->user_id;
             */
             if ($model->save()) {
                 Message::echoJsonSuccess();
             } else {
                 Message::echoJsonError(__('prospects_email_not_created') . ' ' . $model->errors2string);
             }
             die;
         }
         if (isset($_POST['model']) && $_POST['model'] == 'campaigns') {
             $campaignModel = new Campaign();
             $campaignModel->setIsNewRecord(false);
             $campaignID = AF::get($_POST, 'campaign_id');
             $campaignModel->fillFromDbPk($campaignID);
             $campaignModel->smtp_id = AF::get($_POST, 'smtp_id');
             $campaignModel->user_id_updated = $this->user->user_id;
             $campaignModel->updated = 'NOW():sql';
             if ($campaignModel->save(false)) {
                 Message::echoJsonSuccess(__('campaign_updated'));
             } else {
                 Message::echoJsonError(__('campaign_no_updated'));
             }
             die;
         }
     }
     $clearArray = array();
     $this->filter($clearArray);
     $pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params, 'ajax' => true));
     $models = AFActiveDataProvider::models('CampaignEmail', $this->params, $pagination);
     $dataProvider = $models->getAll();
     $filterFields = $models->getoutFilterFields($clearArray);
     // set ajax table
     if (AF::isAjaxRequestModels()) {
         $this->view->includeFile('_email_table', array('application', 'views', 'prospects'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields));
         die;
     }
     $templates = Template::model()->cache()->findAllInArray();
     $smtps = Smtp::model()->cache()->findAllInArray();
     $campaignID = AF::get($this->params, 'campaign_id');
     $campaignModel = new Campaign();
     $campaignModel->fillFromDbPk($campaignID);
     Assets::js('jquery.form');
     $this->addToPageTitle(__('prospect_email'));
     $this->render('email', array('dataProvider' => $dataProvider, 'pagination' => $pagination, 'models' => $models, 'campaignModel' => $campaignModel, 'templates' => $templates, 'smtps' => $smtps, 'filterFields' => $filterFields));
 }
开发者ID:,项目名称:,代码行数:58,代码来源:

示例5: approvalsAction

 function approvalsAction()
 {
     $clearArray = array();
     $this->filter($clearArray);
     if (!isset($this->params['dates'])) {
         $today = date("d.m.Y");
         $this->params['dates'] = $today . '-' . $today;
     }
     if (!isset($this->params['sort_by'])) {
         $this->params['sort_by'] = 'bank_name';
     }
     if (!isset($this->params['sort'])) {
         $this->params['sort'] = 'asc';
     }
     $models = AFActiveDataProvider::models('Order', $this->params);
     $dataProvider = $models->getApprovalsReport();
     $filterFields = $models->getoutFilterFields($clearArray, array('dates'));
     //=Order::$FilterFields
     // Download a csv file
     if (isset($this->params['download_csv'])) {
         Csv::printArray($dataProvider);
     }
     // set an ajax table
     if (AF::isAjaxRequestModels()) {
         $this->view->includeFile('_approvals_table', array('application', 'views', 'reports'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'filterFields' => $filterFields, 'ajax' => true));
         die;
     }
     $campaigns = Campaign::model()->cache()->findAllInArray();
     $countries = Country::model()->cache()->findAllInArray();
     $this->addToPageTitle(__('section_name_approvals_report'));
     Assets::css('jquery-ui');
     Assets::js('jquery-ui');
     Assets::js('dateRange/jquery.daterange');
     Assets::js('ajax_table');
     Assets::js('af_input_field');
     $this->render('approvals', array('dataProvider' => $dataProvider, 'filterFields' => $filterFields, 'campaigns' => $campaigns, 'countries' => $countries));
 }
开发者ID:,项目名称:,代码行数:37,代码来源:


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