• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AJson类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('tool/files');
     if (!$this->user->canAccess('tool/file_uploads')) {
         $response = new stdClass();
         $response->userdata->error = sprintf($this->language->get('error_permission_access'), 'tool/file_uploads');
         $this->load->library('json');
         $this->response->setOutput(AJson::encode($response));
         return null;
     }
     $this->loadModel('tool/file_uploads');
     $page = $this->request->post['page'];
     // get the requested page
     $limit = $this->request->post['rows'];
     // get how many rows we want to have into the grid
     $sidx = $this->request->post['sidx'];
     // get index row - i.e. user click to sort
     $sord = $this->request->post['sord'];
     // get the direction
     $filter = array();
     //process custom search form
     $allowedSearchFilter = array('date_added', 'section');
     if (isset($this->request->post['filters']) && $this->request->post['filters'] != '') {
         $this->request->post['filters'] = json_decode(html_entity_decode($this->request->post['filters']));
         $filter['value'] = $this->request->post['filters']->rules[0]->data;
     }
     // process jGrid search parameter
     $data = array('sort' => $sidx . ":" . $sord, 'offset' => ($page - 1) * $limit, 'limit' => $limit, 'filter' => $filter);
     $total = $this->model_tool_file_uploads->getTotalRows($filter);
     if ($total > 0) {
         $total_pages = ceil($total / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
         $data['offset'] = ($page - 1) * $limit;
     }
     $response = new stdClass();
     $response->page = $page;
     $response->total = $total_pages;
     $response->records = $total;
     $results = (array) $this->model_tool_file_uploads->getLog($data);
     $i = 0;
     foreach ($results as $k => $result) {
         $k++;
         $response->rows[$i]['id'] = $k;
         $response->rows[$i]['cell'] = array($k, $result['date_added'], $result['section'], is_file($result['path']) ? '<a target="_blank" title="' . $this->language->get('text_download') . '" href="' . $this->html->getSecureUrl('tool/files/download', '&filename=' . urlencode($result['name'])) . '&attribute_type=' . $result['section'] . '&attribute_id=' . $result['section_id'] . '">' . $result['name'] . '</a>' : '');
         $i++;
     }
     $this->data = $response;
     // for hook access
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->addJSONHeader();
     $this->response->setOutput(AJson::encode($this->data));
 }
开发者ID:siddht1,项目名称:abantecart-src,代码行数:60,代码来源:file_uploads.php


示例2: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('catalog/download');
     $this->loadModel('catalog/download');
     //Prepare filter config
     $grid_filter_params = array('name');
     $filter = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params, 'additional_filter_string' => 'shared=1'));
     $filter_data = $filter->getFilterData();
     $total = $this->model_catalog_download->getTotalDownloads($filter_data);
     $response = new stdClass();
     $response->page = $filter->getParam('page');
     $response->total = $filter->calcTotalPages($total);
     $response->records = $total;
     $response->userdata = new stdClass();
     $results = $this->model_catalog_download->getDownloads($filter_data);
     $i = 0;
     foreach ($results as $result) {
         if (!is_file(DIR_RESOURCE . $result['filename'])) {
             $response->userdata->classes[$result['download_id']] = 'warning';
         }
         $response->rows[$i]['id'] = $result['download_id'];
         $response->rows[$i]['cell'] = array($this->html->buildInput(array('name' => 'name[' . $result['download_id'] . ']', 'value' => $result['name'], 'attr' => ' maxlength="64" ')), $this->html->buildCheckbox(array('name' => 'status[' . $result['download_id'] . ']', 'value' => $result['status'], 'style' => 'btn_switch')), $result['product_count']);
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:vglide,项目名称:abantecart-src,代码行数:31,代码来源:download.php


示例3: main

 public function main()
 {
     $this->loadLanguage('forms_manager/forms_manager');
     $this->loadModel('tool/forms_manager');
     //Clean up parametres if needed
     if (isset($this->request->get['keyword']) && $this->request->get['keyword'] == $this->language->get('filter_form')) {
         unset($this->request->get['keyword']);
     }
     //Prepare filter config
     $filter_params = array('status', 'keyword', 'match');
     $grid_filter_params = array('form_name', 'description', 'status');
     $filter_form = new AFilter(array('method' => 'get', 'filter_params' => $filter_params));
     $filter_grid = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params));
     $total = $this->model_tool_forms_manager->getTotalForms(array_merge($filter_form->getFilterData(), $filter_grid->getFilterData()));
     $response = new stdClass();
     $response->page = $filter_grid->getParam('page');
     $response->total = $filter_grid->calcTotalPages($total);
     $response->records = $total;
     $results = $this->model_tool_forms_manager->getForms(array_merge($filter_form->getFilterData(), $filter_grid->getFilterData()));
     $i = 0;
     foreach ($results as $result) {
         $response->rows[$i]['id'] = $result['form_id'];
         $response->rows[$i]['cell'] = array($this->html->buildInput(array('name' => 'form_name[' . $result['form_id'] . ']', 'value' => $result['form_name'])), $this->html->buildInput(array('name' => 'form_description[' . $result['form_id'] . ']', 'value' => $result['description'])), $this->html->buildCheckbox(array('name' => 'form_status[' . $result['form_id'] . ']', 'value' => $result['status'], 'style' => 'btn_switch')));
         $i++;
     }
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:siddht1,项目名称:abantecart-src,代码行数:28,代码来源:form.php


