Skip to content

Commit

Permalink
actualizado 19/09/2022 23:05
Browse files Browse the repository at this point in the history
  • Loading branch information
Trollkopf committed Sep 19, 2022
1 parent 6fea983 commit 0723759
Show file tree
Hide file tree
Showing 31 changed files with 987 additions and 67 deletions.
61 changes: 0 additions & 61 deletions Users/admin/admin-helpers/editar-noticia.php

This file was deleted.

2 changes: 1 addition & 1 deletion Users/admin/admin-partials/news/listar-noticias.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<button type='submit' class='edit' id='ver_noticia<?=$noticia->getID();?>' name='ver_noticia' value='' />
<?php include (PARTIALS_PATH.'boton-ver.html');?></button></td></form>
<!--EDITAR NOTICIA-->
<form method='post' action='TODO:.back/.CLIENT/editnew.php'>
<form method='post' action='helpers/editar-noticia.php'>
<td><input type='text' id='id_noticia' name='id_noticia' value='<?=$noticia->getID();?>' hidden/>
<button type='submit' class='edit' id='editar-<?=$noticia->getID();?>' name='editar'/><?php include (PARTIALS_PATH.'boton-editar.html');?></button></td></form>
<!--BORRAR NOTICIA-->
Expand Down
27 changes: 27 additions & 0 deletions Users/admin/admin-partials/projects/crear-proyecto.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/dirs.php');
include_once(DB_PATH.'DB.PHP');
include_once(MODELS_PATH.'project.php');
include_once(HELPERS_PATH.'curdate.php');
?>

<div class='panel'>
<h3>CREAR PROYECTO:</h3><br/>
<form method="POST" action="helpers/nuevo-proyecto.php" enctype="multipart/form-data">
<input type='text' id='curdate' name='curdate' value='<?php echo $CURDATE;?>' hidden/>

<table border='1' cellpadding='4' cellspacing='2'>
<tr><td colspan="3">Inserte imagen y nombre del proyecto</td></tr>
<tr>
<td>Imagen:</td>
<td><input type="file" name="imagen" id="imagen"></td>
<td rowspan="2"><input type="submit" class="white" name="send_image" id="send_image" value="Cargar imagen"></td>
</tr>

<tr>
<td>Nombre Imagen:</td>
<td><input type="Text" name="nombre_imagen" id="nombre_imagen"></td>
</tr>
</table>
</form><br/>
</div>
17 changes: 17 additions & 0 deletions Users/admin/admin-partials/projects/editar-imagen.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<table border='1' cellpadding='4' cellspacing='2'>
<tr><td colspan="3">Inserte imagen y nombre del proyecto</td></tr>
<input type="text" name="ID" value="<?= $proyecto->getID();?>" hidden>
<input type="text" name="datos" value="<?= $proyecto->getDatos();?>" hidden>
<input type="text" name="tecnologia" value="<?= $proyecto->getTecnologia();?>" hidden>
<input type="text" name="tiempo" value="<?= $proyecto->getTiempo();?>" hidden>
<tr>
<td>Imagen:</td>
<td><input type="file" name="imagen" id="imagen"></td>
<td rowspan="2"><input type="submit" class="white" name="send_image" id="send_image" value="Cargar imagen"></td>
</tr>

<tr>
<td>Nombre Imagen:</td>
<td><input type="Text" name="nombre_imagen" id="nombre_imagen"></td>
</tr>
</table>
52 changes: 52 additions & 0 deletions Users/admin/admin-partials/projects/listar-proyectos.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/dirs.php');
include_once(HELPERS_PATH.'projectsinfo.php');
include_once(MODELS_PATH.'project.php'); ?>

<div class='panel'>
<h3>PROYECTOS:</h3>
<table>
<tr>
<td rowspan="2"><b>Nombre</b></td>
<td rowspan="2"><b>Datos</b></td>
<td rowspan="2"><b>Tecnología Empleada</b></td>
<td rowspan="2"><b>Tiempo de consecución</b></td>
<td rowspan="2"><b>Ruta Imagen</b></td>
<td colspan="3"><b>Acciones</b></td>
</tr>
<tr>
<td><b>Ver</b></td>
<td><b>Editar</b></td>
<td><b>Eliminar</b></td>
</tr>

