-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathventas.php
381 lines (336 loc) · 15.7 KB
/
ventas.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
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
369
370
371
372
373
374
375
376
377
378
379
380
381
<?php
require_once("class/class.php");
if(isset($_SESSION['acceso'])) {
if ($_SESSION['acceso'] == "administrador" || $_SESSION["acceso"] == "cajero") {
$con = new Login();
$con = $con->ContarRegistros();
$config = new Login();
$config = $config->ConfiguracionPorId();
$tra = new Login();
$ses = $tra->ExpiraSession();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="assets/images/favicon.png" rel="icon" type="image">
<link href="assets/plugins/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
<link href="assets/plugins/datatables/responsive.bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="assets/plugins/datatables/dataTables.bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="assets/css/icons.css" rel="stylesheet" type="text/css">
<link href="assets/css/style.css" rel="stylesheet" type="text/css">
<!-- script jquery -->
<script src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="assets/script/jquery.mask.js"></script>
<script type="text/javascript" src="assets/script/titulos.js"></script>
<script type="text/javascript" src="assets/script/script2.js"></script>
<script type="text/javascript" src="assets/script/validation.min.js"></script>
<script type="text/javascript" src="assets/script/script.js"></script>
<!-- script jquery -->
<!-- Calendario -->
<link rel="stylesheet" href="assets/calendario/jquery-ui.css" />
<script src="assets/calendario/jquery-ui.js"></script>
<script src="assets/script/jscalendario.js"></script>
<script src="assets/script/autocompleto.js"></script>
<!-- Calendario -->
</head>
<body onLoad="muestraReloj()" class="fixed-left">
<!-- Modal para mostrar detalles del producto-->
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" style="display: none">
<div class="modal-dialog modal-lg">
<div class="modal-content p-0 b-0">
<div class="panel panel-color panel-primary">
<div class="panel-heading">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><img src="assets/images/close.png"/></button>
<h3 class="panel-title"><i class="fa fa-clipboard"></i> Factura de Venta</h3>
</div>
<div class="panel-body">
<div id="muestraventasmodal"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-times-circle"></span> Aceptar</button>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div id="wrapper">
<div class="topbar">
<div class="topbar-left">
<div class="text-center">
<a href="panel" class="logo"><img src="assets/images/logo_white_2.png" height="50"></a>
<a href="panel" class="logo-sm"><img src="assets/images/logo_sm.png" height="50"></a>
</div>
</div>
<div class="navbar navbar-default" role="navigation">
<div class="container">
<div class="">
<div class="pull-left">
<button type="button" class="button-menu-mobile open-left waves-effect waves-light"><i class="ion-navicon"></i> </button>
<span class="clearfix"></span></div>
<form class="navbar-form pull-left" role="search">
<div class="form-group">
<input class="form-control search-bar" placeholder="Búsqueda..." type="text">
</div>
<button type="submit" class="btn btn-search"><i class="fa fa-search"></i></button>
</form>
<ul class="nav navbar-nav navbar-right pull-right">
<!--- MEJORAR DE AQUI ---->
<!-- Reloj start-->
<li id="header_inbox_bar" class="dropdown hidden-xs">
<a data-toggle="dropdown" class="hour" href="#">
<span id="spanreloj"></span>
</a>
</li>
<!-- Reloj end -->
<li class="dropdown hidden-xs">
<a href="#" data-target="#" class="dropdown-toggle waves-effect waves-light" data-toggle="dropdown" title="Notificaciones de Pedidos" aria-expanded="true">
<i class="fa fa-bell"></i>
<span class="badge badge-xs badge-danger"><?php echo $con[0]['stockproductos']+$con[0]['stockingredientes']+$con[0]['creditosventasvencidos']+$con[0]['creditoscomprasvencidos']; ?></span>
</a>
<ul class="dropdown-menu dropdown-menu-lg">
<li class="text-center notifi-title">Notificaciones</li>
<li class="list-group">
<!-- list item-->
<a href="javascript:void(0);" class="dropdown-toggle waves-effect list-group-item">
<div class="media">
<div class="pull-left">
<em class="fa fa-cart-plus fa-2x text-info"></em>
</div>
<div class="media-body clearfix">
<div class="media-heading">Productos en Stock Minimo</div>
<p class="m-0">
<small>Existen <span class="text-primary"><?php echo $con[0]['stockproductos']; ?></span> Productos en Stock</small>
</p>
</div>
</div>
</a>
<!-- list item-->
<a href="javascript:void(0);" class="list-group-item">
<div class="media">
<div class="pull-left">
<em class="fa fa-cart-arrow-down fa-2x text-primary"></em>
</div>
<div class="media-body clearfix">
<div class="media-heading">Ingredientes en Stock Minimo</div>
<p class="m-0">
<small>Existen <span class="text-primary"><?php echo $con[0]['stockingredientes']; ?></span> Ingredientes en Stock</small>
</p>
</div>
</div>
</a>
<!-- list item-->
<a href="javascript:void(0);" class="list-group-item">
<div class="media">
<div class="pull-left">
<em class="fa fa-truck fa-2x text-info"></em>
</div>
<div class="media-body clearfix">
<div class="media-heading">Créditos de Compras</div>
<p class="m-0">
<small>Existen <span class="text-primary"><?php echo $con[0]['creditoscomprasvencidos']; ?></span> Créditos Vencidos</small> </p>
</div>
</div>
</a>
<!-- last list item -->
<!-- list item-->
<a href="javascript:void(0);" class="list-group-item">
<div class="media">
<div class="pull-left">
<em class="fa fa-diamond fa-2x text-danger"></em>
</div>
<div class="media-body clearfix">
<div class="media-heading">Créditos de Ventas</div>
<p class="m-0">
<small>Existen <span class="text-primary"><?php echo $con[0]['creditosventasvencidos']; ?></span> Créditos Vencidos</small> </p>
</div>
</div>
</a>
<!-- last list item -->
</li>
</ul>
</li>
<!--- MEJORAR DE AQUI ---->
<li class="hidden-xs">
<a href="#" id="btn-fullscreen" class="waves-effect waves-light"><i class="fa fa-crosshairs"></i></a>
</li>
<li class="dropdown">
<a href="" class="dropdown-toggle profile waves-effect waves-light" data-toggle="dropdown" aria-expanded="true">
<span class="dropdown hidden-xs"><abbr title="<?php echo estado($_SESSION['acceso']); ?>"><?php echo $_SESSION['nombres']; ?></abbr></span>
<?php
if (isset($_SESSION['cedula'])) {
if (file_exists("fotos/" . $_SESSION['cedula'] . ".jpg")) {
echo "<img src='fotos/" . $_SESSION['cedula'] . ".jpg?' class='img-circle'>";
} else {
echo "<img src='fotos/avatar.jpg' class='img-circle'>";
}
} else {
echo "<img src='fotos/avatar.jpg' class='img-circle'>";
}
?> </a>
<ul class="dropdown-menu">
<li><a href="perfil"><i class="fa fa-user"></i> Mi Perfil</a></li>
<li><a href="password"><i class="fa fa-edit"></i> Actualizar Password </a></li>
<li><a href="bloqueo"><i class="fa fa-clock-o"></i> Bloquear Sesión</a></li>
<li class="divider"></li>
<li><a href="logout"><i class="fa fa-power-off"></i> Cerrar Sesión</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="left side-menu">
<div class="sidebar-inner slimscrollleft" style="overflow: hidden; width: auto; height: 566px;">
<div class="user-details">
<div class="text-center"> <?php
if (isset($_SESSION['cedula'])) {
if (file_exists("fotos/".$_SESSION['cedula'].".jpg")){
echo "<img src='fotos/".$_SESSION['cedula'].".jpg?' class='img-circle'>";
}else{
echo "<img src='fotos/avatar.jpg' class='img-circle'>";
} } else {
echo "<img src='fotos/avatar.jpg' class='img-circle'>";
}
?></div>
<div class="user-info">
<div class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><?php echo estado($_SESSION['acceso']); ?></a>
<ul class="dropdown-menu">
<li><a href="perfil"><i class="fa fa-user"></i> Mi Perfil</a></li>
<li><a href="password"><i class="fa fa-edit"></i> Actualizar Password </a></li>
<li><a href="bloqueo"><i class="fa fa-clock-o"></i> Bloquear Sesión</a></li>
<li class="divider"></li>
<li><a href="logout"><i class="fa fa-power-off"></i> Cerrar Sesión</a></li>
</ul>
</div>
<p class="text-muted m-0"><i class="fa fa-dot-circle-o text-success"></i> Online</p>
</div>
</div>
<!----- INICIO DE MENU ----->
<?php include('menu.php'); ?>
<!----- FIN DE MENU ----->
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="content-page">
<div class="content">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="page-header-title"><h4 class="pull-left page-title"><i class="fa fa-tasks"></i> Control de Ventas</h4>
<ol class="breadcrumb pull-right"><li><a href="panel">Inicio</a></li>
<li class="active">Control de Ventas</li>
</ol>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<form class="form" method="post" action="#" name="buscarventas" id="buscarventas">
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title"><i class="fa fa-tasks"></i> Búsqueda de Ventas</h3></div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-xs-12">
<div class="box-body">
<div id="delete-ok"></div>
<div class="row">
<div class="col-md-3">
<div class="form-group has-feedback">
<label class="control-label">Tipo de Búsqueda: <span class="symbol required"></span></label>
<i class="fa fa-bars form-control-feedback"></i>
<select name="tipobusqueda" id="tipobusqueda" class="form-control" tabindex="1" required="" aria-required="true">
<option value="">SELECCIONE</option>
<option value="1">POR CLIENTES</option>
<option value="2">POR CAJA</option>
<option value="3">POR FECHA</option>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group has-feedback">
<label class="control-label">Búsqueda de Clientes: <span class="symbol required"></span></label>
<input type="hidden" name="codcliente" id="codcliente">
<input class="form-control" type="text" name="busquedacliente" id="busquedacliente" onKeyUp="this.value=this.value.toUpperCase();" autocomplete="off" placeholder="Ingrese Criterio de Búsqueda" required="required">
<i class="fa fa-search form-control-feedback"></i>
</div>
</div>
<div class="col-md-3">
<div class="form-group has-feedback">
<label class="control-label">Seleccione Caja: <span class="symbol required"></span></label>
<i class="fa fa-bars form-control-feedback"></i>
<select name="codcaja" id="codcaja" class="form-control" required="" aria-required="true">
<option value="">SELECCIONE</option>
<?php
$caja = new Login();
$caja = $caja->ListarCajas();
for($i=0;$i<sizeof($caja);$i++){
?>
<option value="<?php echo $caja[$i]['codcaja']; ?>"><?php echo $caja[$i]['nrocaja']."-".$caja[$i]['nombrecaja']; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group has-feedback">
<label class="control-label">Ingrese Fecha de Venta: <span class="symbol required"></span></label>
<input class="form-control calendario" type="text" name="fecha" id="fecha" onKeyUp="this.value=this.value.toUpperCase();" autocomplete="off" placeholder="Ingrese Fecha de Venta" tabindex="2" required="" aria-required="true">
<i class="fa fa-calendar form-control-feedback"></i>
</div>
</div>
</div><br>
<div class="modal-footer">
<button type="button" onClick="BuscarVentas()" class="btn btn-primary"><span class="fa fa-search"></span> Realizar Búsqueda</button>
</div>
</div><!-- /.box-body -->
</div>
</div>
</div>
</div>
<div id="muestraventas"></div>
</form>
</div>
</div>
</div>
<footer class="footer"> <i class="fa fa-copyright"></i> <span class="current-year"></span>. </footer>
</div>
</div>
<script>
var resizefunc = [];
</script>
<!-- jQuery -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/detect.js"></script>
<script src="assets/js/fastclick.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.blockUI.js"></script>
<script src="assets/js/waves.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/jquery.nicescroll.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="assets/js/jquery.app.js"></script>
<!-- jQuery -->
<script src="assets/pages/jquery.dashboard.js"></script>
<script src="assets/plugins/noty/packaged/jquery.noty.packaged.min.js"></script>
</body>
</html>
<?php } else { ?>
<script type='text/javascript' language='javascript'>
alert('NO TIENES PERMISO PARA ACCEDER A ESTA PAGINA.\nCONSULTA CON EL ADMINISTRADOR PARA QUE TE DE ACCESO')
document.location.href='panel'
</script>
<?php } } else { ?>
<script type='text/javascript' language='javascript'>
alert('NO TIENES PERMISO PARA ACCEDER AL SISTEMA.\nDEBERA DE INICIAR SESION')
document.location.href='logout'
</script>
<?php } ?>