Ejemplo n.º 1
0
                 display_link_to_org($detail['organisation_id']);
                 echo '</td><td align="center" nowrap>';
                 display_link_to_project($detail['project_id']);
                 echo '</td><td align="center" nowrap>';
                 display_link_to_contact($detail['contact_id']);
                 echo "</td></tr>\n";
             }
             echo "</table></td></tr>\n";
         }
     }
     echo '</table></td></tr>';
 } else {
     if ($_GET['group'] == 'projects') {
         $projects_overdue_contacts = array();
         foreach ($overdue_contacts as $cid) {
             $details = get_contact_details($cid);
             $projects_overdue_contacts[$details['project_id']][] = array('contact_id' => $cid) + $details;
         }
         echo '<tr><td><table align="center" cellpadding="2" cellspacing="0">' . '<tr><th></th> <th>Projekt</th><th>Zaleg³ych kontaktów</th></tr>';
         $num_projects = 1;
         foreach ($projects_overdue_contacts as $project_id => $details) {
             $show_project = $_GET['show'] == $project_id;
             echo '<tr><td align="center">' . $num_projects . '</td><td align="center">';
             $num_projects++;
             display_link_to_project($project_id);
             echo '</td><td align="center">' . count($details) . ' [';
             if ($show_project) {
                 echo '<a href="?group=projects" class="menu">Ukryj</a>';
             } else {
                 echo '<a href="?group=projects&show=' . $project_id . '" class="menu">Poka¿</a>';
             }
Ejemplo n.º 2
0
    $data['contact_person'] = $last_contact['contact_person'];
    $data['contact_function'] = $last_contact['contact_function'];
    // the default content of comments for meeting and phone call
    $data['comments'] = $_GET['type'] == 'spotkanie' ? "PRZEBIEG: \n\nATMOSFERA: \n\nREZULTAT: " : '';
    $data['aim'] = $last_contact['aim'];
    $data['nc_type'] = 'spotkanie';
    // next contact date (to days after today)
    $nc_date = getdate(strtotime('+2 days'));
    $data['nc_year'] = $nc_date['year'];
    $data['nc_month'] = $nc_date['mon'];
    $data['nc_day'] = $nc_date['mday'];
} else {
    // "edit a contact" mode
    $edit = true;
    // set flag
    $data = get_contact_details($_GET['cid']);
    if (empty($data)) {
        display_warning('Brak kontaktu.');
        exit;
    }
    if ($_SESSION['valid_user_id'] != $data['user_id'] && !is_admin()) {
        display_warning('Nie jeste¶ uprawniony do edycji tego kontaktu!');
        exit;
    }
    $data['contact_id'] = $_GET['cid'];
    list($data['year'], $data['month'], $data['day']) = explode('-', $data['date']);
    unset($data['date']);
    $data['nc_type'] = empty($data['next_contact_type']) ? 'brak' : $data['next_contact_type'];
    list($data['nc_year'], $data['nc_month'], $data['nc_day']) = empty($data['next_contact_date']) ? array(0, 0, 0) : explode('-', $data['next_contact_date']);
    unset($data['next_contact_type']);
    unset($data['next_contact_date']);
Ejemplo n.º 3
0
function display_contact_history()
{
    $contacts = get_contacts('user_id', $_SESSION['valid_user_id']);
    if ($contacts === false) {
        echo 'B³±d bazy danych, spróbuj pó¼niej.';
    } else {
        if (empty($contacts)) {
            echo 'Brak kontaktów.';
        } else {
            echo '<table><tr><th></th><th>Data, typ</th><th>Organizacja</th><th>Projekt</th></tr>';
            $num_contact = 1;
            foreach ($contacts as $cid) {
                echo '<tr><td>' . $num_contact . '. </td><td>';
                ++$num_contact;
                display_link_to_contact($cid);
                $details = get_contact_details($cid);
                echo '</td><td>';
                display_link_to_org($details['organisation_id']);
                echo '</td><td nowrap>';
                display_link_to_project($details['project_id']);
                echo '</td></tr>';
            }
            echo '</table>';
        }
    }
}
Ejemplo n.º 4
0
function display_link_to_contact($cid, $label = '', $with_img = true, $pre = '', $post = '', $with_title = true)
{
    $det = get_contact_details($cid);
    $img = get_www_root() . 'img/icon_' . ($det['type'] == 'telefon' ? 'phone' : 'meeting') . '.gif';
    if ($label === '') {
        $label = $det['date'];
    }
    echo '<table><tr><td nowrap valign="center">' . $pre . '<a href="' . get_www_root() . 'show/show_contact.php?cid=' . $cid . '" class="menu"';
    if ($with_title) {
        echo ' title="' . htmlspecialchars($det['comments']) . '"';
    }
    echo '>' . $label . '</a>' . $post . '</td><td>';
    if ($with_img) {
        echo '<img src="' . $img . '" width="22" height="17" alt="' . $det['type'] . '" border="0">';
    }
    echo '</td></tr></table>';
}