-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcurso-edit.php
More file actions
99 lines (93 loc) · 3.38 KB
/
curso-edit.php
File metadata and controls
99 lines (93 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
include 'layout/header.php';
if(!isset($_POST)){
header("Location:admin-cursos.php");
}else{
$id = $_GET['id'];
}
?>
<body>
<?php include 'layout/aside.php'; ?>
<section class="home-section">
<?php include 'layout/perfil.php';?>
<div class="home-content">
<div class="center ">
<div class="box-titles">
<h1 class="title">Editar Curso</h1>
<div class="box-botones">
<a class="btn" href="javascript:history.back()" title="Atras"><i class="fas fa-arrow-left"></i></a>
</div>
</div>
<?php if(isset($_SESSION['completado'])): ?>
<div class="alerta-exito">
<?=$_SESSION['completado']?>
</div>
<?php elseif(isset($_SESSION['fallo'])): ?>
<div class="alerta-error">
<?=$_SESSION['fallo']?>
</div>
<?php endif; ?>
<div class="container-wrap mg-auto w100">
<div class="inner-content mg-bt20 w70">
<?php
$datos = obtenerdatos($db, 'cursos', $id);
if(!empty($datos) && mysqli_num_rows($datos) >= 1):
while($dato = mysqli_fetch_assoc($datos)):
?>
<form action="models/updates/upcurso.php" class="box-formulario" enctype="multipart/form-data" method="post">
<div class="w100 container-wrap mg-bt10" >
<div class="box-input">
<label for="nombre">Nombre de la Fase: </label>
<input class="w100" type="hidden" name="id" value="<?php echo $dato['id']; ?>">
<input class="w100" type="text" name="nombre" value="<?php echo $dato['nombre']; ?>">
</div>
<div class="box-input">
<label for="descripcion">descripcion: </label>
<textarea name="descripcion" rows="5"><?php echo $dato['descripcion']; ?></textarea>
</div>
<div class="box-input">
<label for="orden">Orden a Mostrar: </label>
<input class="w100" type="number" name="orden" value="<?php echo $dato['orden']; ?>" min="1">
</div>
<div class="box-input">
<label for="">Fase: </label>
<select class="w70" name="fase">
<?php
$fases = selectalldatos($db, 'fases');
if(!empty($fases) && mysqli_num_rows($fases) >= 1):
while($fase = mysqli_fetch_assoc($fases)):
?>
<option value="<?=$fase['id']?>" <?=($fase['id']) == $dato['fase_id'] ? 'selected="selected"': '' ?>>
<?=$fase['nombre']?>
</option>
<?php
endwhile;
endif;
?>
</select>
</div>
<div class="box-input">
<label for="">Cambiar Imagen:</label>
<input class="w100" type="hidden" name="documento" value="<?php echo $dato['imagen']; ?>">
<img src="assets/img/cursos/<?php echo $dato['imagen'] ?>" alt=""><hr class="w100 mg-bt10">
<input class="w100" type="file" name="foto" >
</div>
<?php
endwhile;
endif;
?>
</div>
<input type="submit" value="Actualizar Datos" class="btn">
</form>
</div>
</div>
</div>
<!-- center -->
<!-- <a class="btn" href="contenedor.php"> Inicio</a> -->
<!-- <a class="btn" href="javascript:history.back()">Atrás</a> -->
<?php borrarErrores(); ?>
</div>
</section>
<?php include 'layout/footer.php'; ?>
</div>
</main>