-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathretrieve modal.php
186 lines (74 loc) · 3 KB
/
retrieve modal.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<script type= "text/javascript">function addUser(id) { var email = prompt("To which email would you like notifications regarding this group be sent?"); $.post("welcome.php", {email: email, id: id}, function(data) { $('#wrapper').html(data); });};</script>
<script src="timeScript.js"></script>
<title>StudyBuddy Choose</title>
<LINK REL=StyleSheet HREF="bootstrap/css/bootstrap.css" TYPE="text/css" MEDIA=screen>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div id="wrapper">
<h1><a href="index.html">StudyBuddy</a><span>|choose</span></h1>
<div id = "container main">
<?php
$con = mysql_connect("localhost",REDACTED,REDACTED);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db(REDACTED, $con);
$result = mysql_query("SELECT * FROM Groups
WHERE Dept = '$_POST[dept]' AND Course = '$_POST[course]' ORDER BY
CASE AMPM WHEN '$_POST[ampm]' THEN 1
ELSE 2
END,
CASE Time WHEN '$_POST[time]:00' THEN 1
ELSE 2
END,
CASE Day WHEN '$_POST[day]' THEN 1
ELSE 2
END
ASC");
//$result = mysql_query("SELECT * FROM Groups");
echo "<table id='hor-minimalist-a'>
<tr>
<th>Course</th>
<th>Day</th>
<th>Time</th>
</tr>";
while($row = mysql_fetch_array($result))
{
$temp = $row['ID'];
echo "<tr>";
echo "<td>" . $row['Dept'] . " " . $row['Course'] . "</td>";
echo "<td>" . $row['Day'] . "</td>";
echo "<td id = \"time\">" . $row['Time'] . " " . $row['AMPM'] . "</td>";
echo "<td><a href=\"#myModal\" role=\"button\" class=\"btn\" data-toggle=\"modal\">Launch demo modal</a></td>";
echo "</tr>";
}
echo '</table>
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<form action="welcome.php" >
First Name<input type="text" name="fname" />
Last Name<input type="text" name="lname" />
Email <input type="text" name="email" />
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<input type="submit" class="btn btn-primary" value="Save changes"</input>
</form>
</div>
</div>';
mysql_close($con);
?>
</div>
</div>
</body>
</html>