-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassignlab.php
More file actions
71 lines (64 loc) · 2.22 KB
/
assignlab.php
File metadata and controls
71 lines (64 loc) · 2.22 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
<?php session_start();
if(!isset($_SESSION['email']))
{
header("location:index(1).html");
}?>
<!DOCTYPE html>
<html>
<head>
<title>Admin Menu</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" />
</head>
<?php
include 'db.php';
include 'newhead.php';
?>
<div id="content">
<!-- insert the page content here -->
<h1>Assign Lab</h1><br><br>
<form method="post" action="">
Faculty ID::<br><br>
<select name="sid" required>
<?php $s="select * from faculty";
$q=mysqli_query($con,$s);
while($rw=mysqli_fetch_array($q))
{ ?>
<option value="<?php echo $rw['facultyid']; ?>"><?php echo $rw['facultyid']; ?></option>
<?php } ?>
</select><br><br>
Lab ID::<br><br>
<select name="lid" required>
<?php $s="select * from lab";
$q=mysqli_query($con,$s);
while($rw=mysqli_fetch_array($q))
{ ?>
<option value="<?php echo $rw['labId']; ?>"><?php echo $rw['labId']; ?></option>
<?php } ?>
</select><br><br>
<input type="submit" name="submit" value="Assign"><br><br>
</form>
</div>
</div>
<!-- <div id="content_footer"></div>
<div id="footer">
<p><a href="index.php">Home</a> | <a href="request.php">Request</a> | <a href="stock.php">Stock</a> | <a href="return.php">Return</a>
| <a href="due.php">Dues</a> </p>
<p>Copyright © simplestyle_blue_trees | <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">design from HTML5webtemplates.co.uk</a></p>
</div>
-->
</div>
</body>
<?php
if(isset($_POST['submit'])){
$sid = $_POST['sid'];
$lid = $_POST['lid'];
$sql = "INSERT INTO faculty_labid VALUES ('$sid','$lid')";
mysqli_query($con,$sql);
mysqli_close();
header("location:admin_home.php");
}
?>
</html>