function display_link_to_org($org_id, $add = false, $project_id = false) { $class = 'org_otwarta'; $href = get_www_root() . 'show/show_org.php?org_id=' . $org_id; $org_info = get_org_info($org_id); $title = 'Adres: ' . (empty($org_info['street']) || empty($org_info['city']) ? '-' : htmlspecialchars($org_info['city'] . ', ' . $org_info['street'])) . "\nTelefon: " . htmlspecialchars(parse_phone_number($org_info['phone'])) . "\nOsoba kontaktowana: " . htmlspecialchars(get_contact_person($org_id)); if ($add) { if (empty_org($org_id)) { $class = 'org_nowa'; $href = get_www_root() . 'add/add_org_info_form.php?org_id=' . $org_id . '&project_id=' . $project_id; $title = 'Uzupe³nij dane o organizacji'; } elseif (!org_is_contacted($org_id, $_SESSION['valid_user_id'], $project_id)) { $class = 'org_nowa'; } } ?> <a href="<?php echo $href; ?> " class="<?php echo $class; ?> " title="<?php echo $title; ?> "><?php echo htmlspecialchars(stripslashes(get_org_name($org_id))); ?> </a><?php }
session_start(); check_valid_user(); if (!isset($_GET['org_id'])) { display_warning('Wybierz organizacjê!'); exit; } display_html_header(); display_document_header(); display_menu(); echo '<table width="90%">' . "\n"; echo '<tr><td align="center" class="naglowek">Dane organizacji <i>' . htmlspecialchars(stripslashes(get_org_name($_GET['org_id']))) . '</i>'; if (is_responsible($_SESSION['valid_user_id'], $_GET['org_id']) || is_admin()) { echo ' [<a href="../add/add_org_info_form.php?org_id=' . $_GET['org_id'] . '" class="menu">Edytuj</a>]'; } echo "<hr></td></tr>\n"; $org_info = get_org_info($_GET['org_id']); echo '<tr><td>'; if (!$org_info) { echo 'Brak danych o organizacji.</td></tr>'; } else { echo '<table align="center">'; $content = array('Adres' => htmlspecialchars($org_info['city'] . ', ' . $org_info['street']), 'Telefon' => htmlspecialchars(parse_phone_number($org_info['phone'])), 'Fax' => htmlspecialchars(parse_phone_number($org_info['fax'])), 'WWW' => strpos($org_info['www'], '.') === false ? '-' : '<a href="' . htmlspecialchars($org_info['www']) . '" target="_blank" class="menu">' . htmlspecialchars($org_info['www']) . '</a>', 'Profil dzia³alno¶ci' => htmlspecialchars($org_info['profile']), 'Data ostatniej aktualizacji' => $org_info['date']); $contact_person = get_contact_person($_GET['org_id']); if ($contact_person !== false && !empty($contact_person)) { $content['Osoba kontaktowa'] = htmlspecialchars($contact_person); } foreach ($content as $label => $value) { echo '<tr><td width="50%" align="right"><b>' . $label . ':</b></td><td width="50%" align="left">'; echo $value; echo "</td></tr>\n"; }
echo 'FLIP - wydruk organizacji u¿ytkownika ' . htmlspecialchars(get_user_login($_SESSION['valid_user_id'])) . ' wygenerowany dnia ' . date('Y-m-d') . "<br><br>\n"; $fields = array('name' => 'Nazwa', 'city' => 'Miejscowo¶æ', 'street' => 'Ulica', 'phone' => 'Telefon', 'fax' => 'Fax', 'www' => 'WWW', 'profile' => 'Profil dzia³alno¶ci', 'date' => 'Data aktualizacji danych', 'updater_id' => 'Osoba aktualizuj±ca dane'); echo '<table border="1" cellspacing="0" cellpadding="2"><tr><th>Nazwa</th>'; $num_info = 0; $info_fields = array(); foreach (array_keys($_POST) as $key) { if ('orgs' !== $key && 'comments' !== $key) { echo '<th>' . $fields[$key] . '</th>'; ++$num_info; $info_fields[] = $key; } } echo "</tr>\n"; foreach (array_keys($_POST['orgs']) as $org_id) { echo '<tr><td>' . htmlspecialchars(get_org_name($org_id)) . '</td>'; $org_info = get_org_info($org_id); if (false === $org_info) { for ($i = 0; $i < $num_info; ++$i) { echo '<td>-</td>'; } } else { reset($info_fields); for ($i = 0; $i < $num_info; ++$i) { $field = each($info_fields); $field = $field[1]; if ($field == 'updater_id') { $content = htmlspecialchars(get_user_login($org_info[$field])); } else { if ($field == 'phone' || $field == 'fax') { $content = parse_phone_number($org_info[$field]); } else {