-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptChgRecPage.php
More file actions
77 lines (77 loc) · 2.52 KB
/
optChgRecPage.php
File metadata and controls
77 lines (77 loc) · 2.52 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
<?php
include('lock.php');
include_once('auditTrial.php');
include_once('parameter.php');
include_once('option.php');
session_start();
$maxRecPerPage = getParameter("al_callrecordperpage");
if($_SERVER["REQUEST_METHOD"] == "POST") {
// username and password sent from Form
$newNumRecord=addslashes($_POST['numrecord']);
$oldNumRecord=getOption($_SESSION['s_loginUserid'], "al_callrecordperpage");
if ($newNumRecord != $oldNumRecord) {
if (!isset($oldNumRecord)) {
if (insertOption($_SESSION['s_loginUserid'], "al_callrecordperpage", $newNumRecord)) {
$_SESSION['s_callrecordperpage'] = $newNumRecord;
$_SESSION['s_systemMessage'] = "Change record per page successfully.";
// audit trial
$auditTrial = "change record per page successfully.";
insertAuditTrial($auditTrial);
} else {
$_SESSION['s_systemMessage'] = "Change record per page failed.";
// audit trial
$auditTrial = "change record per page failed.";
insertAuditTrial($auditTrial);
}
} else {
if (setOption($_SESSION['s_loginUserid'], "al_callrecordperpage", $newNumRecord)) {
$_SESSION['s_callrecordperpage'] = $newNumRecord;
$_SESSION['s_systemMessage'] = "Change record per page successfully.";
// audit trial
$auditTrial = "change record per page successfully.";
insertAuditTrial($auditTrial);
} else {
$_SESSION['s_systemMessage'] = "Change record per page failed.";
// audit trial
$auditTrial = "change record per page failed.";
insertAuditTrial($auditTrial);
}
}
} else {
$_SESSION['s_systemMessage'] = "Same record per page, no change.";
// audit trial
$auditTrial = "same record per page, no change.";
insertAuditTrial($auditTrial);
}
header("location: welcome.php?action=chgrecpage");
}
?>
<script type="text/javascript">
$(function(){
$('#optChgRecPageForm').validate({
rules: {
numrecord: {
required: true,
min: 10,
max: <?php echo $maxRecPerPage;?>,
},
},
});
});
</script>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="libs/css/astlogger.css">
<form class="optChgRecPageForm" id="optChgRecPageForm" action="optChgRecPage.php" method="post">
<table>
<tr>
<td >Records/Page</td>
<td >:</td>
<td ><input type="number" name="numrecord" id="numrecord" value="<?php echo $_SESSION['s_callrecordperpage'];?>"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" value=" Submit "></td>
</tr>
</table>
</form>