2 $monLibrary= dirname(__FILE__) .
"/../library";
3 require_once(
"$monLibrary/cu_top.i");
4 require_once(
"$monLibrary/ck_hticket.i");
5 require_once(
"$monLibrary/cu_pass.i");
7 if (!CheckPerm($link, $Hu, basename($_SERVER[
'SCRIPT_NAME']), $_SERVER[
'REMOTE_ADDR'])) {
11 header(
"Location: /hcuadm/hcu_noperm.prg");
15 $dms_ok=array(
'orderby'=>
'string',
'action'=>
'string',
'rowid'=>
'string');
19 if (empty($orderby)) $orderby =
'cu';
20 if ($orderby ==
'start')
21 $sql_order =
" coalesce(cuadmin.upllaststart, TIMESTAMP '01-01-1970 12:00:00') desc";
22 elseif ($orderby ==
'end')
23 $sql_order = " coalesce(cuadmin.upllastend, TIMESTAMP '01-01-1970 12:00:00') desc";
25 $sql_order = "upper(cuadmin.$orderby)";
26 $sql = "select cu, user_name, vendor, orgname, upllaststat, histtrunc,
27 to_char(upllaststart, 'MM/DD/YYYY HH24:MI:SS') as upllaststart,
28 to_char(upllastend, 'MM/DD/YYYY HH24:MI:SS') as upllastend,
30 from cuadmin order by $sql_order";
34 $use_field =
"user_name";
37 $use_field =
"vendor";
40 $use_field =
"orgname";
49 $sth = db_query($sql, $dbh);
51 cu_header(
"Server Status");
53 echo
"<a name=\"top\"></a>";
54 echo
"<table border=0 cellpadding=3 cellspacing=0 align=center width='100%' class='dmsbg'><tr><td>";
55 echo
"<table border=0 cellpadding=2 cellspacing=0 align=center width='100%' bgcolor=white>";
56 echo
"<tr><td colspan=6 class=bar align=center>SELECT CREDIT UNION</td></tr>";
57 if ($use_field <>
"N") {
58 echo
"<tr><td colspan='6' align=center>Index: ";
59 for ($adx=ord(
"A"); $adx <= ord(
"Z"); $adx++)
60 echo
"<a href=#" . chr($adx) .
">" . chr($adx) .
"</a> ";
65 <a href=$PHP_SELF?action=list&orderby=cu>Credit Union</a></td> 67 <a href=$PHP_SELF?action=list&orderby=orgname>CU Name</a></td> 69 <a href=$PHP_SELF?action=list&orderby=vendor>Vendor</a></td> 71 <a href=$PHP_SELF?action=list&orderby=start>Last Upload Start</a></td> 73 <a href=$PHP_SELF?action=list&orderby=end>Last Upload End</a></td> 74 <td class='hdr'>Status</a></td> 77 if ($use_field <>
"N") {
78 $cur_ascii = ord(
"A") - 1;
79 $lst_ascii = ord(
"A") - 1;
81 for ($row=0; list($cu, $user_name, $vendor, $orgname, $upllaststat, $histtrunc, $upllaststart, $upllastend, $offlinestat) = db_fetch_array($sth,$row); $row++) {
83 $user_name = trim($user_name);
85 if ($use_field <>
"N") {
86 $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);
87 if (($cur_ascii <> $lst_ascii) && (($cur_ascii >= ord(
"A")) && ($cur_ascii <= ord(
"Z")))) {
89 printf(
"<tr><td colspan=6>\n");
90 for ($adx = $lst_ascii + 1; $adx < $cur_ascii; $adx++)
91 printf(
"<a name=%s></a>\n", chr($adx));
93 printf(
"<a name=%s>%s</a> <a href=#top>back to top</a></td></tr>\n", chr($adx), chr($adx));
94 $lst_ascii = $cur_ascii;
99 $tr_class = ($upllaststat > 0 ?
"error" : $RGB);
101 $tr_class = ($histtrunc ==
"1" ?
"trunc" : $tr_class);
102 $tr_class = ($offlinestat ==
"Y" || $offlinestat ==
"U" ?
"offstat" : $tr_class);
103 $vend_show = (trim($vendor) ==
'' ?
"" :
"&vc=". trim($vendor));
104 $pos = strpos($_SERVER[
'HTTP_HOST'],
".");
105 $www_show =
"&wc=" . substr($_SERVER[
'HTTP_HOST'],0,$pos);
106 $llink = (trim($upllaststart) ==
'' ?
'' :
"<a href='https://" . substr($_SERVER[
'HTTP_HOST'],0,$pos) .
107 ".homecu.net/hcuadm/tfiles/$user_name/public_html/status.txt'>Last</a>");
108 $hlink = (trim($upllaststart) ==
'' ?
'' :
"<a href='https://" . substr($_SERVER[
'HTTP_HOST'],0,$pos) .
109 ".homecu.net/hcuadm/html_hist?rowid=$user_name'>History</a>");
111 printf(
"<TR class=\"%s\"><td><A HREF=\"%s/hcuadm/cuindex.prg?action=fetch&rowid=%s%s%s\" target=\"_top\"> 113 <td><font size=2>%s </td> 114 <td><font size=2>%s </td> 115 <td><font size=2>%s </td> 116 <td><font size=2>%s </td> 117 <td><font size=2>%s %s </td> 118 </tr>\n",$tr_class,$infourl,$user_name, $vend_show, $www_show,
119 $user_name, $orgname, $vendor, $upllaststart, $upllastend,$llink,$hlink);
120 $RGB = ($RGB ==
"odd" ?
"even" :
"odd");
123 if ($use_field <>
"N") {
124 if ($cur_ascii < ord(
"Z")) {
125 printf(
"<tr><td colspan=5>\n");
126 for ($adx = $cur_ascii + 1; $adx <= ord(
"Z"); $adx++)
127 printf(
"<a name=%s></a>\n", chr($adx));
129 printf(
"<a href=#top>back to top</a></td></tr>");
132 print <<< print_legend
133 <tr><td colspan=
"6"> </td></tr>
134 <tr><td colspan=
"6" class=
'bar'>
140 The
'upllaststat' flag is
set to 1
for this credit
union. It could indicate an error or an upload is in process.
147 The
'histtrunc' flag is
set to 1
for this credit
union. The next time an upload occurs the history will be truncated.
154 The credit
union has been flagged offline by setting the 'offlinestat' flag.