-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patheliminator.php
192 lines (116 loc) · 4.35 KB
/
eliminator.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
require "db/db.php";
if($_POST){
if($_POST["value"]==3){
$database->update("tbusers",["state"=>"Desactivo" ],["idUser"=>$_POST["id"]]);
//echo $_POST["id"];
header ("Location: principal.php#contClient");
}
if($_POST["value"] == 1){
$database->update("tbreservations",
["state" => 0],
["idReservation" => $_POST["id"]]);
header ("Location: principal.php#contReservation");
}
}
if($_GET){
$id=$_GET['id'];
$type=$_GET['type'];
if($type == 1){
$data = $database -> select('tbreservations',
['date',
'peopleAmount',
'reservationHour',
'clientName',
'idReservation',
'state'],
['idReservation'=>$id]);
if($data[0]['state']==1){
$state="Activo";
}else{
$state="Terminado";
}
$value=1;
}
if($type == 3){
$data = $database->select("tbusers", "*", ["idUser" => $id]);
$value=3;
}
}
?>
<html>
<head>
<title>Administar</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="css/edittable.css">
</head>
<body>
<!--the variable $ value, serves to identify where the data
and show the user . because they are different forms.-->
<div class=" col-xs-12 col-sm-12 col-md-4">
<div class="container img1">
<div class="container-data">
<?php
/*
if($value==0){
header ("Location: principal.php#contClient");
}
*/
if($value==1){
echo "<form action='eliminator.php' method='post'>
<div class='labelStyle'>
<label>Nombre</label>
<br></br>
<label>Cantidad mesas</label>
<br></br>
<label>Hora de reservacion</label>
<br></br>
<label>Fecha</label>
<br></br></br>
<label>Estado</label>
</div>
<div>
<input class='inputStyle' readonly=”readonly” name='' value=".$data[0]["clientName"]."><br>
<input class='inputStyle' readonly='readonly' name='peopleAmount' value=".$data[0]["peopleAmount"]."><br>
<input class='inputStyle' readonly='readonly' name='reservationHour' value=".$data[0]["reservationHour"]."><br>
<input class='inputStyle' readonly='readonly' name='date' value=".$data[0]["date"].">
</br>
<input class='inputStyle' readonly='readonly' name='state' value=".$state.">
<input type='hidden' name='id' value=".$data[0]["idReservation"].">
</div>
<input type='hidden' name='value' value=1>
<input id='buttom' type='submit' value='ELIMINAR'>
<input id='buttom' type='button' value='CANCELAR' onclick='history.back();'>
</form>";
}
if($value == 3){
echo "
<form action='eliminator.php' method='post'>
<div class='labelStyle'>
<label>Nombre</label>
<br></br>
<label>Identificacion</label>
<br></br>
<label>Login</label>
</div>
<div>
<input class='inputStyle' readonly='readonly' name='' value=".$data[0]["name"]."><br>
<input class='inputStyle' readonly='readonly' name='identificacion' value=".$data[0]["identification"]."><br>
<input class='inputStyle' readonly='readonly' name='login' value=".$data[0]["login"]."><br>
<input class='inputStyle' type='hidden' name='id' value=".$data[0]["idUser"].">
<input class='inputStyle' type='hidden' name='value' value=3>
</div>
<br></br>
<input id='buttom' type='submit' value='ELIMINAR'>
<input id='buttom' type='button' value='CANCELAR' onclick='history.back();'>
</form>";
}
?>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 footerStyle">
<p>®Todos los derechos reservados - Proyecto Multimedios 2016</p>
</div>
</div>
</div>
</body>
</html>