本文整理汇总了PHP中Person::printFieldValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Person::printFieldValue方法的具体用法?PHP Person::printFieldValue怎么用?PHP Person::printFieldValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person::printFieldValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printFormParallel
//.........这里部分代码省略.........
<?php
if (SizeDetector::isWide()) {
?>
<td><?php
echo $personid;
?>
</td>
<?php
}
if ($this->_show_photos) {
?>
<td>
<a class="med-popup" tabindex="-1" href="?view=persons&personid=<?php
echo $personid;
?>
">
<img style="width: 50px; max-width: 50px" src="?call=photo&personid=<?php
echo (int) $personid;
?>
" />
</a>
</td>
<?php
}
?>
<td><?php
echo ents($detail['first_name'] . ' ' . $detail['last_name']);
?>
</td>
<?php
if (SizeDetector::isWide()) {
?>
<td class=""><?php
$dummy->printFieldValue('status', $detail['status']);
?>
</td>
<?php
}
foreach ($this->_record_sets as $prefix => $set) {
?>
<td class="parallel-attendance">
<?php
$totalPrinted += $set->printWidget($prefix, $personid);
?>
</td>
<?php
}
if (SizeDetector::isWide()) {
?>
<td class="action-cell narrow">
<a class="med-popup" tabindex="-1" href="?view=persons&personid=<?php
echo $personid;
?>
"><i class="icon-user"></i><?php
echo _('View');
?>
</a>
<a class="med-popup" tabindex="-1" href="?view=_edit_person&personid=<?php
echo $personid;
?>
"><i class="icon-wrench"></i><?php
echo _('Edit');
?>
</a>
<a class="med-popup" tabindex="-1" href="?view=_add_note_to_person&personid=<?php
echo $personid;
示例2: printFieldValue
/**
* Print the value of a field to the HTML interface
*
* Subclasses should add links and other HTML markup by overriding this
*/
function printFieldValue($name, $value = null)
{
if (is_null($value)) {
$value = $this->getValue($name);
}
if ($name == 'restrictions') {
?>
<table class="standard">
<tr>
<th>Congregation Restrictions: </th>
<th>Group Restrictions:</th>
</tr>
<tr>
<td>
<?php
if (!empty($value['congregation'])) {
foreach ($GLOBALS['system']->getDBObjectData('congregation', array('(id' => $value['congregation'])) as $cong) {
echo ents($cong['name']) . '<br />';
}
} else {
echo '(None)';
}
?>
</td>
<td>
<?php
if (!empty($value['group'])) {
foreach ($GLOBALS['system']->getDBObjectData('person_group', array('(id' => $value['group'])) as $group) {
echo ents($group['name']) . '<br />';
}
} else {
echo '(None)';
}
?>
</td>
</tr>
</table>
<?php
} else {
return parent::printFieldValue($name, $value);
}
}
示例3: list
function _printResultSet($congid, $groupid)
{
echo '<h3>';
if ($congid) {
$cong = $GLOBALS['system']->getDBObject('congregation', $congid);
$cong->printFieldValue('name');
echo ' Congregation';
} else {
$group = $GLOBALS['system']->getDBObject('person_group', $groupid);
$group->printFieldValue('name');
echo ' Group';
}
echo '</h3>';
list($dates, $attendances, $totals) = Attendance_Record_Set::getAttendances((array) $congid, $groupid, $this->age_bracket, $this->start_date, $this->end_date);
if (empty($attendances)) {
?>
<p><i>No attendance records found. Try adjusting your criteria.</i></p>
<?php
return;
}
$headcounts = Headcount::fetchRange($congid ? 'congregation' : 'person_group', $congid ? $congid : $groupid, $this->start_date, $this->end_date);
$letters = array(0 => 'A', 1 => 'P', '' => '?');
$classes = array(0 => 'absent', 1 => 'present', '' => 'unknown');
$dummy = new Person();
?>
<form method="post" action="" class="bulk-person-action">
<table class="table table-hover table-auto-width nowrap table-bordered table-condensed">
<thead>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th><?php
echo $this->groupid ? 'Membership Status' : 'Status';
?>
</th>
<?php
foreach ($dates as $date) {
?>
<th><?php
echo date('j M', strtotime($date));
?>
</th>
<?php
}
?>
<th>Actions</th>
<th class="narrow selector form-inline"><input type="checkbox" class="select-all" title="Select all" /></th>
</tr>
</thead>
<tbody>
<?php
foreach ($attendances as $personid => $record) {
?>
<tr <?php
if ($record['status'] == 'archived') {
echo 'class="archived"';
}
?>
>
<td><?php
echo ents($record['last_name']);
?>
</td>
<td><?php
echo ents($record['first_name']);
?>
</td>
<td>
<?php
if ($this->groupid) {
echo ents($record['membership_status']);
} else {
$dummy->printFieldValue('status', $record['status']);
}
?>
</td>
<?php
foreach ($dates as $date) {
$letter = $letters[array_get($record, $date, '')];
$class = $classes[array_get($record, $date, '')];
echo '<td class="' . $class . '">' . $letter . '</td>';
}
?>
<td class="narrow action-cell">
<a class="med-popup" href="?view=persons&personid=<?php
echo $personid;
?>
"><i class="icon-user"></i>View</a>
<?php
if ($GLOBALS['user_system']->havePerm(PERM_EDITPERSON)) {
?>
<a class="med-popup" href="?view=_edit_person&personid=<?php
echo $personid;
?>
"><i class="icon-wrench"></i>Edit</a>
<?php
}
if ($GLOBALS['user_system']->havePerm(PERM_EDITNOTE)) {
?>
<a class="med-popup" href="?view=_add_note_to_person&personid=<?php
//.........这里部分代码省略.........
示例4: printForm
public function printForm($prefix = 0)
{
if (empty($this->_persons)) {
return 0;
}
$GLOBALS['system']->includeDBClass('person');
$dummy = new Person();
?>
<table class="table table-condensed table-auto-width valign-middle">
<?php
$is_first = TRUE;
foreach ($this->_persons as $personid => $details) {
$dummy->populate($personid, $details);
?>
<tr>
<?php
if (!SizeDetector::isNarrow()) {
?>
<td><?php
echo $personid;
?>
</td>
<?php
}
if ($this->show_photos) {
?>
<td>
<a class="med-popup" tabindex="-1" href="?view=persons&personid=<?php
echo $personid;
?>
">
<img style="width: 50px; max-width: 50px" src="?call=photo&personid=<?php
echo (int) $personid;
?>
" />
</a>
</td>
<?php
}
?>
<td>
<?php
echo ents($details['first_name'] . ' ' . $details['last_name']);
?>
</td>
<?php
if (!SizeDetector::isNarrow()) {
?>
<td>
<?php
if ($this->groupid) {
echo ents($details['membership_status']);
} else {
$dummy->printFieldValue('status');
}
?>
</td>
<?php
}
?>
<td class="narrow">
<?php
$this->printWidget($prefix, $personid);
?>
</td>
<?php
if (!SizeDetector::isNarrow()) {
?>
<td class="action-cell narrow">
<a class="med-popup" tabindex="-1" href="?view=persons&personid=<?php
echo $personid;
?>
"><i class="icon-user"></i>View</a>
<a class="med-popup" tabindex="-1" href="?view=_edit_person&personid=<?php
echo $personid;
?>
"><i class="icon-wrench"></i>Edit</a>
<a class="med-popup" tabindex="-1" href="?view=_add_note_to_person&personid=<?php
echo $personid;
?>
"><i class="icon-pencil"></i>Add Note</a>
</td>
<?php
}
?>
</tr>
<?php
$is_first = FALSE;
}
?>
</table>
<?php
return count($this->_persons);
}
示例5: foreach
foreach ($special_fields as $field) {
?>
<td>
<?php
if (isset($callbacks[$field])) {
call_user_func($callbacks[$field], $id, array_get($details, $field, ''));
} else {
echo array_get($details, $field, '');
}
?>
</td>
<?php
}
?>
<td><?php
$dummy_person->printFieldValue('status');
?>
</td>
<td><?php
$dummy_person->printFieldValue('age_bracket');
?>
</td>
<td><?php
$dummy_person->printFieldValue('gender');
?>
</td>
<?php
if (defined('PERSON_LIST_SHOW_GROUPS') && PERSON_LIST_SHOW_GROUPS) {
?>
<td>
<?php
示例6: array
function _printSummaryRows()
{
parent::_printSummaryRows();
include_once 'include/size_detector.class.php';
if (SizeDetector::isNarrow()) {
?>
<tr class="divider-before">
<td colspan="2" id="family-members-container">
<h4> Members:</h4>
<?php
} else {
?>
<tr class="divider-before">
<th>Members</th>
<td id="family-members-container">
<?php
}
$persons = $this->getMemberData();
$show_actions = !empty($this->id);
// hide actions if this is a "draft" family
if (isset($this->_tmp['show_member_callback'])) {
call_user_func($this->_tmp['show_member_callback'], $persons);
} else {
if (empty($this->_tmp['abbreviate_member_list'])) {
?>
<div style="float: left" id="member-details-container">
<?php
// full blown version
$special_fields = array('congregation');
if (!empty($this->_tmp['member_list_special_fields'])) {
$special_fields = $this->_tmp['member_list_special_fields'];
}
include 'templates/person_list.template.php';
?>
</div>
<?php
if ($GLOBALS['system']->featureEnabled('PHOTOS') && $this->id) {
?>
<div style="float: left; " id="family-photos-container">
<?php
foreach ($persons as $personid => $details) {
?>
<a href="?view=persons&personid=<?php
echo (int) $personid;
?>
"><img title="<?php
echo ents($details['first_name'] . ' ' . $details['last_name']);
?>
" src="?call=person_photo&personid=<?php
echo (int) $personid;
?>
" /></a>
<?php
}
?>
</div>
<?php
}
} else {
// abbreviated version
$GLOBALS['system']->includeDBClass('person');
$dummy_person = new Person();
?>
<table>
<?php
foreach ($persons as $id => $person) {
$dummy_person->populate($id, $person);
$tr_class = $person['status'] == 'archived' ? ' class="archived"' : '';
?>
<tr<?php
echo $tr_class;
?>
>
<td class="nowrap"><a href="?view=persons&personid=<?php
echo $id;
?>
"><?php
echo ents($dummy_person->toString());
?>
</a></td>
<td><?php
$dummy_person->printFieldValue('gender');
?>
</td>
<td><?php
$dummy_person->printFieldValue('age_bracket');
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
}
?>
</td>
</tr>
<?php
//.........这里部分代码省略.........
示例7: _printResultsTabular
//.........这里部分代码省略.........
</th>
<?php
$first = FALSE;
}
}
?>
</tr>
<?php
}
?>
</thead>
<tbody>
<?php
foreach ($all_persons as $personid => $details) {
if (!isset($all_attendances[$personid])) {
continue;
}
?>
<tr <?php
if ($details['status'] == 'archived') {
echo 'class="archived"';
}
?>
>
<td class="nowrap">
<?php
echo ents($details['first_name'] . ' ' . $details['last_name']);
?>
</td>
<?php
if (SizeDetector::isWide()) {
?>
<td><?php
$dummy->printFieldValue('status', $details['status']);
?>
</th>
<?php
}
foreach ($all_dates as $date) {
$first = TRUE;
if ($this->format == 'totals') {
$score = '';
foreach ($this->cohortids as $cohortid) {
$catt = array_get($all_attendances[$personid], $cohortid, array());
$x = array_get($catt, $date, '');
if (strlen($x)) {
$score = (int) $score + $x;
}
}
$class = $this->classes[$score > 0 ? 1 : $score];
if ($score === '') {
$score = '?';
}
echo '<td class="center ' . $class . '">' . $score . '</td>';
} else {
foreach ($this->cohortids as $cohortid) {
if (!in_array($cohortid, array_get($all_persons[$personid], 'cohortids', array()))) {
$class = 'disabled';
$letter = '';
} else {
$catt = array_get($all_attendances[$personid], $cohortid, array());
$v = array_get($catt, $date, '');
$letter = $this->letters[$v];
$class = $this->classes[$v];
}
if ($first) {
示例8: printForm
function printForm($prefix = 0)
{
require_once 'include/size_detector.class.php';
$order = defined('ATTENDANCE_LIST_ORDER') ? constant('ATTENDANCE_LIST_ORDER') : self::LIST_ORDER_DEFAULT;
if ($this->congregationid) {
$conds = array('congregationid' => $this->congregationid, '!status' => 'archived');
if (strlen($this->age_bracket)) {
$conds['age_bracket'] = $this->age_bracket;
}
$members = $GLOBALS['system']->getDBObjectData('person', $conds, 'AND', $order);
} else {
$group =& $GLOBALS['system']->getDBObject('person_group', $this->groupid);
$members =& $group->getMembers(FALSE, $order);
if (strlen($this->age_bracket)) {
// Not the most efficient but it's a problem when it's a problem
foreach ($members as $i => $person) {
if ($person['age_bracket'] != $this->age_bracket) {
unset($members[$i]);
}
}
}
}
$GLOBALS['system']->includeDBClass('person');
$dummy = new Person();
?>
<table class="table table-condensed table-auto-width valign-middle">
<?php
$is_first = TRUE;
foreach ($members as $personid => $details) {
$v = isset($this->_attendance_records[$personid]) ? $this->_attendance_records[$personid] ? 'present' : 'absent' : (empty($this->_attendance_records) ? '' : 'unknown');
$dummy->populate($personid, $details);
?>
<tr>
<?php
if (!SizeDetector::isNarrow()) {
?>
<td><?php
echo $personid;
?>
</td>
<?php
}
if ($this->show_photos) {
?>
<td>
<img style="width: 50px; max-width: 50px" src="?call=person_photo&personid=<?php
echo (int) $personid;
?>
" />
</td>
<?php
}
?>
<td><?php
echo ents($details['last_name']);
?>
</td>
<td><?php
echo ents($details['first_name']);
?>
</td>
<?php
if (!SizeDetector::isNarrow()) {
?>
<td>
<?php
if ($this->groupid) {
echo ents($details['membership_status']);
} else {
$dummy->printFieldValue('status');
}
?>
</td>
<?php
}
?>
<td class="narrow">
<?php
print_widget('attendances[' . $prefix . '][' . $personid . ']', array('options' => array('unknown' => '?', 'present' => 'Present', 'absent' => 'Absent'), 'type' => 'select', 'style' => 'colour-buttons', 'class' => $is_first ? 'autofocus' : ''), $v);
?>
</td>
<?php
if (!SizeDetector::isNarrow()) {
?>
<td class="action-cell narrow">
<a class="med-popup" tabindex="-1" href="?view=persons&personid=<?php
echo $personid;
?>
"><i class="icon-user"></i>View</a>
<a class="med-popup" tabindex="-1" href="?view=_edit_person&personid=<?php
echo $personid;
?>
"><i class="icon-wrench"></i>Edit</a>
<a class="med-popup" tabindex="-1" href="?view=_add_note_to_person&personid=<?php
echo $personid;
?>
"><i class="icon-pencil"></i>Add Note</a>
</td>
<?php
}
//.........这里部分代码省略.........