예제 #1
0
//$fields is an array of record fields that will be visible in the print-out.
//The array keys are the MySQL labels and the values are arrays of: printed label, checked, disabled
$fields = array('name' => array('Nazwa', 1, 1), 'city' => array('Miejscowo¶æ', 1, 0), 'street' => array('Ulica', 1, 0), 'phone' => array('Telefon', 1, 0), 'fax' => array('Fax', 0, 0), 'www' => array('WWW', 0, 0), 'profile' => array('Profil dzia³alno¶ci', 0, 0), 'date' => array('Data aktualizacji danych', 0, 0), 'updater_id' => array('Osoba aktualizuj±ca dane', 0, 0), 'comments' => array('Miejsce na uwagi', 1, 0));
echo '<form action="print_orgs.php" method="post">' . "\n";
foreach ($fields as $key => $value) {
    echo '<tr><td><input type="checkbox" name="' . $key . '"';
    if (1 === $value[1]) {
        echo ' checked';
    }
    if (1 === $value[2]) {
        echo ' disabled';
    }
    echo '>' . $value[0] . "</td></tr>\n";
}
echo '<tr><td class="naglowek_maly">Wybierz organizacje, które chcesz uwzglêdniæ na wydruku:</td></tr>' . "\n";
$user_orgs = get_user_orgs($_SESSION['valid_user_id']);
if ($user_orgs === false) {
    echo "<tr><td>B³±d bazy danych, spróbuj pó¼niej.</td></tr>\n";
} else {
    if (empty($user_orgs)) {
        echo "<tr><td>Brak organizacji.</td></tr>\n";
    } else {
        foreach ($user_orgs as $org) {
            echo '<tr><td><input type="checkbox" name="orgs[' . $org['organisation_id'] . ']" checked>';
            display_link_to_org($org['organisation_id']);
            echo "</td></tr>\n";
        }
    }
}
echo '<tr><td><input type="submit" value="Zatwierd¼"></td></tr>' . "\n";
echo "</form>\n";
예제 #2
0
파일: show_user.php 프로젝트: exviva/flip
    echo '<tr><td>B³±d bazy danych, spróbuj pó¼niej.</td></tr>';
} else {
    if (empty($oc_projects)) {
        echo "<tr><td>Brak projektów.</td></tr>\n";
    } else {
        $num_oc = 1;
        foreach ($oc_projects as $pid) {
            echo '<tr><td>' . $num_oc . '. ';
            ++$num_oc;
            display_link_to_project($pid);
            echo "</td></tr>\n";
        }
    }
}
echo "</table>\n<br><br><br></td></tr>\n";
$user_orgs = get_user_orgs($_GET['user_id']);
echo '<tr><td><table>' . "\n";
echo '<tr><td class="naglowek_maly">U¿ytkownik jest odpowiedzialny za organizacje:</td></tr>' . "\n";
if ($user_orgs === false) {
    echo '<tr><td>B³±d bazy danych, spróbuj pó¼niej.</td></tr>';
} else {
    if (empty($user_orgs)) {
        echo "<tr><td>Brak organizacji.</td></tr>\n";
    } else {
        echo "<tr><td><table>\n";
        echo "<tr><th></th><th>Organizacja</th><th>Projekt</th></tr>\n";
        $num_org = 1;
        foreach ($user_orgs as $org) {
            echo '<tr><td>' . $num_org . '. </td><td>';
            ++$num_org;
            display_link_to_org($org['organisation_id']);