-
Notifications
You must be signed in to change notification settings - Fork 0
/
designed_recipes.php
58 lines (53 loc) · 1.59 KB
/
designed_recipes.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
<?php
require("connect-db.php");
require('recipes.php');
require('foods.php');
session_start();
if ($_SESSION["userID"] == 0){
header("Location: login_form.php");
}
$recipes = getRecipesByUser($_SESSION["userID"]);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include("common-header.php"); ?>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<?php include("navbar.php"); ?>
<div class="jumbotron feature" style = "margin-bottom: 10px;">
<div class="container">
<h1>Designed Recipes</h1>
<p>View all the recipes you have made</p>
</div>
</div>
<div class="row justify-content-center">
<table class="w3-table w3-bordered w3-card-4 center" style="width:70%">
<thead>
<tr style="background-color:#B0B0B0">
<th width="30%"> Food Made
<th width="15%"> Prep Time
<th width="40%"> Recipe Link
<th width="15%"> Edit Recipe
</tr>
</thead>
<?php foreach ($recipes as $recipe): ?>
<?php
?>
<tr>
<td><?php echo getFoodName($recipe['foodMade']); ?></td>
<td><?php echo $recipe['prep_time'] ? $recipe['prep_time'] . " min." : "" ?></td>
<td><a href=<?php echo $recipe['link'] ?>><?php echo $recipe['link'] ?></a></td>
<td>
<form name="Edit recipe" action="edit_recipe.php">
<input type="hidden" name="recipeID" value=<?php echo $recipe['id'] ?>>
<input class="btn btn-primary" type="submit" value="Edit">
</form>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
</body>
</html>