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


PHP redirect_back函数代码示例

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


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

示例1: delete

 public function delete($id)
 {
     // Kijken of user ingelogd is en admin is
     $user = $this->authex->getUserInfo();
     if ($user == null) {
         redirect('home/login');
     }
     if ($user->niveauId != 1) {
         redirect('home/login');
     }
     //Controleren of er een id is, anders redirecten. Gebruiker kan nooit hier op komen zonder ID.
     //Als er geen ID is, heeft hij de url zelf zo ingetypd.
     if ($id == null) {
         redirect('manage/hotels');
     } else {
         if (!is_numeric($id)) {
             redirect('manage/hotels');
         }
     }
     //Models laden
     $this->load->model('conferentiedag_model');
     $this->load->model('sessie_model');
     $this->load->model('activiteit_model');
     //Kijken of er geen sessies meer aan gebonden zijn
     $sessies = $this->sessie_model->getSessionsConferenceDay($id);
     $activities = $this->activiteit_model->getAllActivitiesConference($id);
     //Kijken of er sessies/activities aan gebonden zijn
     if (count($sessies) == 0 && count($activities) == 0) {
         $this->conferentiedag_model->delete($id);
     }
     //Redirect terug naar current pagina
     redirect_back();
 }
开发者ID:semihovic,项目名称:Project,代码行数:33,代码来源:schedule.php

示例2: mark_all

 public function mark_all($user_reff, $user_reff_id)
 {
     $this->auth->login_scurity();
     $this->model_notification->mark_all($user_reff, $user_reff_id);
     set_flashdata("notif", alert("Success mark as read"));
     redirect_back();
 }
开发者ID:ridwanskaterock,项目名称:coc-ri-comunnity,代码行数:7,代码来源:Notification.php

示例3: enroll

 function enroll()
 {
     $this->form_validation->set_rules('user_skype', 'Skype ID', 'trim|required');
     $this->form_validation->set_rules('user_contact', 'Contact #', 'trim|required');
     if ($this->form_validation->run() == false) {
         $this->session->set_flashdata('msg', '<div class="alert alert-danger text-center">Error.</div>');
         redirect_back();
     } else {
         $course = $this->input->post('course');
         $id = $this->session->userdata('id');
         $username = $this->session->userdata('username');
         $date = $this->input->post('date');
         $time = $this->input->post('time');
         $hours = $this->input->post('hours');
         $price = $this->input->post('price');
         $user_skype = $this->input->post('user_skype');
         $user_contact = $this->input->post('user_contact');
         $course_no = $this->input->post('course_no');
         $enroll = array('course' => $course, 'username' => $username, 'date' => $date, 'TIME_START' => $time, 'hours' => $hours, 'price' => $price, 'course_no' => $course_no, 'status' => 'Enrolled');
         $prof = array('username' => $username, 'USER_SKYPE' => $user_skype, 'USER_CONTACT' => $user_contact);
         $this->Schedules_model->enroll($enroll, $prof);
         $this->session->set_flashdata('msg', '<div class="alert alert-success text-center">Schedule created. We will send you an email for confirmation. </div>');
         redirect('student/profile');
     }
 }
开发者ID:jeremiahC,项目名称:ci2,代码行数:25,代码来源:Course_enroll.php

示例4: _edit

 public function _edit($talk_id, $title)
 {
     $this->subtitle($title)->load->library('form')->add_rules('talks', array('title' => $title))->add_submit($this('edit'))->add_back('admin/talks.html');
     if ($this->form->is_valid($post)) {
         $this->model()->edit_talk($talk_id, $post['title']);
         //add_alert('success', $this('edit_success_message'));
         redirect_back('admin/talks.html');
     }
     return new Panel(array('title' => $this('edit_talk'), 'icon' => 'fa-comment-o', 'content' => $this->form->display()));
 }
开发者ID:nsystem1,项目名称:neofrag-cms,代码行数:10,代码来源:admin.php

示例5: _edit

 public function _edit($page_id, $name, $published, $title, $subtitle, $content, $tab)
 {
     $this->subtitle($title)->load->library('form')->add_rules('pages', array('title' => $title, 'subtitle' => $subtitle, 'name' => $name, 'content' => $content, 'published' => $published))->add_submit($this('edit'))->add_back('admin/pages.html');
     if ($this->form->is_valid($post)) {
         $this->model()->edit_page($page_id, $post['name'], $post['title'], in_array('on', $post['published']), $post['subtitle'], $post['content'], $this->config->lang);
         //add_alert('success', $this('edit_success_message'));
         redirect_back('admin/pages.html');
     }
     return new Panel(array('title' => $this('edit_page'), 'icon' => 'fa-align-left', 'content' => $this->form->display()));
 }
