3 $dms_ok=array(
'action'=>
'string',
'reset_bit'=>
'array',
'reset_doc'=>
'array');
4 dms_import_v2($SYSENV,
"SETFLAG", $dms_ok);
6 $SYSENV[
"SETFLAG"][
"helpicon"]=
"<img src='/IMAGES/q1.gif' border=0 alt='View Help' align='top'>";
7 $SYSENV[
"SETFLAG"][
"helpicon2"]=
"<img src='/IMAGES/q2.gif' border=0 alt='View Help' align='top'>";
8 $SYSENV[
"SETFLAG"][
"helpdoc"]=
"SetFlagHelp.html";
9 $SYSENV[
"SETFLAG"][
"self"] =
"$menu_link?ft=24";
10 extract($SYSENV[
"SETFLAG"]);
11 extract($SYSENV[
"TOP"]);
13 $main = basename($_SERVER[
'SCRIPT_NAME']);
25 $CU = strtoupper( $Cu );
28 $sql =
"select docs.docsid, docs.docsname, docs.docstitle, docs.docsdesc, docs.docsresponsetype 30 join cucmsfrags frags on frags.docsid = docs.docsid 31 and frags.cu = '{$CU}' 32 where docs.docsresponsetype in ('D', 'A', 'E', 'P')";
33 $sth = db_query($sql, $dbh);
36 $upgradeList = array();
38 while ( $popRow = db_fetch_array($sth, $row++) ) {
39 $upgradeList[] = $popRow;
42 <script language=
"JAVASCRIPT">
44 function show_help(marker)
46 helpwin=window.open(marker,
"_Help",
"toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=500,height=340");
53 if ( count( $upgradeList ) > 0 ) {
55 $memberDismissibleList = array();
56 $cuDismissibleList = array();
57 for ( $i = 0; $i < count( $upgradeList ); $i++ ) {
58 if ( $upgradeList[$i][
"docsresponsetype"] ==
"P" )
59 $cuDismissibleList[] = $upgradeList[$i];
61 $memberDismissibleList[] = $upgradeList[$i];
64 <form action=
"<?php echo $self ?>&act=U2" method=
"post">
68 <table width=
"100%" border=0 cellpadding=4 cellspacing=1>
71 if ( count( $memberDismissibleList ) ) {
73 <tr><td
class=
"bar" colspan=
"2" align=
"center">Reset Member Pop-Ups and Promos <a href=
'javascript:show_help("<?php echo $helpdoc ?>#overview");'><?php echo $helpicon ?></a></td></tr>
74 <tr><td
class=
"msg" colspan=
"2" align=
"left">
75 By
default, Pop-up messages and Member-Dismissible Login Promos are shown to all members. Members may dismiss the message or promo by specifying
"Don't Tell Me Again". <br><br>When you reset these flags, all members will see the related message or promo again, even
if they previously checked
"Don't Tell Me Again".
78 for ( $i = 0; $i < count( $memberDismissibleList ); $i++ ) {
80 $sql =
"SELECT count(*) FROM cucmsresponse WHERE docsid = {$memberDismissibleList[$i]["docsid
"]} AND cu = '$Cu' AND responseon IS NOT NULL";
81 $rs = db_query($sql, $dbh);
82 $row = db_fetch_array($rs,0);
84 $affectedStr =
"(<span style='font-style:italic;'>{$row[0]} member(s)</span>)";
89 <tr><td
class=
"dtl" align=
"left" width=
"70%">{$memberDismissibleList[$i][
"docsdesc"]} $affectedStr</td>
90 <td
class=
"dtll" width=
"30%" >
91 <input type=
"checkbox" name=
"reset_doc[]" value=
"{$memberDismissibleList[$i]["docsid
"]}">Reset Flag
101 if ( count( $memberDismissibleList ) && count( $cuDismissibleList ) ) {
103 <tr><td
class=
"msg" colspan=
"2"> </td></tr>
108 if ( count( $cuDismissibleList ) ) {
110 <tr><td
class=
"msg" colspan=
"2" align=
"left">
111 By
default, the CU-Dismissible Promos are shown to all members. It is possible
for the credit
union to exclude members from the CU-Dismissible Login Promo by marking their accounts (see below).<br><br>When you reset this flag, all members will see any active CU-Dismissible Promo.
114 for ( $i = 0; $i < count( $cuDismissibleList ); $i++ ) {
115 $sql =
"SELECT count(*) FROM cucmsresponse WHERE docsid = {$cuDismissibleList[$i]["docsid
"]} AND cu = '$Cu' AND responseon IS NOT NULL";
116 $rs = db_query($sql, $dbh);
117 $row = db_fetch_array($rs,0);
119 $affectedStr =
"(<span style='font-style:italic;'>{$row[0]} member(s)</span>)";
124 <tr><td
class=
"dtl" width=
"70%">{$cuDismissibleList[$i][
"docsdesc"]} $affectedStr</td>
125 <td
class=
"dtll" width=
"30%" >
126 <input type=
"checkbox" name=
"reset_doc[]" value=
"{$cuDismissibleList[$i]["docsid
"]}">Reset Flag
133 <tr><td align=
"center" colspan=
'2' class=
'dtl'><input type=
"submit" value=
"Reset Selected Flags" name=
"submit_settings"></td></tr>
141 <form action=
"<?php echo $self ?>&act=S" method=
"post">
145 <table width=
"100%" border=0 cellpadding=4 cellspacing=1>
146 <tr><td
class=
"bar" align=
"center">Exclude From CU-Dismissible Login Promo<a href=
'javascript:show_help("<?php echo $helpdoc ?>#NDTpromo");'><?php echo $helpicon ?></a></td></tr>
147 <?php
if (is_readable(
"$home_path/admin/CU-Dismissible.html")): ?>
148 <tr><td
class=
"dtlr"><a href=
"<?php echo $main ?>/admin/CU-Dismissible.html?ft=82" target=
"get_file" class=
"link2">View Results of Last Post </a></td></tr>
151 <tr><td
class=
"msg" align=
"left">
152 By
default, the CU-Dismissible Login Promo is shown to all members. If you wish to exclude certain members from
this promo, use the box below to enter their accounts.
153 <br><br>Insert the account numbers into
this entry field, separated by a space or
new line. <br>
154 If the record does not exist or cannot be updated, an error will be displayed.
156 <tr><td valign=
"top" class=
"dtl" align=
"center">
157 <textarea name=
"accts" cols=
"35" rows=
"15"></textarea>
160 <td align=
"center" class=
"dtl"><input type=
"submit" value=
"Set Flags" name=
"btnEval"></td>
167 elseif ($act ==
"U2"):
169 $errorList = array();
170 for ( $i = 0; $i < count($reset_doc); $i++ ) {
171 $docID = $reset_doc[$i];
174 $sql =
"UPDATE cucmsresponse SET responseon = NULL 175 WHERE docsid = $docID AND cu = '$Cu'";
178 $rs = db_query($sql, $dbh);
183 $sql =
"SELECT docsname FROM cucmsdocs WHERE docsid = $docID";
184 $rs = db_query($sql, $dbh);
186 $errorList[] =
"Error reading doc id: $docID";
188 $row = db_fetch_array($rs,0);
189 $errorList[] =
"Error reading doc: {$row["docsname
"]}";
194 if ( count( $errorList ) > 0 ):
199 <table border=0 cellpadding=4 cellspacing=0>
200 <tr><td
class=
"bar">Credit Union Message Settings</td></tr>
201 <tr><td
class=
"dtl">Failed to reset notice settings</td></tr>
203 for ( $i = 0; $i < count( $errorList ); $i++ ) {
204 print
"<tr><td class='dtl'>{$errorList[$i]}</td></tr>";
217 <table border=0 cellpadding=4 cellspacing=0>
218 <tr><td
class=
"bar">Credit Union Popups and Promos Settings</td></tr>
219 <tr><td
class=
"dtl">Settings Saved Successfully</td></tr>
226 elseif ($act ==
"S"):
233 $CU = strtoupper($Cu);
234 $sql =
"select docs.docsid from cucmsdocs docs 235 join cucmsfrags frags on frags.docsid = docs.docsid 236 and frags.cu = '{$CU}' 237 where docs.docsresponsetype = 'P'";
238 $sth = db_query($sql, $dbh);
240 if (!($sth) || db_num_rows($sth) != 1) {
241 # error - no persistent promo 242 $save_msg .=
"No persistent promo found. Can't update.";
243 $prt_msg .=
"No persistent promo found. Can't update.";
245 list($docID) = db_fetch_array($sth, 0);
253 $form_accts = array();
254 $delims = array(
"\r\n",
"\t",
";",
",");
255 $form_accts = explode(
" ", str_replace($delims,
" ", $_POST[
'accts']));
257 for ($idx = 0; $idx < count($form_accts); $idx++) {
259 $member = $form_accts[$idx];
260 if (trim($member) <>
'') {
261 if (strlen(trim($member)) > 0 && preg_match(
"/^\d\d*$/", $member)) {
269 # first see if the cuuser record exists - 270 $upd_sql =
"SELECT user_name from cuusers WHERE cu='" . prep_save($CU) .
"' 271 and user_name = '" . prep_save($member) .
"'; ";
272 $updateRs = db_query($upd_sql, $dbh);
274 if (db_num_rows($updateRs) === 0) {
275 $save_msg .=
"Invalid member $member (no Digital Banking record)<br>\n";
276 $prt_msg .=
"Invalid member $member (no Digital Banking record)<br>\n";
279 # call update-notice to set "response" for this member. 281 $upd_sql =
"INSERT INTO cucmsresponse (docsid, cu, accountnumber, responseon) 282 (SELECT " . intval($docID) .
", '" . prep_save($CU) .
"', 283 '" . prep_save($member) .
"', current_date 284 WHERE NOT EXISTS (SELECT (docsid, cu, accountnumber) 285 FROM cucmsresponse as cur 286 WHERE cur.docsid = " . intval($docID) .
" 287 AND cur.cu = '" . prep_save($CU) .
"' 288 AND cur.accountnumber = '" . prep_save($member) .
"' ) ); ";
290 $updateRs = db_query($upd_sql, $dbh);
291 if (db_affected_rows($updateRs) === 0) {
295 $upd_sql =
"UPDATE cucmsresponse 296 SET responseon = current_date 297 WHERE docsid = " . intval($docID) .
" 298 AND cu = '" . prep_save($CU) .
"' 299 AND accountnumber = '" . prep_save($member) .
"' ";
300 $updateRs = db_query($upd_sql, $dbh);
303 $save_msg .=
"Update FAILED Member $member <br>\n";
304 $prt_msg .=
"Update FAILED Member $member <br>\n";
307 $prt_msg .=
"Member $member updated<br>\n";
310 $save_msg .=
"Invalid member $member (empty or non-numeric)<br>\n";
311 $prt_msg .=
"Invalid member $member (empty or non-numeric)<br>\n";
315 # create file to save $prt_msg 317 $tabfile =
"$home_path/admin/CU-Dismissible.html";
318 $tabhdr =
"<HTML><HEAD> 319 <TITLE>Last CU-Dismissible Promo Exclusions</TITLE></HEAD> 320 <BODY>Posted by $Cn " . date(
"r") .
"<BR><BR>";
321 $tabtrl =
"</BODY></HTML>";
324 $STATFILE = fopen(
"$tabfile",
"w");
327 fwrite($STATFILE,
"$tabhdr");
328 fwrite($STATFILE,
"$prt_msg");
329 fwrite($STATFILE,
"$tabtrl");
332 print
"<div align='center'><table border=0 cellpadding=4 cellspacing=0> 334 <td class='bar'>Credit Union Popups and Promos Settings</td> 336 <tr><td class='dtlr'><a href='$main/admin/CU-Dismissible.html?ft=82' target='get_file' class='link2'>View Full Results </a></td></tr>";
337 if (trim($save_msg) ==
'') {
338 print
"<tr><td class='dtl'>Settings Saved Successfully</td></tr>";
340 print
"<tr><td class='dtl'>$save_msg</td></tr>";
342 print
"</table></div>";