Add family interests view (close #11)

master
Skylar Ittner 5 years ago
parent 0d67ae85ad
commit 1dd87ab62a

@ -22,5 +22,6 @@
"Okay to use photos?": "Okay to use photos?", "Okay to use photos?": "Okay to use photos?",
"Adding Family": "Adding Family", "Adding Family": "Adding Family",
"Editing Family": "Editing {family} Family", "Editing Family": "Editing {family} Family",
"Recent Payments": "Recent Payments" "Recent Payments": "Recent Payments",
"Interests": "Interests"
} }

@ -5,5 +5,6 @@
"Family deleted.": "Family deleted.", "Family deleted.": "Family deleted.",
"Are you sure you want to delete this family?": "Are you sure you want to delete this family?", "Are you sure you want to delete this family?": "Are you sure you want to delete this family?",
"This action cannot be undone! All information about this family, including payment history, will be purged forever.": "This action cannot be undone! All information about this family, including payment history, will be purged forever.", "This action cannot be undone! All information about this family, including payment history, will be purged forever.": "This action cannot be undone! All information about this family, including payment history, will be purged forever.",
"To remove a child, delete the contents of the Name box.": "To remove a child, delete the contents of the Name box." "To remove a child, delete the contents of the Name box.": "To remove a child, delete the contents of the Name box.",
"No interests selected.": "No interests selected."
} }

@ -148,5 +148,62 @@ $family = (new Family())->load($famid);
</tbody> </tbody>
</table> </table>
</div> </div>
<h4 class="mt-4"><?php $Strings->get("Interests"); ?></h4>
<?php
$events = $database->select('events', ["[>]interests" => ['eventid' => 'eventid']], ['event (name)'], ['familyid' => $family->getID()]);
$eventcount = count($events);
if ($eventcount > 0) {
$cola = [];
$colb = [];
for ($i = 0; $i < $eventcount; $i++) {
if ($i % 2 === 0) {
$cola[] = $events[$i];
} else {
$colb[] = $events[$i];
}
}
?>
<div class="row">
<div class="col-12 col-md-6">
<ul class="list-group">
<?php
foreach ($cola as $ev) {
?>
<li class="list-group-item">
<?php echo $ev['name']; ?>
</li>
<?php
}
?>
</ul>
</div>
<div class="col-12 col-md-6">
<ul class="list-group">
<?php
foreach ($colb as $ev) {
?>
<li class="list-group-item">
<?php echo $ev['name']; ?>
</li>
<?php
}
?>
</ul>
</div>
</div>
<?php
} else {
?>
<i class="fas fa-info-circle"></i> <?php $Strings->get("No interests selected."); ?>
<?php
}
?>
</div> </div>
</div> </div>
Loading…
Cancel
Save