-
Notifications
You must be signed in to change notification settings - Fork 10
/
viewinvest.php
139 lines (126 loc) · 3.96 KB
/
viewinvest.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
<?php
include("sqlcon.php");
error_reporting(0);
session_start();
if(!isset($_SESSION['type']))
{
echo "<script>window.location=index.php;</script>";
}
/* ### */ ?>
<?php
include("header.php")
/* ### */ ?>
<div class="container">
<div class="page">
<h3>Invested Funds</h3>
<div class="bs-example" data-example-id="contextual-table" style="border: 1px solid #eee">
<table class="table" id="dataTables-example">
<thead>
<tr>
<th>#</th>
<th>Utilized For</th>
<th>Invested Date</th>
<th>Remarks</th>
<th>Amount Invested</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="5" style="text-align:right"></th>
<th></th>
</tr>
</tfoot>
<tbody>
<?php
$res = mysqli_query($con, "Select * from tblfundinterest");
$c = 1;
if(mysqli_num_rows($res) > 0)
{
while($row = mysqli_fetch_array($res))
{
$invest=$invest+$row[iamount];
echo "<tr>
<td>".$c++."</td>
<td>".$row[investedfor]."</td>
<td>".$row[investeddate]."</td>
<td>".$row[note]."</td>
<td>".$row[iamount]."</td>
</tr>";
}
$res = mysqli_query($con, "Select sum(amount) from tblfund");
$row = mysqli_fetch_array($res);
$result = $row[0];
$bal = $result - $invest;
}
/* ### */ ?>
</tbody>
</table>
</div>
</div>
</div>
<h3 style=float:right;padding-right:120px;>Balance: <?php echo number_format((float)$bal, 2, ., ); /* ### */ ?></h3>
<h3> </h3>
<h3> </h3>
<link rel="stylesheet" type="text/css" href="DataTables-1.10.12/extensions/Buttons/css/buttons.dataTables.css">
<link rel="stylesheet" type="text/css" href="DataTables-1.10.12/media/css/jquery.dataTables.css">
<script type="text/javascript" language="javascript" src="DataTables-1.10.12/media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="DataTables-1.10.12/extensions/Buttons/js/dataTables.buttons.js">
</script>
<script type="text/javascript" language="javascript" src="Stuk-jszip-6d2b991/dist/jszip.min.js">
</script>
<script type="text/javascript" language="javascript" src="pdfmake-master/build/pdfmake.min.js">
</script>
<script type="text/javascript" language="javascript" src="pdfmake-master/build/vfs_fonts.js">
</script>
<script type="text/javascript" language="javascript" src="DataTables-1.10.12/extensions/Buttons/js/buttons.html5.js">
</script>
<script type="text/javascript" language="javascript" src="DataTables-1.10.12/examples/resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="DataTables-1.10.12/examples/resources/demo.js">
</script>
<script>
$(document).ready(function () {
$(#dataTables-example).dataTable({
dom: Bfrtip,
lengthMenu: [
[ 10, 25, 50, -1 ],
[ 10 rows, 25 rows, 50 rows, Show all ]
],
buttons: [
pageLength
],
"footerCallback": function ( row, data, start, end, display ) {
var api = this.api(), data;
// Remove the formatting to get integer data for summation
var intVal = function ( i ) {
return typeof i === string ?
i.replace(/[\$,]/g, )*1 :
typeof i === number ?
i : 0;
};
// Total over all pages
total = api
.column( 6 )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
// Total over this page
pageTotal = api
.column( 6, { page: current} )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
// Update footer
$( api.column( 6 ).footer() ).html(
Rs.+pageTotal + ( Rs.+ total + total)
);
}
} );
});
</script>
<?php
include("footer.php");
/* ### */ ?>