Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Ángel Chica Moral
/
tbw2122_4
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
81bb332f
authored
Mar 21, 2022
by
Javier Godino Moral
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Arreglo BD
parent
7665e037
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
24 deletions
administrador/config/bd.php
administrador/seccion/equipos.php
administrador/seccion/tarjetas.php
administrador/template/cabecera.php
template/cabecera.php
administrador/config/bd.php
View file @
81bb332f
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
try
{
try
{
$conexion
=
new
PDO
(
"mysql:host=
$host
;dbname=
$bd
"
,
$usuario
,
$contrasenia
);
$conexion
=
new
PDO
(
"mysql:host=
$host
;dbname=
$bd
"
,
$usuario
,
$contrasenia
);
if
(
$conexion
){
echo
"Conectado al sistema"
;}
if
(
$conexion
){
echo
"Conectado al sistema"
;}
}
catch
(
Exception
$ex
)
{
}
catch
(
Exception
$ex
)
{
...
...
administrador/seccion/equipos.php
View file @
81bb332f
<?php
include
(
"../template/cabecera.php"
);
?>
<?php
include
(
"../template/cabecera.php"
);
?>
<?php
<?php
print_r
(
$_POST
);
$txtequipo
=
(
isset
(
$_POST
[
'id_equipo'
]))
?
$_POST
[
'id_equipo'
]
:
""
;
$txtequipo
=
(
isset
(
$_POST
[
'id_equipo'
]))
?
$_POST
[
'id_equipo'
]
:
""
;
$txtnombreEquipo
=
(
isset
(
$_POST
[
'nombreEquipo'
]))
?
$_POST
[
'nombreEquipo'
]
:
""
;
$txtnombreEquipo
=
(
isset
(
$_POST
[
'nombreEquipo'
]))
?
$_POST
[
'nombreEquipo'
]
:
""
;
$txtimagen
=
(
isset
(
$_
POST
[
'imgEquipo'
][
'name'
]))
?
$_POST
[
'imgEquipo'
][
'name'
]
:
""
;
$txtimagen
=
(
isset
(
$_
FILES
[
'imgEquipo'
][
'name'
]))
?
$_FILES
[
'imgEquipo'
][
'name'
]
:
""
;
$accion
=
(
isset
(
$_POST
[
'accion'
]))
?
$_POST
[
'accion'
]
:
""
;
$accion
=
(
isset
(
$_POST
[
'accion'
]))
?
$_POST
[
'accion'
]
:
""
;
include
(
"../config/bd.php"
);
include
(
"../config/bd.php"
);
switch
(
$accion
){
switch
(
$accion
){
case
"Agregar"
:
case
"Agregar"
:
//INSERT INTO `equipos` (`id`, `Nombre`, `Imagen`) VALUES (NULL, '
Alavés', 'alaves
.png');
//INSERT INTO `equipos` (`id`, `Nombre`, `Imagen`) VALUES (NULL, '
atlethic', 'atlethic
.png');
$SQL
=
$conexion
->
prepare
(
"INSERT INTO `equipos` (`id`, `Nombre`, `Imagen`) VALUES (NULL, '
Alavés', 'alaves
.png');"
);
$SQL
=
$conexion
->
prepare
(
"INSERT INTO `equipos` (`id`, `Nombre`, `Imagen`) VALUES (NULL, '
atlethic', 'atlethic
.png');"
);
$SQL
->
execute
();
$SQL
->
execute
();
break
;
break
;
case
"Modificar"
:
case
"Modificar"
:
break
;
break
;
case
"Cancelar"
:
case
"Cancelar"
:
break
;
break
;
}
}
?>
?>
...
@@ -29,23 +36,29 @@
...
@@ -29,23 +36,29 @@
Añadir Equipo
Añadir Equipo
</div>
</div>
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<form
method=
"POST"
enctype=
"multipart/form-data"
>
<form
method=
"POST"
enctype=
"multipart/form-data"
>
<div
class =
"form-group"
>
<div
class =
"form-group"
>
<label
for=
"equipo"
>
ID Equipo:
</label>
<label
for=
"id_equipo"
>
ID Equipo:
</label>
<input
type=
"text"
class=
"form-control"
name=
"id_equipo"
id=
"id_equipo"
placeholder=
"Indica el id del nuevo equipo"
>
<input
type=
"text"
class=
"form-control"
name=
"id_equipo"
id=
"id_equipo"
placeholder=
"Indica el id del nuevo equipo"
>
</div>
</div>
<div
class =
"form-group"
>
<div
class =
"form-group"
>
<label
for=
"nombreJugador"
>
Nombre:
</label>
<label
for=
"nombreEquipo"
>
Nombre:
</label>
<input
type=
"text"
class=
"form-control"
name=
"nombreEquipo"
id=
"nombreEquipo"
placeholder=
"Añade un equipo"
>
<input
type=
"text"
class=
"form-control"
name=
"nombreEquipo"
id=
"nombreEquipo"
placeholder=
"Añade un equipo"
>
</div>
</div>
<div
class=
"btn-group"
role=
"group"
aria-label=
""
>
<div
class =
"form-group"
>
<button
type=
"button"
name=
"accion"
value=
"Agregar"
class=
"btn btn-success"
>
Agregar
</button>
<label
for=
"imgEquipo"
>
Escudo:
</label>
<button
type=
"button"
name=
"accion"
value=
"Modificar"
class=
"btn btn-warning"
>
Modificar
</button>
<input
type=
"file"
class=
"form-control"
name=
"imgEquipo"
id=
"imgEquipo"
placeholder=
"Añade un escudo"
>
<button
type=
"button"
name=
"accion"
value=
"Cancelar"
class=
"btn btn-info"
>
Cancelar
</button>
</div>
</div>
<div
class=
"btn-group"
role=
"group"
aria-label=
""
>
<button
type=
"submit"
name=
"accion"
value=
"Agregar"
class=
"btn btn-success"
>
Añadir
</button>
<button
type=
"submit"
name=
"accion"
value=
"Modificar"
class=
"btn btn-warning"
>
Modificar
</button>
<button
type=
"submit"
name=
"accion"
value=
"Cancelar"
class=
"btn btn-info"
>
Cancelar
</button>
</div>
</form>
</form>
</div>
</div>
</div>
</div>
...
...
administrador/seccion/tarjetas.php
View file @
81bb332f
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<div
class=
"card"
>
<div
class=
"card"
>
<div
class=
"card-header"
>
<div
class=
"card-header"
>
Añadir
Jugador
Añadir
Tarjeta
</div>
</div>
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<form
method=
"POST"
enctype=
"multipart/form-data"
>
<form
method=
"POST"
enctype=
"multipart/form-data"
>
...
...
administrador/template/cabecera.php
View file @
81bb332f
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
<a
class=
"nav-item nav-link"
href=
"
<?php
echo
$url
;
?>
/administrador/seccion/tarjetas.php"
>
Tarjetas
</a>
<a
class=
"nav-item nav-link"
href=
"
<?php
echo
$url
;
?>
/administrador/seccion/tarjetas.php"
>
Tarjetas
</a>
<a
class=
"nav-item nav-link"
href=
"
<?php
echo
$url
;
?>
/administrador/seccion/goles.php"
>
Goles
</a>
<a
class=
"nav-item nav-link"
href=
"
<?php
echo
$url
;
?>
/administrador/seccion/goles.php"
>
Goles
</a>
<a
class=
"nav-item nav-link"
href=
"
<?php
echo
$url
;
?>
/administrador/seccion/Cerrar_sesion.php"
>
Cerrar Sesión
</a>
<a
class=
"nav-item nav-link"
href=
"
<?php
echo
$url
;
?>
/administrador/seccion/Cerrar_sesion.php"
>
Cerrar Sesión
</a>
</div>
</div>
</nav>
</nav>
</br></br>
</br></br>
...
...
template/cabecera.php
View file @
81bb332f
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<a
class=
"nav-link"
href=
"equipos.php"
>
Equipos
</a>
<a
class=
"nav-link"
href=
"equipos.php"
>
Equipos
</a>
</li>
</li>
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
<?php
echo
$url
;
?>
>
Registr
arse</a
>
<a
class=
"nav-link"
href=
<?php
echo
$url
;
?>
>
Identific
arse</a
>
</li>
</li>
</ul>
</ul>
</nav>
</nav>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment