Не работает редактор и создавалка фильмов, как исправить?

0
(controller)

public function create() {

if(!$this->dx_auth->is_admin()) {
show_404();
}

$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('poster') && $this->input->post('player_code') && $this->input->post('director') && $this->input->post('add_date') && $this->input->post('category_id') && $this->input->post('season') && $this->input->post("studio") && $this->input->post("style") && $this->input->post("age")) {

$slug = $this->input->post('slug');
$name = $this->input->post('name');
$descriptions = $this->input->post('descriptions');
$year = $this->input->post('year');
$rating = $this->input->post('rating');
$poster = $this->input->post('poster');
$player_code = $this->input->post('player_code');
$director = $this->input->post('director');
$add_date = $this->input->post('add_date');
$category_id = $this->input->post('category_id');
$season = $this->input->post('season');
$studio = $this->input->post('studio');
$style =$this->input->post("style");
$age =$this->input->post("age");

if($this->Films_model->setMovies($slug, $name, $descriptions, $year, $rating, $poster, $player_code, $director, $add_date, $category_id,$season,$studio,$style,$age)) {
$this->data['title'] = "добавлено!";
$this->load->view('templates/header', $this->data);
$this->load->view('movies/created', $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 edit($slug = NULL) {

if(!$this->dx_auth->is_admin()) {
show_404();
}

$this->data['title'] = 'Редактировать фильм/сериал';
$this->data['movies_item'] = $this->Films_model->getMovies($slug);

if (empty($this->data['movies_item'])) {
show_404();
}

$this->data['id_movies'] = $this->data['movies_item']['id'];
$this->data['slug_movies'] = $this->data['movies_item']['slug'];
$this->data['name_movies'] = $this->data['movies_item']['name'];
$this->data['descriptions_movies'] = $this->data['movies_item']['descriptions'];
$this->data['year_movies'] = $this->data['movies_item']['year'];
$this->data['rating_movies'] = $this->data['movies_item']['rating'];
$this->data['poster_movies'] = $this->data['movies_item']['poster'];
$this->data['player_code_movies'] = $this->data['movies_item']['player_code'];
$this->data['director_movies'] = $this->data['movies_item']['director'];
$this->data['add_date_movies'] = $this->data['movies_item']['add_date'];
$this->data['category_id_movies'] = $this->data['movies_item']['category_id'];
$this->data['season_movies'] = $this->data['movies_item']['season'];
$this->data['age_movies'] = $this->data['movies_item']['age'];
$this->data['style_movies'] = $this->data['movies_item']['style'];
$this->data['studio_movies'] = $this->data['movies_item']['studio'];


if($this->input->post('slug') && $this->input->post('name') && $this->input->post('descriptions') && $this->input->post('year') && $this->input->post('rating') && $this->input->post('poster') && $this->input->post('player_code') && $this->input->post('director') && $this->input->post('add_date') && $this->input->post('category_id') && $this->input->post('style') && $this->input->post('age') && $this->input->post('studio') && $this->input->post('season')) {

$id = $this->data['movies_item']['id'];
$slug = $this->input->post('slug');
$name = $this->input->post('name');
$descriptions = $this->input->post('descriptions');
$year = $this->input->post('year');
$rating = $this->input->post('rating');
$poster = $this->input->post('poster');
$player_code = $this->input->post('player_code');
$director = $this->input->post('director');
$add_date = $this->input->post('add_date');
$category_id = $this->input->post('category_id');
$season = $this->input->post('season');
$style = $this->input->post('style');
$age = $this->input->post('age');
$studio = $this->input->post('studio');

if($this->Films_model->updateMovies($id, $slug, $name, $descriptions, $year, $rating, $poster, $player_code, $director, $add_date, $category_id , $season, $style, $age,$studio)) {
$this->data['title'] = 'Успешно обновлено';
$this->load->view('templates/header', $this->data);
$this->load->view('movies/edited', $this->data);
$this->load->view('templates/footer');
}
}
else{
$this->load->view('templates/header', $this->data);
$this->load->view('movies/edit', $this->data);
$this->load->view('templates/footer');

} } 

(model)

public function setMovies($slug, $name, $descriptions, $year, $rating, $poster, $player_code, $director, $add_date, $category_id,$season,$studio,$style,$age) {
$data = array(
'slug' => $slug,
'name' => $name,
'descriptions' => $descriptions,
'year' => $year,
'rating' => $rating,
'poster' => $poster,
'player_code' => $player_code,
'director' => $director,
'add_date' => $add_date,
'category_id' => $category_id,
"season" =>$season,
"studio" =>$studio,
"style" =>$style,
"age"=>$age,
);
return $this->db->insert('movie', $data);
}

public function updateMovies($id, $slug, $name, $descriptions, $year, $rating, $poster, $player_code, $director, $add_date, $category_id, $season,$studio,$style,$age) {
$data = array(
'id' => $id,
'slug' => $slug,
'name' => $name,
'descriptions' => $descriptions,
'year' => $year,
'rating' => $rating,
'poster' => $poster,
'player_code' => $player_code,
'director' => $director,
'add_date' => $add_date,
'category_id' => $category_id,
"season" =>$season,
"studio" =>$studio,
"style" =>$style,
"age"=>$age,
);
return $this->db->update('movie', $data, array('id' => $id));
}
codeigniter

1 ответов

0

Из исходного кода пробовал проект запускать?

Sign up or Log in to write an answer