-
Notifications
You must be signed in to change notification settings - Fork 0
/
RegistrarTecnico.php
54 lines (53 loc) · 2.5 KB
/
RegistrarTecnico.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Registrar Técnico </title>
<?php $page='RegistrarTecnico'; include("Header.php");
$dbconn = pg_connect("host=159.89.34.186 dbname=aeropuerto user=postgres password=papitopiernaslargas69");
if($dbconn){
$result = pg_query($dbconn,"SELECT no_modelo FROM MODELO");
foreach (pg_fetch_all($result) as $row) {
$combobit .="<option value='".$row['no_modelo']."'>".$row['no_modelo']."</option>";
}
}
pg_close($dbconn);
?>
</head>
<body>
<form class='form_base' action="./RegistrarTecnico.php" method="post">
<h1>Registrar Técnico</h1>
<label>Ingrese DNI</label>
<input type="text" name="dni" required="required" pattern="[0-9]{13}" placeholder="Numero De Identidad">
<label>Ingrese Numero De Afiliación</label>
<input type="text" name="nsindicato" required="required" pattern="[0-9]{10}" placeholder="Numero De Sindicato">
<label>Ingrese Nombre</label>
<input type="text" name="nombre" required="required" placeholder="Nombre Completo">
<label>Ingrese Dirección</label>
<input type="text" name="direccion" required="required" placeholder="Direccion De Casa">
<label>Ingrese Telefono</label>
<input type="text" name="telefono" required="required" pattern="^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$" placeholder="Numero De Telefono">
<label>Ingrese Sueldo</label>
<input type="text" name="sueldo" required="required" pattern="\d{4,}" placeholder="Sueldo En Lempiras">
<label>Modelo</label>
<select name="modelo" placeholder="prueba">
<?php echo($combobit);?>
</select>
<label>Maestria</label>
<input type="text" name="maestria" required="required" placeholder="Maestria">
<label>Contraseña</label>
<input type="password" name="pass" required="required" pattern=".{8,}" placeholder="Contraseña">
<input type="submit" name="tecnico" value="Registrar">
</form>
<?php
$dbconn = pg_connect("host=159.89.34.186 user=postgres dbname=aeropuerto password=papitopiernaslargas69");
if($dbconn){
if (isset($_POST['tecnico'])) {
pg_query_params($dbconn,"SELECT addtecnico($1,$2,$3,$4,$5,$6,$7,$8,$9);",array($_REQUEST['dni'],$_REQUEST['nsindicato'],$_REQUEST['nombre'],$_REQUEST['direccion'],$_REQUEST['telefono'],$_REQUEST['sueldo'],sha1($_REQUEST['pass']),$_REQUEST['modelo'],$_REQUEST['maestria']));
echo("<script>alert('Tecnico Creado!');</script>");
}
pg_close($dbconn);
}
?>
</body>
</html>