diff --git a/panel_admin/includes/formAddFilm.php b/panel_admin/includes/formAddFilm.php index b877f31..53ff5c0 100644 --- a/panel_admin/includes/formAddFilm.php +++ b/panel_admin/includes/formAddFilm.php @@ -103,15 +103,15 @@ class formAddFilm extends Form{ if ( $ok ) { $tmp_name = $_FILES['archivo']['tmp_name']; - - if ( !move_uploaded_file($tmp_name, "../img/films/{$nombre}") ) { + $nombreBd = str_replace(" ", "_", $tittle).".".pathinfo($nombre, PATHINFO_EXTENSION); + if ( !move_uploaded_file($tmp_name, "../img/films/{$nombreBd}") ) { $result['img'] = 'Error al mover el archivo'; } //if ( !copy("../img/tmp/{$nombre}", "/{$nombre}") ) { // $result['img'] = 'Error al mover el archivo'; //} - $nombreBd = str_replace("_", " ", $nombre); + //$nombreBd = str_replace("_", " ", $nombre); $bd->createFilm(null, $tittle,$duration,$language,$description, $nombreBd); //Null hasta tener $nombre $_SESSION['message'] = "
diff --git a/panel_admin/includes/formAddPromotion.php b/panel_admin/includes/formAddPromotion.php index cb6bc09..eede5d6 100644 --- a/panel_admin/includes/formAddPromotion.php +++ b/panel_admin/includes/formAddPromotion.php @@ -103,15 +103,15 @@ class formAddPromotion extends Form{ if ( $ok ) { $tmp_name = $_FILES['archivo']['tmp_name']; - - if ( !move_uploaded_file($tmp_name, "../img/promos/{$nombre}") ) { + $nombreBd = str_replace(" ", "_", $tittle).".".pathinfo($nombre, PATHINFO_EXTENSION); + if ( !move_uploaded_file($tmp_name, "../img/promos/{$nombreBd}") ) { $result['img'] = 'Error al mover el archivo'; } //if ( !copy("../img/tmp/{$nombre}", "/{$nombre}") ) { // $result['img'] = 'Error al mover el archivo'; //} - $nombreBd = str_replace("_", " ", $nombre); + //$nombreBd = str_replace("_", " ", $nombre); $bd->createPromotion(null, $tittle,$description,$code,$active, $nombreBd); $_SESSION['message'] = "
diff --git a/panel_admin/includes/formEditFilm.php b/panel_admin/includes/formEditFilm.php index 6b17280..a60d248 100644 --- a/panel_admin/includes/formEditFilm.php +++ b/panel_admin/includes/formEditFilm.php @@ -114,15 +114,15 @@ class formEditFilm extends Form{ if ( $ok ) { $tmp_name = $_FILES['archivo']['tmp_name']; - - if ( !move_uploaded_file($tmp_name, "../img/films/{$nombre}") ) { + $nombreBd = str_replace(" ", "_", $tittle).".".pathinfo($nombre, PATHINFO_EXTENSION); + if ( !move_uploaded_file($tmp_name, "../img/films/{$nombreBd}") ) { $result['img'] = 'Error al mover el archivo'; } //if ( !copy("../img/tmp/{$nombre}", "/{$nombre}") ) { // $result['img'] = 'Error al mover el archivo'; //} - $nombreBd = str_replace("_", " ", $nombre); + //$nombreBd = str_replace("_", " ", $nombre); $bd->editFilm($id, $tittle, $duration, $language, $description, $nombreBd); $_SESSION['message'] = "
diff --git a/panel_admin/includes/formEditPromotion.php b/panel_admin/includes/formEditPromotion.php index c656e4f..18432c5 100644 --- a/panel_admin/includes/formEditPromotion.php +++ b/panel_admin/includes/formEditPromotion.php @@ -110,15 +110,15 @@ class formEditPromotion extends Form{ if ( $ok ) { $tmp_name = $_FILES['archivo']['tmp_name']; - - if ( !move_uploaded_file($tmp_name, "../img/promos/{$nombre}") ) { + $nombreBd = str_replace(" ", "_", $tittle).".".pathinfo($nombre, PATHINFO_EXTENSION); + if ( !move_uploaded_file($tmp_name, "../img/promos/{$nombreBd}") ) { $result['img'] = 'Error al mover el archivo'; } //if ( !copy("../img/tmp/{$nombre}", "/{$nombre}") ) { // $result['img'] = 'Error al mover el archivo'; //} - $nombreBd = str_replace("_", " ", $nombre); + //$nombreBd = str_replace("_", " ", $nombre); $bd->editPromotion($id, $tittle,$description,$code,$active, $nombreBd); $_SESSION['message'] = "