-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoctor_home.html
106 lines (102 loc) · 5.34 KB
/
doctor_home.html
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
<!-- page for displaying home Page
display account of the user here
aur nav bars for him to navigate to other pages
nav bar: past prescriptions, doctor booking, on doctor page and allergy button to help him search for allergies and doctors related who can help -->
<!-- or do this
make 3 bars -> about me, past prescriptions, past doctors, past reviews
where to put search for doctors ?? -->
<!DOCTYPE html>
<html>
<head>
<title>HomePage</title>
<link rel="stylesheet" href="css/style5.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div class="split left">
<div class="userimg" >
<img src="other/avatar.png" style="width: 40%; height:40% ;padding: 15px; background-size: cover; border-radius: 110px;">
</div>
<div class="navbar">
<button class="btn" style="background-color: white;"onclick="window.location.href='doctor_home.html'">About Me</button>
<button class="btn" onclick="window.location.href='doctor_prescription.html'">Past Prescriptions</button>
<button class="btn" onclick="window.location.href='doctor_operation.html'">Past Operations</button>
<button class="btn" onclick="window.location.href='doctor_test.html'">Past Medical Tests</button>
<button class="btn" onclick="window.location.href='doctor_approveapp.html'">Approve Appointments</button>
<!-- <button class="btn" onclick="window.location.href='find_doctor.html'">Find a new doctor</button> -->
</div>
</div>
<div class="split right">
<div class="pagetitle">
<p class="pagehead">Your profile</p>
<i class="material-icons">notifications</i>
</div>
<div class="profilecard">
<div class="cardhead">
<img src="other/avatar.png" style="width: 15%; height:80%; padding:25px ; padding-left: 60px;background-size:cover;border-radius: 150px;">
<div class="about" id="name">
<p><b>Name_of_the_Doctor</b><br>32 (Sample Age)</p>
</div>
</div>
<div class="divider"></div>
<div class="cardabout">
<div class="leftabout">
<div><p id="hospitall">
<b>Hospital</b><br>DMC, Ludhiana
</p></div>
<div><p id="special" style="margin-right: 20px;">
<b>Specialization</b><br>Cardiologist
</p></div>
<div><p id="gender">
<b>Gender</b><br>Female
</p></div>
</div>
<div class="rightabout">
<div><p id="add">
<b>Address of the Doctor</b><br>TIET, Patiala
</p></div>
<div><p id="charges">
<b>Consultation Charges (in ₹)</b><br>2599
</p></div>
<div>
<button class="detailchange">Update details</button>
</div>
<h2 id="message" style="margin-top: 20px; color: red;"></h2>
</div>
</div>
</div>
</div>
<script>
var myHeaders = new Headers();
myHeaders.append("Authorization", `Token ${localStorage.getItem('token')}`);
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("http://localhost:8000/specificdoctorview/", requestOptions)
.then(response => response.text())
.then((result) =>{
let data = JSON.parse(result)
console.log(data);
document.getElementById("name").innerHTML = `<p><b>Name: ${data.name}</b><br>Age: ${data.age}</p>`
document.getElementById("hospitall").innerHTML = `<b>Hospital: </b><br>${data.hospital.name}`
document.getElementById("special").innerHTML = `<b>Specialization: </b><br>${data.specialization}`
document.getElementById("gender").innerHTML = ` <b>Gender: </b><br>${data.gender}`
document.getElementById("add").innerHTML = ` <b>Address of the Doctor: </b><br>${data.hospital.address}`
document.getElementById("charges").innerHTML = ` <b>Consultation Charges (in ₹): </b><br>${data.consultation_charges}`
// let allerhist="";
// for(i=0;i<data.allergic_history.length();i++){
// allerhist+=`<tr><th>${i+1}</th><th>${data.allergic_history[i]}</th><th>${}`
// }
var pidd=data.id
console.log(data.id)
console.log(pidd)
})
.catch((error) => {
console.log(error)
document.getElementById("message").innerHTML ="There was some error in getting the details"
});
</script>
</body>
</html>