本文整理汇总了PHP中redirect_admin函数的典型用法代码示例。如果您正苦于以下问题:PHP redirect_admin函数的具体用法?PHP redirect_admin怎么用?PHP redirect_admin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了redirect_admin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editmetas
public function editmetas($param = '')
{
if ($this->input->post()) {
$this->form_validation->set_rules('url', 'URL', 'required|trim|xss_clean');
$this->form_validation->set_rules('name', 'Name', 'required|trim|xss_clean');
$this->form_validation->set_rules('title', 'Title', 'required|trim|xss_clean');
$this->form_validation->set_rules('description', 'Meta Description', 'required|trim|xss_clean');
$this->form_validation->set_rules('keyword', 'Meta Keyword', 'required|trim|xss_clean');
if ($this->form_validation->run()) {
$id = $this->uri->segment(4, 0);
$updateData = array();
$updateData['url'] = $this->input->post('url');
$updateData['name'] = $this->input->post('name');
$updateData['title'] = $this->input->post('title');
$updateData['meta_description'] = $this->input->post('description');
$updateData['meta_keyword'] = $this->input->post('keyword');
$condition = array('id' => $id);
$this->Common_model->updateTableData('metas', $id, $condition, $updateData);
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Location updated successfully.')));
redirect_admin('managemetas');
}
} else {
echo 'error';
}
$conditions = array("metas.id" => $param);
$data['metas'] = $this->Common_model->getTableData('metas', $conditions)->row();
$conditions = array("metas.id" => $param);
$data['message_element'] = "administrator/managemetas/editmanagemetas";
$this->load->view('administrator/admin_template', $data);
}
示例2: editpopup
public function editpopup($param = '')
{
if ($this->input->post()) {
$id = $this->uri->segment(4, 0);
$updateData = array();
$updateData['name'] = $this->input->post('page_name');
$updateData['content'] = $this->input->post('page_content');
$updateData['status'] = $this->input->post('page_status');
$condition = array('id' => $id);
$this->Common_model->updateTableData('page_popup', $id, $condition, $updateData);
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', 'Updated successfully.'));
redirect_admin('popup');
}
$conditions = array("page_popup.id" => $param);
$data['popups'] = $this->Common_model->getTableData('page_popup', $conditions)->row();
$conditions = array("page_popup.id" => $param);
$data['message_element'] = "administrator/editpopup";
$this->load->view('administrator/admin_template', $data);
}
示例3: index
public function index()
{
$this->form_validation->set_error_delimiters($this->config->item('field_error_start_tag'), $this->config->item('field_error_end_tag'));
if ($this->input->post()) {
$this->form_validation->set_message('is_natural', 'You must enter a valid %s number');
$this->form_validation->set_rules('phone', 'Phone', 'required|trim|xss|is_natural|xss_clean');
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|xss_clean');
$this->form_validation->set_rules('city', 'City', 'required|trim|xss_clean');
$this->form_validation->set_rules('state', 'State', 'required|trim|xss_clean');
$this->form_validation->set_rules('country', 'Country', 'required|trim|xss_clean');
$this->form_validation->set_rules('pincode', 'Pincode to', 'required|trim|alpha_numeric|xss_clean');
$this->form_validation->set_rules('street', 'Street', 'required|trim|xss_clean');
$this->form_validation->set_rules('name', 'Name', 'required|trim|xss_clean');
if ($this->form_validation->run()) {
$data['phone'] = $this->input->post('phone');
$data['email'] = $this->input->post('email');
$data['name'] = $this->input->post('name');
$data['street'] = $this->input->post('street');
$data['city'] = $this->input->post('city');
$data['state'] = $this->input->post('state');
$data['country'] = $this->input->post('country');
$data['pincode'] = $this->input->post('pincode');
$rows = $this->db->get_where('contact_info', array('id' => '1'))->num_rows();
if ($rows > 0) {
$this->db->where('id', 1);
$this->db->update('contact_info', $data);
} else {
$this->db->insert('contact_info', $data);
}
//echo '<p>Contact info updated successfully</p>';
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Contact info updated successfully')));
redirect_admin('contact');
} else {
$data['row'] = $this->db->get_where('contact_info', array('id' => '1'))->row();
$data['message_element'] = "administrator/contact/view_contact_info";
$this->load->view('administrator/admin_template', $data);
}
} else {
$data['row'] = $this->db->get_where('contact_info', array('id' => '1'))->row();
$data['message_element'] = "administrator/contact/view_contact_info";
$this->load->view('administrator/admin_template', $data);
}
}
示例4: index
public function index()
{
if ($this->input->post('update')) {
$this->form_validation->set_rules('google_analytics', 'Google Account Client ID', 'required');
if ($this->form_validation->run()) {
$google_analytics['transaction_id'] = $this->input->post('google_analytics');
$this->db->update('google_analytics', $google_analytics);
$data['message_element'] = "administrator/google_analytics";
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Changes successfully updated')));
redirect_admin('Google_Analytics');
} else {
$data['message_element'] = "administrator/google_analytics";
$this->load->view('administrator/admin_template', $data);
}
// $this->load->view('administrator/admin_template', $data);
} else {
$google_analyze = $this->db->select('transaction_id')->get('google_analytics')->row()->transaction_id;
$data['message_element'] = "administrator/google_analytics";
$this->load->view('administrator/admin_template', $data);
}
}
示例5: addlocation
public function addlocation($param = '')
{
$this->form_validation->set_error_delimiters($this->config->item('field_error_start_tag'), $this->config->item('field_error_end_tag'));
if ($this->input->post()) {
$this->form_validation->set_rules('name', 'Name', 'required|trim|xss_clean');
$this->form_validation->set_rules('location', 'Location', 'required|trim|xss_clean');
if ($this->form_validation->run()) {
$updateData = array();
$insertData['name'] = $this->input->post('name');
$insertData['category_id'] = 1;
$insertData['search_code'] = $this->input->post('location');
$this->Common_model->inserTableData('toplocations', $insertData);
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Location updated successfully.')));
redirect_admin('toplocation');
}
}
$data['categories'] = $this->Common_model->getTableData('toplocation_categories');
$conditions = array("toplocations.id" => $param);
$data['result'] = $this->Common_model->getToplocation($conditions)->row();
$data['message_element'] = "administrator/toplocation/add_location";
$this->load->view('administrator/admin_template', $data);
}
示例6: addproperties
function addproperties()
{
$prop = $this->input->post('addproperty');
$property = trim($prop);
$check = $this->db->where('type', $property)->get('property_type');
if ($check->num_rows() != 0) {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('Please give different one, its already entered.')));
redirect_admin('property_type/view_property');
}
if (empty($property)) {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('Sorry, You have to fill all fields!')));
redirect_admin('property_type/view_property');
} else {
$nul = "NULL";
$data = array('id' => NULL, 'type' => $this->input->post('addproperty'));
$this->Common_model->insertData('property_type', $data);
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Property type added successfully!')));
redirect_admin('property_type/view_all_property');
}
}
示例7: how_it_works
public function how_it_works()
{
if ($this->input->post('update')) {
if ($this->input->post('display_type') == 0) {
if ($_FILES["media"]["name"]) {
$media = $this->db->get_where('settings', array('code' => 'HOW_IT_WORKS'))->row()->string_value;
$real_logo = $this->path . '/uploads/howit/' . $media;
//unlink($real_logo);
$config = array('allowed_types' => 'mp4|flv|FLV', 'upload_path' => 'uploads/howit');
$this->load->library('upload', $config);
if (!$this->upload->do_upload('media')) {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('Please Upload Correct File or MP4 Video')));
redirect_admin('settings/how_it_works');
}
//$this->upload->display_errors('<p>','</p>');
$data1['string_value'] = $_FILES["media"]["name"];
$this->db->where('code', 'HOW_IT_WORKS');
$this->db->update('settings', $data1);
$data2['int_value'] = 0;
$this->db->where('code', 'HOW_IT_WORKS');
$this->db->update('settings', $data2);
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Successfully Uploaded')));
redirect_admin('settings/how_it_works');
}
} else {
if ($this->input->post('display_type') == 1) {
$this->form_validation->set_rules('embed_code', 'Embeded code field', 'required');
if ($this->form_validation->run()) {
//$pattern = '%(?:https?://)?(?:www\.)?(?:youtu\.be/| view.vzaar\.com(?:/embed/|/v/|/watch\?v=))([\w-]{10,12})[a-zA-Z0-9\< \>\"]%x';
// if(!preg_match($pattern, $this->input->post('embed_code'), $matches))
// {
//$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error','Enter the Valid Embed Code.'));
// redirect_admin('settings/how_it_works');
// }
$code = $this->input->post('embed_code');
$last = substr($this->input->post('embed_code'), -1);
/* if($last != '>')
{
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error','Enter the Valid Embed Code.'));
redirect_admin('settings/how_it_works');
}
if($code[0] != '<')
{
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error','Enter the Valid Embed Code.'));
redirect_admin('settings/how_it_works');
} */
$data1['text_value'] = $this->input->post('embed_code');
$this->db->where('code', 'HOW_IT_WORKS');
$this->db->update('settings', $data1);
$data2['int_value'] = 1;
$this->db->where('code', 'HOW_IT_WORKS');
$this->db->update('settings', $data2);
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Successfully Uploaded')));
redirect_admin('settings/how_it_works');
}
}
}
}
$data['display_type'] = $this->db->get_where('settings', array('code' => 'HOW_IT_WORKS'))->row()->int_value;
$data['media'] = $this->db->get_where('settings', array('code' => 'HOW_IT_WORKS'))->row()->string_value;
$data['embed_code'] = $this->db->get_where('settings', array('code' => 'HOW_IT_WORKS'))->row()->text_value;
$data['message_element'] = "administrator/settings/how_it_works";
$this->load->view('administrator/admin_template', $data);
}
示例8: edithelp
/**
* Loads Manage Static helps View.
*
* @access private
* @param nil
* @return void
*/
public function edithelp()
{
//Get id of the category
$id = is_numeric($this->uri->segment(4)) ? $this->uri->segment(4) : 0;
//Intialize values for library and helpers
$this->form_validation->set_error_delimiters($this->config->item('field_error_start_tag'), $this->config->item('field_error_end_tag'));
if ($this->input->post('edithelp')) {
$check_data = $this->db->where('id', $id)->get('help');
if ($check_data->num_rows() == 0) {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('This help already deleted.')));
redirect_admin('help/viewhelp');
}
//Set rules
$this->form_validation->set_rules('question', 'help title', 'required|trim|xss_clean');
$this->form_validation->set_rules('description', 'help content', 'required|trim');
$this->form_validation->set_rules('page_refer', 'page refer', 'required|trim|xss_clean');
//|callback_helpUrlCheck|callback_helpUrlValid');
$this->form_validation->set_rules('status', 'active', 'required|trim|xss_clean');
if ($this->form_validation->run()) {
//prepare update data
$updateData = array();
$updateData['question'] = $this->input->post('question');
$updateData['description'] = $this->input->post('description', false);
$updateData['page_refer'] = $this->input->post('page_refer');
$updateData['status'] = $this->input->post('status');
$updateData['modified_date'] = local_to_gmt();
//Edit Faq Category
$updateKey = array('help.id' => $this->uri->segment(4));
$this->help_model->updatehelp($updateKey, $updateData);
//Notification message
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Help updated successfully')));
redirect_admin('help/viewhelp');
}
}
//If - Form Submission End
//Set Condition To Fetch The Faq Category
$condition = array('help.id' => $id);
//Get Groups
$data['helps'] = $this->help_model->gethelps($condition);
if ($data['helps']->num_rows() == 0) {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('This help already deleted.')));
redirect_admin('help/viewhelp');
}
//Load View
$data['message_element'] = "administrator/help/edithelp";
$this->load->view('administrator/admin_template', $data);
}
示例9: edit_language
/**
* Loads Manage Static Pages View.
*
* @access private
* @param nil
* @return void
*/
public function edit_language()
{
//Get id of the category
$id = is_numeric($this->uri->segment(4)) ? $this->uri->segment(4) : 0;
//Intialize values for library and helpers
$this->form_validation->set_error_delimiters($this->config->item('field_error_start_tag'), $this->config->item('field_error_end_tag'));
if ($this->input->post('edit_language')) {
extract($this->input->post());
//Set rules
$this->form_validation->set_rules('name', 'Language Name', 'required|trim|xss_clean|alpha|callback_edit_name_check');
$this->form_validation->set_rules('language_code', 'Language Code', 'required|trim|xss_clean|alpha|callback_edit_code_check');
$this->form_validation->set_rules('status', 'Status', 'required|trim|xss_clean');
if ($this->form_validation->run()) {
extract($this->input->post());
$data['name'] = $name;
$data['code'] = $language_code;
$data['status'] = $status;
$this->Common_model->updateTableData('language', 0, array('id' => $id), $data);
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Language Updated Successfully.')));
redirect_admin('language/view_languages');
}
} elseif ($this->input->post('cancel')) {
redirect_admin('cancellation/viewCancellation');
}
$condition = array('id' => $id);
//Get Groups
$data['languages'] = $this->Common_model->getTableData('language', $condition);
$data['check_language'] = $this->Common_model->getTableData('language', array('id' => $this->uri->segment(4)))->num_rows();
if ($data['languages']->num_rows() == 0) {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('This cancellation policy already deleted.')));
redirect_admin('cancellation/viewCancellation');
}
//Load View
$data['message_element'] = "administrator/language/edit_language";
$this->load->view('administrator/admin_template', $data);
}
示例10: addaminities
function addaminities()
{
$aminity1 = $this->input->post('addaminitie');
$desc1 = $this->input->post('desc_aminitie');
if (empty($aminity1) && empty($desc1)) {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('Sorry, You have to fill all fields!')));
redirect_admin('lists/view_aminity');
} else {
$nul = "NULL";
$data = array('id' => NULL, 'name' => $this->input->post('addaminitie'), 'description' => $this->input->post('desc_aminitie'));
$this->Common_model->insertData('amnities', $data);
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('Amenity added successfully!')));
redirect_admin('lists/view_aminity');
}
}
示例11: delete_coupon
public function delete_coupon()
{
$this->load->model('coupon_model');
$id = $this->uri->segment(4, 0);
if ($id == 0) {
$couponlist = $this->input->post('couponlist');
if (!empty($couponlist)) {
foreach ($couponlist as $res) {
$condition = array('coupon.id' => $res);
$this->coupon_model->deletecoupon(NULL, $condition);
}
} else {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('Please select coupon list')));
redirect_admin('coupon/view_all_coupon');
}
} else {
$condition = array('coupon.id' => $id);
$this->coupon_model->deletecoupon(NULL, $condition);
}
//Notification message
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Coupon deleted successfully')));
redirect_admin('coupon/view_all_coupon');
}
示例12: index
/**
* Loads site settings page.
*
* @access private
* @param nil
* @return void
*/
function index()
{
$this->load->model('settings_model');
//pr($_POST);
//load validation library
$this->load->library('form_validation');
//Load Form Helper
$this->load->helper('form');
//Intialize values for library and helpers
$this->form_validation->set_error_delimiters($this->config->item('field_error_start_tag'), $this->config->item('field_error_end_tag'));
//Get Form Details
if ($this->input->post('siteSettings')) {
//Set rules
$this->form_validation->set_rules('site_title', 'lang:site_title_validation', 'required|trim|xss_clean');
$this->form_validation->set_rules('site_slogan', 'lang:site_slogan_validation', 'required|alpha_space|trim|xss_clean');
$this->form_validation->set_rules('site_admin_mail', 'lang:site_admin_mail_validation', 'required|trim|valid_email|xss_clean');
$this->form_validation->set_rules('site_language', 'lang:site_language_validation', 'required|trim|xss_clean');
$this->form_validation->set_rules('offline_message', 'lang:offline_message_validation', 'required|trim|xss_clean');
$this->form_validation->set_rules('offline_message', 'lang:offline_message_validation', 'required|trim|xss_clean');
$this->form_validation->set_rules('forced_escrow', 'lang:forced_escrow_validation', 'required|trim|xss_clean');
$this->form_validation->set_rules('forced_escrow', 'lang:forced_escrow_validation', 'required|trim|xss_clean');
$this->form_validation->set_rules('payment_settings', 'lang:payment_settings_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('featured_projects_limit', 'lang:featured_projects_limit_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('urgent_projects_limit', 'lang:urgent_projects_limit_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('latest_projects_limit', 'lang:latest_projects_limit_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('provider_commission_amount', 'lang:provider_commission_amount_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('featured_projects_amount', 'lang:featured_projects_amount_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('urgent_projects_amount', 'lang:urgent_projects_amount_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('hide_projects_amount', 'lang:hide_projects_amount_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('joblist_projects_amount', 'lang:joblist_projects_amount_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('joblist_validity_days', 'lang:joblist_validity_days_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('file_manager_limit', 'lang:file_manager_limit_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('base_url', 'lang:base_url_validation', 'required|trim|xss_clean');
$this->form_validation->set_rules('featured_projects_amount_cm', 'lang:featured_projects_amount_cm_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('urgent_projects_amount_cm', 'lang:urgent_projects_amount_cm_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('hide_projects_amount_cm', 'lang:hide_projects_amount_cm_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('private_projects_amount_cm', 'lang:private_projects_amount_cm_validation', 'numeric|required|trim|xss_clean');
$this->form_validation->set_rules('twitter_username', 'lang:twitter_username_validation', 'alpha_numeric|trim|xss_clean');
$this->form_validation->set_rules('twitter_password', 'lang:twitter_password_validation', 'alpha_numeric|trim|xss_clean');
//$this->form_validation->set_rules('file','Upload File','callback_upload_file');
$this->form_validation->set_rules('private_project_amount', 'lang:private_project_amount_validation', 'numeric|required|trim|xss_clean');
if ($this->form_validation->run()) {
$updateData = array();
$updateData['site_title'] = $this->input->post('site_title');
$updateData['site_language'] = $this->input->post('site_language');
$updateData['twitter_username'] = $this->input->post('twitter_username');
$updateData['twitter_password'] = $this->input->post('twitter_password');
$updateData['site_slogan'] = $this->input->post('site_slogan');
$updateData['site_admin_mail'] = $this->input->post('site_admin_mail');
$updateData['site_status'] = $this->input->post('site_status');
$updateData['offline_message'] = $this->input->post('offline_message');
$updateData['forced_escrow'] = $this->input->post('forced_escrow');
$updateData['payment_settings'] = $this->input->post('payment_settings');
$updateData['featured_projects_limit'] = $this->input->post('featured_projects_limit');
$updateData['urgent_projects_limit'] = $this->input->post('urgent_projects_limit');
$updateData['latest_projects_limit'] = $this->input->post('latest_projects_limit');
$updateData['provider_commission_amount'] = $this->input->post('provider_commission_amount');
$updateData['featured_projects_amount'] = $this->input->post('featured_projects_amount');
$updateData['urgent_projects_amount'] = $this->input->post('urgent_projects_amount');
$updateData['joblist_projects_amount'] = $this->input->post('joblist_projects_amount');
$updateData['joblist_validity_days'] = $this->input->post('joblist_validity_days');
$updateData['hide_projects_amount'] = $this->input->post('hide_projects_amount');
$updateData['private_project_amount'] = $this->input->post('private_project_amount');
$updateData['featured_projects_amount_cm'] = $this->input->post('featured_projects_amount_cm');
$updateData['urgent_projects_amount_cm'] = $this->input->post('urgent_projects_amount_cm');
$updateData['hide_projects_amount_cm'] = $this->input->post('hide_projects_amount_cm');
$updateData['private_project_amount_cm'] = $this->input->post('private_projects_amount_cm');
$updateData['file_manager_limit'] = $this->input->post('file_manager_limit');
$updateData['base_url'] = $this->input->post('base_url');
$updateData['created'] = get_est_time();
if (isset($this->outputData['file'])) {
$this->load->helper('file');
$Data['file'] = $this->outputData['file']['file_name'];
$thumb1 = $this->outputData['file']['file_path'] . 'h1_logo.jpg';
createLogo($this->outputData['file']['full_path'], $thumb1, 276, 79);
}
// pr($updateData);
//Update Site Settings
$this->settings_model->updateSiteSettings($updateData);
//Notification message
$this->session->set_flashdata('flash_message', $this->common_model->admin_flash_message('success', $this->lang->line('updated_success')));
redirect_admin('siteSettings');
}
}
//If - Form Submission End
$this->outputData['settings'] = $this->settings_model->getSiteSettings();
$this->load->view('admin/settings/siteSettings', $this->outputData);
}
示例13: viewSuspend
function viewSuspend()
{
//load validation library
$this->load->library('form_validation');
//Load Form Helper
$this->load->helper('form');
//Intialize values for library and helpers
$this->form_validation->set_error_delimiters($this->config->item('field_error_start_tag'), $this->config->item('field_error_end_tag'));
if ($this->input->post('suspend')) {
//Set rules
$this->form_validation->set_rules('suspend_value', 'lang:ban_value_validation', 'required|trim|xss_clean');
if ($this->form_validation->run()) {
$updateData = array();
$updateData['suspend_type'] = $this->input->post('type', true);
$updateData['suspend_value'] = $this->input->post('suspend_value', true);
$condition = array('suspend.id' => $this->input->post('banid', true));
$suspend_before_update = $this->common_model->getTableData('suspend', $condition, 'suspend_value');
$suspend_before_update = $suspend_before_update->row();
$sus_value_before = $suspend_before_update->suspend_value;
$updateKey = array('suspend.id' => $this->input->post('banid', true));
$this->common_model->updateTableData('suspend', NULL, $updateData, $updateKey);
if (strtolower($updateData['suspend_type']) == 'username') {
$condition = array('users.user_name' => $sus_value_before);
$data = array('users.suspend_status' => '0');
$this->common_model->updateTableData('users', NULL, $data, $condition);
$condition = array('users.user_name' => $updateData['suspend_value']);
$data = array('users.suspend_status' => '1');
$this->common_model->updateTableData('users', NULL, $data, $condition);
} else {
if (strtolower($updateData['suspend_type']) == 'email') {
$condition = array('users.email' => $sus_value_before);
$data = array('users.suspend_status' => '0');
$this->common_model->updateTableData('users', NULL, $data, $condition);
$condition = array('users.email' => $updateData['suspend_value']);
$data = array('users.suspend_status' => '1');
$this->common_model->updateTableData('users', NULL, $data, $condition);
}
}
//Notification message
$this->session->set_flashdata('flash_message', $this->common_model->admin_flash_message('success', $this->lang->line('updated_success')));
redirect_admin('users/editSuspend');
}
}
$banid = $this->uri->segment(4, '0');
$condition = array('suspend.id' => $banid);
$bans = $this->user_model->getSuspend($condition);
$this->outputData['suspendDetails'] = $bans->row();
//pr($bans->num_rows());exit;
$this->load->view('admin/users/viewSuspend', $this->outputData);
}
示例14: editFaq
/**
* Loads Manage Static Pages View.
*
* @access private
* @param nil
* @return void
*/
function editFaq($id)
{
//Get id of the category
$id = is_numeric($id) ? $id : 0;
//Intialize values for library and helpers
$this->form_validation->set_error_delimiters($this->config->item('field_error_start_tag'), $this->config->item('field_error_end_tag'));
if ($this->input->post('editfaq')) {
//Set rules
$this->form_validation->set_rules('question', 'Question', 'required|trim|xss_clean');
$this->form_validation->set_rules('faq_content', 'Answer', 'required|trim');
$check_data = $this->db->where('id', $id)->get('faq');
if ($check_data->num_rows() == 0) {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('This FAQ already deleted.')));
redirect_admin('faq/viewFaqs');
}
if ($this->form_validation->run()) {
//prepare update data
$updateData = array();
$updateData['question'] = $this->input->post('question');
$updateData['faq_content'] = $this->input->post('faq_content', false);
//Edit Faq Category
$updateKey = array('id' => $id);
$this->faq_model->updateFaq($updateKey, $updateData);
//Notification message
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Updated Successfully')));
redirect_admin('faq/viewFaqs');
}
}
//If - Form Submission End
//Set Condition To Fetch The Faq Category
$condition = array('id' => $id);
//Get Groups
$data['faqs'] = $this->faq_model->getfaqs($condition);
if ($data['faqs']->num_rows() == 0) {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('This FAQ already deleted.')));
redirect_admin('faq/viewFaqs');
}
//Load View
$data['message_element'] = 'administrator/faq/editFaq';
$this->load->view('administrator/admin_template', $data);
}
示例15: deleteknowledge
public function deleteknowledge()
{
$id = $this->uri->segment(4, 0);
if ($id == 0) {
$pagelist = $this->input->post('pagelist');
if (!empty($pagelist)) {
foreach ($pagelist as $res) {
$condition = array('id' => $res);
$this->db->delete('neigh_knowledge', $condition);
}
} else {
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('error', translate_admin('Please select any local knowledge')));
redirect_admin('neighbourhoods/viewknowledge');
}
} else {
$condition = array('id' => $id);
$this->db->delete('neigh_knowledge', $condition);
}
//Notification message
$this->session->set_flashdata('flash_message', $this->Common_model->admin_flash_message('success', translate_admin('Local Knowledge deleted successfully')));
redirect_admin('neighbourhoods/viewknowledge');
}