Пример #1
0
    if (is_member_of('Admin', 'Support', 'Manage')) {
        $user_list = "<option value=\"\">--- Any Requester ---</option>" . get_user_list("", $user_org_code, "{$requested_by}");
        echo "<td class=smb>&nbsp;&nbsp;Request&nbsp;By:</td><td class=sml><select class=sml name=requested_by>{$user_list}</select></td>\n";
    }
    if (is_member_of('Admin', 'Support')) {
        $user_list = "<option value=\"\">--- All Users ---</option>" . get_user_list("Support,Contractor", "", $user_no);
    }
    echo "<td class=smb align=right>&nbsp;&nbsp;Work&nbsp;By:</td><td class=sml><select class=sml name=user_no>{$user_list}</select></td>\n";
    printf("<td align=right><input type=checkbox value=1 name=uncharged%s></td><td align=left class=smb><label for=uncharged>Uncharged</label></td>\n", "{$uncharged}" != "" ? " checked" : "");
    printf("<td align=right><input type=checkbox value=1 name=charge%s></td><td align=left class=smb><label for=charge>Charge</label></td>\n", "{$charge}" != "" ? " checked" : "");
    echo "</tr></table></td>\n<tr><td><table border=0 cellpadding=0 cellspacing=0 width=100%>\n";
    include "system-list.php";
    if (is_member_of('Admin', 'Support')) {
        $system_list = get_system_list("", "{$system_id}", 35);
    } else {
        $system_list = get_system_list("CES", "{$system_id}", 35);
    }
    echo "<td class=smb>System:</td><td class=sml><font size=1><select class=sml name=system_id><option value=\"\">--- All Systems ---</option>{$system_list}</select></font></td>\n";
    if (is_member_of('Admin', 'Support')) {
        include "organisation-list.php";
        $orglist = "<option value=\"\">--- All Organisations ---</option>\n" . get_organisation_list("{$org_code}", 35);
        echo "<td class=smb>&nbsp; &nbsp;Organisation:</td><td class=sml><select class=sml name=\"org_code\">\n{$orglist}</select></td>\n";
    }
    echo "<td align=left><input type=submit class=submit alt=go id=go value=\"GO>>\"name=go></td>\n";
    echo "</tr></table></td></tr>\n<tr><td><table border=0 cellspacing=0 cellpadding=0 width=100%><tr valign=middle>\n<td class=smb align=right>Work&nbsp;From:</td>\n<td nowrap class=smb><input type=text size=10 name=from_date class=sml value=\"{$from_date}\">\n<a href=\"javascript:show_calendar('forms.form.from_date');\" onmouseover=\"window.status='Date Picker';return true;\" onmouseout=\"window.status='';return true;\">" . $theme->Image("date-picker.gif") . "</a>\n</td>\n\n<td class=smb align=right>&nbsp;To:</td>\n<td nowrap class=smb><input type=text size=10 name=to_date class=sml value=\"{$to_date}\">\n<a href=\"javascript:show_calendar('forms.form.to_date');\" onmouseover=\"window.status='Date Picker';return true;\" onmouseout=\"window.status='';return true;\">" . $theme->Image("date-picker.gif") . "</a>\n</td>\n<td class=smb align=right>&nbsp;Type:</td>\n<td nowrap class=smb><select name=\"type_code\" class=sml><option value=\"\">-- All Types --</option>{$request_types}</select></td>\n</tr></table></td>\n</tr>\n</table>\n</form>\n";
}
$numcols = 7;
if ("{$search_for}{$system_id} " != "") {
    $query = "SELECT request.*, organisation.*, request_timesheet.*, ";
    $query .= " worker.fullname AS worker_name, requester.fullname AS requester_name";
    $query .= " FROM request, usr AS worker, usr AS requester, organisation, request_timesheet ";
Пример #2
0
$result = awm_pgexec($dbconn, "SET SQL_Inheritance TO OFF;");
// Initialise variables.
if (!isset($from_date)) {
    $from_date = date('01/m/y', mktime(0, 0, 0, date("m"), 0, date("Y")));
}
if (!isset($to_date)) {
    $to_date = date('d/m/y', mktime(0, 0, 0, date("m"), 0, date("Y")));
}
if (!isset($break_columns)) {
    $break_columns = 2;
}
if (is_member_of('Admin', 'Accounts')) {
    $system_list = get_system_list("", $system_id);
    $user_list = get_user_list("Support", "", $users);
} else {
    $system_list = get_system_list("CES", $system_id);
    $users = array($session->user_no);
    $user_list = "<option value=\"" . $session->user_no . "\">" . substr($session->fullname, 0, 25) . " (" . $session->abbreviation . ")" . "</option>";
}
$organisation_list = get_organisation_list($organisation_code);
$request_types = get_code_list("request", "request_type", "{$request_type}");
$quote_types = get_code_list("request_quote", "quote_type", "{$quote_type}");
$period_total = "week";
$select_columns = array("" => "", "Organisation" => "o.org_name", "System" => "ws.system_desc", "WR#" => "r.request_id", "Work By" => "rtu.fullname", "Request Brief" => "r.brief", "Request Status" => "r.last_status");
// $select_columns=array(""=>"","Organisation"=>"o.org_name","System"=>"r.system_id","WR#"=>"r.request_id","Work By"=>"rtu.fullname","Request Brief"=>"r.brief","Request Status"=>"r.last_status");
function buildSelect($name, $key_values, $current)
{
    // global $select_columns;
    $select = "<select name=\"" . $name . "\" class=\"sml\" id=\"" . $name . "\">\n";
    foreach ($key_values as $key => $value) {
        $select .= "<option";
Пример #3
0
<?php

include "system-list.php";
$system_ids = get_system_list("ECRS", "{$request->system_id}");
?>
<FORM METHOD=POST ACTION="<?php 
echo "{$SCRIPT_NAME}?form={$form}";
?>
">
<table align=center><tr valign=middle>
<td><b>Name</b><font size=2><input TYPE="Text" Size="20" Name="search_for" Value="<?php 
echo "{$search_for}";
?>
"></font></td>
<td class=smb>&nbsp;<b><label id=status>Inactive:</label></b></td><td><input id=status class=sml type="checkbox" name=status value=I<?php 
if ("{$status}" == "I") {
    echo " checked";
}
?>
></td>
<td><input type="submit" alt="go" name="submit" value="GO>>" class="submit"></td>
</tr></table>
</form>

<?php 
if (!is_member_of('Admin', 'Support')) {
    $org_code = $session->org_code;
}
if ("{$search_for}{$system_id} " != "") {
    $query = "SELECT * FROM organisation ";
    if ("{$system_id}{$org_code}" != "") {
Пример #4
0
require_once "top-menu-bar.php";
include "page-header.php";
if (!is_member_of('Admin', 'Support', 'OrgMgr')) {
    echo "<p class=error>Unauthorised</p>\n";
} else {
    echo "<form Action=\"{$base_url}/usrsearch.php\" Method=\"post\">\n";
    echo "<table align=center cellspacing=0 cellpadding=2><tr valign=middle>\n";
    echo "<td class=smb><b>Name:</b></td><td><input class=sml type=text size=\"8\" name=search_for value=\"{$search_for}\"></td>\n";
    if (is_member_of('Admin', 'Support')) {
        include "organisation-list.php";
        $orglist = "<option value=\"\">--- All Organisations ---</option>\n" . get_organisation_list("{$org_code}", 20);
        echo "<td class=smb>Org:</td><td><select class=sml name=\"org_code\">\n{$orglist}</select></td>\n";
    }
    if (is_member_of('Admin', 'Support', 'Manage')) {
        include "system-list.php";
        $syslist = "<option value=\"\">--- All Systems ---</option>\n" . get_system_list("VOECS", "{$system_id}", 20);
        echo "<td class=smb><b>Type:</b></td><td><select class=sml name=\"system_id\">\n{$syslist}</select></td>\n";
        echo "<td class=smb>&nbsp;<b><label id=\"active\">Inactive:</label></b></td><td><input id=\"active\" class=\"sml\" type=\"checkbox\" name=\"active\" value=\"f\"" . ($active == 'f' ? " checked" : "") . "></td>\n";
    }
    echo "<td><input type=submit class=submit alt=go value=\"GO>>\" name=submit></td>\n";
    echo "</tr></table>\n</form>\n";
    if ("{$search_for}{$org_code}{$system_id}{$active} " != "") {
        $sql = "SELECT *, to_char( last_update, 'dd/mm/yyyy' ) AS last_update, to_char( last_used, 'dd/mm/yyyy' ) AS last_used ";
        $sql .= "FROM usr JOIN organisation USING ( org_code ) ";
        if (isset($system_id) && $system_id > 0) {
            $sql .= "JOIN system_usr USING ( user_no ) ";
            $sql .= "JOIN lookup_code ON source_table='system_usr' AND source_field='role' AND lookup_code=role ";
        }
        $sql .= "WHERE TRUE ";
        if (!isset($org_code) || $org_code == 0) {
            $sql .= "AND organisation.active ";