Пример #1
0
<?php 
if ($P) {
    // the logged-in version:
    if (get_http_var('Add')) {
        // create a new alert
        $journo_ref = get_http_var('j');
        DoAddAlert($P, $journo_ref);
    } else {
        if (get_http_var('Remove')) {
            // remove an alert
            $journo_ref = get_http_var('j');
            DoRemoveAlert($P, $journo_ref);
        }
    }
    alert_emit_list($P->id);
    EmitLookupForm();
} else {
    // the non logged-in version:
    ?>
    <p>If you already have an account, just <a href="/alert?dologin=yes">log in here</a></p>
    <p>Otherwise, <a href="/login?action=register">register here</a></p>
<?php 
    //loginform_emit();
}
?>
</div>
<div class="foot"></div>
</div>  <!-- end main -->
<div class="sidebar">
<?php 
if ($P) {
Пример #2
0
function LookupJourno($art, $lookup)
{
    EmitLookupForm($art, $lookup);
    $journos = db_getAll("SELECT * FROM journo WHERE prettyname ilike ? ORDER BY lastname", '%' . $lookup . '%');
    if (count($journos) > 0) {
        print "<ul>";
        foreach ($journos as $j) {
            print "<li>";
            EmitAddJournoForm($art, $j);
            print "</li>\n";
        }
        print "</ul>\n";
    } else {
        print "<p>No matches</p>\n";
    }
}