开发者ID:agreements,项目名称:neofrag-cms,代码行数:10,代码来源:admin.php

示例6: _edit

 public function _edit($game_id, $parent_id, $image_id, $icon_id, $title)
 {
     $this->title($this('games_maps'))->subtitle($this('edit_game'))->load->library('form')->add_rules('games', array('games' => $this->model()->get_games_list($game_id), 'title' => $title, 'parent_id' => $parent_id, 'image_id' => $image_id, 'icon_id' => $icon_id))->add_submit($this('edit'))->add_back('admin/games.html');
     if ($this->form->is_valid($post)) {
         $this->model()->edit_game($game_id, $post['title'], $post['parent_id'], $post['image'], $post['icon']);
         //add_alert('success', $this('edit_game_message'));
         redirect_back('admin/games.html');
     }
     $game = $this->form->display();
     return new Panel(array('title' => $this('edit_game_title', $title), 'icon' => 'fa-gamepad', 'content' => $game));
 }
开发者ID:nsystem1,项目名称:neofrag-cms,代码行数:11,代码来源:admin.php

示例7: add_new_people

 function add_new_people($p_id = false)
 {
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
     $this->form_validation->set_rules('first_name', 'Name', 'required|min_length[1]|max_length[100]');
     $this->form_validation->set_rules('last_name', 'Name', 'required|min_length[1]|max_length[100]');
     $this->form_validation->set_rules('company_name', 'company name', 'min_length[1]|max_length[100]');
     $this->form_validation->set_rules('mobile', 'Mobile', 'regex_match[/^[0-9]{10}$/]');
     $this->form_validation->set_rules('email', 'Email', 'valid_email');
     $this->form_validation->set_rules('address1', 'Address', 'required|min_length[1]|max_length[200]');
     $this->form_validation->set_rules('city', 'city', 'required');
     if ($this->form_validation->run() == FALSE) {
         set_message(validation_errors());
         redirect_back();
         return 0;
     } else {
         $first_name = strtoupper($this->input->post('first_name'));
         $last_name = strtoupper($this->input->post('last_name'));
         $company_name = strtoupper($this->input->post('company_name'));
         $email = $this->input->post('email');
         $sec_email = $this->input->post('sec_email');
         $mobile = $this->input->post('mobile');
         $phone = $this->input->post('phone');
         $website = $this->input->post('website');
         $skype = $this->input->post('skype');
         $industry = $this->input->post('industry');
         $address1 = $this->input->post('address1');
         $address2 = $this->input->post('address2');
         $city = $this->input->post('city');
         $state = $this->input->post('state');
         $country = $this->input->post('country');
         $note = $this->input->post('note');
         if ($this->session->userdata('role') != 'admin') {
             $companyid = $this->session->userdata('companyid');
         } else {
             $companyid = $this->input->post('companyid');
         }
         $people_data = array('company_name' => $company_name, 'first_name' => $first_name, 'last_name' => $last_name, 'email' => $email, 'sec_email' => $sec_email, 'mobile' => $mobile, 'phone' => $phone, 'website' => $website, 'skype' => $skype, 'industry' => $industry, 'address1' => $address1, 'address2' => $address2, 'city' => $city, 'state' => $state, 'country' => $country, 'note' => $note);
         if ($p_id) {
             $updated_at = date('Y-m-d H:i:s');
             $people_data['updated_at'] = $updated_at;
             $this->db->where('people_id', $p_id);
             $res = $this->db->update('people', $people_data);
             return $res;
         } else {
             $created_at = date('Y-m-d H:i:s');
             $people_data['created_at'] = $created_at;
             $this->db->insert('people', $people_data);
             $people_id = $this->db->insert_id();
             return $people_id;
         }
     }
 }
开发者ID:shripadv,项目名称:leadmgt,代码行数:53,代码来源:people_model.php

示例8: destroy

 public function destroy($id)
 {
     $cart_items = $this->session->userdata('cart_items');
     foreach ($cart_items as $key => $item) {
         if ($item == $id) {
             unset($cart_items[$key]);
             break;
         }
     }
     $this->session->set_userdata('cart_items', $cart_items);
     redirect_back();
 }
