本文整理汇总了PHP中Family::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Family::setValue方法的具体用法?PHP Family::setValue怎么用?PHP Family::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Family
的用法示例。
在下文中一共展示了Family::setValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printResults
function printResults($with_links = FALSE)
{
$db = $GLOBALS['db'];
$groupid = (int) $_REQUEST['groupid'];
$all_member_details = array_get($_REQUEST, 'all_member_details', 0);
if (empty($groupid)) {
return;
}
$sql = '
select family.id as familyid, family.family_name, family.home_tel,
person.*, congregation.long_name as congname,
address_street, address_suburb, address_state, address_postcode
from family
join person on family.id = person.familyid
left join congregation on person.congregationid = congregation.id
where person.status <> "archived"
and family.id in
(select familyid
from person join person_group_membership pgm on person.id = pgm.personid
where pgm.groupid = ' . (int) $groupid;
if (!empty($_REQUEST['congregationid'])) {
$sql .= '
AND person.congregationid in (' . implode(',', array_map(array($db, 'quote'), $_REQUEST['congregationid'])) . ')';
}
$sql .= ')
order by family_name asc, age_bracket asc, gender desc
';
$res = $db->queryAll($sql, null, null, true, true, true);
check_db_result($res);
if (empty($res)) {
?>
<p><i>No families to show</i></p><?php
return;
}
$sql = '
select personid
from person_group_membership pgm
where pgm.groupid = ' . (int) $groupid;
$signups = $db->queryCol($sql);
check_db_result($signups);
$GLOBALS['system']->includeDBClass('family');
$GLOBALS['system']->includeDBClass('person');
$dummy_family = new Family();
$dummy_person = new Person();
?>
<table class="contact-list">
<?php
foreach ($res as $familyid => $family_members) {
$adults = array();
$children = array();
$adults_use_full = false;
$children_use_full = false;
foreach ($family_members as $member) {
if (empty($_REQUEST['age_bracket']) || in_array($member['age_bracket'], $_REQUEST['age_bracket'])) {
$adults[] = $member;
if ($member['last_name'] != $member['family_name']) {
$adults_use_full = true;
}
} else {
$children[] = $member;
if ($member['last_name'] != $member['family_name']) {
$children_use_full = true;
}
}
}
$first_member = reset($family_members);
?>
<tr><td colspan="4"><h2 style="margin-bottom: 0px"><?php
echo $first_member['family_name'];
?>
</h2></td></tr>
<?php
if ($first_member['home_tel']) {
$dummy_family->setValue('home_tel', $first_member['home_tel']);
echo '<tr><td colspan="4"><h3 style="border: 0px; margin: 0px; padding: 0px">';
echo ents($dummy_family->getFormattedValue('home_tel'));
echo '</h3></td></tr>';
}
if (!empty($_REQUEST['include_address']) && $first_member['address_street']) {
echo '<tr><td colspan="4">' . nl2br(ents($first_member['address_street'])) . '<br />';
echo ents($first_member['address_suburb'] . ' ' . $first_member['address_state'] . ' ' . $first_member['address_postcode']);
echo '</td></tr>';
}
$fn = $with_links ? 'printFieldValue' : 'getFormattedValue';
foreach ($adults as $adult) {
$dummy_person->populate($adult['id'], $adult);
?>
<tr>
<td><?php
echo ents($adults_use_full ? $adult['first_name'] . ' ' . $adult['last_name'] : $adult['first_name']);
?>
</td>
<td><?php
echo ents($adult['congname']);
?>
</td>
<td><?php
if ($all_member_details || in_array($adult['id'], $signups)) {
echo ents($dummy_person->getFormattedValue('mobile_tel'));
//.........这里部分代码省略.........