Re-LogIn"; } else if (isset($_REQUEST['logout'])) { /* * ************************ Step 2 - Case 1 ************************ */ //Log out and redirect login page unset($_SESSION['admname']); header('Location: index.php'); } else if (isset($_REQUEST['dashboard'])) { /* * ************************ Step 2 - Case 2 ************************ */ //redirect to dashboard header('Location: admwelcome.php'); } else if (isset($_REQUEST['tcmng'])) { /* * ************************ Step 2 - Case 2 ************************ */ //redirect to dashboard header('Location: tcmng.php'); } else if (isset($_REQUEST['delete'])) { /* * ************************ Step 2 - Case 3 ************************ */ //deleting the selected users unset($_REQUEST['delete']); $hasvar = false; foreach ($_REQUEST as $variable) { if (is_numeric($variable)) { //it is because, some sessin values are also passed with request $hasvar = true; if (!@executeQuery("delete from student where stdid=$variable")) { if (mysql_errno () == 1451) //Children are dependent value $_GLOBALS['message'] = "Too Prevent accidental deletions, system will not allow propagated deletions.
Help: If you still want to delete this user, then first manually delete all the records that are associated with this user."; else $_GLOBALS['message'] = mysql_errno(); } } } if (!isset($_GLOBALS['message']) && $hasvar == true) $_GLOBALS['message'] = "Selected User/s are successfully Deleted"; else if (!$hasvar) { $_GLOBALS['message'] = "First Select the users to be Deleted."; } } else if (isset($_REQUEST['savem'])) { /* * ************************ Step 2 - Case 4 ************************ */ //updating the modified values if (empty($_REQUEST['cname']) || empty($_REQUEST['password']) || empty($_REQUEST['email'])) { $_GLOBALS['message'] = "Some of the required Fields are Empty.Therefore Nothing is Updated"; } else { $query = "update student set stdname='" . htmlspecialchars($_REQUEST['cname'], ENT_QUOTES) . "', stdpassword=ENCODE('" . htmlspecialchars($_REQUEST['password']) . "','oespass'),emailid='" . htmlspecialchars($_REQUEST['email'], ENT_QUOTES) . "',contactno='" . htmlspecialchars($_REQUEST['contactno'], ENT_QUOTES) . "',address='" . htmlspecialchars($_REQUEST['address'], ENT_QUOTES) . "',city='" . htmlspecialchars($_REQUEST['city'], ENT_QUOTES) . "',pincode='" . htmlspecialchars($_REQUEST['pin'], ENT_QUOTES) . "' where stdid='" . htmlspecialchars($_REQUEST['student'], ENT_QUOTES) . "';"; if (!@executeQuery($query)) $_GLOBALS['message'] = mysql_error(); else $_GLOBALS['message'] = "User Information is Successfully Updated."; } closedb(); } else if (isset($_REQUEST['savea'])) { /* * ************************ Step 2 - Case 5 ************************ */ //Add the new user information in the database $result = executeQuery("select max(stdid) as std from student"); $r = mysql_fetch_array($result); if (is_null($r['std'])) $newstd = 1; else $newstd=$r['std'] + 1; $result = executeQuery("select stdname as std from student where stdname='" . htmlspecialchars($_REQUEST['cname'], ENT_QUOTES) . "';"); if (empty($_REQUEST['cname']) || empty($_REQUEST['password']) || empty($_REQUEST['email'])) { $_GLOBALS['message'] = "Some of the required Fields are Empty"; } else if (mysql_num_rows($result) > 0) { $_GLOBALS['message'] = "Sorry User Already Exists."; } else { $query = "insert into student values($newstd,'" . htmlspecialchars($_REQUEST['cname'], ENT_QUOTES) . "',ENCODE('" . htmlspecialchars($_REQUEST['password'], ENT_QUOTES) . "','oespass'),'" . htmlspecialchars($_REQUEST['email'], ENT_QUOTES) . "','" . htmlspecialchars($_REQUEST['contactno'], ENT_QUOTES) . "','" . htmlspecialchars($_REQUEST['address'], ENT_QUOTES) . "','" . htmlspecialchars($_REQUEST['city'], ENT_QUOTES) . "','" . htmlspecialchars($_REQUEST['pin'], ENT_QUOTES) . "')"; if (!@executeQuery($query)) { if (mysql_errno () == 1062) //duplicate value $_GLOBALS['message'] = "Given User Name voilates some constraints, please try with some other name."; else $_GLOBALS['message'] = mysql_error(); } else $_GLOBALS['message'] = "Successfully New User is Created."; } closedb(); } ?> OES-Manage Users " . $_GLOBALS['message'] . ""; } ?>
OES

 Online Examination System

...because Examination Matters

Students Management
"; if (isset($_REQUEST['add'])) { /* * ************************ Step 3 - Case 1 ************************ */ //Form for the new user ?>
User Name
Password
Re-type Password
E-mail ID
Contact No
Address
City
PIN Code
User Name
Password
E-mail ID
Contact No
Address
City
PIN Code
No Users Yet..!"; } else { $i = 0; ?> "; else echo ""; echo "" . ""; } ?>
  User Name Email-ID Contact Number Edit
" . htmlspecialchars_decode($r['stdname'], ENT_QUOTES) . "" . htmlspecialchars_decode($r['emailid'], ENT_QUOTES) . "" . htmlspecialchars_decode($r['contactno'], ENT_QUOTES) . "\"Edit\"