2 $monLibrary= dirname(__FILE__) .
"/../library";
3 $sharedLibrary= dirname(__FILE__) .
"/../../shared/library";
4 require_once(
"$monLibrary/cu_top.i");
5 require_once(
"$monLibrary/ck_hticket.i");
6 require_once(
"$monLibrary/cu_pass.i");
7 require_once(
"$sharedLibrary/errormail.i");
9 if (!CheckPerm($link, $Hu, basename($_SERVER[
'SCRIPT_NAME']), $_SERVER[
'REMOTE_ADDR'])) {
12 header(
"Location: /hcuadm/hcu_noperm.prg");
16 $dms_ok=array(
'action'=>
'string',
'msg'=>
'string',
'offlinestat'=>
'string',
'offlineblurb'=>
'string',
'rowid'=>
'string',
'livebatch'=>
'string');
20 $self = $_SERVER[
'PHP_SELF'];
25 # validate entries if needed; set $msg for error conditions 28 $sql=
"update cuadmin set offlinestat='$offlinestat', 29 offlineblurb='" . prep_save($offlineblurb) .
"' 30 where user_name='$rowid'";
31 $sth = db_query($sql,$dbh);
33 $msg=
"Unable to update status";
35 $notify->mailto=
'miki@homecu.net';
36 $notify->replyto=
'miki@homecu.net';
37 $notify->subject=
'Error updating status';
38 $notify->msgbody =
"\tUnable to update status\n\n";
39 $notify->msgbody .=
"Cu: $rowid\n";
40 $notify->msgbody .= $sql;
41 $notify->file = __FILE__;
48 cu_header(
"Status Updated");
49 cu_message(
"Succeeded<br>Status successfully updated");
56 $sql =
"select offlinestat, offlineblurb, livebatch 57 from cuadmin where user_name ='$rowid';";
58 $sth = db_query($sql, $dbh);
60 $row=db_fetch_array($sth);
61 cu_header(
"$rowid Status Change");
64 <script language=
"javascript">
68 if (document.forms[
'status'].elements[
'offlinestat'].selectedIndex == 0)
69 err_msg +=
"Offline Status must be selected.\\n";
71 if (document.forms[
'status'].elements[
'offlinestat'].value ==
'R' && document.forms[
'status'].elements[
'livebatch'].value ==
'L')
72 err_msg +=
"Read-Only Status is for Batch Systems only.\\n";
75 err_msg +=
"\\nPlease correct errors to continue.\\n";
76 window.alert(err_msg);
83 function showblurb() {
85 var idx= document.forms[
'status'].elements[
'reason'].selectedIndex;
86 var msg= document.forms[
'status'].elements[
'reason'][idx].text;
87 document.forms[
'status'].elements[
'offlineblurb'].value =
88 '<h2>' + msg +
'</h2>';
94 <FORM NAME=status ACTION=
"${self}" METHOD=post>
95 <TABLE BORDER=0 width=
"90%" cellpadding=3 cellspacing=0
class=
'dmsbg'><tr><td>
96 <TABLE BORDER=0 width=
"100%" cellpadding=2 cellspacing=0 bgcolor=white>
97 <TR><TD CLASS=
"bar" align=
"center" colspan=3>$rowid Status Change</TD></TR>
100 if (db_num_rows($sth) == 0) {
103 <td
class=
'dtl' align=center>Missing cuadmin record
for $rowid</td>
112 <tr><td
class=
'hdr' align=right valign=
'top'>Offline Status: </td>
113 <td
class=
'dtl' align=left><select name=
"offlinestat" size=
"5">
116 if (trim($row[
'offlinestat']) ==
'') { print
' selected'; }
117 print
"><<Select>></option> 119 if (trim($row[
'offlinestat']) ==
'N') { print
' selected'; }
120 print
">Active</option> 122 if (trim($row[
'offlinestat']) ==
'U') { print
' selected'; }
123 print
">Offline (Auto Up)</option> 125 if (trim($row[
'offlinestat']) ==
'Y') { print
' selected'; }
126 print
">Offline (Stay Down)</option> 128 if (trim($row[
'offlinestat']) ==
'R') { print
' selected'; }
129 print
">Read-Only</option> 132 <font color=
"green" size=
"2">Read-Only is
for Batch systems</font>
134 <tr><td
class=
'hdr' align=right valign=
'top'>Offline Message: </td>
135 <td
class=
'dtl' align=left>
136 <select name=
'reason' size=
'4' onChange=
'showblurb(this)'>
137 <option value=
'noconnect'>We are unable to access your information at
this time. Please
try back later.</option>
138 <option value=
'working'>We are working on the system. Please
try again later.</option>
139 <option value=
'maintenance'> We are currently down
for system maintenance. Please
try again later.</option>
140 <option value=
'upgrade'> We are currently down
for a system upgrade. We expect to be back at . Please
try again then.</option>
141 <option value=
'badlink'>You have followed an outdated link. Please
return to the credit
union home page for home banking access.</option>
143 <br><input type=
"text" size=110 maxlength=255 name=
"offlineblurb" value=
"${row['offlineblurb']}"></td></tr>
144 <tr><td colspan=
"2" class=
'bar'> </td></tr>
147 <td
class=
'dtl'> </td>
148 <TD CLASS=
"dtl" colspan=2>
149 <input type=hidden name=
"action" value=
"Change Status">
150 <input type=hidden name=
"rowid" value=
"$rowid">
151 <input type=hidden name=
"livebatch" value=
"${row['livebatch']}">
152 <input type=
"submit" value=
"Change Status" name=
"BtnSubmit" onclick=
"return val_save();">