Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Mat0wa3 authored Dec 1, 2022
1 parent 1f11f46 commit a4c4bf3
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 59 deletions.
2 changes: 1 addition & 1 deletion Controlador/actualizarControlador.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$estado=$_POST["estado"];
$sql=$conexion->query(" UPDATE usuario SET nombre='$nombre', apellido='$apellidos', mail='$email', rol='$rol', estado='$estado' WHERE id='$id' ");
if ($sql==1) {
header("location: ../principal.php ");
header("location: ./principal.php?control=usuario ");
} else {
echo "<div class='error'>Error al modificar!</div>";
}
Expand Down
5 changes: 4 additions & 1 deletion Controlador/eliminarControlador.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
$id=$_GET["id"];
$sql=$conexion->query(" UPDATE usuario SET estado='inactivo' WHERE id='$id' ");
if ($sql==1) {
echo "<script>alert('Usuario Desactivado!')</script>";
echo "<script>
alert('Usuario Desactivado!');
window.location = './principal.php?control=usuario';
</script>";
} else {
echo "<script>alert('Error al Desactivar!')</script>";
}
Expand Down
2 changes: 1 addition & 1 deletion Controlador/pruebaControlador.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$materia = $_POST['txtMateria'];
$nombre_prueba = $_POST['txtExamen'];
$id_encargado = $_POST['id'];
$sql_examen = $conexion->query("INSERT INTO examen VALUES (NULL, '$id_encargado', '$materia', '$nombre_prueba', '$tiempo')");
$sql_examen = $conexion->query("INSERT INTO examen VALUES (NULL, '$id_encargado', '$nombre_prueba', '$materia', '$tiempo')");
if ($sql_examen == 1) {
echo "<script>
alert('El examen se creo!');
Expand Down
4 changes: 2 additions & 2 deletions Modelo/parameters.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
define('base_url', 'http://127.0.0.1/proyecto/prime-saber/');
define('base_url', 'http://127.0.0.1/prime-saber/');
function url_base() {
return $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["SERVER_NAME"]."/proyecto/Prime-Saber/";
return $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["SERVER_NAME"]."/Prime-Saber/";
}

?>
1 change: 1 addition & 0 deletions Vista/principal.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<footer><?php require_once("./layout/footer.php") ?></footer>
<?php
} else if ($control == "editarU") {
echo "<link rel='stylesheet' href='../assets/css/ingresar.css'>";
require_once("./usuario/editarUsuario.php");
}
?>
Expand Down
78 changes: 56 additions & 22 deletions Vista/usuario/editarUsuario.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,59 @@

?>

<form action="" method="post" class="formulario">
<h2 class="create-account">Editar</h2>
<input type="hidden" name="id" value="<?= $_GET['id'] ?>">
<?php
include("../Controlador/actualizarControlador.php");
$datos = $sql->fetch_object();
?>
<input name="nombre" type="text" placeholder="Nombres" value="<?= $datos->nombre ?>">
<input type="text" name="apellido" placeholder="Apellidos" value="<?= $datos->apellido ?>">
<input name="email" type="email" placeholder="Correo" value="<?= $datos->mail ?>">
<select name="rol">
<option value="" disabled selected>Selecciona tu cargo</option>
<option value="profesor">Profesor</option>
<option value="estudiante">Estudiante</option>
</select>
<select name="estado">
<option value="" disabled selected>Estado de la cuenta</option>
<option value="activo">Activo</option>
<option value="inactivo">Inactivo</option>
</select>
<input name="actualizar" type="submit" value="Actualizar">
</form>
<div class="container">
<a href="./principal.php?control=usuario" class="btn__back">
<i class="fa-solid fa-circle-left"></i>
<h3>Volver</h3>
</a>
<div class="forms__container">
<div class="signin-signup">
<form action="" method="post" class="sign-in-form">
<input type="hidden" name="id" value="<?= $_GET['id'] ?>">
<?php
include("../Controlador/actualizarControlador.php");
$datos = $sql->fetch_object();
?>
<div class="input__field">
<i class="fas fa-user"></i>
<input name="nombre" type="text" placeholder="Nombres" value="<?= $datos->nombre ?>">
</div>
<div class="input__field">
<i class="fa-solid fa-signature"></i>
<input type="text" name="apellido" placeholder="Apellidos" value="<?= $datos->apellido ?>">
</div>
<div class="input__field">
<i class="fas fa-envelope"></i>
<input name="email" type="email" placeholder="Correo" value="<?= $datos->mail ?>">
</div>
<div class="input__field">
<i class="fas fa-user-tie"></i>
<input list="rol" type="text" name="rol" value="<?= $datos->rol?>">
<datalist id="rol">
<option value="profesor"></option>
<option value="estudiante"></option>
</datalist>
</div>
<div class="input__field">
<i class="fas fa-lock"></i>
<select name="estado">
<option value="" disabled selected>Estado de la cuenta</option>
<option value="activo">Activo</option>
<option value="inactivo">Inactivo</option>
</select>
</div>
<input name="actualizar" type="submit" value="Actualizar" class="btn solid">
</form>
</div>
</div>
<div class="panels__container">
<div class="panel left-panel">
<div class="content">
<h3>Editar usuario</h3>
<p>Aqui podras editar la información del usuario que has seleccionado</p>
</div>

<img src="../assets/img/log.svg" class="image" alt="login">
</div>
</div>
</div>
5 changes: 4 additions & 1 deletion assets/css/ingresar.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ body, input {
font-family: 'Quicksand', sans-serif;
}

body {
width: 100%;
}

.container {
position: relative;
width: 100%;
min-height: 100vh;
background-color: #fff;
overflow: hidden;
Expand Down
1 change: 1 addition & 0 deletions assets/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ footer {
color: #fff;
font-weight: 600;
border-radius: 1rem 1rem 0 0;
position: relative;
bottom: 0;
text-align: center;
gap: 10px;
Expand Down
32 changes: 1 addition & 31 deletions assets/css/mision-vision.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,8 @@ body{
background-size: cover;
}

.header{
background-color: #9c4900;
width: 100%;
height: 90px;
padding: 10px;
display: flex;
justify-content: space-around;
align-items: center;
text-align: center;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
color: #fff;
}

.back a{
text-decoration: none;
padding: 20px;
color: inherit;
display: flex;
gap: 10%;
margin: 10px;
background-color: #9b6433;
align-items: center;
border-radius: 2rem;
}

.back a:hover{
background-color: rgb(255, 120, 2);
}

.main{
height: 100vh;
min-height: 100vh;
width: 100%;
max-height: 1000px;
}
Expand Down
1 change: 1 addition & 0 deletions assets/css/principal.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

body {
background-color: #e0e0e0;
min-height: 100vh;
}

main,
Expand Down

0 comments on commit a4c4bf3

Please sign in to comment.