-
Notifications
You must be signed in to change notification settings - Fork 2
/
add_new_user.php
executable file
·112 lines (99 loc) · 2.85 KB
/
add_new_user.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
<?php
session_start();
$main_page="Add New User";
include_once("Connections/dbconnect.php");
?>
<!DOCTYPE html>
<html><!-- InstanceBegin template="/Templates/template.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Nancin Christ Standard School
<?php
if(isset($main_page))
{
echo" : $main_page";
}
if(isset($sub_page))
{
echo" : ($sub_page)";
}
?>
</title>
<!-- InstanceEndEditable -->
<link href="styles.css" rel="stylesheet" type="text/css" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body>
<div id="header">
<h1>Payroll</h1>
</div>
<div id="content">
<?php
if($main_page!="Login" && isset($_SESSION['current_user']))
{
?>
<p align="right" style="border-bottom:solid 1px #ccc;"><b>User:</b> <?php echo $_SESSION['current_user'];?></p>
<?php
}
?>
<h1 align="center"> <?php echo $main_page; ?> </h1>
<?php
if(isset($_SESSION['message']))
{
?>
<p class="<?php echo $_SESSION['messagetype']; ?>"><?php echo $_SESSION['message']; ?></p>
<?php
unset($_SESSION['message'],$_SESSION['messagetype']);
}
?>
<!-- InstanceBeginEditable name="mycontent" -->
<p align="center"><a href="home.php">Home</a> | <a href="manage_users.php">Back To Manage Users</a></p>
<form action="add_new_user_process.php" method="post" id="myform">
<table align="center" cellpadding="10" cellspacing="1">
<tr bgcolor="#efefef">
<td>Username</td>
<td><input name="username" type="text" id="username" /></td>
</tr>
<tr bgcolor="#cdcdcd">
<td>Password</td>
<td><input name="password" type="password" id="password" /></td>
</tr>
<tr bgcolor="#efefef">
<td>Name</td>
<td><input name="name" type="text" id="name" /></td>
</tr>
<tr bgcolor="#cdcdcd">
<td colspan="2" align="center"><input type="button" value="Add User" onclick="add_bttn()" /></td>
</tr>
</table>
</form>
<script type="text/javascript">
document.getElementById("username").focus()
function add_bttn()
{
if(document.getElementById("username").value=="")
{
alert("Please put in your Username");
document.getElementById("username").focus()
return null;
}
if(document.getElementById("password").value=="")
{
alert("Please put in your password");
document.getElementById("password").focus()
return null;
}
if(document.getElementById("name").value=="")
{
alert("Please put in your Name");
document.getElementById("name").focus()
return null;
}
document.getElementById("myform").submit()
}
</script>
<!-- InstanceEndEditable -->
</div>
</body>
<!-- InstanceEnd --></html>