开发者ID:7urkm3n,项目名称:eCommerce_PHP,代码行数:12,代码来源:carts.php

示例9: insert_address

 public function insert_address()
 {
     $user_id = $this->session->userdata('user_session')['user_id'];
     if ($this->form_validation->run() == FALSE) {
         $this->session->set_flashdata('errors', validation_errors());
         redirect_back();
     } else {
         $this->order->update($user_id, $this->input->post());
         $this->session->set_flashdata('success', 'Payment success!');
         redirect('/products');
     }
 }
开发者ID:7urkm3n,项目名称:eCommerce_PHP,代码行数:12,代码来源:orders.php

示例10: do_delete

 function do_delete($id)
 {
     if (isPost()) {
         $comment = $this->get('Comment', $id);
         if ($comment && $comment->canEdit($this->currentUser)) {
             $comment->entry->get();
             $comment->delete();
         } else {
             $this->show_error('Permission denied');
         }
         redirect_back(url_to($comment->entry, 'show'));
     }
 }
开发者ID:broofa,项目名称:socipedia,代码行数:13,代码来源:comments.php

示例11: add_place

 function add_place()
 {
     $data = $this->input->post();
     $time = time();
     /* var_dump(date("Y-m-d",$time));
     		echo "<pre>";
     		//var_dump($data);
     		echo "</pre>"; */
     $data1 = array("plc_id" => $data['gid'], "name" => $data['name'], "proportion" => $data['place_area'] . "平方米", "price" => $data['place_price'] . "元", "content" => $data['content'], "created" => $time);
     /* echo "<pre>";
     		var_dump($data1);
     		echo "</pre>"; */
     /**
      * xingde.wei
      * 获取汉字拼音
      */
     // 		$this->load->library('chinesespell');
     // 		$hanzi = iconv("UTF-8","GBK//IGNORE",$data['name']);
     // 		$hanzi = $this->chinesespell->getFullSpell($hanzi);
     // 		$data1['hanzi'] = $hanzi;
     $this->load->model('place_room_model');
     $pr_id = $this->place_room_model->insert($data1);
     if (!empty($pr_id) && isset($pr_id)) {
         $this->load->library('upload2');
         $filedir = 'place_pic/' . date('Ym', time()) . '/' . date('d', time()) . '/';
         $upload_obj = 'upload/';
         $this->upload2->field = 'image';
         $this->upload2->set_dir($upload_obj, $filedir);
         $fs = $this->upload2->execute();
         //var_dump($fs);
         if (!empty($fs)) {
             foreach ($fs as $item) {
                 $pic_file = $upload_obj . $filedir . $item['name'];
                 $data2 = array("room_id" => $pr_id, "pic" => $pic_file, "time" => $time);
                 $this->load->model('place_image_model');
                 $pi_id = $this->place_image_model->insert($data2);
                 if (!empty($pi_id) && isset($pi_id)) {
                     redirect_back();
                 } else {
                     show_error("添加失败!");
                 }
             }
         }
     }
 }
开发者ID:aidear,项目名称:100event,代码行数:45,代码来源:place.php

示例12: create

 public function create()
 {
     $this->auth->allow(array('member'));
     $this->form_validation->set_rules('base_name', 'Base Name', 'required|min_length[5]');
     if ($this->form_validation->run()) {
         $base_name = $this->input->post('base_name');
         $base_desc = $this->input->post('base_desc');
         $base_town_hall = $this->input->post('base_town_hall');
         $data = array('base_name' => $base_name, 'base_desc' => $base_desc, 'base_town_hall' => $base_town_hall, 'base_created_date' => now(), 'base_created_by' => user_member('iduser'));
         $config['upload_path'] = FCPATH . 'asset/base-image/';
         $config['allowed_types'] = 'gif|jpg|png';
         $config['max_size'] = '999999';
         $config['max_width'] = '999999';
         $config['max_height'] = '999999';
         $config['filename'] = 'tes.jpg';
         $this->load->library('upload', $config);
         if ($_FILES and $_FILES['base_image']['name']) {
             if (!$this->upload->do_upload("base_image")) {
                 $error = $this->upload->display_errors();
                 set_flashdata("notif", $error);
                 redirect_back();
             } else {
                 $data_upload = $this->upload->data();
                 $data['base_image'] = $data_upload['file_name'];
                 set_flashdata("notif", 'Success share base');
             }
         } else {
             set_flashdata("notif", 'Please choose once image.');
             redirect_back();
         }
         $idbase = $this->model_base->store($data);
         redirect('base/detail/' . $idbase);
     }
     $data = array();
     $this->template->render('front/base/create-base', $data);
 }
