-
Notifications
You must be signed in to change notification settings - Fork 1
/
view.php
62 lines (52 loc) · 1.56 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
61
62
<?php
/**
* view template
*/
include "views/header.php";
require_once 'classCat.php';
require_once 'classUtility.php';
$newCat_class = new \Cat\Cat();
$approvedGenders = $newCat_class->setAllowedGenders();
$approvedColors = $newCat_class->setAllowedColorings();
$approvedMoods = $newCat_class->setApprovedMood();
$approvedHairLength = $newCat_class->checkIsHairLengthApproved();
$time = \Cat\Utility::getDateTime();
//get id of record from url
$catId = $_GET['id'];
$currentCatData = $newCat_class->getSingleCatByID($catId);
$ourCat = \Cat\Cat::fromID($catId);
if (!empty($error_message)) : ?>
<div id="error"><p>Error: <?=$error_message?></p></div>
<?php endif; ?>
<h2 class="page_heading">View <?=$ourCat->catName?> Cat</h2>
<form>
<div class="entry">
<label>Cat Name</label>
<?=$ourCat->catName?>
</div>
<div class="entry">
<label>Age</label>
<?=$ourCat->age?>
</div>
<div class="entry">
<label>Weight</label>
<?=$ourCat->weight?>
</div>
<div class="entry">
<label>Gender</label>
<?=$ourCat->gender?>
</div>
<div class="entry">
<label>Color</label>
<?=$ourCat->coloring?>
</div>
<div class="entry">
<label>Current Mood</label>
<?=$ourCat->currentMood?>
</div>
<div class="entry">
<label>Hair Length</label>
<?=$ourCat->hairLength?>
</div>
</form>
<?php include "views/footer.php";?>