示例4: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('report/purchased');
     $this->loadModel('report/purchased');
     //Prepare filter config
     $filter_params = array('date_start', 'date_end');
     if (!$this->request->get['date_start']) {
         $this->request->get['date_start'] = dateInt2Display(strtotime('-30 day'));
     }
     if (!$this->request->get['date_end']) {
         $this->request->get['date_end'] = dateInt2Display(time());
     }
     $filter_form = new AFilter(array('method' => 'get', 'filter_params' => $filter_params));
     $filter_grid = new AFilter(array('method' => 'post'));
     $data = array_merge($filter_form->getFilterData(), $filter_grid->getFilterData());
     $total = $this->model_report_purchased->getTotalOrderedProducts($data);
     $response = new stdClass();
     $response->page = $filter_grid->getParam('page');
     $response->total = $filter_grid->calcTotalPages($total);
     $response->records = $total;
     $results = $this->model_report_purchased->getProductPurchasedReport($data);
     $i = 0;
     foreach ($results as $result) {
         $response->rows[$i]['id'] = $i;
         $response->rows[$i]['cell'] = array($result['name'], $result['model'], $result['quantity'], $this->currency->format($result['total'], $this->config->get('config_currency')));
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:siddht1,项目名称:abantecart-src,代码行数:34,代码来源:report_purchased.php


示例5: test

 public function test()
 {
     $this->registry->set('force_skip_errors', true);
     $this->loadLanguage('default_twilio/default_twilio');
     $this->loadModel('setting/setting');
     include_once DIR_EXT . 'default_twilio/core/lib/Services/Twilio.php';
     $cfg = $this->model_setting_setting->getSetting('default_twilio', (int) $this->session->data['current_store_id']);
     $AccountSid = $cfg['default_twilio_username'];
     $AuthToken = $cfg['default_twilio_token'];
     $sender = new Services_Twilio($AccountSid, $AuthToken);
     if ($this->config->get('default_twilio_test')) {
         //sandbox number without errors from api
         $from = '+15005550006';
     } else {
         $from = $this->config->get('default_twilio_sender_phone');
         $from = '+' . ltrim($from, '+');
     }
     $error_message = '';
     try {
         $sender->account->sms_messages->create($from, "+15005550006", 'test message', array());
     } catch (Exception $e) {
         $error_message = $e->getMessage();
     }
     $this->registry->set('force_skip_errors', false);
     $json = array();
     if (!$error_message) {
         $json['message'] = $this->language->get('text_connection_success');
         $json['error'] = false;
     } else {
         $json['message'] = "Connection to Twilio server can not be established.<br>" . $error_message . ".<br>Check your server configuration or contact your hosting provider.";
         $json['error'] = true;
     }
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($json));
 }
开发者ID:siddht1,项目名称:abantecart-src,代码行数:35,代码来源:default_twilio.php