<?php foreach($proyecto as $p):?>

<?php $proyecto = new Proyecto($p['ID'], $p['nombre'], $p['datos'], $p['tecnologia'], $p['tiempo'], $p['imagen']);?>
<tr>
<td><?=$proyecto->getNombre_proyecto();?></td>
<td><?=$proyecto->getDatos();?></td>
<td><?=$proyecto->getTecnologia();?></td>
<td><?=$proyecto->getTiempo();?></td>
<td><?=$proyecto->getImagen();?></td>
<!--LEER PROYECTO-->
<form method='post' action=TODO:'../views/leerproyecto.php'>
<td><input type='text' id='id_proyecto' name='id_proyecto' value='<?=$proyecto->getID();?>' hidden/>
<button type='submit' class='edit' id='ver_proyecto<?=$proyecto->getID();?>' name='ver_proyecto' value='' />
<?php include (PARTIALS_PATH.'boton-ver.html');?></button></td></form>
<!--EDITAR PROYECTO-->
<form method='post' action='helpers/editar-proyecto.php'>
<td><input type='text' id='id_proyecto' name='id_proyecto' value='<?=$proyecto->getID();?>' hidden/>
<button type='submit' class='edit' id='editar-<?=$proyecto->getID();?>' name='editar'/><?php include (PARTIALS_PATH.'boton-editar.html');?></button></td></form>
<!--BORRAR PROYECTO-->
<form method='post' action='controllers/borrar-proyecto.php'>
<td><input type='text' id='id_proyecto' name='id_proyecto' value='<?=$proyecto->getID();?>' hidden/>
<button type='submit' class='red' id='borrar-<?=$proyecto->getID();?>' name='borrar' value='' onclick="return confirm('¿Realmente desea borrar el proyecto?')">
<?php include (PARTIALS_PATH.'boton-borrar.html');?></button></td></form>
</tr>

<?php endforeach; ?>
</table>
</div>

</section>
4 changes: 2 additions & 2 deletions Users/admin/news.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
include_once(HELPERS_PATH.'currentuser.php');?>

<section>
<!--LISTAR NOTICIAS-->
<?php include (ADMIN_PATH.'admin-partials/news/listar-noticias.php')?>
<!--REDACTAR NOTICIA-->
<?php include (ADMIN_PATH.'admin-partials/news/escribir-noticia.php')?>
<!--LISTAR NOTICIAS-->
<?php include (ADMIN_PATH.'admin-partials/news/listar-noticias.php')?>

</section>

Expand Down
12 changes: 12 additions & 0 deletions Users/admin/projects.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/dirs.php');
include_once(HELPERS_PATH.'curdate.php');
include_once(HELPERS_PATH.'currentuser.php');?>

<section>
<!--NUEVO PROYECTO-->
<?php include (ADMIN_PATH.'admin-partials/projects/crear-proyecto.php')?>
<!--LISTAR PROYECTS-->
<?php include (ADMIN_PATH.'admin-partials/projects/listar-proyectos.php')?>

</section>
2 changes: 1 addition & 1 deletion Users/client/client-partials/appointments/editar-cita.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<td colspan="3"><input type='text' class='datepicker' id='fecha-<?=$cita->getID();?>' name='datepicker'></td>
<td><select id='hour-<?=$cita->getID();?>' name='hour'>
<?php include(HELPERS_PATH.'options-horas.html');?>
<?php include(PARTIALS_PATH.'options-horas.html');?>
</td>

