This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
generated from StartBootstrap/startbootstrap-business-casual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
healthcare_details.php
91 lines (88 loc) · 4.17 KB
/
healthcare_details.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
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
<?php include_once 'includes/header.php'; ?>
<?php if (!empty($email)) : ?>
<?php if (!empty($_GET['h']) && is_numeric($_GET['h'])) : ?>
<?php include_once 'pdo.php'; ?>
<?php include_once 'models/Healthcare.php'; ?>
<?php
$healthcare_id = htmlspecialchars($_GET['h'], ENT_QUOTES);
$sql = "SELECT * FROM healthcare WHERE healthcare_id = :u;";
$stmt = $pdo->prepare($sql);
$stmt->execute(array(':u' => $healthcare_id));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
?>
<?php
if (!empty($row)) {
$healthcare = new Healthcare($row);
} else {
header('Location: 404.php');
exit();
}
?>
<section class="page-section about-heading">
<div class="container">
<div class="about-heading-content">
<div class="row">
<div class="col-xl-9 col-lg-10 mx-auto">
<div class="bg-faded rounded p-5">
<h2 class="section-heading mb-4">
<span class="section-heading-upper">Understand healthcares, Love your pet</span>
<span class="section-heading-lower">Learn more about <?= $healthcare->healthcare_name ?></span>
</h2>
<p>The <strong><?= $healthcare->healthcare_name ?></strong> plan
includes:
</p>
<section class="py-4 my-5">
<div class="container">
<div class="row">
<?php
foreach ($healthcare as $key => $value) {
if ($key == 'healthcare_id') {
continue;
}
echo <<<A
<div class="col-md-6 col-lg-4">
<p><strong>$key</strong></p>
A;
echo "<div><samp class='text-white bg-dark'>";
if ($key == 'price') {
echo "€ $value</samp></div></div>";
} else {
echo "$value</samp></div></div>";
}
}
?>
</div>
</div>
</section>
<?php
echo <<<QQ
<div class="text-center">
<a class="btn btn-primary text-decoration-none text-black"
QQ;
echo <<<Z
href="ads.php?h=$healthcare_id"
Z;
echo <<<R
>Check pets with this plan</a>
<a class="btn btn-primary text-decoration-none text-black" href="healthcare.php">
Go back</a>
</div>
R;
?>
</div>
</div>
</div>
</div>
</div>
</section>
<?php endif; ?>
<?php if (empty($_GET['h']) || !is_numeric($_GET['h'])) {
header('Location: 404.php');
} ?>
<?php include_once 'includes/footer.php'; ?>
</body>
</html>
<?php endif; ?>
<?php if (empty($email))
header('Location: login.php');
?>