Update member report

master
Skylar Ittner 1 year ago
parent 860808d62c
commit 49f078c8fc

@ -153,12 +153,10 @@ END;
$header = $phpWord->addSection(["paperSize" => "Letter", 'marginLeft' => 600, 'marginRight' => 600, 'marginTop' => 600, 'marginBottom' => 600]); $header = $phpWord->addSection(["paperSize" => "Letter", 'marginLeft' => 600, 'marginRight' => 600, 'marginTop' => 600, 'marginBottom' => 600]);
$header->addTitle("HACHE Member Directory\n", 1); $header->addTitle("HACHE Member Directory\n", 1);
$updated = $header->addTextRun(); $header->addText("Updated: ", ['bold' => true]);
$updated->addText("Updated: ", ['bold' => true]); $header->addText("$date");
$updated->addText("$date"); $header->addText("Icon key: ", ['bold' => true]);
$iconkey = $header->addTextRun(); $header->addText("●: Graduated student | ►: Photo permission denied");
$iconkey->addText("Icon key: ", ['bold' => true]);
$iconkey->addText("●: Graduated student | ►: Photo permission denied");
$header->addText($Strings->get("You agree to use the information in this directory for homeschool use ONLY. All other purposes, such as soliciting, is strictly prohibited.", false)); $header->addText($Strings->get("You agree to use the information in this directory for homeschool use ONLY. All other purposes, such as soliciting, is strictly prohibited.", false));
$header->addTextBreak(2); $header->addTextBreak(2);
@ -178,21 +176,28 @@ END;
$famtext->addText("►"); $famtext->addText("►");
} }
$famtext->addText($f->getName(), ['bold' => true]); $famtext->addText($f->getName(), ['bold' => true]);
$famtext->addText(", " . $f->getFather() . " and " . $f->getMother()); if (!empty($f->getFather()) && !empty($f->getMother())) {
$body->addText($f->getAddress() . ", " . $f->getCity() . ", " . $f->getState() . " " . $f->getZip()); $famtext->addText(", " . $f->getFather() . " and " . $f->getMother());
$links = $body->addTextRun(); } else if (!empty($f->getFather())) {
$links->addLink("tel:" . $f->getPhone(), $f->getPhone()); $famtext->addText(", " . $f->getFather());
$links->addText(" "); } else if (!empty($f->getMother())) {
$links->addLink("mailto:" . $f->getEmail(), $f->getEmail()); $famtext->addText(", " . $f->getMother());
}
$famtext = $body->addTextRun();
$famtext->addText($f->getAddress() . ", " . $f->getCity() . ", " . $f->getState() . " " . $f->getZip());
$famtext = $body->addTextRun();
$famtext->addLink("tel:" . $f->getPhone(), $f->getPhone());
$famtext->addText(" ");
$famtext->addLink("mailto:" . $f->getEmail(), $f->getEmail());
foreach ($f->getChildren() as $child) { foreach ($f->getChildren() as $child) {
$chtext = $body->addTextRun(["indent" => 1440]); $famtext = $body->addTextRun();
if ($child->isGraduated()) { if ($child->isGraduated()) {
$chtext->addText(" ● "); $famtext->addText(" ● ");
} else { } else {
$chtext->addText(""); $famtext->addText("");
} }
$chtext->addText($child->getName() . ", " . date("M y", $child->getBirthday())); $famtext->addText($child->getName() . ", " . date("M y", $child->getBirthday()));
} }
$body->addTextBreak(1); $body->addTextBreak(1);
} }

Loading…
Cancel
Save