function RenderTagsPanel($ef) { global $session; $html = ""; $org_code = intval(ggv('org_code')); // Tags List format is as simple as possible... $ef->TempLineFormat('<span class="srchf" style="white-space: nowrap">%s%s</span>'); $sql = "SELECT tag_id, tag_description "; if ($org_code == 0 && ($session->AllowedTo("Admin") || $session->AllowedTo("Support"))) { $sql .= " || ' (' || abbreviation || ')' AS tag_description "; } $sql .= "FROM organisation JOIN organisation_tag USING(org_code) "; $sql .= "WHERE organisation.active AND organisation_tag.active "; if ($org_code != 0 && ($session->AllowedTo("Admin") || $session->AllowedTo("Support"))) { $sql .= "AND organisation.org_code = {$org_code} "; } else { if (!($session->AllowedTo("Admin") || $session->AllowedTo("Support"))) { $sql .= "AND organisation.org_code = {$session->org_code} "; } } $sql .= "ORDER BY lower(abbreviation), tag_sequence, lower(tag_description)"; $html .= "<div id=\"tagselect\" style=\"display :none;\">"; $html .= $ef->DataEntryLine("Tag List", "", "lookup", "orgtaglist", array("_sql" => SqlSelectOrgTags($org_code), "_null" => "-- Any Tag --", "title" => "A tag that you want included or excluded from the report.", "class" => "srchf", "id" => "taglistselect", "style" => "width: 12em")); $html .= $ef->DataEntryLine("Tag Search Fields", "%s", "text", "taglist_count", array("id" => "taglistcount")); $html .= "</div>"; $tag_and_v = ""; $tag_lb_v = ""; $tag_list_v = ""; $tag_rb_v = ""; $taglist_count = intval(ggv('taglist_count')); for ($i = 0; $i < $taglist_count; $i++) { $tag_and_v .= ggv('tag_and', $i) . ','; $tag_lb_v .= ggv('tag_lb', $i) . ','; $tag_list_v .= ggv('tag_list', $i) . ','; $tag_rb_v .= ggv('tag_rb', $i) . ','; } $html .= "<div id=\"moretags\" style=\"display :inline;\">"; $html .= "<script type='text/javascript'>TagSelectionStanza({$taglist_count},'{$tag_and_v}','{$tag_lb_v}','{$tag_list_v}','{$tag_rb_v}');</script>"; $html .= "</div>"; $html .= $ef->DataEntryLine("", "", "button", "extend_tags", array("value" => "More Tags", "onclick" => "ExtendTagSelections();", "title" => "Click to add another tag for the search.", "class" => "fsubmit")); $ef->RevertLineFormat(); return $html; }
echo "Person: <option value=\"{$row->user_no}\">{$row->name}</option>\n"; } } $qry = new PgQuery(SqlSelectSubscribers($org_code)); if ($qry->Exec('js::Subscriber')) { while ($row = $qry->Fetch()) { echo "Subscriber: <option value=\"{$row->user_no}\">{$row->name}</option>\n"; } } $qry = new PgQuery(SqlSelectSystems($org_code)); if ($qry->Exec('js::System')) { while ($row = $qry->Fetch()) { echo "System: <option value=\"{$row->system_id}\">{$row->system_desc}</option>\n"; } } $qry = new PgQuery(SqlSelectOrgTags($org_code)); if ($qry->Exec('js::OrgTag')) { while ($row = $qry->Fetch()) { echo "OrgTag: <option value=\"{$row->tag_id}\">{$row->tag_description}</option>\n"; } } } else { if (isset($person_id)) { $person_id = intval($person_id); } else { if (isset($system_id)) { } else { echo "Error: Unrecognised request"; } } }