Guest User

Untitled

a guest
Sep 24th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.34 KB | None | 0 0
  1. function create() {  
  2.         $this->bep_assets->load_asset_group('TINYMCE');
  3.         if ($this->input->post('name')) {  
  4.             $rules['name'] = 'required';
  5.             $this->form_validation->set_rules($rules);
  6.             if ($this->form_validation->run() == FALSE) {
  7.                 echo "prince"; die;
  8.                 $this->form_validation->output_errors();
  9.                 //redirect($this->module.'/admin/create');
  10.                 $data['title'] = "Create Accomodation ";
  11.                 // Set breadcrumb
  12.                 $this->bep_site->set_crumb($this->lang->line('kago_create')." ".$this->lang->line('kago_accommodation'),$this->module.'/admin/create');
  13.                 $data['header'] = $this->lang->line('backendpro_access_control');
  14.                 $data['page'] = $this->config->item('backendpro_template_admin') . "admin_accommodation_create";
  15.                 $data['cancel_link']= $this->module."/admin/index/";
  16.                 $data['module'] = $this->module;
  17.                 $this->load->view($this->_container,$data);
  18.             }else{
  19.                 $data = $this->_fields();
  20.                 $id = $this->MKaimonokago->addItem($this->module, $data, $return_id=TRUE);
  21.                 //flashMsg('success','Accomodation  created');
  22.                 redirect($this->module.'/admin/edit/'.$id.'#tab2','refresh');
  23.             }
  24.         }else{    
  25.             $data['title'] = "Create Accomodation ";
  26.             $this->do_upload();
  27.                 // Set breadcrumb
  28.                 $this->bep_site->set_crumb($this->lang->line('kago_create')." ".$this->lang->line('kago_accommodation'),$this->module.'/admin/create');
  29.                 $data['header'] = $this->lang->line('backendpro_access_control');
  30.                 $data['page'] = $this->config->item('backendpro_template_admin') . "admin_accommodation_create";
  31.                 $data['cancel_link']= $this->module."/admin/index/";
  32.                 $data['module'] = $this->module;
  33.                 $data['zone'] = $this->MZone->getIdwithnoneLang();
  34.                 $data['member'] = $this->MAccommodationMember->getIdwithnoneLang();
  35.                 $data['style'] = $this->MAccommodationStyle->getIdwithnoneLang();
  36.                 $data['type'] = $this->MAccommodationType->getIdwithnoneLang();
  37.            
  38.                 $this->load->view($this->_container,$data);
  39.         }
  40.     }
Add Comment
Please, Sign In to add comment