-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1f2bb75
Showing
177 changed files
with
181,969 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Login</title> | ||
<script> | ||
function Portals() { | ||
var usertype = document.getElementById("user-type").value; | ||
var username = document.getElementById("Portalusername").value; | ||
var password = document.getElementById("PortalPassword").value; | ||
|
||
if (usertype === "admin") { | ||
if (username === "fahad" && password === "fahad") { | ||
window.location.href = "/AdminPortal/admindashboard.html"; | ||
} else if (username === "mehboob" && password === "mehboob") { | ||
window.location.href = "/AdminPortal/admindashboard.html"; | ||
} else { | ||
alert("Invalid account credentials. Please try again."); | ||
} | ||
} else if (usertype === "receptionist") { | ||
if (username === "mehboob" && password === "mehboob") { | ||
window.location.href = "/Receptionist/ReceptionistDashboard.html"; | ||
} else if (username === "taimoor" && password === "taimoor") { | ||
window.location.href = "/Receptionist/ReceptionistDashboard.html"; | ||
} else { | ||
alert("Invalid account credentials. Please try again."); | ||
} | ||
} else if (usertype === "doctor") { | ||
if (username === "fahad" && password === "fahad") { | ||
window.location.href = "/Doctor/DoctorDashboard.html"; | ||
} else if (username === "mehboob" && password === "mehboob") { | ||
window.location.href = "/Doctor/DoctorDashboard.html"; | ||
} else { | ||
alert("Invalid account credentials. Please try again."); | ||
} | ||
} | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<h1>Login</h1> | ||
<form id="login-form"> | ||
<label for="user-type">User Type:</label> | ||
<select id="user-type"> | ||
<option value="admin">Admin</option> | ||
<option value="receptionist">Receptionist</option> | ||
<option value="doctor">Doctor</option> | ||
</select> | ||
<br> | ||
<label for="Portalusername">Username:</label> | ||
<input type="text" id="Portalusername"> | ||
<br> | ||
<label for="PortalPassword">Password:</label> | ||
<input type="password" id="PortalPassword"> | ||
<br> | ||
<button type="button" onclick="Portals()">Login</button> | ||
</form> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
include "connection.php"; | ||
|
||
/* ================================================================================================================== | ||
Admin Doctor | ||
==================================================================================================================*/ | ||
|
||
|
||
// department select | ||
if (isset($_POST['department'])) { | ||
$dept_no = $_POST['department']; | ||
$query = " SELECT s.speciality_id,s.speciality_name from speciality as s inner join department as d | ||
on s.dept_no=d.dept_no where d.dept_no= '$dept_no'"; | ||
$result = mysqli_query($conn, $query); | ||
|
||
foreach ($result as $row) { | ||
echo ' | ||
<option value="' . $row['speciality_id'] . '" >' . $row['speciality_name'] . '</option> | ||
'; | ||
} | ||
} | ||
|
||
// add doctor | ||
if (isset($_POST['add_doctor'])) { | ||
$id = rand(1000, 9999); | ||
$name = $_POST['doctor_name']; | ||
$department = $_POST['department']; | ||
$speciality = $_POST['speciality']; | ||
$doctor_phone = $_POST['doctor_phone']; | ||
$dob = $_POST['dob_doctor']; | ||
$experience = $_POST['experience_doctor']; | ||
$education = $_POST['education']; | ||
$address_doctor = $_POST['address_doctor']; | ||
$gender = $_POST['gender_doctor']; | ||
$about = $_POST['about']; | ||
$image = file_get_contents($_FILES['image']['tmp_name']); | ||
$img = mysqli_real_escape_string($conn, $image); | ||
|
||
$job_role = "doctor"; | ||
$salary = 100000; | ||
$emp_id = rand(1000, 9999); | ||
$shiftTiming = $_POST['shiftTiming']; | ||
$password = $_POST['password_doctor']; | ||
$p_id = rand(1000, 9999); | ||
|
||
// if($img) | ||
// { | ||
// echo "upload"; | ||
// } | ||
// else | ||
// { | ||
// echo "error"; | ||
|
||
// } | ||
$query1 = "INSERT INTO doctor VALUES('$id','$name','$doctor_phone','$dob','$experience','$education','$address_doctor','$img','$gender','$about','$speciality','$department')"; | ||
$result1 = mysqli_query($conn, $query1); | ||
if ($result1) { | ||
// employee | ||
$query2 = "INSERT INTO employees (employee_id,job_role,salary,shiftTiming,doctor_id) VALUES('$emp_id','$job_role','$salary','$shiftTiming','$id')"; | ||
$result2 = mysqli_query($conn, $query2); | ||
// emp_portal | ||
$query3 = "INSERT INTO employees_portal (portal_id,employee_id,password) VALUES('$p_id','$emp_id','$password')"; | ||
$result3 = mysqli_query($conn, $query3); | ||
|
||
|
||
if ($result3) { | ||
echo "insert"; | ||
} | ||
|
||
} else { | ||
echo "error1"; | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
|
||
// update btn doctor | ||
if (isset($_POST['doctor_updateBtn'])) | ||
{ | ||
$id=$_POST['doctor_id']; | ||
|
||
$query="SELECT * FROM doctor WHERE doctor_id='$id'"; | ||
$result=mysqli_query($conn,$query); | ||
|
||
|
||
} | ||
|
||
|
||
?> |
Oops, something went wrong.