Пример #1
0
function get_Meeting_report($SponsID)
{
    require 'DBconnect.php';
    //this is needed in every function that uses mySQL
    $rep_name = get_person_name($SponsID);
    $rep_calls = 0;
    $rep_emails = 0;
    $rep_Meetings = 0;
    $rep_Meeting_query = "SELECT * FROM Meeting WHERE SponsID = {$SponsID}";
    $result = mysql_query($rep_Meeting_query);
    if (mysql_num_rows($result) > 0) {
        while ($row = mysql_fetch_assoc($result)) {
            switch ($row["MeetingType"]) {
                case "Call":
                    $rep_calls++;
                    break;
                case "Email":
                    $rep_emails++;
                    break;
                case "Meet":
                    $rep_Meetings++;
                    break;
            }
        }
    }
    return array($rep_name, $rep_calls, $rep_Meetings, $rep_emails);
}
Пример #2
0
 echo "<th class='heading'>" . _Th('case_input_author') . '&nbsp;' . '<a title="' . _T('fu_button_stats_' . ($show_more_times ? 'less' : 'more')) . '" href="' . $link_details->getUrl() . '">' . '<img src="images/spip/' . ($show_more_times ? 'moins' : 'plus') . '.gif" alt="" border="0" />' . '</a>' . "</th>\n";
 echo "<th class='heading' width='120' nowrap='nowrap' align='right'>" . _Th('time_input_length') . ' (' . _T('time_info_short_hour') . ")</th>\n";
 $total_time = 0;
 $total_sum_billed = 0.0;
 $meta_sum_billed = read_meta('fu_sum_billed');
 if ($meta_sum_billed == 'yes') {
     $currency = read_meta('currency');
     echo "<th class='heading' width='120' nowrap='nowrap' align='right'>" . _Th('fu_input_sum_billed') . ' (' . $currency . ")</th>\n";
 }
 echo "</tr>\n";
 // Show table contents & calculate total
 while ($row = lcm_fetch_array($result)) {
     $total_time += $row['time'];
     $total_sum_billed += $row['sumbilled'];
     echo "<tr><td>";
     echo get_person_name($row);
     echo '</td><td align="right" valign="top">';
     echo format_time_interval_prefs($row['time']);
     echo "</td>\n";
     if ($meta_sum_billed == 'yes') {
         echo '<td align="right" valign="top">';
         echo format_money($row['sumbilled']);
         echo "</td>\n";
     }
     if ($show_more_times) {
         $fu_types = get_keywords_in_group_name('followups', false);
         $html = "";
         foreach ($fu_types as $f) {
             $q2 = "SELECT type,\n\t\t\t\t\t\t\t\t\tsum(IF(UNIX_TIMESTAMP(fu.date_end) > 0,\n\t\t\t\t\t\t\t\t\t\tUNIX_TIMESTAMP(fu.date_end)-UNIX_TIMESTAMP(fu.date_start), 0)) as time,\n\t\t\t\t\t\t\t\t\tsum(sumbilled) as sumbilled\n\t\t\t\t\t\t\t\tFROM  lcm_followup as fu\n\t\t\t\t\t\t\t\tWHERE fu.id_case = {$case}\n\t\t\t\t\t\t\t\t  AND fu.id_author = " . $row['id_author'] . "\n\t\t\t\t\t\t\t\t  AND fu.hidden = 'N'\n\t\t\t\t\t\t\t\t  AND fu.type = '" . $f['name'] . "'\n\t\t\t\t\t\t\t\tGROUP BY fu.type";
             $r2 = lcm_query($q2);
             // FIXME: css for "ul/li" is a bit weird, but without specifying the height,
Пример #3
0
function sql_calendrier_interval_rv($avant, $apres)
{
    /*
    	// Debug info
    	echo "<!-- sql_calendrier_interval_rv($avant, $apres)";
    */
    global $connect_id_auteur;
    $evenements = array();
    if (!$connect_id_auteur) {
        return $evenements;
    }
    /* [ML] 2007-01-16: "group by a.id_app" was commented out because in
    		theory there should not be multiple identical rows for (id_app, id_author)
    		but who knows, there are mysterious bugs sometimes.. 
    		NOTE: if someone adds the 'group by', dont forget to group by on all 'select'
    		fields, otherwise postgresql panics. */
    $q = "SELECT a.*\n\t\t\t\tFROM lcm_app as a, lcm_author_app as ap\n\t\t\t\tWHERE (ap.id_author = " . $GLOBALS['author_session']['id_author'] . "\n\t\t\t\tAND a.id_app = ap.id_app\n\t\t\t\tAND a.hidden != 'Y'\n\t\t\t\tAND ((a.end_time >= {$avant} OR a.start_time >= {$avant}) AND a.start_time <= {$apres}))\n\t" . "\n\t\t\t\tORDER BY a.start_time";
    $result = lcm_query($q);
    while ($row = lcm_fetch_array($result)) {
        $date_heure = $row["start_time"];
        $date_fin = $row["end_time"];
        $type = $row["type"];
        $id_message = $row['id_app'];
        $cat = 9;
        $auteurs = array();
        $result_aut = lcm_query("SELECT au.name_first, au.name_last\n\t\t\t\t\tFROM\tlcm_author as au, lcm_author_app as ap\n\t\t\t\t\tWHERE\t(ap.id_app = {$id_message}\n\t\t\t\t\tAND\tau.id_author != " . $GLOBALS['author_session']['id_author'] . "\n\t\t\t\t\tAND\tap.id_author = au.id_author)");
        while ($row_auteur = lcm_fetch_array($result_aut)) {
            $auteurs[] = get_person_name($row_auteur);
        }
        $jour_avant = substr($avant, 9, 2);
        $mois_avant = substr($avant, 6, 2);
        $annee_avant = substr($avant, 1, 4);
        $jour_apres = substr($apres, 9, 2);
        $mois_apres = substr($apres, 6, 2);
        $annee_apres = substr($apres, 1, 4);
        $ical_apres = sql_calendrier_jour_ical("{$annee_apres}-{$mois_apres}-" . sprintf("%02d", $jour_apres));
        // Calcul pour les semaines a cheval sur deux mois
        $j = 0;
        $amj = sql_calendrier_jour_ical("{$annee_avant}-{$mois_avant}-" . sprintf("%02d", $j + $jour_avant));
        while ($amj <= $ical_apres) {
            if (!($amj == sql_calendrier_jour_ical($date_fin) and preg_match("/00:00:00/", $date_fin))) {
                // Ne pas prendre la fin a minuit sur jour precedent
                $evenements[$amj][$id_message] = array('URL' => "app_det.php?app={$id_message}", 'DTSTART' => date_ical($date_heure), 'DTEND' => date_ical($date_fin), 'DESCRIPTION' => $row['description'], 'SUMMARY' => $row['title'], 'CATEGORIES' => $cat, 'ATTENDEE' => count($auteurs) == 0 ? '' : join($auteurs, ", "));
            }
            $j++;
            $ladate = date("Y-m-d", mktime(1, 1, 1, $mois_avant, $j + $jour_avant, $annee_avant));
            $amj = sql_calendrier_jour_ical($ladate);
        }
    }
    /*
      // Debug info
      echo " = ";
      var_dump($evenements);
      echo " -->\n";
    */
    return $evenements;
}
Пример #4
0
function show_report_filters($id_report, $is_runtime = false)
{
    // Get general report info
    $q = "SELECT * FROM lcm_report WHERE id_report = " . intval($id_report);
    $res = lcm_query($q);
    $rep_info = lcm_fetch_array($res);
    if (!$rep_info) {
        lcm_panic("Report does not exist: {$id_report}");
    }
    // List filters attached to this report
    $query = "SELECT *\n\t\tFROM lcm_rep_filter as v, lcm_fields as f\n\t\tWHERE id_report = " . $id_report . "\n\t\tAND f.id_field = v.id_field";
    // If generating the report (as opposed to editing), show filters
    // who have a filter type (eq, neq, in, ..), but no value.
    if ($is_runtime) {
        $query .= " AND v.type != '' AND v.value = '' ";
    }
    $result = lcm_query($query);
    if (lcm_num_rows($result)) {
        if ($is_runtime) {
            // submit all at once (else submit on a per-filter basis)
            echo '<form action="run_rep.php" name="frm_filters" method="get">' . "\n";
            echo '<input name="rep" value="' . $id_report . '" type="hidden" />' . "\n";
            if (isset($_REQUEST['export'])) {
                echo '<input name="export" value="' . $_REQUEST['export'] . '" type="hidden" />' . "\n";
            }
        }
        echo "<table border='0' class='tbl_usr_dtl' width='99%'>\n";
        while ($filter = lcm_fetch_array($result)) {
            if (!$is_runtime) {
                echo "<form action='upd_rep_field.php' name='frm_line_additem' method='get'>\n";
                echo "<input name='update' value='filter' type='hidden' />\n";
                echo "<input name='rep' value='{$id_report}' type='hidden' />\n";
                echo "<input name='id_filter' value='" . $filter['id_filter'] . "' type='hidden' />\n";
            }
            echo "<tr>\n";
            echo "<td>" . _Th($filter['description']) . "</td>\n";
            // Type of filter
            echo "<td>";
            $all_filters = array('number' => array('none', 'num_eq', 'num_neq', 'num_lt', 'num_le', 'num_gt', 'num_ge'), 'date' => array('none', 'date_eq', 'date_in', 'date_lt', 'date_le', 'date_gt', 'date_ge'), 'text' => array('none', 'text_eq', 'text_neq'));
            if ($all_filters[$filter['filter']]) {
                // At runtime, if a filter has been selected, do not allow select
                if ($filter['type'] && $is_runtime) {
                    echo _T('rep_filter_' . $filter['type']);
                } else {
                    echo "<select name='filter_type'>\n";
                    echo "<option value=''>...</option>\n";
                    foreach ($all_filters[$filter['filter']] as $f) {
                        $sel = $filter['type'] == $f ? ' selected="selected"' : '';
                        echo "<option value='" . $f . "'" . $sel . ">" . _T('rep_filter_' . $f) . "</option>\n";
                    }
                    echo "</select>\n";
                }
            } else {
                // XXX Should happen only if a filter was removed in a future version, e.g. rarely
                // or between development releases.
                echo "Unknown filter";
            }
            echo "</td>\n";
            // Value for filter
            echo "<td>";
            switch ($filter['type']) {
                case 'num_eq':
                case 'num_neq':
                    if ($filter['field_name'] == 'id_author') {
                        $name = $is_runtime ? "filter_val" . $filter['id_filter'] : 'filter_value';
                        // XXX make this a function
                        $q = "SELECT * FROM lcm_author WHERE status IN ('admin', 'normal', 'external')";
                        $result_author = lcm_query($q);
                        echo "<select name='{$name}'>\n";
                        echo "<option value=''>...</option>\n";
                        // TRAD
                        while ($author = lcm_fetch_array($result_author)) {
                            // Check for already submitted value
                            $sel = $filter['value'] == $author['id_author'] || $_REQUEST['filter_val' . $filter['id_filter']] == $author['id_author'] ? ' selected="selected"' : '';
                            echo "<option value='" . $author['id_author'] . "'" . $sel . ">" . $author['id_author'] . " : " . get_person_name($author) . "</option>\n";
                        }
                        echo "</select>\n";
                        break;
                    }
                case 'num_lt':
                case 'num_gt':
                    $name = $is_runtime ? "filter_val" . $filter['id_filter'] : 'filter_value';
                    echo '<input style="width: 99%;" type="text" name="' . $name . '" value="' . $filter['value'] . '" />';
                    break;
                case 'date_eq':
                case 'date_lt':
                case 'date_le':
                case 'date_gt':
                case 'date_ge':
                    $name = $is_runtime ? "filter_val" . $filter['id_filter'] : 'date';
                    echo get_date_inputs($name, $filter['value']);
                    // FIXME
                    break;
                case 'date_in':
                    // date_in has two values, stored ex: 2005-01-01 00:00:00;2006-02-02 00:00:00
                    $name = $is_runtime ? "filter_val" . $filter['id_filter'] : 'date';
                    $values = split(";", $filter['value']);
                    echo get_date_inputs($name . '_start', $values[0]);
                    echo "<br />\n";
                    echo get_date_inputs($name . '_end', $values[1]);
                    break;
                case 'text_eq':
                case 'text_neq':
                    $name = $is_runtime ? "filter_val" . $filter['id_filter'] : 'filter_value';
                    if ($filter['enum_type']) {
                        $enum = explode(":", $filter['enum_type']);
                        if ($enum[0] == 'keyword') {
                            if ($enum[1] == 'system_kwg') {
                                $all_kw = get_keywords_in_group_name($enum[2]);
                                echo '<select name="' . $name . '">' . "\n";
                                echo '<option value="">' . "..." . "</option>\n";
                                // TRAD
                                foreach ($all_kw as $kw) {
                                    $sel = $filter['value'] == $kw['name'] || $_REQUEST['filter_val' . $filter['id_filter']] == $kw['name'] ? ' selected="selected" ' : '';
                                    echo '<option value="' . $kw['name'] . '"' . $sel . '>' . _Tkw($enum[2], $kw['name']) . "</option>\n";
                                }
                                echo "</select>\n";
                            }
                        } elseif ($enum[0] == 'list') {
                            $items = split(",", $enum[1]);
                            echo '<select name="' . $name . '">' . "\n";
                            echo '<option value="">' . "..." . "</option>\n";
                            // TRAD
                            foreach ($items as $i) {
                                $tmp = $i;
                                if ($enum[2]) {
                                    $tmp = _T($enum[2] . $tmp);
                                }
                                $sel = $filter['value'] == $i || $_REQUEST['filter_val' . $filter['id_filter']] == $i ? ' selected="selected" ' : '';
                                echo '<option value="' . $i . '"' . $sel . '>' . $tmp . "</option>\n";
                            }
                            echo "</select>\n";
                        }
                    } else {
                        echo '<input style="width: 99%;" type="text" name="' . $name . '" value="' . $filter['value'] . '" />';
                    }
                    break;
                default:
                    echo "<!-- no type -->\n";
            }
            echo "</td>\n";
            if (!$is_runtime) {
                // Button to validate
                echo "<td>";
                echo "<button class='simple_form_btn' name='validate_filter_addfield'>" . _T('button_validate') . "</button>\n";
                echo "</td>\n";
                // Link for "Remove"
                echo "<td><a class='content_link' href='upd_rep_field.php?rep=" . $id_report . "&amp;" . "remove=filter" . "&amp;" . "id_filter=" . $filter['id_filter'] . "'>" . "X" . "</a></td>\n";
            }
            echo "</tr>\n";
            if (!$is_runtime) {
                echo "</form>\n";
            }
        }
        echo "</table>\n";
    }
    if ($is_runtime) {
        echo "<p><button class='simple_form_btn' name='validate_filter_addfield'>" . _T('button_validate') . "</button></p>\n";
        echo "</form>\n";
        return;
    }
    // List all available fields in selected tables for report
    $query = "SELECT *\n\t\tFROM lcm_fields\n\t\tWHERE ";
    $sources = array();
    if ($rep_info['line_src_name']) {
        array_push($sources, "'lcm_" . $rep_info['line_src_name'] . "'");
    }
    // Fetch all tables available as rep colums
    // (this is not like rep line, because the source is not always in
    // lcm_report, but this should be 'fixed')
    $q_tmp = "SELECT DISTINCT table_name \n\t\t\t\tFROM lcm_rep_col as rp, lcm_fields as f\n\t\t\t\tWHERE rp.id_field = f.id_field\n\t\t\t\t  AND rp.id_report = " . $id_report;
    $result_tmp = lcm_query($q_tmp);
    while ($row = lcm_fetch_array($result_tmp)) {
        array_push($sources, "'" . $row['table_name'] . "'");
    }
    // Fetch all keyword sources
    if ($rep_info['col_src_type'] == 'keyword' && $rep_info['col_src_name']) {
        $kwg = get_kwg_from_name($rep_info['col_src_name']);
        if ($kwg['type'] == 'system') {
            switch ($kwg['name']) {
            }
        } else {
            if ($kwg['type'] == 'client_org') {
                array_push($sources, "'lcm_client'");
                array_push($sources, "'lcm_org'");
            } else {
                array_push($sources, "'lcm_" . $kwg['type'] . "'");
            }
        }
    }
    // If lcm_case in there, also add lcm_stage
    $tmp = '';
    foreach ($sources as $s) {
        if ($s == "'lcm_case'") {
            $tmp = "lcm_stage";
        }
    }
    if ($tmp) {
        array_push($sources, "'lcm_stage'");
    }
    // List only filters if table were selected as sources (line/col)
    if (count($sources)) {
        $query .= " table_name IN ( " . implode(" , ", $sources) . " ) AND ";
        $query .= " filter != 'none'";
        $query .= " ORDER BY table_name ";
        echo "<!-- QUERY: {$query} -->\n";
        $result = lcm_query($query);
        if (lcm_num_rows($result)) {
            echo "<form action='upd_rep_field.php' name='frm_line_additem' method='get'>\n";
            echo "<input name='rep' value='" . $rep_info['id_report'] . "' type='hidden' />\n";
            echo "<input name='add' value='filter' type='hidden' />\n";
            echo "<p class='normal_text'>" . _Ti('rep_input_filter_add');
            echo "<select name='id_field'>\n";
            echo "<option value=''>...</option>\n";
            while ($row = lcm_fetch_array($result)) {
                echo "<option value='" . $row['id_field'] . "'>" . _Ti('rep_info_table_' . $row['table_name']) . _Th($row['description']) . "</option>\n";
            }
            echo "</select>\n";
            echo "<button class='simple_form_btn' name='validate_filter_addfield'>" . _T('button_validate') . "</button>\n";
            echo "</p>\n";
            echo "</form>\n";
        }
    } else {
        echo '<p class="normal_text">' . _T('rep_info_select_source_first') . "</p>\n";
    }
}
Пример #5
0
/**
 * print ASSO RELA information
 *
 * Ex1:
 * <code>1 ASSO @I1@
 * 2 RELA Twin</code>
 *
 * Ex2:
 * <code>1 CHR
 * 2 ASSO @I1@
 * 3 RELA Godfather
 * 2 ASSO @I2@
 * 3 RELA Godmother</code>
 *
 * @param string $pid		person or family ID
 * @param string $factrec	the raw gedcom record to print
 * @param string $linebr 	optional linebreak
 */
function print_asso_rela_record($pid, $factrec, $linebr = false)
{
    global $GEDCOM, $SHOW_ID_NUMBERS, $TEXT_DIRECTION, $pgv_lang, $factarray, $PGV_IMAGE_DIR, $PGV_IMAGES, $view;
    // get ASSOciate(s) ID(s)
    $ct = preg_match_all("/\\d ASSO @(.*)@/", $factrec, $match, PREG_SET_ORDER);
    for ($i = 0; $i < $ct; $i++) {
        $level = substr($match[$i][0], 0, 1);
        $pid2 = $match[$i][1];
        // get RELAtionship field
        $assorec = get_sub_record($level, "{$level} ASSO ", $factrec, $i + 1);
        //		if (substr($_SERVER["SCRIPT_NAME"],1) == "pedigree.php") {
        $rct = preg_match("/\\d RELA (.*)/", $assorec, $rmatch);
        if ($rct > 0) {
            // RELAtionship name in user language
            $key = strtolower(trim($rmatch[1]));
            $cr = preg_match_all("/sosa_(.*)/", $key, $relamatch, PREG_SET_ORDER);
            if ($cr > 0) {
                $rela = get_sosa_name($relamatch[0][1]);
            } else {
                if (isset($pgv_lang["{$key}"])) {
                    $rela = $pgv_lang[$key];
                } else {
                    $rela = $rmatch[1];
                }
            }
            $p = strpos($rela, "(=");
            if ($p > 0) {
                $rela = trim(substr($rela, 0, $p));
            }
            if ($pid2 == $pid) {
                print "<span class=\"details_label\">";
            }
            print $rela . ": ";
            if ($pid2 == $pid) {
                print "</span>";
            }
        } else {
            $rela = $factarray["RELA"];
        }
        // default
        //		}
        // ASSOciate ID link
        $gedrec = find_gedcom_record($pid2);
        if (strstr($gedrec, "@ INDI") !== false or strstr($gedrec, "@ SUBM") !== false) {
            // ID name
            if (DisplayDetailsByID($pid2) || showLivingNameByID($pid2)) {
                $name = get_person_name($pid2);
                $addname = get_add_person_name($pid2);
            } else {
                $name = $pgv_lang["private"];
                $addname = "";
            }
            print "<a href=\"individual.php?pid={$pid2}&amp;ged={$GEDCOM}\">" . PrintReady($name);
            //			if (!empty($addname)) print "<br />" . PrintReady($addname);
            if (!empty($addname)) {
                print " - " . PrintReady($addname);
            }
            if ($SHOW_ID_NUMBERS) {
                print "&nbsp;&nbsp;";
                if ($TEXT_DIRECTION == "rtl") {
                    print "&rlm;";
                }
                print "(" . $pid2 . ")";
                if ($TEXT_DIRECTION == "rtl") {
                    print "&rlm;";
                }
            }
            print "</a>";
            // ID age
            if (!strstr($factrec, "_BIRT_")) {
                $dct = preg_match("/2 DATE (.*)/", $factrec, $dmatch);
                if ($dct > 0) {
                    print " <span class=\"age\">" . get_age($gedrec, $dmatch[1]) . "</span>";
                }
            }
            // RELAtionship calculation : for a family print relationship to both spouses
            if ($view != "preview") {
                $famrec = find_family_record($pid);
                if ($famrec) {
                    $parents = find_parents_in_record($famrec);
                    $pid1 = $parents["HUSB"];
                    if ($pid1 and $pid1 != $pid2) {
                        print " - <a href=\"relationship.php?pid1={$pid1}&amp;pid2={$pid2}&amp;followspouse=1&amp;ged={$GEDCOM}\">[" . $pgv_lang["relationship_chart"] . "<img src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["sex"]["small"] . "\" title=\"" . $pgv_lang["husband"] . "\" alt=\"" . $pgv_lang["husband"] . "\" class=\"sex_image\" />]</a>";
                    }
                    $pid1 = $parents["WIFE"];
                    if ($pid1 and $pid1 != $pid2) {
                        print " - <a href=\"relationship.php?pid1={$pid1}&amp;pid2={$pid2}&amp;followspouse=1&amp;ged={$GEDCOM}\">[" . $pgv_lang["relationship_chart"] . "<img src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["sexf"]["small"] . "\" title=\"" . $pgv_lang["wife"] . "\" alt=\"" . $pgv_lang["wife"] . "\" class=\"sex_image\" />]</a>";
                    }
                } else {
                    if ($pid != $pid2) {
                        print " - <a href=\"relationship.php?pid1={$pid}&amp;pid2={$pid2}&amp;followspouse=1&amp;ged={$GEDCOM}\">[" . $pgv_lang["relationship_chart"] . "]</a>";
                    }
                }
            }
        } else {
            if (strstr($gedrec, "@ FAM") !== false) {
                print "<a href=\"family.php?famid={$pid2}\">";
                if ($TEXT_DIRECTION == "ltr") {
                    print " &lrm;";
                } else {
                    print " &rlm;";
                }
                print "[" . $pgv_lang["view_family"];
                if ($SHOW_ID_NUMBERS) {
                    print " &lrm;({$pid2})&lrm;";
                }
                if ($TEXT_DIRECTION == "ltr") {
                    print "&lrm;]</a>\n";
                } else {
                    print "&rlm;]</a>\n";
                }
            } else {
                print $pgv_lang["unknown"];
                if ($SHOW_ID_NUMBERS) {
                    print "&nbsp;&nbsp;";
                    if ($TEXT_DIRECTION == "rtl") {
                        print "&rlm;";
                    }
                    print "(" . $pid2 . ")";
                    if ($TEXT_DIRECTION == "rtl") {
                        print "&rlm;";
                    }
                }
            }
        }
        if ($linebr) {
            print "<br />\n";
        }
        print_fact_notes($assorec, $level + 1);
        if (substr($_SERVER["SCRIPT_NAME"], 1) == "pedigree.php") {
            print "<br />";
            if (function_exists('print_fact_sources')) {
                print_fact_sources($assorec, $level + 1);
            }
        }
    }
}
Пример #6
0
    // $q .= ($q ? ', ' : '');
    $q .= get_person_name($row) . ($row['name'] ? " of " . $row['name'] : '');
    // TRAD
    $q .= '&nbsp;(<label for="id_rem_client' . $row['id_client'] . ':' . $row['id_org'] . '">';
    $q .= '<img src="images/jimmac/stock_trash-16.png" width="16" height="16" alt="Remove?" title="Remove?" /></label>&nbsp;';
    $q .= '<input type="checkbox" id="id_rem_client' . $row['id_client'] . ':' . $row['id_org'] . '" name="rem_client[]" value="' . $row['id_client'] . ':' . $row['id_org'] . '"/>)<br />';
    // TRAD
}
echo "\t\t\t{$q}\n";
// List rest of the clients to add
$q = "SELECT c.id_client, c.name_first, c.name_last, co.id_org, o.name\n\t\t\tFROM lcm_client AS c\n\t\t\tLEFT JOIN lcm_client_org AS co USING (id_client)\n\t\t\tLEFT JOIN lcm_org AS o ON (co.id_org = o.id_org)\n\t\t\tLEFT JOIN lcm_app_client_org AS aco ON (aco.id_client = c.id_client AND aco.id_app = " . _session('id_app', 0) . ")\n\t\t\tWHERE id_app IS NULL\n\t\t\tORDER BY c.name_first, c.name_last, o.name";
$result = lcm_query($q);
echo '<select name="client">' . "\n";
echo '<option selected="selected" value="0"> ... </option>' . "\n";
while ($row = lcm_fetch_array($result)) {
    echo '<option value="' . $row['id_client'] . ':' . $row['id_org'] . '">' . get_person_name($row) . ($row['name'] ? ' of ' . $row['name'] : '') . "</option>\n";
}
echo "</select>\n";
echo "<button name=\"submit\" type=\"submit\" value=\"add_client\" class=\"simple_form_btn\">" . 'Add' . "</button>\n";
// TRAD
echo "</td></tr>\n";
echo "</table>\n";
// Delete appointment
if (_session('id_app', 0)) {
    // $checked = ($this->getDataString('hidden') == 'Y' ? ' checked="checked" ' : '');
    $checked = $_SESSION['form_data']['hidden'] == 'Y' ? ' checked="checked" ' : '';
    echo '<p class="normal_text">';
    echo '<input type="checkbox"' . $checked . ' name="hidden" id="box_delete" />';
    echo '<label for="box_delete">' . _T('app_info_delete') . '</label>';
    echo "</p>\n";
}
Пример #7
0
 function printGeneral($show_subtitle = true, $allow_edit = true)
 {
     // Read site configuration preferences
     $case_assignment_date = read_meta('case_assignment_date');
     $case_alledged_crime = read_meta('case_alledged_crime');
     $case_legal_reason = read_meta('case_legal_reason');
     if ($show_subtitle) {
         show_page_subtitle(_T('generic_subtitle_general'), 'cases_intro');
     }
     $add = allowed($this->data['case'], 'w');
     $edit = allowed($this->data['case'], 'e');
     $admin = allowed($this->data['case'], 'a');
     //
     // Show various stages info
     //
     $q = "SELECT * FROM lcm_stage WHERE id_case = " . $this->data['case'] . " ORDER BY date_creation DESC";
     $result = lcm_query($q);
     echo '<div style="float: right; width: 180px;">';
     show_page_subtitle(_T('case_subtitle_stage'), 'cases_intro');
     echo '<ul>';
     while ($row = lcm_fetch_array($result)) {
         echo '<li>' . format_date($row['date_creation'], 'date_short') . ': <br/>' . _Tkw('stage', $row['kw_case_stage']) . '</li>';
     }
     echo "</ul>\n";
     echo "</div>\n";
     //
     // Show case info
     //
     echo '<ul class="info">';
     // Case ID
     echo '<li>' . '<span class="label1">' . _Ti('case_input_id') . '</span>' . '<span class="value1">' . show_case_id($this->getDataInt('id_case')) . '</span>' . "</li>\n";
     // Case title
     echo '<li>' . '<span class="label1">' . _Ti('case_input_title') . '</span>' . '<span class="value1">' . $this->getDataString('title') . '</span>' . "</li>\n";
     // Show users assigned to the case
     $q = "SELECT id_case, a.id_author, name_first, name_middle, name_last\n\t\t\t\tFROM lcm_case_author as ca, lcm_author as a\n\t\t\t\tWHERE (id_case=" . $this->getDataInt('id_case') . "\n\t\t\t\t  AND ca.id_author = a.id_author)";
     $authors_result = lcm_query($q);
     $cpt = 0;
     if (lcm_num_rows($authors_result) > 1) {
         echo '<li>' . '<span class="label2">' . _Ti('case_input_authors') . '</span>';
     } else {
         echo '<li>' . '<span class="label2">' . _Ti('case_input_author') . '</span>';
     }
     while ($author = lcm_fetch_array($authors_result)) {
         if ($cpt) {
             echo "; ";
         }
         $name = htmlspecialchars(get_person_name($author));
         echo '<span class="value2">' . '<a href="author_det.php?author=' . $author['id_author'] . '" class="content_link"' . ' title="' . _T('case_tooltip_view_author_details', array('author' => $name)) . '">' . $name . "</a>" . '</span>';
         if ($admin) {
             echo '<span class="noprint">';
             echo '&nbsp;<a href="edit_auth.php?case=' . $this->getDataInt('id_case') . '&amp;author=' . $author['id_author'] . '"' . ' title="' . _T('case_tooltip_view_access_rights', array('author' => $name)) . '">' . '<img src="images/jimmac/stock_access_rights-16.png" width="16" height="16" border="0" alt="" />' . '</a>';
             echo "</span>\n";
         }
         $cpt++;
     }
     // [ML] FIXME Double-check if this is OK here in all scenarios
     if ($admin) {
         echo '<span class="noprint">';
         echo '<a href="sel_auth.php?case=' . $this->getDataInt('id_case') . '" title="' . _T('add_user_case') . '">' . '<img src="images/jimmac/stock_attach-16.png" width="16" height="16" border="0" alt="' . _T('add_user_case') . '" />' . '</a>';
         echo "</span>\n";
     }
     echo "</li>\n";
     echo '<li>' . '<span class="label2">' . _Ti('case_input_date_creation') . '</span>' . '<span class="value2">' . format_date($this->getDataString('date_creation')) . '</span>' . "</li>\n";
     if ($case_assignment_date == 'yes') {
         // [ML] Case is assigned/unassigned when authors are added/remove
         // + case is auto-assigned when created.
         if ($this->data['date_assignment']) {
             echo '<li>' . '<span class="label2">' . _Ti('case_input_date_assigned') . '</span>' . '<span class="value2">' . format_date($this->getDataString('date_assignment')) . '</span>' . "</li>\n";
         }
     }
     // Total time spent on case (redundant with "reports/times")
     $query = "SELECT " . lcm_query_sum_time('fu.date_start', 'fu.date_end') . " as time\n\t\t\t\t\tFROM lcm_followup as fu \n\t\t\t\t\tWHERE fu.id_case = " . $this->getDataInt('id_case', '__ASSERT__') . "\n\t\t\t\t\t  AND fu.hidden = 'N'";
     $result = lcm_query($query);
     $row_tmp = lcm_fetch_array($result);
     echo '<li>' . '<span class="label2">' . _Ti('case_input_total_time') . '</span>' . '<span class="value2">' . format_time_interval_prefs($row_tmp['time']) . '&nbsp;' . _T('time_info_short_hour') . '</span>' . "</li>\n";
     if (substr($case_legal_reason, 0, 3) == 'yes') {
         echo '<li>' . '<span class="label2">' . _Ti('case_input_legal_reason') . '</span>' . '<span class="value2">' . clean_output($this->getDataString('legal_reason')) . '</span>' . "</li>\n";
     }
     if (substr($case_alledged_crime, 0, 3) == 'yes') {
         echo '<li>' . '<span class="label2">' . _Ti('case_input_alledged_crime') . '</span>' . '<span class="value2">' . clean_output($this->getDataString('alledged_crime')) . '</span>' . "</li>\n";
     }
     // Keywords
     show_all_keywords('case', $this->getDataInt('id_case'));
     if ($this->data['stage']) {
         // There should always be a stage, but in early versions, < 0.6.0,
         // it might have been missing, causing a lcm_panic().
         $stage = get_kw_from_name('stage', $this->getDataString('stage', '__ASSERT__'));
         $id_stage = $stage['id_keyword'];
         show_all_keywords('stage', $this->getDataInt('id_case'), $id_stage);
     }
     // Notes
     echo '<li class="large">' . '<span class="label2">' . _Ti('case_input_notes') . '</span>' . '<span class="value2">' . nl2br($this->getDataString('notes')) . '</span>' . "</li>\n";
     //	echo "</ul>\n";
     //	echo "<p class='normal_text'>";
     if ($allow_edit && $admin) {
         // Show case status (if closed, only site admin can re-open)
         echo '<li>';
         echo "<form action='edit_fu.php' method='get'>\n";
         echo "<input type='hidden' name='case' value='" . $this->getDataInt('id_case') . "' />\n";
         echo _Ti('case_input_status');
         echo "<select name='type' class='sel_frm' onchange='lcm_show(\"submit_status\")'>\n";
         // in inc/inc_acc.php
         $statuses = get_possible_case_statuses($this->getDataString('status'));
         foreach ($statuses as $s => $futype) {
             $sel = $s == $this->getDataString('status') ? ' selected="selected"' : '';
             echo '<option value="' . $futype . '"' . $sel . '>' . _T('case_status_option_' . $s) . "</option>\n";
         }
         echo "</select>\n";
         echo "<button type='submit' name='submit' id='submit_status' value='set_status' style='visibility: hidden;' class='simple_form_btn'>" . _T('button_validate') . "</button>\n";
         echo "</form>\n";
         // Show case stage
         echo "<form action='edit_fu.php' method='get'>\n";
         echo "<input type='hidden' name='case' value='" . $this->getDataInt('id_case') . "' />\n";
         echo "<input type='hidden' name='type' value='stage_change' />\n";
         echo _Ti('case_input_stage');
         echo "<select name='stage' class='sel_frm' onchange='lcm_show(\"submit_stage\")'>\n";
         $stage_kws = get_keywords_in_group_name('stage');
         foreach ($stage_kws as $kw) {
             $sel = $kw['name'] == $this->data['stage'] ? ' selected="selected"' : '';
             echo "\t\t<option value='" . $kw['name'] . "'" . "{$sel}>" . _T(remove_number_prefix($kw['title'])) . "</option>\n";
         }
         echo "</select>\n";
         echo "<button type='submit' name='submit' id='submit_stage' value='set_stage' style='visibility: hidden;' class='simple_form_btn'>" . _T('button_validate') . "</button>\n";
         echo "</form>\n";
         echo "</li>\n";
     } else {
         echo '<li>' . _Ti('case_input_status') . _T('case_status_option_' . $this->getDataString('status')) . "</li>\n";
         echo '<li>' . _Ti('case_input_stage') . _Tkw('stage', $this->data['stage']) . "</li>\n";
     }
     // If case closed, show conclusion
     if ($this->data['status'] == 'closed') {
         // get the last relevant conclusion
         $q_tmp = "SELECT * \n\t\t\t\tFROM lcm_followup\n\t\t\t\tWHERE id_case = " . $this->getDataInt('id_case') . "\n\t\t\t\tAND (type = 'conclusion'\n\t\t\t\t\t\tOR type = 'stage_change')\n\t\t\t\tORDER BY id_followup DESC \n\t\t\t\tLIMIT 1";
         $r_tmp = lcm_query($q_tmp);
         $row_tmp = lcm_fetch_array($r_tmp);
         if ($row_tmp) {
             echo '<li>';
             echo '<div style="background: #f0f0f0; padding: 4px; border: 1px solid #aaa;">';
             echo _Ti('fu_input_conclusion');
             echo get_fu_description($row_tmp, false);
             echo ' <a class="content_link" href="fu_det.php?followup=' . $row_tmp['id_followup'] . '">...</a>';
             echo "</div>\n";
             echo "</li>\n";
         }
     }
     echo '<li>' . _Ti('case_input_collaboration');
     echo "<ul style='padding-top: 1px; margin-top: 1px;'>";
     echo "<li>" . _Ti('case_input_collaboration_read') . _T('info_' . ($this->getDataInt('public') ? 'yes' : 'no')) . "</li>\n";
     echo "<li>" . _Ti('case_input_collaboration_write') . _T('info_' . ($this->getDataInt('pub_write') ? 'yes' : 'no')) . "</li>\n";
     echo "</ul>\n";
     echo "</li>\n";
     echo "</ul>\n";
     // clear the right column with stage info
     echo "<div style='clear: right;'></div>\n";
 }
{
    echo '<form action="sort_search_table.php" class="search_form" method="post" align="center">';
    echo 'Search by:<select name="search_by">';
    $i = 0;
    while ($i < mysql_num_fields($result)) {
        $attr = mysql_fetch_field($result, $i);
        echo "<option>" . $attr->name . "</option>";
        $i++;
    }
    echo '</select> ';
    echo '<input type="text" name="search_field">';
    echo '<button type="submit" name="submit">Search</button>';
    echo '</form>';
}
$SponsAccessLevel = get_access_level($SponsID);
$SponsName = get_person_name($SponsID);
$SponsSector = get_person_sector($SponsID);
$table_message = $_SESSION['table_message'];
$main_query = $_SESSION['main_query'];
echo '<header align="center">
			<h1>Sponsorship Department</h1>';
if ($SponsAccessLevel == "SectorHead") {
    echo $SectorHeadBackButton;
}
if ($SponsAccessLevel == "SponsRep") {
    echo $SponsRepBackButton;
}
if ($SponsAccessLevel == "CSO") {
    echo $CSOBackButton;
}
echo '</header>';
Пример #9
0
// - To return xml with &nbsp;, it causes a syntax error. liveUpdated.js makes
//   an alert with the resulting code, which will look valid, but Firefox will
//   show in its javascript console where the xml error is located.
header('Content-Type: text/xml');
echo '<?xml version="1.0"?>';
echo "<body>";
if (_request('find_name_client')) {
    include_lcm('inc_obj_client');
    echo "<div id=\"autocomplete-client-popup\">";
    $cpt = 0;
    $search = _request('find_name_client');
    $query = "SELECT *\n\t\t\t\tFROM lcm_client\n\t\t\t\tWHERE name_last LIKE '%{$search}%'\n\t\t\t\t\tOR name_first LIKE '%{$search}%'\n\t\t\t\t\tOR CONCAT(name_first, ' ', name_middle, ' ', name_last) LIKE '%{$search}%'\n\t\t\t\t\tOR CONCAT(name_first, ' ', name_last) LIKE '%{$search}%'";
    $result = lcm_query($query);
    echo "<ul>";
    while ($row = lcm_fetch_array($result)) {
        echo "<li>" . $row['id_client'] . ": " . get_person_name($row) . "</li>\n";
        $cpt++;
    }
    if (!$cpt) {
        echo "<li>0: No results</li>";
    }
    // TRAD
    echo "</ul>\n";
    echo "</div>\n";
} elseif (_request('find_name_org')) {
    include_lcm('inc_obj_org');
    echo "<div id=\"autocomplete-org-popup\">";
    $cpt = 0;
    $search = _request('find_name_org');
    $query = "SELECT *\n\t\t\t\tFROM lcm_org\n\t\t\t\tWHERE name LIKE '%{$search}%'\n\t\t\t\t\tOR tax_number LIKE '%{$search}%'\n\t\t\t\t\tOR court_reg LIKE '%{$search}%'\n\t\t\t\t\tOR stat_number LIKE '%{$search}%'";
    $result = lcm_query($query);
Пример #10
0
echo "</td>\n\t\t\t</tr>\n\t\t\t<tr align=left>\n\t\t\t\t<th>Total earned:</th>\n\t\t\t\t<td>";
$Income = mysql_query("SELECT SUM(Amount) as 'Sum' FROM AccountLog WHERE TransType='Deposit'");
$row = mysql_fetch_assoc($Income);
$row = $row['Sum'];
echo "Rs." . $row;
echo "</td>\n\t\t\t</tr>\n\t\t\t</table>";
?>


		<br><br><br>
		<!--<h3>Total Amount:<!-- Total amount -->
	</section>	
	
	<div id="welcome" align="right">
		<h2>Welcome, <?php 
echo get_person_name($SponsID);
?>
 <!-- The name of the  SponsRep will come here -->
		<br>
		<a href='logout.php'>Logout</a>
	</div>
	
	<section class="options">
	
	

	<div id="query" align="center">
		
		<!-- SectorHead form -->
		<form action="query.php" method ="POST">
			<h2>Options:</h2>
Пример #11
0
	$Id: client_det.php,v 1.56 2007/01/12 17:37:04 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_contacts');
include_lcm('inc_obj_client');
$client = intval(_request('client'));
if (!($client > 0)) {
    lcm_header("Location: listclients.php");
    exit;
}
$q = "SELECT *\n\t\tFROM lcm_client as c\n\t\tWHERE c.id_client = {$client}";
$result = lcm_query($q);
if (!($row = lcm_fetch_array($result))) {
    die("ERROR: There is no such client in the database.");
}
lcm_page_start(_T('title_client_view') . ' ' . get_person_name($row), '', '', 'clients_intro');
/* Saved for future use
			// Check for access rights
			if (!($row['public'] || allowed($client,'r'))) {
				die("You don't have permission to view this client details!");
			}
			$edit = allowed($client,'w');
		*/
$edit = true;
// Show tabs
$groups = array('general' => array('name' => _T('generic_tab_general'), 'tooltip' => _T('generic_subtitle_general')), 'cases' => array('name' => _T('generic_tab_cases'), 'tooltip' => _T('client_subtitle_cases')), 'attachments' => array('name' => _T('generic_tab_documents'), 'tooltip' => _T('client_subtitle_attachments')));
$tab = isset($_GET['tab']) ? $_GET['tab'] : 'general';
show_tabs($groups, $tab, $_SERVER['REQUEST_URI']);
if ($c = intval(_request('attach_case', 0))) {
    $q = "SELECT title\n\t\t\t\t\tFROM lcm_case\n\t\t\t\t\tWHERE id_case = " . $c;
    $result = lcm_query($q);
Пример #12
0
     echo "<tr>\n";
     echo '<th class="heading">' . "#" . '</th>';
     echo '<th class="heading" width="99%">' . _Th('person_input_name') . '</th>';
     echo '<th class="heading">&nbsp;</th>';
     echo "</tr>\n";
 } else {
     // TODO info message?
 }
 $i = 0;
 while ($row = lcm_fetch_array($result)) {
     echo "<tr>\n";
     // ID
     echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">' . $row['id_client'] . '</td>';
     // Name of client
     echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '"><a href="client_det.php?client=' . $row['id_client'] . '" class="content_link">';
     echo get_person_name($row) . "</a></td>";
     // Delete association
     echo '<td nowrap="nowrap" class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">';
     echo '<label for="id_rem_cli_' . $row['id_client'] . '">';
     echo '<img src="images/jimmac/stock_trash-16.png" width="16" height="16" ' . 'alt="' . _T('org_info_delete_client') . '" title="' . _T('org_info_delete_client') . '" />';
     echo '</label>&nbsp;';
     echo '<input type="checkbox" onclick="lcm_show(\'btn_delete\')" id="id_rem_cli_' . $row['id_client'] . '" name="rem_clients[]" value="' . $row['id_client'] . '" />';
     echo '</td>';
     echo "</tr>\n";
     $i++;
 }
 if ($show_table) {
     echo "</table>";
 }
 echo '<div align="right" style="visibility: hidden">';
 echo '<input type="submit" name="submit" id="btn_delete" value="' . _T('button_validate') . '" class="search_form_btn" />';
Пример #13
0
function get_author_link($item)
{
    if (!is_array($item)) {
        lcm_log("Warning: show_author_link() was not given an array");
        return;
    }
    return '<a class="content_link" ' . 'href="author_det.php?author=' . $item['id_author'] . '" ' . 'title="' . _T('case_tooltip_view_author_details', array('author' => get_person_name($item))) . '">' . get_person_name($item) . "</a>";
}
Пример #14
0
function get_fu_description($item, $make_short = true)
{
    if (!is_array($item)) {
        lcm_debug("get_fu_description: parameter is not an array.");
        return '';
    }
    global $prefs;
    global $fu_desc_len;
    // configure via my_options.php with $GLOBALS['fu_desc_len'] = NNN;
    $short_description = '';
    // Set the length of short followup title (was: wide = 48, narrow = 115)
    $title_length = isset($fu_desc_len) && $fu_desc_len > 0 ? $fu_desc_len : 256;
    if ($item['type'] == 'assignment' && is_numeric($item['description'])) {
        $res1 = lcm_query("SELECT * FROM lcm_author WHERE id_author = " . $item['description']);
        $author1 = lcm_fetch_array($res1);
        $short_description = _T('case_info_author_assigned', array('name' => get_person_name($author1)));
    } elseif ($item['type'] == 'unassignment' && is_numeric($item['description'])) {
        $res1 = lcm_query("SELECT * FROM lcm_author WHERE id_author = " . $item['description']);
        $author1 = lcm_fetch_array($res1);
        $short_description = _T('case_info_author_unassigned', array('name' => get_person_name($author1)));
    } elseif ($item['type'] == 'stage_change' || is_status_change($item['type'])) {
        $tmp = lcm_unserialize($item['description']);
        // for backward compatibility, make it optional
        if ($item['case_stage']) {
            $short_description = _Tkw('stage', $item['case_stage']);
        }
        if ($tmp['description']) {
            $short_description .= " / " . $tmp['description'];
        }
        if ($tmp['result'] || $tmp['conclusion']) {
            $short_description .= "\n" . _Ti('fu_input_conclusion');
        }
        if ($tmp['result']) {
            $short_description .= _Tkw('_crimresults', $tmp['result']) . "/";
        }
        if ($tmp['conclusion']) {
            $short_description .= _Tkw('conclusion', $tmp['conclusion']);
        }
        if ($tmp['sentence']) {
            $short_description .= "\n" . _Ti('fu_input_sentence') . _Tkw('sentence', $tmp['sentence'], array('currency' => read_meta('currency')));
        }
        if ($tmp['sentence_val']) {
            $short_description .= ": " . $tmp['sentence_val'];
        }
    } else {
        if ($item['description']) {
            if (!$make_short || strlen(lcm_utf8_decode($item['description'])) < $title_length) {
                $short_description = $item['description'];
            } else {
                $short_description = substr($item['description'], 0, $title_length) . '...';
            }
            $short_description = clean_output($short_description);
        } else {
            $short_description = _T('fu_info_emptydesc');
        }
    }
    $short_description = nl2br($short_description);
    if (empty($short_description)) {
        $short_description = _T('info_not_available');
    }
    return $short_description;
}
Пример #15
0
        lcm_panic("Error seeking position {$list_pos} in the result");
    }
}
$headers = array();
$headers[0]['title'] = _Th('person_input_name');
$headers[0]['order'] = 'order_name_first';
$headers[0]['default'] = 'ASC';
$headers[1]['title'] = _Th('authoredit_input_status');
$headers[1]['order'] = 'order_status';
$headers[1]['default'] = '';
show_list_start($headers);
// Process the output of the query
for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) {
    // Author name
    echo "<tr>\n";
    echo "<td class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>";
    echo '<a href="author_det.php?author=' . $row['id_author'] . '" class="content_link">';
    echo highlight_matches(get_person_name($row), $find_author_string);
    echo "</a></td>\n";
    // Author status
    echo "<td class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>";
    echo _T('authoredit_input_status_' . $row['status']);
    echo "</td>\n";
    echo "</tr>\n";
}
show_list_end($list_pos, $number_of_rows);
// New author button
if ($GLOBALS['author_session']['status'] == 'admin') {
    echo '<p><a href="edit_author.php?author=0" class="create_new_lnk">' . _T('authoredit_button_new') . "</a></p>\n";
}
lcm_page_end();
Пример #16
0
if ($id_case) {
    lcm_page_start(_T('title_case_edit'), '', '', 'cases_intro#edit');
} else {
    lcm_page_start(_T('title_case_new'), '', '', 'cases_intro#new');
}
// Show the errors (if any)
echo show_all_errors();
if ($attach_client || $attach_org) {
    show_context_start();
}
if ($attach_client) {
    $query = "SELECT id_client, name_first, name_middle, name_last\n\t\t\t\tFROM lcm_client\n\t\t\t\tWHERE id_client = " . $attach_client;
    $result = lcm_query($query);
    while ($row = lcm_fetch_array($result)) {
        // should be only once
        echo '<li style="list-style-type: none;">' . _Ti('fu_input_involving_clients') . get_person_name($row) . "</li>\n";
    }
}
if ($attach_org) {
    $query = "SELECT id_org, name\n\t\t\t\tFROM lcm_org\n\t\t\t\tWHERE id_org = " . $attach_org;
    $result = lcm_query($query);
    while ($row = lcm_fetch_array($result)) {
        // should be only once
        echo '<li style="list-style-type: none;">' . _Ti('fu_input_involving_clients') . $row['name'] . "</li>\n";
    }
}
if ($attach_client || $attach_org) {
    show_context_end();
}
// Start edit case form
echo '<form action="upd_case.php" method="post">' . "\n";
Пример #17
0
         }
         echo "</tr>\n";
         echo "</table>\n";
         echo "</p>\n";
     }
     $foo = get_date_range_fields();
     echo $foo['html'];
     show_report_for_user($author, $foo['date_start'], $foo['date_end'], 'case');
     show_report_for_user($author, $foo['date_start'], $foo['date_end'], 'fu');
     show_report_for_user($author, $foo['date_start'], $foo['date_end'], 'agenda');
     break;
 case 'appointments':
     if (!allowed_author($author, 'r')) {
         die("Access denied");
     }
     show_page_subtitle(_T('author_subtitle_appointments', array('author' => get_person_name($author_data))), 'tools_agenda');
     $foo = get_date_range_fields();
     $date_start = $foo['date_start'];
     $date_end = $foo['date_end'];
     echo $foo['html'];
     echo "<p class=\"normal_text\">\n";
     $q = "SELECT ap.*\n\t\t\t\t\tFROM lcm_author_app as aa, lcm_app as ap\n\t\t\t\t\tWHERE aa.id_app = ap.id_app\n\t\t\t\t\t\tAND UNIX_TIMESTAMP(start_time) >= UNIX_TIMESTAMP('" . $date_start . "') ";
     if ($date_end != "-1") {
         $q .= " AND UNIX_TIMESTAMP(end_time) <= UNIX_TIMESTAMP('" . $date_end . "') ";
     }
     $q .= " AND aa.id_author = " . $GLOBALS['author_session']['id_author'];
     // Sort agenda by date/time of the appointments
     $order = 'DESC';
     if (isset($_REQUEST['order'])) {
         if ($_REQUEST['order'] == 'ASC' || $_REQUEST['order'] == 'DESC') {
             $order = $_REQUEST['order'];
Пример #18
0
		<th align="center" class="heading"><?php 
echo _Th('case_input_author');
?>
</th>
		<th align="center" class="heading"><?php 
echo _Th('case_ac_input_rights');
?>
</th>
	</tr>

<?php 
while ($row = lcm_fetch_array($result)) {
    echo "<tr>\n";
    // User name
    echo '<td align="left">';
    echo '<a href="author_det.php?author=' . $row['id_author'] . '" class="content_link"' . ' title="' . _T('case_tooltip_view_author_details', array('author' => get_person_name($row))) . '">' . get_person_name($row) . '</a>';
    echo "</td>\n";
    // Access rights in case
    echo '<td align="center">';
    echo '<select name="auth[' . $row['id_author'] . ']">' . "\n";
    $all_rights = array('read', 'write', 'admin', '', 'remove');
    foreach ($all_rights as $ac) {
        $sel = $row['ac_' . $ac] ? ' selected="selected" ' : '';
        $dis = !$ac ? ' disabled="disabled" ' : '';
        $title = $ac ? _T('case_input_option_ac_' . $ac) : '';
        echo '<option value="' . $ac . '"' . $sel . $dis . '>' . $title . "</option>\n";
    }
    echo "</select>\n";
    echo "</td>\n";
    echo "</tr>\n";
}
Пример #19
0
show_find_box('author', $find_author_string, '__self__');
echo '<form action="add_auth.php" method="post">' . "\n";
$headers = array();
$headers[0]['title'] = '';
$headers[0]['order'] = 'no_order';
$headers[1]['title'] = _Th('person_input_name');
$headers[1]['order'] = 'order_name';
$headers[2]['title'] = _Th('authoredit_input_status');
$headers[2]['order'] = 'order_status';
show_list_start($headers);
for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) {
    echo "<tr>\n";
    echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">';
    echo '<input type="checkbox" name="authors[]" value="' . $row['id_author'] . '" />';
    echo "</td>\n";
    echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">' . get_person_name($row) . "</td>\n";
    echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">' . _T('authoredit_input_status_' . $row['status']) . "</td>\n";
    echo "</tr>\n";
}
show_list_end($list_pos, $number_of_rows);
?>

<input type="hidden" name="case" value="<?php 
echo $case;
?>
" />
<input type="hidden" name="ref_sel_auth" value="<?php 
echo $dest_link->getUrl();
?>
" />
<button name="submit" type="submit" value="submit" class="simple_form_btn"><?php 
Пример #20
0
 function getPerson()
 {
     return get_person_name($this->data);
 }
Пример #21
0
<?php

$chuck = array("fullname" => "Chuck Severance", 'room' => '3437NQ');
$colleen = array("familyname" => "van Lent", 'givenname' => 'Colleen', 'room' => '3439NQ');
function get_person_name($person)
{
    if (isset($person['fullname'])) {
        return $person['fullname'];
    }
    if (isset($person['familyname']) && isset($person['givenname'])) {
        return $person['givenname'] . ' ' . $person['familyname'];
    }
    return false;
}
print get_person_name($chuck) . "\n";
print get_person_name($colleen) . "\n";
			echo $meeting_arr[3]; 

			echo "</td>
			</tr>"
			
			
			?>


		</table>
		<br><br><br>
		<!--<h3>Total Amount:<!-- Total amount -->
	</section>	
	
	<div id="welcome" align="right">
		<h2>Welcome, <?php echo get_person_name($SponsID); ?> <!-- The name of the  SponsRep will come here -->
		<br>
		<a href='logout.php'>Logout</a>
	</div>
	
	<section class="options">
	<div align="center">
	</div>
	
	

	<div id="query" align="center">
		<!-- SponsRep form -->
		<form action="query.php" method ="post"> 
		<h2>Options:</h2>
			<select name="query_type">
Пример #23
0
if ($list_pos >= $number_of_rows) {
    $list_pos = 0;
}
// Position to the page info start
if ($list_pos > 0) {
    if (!lcm_data_seek($result, $list_pos)) {
        lcm_panic("Error seeking position {$list_pos} in the result");
    }
}
// Output table tags
show_listclient_start();
for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) {
    echo "<tr>\n";
    echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">' . $row['id_client'] . "</td>\n";
    echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">';
    echo '<a href="client_det.php?client=' . $row['id_client'] . '" class="content_link">';
    $fullname = clean_output(get_person_name($row));
    echo highlight_matches($fullname, $find_client_string);
    echo "</a>\n";
    echo "</td>\n";
    echo "</tr>\n";
}
show_listclient_end($list_pos, $number_of_rows);
?>
<p><a href="edit_client.php" class="create_new_lnk"><?php 
echo _T('client_button_new');
?>
</a></p>
<br /><br />
<?php 
lcm_page_end();
	echo '<header align="center">' . '
			<h1>Sponsorship Department</h1>';


	if ($SponsAccessLevel == "SectorHead") echo $SectorHeadBackButton;

	if ($SponsAccessLevel == "SponsRep") echo $SponsRepBackButton;

	if ($SponsAccessLevel == "CSO") echo $CSOBackButton;


	echo '</header>';

	echo '<h3 class="SponsID">';
	echo 'SponsID: ' . $SponsID;
	echo '<br>Name: ' . get_person_name($SponsID);

	$role = get_access_level($SponsID);
	$printing_role = $role;
	if ($role == 'SponsRep') $printing_role = "Sponsorship Representative";
	if ($role == 'SectorHead') $printing_role = "Sector Head";
	if ($role == 'CSO') $printing_role = "Chief Sponsorship Officer";
	echo '<br>Role: ' . $printing_role;

	if (get_access_level($SponsID) == "SponsRep" || get_access_level($SponsID) == "SectorHead"){
		echo '<br>Sector: ' . get_person_sector($SponsID);
	}
	echo '</h3>';


	echo '<div align="center">';
