-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesta_compras.php
176 lines (112 loc) · 3.33 KB
/
esta_compras.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
<?php
include("funciones.php");
session_start();
if (!isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] != 1) {
header("location: login.php");
exit;
}
$active_pedidos="";
$active_productos="";
$title="Estadísticas de compras";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include("head.php");?>
</head>
<body>
<?php
include("navbarGerente.php");
?>
<div class="row">
<div class="col-md-12">
<div class="container">
</div>
<div class="container">
<ul class="nav nav-tabs">
<li role="presentation"><a href="esta_produccion.php">Estadística de producción</a></li>
<li role="presentation"><a href="esta_producto.php">Productos más producidos</a></li>
<li role="presentation"><a href="esta_ventas.php">Estadística de ventas</a></li>
<li role="presentation"><a href="esta_producto_ventas.php">Productos más vendidos</a></li>
<li role="presentation" class ="active"><a href="esta_compras.php">Estadística compras</a></li>
<li role="presentation"><a href="esta_producto_compras.php">Materiales o Isumos más comprados</a></li>
</ul>
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
Highcharts.chart('container', {
title: {
text: 'Compras de la Pastelería Italiana Venecia <?php echo $hoy = date("Y");?>',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun',
'Jul', 'Agos', 'Sep', 'Oct', 'Nov', 'Dic']
},
yAxis: {
title: {
text: 'Compras Anual'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: 'UND'
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: 'Producción',
data: [
<?php
$sql = sprintf("SELECT SUM(cantidad) as total FROM detalle_compra JOIN compra ON detalle_compra.numero_factura=compra.numero_factura GROUP BY MONTH(fecha_factura)");
$result = mysqli_query($con, $sql);
while ($row=mysqli_fetch_array($result))
{
?>
<?php echo $row["total"];?>,
<?php
}
?>
]
}, {
name: 'Invertido',
data: [
<?php
$sql = sprintf("SELECT SUM(precio_venta) as total FROM compra JOIN detalle_compra ON compra.numero_factura=detalle_compra.numero_factura GROUP BY MONTH(fecha_factura)");
$result = mysqli_query($con, $sql);
while ($row=mysqli_fetch_array($result))
{
?>
<?php echo $row["total"];?>,
<?php
}
?>
]
}]
});
});
</script>
<hr>
<?php
include("footer.php");
?>
<script type="text/javascript" src="js/VentanaCentrada.js"></script>
<script src="js/highcharts.js"></script>
<script src="js/exporting.js"></script>
<div id="container" style="min-width: 210px; height: 400px ; margin: 0 auto"></div>
</body>
</html>
</html>