-
Notifications
You must be signed in to change notification settings - Fork 2
/
admin.products.html
368 lines (347 loc) · 18.3 KB
/
admin.products.html
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./assets/css/bootstrap.css">
<link rel="stylesheet" href="./assets/css/header.style.css">
<link rel="stylesheet" href="./assets/css/container.style.css">
<link rel="stylesheet" href="./assets/css/admin.style.css">
<link rel="stylesheet" href="./assets/css/sidebar.style.css">
</head>
<body>
<header class="header">
<nav class="navbar navbar-expand-lg">
<div class="container">
<!-- Navbar brand--><a href="index.html" class="navbar-brand font-weight-bold">
<h1 class="title-header">Hip-SHop</h1></a>
<!-- Navbar toggler button-->
<button type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler navbar-toggler-right">Menu<i class="icon ion-md-list ml-2"></i></button>
<div id="navbarSupportedContent" class="collapse navbar-collapse">
<ul class="navbar-nav mx-auto ml-auto">
<!-- Link-->
<li class="nav-item"> <a href="rap-freestyle.html" class="nav-link">Rap & Freestyle</a></li>
<!-- Link-->
<li class="nav-item"> <a href="breaking.html" class="nav-link">Breaking</a></li>
<!-- Link-->
<li class="nav-item"> <a href="djs-beatmakers.html" class="nav-link">DJs & Beatmakers</a></li>
<li class="nav-item"> <a href="graffiti.html" class="nav-link">Graffiti</a></li>
<!-- <li class="nav-item"> <a href="#" class="nav-link">Mujeres</a></li>
<li class="nav-item"> <a href="#" class="nav-link">Hombres</a></li> -->
</ul>
<ul class="navbar-nav">
<li class="nav-item" id="loginButton"><a href="#" data-bs-toggle="modal" data-bs-target="#modalForm" class="nav-link font-weight-bold mr-3">Iniciar</a></li>
<li class="nav-item" id="signupButton"><a href="#" data-bs-toggle="modal" data-bs-target="#modalSignup" class="navbar-btn btn btn-primary">Registrarse</a></li>
<li class="nav-item" id="nameButton"><a href="perfil.html" class="nav-link font-weight-bold mr-3" style="font-family: 'SedgwickAveDisplay';font-size: 1.5rem;">Ernesto</a></li>
<li class="nav-item" id="cartIcon" ><a href="cart.html"><svg xmlns="http://www.w3.org/2000/svg" width="50" style="cursor: pointer;margin-left:20px;" height="50" fill="currentColor" class="bi bi-cart" viewBox="0 0 16 16">
<path d="M0 1.5A.5.5 0 0 1 .5 1H2a.5.5 0 0 1 .485.379L2.89 3H14.5a.5.5 0 0 1 .491.592l-1.5 8A.5.5 0 0 1 13 12H4a.5.5 0 0 1-.491-.408L2.01 3.607 1.61 2H.5a.5.5 0 0 1-.5-.5zM3.102 4l1.313 7h8.17l1.313-7H3.102zM5 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm-7 1a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm7 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
</svg></a></li>
</ul>
</div>
</div>
</nav>
</header>
<!-- Modal container Login-->
<div class="modal fade" id="modalForm" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Iniciar sesión</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="form-floating">
<input type="text" class="form-control" id="aka" placeholder="Correo electronico">
<label for="aka">A.K.A.</label>
</div>
<br>
<div class="form-floating">
<input type="password" class="form-control" id="password" placeholder="Contraseña">
<label for="password">Contraseña</label>
</div>
<br>
<div class="modal-footer d-block">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-label="Close">Cancelar</button>
<button type="button" id="login" style="float: right;" class="btn btn-success">Iniciar sesión</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modalSignup" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Regístrate</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="form-floating">
<input type="text" class="form-control" id="usernameRegister" placeholder="Correo electronico">
<label for="correoElectronico">A.K.A.</label>
</div>
<br>
<div class="form-floating">
<input type="password" class="form-control" id="passwordRegister" placeholder="Contraseña">
<label for="password">Contraseña</label>
</div>
<br>
<div class="form-floating">
<input type="password" class="form-control" id="passwordRegisterConfirm" placeholder="Repite tu contraseña">
<label for="password">Repite tu contraseña</label>
</div>
<br>
<div class="modal-footer d-block">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-label="Close">Cancelar</button>
<button type="button" style="float: right;" id="registerButton" class="btn btn-success">Registrarse</button>
</div>
</div>
</div>
</div>
</div>
<!-- Modal container -->
<div class="modal fade" id="modalForm" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" >Producto</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="form-floating">
<input type="text" class="form-control" placeholder="Nombre del producto" value="Nike 10 Aczino">
<label for="floatingPassword">Nombre del producto</label>
</div>
<br>
<ul class="list-size">
<li>
<div class="form-floating">
<span class="remove-table">-</span>
<input type="text" class="form-control" placeholder="Nombre del producto">
<label for="floatingPassword">Talla</label>
</div>
<table class="table products">
<thead>
<tr>
<th>Color:</th>
<th>Piezas disponibles:</th>
</tr>
</thead>
<tbody>
<tr>
<td> <input type="color" value="#000000"></td>
<td> <input type="text" value="0"></td>
<td>
<span class="remove-row">-</span> </td>
</tr>
</tbody>
</table>
<span class="add-row">+</span>
</li>
</ul>
<span class="add-table">+</span>
<div>
<h5>Imágenes:</h5>
<input type="file" id="imagesUpload" multiple>
</div>
<br>
<div class="form-floating">
<input type="text" class="form-control" placeholder="Nombre del producto" value="1200">
<label for="floatingPassword">Costo</label>
</div>
<div class="modal-footer d-block">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-label="Close">Cerrar</button>
<button type="button" style="float: right;" class="btn btn-success">Guardar</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="newItemForm" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Agregar nuevo workshop</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="form-floating">
<input type="text" class="form-control" id="productName" placeholder="Password">
<label for="floatingPassword">Nombre del producto</label>
</div>
<div class="form-floating">
<input type="text" class="form-control" id="imagen" placeholder="Password">
<label for="floatingPassword">Imagen</label>
</div>
<div class="form-floating">
<input type="text" class="form-control" id="precio" placeholder="Password">
<label for="floatingPassword">Precio</label>
</div>
<div class="form-floating">
<input type="text" class="form-control" id="fecha" placeholder="Password">
<label for="floatingPassword">Fecha</label>
</div>
<div class="form-floating">
<input type="text" class="form-control" id="location" placeholder="Password">
<label for="floatingPassword">Location</label>
</div>
<div class="modal-footer d-block">
<button type="button" class="btn btn-danger" id="autofill" >Autollenar</button>
<button type="button" style="float: right;" class="btn btn-success" id="saveWorkshop">Guardar</button>
</div>
</div>
</div>
</div>
</div>
<div class="container container-fluid-px py-6">
<div class="row">
<!-- Grid -->
<div class="products-grid col-xl-9 col-lg-8 order-lg-2">
<section class="items">
<div class="row row-items">
<div class="col-12">
<div>
<h1 style="display:inline-block;margin: 15px 0;font-size: 2rem;color: #484848;">Productos</h1>
<button href="#" data-bs-toggle="modal" data-bs-target="#newItemForm" class="btn btn-primary" style="float: right;margin: 13px 0;">Agregar nuevo producto</button>
</div>
<table class="table">
<thead>
<tr>
<th>Producto:</th>
<th>Disponibilidad:</th>
<th>Costo:</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#" data-bs-toggle="modal" data-bs-target="#modalForm"><img class="product-image" src="./assets/img/tenis1.webp"></a>
</td>
<td>
<div>
<div>
<span>Talla 25</span>
<ul class="list-colors">
<li class="element-list-colors"><span class="color-list-element" style="background-color: #000;box-shadow: 0px 2px 4px 0px #404040;">10</span></li>
<li class="element-list-colors"><span class="color-list-element" style="background-color: #d70000;box-shadow: 0px 2px 4px 0px #404040;">20</span></li>
<li class="element-list-colors"><span class="color-list-element" style="background-color: #21d7a4;box-shadow: 0px 2px 4px 0px #404040;">10</span></li>
<li class="element-list-colors"><span class="color-list-element" style="background-color: #0800ff;box-shadow: 0px 2px 4px 0px #404040;">30</span></li>
<li class="element-list-colors"><span class="color-list-element" style="background-color: #fb0dcb;box-shadow: 0px 2px 4px 0px #404040;">5</span></li>
</ul>
</div>
<div>
<span>Talla 28</span>
<ul class="list-colors">
<li class="element-list-colors"><span class="color-list-element" style="background-color: #000;box-shadow: 0px 2px 4px 0px #404040;">10</span></li>
<li class="element-list-colors"><span class="color-list-element" style="background-color: #d70000;box-shadow: 0px 2px 4px 0px #404040;">20</span></li>
<li class="element-list-colors"><span class="color-list-element" style="background-color: #21d7a4;box-shadow: 0px 2px 4px 0px #404040;">10</span></li>
<li class="element-list-colors"><span class="color-list-element" style="background-color: #0800ff;box-shadow: 0px 2px 4px 0px #404040;">30</span></li>
<li class="element-list-colors"><span class="color-list-element" style="background-color: #fb0dcb;box-shadow: 0px 2px 4px 0px #404040;">5</span></li>
</ul>
</div>
</div>
</td>
<td>$1,610.00</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
<!-- Sidebar-->
<div class="sidebar col-xl-3 col-lg-4 pr-xl-5 order-lg-1">
<div class="sidebar-block px-3 px-lg-0">
<!-- Brand filter menu - this menu has .show class, so is expanded by default-->
<div class="admin-sidebar" style="font-size: 1.5rem;">
<ul class="sidebar-list">
<li class="sidebar-list-item"><a href="admin.index.html" class="sidebar-list-item-anchor">Dashboard</a></li>
<li class="sidebar-list-item"><a href="admin.sales.html" class="sidebar-list-item-anchor">Ventas</a></li>
<li class="sidebar-list-item"><a href="admin.orders.html" class="sidebar-list-item-anchor">Pedidos</a></li>
<li class="sidebar-list-item"><a href="admin.products.html" class="sidebar-list-item-anchor">Productos</a></li>
<li class="sidebar-list-item"><a href="admin.settings.html" class="sidebar-list-item-anchor">Ajustes</a></li>
</ul>
</div>
</div>
</div>
<!-- /Sidebar end-->
</div>
</div>
<!--Footer-->
<div class="piedepag">
<br>
<br>
<p class="mpie">Categorias</p>
<button type="button" class="btn btn-light mpie me-1">Rap & Freestyle</button>
<button type="button" class="btn btn-light me-1">Break Dance</button>
<button type="button" class="btn btn-light me-1"><a href="djs-beatmakers.html" style="color: black;">Dj's & Beatmakers</a></button>
<button type="button" class="btn btn-light me-1">Graffiti</button>
<p class="mpie mt-3">Artistas Destacado</p>
<button type="button" class="btn btn-light mpie me-1">Masta Quba</button>
<button type="button" class="btn btn-light me-1">Pat Boy</button>
<button type="button" class="btn btn-light me-1">Skafo LaFaro</button>
<button type="button" class="btn btn-light me-1">Olmeca</button>
<p class="mpie mt-3">Articulos</p>
<button type="button" class="btn btn-light mpie me-1">Hodies</button>
<button type="button" class="btn btn-light me-1">Playeras</button>
<button type="button" class="btn btn-light me-1">Tennis</button>
<button type="button" class="btn btn-light me-1">Arte</button>
<button type="button" class="btn btn-light me-1">Stickers</button>
<p class="newslet fuentenew mt-3">Newsletter</p>
<p class="newslet">SUSCRÍBETE A NUESTRO NEWSLETTER Y RECIBE NUESTRAS PROMOCIONES DIRECTAMENTE EN TU CORREO</p>
<div class="input-group mt-3 cartas" style="width: 50%;">
<input type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username with two button addons">
<button class="btn btn-outline-light" type="button" style="width: 92px;">Hombre</button>
<button class="btn btn-outline-light" type="button" style="width: 92px;"> Mujer</button>
<button class="btn btn-outline-light" type="button">Suscribete</button>
</div>
<br>
<br>
<img src="assets/images/fotter1.jpg" alt="" style="width: 99%;">
</div>
<script src="./assets/js/jquery.js"></script>
<script src="./assets/js/admin.products.js"></script>
<script src="./assets/js/bootstrap.bundle.js"></script>
<script src="./assets/js/jquery.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>
$("#autofill").click(function(){
$("#productName").val("Workshop de prueba");
$("#imagen").val("https://tremending.com/wp-content/uploads/2018/03/rapworkshop2-629x400.jpg");
$("#precio").val("1500");
$("#fecha").val("23-10-2021");
$("#location").val("Este workshop sera llevado a cabo en Eje central #50");
});
$("#saveWorkshop").click(function(){
let request = $.ajax({
url: "http://localhost:8080/workshop",
method: "POST",
contentType: 'application/json',
beforeSend: function (xhr) {
xhr.setRequestHeader('Authorization', localStorage.getItem("token"));
},
data: JSON.stringify({
"productName" :$("#productName").val(),
"image":$("#imagen").val(),
"price": $("#precio").val(),
"date": $("#fecha").val(),
"location": $("#location").val()
})
});
request.done(function( data ) {
swal("Genial", "Ya guardaste un workshop", "success");
});
request.fail(function( jqXHR, textStatus ) {
if(localStorage.getItem("token")){
swal("No se ha guardado", "No se ha podido guardar, intenta de nuevo despues", "error");
}else{
swal("No se ha guardado", "Inicia sesion primero", "error");
}
});
});
</script>
<script src="./assets/js/register.js"></script>
</body>
</html>