當前位置: 首頁>>代碼示例>>PHP>>正文


PHP remind類代碼示例

本文整理匯總了PHP中remind的典型用法代碼示例。如果您正苦於以下問題:PHP remind類的具體用法?PHP remind怎麽用?PHP remind使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了remind類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: edit

 /**
  * 編輯頁麵分類
  */
 public function edit()
 {
     $id = $this->input->get('id');
     if (!$id) {
         remind::set(Kohana::lang('o_global.bad_request'), 'site/doc_category');
     }
     $data = Mydoc_category::instance($id)->get();
     if ($_POST) {
         $category_name = $this->input->post('category_name');
         $parent_id = $this->input->post('parent_id');
         if (empty($category_name)) {
             remind::set(Kohana::lang('o_site.doc_category_cannot_null'));
         } else {
             if ($parent_id == $id) {
                 remind::set(Kohana::lang('o_site.doc_parent_category_cannot_self'));
             } else {
                 if (Mydoc_category::instance()->name_exist($category_name, $id)) {
                     remind::set(Kohana::lang('o_site.doc_category_has_exist'));
                 } else {
                     if (Mydoc_category::instance($id)->edit($_POST)) {
                         remind::set(Kohana::lang('o_global.update_success'), 'site/doc_category', 'success');
                     } else {
                         remind::set(Kohana::lang('o_global.update_error') . Mydoc_category::instance($id)->error());
                     }
                 }
             }
         }
         $data = array_merge($data, $_POST);
     }
     $doc_categories = Mydoc_category::instance()->doc_categories(0);
     $this->template->content = new View("site/doc_category_edit");
     $this->template->content->data = $data;
     $this->template->content->doc_categories = $doc_categories;
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:37,代碼來源:doc_category.php

示例2: is_allowed

 public static function is_allowed($permission = 'default', $site_id = 0, $type = NULL)
 {
     $verify = true;
     $site_ids = role::get_site_ids($type);
     //超級管理員root不需要檢查權限 zhu modify
     if (role::is_root()) {
         $verify = true;
     } else {
         if ($site_id > 0 && !in_array($site_id, $site_ids)) {
             $verify = false;
         }
         $acl = Session::instance()->get(self::$acl_tag);
         if ($acl) {
             $acl = unserialize($acl);
         } else {
             $acl = self::acl_init();
         }
         $manager = role::get_manager();
         $verify = $acl->is_allowed($manager["username"], $permission);
     }
     //驗證操作
     if ($verify) {
         return $site_ids;
     } else {
         if (request::is_ajax()) {
             $return_struct = array('status' => 0, 'code' => 501, 'msg' => Kohana::lang('o_global.access_denied'), 'content' => array());
             die(json_encode($return_struct));
         } else {
             $referrer = tool::referrer_url();
             remind::set('權限不足', $referrer, 'error');
         }
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:33,代碼來源:acltool.php

示例3: index

 public function index()
 {
     $route_data = Myroute::instance()->get();
     if ($_POST) {
         $site_next_flow = site::site_next_flow($this->current_flow);
         $submit_target = intval($this->input->post('submit_target'));
         if (Myroute::instance()->edit($_POST)) {
             //判斷添加成功去向
             switch ($submit_target) {
                 case 2:
                     remind::set(Kohana::lang('o_global.update_success'), $site_next_flow['url'], 'success');
                 default:
                     remind::set(Kohana::lang('o_global.update_success'), 'site/route', 'success');
             }
         } else {
             remind::set(Kohana::lang('o_global.update_error'), 'site/route');
         }
     }
     $this->template->content = new View("site/route_edit");
     $this->template->content->is_modify = 0;
     if ($this->manager_is_admin == 1) {
         $this->template->content->is_modify = 1;
     }
     $this->template->content->data = $route_data;
     $this->template->content->site_id = $this->site_id;
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:26,代碼來源:route.php

示例4: index

 public function index()
 {
     $site_id = 1;
     $theme_id = 2;
     $server = Storage_server::instance();
     $filename = $this->input->get('filename');
     $theme_views = $server->get_site_themes($site_id, $theme_id, 'views');
     $theme_js = $server->get_site_themes($site_id, $theme_id, 'js');
     $theme_css = $server->get_site_themes($site_id, $theme_id, 'css');
     if (in_array($filename, $theme_views)) {
         $type = 'views';
     } else {
         if (in_array($filename, $theme_js)) {
             $type = 'js';
         } else {
             if (in_array($filename, $theme_css)) {
                 $type = 'css';
             } else {
                 $type = 'views';
                 $filename = 'index.php';
             }
         }
     }
     if ($_POST) {
         $file = $_POST['file'];
         $server->cache_site_theme($site_id, $theme_id, $type, $filename, $file);
         remind::set('add ' . $_POST['file'], url::current(TRUE));
     }
     $code = $server->get_site_theme($site_id, $theme_id, $type, $filename);
     $this->template->content = new View("site/theme_edit");
     $this->template->content->theme_files = array_merge($theme_views, $theme_js, $theme_css);
     $this->template->content->data = $code;
     $this->template->content->filename = $filename;
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:34,代碼來源:theme.php

示例5: index

 /**
  * 物流對應的地區列表
  */
 function index($id)
 {
     if (!$id) {
         remind::set(Kohana::lang('o_global.bad_request'), request::referrer(), 'error');
     }
     $deliverycn_service = DeliverycnService::get_instance();
     $deliverycn_region_service = Deliverycn_regionService::get_instance();
     //驗證此條物流
     $data = $deliverycn_service->get($id);
     if (!$data['id']) {
         remind::set(Kohana::lang('o_global.access_denied'), request::referrer(), 'error');
     }
     //初始化請求結構體
     $query_struct = array('where' => array('deliverycn_id' => $id), 'like' => array(), 'orderby' => array('position' => 'ASC', 'id' => 'ASC'), 'limit' => array('per_page' => 2000, 'offset' => 0));
     // 每頁條目數
     controller_tool::request_per_page($query_struct, $request_data);
     $count = $deliverycn_region_service->query_count($query_struct);
     // 模板輸出 分頁
     $this->pagination = new Pagination(array('total_items' => $count, 'items_per_page' => $query_struct['limit']['per_page']));
     $query_struct['limit']['offset'] = $this->pagination->sql_offset;
     $query_struct['limit']['page'] = $this->pagination->current_page;
     //調用列表
     $deliverycn_regions = $deliverycn_region_service->get_delivery_regions_by_position($query_struct);
     $this->template->content = new View("site/deliverycn/region");
     $this->template->content->deliverycn_regions = $deliverycn_regions;
     $this->template->content->data = $data;
     $this->template->content->regions = $deliverycn_region_service->get_regions();
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:31,代碼來源:deliverycn_region.php

示例6: do_active

 /**
  * 改變狀態
  */
 function do_active($id)
 {
     //權限驗證
     role::check('user_charge');
     if (!$id) {
         remind::set(Kohana::lang('o_global.bad_request'), 'user/user_charge');
     }
     $db = Database::instance();
     $data = array_shift($db->query('SELECT * FROM user_charge_order WHERE id=' . $id)->result_array(false));
     if ($data['id'] <= 0 || $data['status'] > 0) {
         remind::set(Kohana::lang('o_global.bad_request'), 'user/user_charge');
     }
     $logodata = array();
     $logodata['manager_id'] = $this->manager_id;
     $logodata['ip'] = tool::get_str_ip();
     $logodata['user_log_type'] = 27;
     $logodata['method'] = __CLASS__ . '::' . __METHOD__ . '()';
     $logodata['memo'] = "充值訂單號:" . $data['order_num'] . ", 購買拍點數:" . $data['price'] . ", 充值金額:" . $data['money'];
     $sql = "UPDATE user_charge_order SET status=1 WHERE id='" . $id . "' ";
     if ($db->query($sql)) {
         //充值用戶Money
         $sql_reward = "UPDATE users \r\n                            SET user_money = user_money+" . $data['price'] . "\r\n                            WHERE id='" . $data['user_id'] . "'\r\n                          ";
         $db->query($sql_reward);
         //操作log
         ulog::add($logodata);
         remind::set(Kohana::lang('o_global.update_success'), 'user/user_charge', 'success');
     } else {
         //操作log
         ulog::add($logodata, 1);
         remind::set(Kohana::lang('o_global.update_error'), 'user/user_charge', 'error');
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:35,代碼來源:user_charge.php

示例7: add

 public function add()
 {
     if ($_POST) {
         //標簽過濾
         tool::filter_strip_tags($_POST, array('content'));
         $site_next_flow = site::site_next_flow($this->current_flow);
         $submit_target = intval($this->input->post('submit_target'));
         $faq = Myfaq::instance();
         if ($faq->add($_POST)) {
             //判斷添加成功去向
             switch ($submit_target) {
                 case 1:
                     remind::set(Kohana::lang('o_global.add_success'), 'site/faq/add', 'success');
                 case 2:
                     remind::set(Kohana::lang('o_global.add_success'), $site_next_flow['url'], 'success');
                 default:
                     remind::set(Kohana::lang('o_global.add_success'), 'site/faq', 'success');
             }
         } else {
             remind::set(Kohana::lang('o_global.add_error'), 'site/faq/add');
         }
     }
     $this->template->content = new View("site/faq_add");
     $this->template->content->title = "site faq add";
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:25,代碼來源:faq.php

示例8: delete

 /**
  * delete mail_category
  */
 public function delete($id)
 {
     if (Mymail_category::instance($id)->delete()) {
         remind::set(Kohana::lang('o_global.delete_success'), 'manage/mail_category', 'success');
     } else {
         $error = Mymail_category::instance($id)->error();
         remind::set(Kohana::lang('o_global.delete_error') . $error, 'manage/mail_category');
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:12,代碼來源:mail_category.php

示例9: __construct

 /**
  * Template loading and setup routine.
  */
 public function __construct()
 {
     parent::__construct();
     // checke request is ajax
     $this->ajax_request = request::is_ajax();
     // Load the template
     $this->template = new View($this->template);
     if ($this->auto_render == TRUE) {
         Event::add('system.post_controller', array($this, '_render'));
     }
     /**
      * 判斷用戶登錄情況
      */
     if (isset($_REQUEST['session_id'])) {
         $session = Session::instance($_REQUEST['session_id']);
         $manager = role::get_manager($_REQUEST['session_id']);
     } else {
         $session = Session::instance();
         $manager = role::get_manager();
     }
     /* 當前請求的URL */
     $current_url = urlencode(url::current(TRUE));
     //zhu
     if (isset($manager['id'])) {
         $active_time = $session->get('Opococ_manager_active_time');
         //用戶最後操作時間
         $session->set('Opococ_manager_active_time', time());
         //用戶最後操作時間
         $login_ip = $session->get('Opococ_manager_login_ip');
         //用戶登錄的IP
         //操作超時
         if (time() - $active_time > Kohana::config('login.time_out')) {
             $session->delete('Opococ_manager');
             $session->delete('Opococ_manager_active_time');
             $session->delete('Opococ_manager_login_ip');
             remind::set(Kohana::lang('o_global.first_login'), 'login?request_url=' . $current_url);
         }
         //用戶IP(登錄狀態更換IP需要重新登錄)
         $ip = tool::get_long_ip();
         if ($ip != $login_ip) {
             remind::set(Kohana::lang('o_global.login_again'), 'login?request_url=' . $current_url);
         }
         $this->manager = $manager;
         $this->manager_id = $manager['id'];
         $this->manager_name = $manager['name'];
         $this->manager_is_admin = role::is_root($manager['name']) ? 1 : $manager['is_admin'];
         $this->template->manager_data = $manager;
     } else {
         remind::set(Kohana::lang('o_global.first_login'), 'login?request_url=' . $current_url);
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:54,代碼來源:template.php

示例10: delete

 /**
  * author zhubin
  * 刪除用戶地址
  * @param int 
  */
 public function delete()
 {
     //權限驗證
     role::check('user_edit');
     $address_info = $this->input->get();
     if (empty($address_info) || !isset($address_info['address_id']) || !isset($address_info['user_id'])) {
         remind::set(Kohana::lang('o_global.bad_request'), 'user/address');
     }
     if (Myaddress::instance()->delete($address_info['address_id'])) {
         remind::set(Kohana::lang('o_user.delete_user_address_success'), 'user/user/edit/' . $address_info['user_id'], 'success');
     } else {
         remind::set(Kohana::lang('o_user.delete_user_address_failed'), 'user/user/edit/' . $address_info['user_id'], 'error');
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:19,代碼來源:address.php

示例11: delete

 public function delete($templateId)
 {
     //權限檢查 得到所有可管理站點ID列表
     role::check('distribution_system_manage');
     $templateDao = Superplaner_Realtime_contract_template::instance();
     $template = $templateDao->get_by_id($templateId);
     if ($template == null) {
         remind::set(Kohana::lang('o_contract.contract_not_exists'), request::referrer(), 'error');
     }
     if (Superplaner_Realtime_contract_template::instance($templateId)->delete()) {
         remind::set(Kohana::lang('o_global.delete_success'), request::referrer(), 'success');
     } else {
         remind::set(Kohana::lang('o_global.delete_error'), request::referrer(), 'error');
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:15,代碼來源:realtime_contract_template.php

示例12: delete

 public function delete($cardTypeId)
 {
     //權限檢查 得到所有可管理站點ID列表
     role::check('card_system_manage');
     $cardType = $this->cardTypeDao->get_by_id($cardTypeId);
     if ($cardType == null) {
         remind::set(Kohana::lang('o_global.bad_request'), request::referrer(), 'error');
         return;
     }
     if ($this->cardTypeDao->delete($cardTypeId)) {
         remind::set(Kohana::lang('o_global.delete_success'), 'card/card_type', 'success');
         return;
     } else {
         remind::set(Kohana::lang('o_global.delete_error'), request::referrer(), 'error');
         return;
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:17,代碼來源:card_type.php

示例13: add

 /**
  * 添加新支付類型
  */
 function add()
 {
     //權限驗證
     role::check('manage_payment_type');
     if ($_POST) {
         //標簽過濾
         tool::filter_strip_tags($_POST);
         $payment_type = Mypayment_type::instance();
         if ($payment_type->add($_POST)) {
             remind::set(Kohana::lang('o_global.add_success'), 'manage/payment_type', 'success');
         } else {
             $errors = $payment_type->errors();
             remind::set(Kohana::lang('o_global.add_error'), 'manage/payment_type/add', 'error');
         }
     }
     $this->template->content = new View("manage/payment_type_add");
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:20,代碼來源:payment_type.php

示例14: check

 /**
  * 判斷用戶的操作權限
  *
  * @param <String> $model_flag
  * @return <type>
  */
 public static function check($model_flag = 'default')
 {
     //zhu modify
     $verify = self::verify($model_flag);
     //驗證操作
     if ($verify) {
         return $verify;
     } else {
         if (request::is_ajax()) {
             $return_struct = array('status' => 0, 'code' => 501, 'msg' => Kohana::lang('o_global.access_denied'), 'content' => array());
             die(json_encode($return_struct));
         } else {
             $referrer = tool::referrer_url();
             remind::set('權限不足', $referrer, 'error');
         }
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:23,代碼來源:role.php

示例15: queue_add

 public function queue_add($site)
 {
     if (empty($site)) {
         remind::set('域名或者IP出錯,請檢查下您的輸入!', 'site/scan/add');
     } else {
         if (filter_var($site, FILTER_VALIDATE_IP)) {
             $ip = $site;
         } else {
             if (filter_var(gethostbyname($site), FILTER_VALIDATE_IP)) {
                 $ip = gethostbyname($site);
             } else {
                 remind::set('域名或者IP出錯,請檢查下您的輸入!', 'site/scan/add');
             }
         }
     }
     $sign = $this->generate_code('queue', $ip);
     return $this->client->queue_add($ip, $sign, $this->ip);
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:18,代碼來源:Nessus_system.php


注:本文中的remind類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。