-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmittutorial.php
More file actions
executable file
·103 lines (101 loc) · 7.58 KB
/
Copy pathsubmittutorial.php
File metadata and controls
executable file
·103 lines (101 loc) · 7.58 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
<?php
require 'db.php';
session_start();
/* Alert message variables*/
$_SESSION['message'] = null;
$show_alert = false;
/* Login check*/
$logged_in = false;
if(isset($_SESSION['logged_in']) //if variable exists
&& $_SESSION['logged_in']==true //if variable is true
&& $_SESSION['active'] = 1){ //if account is active
$logged_in = true;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TutorialDatabase</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,600">
<link rel="stylesheet" href="assets/fonts/font-awesome.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:300,400,600">
<link rel="stylesheet" href="https://unpkg.com/@bootstrapstudio/bootstrap-better-nav/dist/bootstrap-better-nav.min.css">
<link rel="stylesheet" href="assets/css/styles.min.css">
</head>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
if (isset($_POST['submit'])) { //user submitting
if(isset($_SESSION['id'])){
require 'submittutoriallogics.php';
$show_alert = true;
}
else{
$show_alert = true;
$_SESSION['message'] = 'You are not logged in!';
}
}
}
?>
<body>
<section id="hero">
<nav class="navbar navbar-light navbar-expand-md">
<div class="container-fluid"><a class="navbar-brand" href="index.php" style="background-size:50%;height:130px;background-image:url("none");width:130px;padding:0;margin:0px 20px;"><img src="assets/img/Logo.svg" style="width:130px;"></a><button class="navbar-toggler"
data-toggle="collapse" data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navcol-1">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item" role="presentation" style="margin:0;"><a class="nav-link active" href="database.php" style="padding:8px;margin:15px;font-size:20px;color:rgb(31,155,207);font-family:Montserrat, sans-serif;font-weight:600;">DATABASE</a></li>
<?php if(!$logged_in):?>
<li class="nav-item" role="presentation" style="margin:0;"><a class="nav-link active" href="signup.php" style="padding:8px;margin:15px;font-size:20px;color:#000000;font-family:Montserrat, sans-serif;font-weight:600;">SIGN UP</a></li>
<li class="nav-item" role="presentation" style="margin:0;"><a class="nav-link active" href="login.php" style="padding:8px;margin:15px;font-size:20px;color:#000000;font-family:Montserrat, sans-serif;font-weight:600;">LOGIN</a></li>
<?php endif;?>
<li class="nav-item" role="presentation" style="margin:0;"><a class="nav-link active" href="contactus.php" style="padding:8px;margin:15px;font-size:20px;color:#000000;font-family:Montserrat, sans-serif;font-weight:600;">CONTACT US</a></li>
<?php if($logged_in):?>
<li class="nav-item" role="presentation" style="margin:0;"><a class="nav-link active" href="profile.php" style="padding:8px;margin:15px;font-size:20px;color:#000000;font-family:Montserrat, sans-serif;font-weight:600;">PROFILE</a></li>
<?php endif;?>
</ul>
</div>
</div>
</nav>
<div class="jumbotron" style="background-color:rgb(244,238,238);">
<h1 class="text-center" style="font-size:30px;margin:0px 0px 20px;"><strong>Submit tutorial</strong><br></h1>
<div id="horizontalline"><div><hr></div></div>
<?php if($show_alert):?>
<div class="alert alert-info" style="width:250px;margin:auto;">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<?= $_SESSION['message']?>
</div>
<?php endif;?>
<form method="post">
<p class="text-center" style="margin:16px 0px 0px;"><label class="d-block" style="margin:auto;">Tutorail Software Name *</label></p>
<div class="d-flex" style="margin:auto;"><input class="form-control d-block" type="text" required="" placeholder="Java" style="margin:auto;width:250px;" name="softwareName"></div>
<p class="text-center" style="margin:16px 0px 0px;"><label class="d-block" style="margin:auto;">Name Of Tutorial Creator</label></p>
<div class="d-flex" style="margin:auto;"><input class="form-control d-block" type="text" placeholder="Name Surename" style="margin:auto;width:250px;"name="creator"></div>
<p class="text-center" style="margin:16px 0px 0px;"><label class="d-block" style="margin:auto;">Tutorial Subjects *</label></p>
<p class="text-center" style="margin:0px;"><label class="d-block">(Separate Subjects With Semicolons)</label></p>
<div class="d-flex" style="margin:auto;"><input class="form-control d-block" type="text" required="" placeholder="Threads; Objects; GUI;" style="margin:auto;width:250px;"name="keywords"></div>
<p class="text-center" style="margin:16px 0px 0px;"><label class="d-block" style="margin:auto;">Difficulty *</label></p>
<p class="text-center" style="margin:0px;"><label class="d-block">(Beginner, Intermediate, Expert)</label></p>
<div class="d-flex" style="margin:auto;"><select class="form-control" style="width:250px;margin:auto;" name="difficulty"><optgroup label="Difficulty"><option value="beginner" selected>Beginner</option><option value="intermediate">Intermediate</option><option value="expert">Expert</option></optgroup></select></div>
<p class="text-center" style="margin:16px 0px 0px;"><label class="d-block" style="margin:auto;">Tutorial Link *</label></p>
<div class="d-flex" style="margin:auto;"><input class="form-control d-block" type="text" required="" placeholder="http://www.tutorialurl.com/tut" style="margin:auto;width:250px;" name="link"></div>
<p class="text-center" style="margin:16px 0px 0px;"><label class="d-block" style="margin:auto;">Free or Paid? *</label></p>
<div class="d-flex" style="margin:auto;"><select class="form-control" style="width:250px;margin:auto;" name="paid"><optgroup label="Free or Paid"><option value="0" selected>Free</option><option value="1">Paid</option></optgroup></select></div>
<p class="text-center" style="margin:16px 0px 0px;"><label class="d-block" style="margin:auto;">Description</label></p>
<div class="d-flex" style="margin:auto;width:250px;"><textarea class="form-control" placeholder="Enter description of the tutorial here." style="padding:15px;font-size:12px;" name="description"></textarea></div>
<div class="d-block" style="margin:auto;width:200px;">
<p class="text-center" style="margin:0;"><button class="btn btn-primary" type="submit" style="margin:30px;" name="submit">SUBMIT</button></p>
</div>
</form>
</div>
<footer id="stickbottom" style="width:100%;">
<p class="text-center">Copyright Darius Aleksiunas<br></p>
</footer>
</section>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/@bootstrapstudio/bootstrap-better-nav/dist/bootstrap-better-nav.min.js"></script>
</body>
</html>