<td><input type='text' id='observ-<?=$cita->getID();?>' name='observ' maxlength='50' placeholder='Inserte una breve observaci&oacute;n'/></td>
Expand Down
2 changes: 1 addition & 1 deletion Users/client/client-partials/appointments/pedirCita.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<td><input type='text' id='datepicker' class='datepicker' name='datepicker'></td>
<td>
<select id='hour' name='hour'>
<?php include(HELPERS_PATH.'options-horas.html');?>
<?php include(PARTIALS_PATH.'options-horas.html');?>
</select>
</td>
<td><input type='text' id='observ' name='observ' maxlength='50' placeholder='Inserte una breve observaci&oacute;n'/></td>
Expand Down
12 changes: 12 additions & 0 deletions Users/controllers/borrar-proyecto.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/dirs.php');
include_once(DB_PATH.'db.php');

$id = $_POST['id_proyecto'];

$drop = "DELETE FROM proyectos WHERE ID_proyecto=".$id;

$mysqli->query($drop);

header('Location: ../areausuarios.php');
?>
92 changes: 92 additions & 0 deletions Users/controllers/crear-proyecto.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/dirs.php');
include_once(DB_PATH.'db.php');

$nombre = $_POST['nombre_proyecto'];
$datos = $_POST['datos_proyecto'];

$html = $_POST['Html'];
$css = $_POST['Css'];
$js = $_POST['JavaScript'];
$mysql = $_POST['MySQL'];
$php = $_POST['PHP'];
$csharp = $_POST['C#'];

$consecucion = $_POST['tiempo_consecucion'];
$rutaimagen = $_POST['rutaimagen'];

//SECUENCIA PARA AÑADIR LAS TECNOLOGÍAS
//HTML
if($html != ""){
$tecnologia = $tecnologia.$html;
}

//CSS
if($css != ""){
if($html != ""){
$tecnologia = $tecnologia.", ";
}
}$tecnologia = $tecnologia.$css;

//JAVASCRIPT
if($js != ""){
if($css != ""){
$tecnologia = $tecnologia.", ";
}else if($html != ""){
$tecnologia = $tecnologia.", ";
}
}$tecnologia = $tecnologia.$js;

//MYSQL
if($mysql != ""){
if($js != ""){
$tecnologia = $tecnologia.", ";
}else if($css != ""){
$tecnologia = $tecnologia.", ";
}else if($html != ""){
$tecnologia = $tecnologia.", ";
}
}$tecnologia = $tecnologia.$mysql;

//PHP
if($php != ""){
if($mysql != ""){
$tecnologia = $tecnologia.", ";
}else if($js != ""){
$tecnologia = $tecnologia.", ";
}else if($css != ""){
$tecnologia = $tecnologia.", ";
}else if($html != ""){
$tecnologia = $tecnologia.", ";
}
}$tecnologia = $tecnologia.$php;

//C#
if($csharp != ""){
if($php != ""){
$tecnologia = $tecnologia.", ";
}else if($mysql != ""){
$tecnologia = $tecnologia.", ";
}else if($js != ""){
$tecnologia = $tecnologia.", ";
}else if($css != ""){
$tecnologia = $tecnologia.", ";
}else if($html != ""){
$tecnologia = $tecnologia.", ";
}
}$tecnologia = $tecnologia.$csharp;

$sql = "INSERT INTO proyectos (nombre_proyecto, datos, tecnologia_empleada, tiempo_consecucion, imagen) VALUES ('".$nombre."', '".$datos."', '".$tecnologia."', '".$consecucion."', '".$rutaimagen."' );";

$results = $mysqli->query($sql);

if($results){

header("Location: ../areausuarios.php");
}else{

echo "###ERROR###";
}


?>
17 changes: 17 additions & 0 deletions Users/controllers/editar-noticia.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/dirs.php');
include_once(DB_PATH.'db.php');

$ID = $_POST['id'];
$fecha = $_POST['curdate'];
$categoria = $_POST['categoria'];
$titular = $_POST['titular'];
$subtitulo = $_POST['subtitulo'];
$noticia = $_POST['noticia'];

$update = "UPDATE noticias SET noticia = '".$noticia."', categoria ='".$categoria."', fecha = '".$fecha."', titular= '".$titular."', subtitulo = '".$subtitulo."' WHERE ID = '".$ID."'";

$mysqli->query($update);

header("Location: ../areausuarios.php");
?>
Loading

0 comments on commit 0723759

Please sign in to comment.