-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathfix.php
More file actions
205 lines (197 loc) · 6.02 KB
/
Copy pathfix.php
File metadata and controls
205 lines (197 loc) · 6.02 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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<?php
session_start();
require_once "Database/Database.php";
if ($_SESSION['username'] == null) {
echo "<script>alert('Please login.');</script>";
header("Refresh:0 , url=index.html");
exit();
}
$username = $_SESSION['username'];
$sql_fetch_todos = "SELECT * FROM product ORDER BY id ASC";
$query = mysqli_query($conn, $sql_fetch_todos);
?>
<!doctype html>
<html lang="en">
<head>
<title>Editar Producto</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="dp.png">
<link href="https://fonts.googleapis.com/css2?family=Mitr&display=swap" rel="stylesheet">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #fd7e1b;
}
.header {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
height: 50px;
padding: 5px 13px 11px 0px;
width: 100%;
color: white;
font-family: Arial, Helvetica, sans-serif;
margin-top: 0px;
bottom: 0;
background-color: #298dba;
}
.header p {
margin-left: 20px;
text-align: left;
}
.button-logout {
position: relative;
margin-top: -50px;
margin-right: 20px;
float: right;
text-decoration: none;
border: transparent;
border-radius: 15px;
background-color: #e60000;
padding: 10px 10px 10px 10px;
color: white;
transition: 0.5s;
}
.button-logout:hover {
background-color: #D9ddd4;
color: red;
}
.container {
margin: 90px auto;
margin-bottom: 50px;
border-radius: 30px;
text-align: center;
background-color: white;
width: 40%;
padding-bottom: 10px;
}
table th,
tr,
td {
border: 1px solid black;
border-collapse: collapse;
padding: 10px 0px 10px 0px;
}
table {
width: 100%;
}
th {
color: white;
background-color: #298dba;
}
tr {
background-color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
.timeregis {
text-align: center;
}
.form-group{
margin-left: 600px;
}
[type=text]{
font-family: "Mitr", sans-serif;
border-radius: 15px;
border: transparent;
padding: 7px 200px 7px 5px;
}
.return{
border-radius: 15px;
background-color: #ffcc33;
color: black;
text-decoration: none;
padding: 4px 40px 4px 40px;
margin: 0px 0px 50px 100px;
font-size: 20px;
transition: 0.5s;
}
.return:hover{
background-color: #fdb515;
color: white;
}
.modify{
border-radius: 15px;
border: transparent;
color: white;
padding: 4px 40px 4px 40px;
margin: 0px 50px 50px 100px;
font-size: 20px;
border-collapse: collapse;
background-color: #00A600;
font-family: "Mitr", sans-serif;
transition: 0.5s;
}
.modify:hover{
color: black;
background-color: #BBFFBB;
}
</style>
</head>
<body>
<div class="header">
<h3>ConfiguroWeb</h3>
<a name="" id="" class="button-logout" href="logout.php" role="button">Cerrar Sesión</a>
</div>
<div class="container">
<h1>Lista de Productos</h1>
<h2>Has accedido como <?php echo $str = strtoupper($username) ?></h2>
</div>
<div class="table-product">
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">Orden</th>
<th scope="col">ID:Producto</th>
<th scope="col">Nombre:Producto</th>
<th scope="col">Cantidades</th>
<th scope="col">Fecha:Registro</th>
</tr>
</thead>
<tbody>
<?php
$idpro = 1;
while ($row = mysqli_fetch_array($query)) { ?>
<tr>
<td scope="row"><?php echo $idpro ?></td>
<td><?php echo $row['id'] ?></td>
<td><?php echo $row['proname'] ?></td>
<td><?php echo $row['amount'] ?></td>
<td class="timeregis"><?php echo $row['time'] ?></td>
</tr>
<?php
$idpro++;
} ?>
</tbody>
</table>
<br>
</div>
<div class="fixproduct">
<form method="POST" action="main/fix.php">
<div class="form-group">
<label for="exampleInputEmail1">Nombre del Producto</label>
<br>
<input type="text" class="form-control" name="name" value="<?php echo $_GET['message']; ?>" required>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Cantidad</label>
<br>
<input type="text" value="<?php echo $_GET['amount'] ?>" class="form-control" name="value" required>
<input type="hidden" value="<?php echo $_GET['id'] ?>" name="id" />
</div>
<br>
<div class="form-button">
<button type="submit" class="modify" style="float:right">Editar</button>
<a name="" id="" class="return" href="list.php" role="button" style="float:left">Volver</a>
</div>
</form>
</div>
<?php
mysqli_close($conn);
?>
</body>
</html>