-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhome.php
More file actions
280 lines (245 loc) · 10.2 KB
/
home.php
File metadata and controls
280 lines (245 loc) · 10.2 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
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
<?php
include ("includes/conn.php");
$saldos = [];
$saldo = 0;
$numTandas = [];
$favorite = [];
$deudas = [];
$mysqli = con_start();
/* REGRESA INGRESO TOTAL Y EGRESO TOTAL*/
$smtp = $mysqli->prepare("SELECT Sum(b.amount), Sum(c.amount) FROM mxhacks.Transaction a
LEFT JOIN mxhacks.Transaction b
ON a.id_trans = b.id_trans
AND b.type = 1 AND b.is_active = 1
LEFT JOIN mxhacks.Transaction c
on a.id_trans = c.id_trans
AND c.type = 2 AND c.is_active = 1");
$smtp->execute();
$smtp->store_result();
$smtp->bind_result($ingresos, $egresos);
while($smtp->fetch()){
$saldos[0][0] = $ingresos;
$saldos[0][1] = $egresos;
}
$saldo = $saldos[0][0] - $saldos[0][1];
$smtp->free_result();
/*Consegir el favorito*/
$smtp = $mysqli->prepare("SELECT name, description, amount, completed FROM Product WHERE id_user = 1
AND id_trans = 1 AND hidden = 0");
$smtp->execute();
$smtp->store_result();
$smtp->bind_result($name, $info, $cost, $completed);
while($smtp->fetch()){
$favorite[0][0] = $name;
$favorite[0][1] = $info;
$favorite[0][2] = $cost;
}
$smtp->free_result();
/*Conseguir el numero de tandas*/
$smtp = $mysqli->prepare("SELECT count(id_tanda) FROM Tanda;");
$smtp->execute();
$smtp->store_result();
$smtp->bind_result($tandas);
while($smtp->fetch()){
$numTandas[0][0] = $tandas;
}
$smtp->free_result();
/*IMPRIMIR DEUDAS*/
$smtp = $mysqli->prepare("SELECT SUM(amount) FROM mxhacks.Deudores");
$smtp->execute();
$smtp->store_result();
$smtp->bind_result($total);
while($smtp->fetch()){
$deudas[0][0] = $total;
}
$smtp->free_result();
$smtp->close();
?>
<!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">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Bienvenido</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!-- Custom styles for this template -->
<link href="css/cover.css" rel="stylesheet">
<!-- Material design content -->
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.5/material.green-light_green.min.css" />
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.5/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<style>
h4{
color:#fff;
}
.demo-card-event.mdl-card {
width: 240px;
height: 240px;
margin-left: 20px;
margin-top: 20px;
background: #03A9F4;
float: left;
}
.demo-card-event > .mdl-card__actions {
border-color: rgba(255, 255, 255, 0.2);
}
.demo-card-event > .mdl-card__title {
align-items: flex-start;
}
.demo-card-event > .mdl-card__title > h4 {
margin-top: 0;
}
.demo-card-event > .mdl-card__actions {
display: flex;
box-sizing:border-box;
align-items: center;
}
.demo-card-event > .mdl-card__title,
.demo-card-event > .mdl-card__actions,
.demo-card-event > .mdl-card__actions > .mdl-button {
color: #fff;
}
</style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="home.php">Tu cochinito</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li id="home" ><a href="home.php">Inicio</a></li>
<li id="ingress"><a href="ingress.php">Ingresos</a></li>
<li id="egress"><a href="egress.php">Egresos</a></li>
<li id="resumen"><a href="resumen2.php">Resumen</a></li>
<li id="tandasView"><a href="tandasView.php">Tanda</a></li>
<li id="productoView"><a href="productoView.php">Productos deseados</a></li>
<li id="deudas"><a href="deudas.php">Deudas</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<!-- CARDS SPACE -->
<div class="inner cover">
<div class="demo-card-event mdl-card mdl-shadow--2dp" style="background:#4BAF4F">
<div class="mdl-card__title mdl-card--expand">
<h4>Ingresos<br>
Tienes <br>
$ <?php echo $saldos[0][0]?>
</h4>
</div>
<div class="mdl-card__actions mdl-card--border">
<a href="ingress.php" class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
Ir a ingresos
</a>
<div class="mdl-layout-spacer"></div>
</div>
</div>
<div class="demo-card-event mdl-card mdl-shadow--2dp" style="background:#3F51B5">
<div class="mdl-card__title mdl-card--expand">
<h4>Egresos<br>
Debes<br>
$ <?php echo $saldos[0][1]?>
</h4>
</div>
<div class="mdl-card__actions mdl-card--border">
<a href="egress.php" class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
Ir a egresos
</a>
<div class="mdl-layout-spacer"></div>
</div>
</div>
<div class="demo-card-event mdl-card mdl-shadow--2dp" style="background:#E91E63">
<div class="mdl-card__title mdl-card--expand">
<h4>
Resumen<br>
Tu saldo real<br>
$ <?php echo $saldo?>
</h4>
</div>
<div class="mdl-card__actions mdl-card--border">
<a href="resumen.php" class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
Ir a resumen
</a>
<div class="mdl-layout-spacer"></div>
</div>
</div>
<br>
<div class="demo-card-event mdl-card mdl-shadow--2dp" style="background:#FF5722">
<div class="mdl-card__title mdl-card--expand">
<h4>
Tanda<br>
Actualmente estas en<br>
<?php echo $numTandas[0][0] ?> tandas
</h4>
</div>
<div class="mdl-card__actions mdl-card--border">
<a href="tandasView.php" class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
Ir a tanda
</a>
<div class="mdl-layout-spacer"></div>
</div>
</div>
<div class="demo-card-event mdl-card mdl-shadow--2dp" style="background:#FFC107">
<div class="mdl-card__title mdl-card--expand">
<h4>
Productos<br>
Actualmente quieres<br>
<?php echo $favorite[0][0]?>
</h4>
</div>
<div class="mdl-card__actions mdl-card--border">
<a href="productoView.php" class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
Ir a productos
</a>
<div class="mdl-layout-spacer"></div>
</div>
</div>
<div class="demo-card-event mdl-card mdl-shadow--2dp" style="background:#CDDC39">
<div class="mdl-card__title mdl-card--expand">
<h4>
Deudas<br>
Dinero que me deben<br>
$ <?php echo $deudas[0][0]?>
</h4>
</div>
<div class="mdl-card__actions mdl-card--border">
<a href="deudas.php" class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
Ir a deudas
</a>
<div class="mdl-layout-spacer"></div>
</div>
</div>
<!-- CARDS SPACE -->
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#home').addClass("active");
});
</script>
<?php
include ("foot.php")
?>