This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_campus.php
169 lines (133 loc) · 4.72 KB
/
create_campus.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
<?php
session_start();
require_once 'dbconfig.php';
?>
<!DOCTYPE html>
<html>
<header>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css'>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.0.272/jspdf.debug.js"></script>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style>
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
main {
flex: 1 0 auto;
}
</style>
</header>
<main>
<nav class="cyan">
<div class="nav-wrapper">
<a href="#!" class="brand-logo center">e-Bonafide</a>
<ul class="right ">
<li class="hide-on-med-and-down"><?php echo "Welcome, ".$_SESSION['uname'];?></li>
<!-- Dropdown Trigger -->
<li class="right show-on-med-and-down"><a class="dropdown-button" href="#!" data-activates="dropdown1"><i class="material-icons right">menu</i></a></li>
</ul>
</div>
</nav>
<ul id="dropdown1" class="dropdown-content">
<li><a href="admindash.php">Dashboard</a></li>
<li class="divider"></li>
<br>
<label><h6 class="center">Campus</h6></label>
<li><a href="create_institute.php">Create User</a></li>
<li><a href="manage_institute.php">Manage User</a></li>
<li class="divider"></li>
<li><a href="changepassword.php">Change Password</a></li>
</ul>
<div class="container">
<br>
<h4>Instituition | Create Campus</h4>
<hr>
<br>
<div class="conatiner">
<br>
<div class="row">
<table class="col s6 striped responsive-table" id="campData">
<thead>
<tr>
<th>Campus Name</th>
<th>Campus ID</th>
<th>Campus Username</th>
<th>Campus Password</th>
</tr>
</thead>
<tbody>
<?php
//Institute ID
$uname=$_SESSION['uname'];
$sql=sprintf("SELECT instituteId FROM institute WHERE instituteUsername='$uname' ");
$res=mysqli_query($conn,$sql);
$row=mysqli_fetch_row($res);
$insId=$row[0];
$sql="SELECT campusName,campusId,campusUsername,campusPassword FROM campus WHERE instituteId='$insId'";
$res=mysqli_query($conn,$sql);
while($row=mysqli_fetch_row($res)){
echo" <tr><td>";
echo $row[0];
echo "</td><td>";
echo $row[1];
echo "</td><td>";
echo $row[2];
echo "</td><td>";
echo $row[3];
echo"</td></tr>";
}
?>
<div class="row">
<form class="col s12" action="add_camp.php" method="POST" >
<div class="row">
<div class="input-field col s6">
<input id="camp_name" name="camp_name" type="text" class="validate">
<label for="camp_name">Campus Name</label>
</div>
<div class="input-field col s6">
<button class="waves-effect waves-light btn green" id="submit" type="submit" >Submit</button>
</div>
</div>
</form>
</div>
</tbody>
</table>
</div>
</div>
</div>
</main>
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.1/js/materialize.min.js"></script>
<script>
$('.button-collapse').sideNav({
menuWidth: 300, // Default is 300
edge: 'right', // Choose the horizontal origin
closeOnClick: true, // Closes side-nav on <a> clicks, useful for Angular/Meteor
draggable: true, // Choose whether you can drag to open on touch screens,
onOpen: function(el) { /* Do Stuff*/ }, // A function to be called when sideNav is opened
onClose: function(el) { /* Do Stuff*/ }, // A function to be called when sideNav is closed
}
);
$(document).ready(function() {
$('select').material_select();
});
$(document).ready(function() {
Materialize.updateTextFields();
});
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.0.272/jspdf.debug.js"></script>
<script src='https://code.jquery.com/jquery-2.1.3.min.js'></script>
<footer class="page-footer cyan">
<center><a class="waves-effect waves-light btn light-blue" href="logout.php" id="logout" name="logout">Log Out</a></center>
<br>
</footer>
</html>