-
Notifications
You must be signed in to change notification settings - Fork 15
/
genpop.php
executable file
·295 lines (253 loc) · 14.1 KB
/
genpop.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
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
<?php
/**
* OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
* all the essential functionalities required for any enterprise.
* Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
*
* OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
*/
session_start();
if(!isset($_SESSION['fname'])) {
header("Location: ./relogin.htm");
exit();
}
define('ROOT_PATH', dirname(__FILE__));
require_once ROOT_PATH . '/lib/controllers/GenViewController.php';
require_once ROOT_PATH . '/lib/confs/sysConf.php';
require_once ROOT_PATH . '/lib/common/CommonFunctions.php';
$srchlist[0] = array( 0 , 1 , 2 );
$srchlist[1] = array( '--Select--' , 'ID' , 'Description' );
$sysConst = new sysConf();
$genviewcontroller = new GenViewController();
$headingInfo = $genviewcontroller->getHeadingInfo($_GET['uniqcode']);
$currentPage = (isset($_POST['pageNO'])) ? (int)$_POST['pageNO'] : 1;
if (isset($_POST['captureState'])&& ($_POST['captureState']=="SearchMode"))
{
$choice=$_POST['loc_code'];
$strName=trim($_POST['loc_name']);
$list = $genviewcontroller ->getInfo($_GET['uniqcode'],$currentPage,$strName,$choice);
}
else {
$list = $genviewcontroller -> getInfo($_GET['uniqcode'],$currentPage);
}
$styleSheet = CommonFunctions::getTheme();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link href="./themes/<?php echo $styleSheet;?>/css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">@import url("./themes/<?php echo $styleSheet;?>/css/style.css"); </style>
<title>Un Assigned <?php echo $headingInfo[3]?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<script>
function nextPage() {
var i=eval(document.standardView.pageNO.value);
document.standardView.pageNO.value=i+1;
document.standardView.submit();
}
function prevPage() {
var i=eval(document.standardView.pageNO.value);
document.standardView.pageNO.value=i-1;
document.standardView.submit();
}
function chgPage(pNO) {
document.standardView.pageNO.value=pNO;
document.standardView.submit();
}
function selItm(cntrl) {
opener.document.standardView.action="./CentralController.php?id=" + cntrl.title + "&uniqcode=<?php echo $_GET['uniqcode']?>";
opener.document.standardView.submit();
window.close();
}
function Search() {
if (document.standardView.loc_code.value == 0) {
alert('<?php echo $lang_empview_SelectField;?>');
document.standardView.loc_code.Focus();
return;
};
document.standardView.captureState.value = 'SearchMode';
document.standardView.action="./genpop.php?uniqcode=<?php echo $_GET['uniqcode']?>"
document.standardView.pageNO.value=1;
document.standardView.submit();
}
function clear_form() {
document.standardView.loc_code.options[0].selected=true;
document.standardView.loc_name.value='';
}
</script>
<body>
<p>
<table width='100%' cellpadding='0' cellspacing='0' border='0' class='moduleTitle'><tr><td valign='top'>
<form name="standardView" method="post">
</td><td width="100%"><h2>Un Assigned <?php echo $headingInfo[3]?>
</h2></td>
<p>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="22%" nowrap><h3>
<input type="hidden" name="captureState" value="<?php echo isset($_POST['captureState'])?$_POST['captureState']:''?>">
<input type="hidden" name="pageNO" value="<?php echo isset($_POST['pageNO'])?$_POST['pageNO']:'1'?>">
<input type="hidden" name="empID" value="">
</h3></td>
<td width='78%'><IMG height='1' width='1' src='./pictures/blank.gif' alt=''></td>
</tr>
</table>
<p>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="22%" nowrap><h3>Search</h3></td>
<td width='78%' align="right"><IMG height='1' width='1' src='./pictures/blank.gif' alt=''>
<font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif">
</font> </td>
</tr>
</table>
<!-- newtable -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="13"><img name="table_r1_c1" src="themes/<?php echo $styleSheet; ?>/pictures/table_r1_c1.gif" width="13" height="12" border="0" alt=""></td>
<td width="339" background="themes/<?php echo $styleSheet; ?>/pictures/table_r1_c2.gif"><img name="table_r1_c2" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td width="13"><img name="table_r1_c3" src="themes/<?php echo $styleSheet; ?>/pictures/table_r1_c3.gif" width="13" height="12" border="0" alt=""></td>
<td width="11"><img src="themes/beyondT/pictures/spacer.gif" width="1" height="12" border="0" alt=""></td>
</tr>
<tr>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r2_c1.gif"><img name="table_r2_c1" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><table border="0" cellpadding="5" cellspacing="0" class="">
<tr>
<td width="200" class="dataLabel"><slot>Search By:</slot> <slot>
<select style="z-index: 99;" name="loc_code">
<?php for($c=0;count($srchlist[0])>$c;$c++)
if(isset($_POST['loc_code']) && $_POST['loc_code']==$srchlist[0][$c])
echo "<option selected value='" . $srchlist[0][$c] ."'>".$srchlist[1][$c] ."</option>";
else
echo "<option value='" . $srchlist[0][$c] ."'>".$srchlist[1][$c] ."</option>";
?>
</select>
</slot></td>
<td width="200" class="dataLabel" noWrap><slot>Description</slot> <slot>
<input type=text size="20" name="loc_name" class=dataField value="<?php echo isset($_POST['loc_name'])? stripslashes($_POST['loc_name']):''?>">
</slot></td>
<td align="right" width="180" class="dataLabel"><img title="Search" onClick="Search();" onMouseOut="this.src='./themes/beyondT/pictures/btn_search.gif';" onMouseOver="this.src='./themes/beyondT/pictures/btn_search_02.gif';" src="./themes/beyondT/pictures/btn_search.gif"> <img title="Clear" onClick="clear_form();" onMouseOut="this.src='./themes/beyondT/pictures/btn_clear.gif';" onMouseOver="this.src='./themes/beyondT/pictures/btn_clear_02.gif';" src="./themes/beyondT/pictures/btn_clear.gif"></td>
</table></td>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r2_c3.gif"><img name="table_r2_c3" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r2_c1.gif"><img name="table_r2_c1" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><table border="0" cellpadding="5" cellspacing="0" class="">
</table></td>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r2_c3.gif"><img name="table_r2_c3" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td><img name="table_r3_c1" src="themes/<?php echo $styleSheet; ?>/pictures/table_r3_c1.gif" width="13" height="16" border="0" alt=""></td>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r3_c2.gif"><img name="table_r3_c2" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img name="table_r3_c3" src="themes/<?php echo $styleSheet; ?>/pictures/table_r3_c3.gif" width="13" height="16" border="0" alt=""></td>
<td><img src="themes/beyondT/pictures/spacer.gif" width="1" height="16" border="0" alt=""></td>
</tr>
</table>
<table border="0" width="100%">
<tr>
<td height="40" valign="bottom" align="right">
<?php
if (isset($_POST['captureState'])&& ($_POST['captureState']=="SearchMode"))
$temp = $genviewcontroller -> countList($_GET['uniqcode'],$strName,$choice);
else
$temp = $genviewcontroller -> countList($_GET['uniqcode']);
if($temp)
$recCount=$temp;
else
$recCount=0;
$noPages=(int)($recCount/$sysConst->itemsPerPage);
if($recCount%$sysConst->itemsPerPage)
$noPages++;
echo $noPages;
if ($noPages > 1) {
if($currentPage==1)
echo "<font color='Gray'>Previous</font>";
else
echo "<a href='#' onClick='prevPage()'>Previous</a>";
echo " ";
for( $c = 1 ; $noPages >= $c ; $c++) {
if($c == $currentPage)
echo "<font color='Gray'>" .$c. "</font>";
else
echo "<a href='#' onClick='chgPage(" .$c. ")'>" .$c. "</a>";
echo " ";
}
if($currentPage == $noPages || $noPages==0)
echo "<font color='Gray'>Next</font>";
else
echo "<a href='#' onClick='nextPage()'>Next</a>";
};
?>
</td>
<td width="25"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="13"><img name="table_r1_c1" src="themes/<?php echo $styleSheet; ?>/pictures/table_r1_c1.gif" width="13" height="12" border="0" alt=""></td>
<td width="339" background="themes/<?php echo $styleSheet; ?>/pictures/table_r1_c2.gif"><img name="table_r1_c2" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td width="13"><img name="table_r1_c3" src="themes/<?php echo $styleSheet; ?>/pictures/table_r1_c3.gif" width="13" height="12" border="0" alt=""></td>
<td width="11"><img src="themes/beyondT/pictures/spacer.gif" width="1" height="12" border="0" alt=""></td>
</tr>
<tr>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r2_c1.gif"><img name="table_r2_c1" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><table width="100%" border="0" cellpadding="5" cellspacing="0" class="">
<td width="50" NOWRAP class="listViewThS1" scope="col"></td>
<td scope="col" width="250" class="listViewThS1"><?php echo $headingInfo[0]?></td>
<td scope="col" width="400" class="listViewThS1"><?php echo $headingInfo[1]?></td>
</table></td>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r2_c3.gif"><img name="table_r2_c3" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<?php
if ((isset($list)) && ($list !='')) {
for ($j=0; $j<count($list);$j++) {
?>
<tr>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r2_c1.gif"><img name="table_r2_c1" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><table width="100%" border="0" cellpadding="5" cellspacing="0" class="">
<?php if(!($j%2)) { ?>
<td width="50"></td>
<td width="250"><a title="<?php echo $list[$j][0]?>" href="#" onClick="selItm(this)"><?php echo $list[$j][0]?></a></td>
<td width="400" ><?php echo $list[$j][1]?></td>
<?php } else { ?>
<td bgcolor="#EEEEEE" width="50"></td>
<td bgcolor="#EEEEEE" width="250"><a title="<?php echo $list[$j][0]?>" href="#" onClick="selItm(this)"><?php echo $list[$j][0]?></a></td>
<td bgcolor="#EEEEEE" width="400" ><?php echo $list[$j][1]?></td>
<?php } ?>
</table></td>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r2_c3.gif"><img name="table_r2_c3" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<?php }
} else if ((isset($message)) && ($message =='')) {
$dispMessage = "No Records Found";
echo '<font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif">';
echo $dispMessage;
echo '</font>';
}
?>
<tr>
<td><img name="table_r3_c1" src="themes/<?php echo $styleSheet; ?>/pictures/table_r3_c1.gif" width="13" height="16" border="0" alt=""></td>
<td background="themes/<?php echo $styleSheet; ?>/pictures/table_r3_c2.gif"><img name="table_r3_c2" src="themes/beyondT/pictures/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img name="table_r3_c3" src="themes/<?php echo $styleSheet; ?>/pictures/table_r3_c3.gif" width="13" height="16" border="0" alt=""></td>
<td><img src="themes/beyondT/pictures/spacer.gif" width="1" height="16" border="0" alt=""></td>
</tr>
<!-- newtable -->
</form>
</body>
</html>