-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.php
More file actions
134 lines (97 loc) · 4.56 KB
/
Copy pathmain.php
File metadata and controls
134 lines (97 loc) · 4.56 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>CS Registration</title>
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link href="bootstrap.min.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>
<script src="script.js"></script>
</head>
<?php
session_start();
?>
<body id="page-top">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top" id="sideNav" >
<a class="navbar-brand js-scroll-trigger" >
<span class="d-none d-lg-block">
<img class="img-fluid img-profile rounded-circle mx-auto mb-2" src="img/profile.jpg" alt="">
</span>
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item name"> <?= $_SESSION['fullname'] ?></li>
<li class="nav-item major"><?= $_SESSION['major'] . " : " . $_SESSION['minor'] ?></li>
<li class="nav-item grad"><?php echo "Graduation Date: " . $_SESSION['datee'] ?></li>
<li class="nav-item" style="font-size:10px;padding-top:10px;">Enter (lower bound) credits per course:</li>
<li class="nav-item"><input id="amount" type="number" value="0" /></li>
<li class="nav-item" style="font-size:10px;padding-top:10px;">Enter (upper bound) credits per course:</li>
<li class="nav-item"><input id="amount2" type="number" value="0" /></li>
</ul>
</div>
</nav>
<div class="container-fluid p-0" >
<section class="tinder-section p-1 p-lg-5 d-flex d-column" style="width: 100%;">
<div class="tablehold" id="table">
<div class="subheading mb-5" id="class_number">NAME OF CLASS · COURSE NUMBER</div>
<p class="mb-5" id="descrip" style="font-size:12px;">(picture??)Class description goes here</p>
<p class="mb-5" id="capteach">Capacity, teacher etc here </p>
<p class="mb-5" style="font-weight:bold;"id="type">Class type and credits</p>
<div class="button-hold">
<button class="yes">✔</button>
<button class="no">X</button>
</div>
</div>
<div class="my-auto" style="width:100%;padding: 20px;text-align:center;border: 1px solid #CECAC1;box-shadow: 3px 3px 1px #CECAC1;">
<div class="subheading mb-5">COURSE SELECTIONS</div>
<div class="datahold">
<textarea class="wew" id="wew" name="choices" rows='8' cols='48'></textarea>
<div class="grades">A Credits Remaining:
<span id="A"><?= $_SESSION['A']?></span><br/>
B Credits Remaining:
<span id="B"><?= $_SESSION['B']?></span><br/>
C Credits Remaining:
<span id="C"><?= $_SESSION['C']?></span><br/>
G Credits Remaining:
<span id="G"><?= $_SESSION['G']?></span><br/>
S Credits Remaining:
<span id="S"><?= $_SESSION['S']?></span><br/>
</div>
</div>
<div class="button-hold">
<a href="mailto:<?= $_SESSION['email']?>"><button class="email" >Email List</button></a>
</div>
</div>
</section>
</div>
<div class="hiddens" id="sauce">
<?php
$servername = "mysql.truman.edu";
$username = "cef6418";
$password = "ohbiethe";
$dbname = "cef6418CS315";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT name, number, teacher, cap, description, type, credits FROM classesHack";
$result = mysqli_query($conn, $sql);
#create a course object class and change input from string to objects
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo $row["name"]. "!" . $row["number"]. "!" . $row["teacher"].
"!" . $row["cap"]. "!" . $row["description"].
"!" . $row["type"]. "!" . $row["credits"]. "!";
}
} else {
echo "0 results";
}
mysqli_close($conn);
?>
</div>
</body>
</html>