示例6: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('localisation/location');
     $this->loadModel('localisation/location');
     //Prepare filter config
     $grid_filter_params = array('name');
     $filter = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params));
     $total = $this->model_localisation_location->getTotalLocations($filter->getFilterData());
     $response = new stdClass();
     $response->page = $filter->getParam('page');
     $response->total = $filter->calcTotalPages($total);
     $response->records = $total;
     $results = $this->model_localisation_location->getLocations($filter->getFilterData());
     $i = 0;
     foreach ($results as $result) {
         $response->rows[$i]['id'] = $result['location_id'];
         $response->rows[$i]['cell'] = array($this->html->buildInput(array('name' => 'name[' . $result['location_id'] . ']', 'value' => $result['name'])));
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:InquisitiveQuail,项目名称:abantecart-src,代码行数:26,代码来源:location.php


示例7: encode

 public static function encode($data)
 {
     if (function_exists('json_encode')) {
         return json_encode($data);
     } else {
         switch (gettype($data)) {
             case 'boolean':
                 return $data ? 'true' : 'false';
             case 'integer':
             case 'double':
                 return $data;
             case 'resource':
             case 'string':
                 return '"' . str_replace(array("\r", "\n", "<", ">", "&"), array('\\r', '\\n', '\\x3c', '\\x3e', '\\x26'), addslashes($data)) . '"';
             case 'array':
                 if (empty($data) || array_keys($data) === range(0, sizeof($data) - 1)) {
                     $stdout = array();
                     foreach ($data as $value) {
                         $stdout[] = AJson::encode($value);
                     }
                     return '[ ' . implode(', ', $stdout) . ' ]';
                 }
             case 'object':
                 $stdout = array();
                 foreach ($data as $key => $value) {
                     $stdout[] = AJson::encode(strval($key)) . ': ' . AJson::encode($value);
                 }
                 return '{ ' . implode(', ', $stdout) . ' }';
             default:
                 return 'null';
         }
     }
 }
开发者ID:harshzalavadiya,项目名称:fatak,代码行数:33,代码来源:json.php


示例8: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $page = $this->request->post['page'];
     // get the requested page
     $limit = $this->request->post['rows'];
     // get how many rows we want to have into the grid
     $sidx = $this->request->post['sidx'];
     // get index row - i.e. user click to sort
     $sord = $this->request->post['sord'];
     // get the direction
     $data = array('sort' => $sidx, 'order' => $sord, 'start' => ($page - 1) * $limit, 'limit' => $limit, 'language_id' => $this->session->data['content_language_id']);
     $total = $this->attribute_manager->getTotalAttributeGroups();
     if ($total > 0) {
         $total_pages = ceil($total / $limit);
     } else {
         $total_pages = 0;
     }
     $response = new stdClass();
     $response->page = $page;
     $response->total = $total_pages;
     $response->records = $total;
     $results = $this->attribute_manager->getAttributeGroups($data);
     $i = 0;
     foreach ($results as $result) {
         $response->rows[$i]['id'] = $result['attribute_group_id'];
         $response->rows[$i]['cell'] = array($this->html->buildInput(array('name' => 'name[' . $result['attribute_group_id'] . ']', 'value' => $result['name'])), $this->html->buildInput(array('name' => 'sort_order[' . $result['attribute_group_id'] . ']', 'value' => $result['sort_order'])), $this->html->buildCheckbox(array('name' => 'status[' . $result['attribute_group_id'] . ']', 'value' => $result['status'], 'style' => 'btn_switch')));
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:InquisitiveQuail,项目名称:abantecart-src,代码行数:35,代码来源:attribute_groups.php


示例9: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('localisation/country');
     $this->loadModel('localisation/country');
     //Prepare filter config
     $grid_filter_params = array('name' => 'cd.name', 'iso_code_2' => 'c.iso_code_2', 'iso_code_3' => 'c.iso_code_3');
     $filter = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params));
     $total = $this->model_localisation_country->getTotalCountries($filter->getFilterData());
     $response = new stdClass();
     $response->page = $filter->getParam('page');
     $response->total = $filter->calcTotalPages($total);
     $response->records = $total;
     $results = $this->model_localisation_country->getCountries($filter->getFilterData());
     $i = 0;
     $language_id = $this->language->getContentLanguageID();
     foreach ($results as $result) {
         $response->rows[$i]['id'] = $result['country_id'];
         $response->rows[$i]['cell'] = array($this->html->buildInput(array('name' => 'country_name[' . $result['country_id'] . '][' . $language_id . '][name]', 'value' => $result['name'])), $this->html->buildInput(array('name' => 'iso_code_2[' . $result['country_id'] . ']', 'value' => $result['iso_code_2'])), $this->html->buildInput(array('name' => 'iso_code_3[' . $result['country_id'] . ']', 'value' => $result['iso_code_3'])), $this->html->buildCheckbox(array('name' => 'status[' . $result['country_id'] . ']', 'value' => $result['status'], 'style' => 'btn_switch')));
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:siddht1,项目名称:abantecart-src,代码行数:27,代码来源:country.php


示例10: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     //load available groups for settings
     $this->loadLanguage('setting/setting');
     $this->loadModel('setting/setting');
     //Prepare filter config
     $grid_filter_params = array('alias', 'group', 'key');
     $filter_grid = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params));
     $total = $this->model_setting_setting->getTotalSettings($filter_grid->getFilterData());
     $response = new stdClass();
     $response->page = $filter_grid->getParam('page');
     $response->total = $filter_grid->calcTotalPages($total);
     $response->records = $total;
     $results = $this->model_setting_setting->getAllSettings($filter_grid->getFilterData());
     $i = 0;
     foreach ($results as $result) {
         if (($result['value'] == '1' || $result['value'] == '0') && !is_int(strpos($result['key'], '_id')) && !is_int(strpos($result['key'], 'level'))) {
             $value = $this->html->buildCheckbox(array('name' => '', 'value' => $result['value'], 'style' => 'btn_switch', 'attr' => 'readonly="true"'));
         } else {
             $value = $result['value'];
         }
         $response->rows[$i]['id'] = $result['group'] . '-' . $result['key'] . '-' . $result['store_id'];
         $response->rows[$i]['cell'] = array($result['alias'], $result['group'], $result['key'], $value);
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:harshzalavadiya,项目名称:fatak,代码行数:32,代码来源:setting.php


示例11: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('catalog/manufacturer');
     $this->loadModel('catalog/manufacturer');
     $this->loadModel('tool/image');
     //Prepare filter config
     $grid_filter_params = array('name');
     $filter = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params));
     $filter_data = $filter->getFilterData();
     $total = $this->model_catalog_manufacturer->getTotalManufacturers($filter_data);
     $response = new stdClass();
     $response->page = $filter->getParam('page');
     $response->total = $filter->calcTotalPages($total);
     $response->records = $total;
     $results = $this->model_catalog_manufacturer->getManufacturers($filter_data);
     $resource = new AResource('image');
     $i = 0;
     foreach ($results as $result) {
         $thumbnail = $resource->getMainThumb('manufacturers', $result['manufacturer_id'], (int) $this->config->get('config_image_grid_width'), (int) $this->config->get('config_image_grid_height'), true);
         $response->rows[$i]['id'] = $result['manufacturer_id'];
         $response->rows[$i]['cell'] = array($thumbnail['thumb_html'], $this->html->buildInput(array('name' => 'name[' . $result['manufacturer_id'] . ']', 'value' => $result['name'])), $this->html->buildInput(array('name' => 'sort_order[' . $result['manufacturer_id'] . ']', 'value' => $result['sort_order'])));
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:harshzalavadiya,项目名称:fatak,代码行数:30,代码来源:manufacturer.php


示例12: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('sale/customer_group');
     $this->loadModel('sale/customer_group');
     //Prepare filter config
     $grid_filter_params = array('name', 'tax_exempt');
     $filter = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params));
     $total = $this->model_sale_customer_group->getTotalCustomerGroups($filter->getFilterData());
     $response = new stdClass();
     $response->page = $filter->getParam('page');
     $response->total = $filter->calcTotalPages($total);
     $response->records = $total;
     $results = $this->model_sale_customer_group->getCustomerGroups($filter->getFilterData());
     $i = 0;
     $yesno = array(1 => $this->language->get('text_yes'), 0 => $this->language->get('text_no'));
     foreach ($results as $result) {
         $response->rows[$i]['id'] = $result['customer_group_id'];
         $response->rows[$i]['cell'] = array($result['name'] . ($result['customer_group_id'] == $this->config->get('config_customer_group_id') ? $this->language->get('text_default') : NULL), $yesno[(int) $result['tax_exempt']]);
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:siddht1,项目名称:abantecart-src,代码行数:27,代码来源:customer_group.php


示例13: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('catalog/review');
     $this->loadModel('catalog/review');
     $this->loadModel('tool/image');
     //Prepare filter config
     $filter_params = array('product_id', 'status');
     $grid_filter_params = array('name', 'author');
     $filter_form = new AFilter(array('method' => 'get', 'filter_params' => $filter_params));
     $filter_grid = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params));
     $total = $this->model_catalog_review->getTotalReviews(array_merge($filter_form->getFilterData(), $filter_grid->getFilterData()));
     $response = new stdClass();
     $response->page = $filter_grid->getParam('page');
     $response->total = $filter_grid->calcTotalPages($total);
     $response->records = $total;
     $results = $this->model_catalog_review->getReviews(array_merge($filter_form->getFilterData(), $filter_grid->getFilterData()));
     $resource = new AResource('image');
     $i = 0;
     foreach ($results as $result) {
         $thumbnail = $resource->getMainThumb('products', $result['product_id'], $this->config->get('config_image_grid_width'), $this->config->get('config_image_grid_height'), true);
         $response->rows[$i]['id'] = $result['review_id'];
         $response->rows[$i]['cell'] = array($thumbnail['thumb_html'], $result['name'], $result['author'], $result['rating'], $this->html->buildCheckbox(array('name' => 'status[' . $result['review_id'] . ']', 'value' => $result['status'], 'style' => 'btn_switch')), dateISO2Display($result['date_added'], $this->language->get('date_format_short')));
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:harshzalavadiya,项目名称:fatak,代码行数:31,代码来源:review.php


示例14: save

 public function save()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $output = array();
     $this->loadLanguage('tool/rl_manager');
     $this->document->setTitle($this->language->get('heading_title'));
     if ($this->request->is_POST() && $this->_validateRLTypeForm($this->request->post)) {
         $post_data = $this->request->post;
         $rm = new AResourceManager();
         if ($rm->updateResourceType($post_data)) {
             $output['result_text'] = $this->language->get('text_success');
             $this->load->library('json');
             $this->response->addJSONHeader();
             $this->response->setOutput(AJson::encode($output));
         } else {
             $error = new AError('');
             $err_data = array('error_text' => 'Unable to save resource type');
             return $error->toJSONResponse('VALIDATION_ERROR_406', $err_data);
         }
     } else {
         $error = new AError('');
         $err_data = array('error_text' => $this->error);
         return $error->toJSONResponse('VALIDATION_ERROR_406', $err_data);
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
 }
开发者ID:siddht1,项目名称:abantecart-src,代码行数:28,代码来源:rl_manager.php


示例15: complete

 /**
  * post-trigger of task
  */
 public function complete()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $task_id = (int) $this->request->post['task_id'];
     if ($task_id) {
         $tm = new ATaskManager();
         $tm->deleteTask($task_id);
         $install_upgrade_history = new ADataset('install_upgrade_history', 'admin');
         $backup_name = $this->request->get_or_post('backup_name');
         $backup_name = !$backup_name ? 'manual_backup' : $backup_name;
         $display_name = '';
         if (is_file(DIR_BACKUP . $backup_name . '.tar.gz')) {
             $display_name = $backup_name . '.tar.gz';
             $result_text = $this->html->convertLinks($this->language->get('backup_complete_text_file'));
         } elseif (is_dir(DIR_BACKUP . $backup_name)) {
             $display_name = $backup_name . '/...';
             $result_text = sprintf($this->language->get('backup_complete_text_dir'), DIR_BACKUP . $backup_name);
         }
         $install_upgrade_history->addRows(array('date_added' => date("Y-m-d H:i:s", time()), 'name' => 'Manual Backup', 'version' => VERSION, 'backup_file' => $display_name, 'backup_date' => date("Y-m-d H:i:s", time()), 'type' => 'backup', 'user' => $this->user->getUsername()));
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->addJSONHeader();
     $this->response->setOutput(AJson::encode(array('result' => true, 'result_text' => $result_text)));
 }
开发者ID:InquisitiveQuail,项目名称:abantecart-src,代码行数:30,代码来源:backup.php


示例16: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('banner_manager/banner_manager');
     $this->loadModel('extension/banner_manager');
     $filter_params = array('name', 'banner_group_name', 'type', 'cnt');
     $filter_grid = new AFilter(array('method' => 'post', 'grid_filter_params' => $filter_params, 'additional_filter_string' => ''));
     $total = $this->model_extension_banner_manager->getBannersStat($filter_grid->getFilterData(), 'total_only');
     if ($total > 0) {
         $total_pages = ceil($total / 10);
     } else {
         $total_pages = 0;
     }
     $response = new stdClass();
     $response->page = $page;
     $response->total = $total_pages;
     $response->records = $total;
     $results = $this->model_extension_banner_manager->getBannersStat($filter_grid->getFilterData());
     $i = 0;
     foreach ($results as $result) {
         $response->rows[$i]['id'] = $result['banner_id'];
         $response->rows[$i]['cell'] = array($result['name'], $result['banner_group_name'], $result['clicked'], $result['viewed'], $result['percent']);
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:siddht1,项目名称:abantecart-src,代码行数:30,代码来源:banner_manager_stat.php


示例17: main

    public function main()
    {
        //init controller data
        $this->extensions->hk_InitData($this, __FUNCTION__);
        $this->loadLanguage('banner_manager/banner_manager');
        $this->loadModel('extension/banner_manager');
        $filter_params = array('name', 'banner_group_name', 'type', 'cnt');
        $filter_grid = new AFilter(array('method' => 'post', 'grid_filter_params' => $filter_params, 'additional_filter_string' => ''));
        $total = $this->model_extension_banner_manager->getBannersStat($filter_grid->getFilterData(), 'total_only');
        if ($total > 0) {
            $total_pages = ceil($total / 10);
        } else {
            $total_pages = 0;
        }
        $response = new stdClass();
        $response->page = $page;
        $response->total = $total_pages;
        $response->records = $total;
        $results = $this->model_extension_banner_manager->getBannersStat($filter_grid->getFilterData());
        $i = 0;
        foreach ($results as $result) {
            $response->rows[$i]['id'] = $i;
            $response->rows[$i]['cell'] = array($result['name'], $result['banner_group_name'], $result['clicked'], $result['viewed'], $result['percent'], '<a class="btn_action btn_grid grid_action_expand"
												href="' . $this->html->getSecureURL('extension/banner_manager_stat/details', '&banner_id=' . $result['banner_id']) . '"
												title="' . $this->language->get('text_view') . '">' . '<img src="' . RDIR_TEMPLATE . 'image/icons/icon_grid_view.png" alt="' . $this->language->get('text_view') . '" /></a>');
            $i++;
        }
        //update controller data
        $this->extensions->hk_UpdateData($this, __FUNCTION__);
        $this->load->library('json');
        $this->response->setOutput(AJson::encode($response));
    }
开发者ID:harshzalavadiya,项目名称:fatak,代码行数:32,代码来源:banner_manager_stat.php


示例18: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('localisation/language');
     $this->loadModel('localisation/language');
     //Prepare filter config
     $filter_params = array('name', 'status');
     $grid_filter_params = array('name', 'code', 'sort_order');
     $filter_form = new AFilter(array('method' => 'get', 'filter_params' => $filter_params));
     $filter_grid = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params));
     $total = $this->model_localisation_language->getTotalLanguages(array_merge($filter_form->getFilterData(), $filter_grid->getFilterData()));
     $response = new stdClass();
     $response->page = $filter_grid->getParam('page');
     $response->total = $filter_grid->calcTotalPages($total);
     $response->records = $total;
     $results = $this->model_localisation_language->getLanguages(array_merge($filter_form->getFilterData(), $filter_grid->getFilterData()));
     $i = 0;
     foreach ($results as $result) {
         $response->rows[$i]['id'] = $result['language_id'];
         $response->rows[$i]['cell'] = array($this->html->buildInput(array('name' => 'name[' . $result['language_id'] . ']', 'value' => $result['name'])), $this->html->buildInput(array('name' => 'code[' . $result['language_id'] . ']', 'value' => $result['code'])), $this->html->buildInput(array('name' => 'sort_order[' . $result['language_id'] . ']', 'value' => $result['sort_order'])), $this->html->buildCheckbox(array('name' => 'status[' . $result['language_id'] . ']', 'value' => $result['status'], 'style' => 'btn_switch')));
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:harshzalavadiya,项目名称:fatak,代码行数:28,代码来源:language.php


示例19: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('localisation/zone');
     $this->loadModel('localisation/zone');
     $page = $this->request->post['page'];
     // get the requested page
     $limit = $this->request->post['rows'];
     // get how many rows we want to have into the grid
     $sidx = $this->request->post['sidx'];
     // get index row - i.e. user click to sort
     $sord = $this->request->post['sord'];
     // get the direction
     $this->loadModel('localisation/country');
     $template_data['countries'] = $this->model_localisation_country->getCountries();
     $countries = array('' => $this->language->get('text_select_country'));
     foreach ($template_data['countries'] as $c) {
         $countries[$c['country_id']] = $c['name'];
     }
     $search_str = '';
     //process custom search form
     $allowedSearchFilter = array('country_id');
     $search_param = array();
     foreach ($allowedSearchFilter as $filter) {
         if (isset($this->request->get[$filter]) && $this->request->get[$filter] != '') {
             $search_param[] = " z.`" . $filter . "` = '" . $this->db->escape($this->request->get[$filter]) . "' ";
         }
     }
     if (!empty($search_param)) {
         $search_str = implode(" AND ", $search_param);
     }
     $data = array('sort' => $sidx, 'order' => strtoupper($sord), 'start' => ($page - 1) * $limit, 'limit' => $limit, 'search' => $search_str);
     $total = $this->model_localisation_zone->getTotalZones($data);
     if ($total > 0) {
         $total_pages = ceil($total / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
         $data['start'] = ($page - 1) * $limit;
     }
     $response = new stdClass();
     $response->page = $page;
     $response->total = $total_pages;
     $response->records = $total;
     $results = $this->model_localisation_zone->getZones($data);
     $i = 0;
     foreach ($results as $result) {
         $response->rows[$i]['id'] = $result['zone_id'];
         $response->rows[$i]['cell'] = array($result['country'], $this->html->buildInput(array('name' => 'zone_name[' . $result['zone_id'] . '][' . $this->session->data['content_language_id'] . '][name]', 'value' => $result['name'])), $this->html->buildInput(array('name' => 'code[' . $result['zone_id'] . ']', 'value' => $result['code'])), $this->html->buildCheckbox(array('name' => 'status[' . $result['zone_id'] . ']', 'value' => $result['status'], 'style' => 'btn_switch')));
         $i++;
     }
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($response));
 }
开发者ID:InquisitiveQuail,项目名称:abantecart-src,代码行数:59,代码来源:zone.php


示例20: main

 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('catalog/category');
     $this->loadModel('catalog/category');
     $this->loadModel('catalog/product');
     $this->loadModel('tool/image');
     //Prepare filter config
     $grid_filter_params = array('name');
     $filter = new AFilter(array('method' => 'post', 'grid_filter_params' => $grid_filter_params));
     $filter_data = $filter->getFilterData();
     //Add custom params
     $filter_data['parent_id'] = isset($this->request->get['parent_id']) ? $this->request->get['parent_id'] : 0;
     $new_level = 0;
     //get all leave categories
     $leafnodes = $this->model_catalog_category->getLeafCategories();
     if ($this->request->post['nodeid']) {
         $sort = $filter_data['sort'];
         $order = $filter_data['order'];
         //reset filter to get only parent category
         $filter_data = array();
         $filter_data['sort'] = $sort;
         $filter_data['order'] = $order;
         $filter_data['parent_id'] = (int) $this->request->post['nodeid'];
         $new_level = (int) $this->request->post["n_level"] + 1;
     }
     $total = $this->model_catalog_category->getTotalCategories($filter_data);
     $response = new stdClass();
     $response->page = $filter->getParam('page');
     $response->total = $filter->calcTotalPages($total);
     $response->records = $total;
     $response->userdata = new stdClass();
     $results = $this->model_catalog_category->getCategoriesData($filter_data);
     $i = 0;
     $resource = new AResource('image');
     foreach ($results as $resul 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AMA_DataHandler类代码示例发布时间:2022-05-23
下一篇:
PHP AJXP_XMLWriter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap