Compare commits
	
		
			7 Commits 
		
	
	
		
			Hui-Organi
			...
			Bug510-Abd
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 9816a7e22a | |
|  | 6543782ebe | |
|  | 03d9c20cf7 | |
|  | 4ac03f766c | |
|  | b1ea7bf9e8 | |
|  | b78062c9da | |
|  | 67647de04a | 
|  | @ -7,6 +7,7 @@ $page = "admin"; | |||
| include 'Header.php'; | ||||
| ?>
 | ||||
| 
 | ||||
| 
 | ||||
| <?php | ||||
| // Only Lecturer or Admin could access this page
 | ||||
| if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") { | ||||
|  | @ -14,6 +15,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") { | |||
| } | ||||
| ?>
 | ||||
| 
 | ||||
| 
 | ||||
| <style> | ||||
|   .col-md-4 { | ||||
|     border-right: 1px solid skyblue; | ||||
|  | @ -43,9 +45,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") { | |||
|         <hr> " ;
 | ||||
|         echo    "<b>TA Accounts </b><br>" ; | ||||
|       } | ||||
| 
 | ||||
|   else if($_SESSION['user_type'] == "Admin"){ | ||||
|           | ||||
|         echo " <h4> Lecturer Account Management </h4> 
 | ||||
|         <hr> ";
 | ||||
|         echo "<b>Lecturer Accounts </b><br>"; | ||||
|  | @ -83,9 +83,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") { | |||
|             echo "<b>Create TA Accounts </b>"; | ||||
|               | ||||
|           } | ||||
| 
 | ||||
|         else if($_SESSION['user_type'] == "Admin"){ | ||||
|                | ||||
|            echo "<b>Create Lecturer Accounts </b>"; | ||||
|           } | ||||
|      | ||||
|  | @ -108,7 +106,6 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") { | |||
|                     echo ' <input type="radio" name="type" value="TA" required="" id="role_TA"> TA (Teaching Assistant) '; | ||||
| 
 | ||||
|                 } | ||||
| 
 | ||||
|               else if($_SESSION['user_type'] == "Admin"){ | ||||
|                      | ||||
|                     echo " <input type='radio' name = 'type' value = 'Lecturer' required = '' id='role_lecturer' > Lecturer "; | ||||
|  | @ -161,7 +158,6 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") { | |||
|             } | ||||
| 
 | ||||
|           else if($_SESSION['user_type'] == "Admin"){ | ||||
|                  | ||||
|                 $result = mysqli_query( | ||||
|                   $con, | ||||
|                   "SELECT * FROM Users_Table  WHERE UserType in ('Lecturer')" | ||||
|  |  | |||
|  | @ -279,11 +279,12 @@ if (!empty($_POST["frm_createlecturrer"])) { | |||
|         $_SESSION["info_Admin_Users"]="Email address : ".$email." is already in use."; | ||||
|         header("Location: Admin.php");         | ||||
|     } | ||||
|     $password_hash = password_hash("$password", PASSWORD_DEFAULT); | ||||
|     $sql= "INSERT INTO `users_table`(`Email`, `Password`, `Full_Name`, `UserType`) VALUES " | ||||
|         . "('$email','$password','$fullname','$type')"; | ||||
|         . "('$email','$password_hash','$fullname','$type')"; | ||||
| 
 | ||||
|     if ($con->query($sql) === TRUE) { | ||||
|         $_SESSION["info_Admin_Users"] = $type . " user created successfully. Use email " . $email . " as accout name and $password as password."; | ||||
|         $_SESSION["info_Admin_Users"] = $type . " user created successfully. Use email " . $email . " as account name and $password as password."; | ||||
|         header("Location: Admin.php"); | ||||
|     } else { | ||||
|         echo "Error: " . $sql . "<br>" . $con->error; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue