|
35 | 35 | </section>
|
36 | 36 |
|
37 | 37 | <section class="yoti-attributes-section">
|
38 |
| - <a href="/"> |
39 |
| - <img class="yoti-company-logo" src="assets/images/company-logo.jpg" alt="company logo"> |
40 |
| - </a> |
| 38 | + <a href="/"> |
| 39 | + <img class="yoti-company-logo" src="assets/images/company-logo.jpg" alt="company logo"> |
| 40 | + </a> |
41 | 41 |
|
42 |
| - <div class="yoti-attribute-list-header"> |
43 |
| - <div class="yoti-attribute-list-header-attribute">Attribute</div> |
44 |
| - <div class="yoti-attribute-list-header-value">Value</div> |
45 |
| - <div>Anchors</div> |
46 |
| - </div> |
| 42 | + <div class="yoti-attribute-list-header"> |
| 43 | + <div class="yoti-attribute-list-header-attribute">Attribute</div> |
| 44 | + <div class="yoti-attribute-list-header-value">Value</div> |
| 45 | + <div>Anchors</div> |
| 46 | + </div> |
47 | 47 |
|
48 |
| - <div class="yoti-attribute-list-subheader"> |
49 |
| - <div class="yoti-attribute-list-subhead-layout"> |
50 |
| - <div>S / V</div> |
51 |
| - <div>Value</div> |
52 |
| - <div>Sub type</div> |
53 |
| - </div> |
54 |
| - </div> |
| 48 | + <div class="yoti-attribute-list-subheader"> |
| 49 | + <div class="yoti-attribute-list-subhead-layout"> |
| 50 | + <div>S / V</div> |
| 51 | + <div>Value</div> |
| 52 | + <div>Sub type</div> |
| 53 | + </div> |
| 54 | + </div> |
55 | 55 |
|
56 |
| - <div class="yoti-attribute-list"> |
| 56 | + <div class="yoti-attribute-list"> |
57 | 57 |
|
58 |
| - <?php foreach($profileAttributes as $item): ?> |
59 |
| - <?php if ($item['obj']) : ?> |
60 |
| - <div class="yoti-attribute-list-item"> |
61 |
| - <div class="yoti-attribute-name"> |
62 |
| - <div class="yoti-attribute-name-cell"> |
63 |
| - <i class="<?php echo $item['icon'] ?>"></i> |
64 |
| - <span class="yoti-attribute-name-cell-text"><?php echo $item['name'] ?></span> |
65 |
| - </div> |
66 |
| - </div> |
| 58 | + <?php foreach($profileAttributes as $item): ?> |
| 59 | + <?php if ($item['obj']) : ?> |
| 60 | + <div class="yoti-attribute-list-item"> |
| 61 | + <div class="yoti-attribute-name"> |
| 62 | + <div class="yoti-attribute-name-cell"> |
| 63 | + <i class="<?php echo $item['icon'] ?>"></i> |
| 64 | + <span class="yoti-attribute-name-cell-text"><?php echo htmlspecialchars($item['name']) ?></span> |
| 65 | + </div> |
| 66 | + </div> |
67 | 67 |
|
68 |
| - <div class="yoti-attribute-value"> |
| 68 | + <div class="yoti-attribute-value"> |
| 69 | + <div class="yoti-attribute-value-text"> |
69 | 70 | <?php
|
70 |
| - $name = $item['name']; |
71 |
| - $attributeObj = $item['obj']; |
72 |
| - if ($name === 'Date of birth') { |
73 |
| - $value = $item['obj']->getValue()->format('d-m-Y'); |
74 |
| - } |
75 |
| - elseif ($name === 'Age Verification') { |
| 71 | + $attributeObj = $item['obj']; |
| 72 | + switch ($item['name']) { |
| 73 | + case 'Date of birth'; |
| 74 | + echo htmlspecialchars($item['obj']->getValue()->format('d-m-Y')); |
| 75 | + break; |
| 76 | + case 'Age Verification': |
76 | 77 | // Because AgeVerification::class has a different structure
|
77 | 78 | $attributeObj = $item['obj']->getAttribute();
|
78 |
| - $value = $ageVerificationStr; |
79 |
| - } |
80 |
| - else { |
81 |
| - $value = $item['obj']->getValue(); |
82 |
| - } |
83 |
| - $anchors = $attributeObj->getAnchors(); |
| 79 | + echo htmlspecialchars($ageVerificationStr); |
| 80 | + break; |
| 81 | + case 'Structured Postal Address': |
| 82 | + ?> |
| 83 | + <table> |
| 84 | + <?php foreach ($item['obj']->getValue() as $key => $value): ?> |
| 85 | + <tr> |
| 86 | + <td><?php echo htmlspecialchars($key); ?></td> |
| 87 | + <td><?php echo htmlspecialchars($value); ?></td> |
| 88 | + </tr> |
| 89 | + <?php endforeach; ?> |
| 90 | + </table> |
| 91 | + <?php |
| 92 | + break; |
| 93 | + default: |
| 94 | + echo htmlspecialchars($item['obj']->getValue()); |
| 95 | + } |
84 | 96 | ?>
|
85 |
| - <div class="yoti-attribute-value-text"><?php echo $value; ?></div> |
| 97 | + </div> |
86 | 98 | </div>
|
87 | 99 | <div class="yoti-attribute-anchors-layout">
|
88 | 100 | <div class="yoti-attribute-anchors-head -s-v">S / V</div>
|
89 | 101 | <div class="yoti-attribute-anchors-head -value">Value</div>
|
90 | 102 | <div class="yoti-attribute-anchors-head -subtype">Sub type</div>
|
91 | 103 |
|
92 |
| - <?php foreach($anchors as $anchor) : ?> |
| 104 | + <?php foreach($attributeObj->getAnchors() as $anchor) : ?> |
93 | 105 | <div class="yoti-attribute-anchors -s-v"><?php echo $anchor->getType() ?></div>
|
94 | 106 | <div class="yoti-attribute-anchors -value"><?php echo $anchor->getValue() ?></div>
|
95 | 107 | <div class="yoti-attribute-anchors -subtype"><?php echo $anchor->getSubType() ?></div>
|
|
0 commit comments