コード例 #1
0
}
if ($prev_next_links != '') {
    echo "<p align='center'>{$prev_next_links}</p>";
}
// table of search results
echo '<table align="center" border="1"><tr>';
// print headers
// links to allow (asc/desc) sorting
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_author_id) . "'>" . _("ID") . "</a></th>\n";
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_last_name) . "'>" . _("Last name") . "</a></th>\n";
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_other_names) . "'>" . _("Other name(s)") . "</a></th>\n";
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_born) . "'>" . _("Born") . "</a></th>\n";
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_dead) . "'>" . _("Deceased") . "</a></th>\n";
if ($can_edit) {
    echo "<th>" . _("Edit") . "</th>\n";
}
echo "\n";
$count = $browseUtility->getRowCountToList();
$i = 0;
while ($i++ < $count && ($row = @mysql_fetch_array($result))) {
    $id = $row['author_id'];
    echo "<tr><td>{$id}</td><td><a href=\"author.php?author_id={$id}\">" . html_safe($row['last_name']) . "</a></td><td>" . html_safe($row['other_names']) . "</td><td>" . format_date_from_array($row, 'b') . '</td><td>' . format_date_from_array($row, 'd') . '</td>' . ($can_edit ? "<td><a href='add.php?author_id={$id}'>" . _('Edit') . '</a></td>' : '') . "</tr>\n";
}
echo '</table>';
if ($prev_next_links != '') {
    echo "<p align='center'>{$prev_next_links}</p>";
}
echo '<br />';
$browseUtility->echoCountSelectionList();
echo_menu();
// vim: sw=4 ts=4 expandtab
コード例 #2
0
ファイル: manage.php プロジェクト: cpeel/dproofreaders-shadow
$count = $browseUtility->getRowCountToList();
$i = 0;
while ($i++ < $count && ($author = @mysql_fetch_array($result))) {
    echo "<tr><td colspan='13'></td></tr>\n";
    $id = $author['author_id'];
    $bioresult = mysql_query("SELECT bio_id FROM biographies WHERE author_id = {$id} ORDER BY bio_id;");
    $bio_count = mysql_numrows($bioresult);
    if ($bio_count > 0) {
        $javascript_to_disable_delete_authors .= "document.adminform.delete_author_{$id}.disabled = true;\n";
    }
    $enabled = $author['enabled'];
    // csl with the bio-ids
    $bios_for_this_author = '';
    echo "<input type='hidden' name='old_enabled_author_{$id}' value='{$enabled}' />\n";
    echo "<tr><td rowspan='{$bio_count}'><input type='checkbox' name='new_enabled_author_{$id}' value='yes'" . ($enabled == 'yes' ? ' checked' : '') . " /></td>\n    " . "<td rowspan='{$bio_count}'><input type='checkbox' name='delete_author_{$id}' value='yes' onClick='deleteAuthor(this, {$id});' /></td>\n";
    echo "<td rowspan='{$bio_count}'><input type='radio' name='move_to_author' value='{$id}' onClick='moveToHere(this, {$id});' /></td>\n    " . "<td rowspan='{$bio_count}'>{$id}</td>\n    <td rowspan='{$bio_count}'><a href=\"author.php?author_id={$id}\">" . $author['last_name'] . "</a></td>\n    <td rowspan='{$bio_count}'>" . $author['other_names'] . "</td>\n    <td rowspan='{$bio_count}'>" . format_date_from_array($author, 'b') . "</td>\n    <td rowspan='{$bio_count}'>" . format_date_from_array($author, 'd') . "</td>\n    " . "<td rowspan='{$bio_count}'><a href=\"add.php?author_id={$id}&mode=manage\">" . _('Edit') . "</a></td>\n    " . "<td rowspan='{$bio_count}'></td>\n    ";
    for ($j = 0; $j < $bio_count; $j++) {
        $bio_id = mysql_result($bioresult, $j);
        if ($j != 0) {
            echo "<tr>";
        }
        write_bio_links($id, $bio_id);
    }
    $javascript_to_build_bios_array .= "bios[{$id}] = new Array({$bios_for_this_author});\n";
}
echo "<SCRIPT LANGUAGE='JavaScript'><!--\n{$javascript_to_build_bios_array}\n";
echo "{$javascript_to_disable_delete_authors}\n--></SCRIPT>";
function write_bio_links($author_id, $bio_id)
{
    global $bios_for_this_author;
    echo "<td><a href=\"bio.php?bio_id={$bio_id}\">" . _('Biography') . " {$bio_id}</a></td>\n    " . "<td><input type='checkbox' name='move_bio_{$bio_id}' value='yes' onClick='moveBio(this, {$author_id}, {$bio_id});' /></td>\n    " . "<td><input type='checkbox' name='delete_bio_{$bio_id}' value='yes' onClick='deleteBio(this, {$author_id}, {$bio_id});' /></td>\n</tr>\n";