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 '<tr><td width="50%" align="right"><b>Osoba aktualizuj±ca dane:</b></td><td>'; display_link_to_user($org_info['updater_id']); echo "</td></tr>\n"; echo "</table></td></tr>\n"; } echo "</table>\n<br><br><br><br>";
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 }
if (isset($_GET['project_id'])) { echo '<input type="hidden" name="project_id" value="' . $_GET['project_id'] . '">' . "\n"; } $org_info = get_org_info($_GET['org_id']); $defaults = array(); $defaults['name'] = get_org_name($_GET['org_id']); if ($org_info === false) { $defaults['street'] = 'ul. '; $defaults['city'] = '£ód¼'; $defaults['phone'] = '+4842 '; $defaults['fax'] = '+4842 '; $defaults['www'] = 'http://'; $defaults['profile'] = 'Tu wpisz krótko, czym zajmuje siê organizacja'; } else { $org_info['phone'] = parse_phone_number($org_info['phone']); $org_info['fax'] = parse_phone_number($org_info['fax']); $defaults = array_merge($defaults, $org_info); } $fields = array(); if (is_admin()) { $fields['Nazwa'] = array('name', 100, 30); } $fields += array('Ulica, nr' => array('street', 40, 30), 'Miejscowo¶æ' => array('city', 25, 30), 'Telefon' => array('phone', 17, 30), 'Fax' => array('fax', 17, 30), 'Strona WWW' => array('www', 100, 30), 'Profil dzia³alno¶ci' => array('profile', 255, 80)); foreach ($fields as $label => $form) { echo '<tr><td align="right">' . htmlspecialchars($label) . ':</td>'; echo '<td align="left"><input type="text" name="' . htmlspecialchars($form[0]) . '" value="' . htmlspecialchars($defaults[$form[0]]) . '" maxlength="' . $form[1] . '" size="' . $form[2] . '"></td></tr>' . "\n"; } echo "</table>\n</td></tr>"; echo '<tr><td align="center"><input type="submit" value="Gotowe"></td></tr>' . "\n"; echo '</form></table>' . "\n"; display_document_footer();
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 { $content = htmlspecialchars($org_info[$field]); } } echo '<td>' . $content . '</td>'; } } echo "</tr>\n"; if (isset($_POST['comments'])) { echo '<tr><td colspan="' . ($num_info + 1) . '" align="left" valign="top" height="50"><i>Uwagi:<i></td></tr>' . "\n"; } } ?> </table>