-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngine.php
More file actions
71 lines (54 loc) · 1.72 KB
/
Copy pathEngine.php
File metadata and controls
71 lines (54 loc) · 1.72 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
<?php
require_once ('Conexion.php');
class Engine extends Conexion
{
function __construct()
{
$this->db = parent::__construct();
}
public function Add($nombre, $cargo, $area,$ciudad, $correo, $telefono, $observacion)
{
$query = $this->db->prepare("INSERT INTO tickets (Fecha , Nombre, Cargo, Area, Ciudad, Correo, Telefono, Observacion) VALUES (NOW(),:Nombre,:Cargo,:Area,:Ciudad,:Correo,:Telefono,:Observacion);");
$query->bindParam(':Nombre',$nombre);
$query->bindParam(':Cargo',$cargo);
$query->bindParam(':Area', $area);
$query->bindParam(':Ciudad', $ciudad);
$query->bindParam(':Correo',$correo);
$query->bindParam(':Telefono',$telefono);
$query->bindParam(':Observacion',$observacion);
if($query->execute())
{
echo "Se agrego un nuevo ticket de: ".$nombre;
}
else
{
echo "Error en la ejecucuion del query";
}
}
}
$Conexion1 = new Engine();
$nombre = $_POST['Nombre'];
$cargo = $_POST['Cargo'];
$area = $_POST['Area'];
$ciudad = $_POST['Ciudad'];
$email = $_POST['Email'];
$telefono = $_POST['Telefono'];
$observacion = $_POST['Observacion'];
$valores = array("Nombre" => $nombre, "Cargo" => $cargo, "Area" => $area, "Ciudad" => $ciudad, "Email" => $email, "Telefono" => $telefono, "Observacion" => $observacion);
$Conexion1->Add($nombre,$cargo,$area,$ciudad,$email,$telefono,$observacion);
?>
<br><br>
<button><a href="Usuario.php">Crear un nuevo ticket</a></button>
<br><br><h4>Los datos exportados son</h4>
<table border="1">
<tr>
<th>Campo</th>
<th>Dato</th>
</tr>
<?php foreach ($valores as $key => $value) {?>
<tr>
<td><?php echo $key ?></td>
<td><?php echo $value ?></td>
</tr>
<?php } ?>
</table>