forked from arteiroxyko/LivroCaixa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
1429 lines (1309 loc) · 60.8 KB
/
index.php
File metadata and controls
1429 lines (1309 loc) · 60.8 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
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
include ("./conf/config.php");
protegePagina();
include './conf/functions.php';
require_once './conf/versao.php';
$usuario = $_SESSION['usuarioID'];
//Apagar movimentos
if (isset($_GET['acao']) && $_GET['acao'] == 'apagar') {
$id = $_GET['id'];
$log = mysqli_query($_SG['conexao'], "SELECT * FROM movimentos WHERE id='$id'");
$logexc = mysqli_fetch_array($log);
$idmov = $logexc['id'];
$tipomov = $logexc['tipo'];
$descmov = $logexc['descricao'];
$valormov = $logexc['valor'];
$catmov = $logexc['cat'];
$contamov = $logexc['conta'];
$dataexc = date("Ymd");
$id_comp_img=$logexc['comp_img'];
mysqli_query($_SG['conexao'],"INSERT INTO exclusoes (id_mov_exc,tipo_mov,desc_mov,valor_mov,cat_mov,conta_mov,data_exc,usuario_mov) values ('$idmov','$tipomov','$descmov','$valormov','$catmov','$contamov','$dataexc','$usuario')");
mysqli_query($_SG['conexao'], "DELETE FROM movimentos WHERE id='$id'");
mysqli_query($_SG['conexao'], "DELETE FROM historico WHERE id_mov='$id'");
$qr1=mysqli_query($_SG['conexao'], "SELECT * FROM movimentos WHERE comp_img='$id_comp_img'");
$row1=mysqli_fetch_array($qr1);
if (empty($row1)){
mysqli_query($_SG['conexao'], "DELETE FROM comprovantes WHERE id='$id_comp_img'");
}
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano'] . "&ok=2");
exit();
}
//Editar categorias
if (isset($_POST['acao']) && $_POST['acao'] == 'editar_cat') {
$id = $_POST['id'];
$nome = $_POST['nome'];
mysqli_query($_SG['conexao'], "UPDATE categorias SET nome='$nome' WHERE id='$id'");
echo mysqli_error($_SG['conexao']);
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano'] . "&cat_ok=3");
exit();
}
//Apagar categorias
if (isset($_GET['acao']) && $_GET['acao'] == 'apagar_cat') {
$id = $_GET['id'];
$qr = mysqli_query($_SG['conexao'],
"SELECT c.id FROM movimentos g, categorias c WHERE c.id=g.cat && c.id=$id");
if (mysqli_num_rows($qr) !== 0) {
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano'] . "&cat_err=1");
exit();
} else {
mysqli_query($_SG['conexao'], "DELETE FROM categorias WHERE id='$id'");
echo mysqli_error($_SG['conexao']);
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano'] . "&cat_ok=2");
exit();
}
}
//Editar movimentos
if (isset($_POST['acao']) && $_POST['acao'] == 'editar_mov') {
$file_tmp = $_FILES["file"]["tmp_name"];
$file_name = $_FILES["file"]["name"];
$file_type = $_FILES["file"]["type"];
$file_size = $_FILES["file"]["size"];
$dataimagen=date('dmyHi');
$nome_r1 = tirarAcentos($file_name);
$nome_r2 = str_replace(" ", "", $nome_r1);
$nome="$usuario.$dataimagen.$nome_r2";
$caminho="./upload_temp/$usuario.$dataimagen.$nome_r2";
$extensao = @strtolower(end(explode('.',$file_name)));
$extesoespermitidas= array('png','jpeg','jpg','bmp','pdf','doc','docx','xls','xlsx','html','xml','rar','zip');
$tamanhoemBytes=@round (($file_size / 1024) / 1024,2);
$tamanhoemMB=$tamanhoemBytes." MB";
$id = $_POST['id'];
$dia = $_POST['dia'];
$mes = $_POST['mes'];
$ano = $_POST['ano'];
$tipo = $_POST['tipo'];
$cat = $_POST['cat'];
$conta_lan = $_POST['conta'];
$descricao = $_POST['descricao'];
$valor = str_replace(",", ".", $_POST['valor']);
$dataed = date("Ymd");
$qred = mysqli_query($_SG['conexao'], "SELECT * FROM movimentos WHERE id='$id'");
$rowed = mysqli_fetch_array($qred);
$comp_cad=$rowed['comp_img'];
if (empty($valor)) {
echo "<script>
alert('O campo VALOR é obrigatório, e precisa ser diferente de zero para editar.'); location.href='index.php'; historico.go(-1);
</script>";
exit();
}
if ($dia != $rowed['dia']) {
mysqli_query($_SG['conexao'], "UPDATE movimentos SET dia='$dia', mes='$mes', ano='$ano', tipo='$tipo', cat='$cat', conta='$conta_lan', descricao='$descricao', valor='$valor', edicao='Editado' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','1','$dataed','1','$usuario')");
echo mysqli_error($_SG['conexao']);
}
if ($mes != $rowed['mes']) {
mysqli_query($_SG['conexao'], "UPDATE movimentos SET dia='$dia', mes='$mes', ano='$ano', tipo='$tipo', cat='$cat', conta='$conta_lan', descricao='$descricao', valor='$valor', edicao='Editado' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','2','$dataed','1','$usuario')");
echo mysqli_error($_SG['conexao']);
}
if ($ano != $rowed['ano']) {
mysqli_query($_SG['conexao'], "UPDATE movimentos SET dia='$dia', mes='$mes', ano='$ano', tipo='$tipo', cat='$cat', conta='$conta_lan', descricao='$descricao', valor='$valor', edicao='Editado' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','3','$dataed','1','$usuario')");
echo mysqli_error($_SG['conexao']);
}
if ($tipo != $rowed['tipo']) {
mysqli_query($_SG['conexao'], "UPDATE movimentos SET dia='$dia', mes='$mes', ano='$ano', tipo='$tipo', cat='$cat', conta='$conta_lan', descricao='$descricao', valor='$valor', edicao='Editado' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','4','$dataed','1','$usuario')");
echo mysqli_error($_SG['conexao']);
}
if ($cat != $rowed['cat']) {
mysqli_query($_SG['conexao'], "UPDATE movimentos SET dia='$dia', mes='$mes', ano='$ano', tipo='$tipo', cat='$cat', conta='$conta_lan', descricao='$descricao', valor='$valor', edicao='Editado' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','5','$dataed','1','$usuario')");
echo mysqli_error($_SG['conexao']);
}
if ($descricao != $rowed['descricao']) {
mysqli_query($_SG['conexao'], "UPDATE movimentos SET dia='$dia', mes='$mes', ano='$ano', tipo='$tipo', cat='$cat', conta='$conta_lan', descricao='$descricao', valor='$valor', edicao='Editado' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','6','$dataed','1','$usuario')");
echo mysqli_error($_SG['conexao']);
}
if ($valor != $rowed['valor']) {
mysqli_query($_SG['conexao'], "UPDATE movimentos SET dia='$dia', mes='$mes', ano='$ano', tipo='$tipo', cat='$cat', conta='$conta_lan', descricao='$descricao', valor='$valor', edicao='Editado' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','7','$dataed','1','$usuario')");
echo mysqli_error($_SG['conexao']);
}
if ($conta_lan != $rowed['conta']) {
mysqli_query($_SG['conexao'], "UPDATE movimentos SET dia='$dia', mes='$mes', ano='$ano', tipo='$tipo', cat='$cat', conta='$conta_lan', descricao='$descricao', valor='$valor', edicao='Editado' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','8','$dataed','$conta_lan','$usuario')");
echo mysqli_error($_SG['conexao']);
}
if (!empty($file_tmp)){
if (array_search($extensao, $extesoespermitidas) === false) {
echo "<script>
alert('São permitidos apenas arquivos nestes formatos: PNG, JPEG, PNG, BMP, PDF, DOC, DOCX, XLS, XLSX, HTML, XML, ZIP e RAR.'); location.href='index.php';
</script>";
exit();
}
if ($file_size>7340032){
echo "<script>
alert('O arquivo é muito grande. Tamanho maxímo 7Mb.'); location.href='index.php';
</script>";
exit();
}
if (empty($comp_cad)){
copy($file_tmp, "$caminho");
$fp = fopen($caminho, "rb");
$filename=fread($fp, $file_size);
$filename=addslashes($filename);
fclose($fp);
mysqli_query($_SG['conexao'], "INSERT INTO comprovantes (comp, nome, tipo, ext, tamanho) values ('$filename','$nome','$file_type','$extensao','$tamanhoemMB')");
unlink($caminho);
$dados=mysqli_query($_SG['conexao'], "SELECT * FROM comprovantes WHERE id=(SELECT MAX(id) FROM comprovantes)");
$dados2=mysqli_fetch_array($dados);
$id_img=$dados2['id'];
mysqli_query($_SG['conexao'], "UPDATE movimentos SET edicao='Editado', comp_img='$id_img' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','9','$dataed','$conta_lan','$usuario')");
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano'] . "&ok=1");
exit();
}
copy($file_tmp, "$caminho");
$fp = fopen($caminho, "rb");
$filename=fread($fp, $file_size);
$filename=addslashes($filename);
fclose($fp);
mysqli_query($_SG['conexao'], "UPDATE comprovantes SET comp='$filename', nome='$nome', tipo='$file_type', ext='$extensao', tamanho='$tamanhoemMB' WHERE id='$comp_cad'");
unlink($caminho);
mysqli_query($_SG['conexao'], "UPDATE movimentos SET edicao='Editado' WHERE id='$id'");
mysqli_query($_SG['conexao'], "INSERT INTO historico (id_mov,just_id,data,conta_mov,usuario) values ('$id','9','$dataed','$conta_lan','$usuario')");
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano'] . "&ok=1");
exit();
}
}
//Cadastrar categorias
if (isset($_POST['acao']) && $_POST['acao'] == 2) {
$nome = $_POST['nome'];
mysqli_query($_SG['conexao'], "INSERT INTO categorias (nome,usuario) values ('$nome','$usuario')");
echo mysqli_error($_SG['conexao']);
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano'] . "&cat_ok=1");
exit();
}
//Lançar movimentos
if (isset($_POST['acao']) && $_POST['acao'] == 1) {
$file_tmp = $_FILES["file"]["tmp_name"];
$file_name = $_FILES["file"]["name"];
$file_type = $_FILES["file"]["type"];
$file_size = $_FILES["file"]["size"];
$dataimagen=date('dmyHi');
$nome_r1 = tirarAcentos($file_name);
$nome_r2 = str_replace(" ", "", $nome_r1);
$nome="$usuario.$dataimagen.$nome_r2";
$caminho="./upload_temp/$usuario.$dataimagen.$nome_r2";
$extensao = @strtolower(end(explode('.',$file_name)));
$extesoespermitidas= array('png','jpeg','jpg','bmp','pdf','doc','docx','xls','xlsx','html','xml','rar','zip');
$tamanhoemBytes=@round (($file_size / 1024) / 1024,2);
$tamanhoemMB=$tamanhoemBytes." MB";
$data = $_POST['data'];
$tipo = $_POST['tipo'];
$cat = $_POST['cat'];
$descricao = $_POST['descricao'];
$valor_recebido = str_replace(".", "", $_POST['valor']);
$valortotal = str_replace(",", ".", $valor_recebido);
$parcelas = $_POST['parcelas'];
$valor = @$valortotal / $parcelas;
$t = explode("/", $data);
$dia = $t[0];
$mes = $t[1];
$ano = $t[2];
if (empty($valor)){
echo "<script>
alert('O campo VALOR é obrigatório, e precisa ser diferente de zero.'); location.href='index.php'; historico.go(-1);
</script>";
exit;
}
$n=1;
if (!empty($file_tmp)){
if (array_search($extensao, $extesoespermitidas) === false) {
echo "<script>
alert('São permitidos apenas arquivos nestes formatos: PNG, JPEG, PNG, BMP, PDF, DOC, DOCX, XLS, XLSX, HTML, XML, ZIP e RAR.'); location.href='index.php';
</script>";
exit();
}
if ($file_size>7340032){
echo "<script>
alert('O arquivo é muito grande. Tamanho maxímo 7Mb.'); location.href='index.php';
</script>";
exit();
}
copy($file_tmp, "$caminho");
$fp = fopen($caminho, "rb");
$filename=fread($fp, $file_size);
$filename=addslashes($filename);
fclose($fp);
mysqli_query($_SG['conexao'], "INSERT INTO comprovantes (comp, nome, tipo, ext, tamanho) values ('$filename','$nome','$file_type','$extensao','$tamanhoemMB')");
unlink($caminho);
while ($n <= $parcelas) {
$dados=mysqli_query($_SG['conexao'], "SELECT * FROM comprovantes WHERE id=(SELECT MAX(id) FROM comprovantes)");
$dados2=mysqli_fetch_array($dados);
$id_img=$dados2['id'];
mysqli_query($_SG['conexao'], "INSERT INTO movimentos (dia,mes,ano,tipo,descricao,valor,cat,conta,nparcela,parcelas,usuario,comp_img) values ('$dia','$mes','$ano','$tipo','$descricao','$valor','$cat','1','$n','$parcelas','$usuario','$id_img')");
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano'] . "&ok=1");
if ($mes<=11){
$mes++;}
else{
$mes = 1;
$ano++;}
$n++;
}
exit();
}
while ($n <= $parcelas) {
mysqli_query($_SG['conexao'], "INSERT INTO movimentos (dia,mes,ano,tipo,descricao,valor,cat,conta,nparcela,parcelas,usuario) values ('$dia','$mes','$ano','$tipo','$descricao','$valor','$cat','1','$n','$parcelas','$usuario')");
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano'] . "&ok=1");
if ($mes<=11){
$mes++;}
else{
$mes = 1;
$ano++;}
$n++;
}
exit();
}
//Cadastrar orçamento
if (isset($_POST['acao']) && $_POST['acao'] == 'cad_orcamento') {
$valor_recebido = str_replace(".", "", $_POST['valor']);
$valor_orcamento = str_replace(",", ".", $valor_recebido);
$tipo = $_POST['tipo'];
$data = $_POST['data'];
$t = explode("/", $data);
$dia = $t[0];
$mes = $t[1];
$ano = $t[2];
$valida_meses = 12 - $mes + 1;
if (empty($valor_orcamento)) {
echo "<script>
alert('O campo VALOR é obrigatório, e precisa ser diferente de zero.'); location.href='index.php'; historico.go(-1);
</script>";
exit;
}
if ($tipo != 0) {
mysqli_query($_SG['conexao'],
"INSERT INTO orcamento (mes,ano,valor,conta,usuario) values ('$mes','$ano','$valor_orcamento','1','$usuario')");
echo mysqli_error($_SG['conexao']);
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano']);
exit();
}
$n = 1;
while ($n <= $valida_meses) {
mysqli_query($_SG['conexao'],
"INSERT INTO orcamento (mes,ano,valor,conta,usuario) values ('$mes','$ano','$valor_orcamento','1','$usuario')");
echo mysqli_error($_SG['conexao']);
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano']);
if ($mes <= 11) {
$mes++;
}
$n++;
}
exit();
}
//Editar orçamento
if (isset($_POST['acao']) && $_POST['acao'] == 'ed_orcamento') {
$valor_recebido = str_replace(".", "", $_POST['valor']);
$valor_orcamento = str_replace(",", ".", $valor_recebido);
$tipo = $_POST['tipo'];
$data = $_POST['data'];
$t = explode("/", $data);
$dia = $t[0];
$mes = $t[1];
$ano = $t[2];
$valida_meses = 12 - $mes + 1;
if (empty($valor_orcamento)) {
echo "<script>
alert('O campo VALOR é obrigatório, e precisa ser diferente de zero.'); location.href='index.php'; historico.go(-1);
</script>";
exit();
}
if ($tipo != 0) {
mysqli_query($_SG['conexao'], "UPDATE orcamento SET valor='$valor_orcamento' WHERE mes='$mes' && conta='1' && usuario='$usuario'");
echo mysqli_error($_SG['conexao']);
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano']);
exit();
}
mysqli_query($_SG['conexao'], "UPDATE orcamento SET valor='$valor_orcamento' WHERE mes>=$mes && ano='$ano' && conta='1' && usuario='$usuario'");
echo mysqli_error($_SG['conexao']);
header("Location: ?mes=" . $_GET['mes'] . "&ano=" . $_GET['ano']);
exit();
}
//Boas vindas em função da hora
$hora = date('G');
if (($hora >= 0) and ($hora < 5)) {
$mensagem = "Já é madrugada";
} else
if (($hora >= 5) and ($hora < 6)) {
$mensagem = "Já esta amanhecendo";
} else
if (($hora >= 6) and ($hora < 12)) {
$mensagem = "Bom dia";
} else
if (($hora >= 12) and ($hora < 18)) {
$mensagem = "Boa tarde";
} else {
$mensagem = "Boa noite";
}
//Mês e ano hoje
if (isset($_GET['mes']))
$mes_hoje = $_GET['mes'];
else
$mes_hoje = date('m');
if (isset($_GET['ano']))
$ano_hoje = $_GET['ano'];
else
$ano_hoje = date('Y');
?>
<html>
<head>
<title id='titulo'>CONTA CORRENTE</title>
<link href="./conf/img/favicon.png" rel="icon" type="image/png"/>
<meta name="LANGUAGE" content="Portuguese" />
<meta name="AUDIENCE" content="all" />
<meta name="RATING" content="GENERAL" />
<link href="./conf/css/styles.css" rel="stylesheet" type="text/css" />
<link id="scrollUpTheme" rel="stylesheet" href="./conf/css/image.css">
<link rel="stylesheet" href="./conf/css/calculadora.css">
<script LANGUAGE="JavaScript" src="./conf/js/scripts.js"></script>
<script src="./conf/js/jquery.js"></script>
<script src="./conf/js/jquery.scroll.topo.js"></script>
<script src="./conf/js/jquery.easing.js"></script>
<script src="./conf/js/jquery.easing.compatibilidade.js"></script>
<script LANGUAGE="JavaScript" src="./conf/js/jquery.validar.formulario.js"></script>
<script src="./conf/js/jquery.calc.js"></script>
<script src="./conf/js/jquery.calculadora.js"></script>
<script>
(function ($) {
$.getQuery = function (query) {
query = query.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]');
var expr = '[\\?&]' + query + '=([^&#]*)';
var regex = new RegExp(expr);
var results = regex.exec(window.location.href);
if (results !== null) {
return results[1];
} else {
return false;
}
};
})(jQuery);
$(function () {
$('.image-switch').click(function () {
window.location = '?theme=image';
});
if ($.getQuery('theme') === 'image') {
$(function () {
$.scrollUp({
animation: 'fade',
activeOverlay: 'false',
scrollImg: {
active: true,
type: 'background',
src: './conf/img/topo.png'
}
});
});
$('#scrollUpTheme').attr('href', './conf/css/image.css?1.1');
$('.image-switch').addClass('active');
} else {
$(function () {
$.scrollUp({
animation: 'slide',
activeOverlay: 'false'
});
});
$('#scrollUpTheme').attr('href', './conf/css/image.css?1.1');
$('.image-switch').addClass('active');
}
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('#formulario_lancamento').validate({
rules: {
valor: {
required: true,
},
parcelas: {
required: true,
digits: true
},
},
messages: {
valor: {
required: "Campo obrigatório.",
},
parcelas: {
required: "Campo obrigatório.",
digits: "Digite apenas números."
},
}
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('#form_alt_senha').validate({
rules: {
novasenha: {
required: true,
minlength: 6
},
novasenhaconf: {
required: true,
equalTo: "#novasenha"
},
},
messages: {
novasenha: {
required: "Campo obrigatório.",
minlength: "Mínimo 6 caracteres."
},
novasenhaconf: {
required: "Campo obrigatório.",
equalTo: "Senhas não conferem."
},
}
});
});
</script>
<script>
function passwordStrength(password)
{
var desc = new Array();
desc[0] = "";
desc[1] = "";
desc[2] = "";
desc[3] = "";
desc[4] = "";
desc[5] = "";
var score = 0;
if (password.length > 6) score++;
if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++;
if (password.match(/\d+/)) score++;
if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++;
if (password.length > 12) score++;
document.getElementById("passwordDescription").innerHTML = desc[score];
document.getElementById("passwordStrength").className = "strength" + score;
}
</script>
<script>
$(function () {
$.calculator.setDefaults({showOn: 'both', buttonImageOnly: true, buttonImage: './conf/img/calc.png'});
$('#valor').calculator(); //Calculadora comum para lançamento de movimentos
$('#valororcamento').calculator({layout: $.calculator.scientificLayout}); //Calculadora cientifica para lançamento de orçamento
$('#edorcamento').calculator({layout: $.calculator.scientificLayout}); //Calculadora cientifica para edição de orçamento
});
</script>
</head>
<body style="padding:10px">
<table cellpadding="1" cellspacing="10" width="1000" align="center" style="background-color:#033">
<tr>
<td colspan="11" style="background-color:#005B5B;">
<h2 style="margin:5px"><a href=index.php style="color:#FFF">Conta Corrente</a> | <a href=visa.php style="color:#008B8B">Cartão Visa</a> | <a href=master.php style="color:#008B8B">Cartão Master</a> | <a href=./dashboard/dashboard.php style="color:#008B8B">Dashboard</a></h2>
</td>
<td colspan="2" align="right" style="background-color:#005B5B;">
<a style="color:#FFF" href="?mes=<?php echo date('m') ?>&ano=<?php echo date('Y') ?>">Hoje:<strong> <?php echo
date('d') ?> de <?php echo
mostraMes(date('m')) ?> de <?php echo
date('Y') ?></strong></a>
</td>
</tr>
<tr>
<td width="70">
<select onchange="location.replace('?mes=<?php echo $mes_hoje ?>&ano='+this.value)">
<?php
for ($i = 2015; $i <= 2020; $i++) {
?>
<option value="<?php echo $i ?>" <?php if ($i == $ano_hoje)
echo "selected=selected" ?> ><?php echo
$i ?></option>
<?php } ?>
</select>
</td>
<?php
for ($i = 1; $i <= 12; $i++) {
?>
<td align="center" style="<?php if ($i != 12)
echo "border-right:1px solid #FFF;" ?> padding-right:5px">
<a href="?mes=<?php echo $i ?>&ano=<?php echo $ano_hoje ?>" style="
<?php if ($mes_hoje == $i) { ?>
color:#033; font-size:16px; font-weight:bold; background-color:#FFF; padding:5px
<?php } else { ?>
color:#FFF; font-size:16px;
<?php } ?>
">
<?php echo mostraMes($i); ?>
</a>
</td>
<?php
}
?>
</tr>
</table>
<table cellpadding="5" cellspacing="0" width="1000" align="center">
<tr>
<?php
$qrvisita = mysqli_query($_SG['conexao'], "SELECT * FROM usuarios where id='$usuario'");
$rowvisita = mysqli_fetch_array($qrvisita);
$qracesso = mysqli_query($_SG['conexao'], "SELECT * FROM usuarios where id='$usuario'");
$rowacesso = mysqli_fetch_array($qracesso);
$n = $rowacesso['n_acesso_f'];
$n_acesso = $n + 1;
?>
<td>
<b><font color="#000" size=1><?php if ($n > 0)
echo "Último acesso: " . date('d/m/Y H:i:s', strtotime($rowvisita['ultimavisita']));
else
echo "" ?></font>
</td>
<td><font color="#000"><?php echo $mensagem ?><?php echo " " ?><?php echo $_SESSION['usuarioNome']; ?><?php echo
" " ?><?php echo
$_SESSION['usuarioSobrenome']; ?>.</font></b>
</td>
<td align="right" style="font-size:13px; color:rgba(4, 45, 191, 1)">
<a href="javascript:;" style="font-size:12px; color:rgba(4, 45, 191, 1)" onclick="abreFecha('orcamento')"> [ Orçamento ]</a>
<a href="javascript:;" style="font-size:12px; color:rgba(4, 45, 191, 1)" onclick="abreFecha('alterar_senha')">[ Alterar senha ]</a>
<a href="logout.php" style="font-size:12px; color:rgba(4, 45, 191, 1)"><?php echo
" [ Fazer logout ]" ?></a>
</td>
</tr>
<tr>
<td>
<b><font color="#000" size=1><?php echo "Acesso Nº: " ?><?php if ($n = 0)
echo "1";
else
echo "$n_acesso" ?></font>
</td>
</tr>
</table>
<table cellpadding="5" cellspacing="0" width="1000" align="center">
<tr style="display:none; background-color:#E0E0E0" id="alterar_senha">
<td align="left">
<form id="form_alt_senha" method="post" action="cadastro.php">
<input type="hidden" name="acao" value="alterar_senha" />
<input type="hidden" name="pagina" value="index.php" />
<input type="hidden" name="usuario" value="<?php echo $usuario ?>" />
<b>Nova senha:</b> <font color="#FF0000" size=2><input type="password" name="novasenha" id="novasenha" onkeyup="passwordStrength(this.value)"></font> <b>Confirmar nova senha:</b> <font color="#FF0000" size=2><input type="password" name="novasenhaconf" id="novasenhaconf"></font><br>
<label for="passwordStrength"><font size=2>Força da senha</font></label><br>
<div id="passwordDescription"></div>
<div id="passwordStrength" class="strength0"></div>
<p align="right">
<input type="submit" class="input" value="Alterar" /></p>
</form>
</td>
</tr>
</table>
<table cellpadding="5" cellspacing="0" width="1000" align="center">
<?php
$qr = mysqli_query($_SG['conexao'],
"SELECT SUM(valor) as total FROM orcamento WHERE mes='$mes_hoje' && ano='$ano_hoje' && conta=1 && usuario='$usuario'");
$row = mysqli_fetch_array($qr);
$total = $row['total'];
$qr = mysqli_query($_SG['conexao'],
"SELECT SUM(valor) as total FROM movimentos WHERE tipo=0 && conta=1 && usuario='$usuario' && mes='$mes_hoje' && ano='$ano_hoje'");
$row = mysqli_fetch_array($qr);
$gasto = $row['total'];
$resta = $total - $gasto;
if ($total > 0) {
$percento = @round(($gasto / $total) * 100, 2);
if ($percento > 100) {
$comp = 100;
}
if ($percento <= 100) {
$comp = $percento;
}
} else {
$percento = '-1';
$comp = '100';
}
//Percentual do orçamento anual
$qra = mysqli_query($_SG['conexao'],
"SELECT SUM(valor) as total FROM orcamento WHERE ano='$ano_hoje' && conta=1 && usuario='$usuario'");
$rowa = mysqli_fetch_array($qra);
$total_ano = $rowa['total'];
$qra = mysqli_query($_SG['conexao'],
"SELECT SUM(valor) as total FROM movimentos WHERE tipo=0 && conta=1 && usuario='$usuario' && ano='$ano_hoje'");
$rowa = mysqli_fetch_array($qra);
$gasto_ano = $rowa['total'];
$resta_ano = $total_ano - $gasto_ano;
if ($total_ano > 0) {
$percento_ano = @round(($gasto_ano / $total_ano) * 100, 2);
if ($percento_ano > 100) {
$comp_ano = 100;
}
if ($percento_ano <= 100) {
$comp_ano = $percento_ano;
}
} else {
$percento_ano = '-1';
$comp_ano = '100';
}
//Percentual do orçamento dos cartões
$qrc = mysqli_query($_SG['conexao'],
"SELECT SUM(valor) as total FROM orcamento WHERE mes='$mes_hoje' && ano='$ano_hoje' && conta!=1 && usuario='$usuario'");
$rowc = mysqli_fetch_array($qrc);
$total_cart = $rowc['total'];
$qrc = mysqli_query($_SG['conexao'],
"SELECT SUM(valor) as total FROM movimentos WHERE tipo=0 && conta!=1 && usuario='$usuario' && mes='$mes_hoje' && ano='$ano_hoje'");
$rowc = mysqli_fetch_array($qrc);
$gasto_cart = $rowc['total'];
$resta_cart = $total_cart - $gasto_cart;
if ($total_cart > 0) {
$percento_cart = @round(($gasto_cart / $total_cart) * 100, 2);
if ($percento_cart > 100) {
$comp_cart = 100;
}
if ($percento_cart <= 100) {
$comp_cart = $percento_cart;
}
} else {
$percento_cart = '-1';
$comp_cart = '100';
}
?>
<tr style="display:none;" id="orcamento">
<td align="left" style="font-size:11px; color:rgb(0, 0, 0)">
<a href="javascript:;" style="font-size:12px" onclick="abreFecha('lancar_orcamento')" title="Gereciar orçamento">Orçamento mensal: <?php echo
formata_dinheiro($gasto) ?><?php echo
" de " ?><?php echo
formata_dinheiro($total) ?><?php echo
" resta " ?><font color="<?php if ($resta <=
0)
echo "#C00" ?>"><?php echo
formata_dinheiro($resta) ?></font>.</a><br>
<style type="text/CSS">
.outter{
height:20px;
width:1000px;
border:solid 1px #000;
}
.inner{
height:20px;
width:<?php echo $comp ?>%;
background: <?php if ($percento <= 0)
echo "rgb(240,240,240); /* Old browsers */
background: -moz-linear-gradient(top, rgba(240,240,240,1) 0%, rgba(228,228,228,1) 50%, rgba(223,223,223,1) 51%, rgba(240,240,240,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(228,228,228,1) 50%,rgba(223,223,223,1) 51%,rgba(240,240,240,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(240,240,240,1) 0%,rgba(228,228,228,1) 50%,rgba(223,223,223,1) 51%,rgba(240,240,240,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0f0f0', endColorstr='#f0f0f0',GradientType=0 ); /* IE6-9 */";
else
if (($percento > 0) and ($percento <= 65))
echo "rgb(180,221,180); /* Old browsers */
background: -moz-linear-gradient(top, rgba(180,221,180,1) 0%, rgba(131,199,131,1) 4%, rgba(131,199,131,1) 4%, rgba(131,199,131,1) 30%, rgba(131,199,131,1) 42%, rgba(0,138,0,1) 100%, rgba(0,87,0,1) 100%, rgba(0,36,0,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(180,221,180,1) 0%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 30%,rgba(131,199,131,1) 42%,rgba(0,138,0,1) 100%,rgba(0,87,0,1) 100%,rgba(0,36,0,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(180,221,180,1) 0%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 30%,rgba(131,199,131,1) 42%,rgba(0,138,0,1) 100%,rgba(0,87,0,1) 100%,rgba(0,36,0,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b4ddb4', endColorstr='#002400',GradientType=0 ); /* IE6-9 */";
else
if (($percento > 65) and ($percento <= 85))
echo "rgb(252,243,188); /* Old browsers */
background: -moz-linear-gradient(top, rgba(252,243,188,1) 0%, rgba(252,232,78,1) 50%, rgba(248,219,0,1) 51%, rgba(251,239,147,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(252,243,188,1) 0%,rgba(252,232,78,1) 50%,rgba(248,219,0,1) 51%,rgba(251,239,147,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(252,243,188,1) 0%,rgba(252,232,78,1) 50%,rgba(248,219,0,1) 51%,rgba(251,239,147,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcf3bc', endColorstr='#fbef93',GradientType=0 ); /* IE6-9 */";
else
echo "rgb(246,25,0); /* Old browsers */
background: -moz-linear-gradient(top, rgba(246,25,0,1) 16%, rgba(186,0,0,1) 47%, rgba(246,25,0,1) 87%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(246,25,0,1) 16%,rgba(186,0,0,1) 47%,rgba(246,25,0,1) 87%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(246,25,0,1) 16%,rgba(186,0,0,1) 47%,rgba(246,25,0,1) 87%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f61900', endColorstr='#f61900',GradientType=0 ); /* IE6-9 */" ?>
}
</style>
<style type="text/CSS">
.outter2{
height:20px;
width:1000px;
border:solid 1px #000;
}
.inner2{
height:20px;
width:<?php echo $comp_ano ?>%;
background: <?php if ($percento_ano <= 0)
echo "rgb(240,240,240); /* Old browsers */
background: -moz-linear-gradient(top, rgba(240,240,240,1) 0%, rgba(228,228,228,1) 50%, rgba(223,223,223,1) 51%, rgba(240,240,240,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(228,228,228,1) 50%,rgba(223,223,223,1) 51%,rgba(240,240,240,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(240,240,240,1) 0%,rgba(228,228,228,1) 50%,rgba(223,223,223,1) 51%,rgba(240,240,240,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0f0f0', endColorstr='#f0f0f0',GradientType=0 ); /* IE6-9 */";
else
if (($percento_ano > 0) and ($percento_ano <= 65))
echo "rgb(180,221,180); /* Old browsers */
background: -moz-linear-gradient(top, rgba(180,221,180,1) 0%, rgba(131,199,131,1) 4%, rgba(131,199,131,1) 4%, rgba(131,199,131,1) 30%, rgba(131,199,131,1) 42%, rgba(0,138,0,1) 100%, rgba(0,87,0,1) 100%, rgba(0,36,0,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(180,221,180,1) 0%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 30%,rgba(131,199,131,1) 42%,rgba(0,138,0,1) 100%,rgba(0,87,0,1) 100%,rgba(0,36,0,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(180,221,180,1) 0%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 30%,rgba(131,199,131,1) 42%,rgba(0,138,0,1) 100%,rgba(0,87,0,1) 100%,rgba(0,36,0,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b4ddb4', endColorstr='#002400',GradientType=0 ); /* IE6-9 */";
else
if (($percento_ano > 65) and ($percento_ano <= 85))
echo "rgb(252,243,188); /* Old browsers */
background: -moz-linear-gradient(top, rgba(252,243,188,1) 0%, rgba(252,232,78,1) 50%, rgba(248,219,0,1) 51%, rgba(251,239,147,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(252,243,188,1) 0%,rgba(252,232,78,1) 50%,rgba(248,219,0,1) 51%,rgba(251,239,147,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(252,243,188,1) 0%,rgba(252,232,78,1) 50%,rgba(248,219,0,1) 51%,rgba(251,239,147,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcf3bc', endColorstr='#fbef93',GradientType=0 ); /* IE6-9 */";
else
echo "rgb(246,25,0); /* Old browsers */
background: -moz-linear-gradient(top, rgba(246,25,0,1) 16%, rgba(186,0,0,1) 47%, rgba(246,25,0,1) 87%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(246,25,0,1) 16%,rgba(186,0,0,1) 47%,rgba(246,25,0,1) 87%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(246,25,0,1) 16%,rgba(186,0,0,1) 47%,rgba(246,25,0,1) 87%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f61900', endColorstr='#f61900',GradientType=0 ); /* IE6-9 */" ?>
}
</style>
<style type="text/CSS">
.outter3{
height:20px;
width:1000px;
border:solid 1px #000;
}
.inner3{
height:20px;
width:<?php echo $comp_cart ?>%;
background: <?php if ($percento_cart <= 0)
echo "rgb(240,240,240); /* Old browsers */
background: -moz-linear-gradient(top, rgba(240,240,240,1) 0%, rgba(228,228,228,1) 50%, rgba(223,223,223,1) 51%, rgba(240,240,240,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(228,228,228,1) 50%,rgba(223,223,223,1) 51%,rgba(240,240,240,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(240,240,240,1) 0%,rgba(228,228,228,1) 50%,rgba(223,223,223,1) 51%,rgba(240,240,240,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0f0f0', endColorstr='#f0f0f0',GradientType=0 ); /* IE6-9 */";
else
if (($percento_cart > 0) and ($percento_cart <= 65))
echo "rgb(180,221,180); /* Old browsers */
background: -moz-linear-gradient(top, rgba(180,221,180,1) 0%, rgba(131,199,131,1) 4%, rgba(131,199,131,1) 4%, rgba(131,199,131,1) 30%, rgba(131,199,131,1) 42%, rgba(0,138,0,1) 100%, rgba(0,87,0,1) 100%, rgba(0,36,0,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(180,221,180,1) 0%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 30%,rgba(131,199,131,1) 42%,rgba(0,138,0,1) 100%,rgba(0,87,0,1) 100%,rgba(0,36,0,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(180,221,180,1) 0%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 4%,rgba(131,199,131,1) 30%,rgba(131,199,131,1) 42%,rgba(0,138,0,1) 100%,rgba(0,87,0,1) 100%,rgba(0,36,0,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b4ddb4', endColorstr='#002400',GradientType=0 ); /* IE6-9 */";
else
if (($percento_cart > 65) and ($percento_cart <= 85))
echo "rgb(252,243,188); /* Old browsers */
background: -moz-linear-gradient(top, rgba(252,243,188,1) 0%, rgba(252,232,78,1) 50%, rgba(248,219,0,1) 51%, rgba(251,239,147,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(252,243,188,1) 0%,rgba(252,232,78,1) 50%,rgba(248,219,0,1) 51%,rgba(251,239,147,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(252,243,188,1) 0%,rgba(252,232,78,1) 50%,rgba(248,219,0,1) 51%,rgba(251,239,147,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcf3bc', endColorstr='#fbef93',GradientType=0 ); /* IE6-9 */";
else
echo "rgb(246,25,0); /* Old browsers */
background: -moz-linear-gradient(top, rgba(246,25,0,1) 16%, rgba(186,0,0,1) 47%, rgba(246,25,0,1) 87%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(246,25,0,1) 16%,rgba(186,0,0,1) 47%,rgba(246,25,0,1) 87%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(246,25,0,1) 16%,rgba(186,0,0,1) 47%,rgba(246,25,0,1) 87%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f61900', endColorstr='#f61900',GradientType=0 ); /* IE6-9 */" ?>
}
</style>
<div class="outter">
<div class="inner"><center><?php if ($percento < 0)
echo "Não " . "há " . "orçamento " . "cadastrado.";
else
echo $percento . "%" ?></center></div>
</div>
<a href="javascript:;" style="font-size:12px" onclick="abreFecha('orcamento_anual')" title="Exibir orçamento anual">[ Exibir orçamento anual ]</a>
<a href="javascript:;" style="font-size:12px" onclick="abreFecha('orcamento_cartoes')" title="Exib. orçamento mensal cartões">[ Exib. orçamento cartões ]</a>
</td>
</tr>
<tr style="display:none; background-color:#E0E0E0" id="lancar_orcamento">
<td>
<a href="javascript:;" style="font-size:12px; color:rgba(4, 45, 191, 1)" onclick="abreFecha('cad_orcamento')" title="Cadastre apenas uma vez."> [ Cad. Orçamento ]</a>
<a href="javascript:;" style="font-size:12px; color:rgba(4, 45, 191, 1)" onclick="abreFecha('ed_orcamento')" title="Edite um ou mais meses"> [ Editar Orçamento ]</a>
</dt>
</tr>
<tr style="display:none; background-color:#E0E0E0" id="cad_orcamento">
<td>
<form method="post" action="?mes=<?php echo $mes_hoje ?>&ano=<?php echo $ano_hoje ?>">
<input type="hidden" name="acao" value="cad_orcamento" />
Valor do orçamento: R$ <input type=text value="<?php echo $total ?>" name=valor id="valororcamento" length=15 onKeyPress="return(FormataReais(this,'.',',',event))"> |
<input type="radio" name="tipo" value="1" checked /> Este mês
<input type="radio" name="tipo" value="0" /> Este ano |
Data inicial: <input type="text" name="data" size="11" maxlength="10" value="<?php echo
date('d') ?>/<?php echo
$mes_hoje ?>/<?php echo
$ano_hoje ?>" />
<input type="submit" class="input" value="Gravar" />
</form>
</td>
</tr>
<tr style="display:none; background-color:#E0E0E0" id="ed_orcamento">
<td>
<form method="post" action="?mes=<?php echo $mes_hoje ?>&ano=<?php echo $ano_hoje ?>">
<input type="hidden" name="acao" value="ed_orcamento" />
Novo valor: R$ <input type=text value="<?php echo $total ?>" name=valor id="edorcamento" length=15 onKeyPress="return(FormataReais(this,'.',',',event))"> |
<input type="radio" name="tipo" value="1" checked /> Somente este
<input type="radio" name="tipo" value="0" /> Este e futuros |
Data inicial: <input type="text" name="data" size="11" maxlength="10" value="<?php echo
date('d') ?>/<?php echo
$mes_hoje ?>/<?php echo
$ano_hoje ?>" />
<input type="submit" class="input" value="Gravar" />
</form>
</td>
</tr>
<tr style="display:none;" id="orcamento_anual">
<td style="font-size:11px; color:rgb(0, 0, 0)">
<a href="javascript:;" style="font-size:12px" title="Orçamento anual">Orçamento anual: <?php echo
formata_dinheiro($gasto_ano) ?><?php echo
" de " ?><?php echo
formata_dinheiro($total_ano) ?><?php echo
" resta " ?><font color="<?php if ($resta_ano <=
0)
echo "#C00" ?>"><?php echo
formata_dinheiro($resta_ano) ?></font>.</a><br>
<div class="outter2">
<div class="inner2"><center><?php if ($percento_ano < 0)
echo "Não " . "há " . "orçamento " . "cadastrado.";
else
echo $percento_ano . "%" ?></center></div>
</div>
</dt>
</tr>
<tr style="display:none;" id="orcamento_cartoes">
<td style="font-size:11px; color:rgb(0, 0, 0)">
<a href="javascript:;" style="font-size:12px" title="Orçamento mensal cartões">Orçamento mensal cartões: <?php echo
formata_dinheiro($gasto_cart) ?><?php echo
" de " ?><?php echo
formata_dinheiro($total_cart) ?><?php echo
" resta " ?><font color="<?php if ($resta_cart <=
0)
echo "#C00" ?>"><?php echo
formata_dinheiro($resta_cart) ?></font>.</a><br>
<div class="outter3">
<div class="inner3"><center><?php if ($percento_cart < 0)
echo "Não " . "há " . "orçamento " . "cadastrado.";
else
echo $percento_cart . "%" ?></center></div>
</div>
</dt>
</tr>
</table>
<table cellpadding="10" cellspacing="0" width="1000" align="center" >
<tr>
<td colspan="2">
<h2><?php echo mostraMes($mes_hoje) ?>/<?php echo $ano_hoje ?></h2>
</td>
<td align="right">
<a href="javascript:;" onclick="abreFecha('add_cat')" class="bnt">[+] Adicionar Categoria</a>
<a href="javascript:;" onclick="abreFecha('add_movimento')" class="bnt"><strong>[+] Adicionar Movimento</strong></a>
</td>
</tr>
<tr >
<td colspan="3" >
<?php
if (isset($_GET['cat_err']) && $_GET['cat_err'] == 1) {
?>
<div style="padding:5px; background-color:#FF6; text-align:center; color:#030">
<strong>Esta categoria não pode ser removida, pois há movimentos associados a mesma</strong>
</div>
<?php } ?>
<?php
if (isset($_GET['cat_ok']) && $_GET['cat_ok'] == 2) {
?>
<div style="padding:5px; background-color:#9CC; text-align:center; color:#000">
<strong>Categoria removida com sucesso!</strong>
</div>
<?php } ?>
<?php
if (isset($_GET['cat_ok']) && $_GET['cat_ok'] == 1) {
?>
<div style="padding:5px; background-color:#9CC; text-align:center; color:#000">
<strong>Categoria Cadastrada com sucesso!</strong>
</div>
<?php } ?>
<?php
if (isset($_GET['cat_ok']) && $_GET['cat_ok'] == 3) {
?>
<div style="padding:5px; background-color:#9CC; text-align:center; color:#000">
<strong>Categoria alterada com sucesso!</strong>
</div>
<?php } ?>
<?php
if (isset($_GET['ok']) && $_GET['ok'] == 1) {
?>
<div style="padding:5px; background-color:#9CC; text-align:center; color:#000">
<strong>Movimento Cadastrado com sucesso!</strong>
</div>
<?php } ?>
<?php
if (isset($_GET['ok']) && $_GET['ok'] == 2) {
?>
<div style="padding:5px; background-color:#900; text-align:center; color:#FFF">
<strong>Movimento removido com sucesso!</strong>
</div>
<?php } ?>
<?php
if (isset($_GET['ok']) && $_GET['ok'] == 3) {
?>
<div style="padding:5px; background-color:#9CC; text-align:center; color:#000">
<strong>Movimento alterado com sucesso!</strong>
</div>
<?php } ?>
<div style=" background-color:#F1F1F1; padding:10px; border:1px solid #999; margin:5px; display:none" id="add_cat">
<h3>Adicionar Categoria</h3>