开发者ID:ridwanskaterock,项目名称:coc-ri-comunnity,代码行数:36,代码来源:Base.php

示例13: save_task

 function save_task()
 {
     //dsm($this->input->post()); die;
     $project_task_id = $this->input->post('project_task_id');
     $this->load->model('lead_model');
     $this->load->model('user_model');
     $this->load->model('project_model');
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
     $this->form_validation->set_rules('project_id', 'Project', 'required');
     $this->form_validation->set_rules('employee_id', 'Employee', 'required');
     $this->form_validation->set_rules('project_task_priority', 'Task Priority', 'required');
     $this->form_validation->set_rules('project_task_label', 'Task Label', 'required');
     $this->form_validation->set_rules('project_status_id', 'project Status', 'required');
     $this->form_validation->set_rules('task_status', 'Task Status', 'required');
     $this->form_validation->set_rules('project_task_title', 'Task Title', 'required');
     $this->form_validation->set_rules('project_task_description', 'Task Description', 'required');
     if ($this->form_validation->run() == FALSE) {
         set_message(validation_errors());
         redirect_back();
         return 0;
     } else {
         $project_id = $this->input->post('project_id');
         $employee_id = $this->input->post('employee_id');
         $project_task_priority = $this->input->post('project_task_priority');
         $project_task_label = $this->input->post('project_task_label');
         $project_status_id = $this->input->post('project_status_id');
         $task_status = $this->input->post('task_status');
         $project_task_title = $this->input->post('project_task_title');
         $project_task_progress = $this->input->post('project_task_progress');
         $project_task_estimate = $this->input->post('project_task_estimate');
         $start_date = $this->input->post('start_date');
         $due_date = $this->input->post('due_date');
         $project_task_description = $this->input->post('project_task_description');
         $task_data = array('project_id' => $project_id, 'employee_id' => $employee_id, 'project_task_priority' => $project_task_priority, 'project_task_label' => $project_task_label, 'project_status_id' => $project_status_id, 'task_status' => $task_status, 'project_task_title' => $project_task_title, 'project_task_progress' => $project_task_progress, 'project_task_estimate' => $project_task_estimate, 'start_date' => $start_date, 'due_date' => $due_date, 'project_task_description' => $project_task_description, 'created_by' => $this->session->userdata('uid'));
         if ($project_task_id) {
             $task_data['updated_at'] = date('Y-m-d H:i:s');
             $res = $this->project_model->update_project_task($task_data, $project_task_id);
             if ($res) {
                 set_message('Task Edited Successfully', 'success');
                 redirect_back();
             } else {
                 set_message('Something went wrong');
                 redirect_back();
             }
         } else {
             $task_data['created_at'] = date('Y-m-d H:i:s');
             $res = $this->project_model->add_project_task($task_data);
             if ($res) {
                 set_message('Task Added Successfully', 'success');
                 redirect_back();
             } else {
                 set_message('Something went wrong');
                 redirect_back();
             }
         }
     }
 }
开发者ID:shripadv,项目名称:leadmgt,代码行数:58,代码来源:project.php

示例14: _roles_edit

 public function _roles_edit($role_id, $title)
 {
     $this->subtitle($this('role_', $title))->load->library('form')->add_rules('roles', array('title' => $title))->add_submit($this('edit'))->add_back('admin/teams.html');
     if ($this->form->is_valid($post)) {
         $this->model('roles')->edit_role($role_id, $post['title']);
         //add_alert('success', $this('edit_role_success_message'));
         redirect_back('admin/teams.html');
     }
     return new Panel(array('title' => $this('edit_role'), 'icon' => 'fa-sitemap', 'content' => $this->form->display()));
 }
开发者ID:nsystem1,项目名称:neofrag-cms,代码行数:10,代码来源:admin.php

示例15: do_logout

 function do_logout()
 {
     $this->session->sess_destroy();
     redirect_back(url_to());
 }
开发者ID:broofa,项目名称:socipedia,代码行数:5,代码来源:users.php


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