-
Notifications
You must be signed in to change notification settings - Fork 0
/
report-tracker.php
54 lines (54 loc) · 1.08 KB
/
report-tracker.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
<?php
include './resources/init.php';
$tmpl->place('header');
?>
<script type="text/javascript" src="./js/admin-branch.js"></script>
<?php
$tmpl->place('menu');
?>
<div id="content" class="span-24 last">
<?php $tmpl->place('menuReport'); ?>
<h2>User Report</h2><h3>Aging</h3>
<?php
$branch = "HQKL";
$items = Inv_stock::findByBranch($branch);
?>
<table>
<thead>
<tr>
<th></th>
<?php
for($i=1;$i<=12;$i++)
{
$stringmonth = date("F", mktime(0,0,0,$i));
echo "<th>".$stringmonth."</th>";
}
?>
</tr>
</thead>
<tbody>
<?php
foreach($items as $item)
{
?>
<tr>
<td>
<?php echo $item->prepareItemId(); ?>
</td>
<?php
$total = 0;
for($i=1;$i<=12;$i++)
{
$value = Inv_movement::findByMonth($branch,$i,$item->getItemId());
$arr[$item->getItemId()][$i] = $value;
echo "<td>".($value > 0 ? "+".$value : $value);
$total = $total + $arr[$item->getItemId()][$i];
echo "(".$total.")</td>";
}
?>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php $tmpl->place('footer'); ?>