-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmitroute.php
More file actions
58 lines (55 loc) · 1.74 KB
/
submitroute.php
File metadata and controls
58 lines (55 loc) · 1.74 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
<?php include 'header.php'?>
<?php include 'connect.php'?>
<?php
if ($_GET["objid"]){
if ($_GET["type"] == '1'){
$sql = "SELECT * FROM `GymAndLocation` WHERE `objid` = ".$_GET["objid"];
}
else {
$sql = "SELECT * FROM `SiteAndLocation` WHERE `objid` = ".$_GET["objid"];
}
$result = mysqli_query($mysqli, $sql);
}
?>
<div class="row">
<div class="col-lg-12">
<h2>
<?php
if($result->num_rows > 0){
$row = $result->fetch_assoc();
echo " " . htmlspecialchars($row["name"]);
}
echo "</h2>";
?>
<form action="route_upload.php" method="post" enctype="multipart/form-data">
<fieldset>
<legend>New Route:</legend>
<h4>Route Description:
<p>
<textarea name="description" rows="15" cols="60" required = "true" placeholder="Enter your description here, please use only 500 words."></textarea>
</p>
</h4>
<h4>Difficulty:
<p>
<textarea name="difficulty" rows="1" cols="6" required = "true" placeholder="Enter a difficulty."></textarea>
</p>
</h4>
<h4>Select image to upload:</h4>
<input type="file" name="fileToUpload" id="fileToUpload">
<button type="submit" name="submit" value="Submit">Submit</button>
<input type="hidden" name="objid" value="<?php echo $_GET['objid']; ?>">
</fieldset>
</form>
</div>
<?php /* CURRENTLY NOT IN USE
if($_POST['submityes'] == "Submit"){
$OBJID = $_GET['objid'];
$CONTENT = $_POST['description'];
$DIFFICULTY = $_POST['difficulty'];
if($OBJID != NULL && $CONTENT != NULL && $DIFFICULTY != NULL){
$result = $mysqli->query("INSERT INTO `Route` (`locationID`, `bio`, `difficulty`) VALUES ('$OBJID', '$CONTENT', '$DIFFICULTY')");
}
}*/
?>
</div>
<?php include 'footer.php' ?>