I am sending a variable through the GET method in PHP, it receives it and executes the actions correctly, the problem is with the CSS styles, the procedure is as follows:
1- Send $ id through the GET method from AppTarea / index.php
<div class="opciones">
<a href="Modelo/editar.php/?id=<?php echo $datos['id']; ?>">
<i class="fa fa-pencil-square-o editar"></i>
</a>
</div>
2- Model / edit.php receives the varible, before receiving the variable $ id the page looks like this - > edit.php, and receive CSS styles
but then it no longer receives them because the url changes upon receiving the variable - > edit.php? id = 1
I do not know what's happening, someone can help.
AppTarea's full code / index.php, the data comes from the database.
<?php
include_once('Modelo/Tareas.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>App Terea</title>
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/estilos.css">
</head>
<body>
<div id="App">
<h1 class="nombre">TARE-APP</h1>
<h2>Tareas Creadas</h2>
<?php
$tarea = new Tareas();
$resul = $tarea -> selectTarea();
foreach ($resul as $datos) { ?>
<div class="tarea" id="1">
<div class="fecha_hora">
<h3><?php echo $datos['hora']; ?> </h3>
<h3><?php echo $datos['fecha']; ?></h3>
</div>
<section class="info">
<h1><?php echo $datos['titulo']; ?></h1>
<p><?php echo $datos['descripcion']; ?></p>
</section>
<div class="opciones">
<a href="Modelo/editar.php/?id=<?php echo $datos['id']; ?>""><i class="fa fa-pencil-square-o editar" aria-hidden="true"></i></a>
<a href="Modelo/eliminar.php/?id_tarea=<?php echo $datos['id']; ?>"><i class="fa fa-trash eliminar" aria-hidden="true"></i></a>
</div>
</div>
<?php } ?>
<a href="Crear-Tarea"><div class="btnCrearTarea"> <span class="fa fa-plus"></span></div></a>
</div>
</body>
</html>
Model complete code / edit.php
<?php
include_once('../Modelo/Tareas.php');
$id = $_REQUEST['id'];
$tarea_vieja = New Tareas();
$result = $tarea_vieja -> selectTarea($id);
?>
<!DOCTYPE html>
<html lang="Es">
<head>
<meta charset="UTF-8">
<title>Crear Nueva Tarea</title>
<link rel="stylesheet" href="../css/font-awesome.min.css">
<link rel="stylesheet" href="../css/estilos.css">
</head>
<body>
<div id="App">
<h1 class="nombre">TARE-APP</h1>
<a href="../index.php"><i class="fa fa-arrow-circle-left flecha_volver" aria-hidden="true"></i></a>
<h2>Crear nueva tarea</h2>
<?php foreach ($result as $datos) { ?>
<form action="" method="post">
<input type="text" value="<?php echo $datos['titulo']; ?>" name="titulo" required placeholder="Titulo Tarea" class="titulo" ><br>
<textarea name="descripcion" maxlength="100" cols="22" rows="5" autocomplete="on" placeholder="Descripcion" class="descripcion"> <?php echo $datos['descripcion']; ?> </textarea><br>
<input type="text" value="100" class="caracteres"><br>
<input type="time" value="<?php echo $datos['hora']; ?>" name="hora" required class="hora"><br>
<input type="date" value="<?php echo $datos['fecha']; ?>" name="fecha" required class="fecha"><br>
<input type="submit" value="Editar" name="editar" class="btn_crear">
</form>
<?php } ?>
</div>
<?php
if(isset($_POST['editar']) and !empty($_POST['editar'])) {
$titulo_nuevo = $_POST['titulo'];
$desc_nuevo = $_POST['descripcion'];
$hora_nuevo = $_POST['hora'];
$fecha_nuevo = $_POST['fecha'];
// Pasar datos al objeto de la clase Tareas para actualizar
$tarea = new Tareas($titulo_nuevo, $desc_nuevo, $hora_nuevo, $fecha_nuevo);
$tarea -> updateTarea($id);
echo "<div id='msm'> <p> Tarea actualizada </p> </div>";
}
</body>
</html>