-
Notifications
You must be signed in to change notification settings - Fork 0
/
editar_estudiante.php
126 lines (109 loc) · 4.88 KB
/
editar_estudiante.php
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php include('header.php'); ?>
<?php include('sesion.php'); ?>
<?php $get_id = $_GET['id']; ?>
<body>
<?php include('navbar.php');?>
<center><img src="images/logoISJU.png"></center>
<div class="container-fluid">
<div class="row-fluid">
<?php include('barra_lateral_estudiantes.php'); ?>
<div class="span9" id="">
<div class="row-fluid">
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left"><i class="icon-pencil icon-large"></i> Editar Estudiante</div>
<div class="muted pull-right"><a href="estudiantes.php"><i class="icon-arrow-left icon-large"></i> Volver</a></div>
</div>
<div class="block-content collapse in">
<?php
$query = mysqli_query($connection,"select * from estudiantes where estudiante_id = '$get_id'");
$row = mysqli_fetch_array($query);
?>
<form id="editar_estudiante" class="form-signin" method="post">
<!-- span 4 -->
<div class="span4">
<input type="hidden" value="<?php echo $row['estudiante_id']; ?>" class="input-block-level" name="estudiante_id" required>
<label>Nombres:</label>
<input type="text" class="input-block-level" name="nombres" value="<?php echo $row['nombres']; ?>" required>
<label>Apellido:</label>
<input type="text" class="input-block-level" name="apellido" value="<?php echo $row['apellido']; ?>"required>
<label>Genero:</label>
<select name="genero_id" class="span5" required>
<option></option>
<option>Maculino</option>
<option>Femenino</option>
<option>Sin Especificar</option>
<?php
$result1 = mysqli_query($connection,"select * from genero");
while($row1 = mysqli_fetch_array($result1)){
$myclass1 = $row1['genero_id'];
?>
<?php }?>
</select>
<label>email:</label>
<input type="email" class="input-block-level" name="email" value="<?php echo $row['email']; ?>"required>
</div>
<div class="span4">
<label>Telefono:</label>
<input type="text" class="input-block-level" name="telefono" value="<?php echo $row['telefono']; ?>">
<label>Fecha de Nacimiento:</label>
<input type="date" class="input-block-level" name="fec_nac" value="<?php echo $row['fec_nac']; ?>">
<label>Direccion:</label>
<input type="text" value="<?php echo $row['direccion']; ?>" name="direccion" class="my_message" required>
<br>
<br>
<button class="btn btn-success" name="update"><i class="icon-save icon-large"></i> Actualizar</button>
</div>
<!--end span 4 -->
<!-- span 4 -->
<div class="span4">
<input type="hidden" value="<?php echo $row['estudiante_id']; ?>" class="input-block-level" name="estudiante_id" required>
<label>Localidad:</label>
<input type="text" class="input-block-level" name="localidad" value="<?php echo $row['localidad']; ?>" required>
<label>Carrera:</label>
<select name="carrera_id" class="span5" required>
<option></option>
<option>Tec. Sup. en Desarrollo de Software</option>
<option>Tec. Sup. en Desarrollo de Diseño Grafico</option>
<?php
$result = mysqli_query($connection,"select * from carrera");
while($row = mysqli_fetch_array($result)){
$myclass = $row['carrera_id'];
?>
<?php }?>
</select>
</div>
</div>
<!--end span 4 -->
<div class="span12"><hr></div>
</form>
<script>
jQuery(document).ready(function($){
$("#editar_estudiante").submit(function(e){
e.preventDefault();
var _this = $(e.target);
var formData = $(this).serialize();
$.ajax({
type: "POST",
url: "actualizar_estudiante.php",
data: formData,
success: function(html){
$.jGrowl("Estudiante actualizado con éxito", { header: 'Estudiante Actualizado' });
window.location = 'estudiantes.php';
}
});
});
});
</script>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>