From f22ddcff6654a45e2aeeb048fd89ba9c973c17c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Mu=C3=B1oz=20Garcia?=
<73303506+danimu03@users.noreply.github.com>
Date: Thu, 27 May 2021 10:56:01 +0200
Subject: [PATCH] debug name files bd
---
panel_admin/includes/formAddFilm.php | 6 +++---
panel_admin/includes/formAddPromotion.php | 6 +++---
panel_admin/includes/formEditFilm.php | 6 +++---
panel_admin/includes/formEditPromotion.php | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)
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'] = "