Пример #25
0
            }
        }
    }
} else {
    // Fetch previously submitted values, if any
    if (!$_SESSION['form_data']['id_client']) {
        $_SESSION['form_data']['id_client'] = 0;
    }
    if (isset($_SESSION['form_data'])) {
        foreach ($_SESSION['form_data'] as $key => $value) {
            $form_data[$key] = $value;
        }
    }
}
if ($id_client > 0) {
    lcm_page_start(_T('title_client_edit') . ' ' . get_person_name($form_data), '', '', 'clients_newclient');
} else {
    lcm_page_start(_T('title_client_new'), '', '', 'clients_newclient');
}
echo show_all_errors();
echo '<form action="upd_client.php" method="post">' . "\n";
if (_request('attach_case')) {
    echo '<input type="hidden" name="attach_case" id="attach_case" value="' . _request('attach_case') . '" />' . "\n";
}
$obj_client = new LcmClientInfoUI($form_data['id_client']);
$obj_client->printEdit();
//
// Organisations this client represents
//
/* [ML] too confusing
	echo "<tr>\n";
Пример #26
0
        }
        // Get participant author(s)
        $participants = array();
        $q = "SELECT lcm_author_app.*,lcm_author.name_first,lcm_author.name_middle,lcm_author.name_last\n\t\t\t\t\tFROM lcm_author_app, lcm_author\n\t\t\t\t\tWHERE (id_app={$app} AND lcm_author_app.id_author=lcm_author.id_author)";
        $res_author = lcm_query($q);
        if (lcm_num_rows($res_author) > 0) {
            while ($author = lcm_fetch_array($res_author)) {
                $participants[] = get_person_name($author);
            }
        }
        // Get appointment client(s)
        $q = "SELECT aco.*, c.name_first, c.name_middle, c.name_last, o.name\n\t\t\t\t\tFROM lcm_app_client_org as aco\n\t\t\t\t\tNATURAL JOIN lcm_client as c\n\t\t\t\t\tLEFT JOIN lcm_org as o ON (o.id_org = aco.id_org)\n\t\t\t\t\tWHERE (id_app = {$app} AND aco.id_client = c.id_client)";
        $res_client = lcm_query($q);
        if (lcm_num_rows($res_client) > 0) {
            while ($client = lcm_fetch_array($res_client)) {
                $participants[] = get_person_name($client) . ($client['id_org'] > 0 ? " of " . $client['name'] : '');
            }
            // TRAD
        }
        $_SESSION['form_data']['id_app'] = $app;
        if (empty($_SESSION['errors'])) {
            // Propose a description based on the appointment
            $_SESSION['form_data']['description'] = _T('fu_info_after_event', array('title' => _Ti(_Tkw('appointments', $row['type'])) . $row['title'], 'date' => format_date($row['start_time']), 'participants' => join(', ', $participants)));
            $_SESSION['form_data']['date_start'] = $row['start_time'];
            $_SESSION['form_data']['date_end'] = $row['end_time'];
            $_SESSION['form_data']['description'] = str_replace('&nbsp;', ' ', $_SESSION['form_data']['description']);
        }
    }
}
//
// Check for access rights
Пример #27
0
    if (!lcm_data_seek($result, $list_pos)) {
        lcm_panic("Error seeking position {$list_pos} in the result");
    }
}
show_find_box('client', $find_client_string, '__self__');
echo '<form action="add_cli_org.php" method="post">' . "\n";
$headers = array();
$headers[0]['title'] = '';
$headers[0]['order'] = 'no_order';
$headers[1]['title'] = _Th('person_input_name');
$headers[1]['order'] = 'order_name';
show_list_start($headers);
for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) {
    echo "<tr>\n";
    echo '<td><input type="checkbox" name="clients[]" value="' . $row['id_client'] . '"></td>' . "\n";
    echo '<td>' . get_person_name($row) . "</td>\n";
    echo "</tr>\n";
}
?>
		<tr>
			<td>&nbsp;</td>
			<td><a href="edit_client.php" class="content_link"><strong><?php 
echo _T('client_button_new');
?>
</strong></a></td>
		</tr>

<?php 
show_list_end($list_pos, $number_of_rows);
?>