CodeIgniter урок 24
РУСЛАН ГАЛКА6 ответов
Делаю дз написал запрос на добавление фильмов а он не работает
public function filmadd(){
/*if(!$this->dx_auth->is_admin()){
//show_404();
$this->load->helper('url_helper');
redirect('/', 'location');
}*/
$this->data['title'] = "Добавить фильм";
if($this->input->post('slug') && $this->input->post('$name') && $this->input->post('$descriptions') && $this->input->post('$year') && $this->input->post('rating') && $this->input->post('player_code') && $this->input->post('poster') && $this->input->post('regis')){
$slug = $this->input->post('slug');
$title = $this->input->post('title');
$descriptions = $this->input->post('descriptions');
$year = $this->input->post('year');
$rating = $this->input->post('rating');
$player_code = $this->input->post('player_code');
$poster = $this->input->post('poster');
$regis = $this->input->post('regis');
$date = now();
$cat_id = 1;
if($this->films_model->setFilms($slug, $name, $descriptions, $year, $rating, $player_code, $poster, $regis, $date, $cat_id )){
$this->load->view('templates/header', $this->data);
$this->load->view('news/succes', $this->data);
$this->load->view('templates/footer');
}
}
else {
$this->load->view('templates/header', $this->data);
$this->load->view('movies/create-film', $this->data);
$this->load->view('templates/footer');
}
}