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


PHP site::next_flow方法代碼示例

本文整理匯總了PHP中site::next_flow方法的典型用法代碼示例。如果您正苦於以下問題:PHP site::next_flow方法的具體用法?PHP site::next_flow怎麽用?PHP site::next_flow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在site的用法示例。


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

示例1: add

 /**
  * 添加新商戶
  */
 public function add()
 {
     /* 隻允許root和管理員執行 */
     if (!role::is_root()) {
         role::check('manage_merchant');
         $manager = Mymanager::instance($this->manager_id)->get();
         if (!$manager['is_admin']) {
             remind::set(Kohana::lang('o_manage.only_admin_do'), 'manage/manager');
         }
     }
     $next_flow = site::next_flow(self::CURRENT_FLOW);
     if ($_POST) {
         //echo "<pre>";print_r($this->input->post());die();
         $role_id = intval($this->input->post('role_id'));
         $submit_target = intval($this->input->post('submit_target'));
         //標簽過濾
         tool::filter_strip_tags($_POST);
         $password1 = $this->input->post('password1');
         $password2 = $this->input->post('password2');
         $username = $this->input->post('username');
         $email = $this->input->post('email');
         $manager = Mymanager::instance()->get_by_username($username);
         if ($manager['id']) {
             remind::set(Kohana::lang('o_manage.name_has_exist'), 'manage/manager/add');
         }
         $manager = Mymanager::instance()->get_by_email($email);
         if ($manager['id']) {
             remind::set(Kohana::lang('o_manage.email_has_exist'), 'manage/manager/add');
         }
         //驗證兩次密碼是否相同
         if ($password1 != $password2) {
             remind::set(Kohana::lang('o_manage.two_pwd_not_valid'), 'manage/manager/add');
         } else {
             $_POST['password'] = $password1;
         }
         $_POST['parent_id'] = $this->manager_id;
         if (Mymanager::instance()->add($_POST)) {
             //判斷添加成功去向
             switch ($submit_target) {
                 case 1:
                     remind::set(Kohana::lang('o_global.add_success'), 'manage/manager/add', 'success');
                 case 2:
                     remind::set(Kohana::lang('o_global.add_success_into') . $next_flow['name'], $next_flow['url'], 'success');
                 case 3:
                 default:
                     if ($role_id == 0) {
                         $id = Mymanager::instance()->get('id');
                         remind::set(Kohana::lang('o_global.add_success'), 'manage/manager/rule/' . $id, 'success');
                     }
                     remind::set(Kohana::lang('o_global.add_success'), 'manage/manager', 'success');
             }
         } else {
             $error = Mysite::instance()->error();
             remind::set(Kohana::lang('o_global.add_error') . $error, 'manage/manager/add');
         }
     }
     $where = array();
     $where['type'] = 0;
     $where['active'] = 1;
     //zhu add
     //在添加商家帳號時候隻能顯示一級的用戶級別
     $where['level_depth'] = 1;
     $roles = Myrole::instance()->roles($where);
     $this->template->content = new View("manage/manager_add");
     $this->template->content->roles = $roles;
     //show next flow button
     $this->template->content->next_flow_btn = site::next_flow_btn(self::CURRENT_FLOW);
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:71,代碼來源:manager.php


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