Skip to content

Commit

Permalink
web
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadfahaddev committed May 28, 2023
0 parents commit 1f2bb75
Show file tree
Hide file tree
Showing 177 changed files with 181,969 additions and 0 deletions.
58 changes: 58 additions & 0 deletions 1.html
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>
Binary file added 1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions AdminPortal/AdminPHPFile.php
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);


}


?>
Loading

0 comments on commit 1f2bb75

Please sign in to comment.