forked from jmueller17/Aixada
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport_account.php
238 lines (194 loc) · 7.5 KB
/
report_account.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
<?php include "php/inc/header.inc.php" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$language;?>" lang="<?=$language;?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $Text['global_title'] . " - " . $Text['head_ti_account'] ;?></title>
<link rel="stylesheet" type="text/css" media="screen" href="css/aixada_main.css" />
<link rel="stylesheet" type="text/css" media="print" href="css/print.css" />
<link rel="stylesheet" type="text/css" media="screen" href="js/fgmenu/fg.menu.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui-themes/<?=$default_theme;?>/jqueryui.css"/>
<?php if (isset($_SESSION['dev']) && $_SESSION['dev'] == true ) { ?>
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/jqueryui/jqueryui.js"></script>
<script type="text/javascript" src="js/fgmenu/fg.menu.js"></script>
<script type="text/javascript" src="js/aixadautilities/jquery.aixadaMenu.js"></script>
<script type="text/javascript" src="js/aixadautilities/jquery.aixadaXML2HTML.js" ></script>
<script type="text/javascript" src="js/aixadautilities/jquery.aixadaUtilities.js" ></script>
<?php } else { ?>
<script type="text/javascript" src="js/js_for_report_account.min.js"></script>
<?php }?>
<script type="text/javascript" src="js/jqueryui/i18n/jquery.ui.datepicker-<?=$language;?>.js" ></script>
<script type="text/javascript">
$(function(){
//loading animation
$('.loadSpinner').attr('src', "img/ajax-loader-<?=$default_theme;?>.gif").hide();
//decide what to do in which section
var what = $.getUrlVar('what');
if (what == 'my_account'){
$('.myAccountElements').show();
$('.reportAccountElements').hide();
} else {
$('.myAccountElements').hide();
$('.reportAccountElements').show();
}
/**
* account extract
*/
$('#list_account tbody').xml2html('init',{
url : 'php/ctrl/Account.php',
resultsPerPage : 20,
paginationNav : '#list_account tfoot td',
beforeLoad : function(){
$('.loadSpinner').show();
},
rowComplete : function (rowIndex, row){
$.formatQuantity(row);
},
complete : function(rowCount){
$('.loadSpinner').hide();
if ($('#list_account tbody tr').length == 0){
$.showMsg({
msg:"<?php echo $Text['msg_err_nomovements']; ?>",
type: 'warning'});
} else {
$('#list_account tbody tr:even').addClass('rowHighlight');
}
}
});
/**
-1 Manteniment
-2 Consum
-3 Cashbox
1..999 Uf cash sources (money that comes out of our pockets or goes in)
1001..1999 regular UF accounts (1000 + uf.id)
2001..2999 regular provider account (2000 + provider.id)
*/
/**
* build account SELECT
*/
$("#account_select").xml2html("init", {
url: 'php/ctrl/Account.php',
params : 'oper=getActiveAccounts',
offSet : 1,
loadOnInit: true
}).change(function(){
//get the id of the provider
var id = $("option:selected", this).val();
if (id <= -100) {
$('#list_account tbody').xml2html('removeAll');
return true;
}
$('.account_id').html(id);
$('#list_account tbody').xml2html('reload',{
params : 'oper=accountExtract&account_id='+id+'&filter=pastYear',
});
}); //end select change
$("#tblAccountViewOptions")
.button({
icons: {
secondary: "ui-icon-triangle-1-s"
}
})
.menu({
content: $('#tblAccountOptionsItems').html(),
showSpeed: 50,
width:280,
flyOut: true,
itemSelected: function(item){
var filter = $(item).attr('id');
var id = $("#account_select option:selected").val();
if (id == -100 && what != 'my_account'){
$.showMsg({
msg:"<?php echo $Text['msg_sel_account'];?>",
buttons: {
"<?=$Text['btn_ok'];?>":function(){
$(this).dialog('close');
}
},
type: 'warning'});
} else {
id = (what == 'my_account')? '':id;
$('#list_account tbody').xml2html('reload',{
params : 'oper=accountExtract&account_id='+id+'&filter='+filter,
});
}
}//end item selected
});//end menu
if (what == 'my_account'){
$('#list_account tbody').xml2html('reload',{
params : 'oper=accountExtract&filter=pastYear',
});
}
}); //close document ready
</script>
</head>
<body>
<div id="wrap">
<div id="headwrap">
<?php include "php/inc/menu.inc.php" ?>
</div>
<!-- end of headwrap -->
<div id="stagewrap">
<div id="titlewrap" class="ui-widget">
<div id="titleLeftCol50">
<h1 class="reportAccountElements"><?php echo $Text['ti_report_account']; ?></h1>
<h1 class="myAccountElements"><?php echo $Text['ti_my_account_money'];?></h1>
</div>
<div id="titleRightCol50">
<button id="tblAccountViewOptions" class="hideInPrint floatRight"><?php echo $Text['btn_filter'];?></button>
<div id="tblAccountOptionsItems" class="hidden hideInPrint">
<ul>
<li><a href="javascript:void(null)" id="today"><?php echo $Text['filter_acc_todays']; ?></a></li>
<li><a href="javascript:void(null)" id="past2Month"><?php echo $Text['filter_recent']; ?></a></li>
<li><a href="javascript:void(null)" id="pastYear"><?php echo $Text['filter_year'] ;?></a></li>
<li><a href="javascript:void(null)" id="all"><?php echo $Text['filter_all'];?></a></li>
</ul>
</div>
<p class="reportAccountElements textAlignCenter">
<select id="account_select" class="longSelect">
<option value="-100" selected="selected"><?php echo $Text['sel_account']; ?></option>
<option value="{id}">{id} {name}</option>
</select>
</p>
</div>
</div>
<div id="account_listing" class="ui-widget">
<div class="ui-widget-content ui-corner-all">
<h3 class="ui-widget-header ui-corner-all"><?=$Text['latest_movements'];?> <span class="account_id"></span> <span style="float:right; margin-top:-4px;"><img class="loadSpinner" src="img/ajax-loader.gif"/></span></h3>
<table id="list_account" class="tblListingDefault">
<thead>
<tr>
<th><?php echo $Text['date'];?></th>
<th><?php echo $Text['operator']; ?></th>
<th><?php echo $Text['description']; ?></th>
<th>Type</th>
<th><p class="textAlignCenter"><?php echo $Text['account']; ?></p></th>
<th><p class="textAlignRight"><?php echo $Text['amount']; ?></p></th>
<th><p class="textAlignRight"><?php echo $Text['balance']; ?></p></th>
</tr>
</thead>
<tbody>
<tr class="xml2html_tpl">
<td>{ts}</td>
<td>{operator}</td>
<td>{description}</td>
<td>{method}</td>
<td><p class="textAlignCenter">{account}</p></td>
<td><p class="textAlignRight"><span class="formatQty">{quantity}</span></p></td>
<td><p class="textAlignRight"><span class="formatQty">{balance}</span></p></td>
</tr>
</tbody>
<tfoot>
<tr><td></td></tr>
</tfoot>
</table>
</div>
</div>
</div>
<!-- end of stage wrap -->
</div>
<!-- end of wrap -->
<!-- / END -->
</body>
</html>