-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcclassroom.php
More file actions
57 lines (56 loc) · 2.36 KB
/
cclassroom.php
File metadata and controls
57 lines (56 loc) · 2.36 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
<?php
require 'core.inc.php';
if (loggedin()) {
include ('headerlogin.php');
include 'connect.php';
if (isset($_GET['ctut'])) {
$tut = htmlspecialchars(mysqli_real_escape_string($link, $_GET['ctut']));
$sql= "SELECT * FROM ctuts WHERE id ='".$tut."'";
if($result = mysqli_query($link, $sql)) {
$_SESSION['ctut']= $tut;
}
}
if (@$_SESSION['ctut']==null) {
echo '<div class="alert alert-danger">
Something went wrong. Click <a href="c.map.php">here<a> to return
</div>';
}
$sql= "SELECT * FROM ctuts WHERE id='".$_SESSION['ctut']."'";
$result = mysqli_query($link, $sql);
while (@$row = mysqli_fetch_array($result)) {
$next = $row['id']+1;
echo '
<title>'.$row['title'].' | The Programmer\'s Hub</title>
<div class="container-fluid" style="margin-top: 50px;">
<div class="row">
<!--first column-->
<div class="col-sm-3">
<div class="col-sm-10">
<h4 class="feature-title">'.$row['title'].'</h4><hr>
<p class="grey-text">'.$row['brief'].'</p>
<p class="grey-text">Have a question, or need more clarifcation? Use our<a href="https://gitter.im/The-Programmers-Hub/Lobby?source=orgpage" target="_blank"> forum.</a></p>
<a href="cclassroom?ctut='.$next.'"><button class="btn-outline-info btn-block btn-rounded btn" name="submit">Next Tutorial</button></a><br>
</div>
<div style="height:30px;"></div>
</div>
<!--second column-->
<div class="col-sm-9">
<div class="col-sm-10">
<h4 class="feature-title">Watch video tutorial</h4><hr>
<p class="grey-text"><div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="'.$row['ulink'].'" allowfullscreen></iframe>
</div>
</p>
</div>
<div style="height:30px;"></div>
</div>
</div>
</div>';
}
}else {
include ('header.php');
echo '<div class="alert alert-danger">
Welcome to our C Programming Tutorial page. You need to <a type="button" data-toggle="modal" style="color: blue;" data-target="#modalLogin">login</a> or <a type="button" data-toggle="modal" style="color: blue;" data-target="#modalRegister">register</a> to view tutorials.
</div>';
}
?>