-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdetails.php
92 lines (81 loc) · 3.17 KB
/
details.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
<?php
session_start();
if (isset($_SESSION['login'])!=true)
{
header("Location:Student_Login.php");
}
include_once 'dbconnect.php';
?>
<html>
<head>
<meta content="width=device-width, initial-scale=1.0" name="viewport" >
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbar1">
<a href="index.html"><img src="images/logo3.png" width="200px" height="120px" title="logo" /></a>
<ul class="nav navbar-nav navbar-right">
<?php if (isset($_SESSION['usr_id'])) { ?>
<li><p class="navbar-text">Signed in as <?php echo $_SESSION['usr_name'];
$u=$_SESSION['usr_id'] ;?></p></li>
<li><a href="logout.php">Log Out</a></li>
<li><a href="login.php"></a></li>
<li><a href="register.php"></a></li>
<?php } ?>
</ul>
</div>
</div>
</nav>
</body>
</html>
<?php
if (isset($_SESSION['usr_id']))
{
//echo $_SESSION['usr_id'];
$id=$_SESSION['usr_id'];
}
$cid=$_GET['cid'];
include('dbconnect.php');
$res1=mysqli_query($con,"select * from courses where cid=$cid");
while($name=mysqli_fetch_array($res1))
{
$fid=$name['fid'];
$cname=$name['cname'];
$cname1=urlencode($cname);
$descp=$name['descp'];
$res2=mysqli_query($con,"select * from faculty where fid=$fid");
$name1=mysqli_fetch_array($res2);
$fname=$name1['name'];
echo "<center>";
echo "<div class='container'><table class='table table-striped '>
<tbody>
<tr> <td><center> Course </center></td> <td><center> $cname </center></td> </tr>";
echo "<br>";
echo "<tr> <td><center> Description </td> <td><center> $descp </center></td> </tr>";
echo "<br>";
echo "<tr> <td><center> Faculty </td> <td><center> $fname </center></td> </tr></tbody></table>";
echo "<br>";
echo "<br>";
echo "<br>";
echo " <a href=unregpage.php?id=$id&cid=$cid&fid=$fid&var=$cname1 class='btn btn-primary' role='button'><h6>Unregister</h6></a>";
}
$n=urlencode($cname);
$_SESSION['cid'] = $cid;
$_SESSION['n1'] = $n;
echo "<a href=addtopic.php class='btn btn-primary' role='button'><h6> Add Discusion</h6> </a>";
//$s=urlencode('current discussions.php');
echo "<a href=currentdiscussions.php class='btn btn-primary' role='button'><h6>Current Discussions</h6></a>";
?>