forked from zhouhu/openpayroll
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathearningsdeductions.php
More file actions
235 lines (191 loc) · 16.1 KB
/
earningsdeductions.php
File metadata and controls
235 lines (191 loc) · 16.1 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
<?php
//include_once('config.php');
//exit($base_url);
//include_once('assets/classes/functions.php');
include_once('assets/includes/header.php');
if($_SESSION['logged_in'] != '1'){
session_start();
header('Status: 401');
header('Location: ' . urlencode('index.php'));
}
include_once('assets/includes/menubar.php');
?>
<!-- BEGIN PAGE TITLE-->
<h1 class="page-title"> Organization
<small>Manage Company's Earnings & Deductions</small>
</h1>
<!-- END PAGE TITLE-->
<!-- END PAGE HEADER-->
<!--Begin Page Content-->
<div class="row">
<div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet light bordered">
<div class="portlet-body">
<div class="table-toolbar">
<div class="row">
<div class="col-md-12">
<div class="btn-group pull-right">
<a class="btn blue btn-sm" data-toggle="modal" href="#newearning"> Create New Earning <i class="fa fa-plus-square"></i></a>
<a class="btn red btn-sm" data-toggle="modal" href="#newdeduction"> Create New Deduction <i class="fa fa-minus-square"></i></a>
<a class="btn purple btn-sm" data-toggle="modal" href="#newloan"> Create New Loan <i class="fa fa-minus-square"></i></a>
</div>
</div>
</div>
<!-- Start Modal -->
<div id="newearning" class="modal fade" tabindex="-1" data-width="560">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">New Earning</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" method="post" action="assets/classes/controller.php?act=addearning">
<div class="row">
<div class="col-md-12">
<div class="form-body">
<div class="form-group">
<label class="col-md-4 control-label">Description</label>
<div class="col-md-7">
<input type="text" required class="form-control" name="eddescription" placeholder="Title of New Earning">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Recurrent?</label>
<div class="col-md-7">
<label class="radio-inline"><input type="radio" name="recurrent" checked value="0"> No</label>
<label class="radio-inline"><input type="radio" name="recurrent" value="1"> Yes</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-outline dark">Cancel</button>
<button type="submit" class="btn red">Add Earning</button>
</div>
</form>
</div>
<div id="newdeduction" class="modal fade" tabindex="-1" data-width="560">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">New Deduction</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" method="post" action="assets/classes/controller.php?act=adddeduction">
<div class="row">
<div class="col-md-12">
<div class="form-body">
<div class="form-group">
<label class="col-md-4 control-label">Description</label>
<div class="col-md-7">
<input type="text" required class="form-control" name="eddescription" placeholder="Title of New Deduction">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Recurrent?</label>
<div class="col-md-7">
<label class="radio-inline"><input type="radio" checked name="recurrent" value="0"> No</label>
<label class="radio-inline"><input type="radio" name="recurrent" value="1"> Yes</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-outline dark">Cancel</button>
<button type="submit" class="btn red">Add Deduction</button>
</div>
</form>
</div>
<div id="newloan" class="modal fade" tabindex="-1" data-width="560">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">New Loan Facility</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" method="post" action="assets/classes/controller.php?act=addloan">
<div class="row">
<div class="col-md-12">
<div class="form-body">
<div class="form-group">
<label class="col-md-4 control-label">Description</label>
<div class="col-md-7">
<input type="text" required class="form-control" name="newloandesc" placeholder="e.g. Emergency Loan">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-outline dark">Cancel</button>
<button type="submit" class="btn red">Add Loan</button>
</div>
</form>
</div>
<!--End Modal-->
</div>
<table class="table table-striped table-bordered table-hover table-checkable order-column" id="sample_1">
<thead>
<tr>
<th> </th>
<th> E/D Code </th>
<th> Description </th>
<th> Type </th>
<th> Recurrrent? </th>
<th> Actions </th>
</tr>
</thead>
<tbody>
<!--Begin Data Table-->
<?php
try{
$query = $conn->prepare('SELECT * FROM earnings_deductions WHERE companyId = ? AND active = ? AND globalComputed = ?');
$fin = $query->execute([$_SESSION['companyid'], '1', '0']);
$res = $query->fetchAll(PDO::FETCH_ASSOC);
foreach ($res as $row => $link) {
?><tr class="odd gradeX"><td></td><?php echo '<td>' . $link['edCode'] . '</td><td>' . $link['edDesc'] . '</td><td>';
$edtype = $link['edType'];
echo '<span class="label label-inverse label-sm label-' . styleLabelColor($edtype) . '">' . $link['edType'] . '</span></td>';
if ($link['recurrentEd'] == 1) {
echo '<td> Yes </td>';
} else{
echo '<td> No </td>';
}
echo '<td><a href="" class="btn btn-zs yellow"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a>
<a href="" class="btn btn-zs red"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a> </td></tr>';
}
}
catch(PDOException $e){
echo $e->getMessage();
}
?>
<!--End Data Table-->
</tbody>
</table>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
<div class="clearfix"></div>
<!-- END DASHBOARD STATS 1-->
</div>
<!-- END CONTENT BODY -->
</div>
<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<div class="page-footer">
<div class="page-footer-inner"> 2016 © Redsphere Consulting v0.8
</div>
<div class="scroll-to-top">
<i class="icon-arrow-up"></i>
</div>
</div>
<!-- END FOOTER -->
</div>
<?php include_once('assets/includes/footer.php');?>