-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqa.php
138 lines (108 loc) · 4.46 KB
/
qa.php
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
session_start();
?>
<!DOCTYPE HTML>
<html>
<head>
<title>simplestyle_5</title>
<meta name="description" content="website description" />
<meta name="keywords" content="website keywords, website keywords" />
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<link rel="stylesheet" type="text/css" href="style/style.css" />
<script type="text/javascript">
function check(){
document.getElementById("site_content").style.display="none";
document.getElementById("popup1").style.display="block";
document.getElementById("footer").style.display="none";
}
</script>
<?php
echo"<input type=hidden name=hiddenSession id=hiddenSession value=$_SESSION[session1]>";
?>
</head>
<script src="https://www.gstatic.com/firebasejs/4.5.0/firebase.js"></script>
<script type="text/javascript">
// Initialize Firebase
var config = {
apiKey: "AIzaSyAVSbIWyaD6EoPUjXrk5tLz8qlXo5ZmIxw",
authDomain: "online-education-b4348.firebaseapp.com",
databaseURL: "https://online-education-b4348.firebaseio.com",
projectId: "online-education-b4348",
storageBucket: "online-education-b4348.appspot.com",
messagingSenderId: "524726254199"
};
firebase.initializeApp(config);
// load db
var db = firebase.database();
function submitDoctorData() {
// doctor data
var d_username = document.getElementById('hiddenSession').value;
// doctor hospital data
var h_question = document.getElementById('question').value;
addHospitalAndSignup(d_username, h_question);
}
function addHospitalAndSignup(d_username, d_question) {
// a doctor object
var UserQuestionObj = {
question: d_question,
username:d_username
}
// write to database
var dbUpdates = {};
dbUpdates['/Questions/' + d_username + "_" + "question"] = UserQuestionObj;
firebase.database().ref().update(dbUpdates);
// redirect
window.location = "patientHomePage.php";
}
</script>
</script>
<body>
<div id="main">
<div id="header">
<div id="logo">
<div id="logo_text">
<!-- class="logo_colour", allows you to change the colour of the text -->
<h1><a href="index.html">simple<span class="logo_colour">style_5</span></a></h1>
</div>
</div>
</div>
<div id="site_content">
<h2>LEARN TO ASK QUESTIONS</h2>
<input type="button" class="addbtn" value="Add a question" onclick="check()">
<div class="sidebar">
<h1>Latest News</h1>
<h4>New Website Launched</h4>
<h5>January 1st, 2010</h5>
<p>2010 sees the redesign of our website. Take a look around and let us know what you think.<br /><a href="#">Read more</a></p>
<h1>Useful Links</h1>
<ul>
<li><a href="#">link 1</a></li>
<li><a href="#">link 2</a></li>
<li><a href="#">link 3</a></li>
<li><a href="#">link 4</a></li>
</ul>
<h1>Search</h1>
<form method="post" action="#" id="search_form">
<p>
<input class="search" type="text" name="search_field" value="Enter keywords....." />
<input name="search" type="image" style="border: 0; margin: 0 0 -9px 5px;" src="style/search.png" alt="Search" title="Search" />
</p>
</form>
</div>
</div>
</div>
<div id="footer">
<p><a href="index.html">Home</a> | <a href="examples.html">Examples</a> | <a href="page.html">A Page</a> | <a href="another_page.html">Another Page</a> | <a href="contact.html">Contact Us</a></p>
<p>Copyright © simplestyle_5 | <a href="http://validator.w3.org/check?uri=referer">HTML5</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> | <a href="http://www.html5webtemplates.co.uk">Simple web templates by HTML5</a></p>
</div>
</div>
<div class="popup" id="popup1">
<br>
<div id="inner">
<h3>Type your Question below:</h3>
<textarea name="question" id="question" rows="4" cols="50"></textarea>
<input type="button" class="addbtn1" value="submit" onclick="submitDoctorData();">
</div>
</div>
</body>
</html>