Exemplo n.º 1
0
include_once 'authors.inc';
include_once 'menu.inc';
require_login();
// argument provided?
if (isset($_GET['author_id'])) {
    $id = $_GET['author_id'];
} else {
    output_header(_('No author-id specified'));
    echo _('There was an error: No author-id was specified.') . ' ';
    echo _('If you believe this to be the result of perfectly legitimate actions taken by you, please ');
    echo '<a href="whatever">' . _('report it to us') . "</a>.\n";
    echo _('You may return to <a href="listing.php">the authors-listing</a>.');
    exit;
}
$result = mysql_query("SELECT * FROM authors WHERE author_id={$id};");
$last_name = mysql_result($result, 0, "last_name");
$other_names = mysql_result($result, 0, "other_names");
$birth = format_date_from_sqlset($result, 0, 'b');
$decease = format_date_from_sqlset($result, 0, 'd');
// Start outputting
output_header(_('Author') . ': ' . $last_name . ($other_names != '' ? ", {$other_names}" : ''));
echo_menu();
echo '<h1 align="center">' . _('Author') . '</h1>';
echo_author($last_name, $other_names, $birth, $decease, $id);
if (user_is_authors_db_manager()) {
    ?>
<BR/>
<?php 
}
echo_menu();
// vim: sw=4 ts=4 expandtab
Exemplo n.º 2
0
        return false;
}
return true;
}

function setComments(bd, comments) {
eval("document.addform."+bd+"comments.value=comments;");
}
// -->
</script>
<?php 
$message = @$_GET['message'];
if (isset($message)) {
    echo '<center>' . html_safe($message) . '</center><br />';
} elseif (isset($_POST['Preview'])) {
    echo_author($last_name, $other_names, format_date($byear, $bmonth, $bday, $bcomments), format_date($dyear, $dmonth, $dday, $dcomments), isset($_POST['author_id']) ? $_POST['author_id'] : FALSE);
    echo '<br/>';
    if (isset($_POST['author_id'])) {
        $author_id = $_POST['author_id'];
    }
}
?>
<form name="addform" action="add.php" method="POST" onSubmit="return validate();">
<?php 
if (isset($author_id)) {
    echo "<input type='hidden' name='author_id' value='{$author_id}'>\n";
}
function _var($bd, $name)
{
    $var = $bd . $name;
    global ${$var};