-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathview.php
60 lines (45 loc) · 1.36 KB
/
view.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
<?php
require "pdo.php";
require_once "util.php";
if (!isset($_GET['profile_id'])) {
$_SESSION['error'] = "Could not load profile";
header("Location: index.php");
return;
}
$statement = $pdo->prepare("SELECT * FROM profile WHERE profile_id = :pid");
$statement->execute(array(
":pid" => $_GET['profile_id']
));
$row = $statement->fetch(PDO::FETCH_ASSOC);
if ($row == false) {
$_SESSION['error'] = "Could not load profile";
header("Location: index.php");
return;
}
?>
<html>
<head>
<?php require "requirements.php" ?>
</head>
<body>
<div class="container">
<p>First Name: <?= $row['first_name'] ?></p>
<p>Last Name: <?= $row['last_name'] ?></p>
<p>Email: <?= $row['email'] ?></p>
<p>Headline: <?= $row['headline'] ?></p>
<p>Summary: <?= $row['summary'] ?></p>
<ul>
<?php
$statement = $pdo->prepare("SELECT * FROM position WHERE profile_id = :pid");
$statement->execute(array(
":pid" => $row['profile_id']
));
while($row = $statement->fetch(PDO::FETCH_ASSOC)) {
echo "<li>".$row['year']." ".$row['description']."</li>";
}
?>
</ul>
<a href="index.php">Done</a>
</div>
</body>
</html>