3 $monLibrary = dirname(__FILE__) .
"/../library";
4 require_once(
"$monLibrary/cu_top.i");
5 require_once(
"$monLibrary/ck_hticket.i");
6 require_once(
"$monLibrary/cu_pass.i");
8 if (!CheckPerm($link, $Hu, basename($_SERVER[
'SCRIPT_NAME']), $_SERVER[
'REMOTE_ADDR'])) {
12 header(
"Location: /hcuadm/hcu_noperm.prg");
16 $dms_ok = array(
'orderby'=>
'string',
'action'=>
'string',
'rowid'=>
'string');
20 if (empty($orderby)) $orderby =
'cu';
21 if ($orderby ==
'start')
22 $sql_order =
" coalesce(cuadmin.upllaststart, TIMESTAMP '01-01-1970 12:00:00') desc";
23 elseif ($orderby ==
'end')
24 $sql_order = " coalesce(cuadmin.upllastend, TIMESTAMP '01-01-1970 12:00:00') desc";
26 $sql_order = "upper(cuadmin.$orderby)";
27 $sql = "select cu, user_name, vendor, orgname, upllaststat, histtrunc,
28 to_char(upllaststart, 'MM/DD/YYYY HH24:MI:SS') as upllaststart,
29 to_char(upllastend, 'MM/DD/YYYY HH24:MI:SS') as upllastend,
31 from cuadmin order by $sql_order";
35 $use_field =
"user_name";
38 $use_field =
"vendor";
41 $use_field =
"orgname";
50 $sth = db_query($sql, $dbh);
52 cu_header(
"Server Status");
54 echo
"<a name=\"top\"></a>";
55 echo
"<table border=0 cellpadding=3 cellspacing=0 align=center width='100%' class='dmsbg'><tr><td>";
56 echo
"<table border=0 cellpadding=2 cellspacing=0 align=center width='100%' bgcolor=white>";
57 echo
"<tr><td colspan=6 class=bar align=center>SELECT CREDIT UNION</td></tr>";
58 if ($use_field <>
"N") {
59 echo
"<tr><td colspan='6' align=center>Index: ";
60 for ($adx=ord(
"A"); $adx <= ord(
"Z"); $adx++)
61 echo
"<a href=#" . chr($adx) .
">" . chr($adx) .
"</a> ";
66 <a href={$_SERVER['PHP_SELF']}?action=list&orderby=cu>Credit Union</a></td> 68 <a href={$_SERVER['PHP_SELF']}?action=list&orderby=orgname>CU Name</a></td> 70 <a href={$_SERVER['PHP_SELF']}?action=list&orderby=vendor>Vendor</a></td> 72 <a href={$_SERVER['PHP_SELF']}?action=list&orderby=start>Last Upload Start</a></td> 74 <a href={$_SERVER['PHP_SELF']}?action=list&orderby=end>Last Upload End</a></td> 75 <td class='hdr'>Status</a></td> 78 if ($use_field <>
"N") {
79 $cur_ascii = ord(
"A") - 1;
80 $lst_ascii = ord(
"A") - 1;
82 for ($row=0; list($cu, $user_name, $vendor, $orgname, $upllaststat, $histtrunc, $upllaststart, $upllastend, $offlinestat) = db_fetch_array($sth,$row); $row++) {
84 $user_name = trim($user_name);
86 if ($use_field <>
"N") {
87 $cur_ascii = (ord(strtoupper(substr($$use_field, 0, 1))) > $cur_ascii && ord(strtoupper(substr($$use_field, 0, 1))) <= ord(
"Z") ? ord(strtoupper(substr($$use_field, 0, 1))) : $cur_ascii);
88 if (($cur_ascii <> $lst_ascii) && (($cur_ascii >= ord(
"A")) && ($cur_ascii <= ord(
"Z")))) {
90 printf(
"<tr><td colspan=6>\n");
91 for ($adx = $lst_ascii + 1; $adx < $cur_ascii; $adx++)
92 printf(
"<a name=%s></a>\n", chr($adx));
94 printf(
"<a name=%s>%s</a> <a href=#top>back to top</a></td></tr>\n", chr($adx), chr($adx));
95 $lst_ascii = $cur_ascii;
100 $tr_class = ($upllaststat > 0 ?
"error" : $RGB);
102 $tr_class = ($histtrunc ==
"1" ?
"trunc" : $tr_class);
103 $tr_class = ($offlinestat ==
"Y" || $offlinestat ==
"U" ?
"offstat" : $tr_class);
104 $vend_show = (trim($vendor) ==
'' ?
"" :
"&vc=". trim($vendor));
105 $pos = strpos($_SERVER[
'HTTP_HOST'],
".");
106 $shortServer = substr($_SERVER[
'HTTP_HOST'],0,$pos);
107 $server = in_array($shortServer, array(
"www",
"www3",
"www4",
"www5",
"www6")) ? $shortServer : $_SERVER[
'HTTP_HOST'];
108 $www_show =
"&wc=" . $server;
109 $llink = (trim($upllaststart) ==
'' ?
'' :
"<a href='https://" . $shortServer .
110 ".homecu.net/hcuadm/tfiles/$user_name/public_html/status.txt'>Last</a>");
111 $hlink = (trim($upllaststart) ==
'' ?
'' :
"<a href='https://" . $shortServer .
112 ".homecu.net/hcuadm/html_hist?rowid=$user_name'>History</a>");
114 printf(
"<TR class=\"%s\"><td><A HREF=\"%s/hcuadm/cuindex.prg?action=fetch&rowid=%s%s%s\" target=\"_top\"> 116 <td><font size=2>%s </td> 117 <td><font size=2>%s </td> 118 <td><font size=2>%s </td> 119 <td><font size=2>%s </td> 120 <td><font size=2>%s %s </td> 121 </tr>\n",$tr_class,$infourl,$user_name, $vend_show, $www_show,
122 $user_name, $orgname, $vendor, $upllaststart, $upllastend,$llink,$hlink);
123 $RGB = ($RGB ==
"odd" ?
"even" :
"odd");
126 if ($use_field <>
"N") {
127 if ($cur_ascii < ord(
"Z")) {
128 printf(
"<tr><td colspan=5>\n");
129 for ($adx = $cur_ascii + 1; $adx <= ord(
"Z"); $adx++)
130 printf(
"<a name=%s></a>\n", chr($adx));
132 printf(
"<a href=#top>back to top</a></td></tr>");
135 print <<< print_legend
136 <tr><td colspan=
"6"> </td></tr>
137 <tr><td colspan=
"6" class=
'bar'>
143 The
'upllaststat' flag is
set to 1
for this credit
union. It could indicate an error or an upload is in process.
150 The
'histtrunc' flag is
set to 1
for this credit
union. The next time an upload occurs the history will be truncated.
157 The credit
union has been flagged offline by setting the 'offlinestat' flag.