При добавление фильма что нужно указывать?

1

Создал форму для добавление фильма, в контролере все указал и в модели тоже. Но при проверке конечного результата фильм не добавляется просто открывает пустую форму. Какие нужно указывать столбцы из бд, чтобы все корректно работало? 

public function create() ---> контроллер 
{
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('player_code')
&& $this->input->post('year')
&& $this->input->post('rating')
&& $this->input->post('producer')
&& $this->input->post('descriptions')
&& $this->input->post('poster')
&& $this->input->post('id')
&& $this->input->post('add_date'))
{

$slug = $this->input->post('slug');
$name = $this->input->post('name');
$player_code = $this->input->post('player_code');
$year = $this->input->post('year');
$rating = $this->input->post('rating');
$producer = $this->input->post('producer');
$descriptions = $this->input->post('descriptions');
$poster = $this->input->post('poster');
$id = $this->input->post('id');
$id = $this->input->post('add_date');

if($this->films_model->setFilm($slug, $name, $player_code, $year, $rating, $producer, $descriptions, $poster, $id, $add_date))
{
$this->load->view('templates/header', $this->data);
$this->load->view('movies/success', $this->data);
$this->load->view('templates/footer');
}
}
else
{
$this->load->view('templates/header', $this->data);
$this->load->view('movies/create', $this->data);
$this->load->view('templates/footer');
}

}

--Модель--

public function setFilms($slug, $name, $player_code, $year, $rating, $producer, $descriptions, $poster, $id, $add_date)
{

$data = array(
'slug' => $slug,
'name' => $name,
'player_code' => $player_code,
'year' => $year,
'rating' => $rating,
'producer' => $descriptions,
'descriptions' => $player_code,
'poster' => $poster,
'id' => $id,
'add_date' => $add_date
);

return $this->db->insert('movies', $data);
}

--форма--

<form action="/movies/create/" method="post">

<input class="form-control input-lg" type="input" name="slug" placeholder="slug"></br>
<input class="form-control input-lg" type="input" name="name" placeholder="название фильма"></br>
<input class="form-control input-lg" type="input" name="player_code" placeholder="код плеера"></br>
<input class="form-control input-lg" type="input" name="year" placeholder="год"></br>
<input class="form-control input-lg" type="input" name="rating" placeholder="рейтинг"></br>
<input class="form-control input-lg" type="input" name="prosucer" placeholder="режиссер"></br>
<input class="form-control input-lg" type="input" name="poster" placeholder="постер"></br>
<input class="form-control input-lg" type="input" name="id" placeholder="Фильм(1)/Сериал(2)"></br>
<input class="form-control input-lg" type="input" name="add_date" placeholder="дата добавления"></br>
<textarea class="form-control input-lg" name="descriptions" placeholder="описание фильма"></textarea></br>
<input type="submit" class="btn btn-default" name="submit" value="Добавить Фильм">

</form>

php
xampp
codeigniter

0 ответов

Sign up or Log in to write an answer