-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdictionaryAdd.php
More file actions
52 lines (52 loc) · 1.45 KB
/
dictionaryAdd.php
File metadata and controls
52 lines (52 loc) · 1.45 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
<?php
include('lock.php');
include_once('auditTrial.php');
include_once('dictionary.php');
$groupID = $_SESSION['s_loginGroupid'];
if (isset($groupID)) {
if ($groupID==0) {
if($_SERVER["REQUEST_METHOD"] == "POST") {
// id and name sent from Form
$id=addslashes($_POST['id']);
$name=addslashes($_POST['name']);
if (insertDictionary($id, $name)) {
$_SESSION['s_systemMessage'] = "Add dictionary $id $name successfully.";
// audit trial
$auditTrial = "add dictionary $id $name successfully.";
insertAuditTrial($auditTrial);
} else {
$_SESSION['s_systemMessage'] = "Add dictionary $id $name failed.";
// audit trial
$auditTrial = "add dictionary $id $name failed.";
insertAuditTrial($auditTrial);
}
header("location: welcome.php?action=dictionaryadd");
} else {
$form = "
<meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">
<link rel=\"stylesheet\" href=\"libs/css/astlogger.css\">
<form class=\"dictionaryAddForm\" id=\"dictionaryAddForm\" action=\"dictionaryAdd.php\" method=\"post\">
<table>
<tr>
<td>ID(*)</td>
<td>:</td>
<td><input name=\"id\" type=\"text\" id=\"id\"></td>
</tr>
<tr>
<td>Name(*)</td>
<td>:</td>
<td><input name=\"name\" type=\"text\" id=\"name\"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type=\"submit\" value=\" Submit \"></td>
</tr>
</table>
</form>
";
echo $form;
}
}
}
?>