Odyssey
cuilist.prg
1 <?php
2 
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");
7 
8  if (!CheckPerm($link, $Hu, basename($_SERVER['SCRIPT_NAME']), $_SERVER['REMOTE_ADDR'])) {
9 
10  // ** Permissions failed
11  // ** redirect to new page
12  header("Location: /hcuadm/hcu_noperm.prg");
13  exit;
14  }
15 
16  $reset_cookie = 0;
17  $sql_sys_opt = "";
18  $www_server = "";
19 
20  $dms_ok=array('sys_opt'=>'array','btnShowType'=>'string','action'=>'string',
21  'orderby'=>'string', 'reset_cookie'=>'digits');
22 
23  dms_import($dms_ok);
24 
25  $bgcolor = "#23497A";
26 
27  $ivrHostName = 'ivr.homecu.net';
28 
29  $use_cookie = false;
30  if ($reset_cookie == 1) {
31  HCU_setcookie_env($SYSENV, "Monitor_View", "", $now);
32 
33  } elseif (!isset($orderby) && !isset($sys_opt)) {
34  // ** Check for the cookie here -- If found then set the values I find
35  if (isset($_COOKIE['Monitor_View'])) {
36  // ** This may give the following values
37  // orderby :: cookie_sys_opt
38  parse_str ($_COOKIE['Monitor_View']);
39  }
40  $use_cookie = true;
41  }
42 
43  if (empty($orderby)) {
44  $orderby = 'cu';
45  }
46  switch ($orderby) {
47  case "www":
48  $sql_order = "www_server,lower(user_name)";
49  $use_field = "N";
50  break;
51  case "cu":
52  $sql_order = "lower(user_name)";
53  $use_field = "user_name";
54  break;
55  case "vendor":
56  $sql_order = "upper(vendor)";
57  $use_field = "vendor";
58  break;
59  case "orgname":
60  $sql_order = "upper(name)";
61  $use_field = "orgname";
62  break;
63  case "cu_state":
64  $sql_order = "upper(state), lower(user_name)";
65  $use_field = "cu_state";
66  break;
67  case "lb":
68  $use_field = "N";
69  $sql_order = "
70  CASE
71  WHEN (coalesce(system_options, 0) & $SYS_TYPE_CLOSED) = $SYS_TYPE_CLOSED
72  THEN 99
73  WHEN (coalesce(system_options, 0) & ($SYS_TYPE_BATCH + $SYS_TYPE_ASP)) = ($SYS_TYPE_BATCH + $SYS_TYPE_ASP)
74  THEN 2
75  WHEN (coalesce(system_options, 0) & ($SYS_TYPE_BATCH + $SYS_TYPE_IVR)) = ($SYS_TYPE_BATCH + $SYS_TYPE_IVR)
76  THEN 3
77  WHEN (coalesce(system_options, 0) & ($SYS_TYPE_BATCH + $SYS_TYPE_VOIP)) = ($SYS_TYPE_BATCH + $SYS_TYPE_VOIP)
78  THEN 4
79  WHEN (coalesce(system_options, 0) & $SYS_TYPE_BATCH) = $SYS_TYPE_BATCH
80  THEN 1
81  WHEN (coalesce(system_options, 0) & ($SYS_TYPE_LIVE + $SYS_TYPE_ASP)) = ($SYS_TYPE_LIVE + $SYS_TYPE_ASP)
82  THEN 6
83  WHEN (coalesce(system_options, 0) & ($SYS_TYPE_LIVE + $SYS_TYPE_IVR)) = ($SYS_TYPE_LIVE + $SYS_TYPE_IVR)
84  THEN 7
85  WHEN (coalesce(system_options, 0) & ($SYS_TYPE_LIVE + $SYS_TYPE_VOIP)) = ($SYS_TYPE_LIVE + $SYS_TYPE_VOIP)
86  THEN 8
87  WHEN (coalesce(system_options, 0) & $SYS_TYPE_LIVE) = $SYS_TYPE_LIVE
88  THEN 5
89  WHEN (coalesce(system_options, 0) & $SYS_TYPE_IVR) = $SYS_TYPE_IVR
90  THEN 9
91  WHEN (coalesce(system_options, 0) & $SYS_TYPE_VOIP) = $SYS_TYPE_VOIP
92  THEN 10
93  WHEN (coalesce(system_options, 0) & $SYS_TYPE_WEBONLY) = $SYS_TYPE_WEBONLY
94  THEN 11
95  ELSE
96  100
97  END, lower(user_name)
98  ";
99 
100  // ** I did have the idea when ordering by system_options (as done above) to use 'system_options' as the 2nd field
101  // In the order by list...this caused all different combinations to group...I thought it best to order by the main
102  // Option (Batch, Live, IVR, Webonly)...there order by user_name..
103  break;
104  }
105  $bit_sys_opt = 0;
106  $sys_opt_link = "";
107  if (isset($sys_opt)) {
108  // ** Create a bit-type variable for the addition of these new values
109  // *** Figure out the count...
110  foreach ($sys_opt as $opt_value) {
111  $bit_sys_opt = ($bit_sys_opt | $opt_value);
112  }
113 
114  $link_sys_opt = "&sys_opt=$bit_sys_opt";
115  } elseif (isset($sys_opt)) {
116  $bit_sys_opt = $sys_opt;
117  $link_sys_opt = "&sys_opt=$bit_sys_opt";
118  } elseif (isset($cookie_sys_opt)) {
119  $bit_sys_opt = $cookie_sys_opt;
120  $link_sys_opt = "&sys_opt=$bit_sys_opt";
121  }
122 
123  // *** SET THE COOKIE
124  $cookie_val = "orderby=$orderby&cookie_sys_opt=$bit_sys_opt";
125  HCU_setcookie_env($SYSENV, "Monitor_View", $cookie_val, time() + 86400);
126  if ($bit_sys_opt > 0 ) {
127  $sql_sys_opt = " WHERE (system_options & $bit_sys_opt) > 0 ";
128  }
129  $sql = "SELECT user_name, www_server, vendor, rtrim(name) as name,
130  trim(home_page_url), system_options, state, date_live
131  FROM cuinfo
132  $sql_sys_opt
133  ORDER BY $sql_order";
134 
135  $sth = db_query($sql, $dbh);
136 
137  if ($sth) {
138 
139  cu_header("Credit Union Settings Maintenance -- Select Account");
140  require( "monitorScriptInclude.prg" ); // html static script header for js and css links
141 
142 
143 ?>
144  <style>
145  .toTop {
146  position: fixed;
147  right: 20px;
148  top:20px;
149  width: 100px;
150  z-index: 10010;
151  border-radius: 5px;
152  box-shadow: 0px 1px 2px #8e8e8e;
153  }
154  #toTopSection {
155  margin: 5px 0 5px 5px;
156  }
157 
158  #toTopSection a {
159  color: #e6f2ff;
160  text-decoration: none;
161  }
162  .k-grid td{
163  white-space: nowrap;
164  text-overflow: ellipsis;
165  line-height: 11px;
166  font-size: 14px;
167  }
168  .lcolor { color: #016103; text-decoration: underline; cursor: pointer; }
169  .lcolor:hover {text-decoration: none; }
170  .lclosed {color:red}
171  </style>
172  <script language="javascript">
173  <!--
174  function view_vendor(vend_code) {
175  var newwin = null;
176  // This function will open a new window and view the vendor information
177  url = "view_vend.prg?vc=" + vend_code;
178  newwin = window.open(url, "VendorInfo", "width=400, height=600, resizeable=yes, scrollbars=yes, status=no, menubar=no, location=no, top=0, left=0");
179  }
180  function keywin() {
181  // This function will open a new window and view the GenKey script
182  window.open("GenKey.prg","GenKey","toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=600,height=430");
183  }
184  function hashwin() {
185  // This function will open a new window for the TicketHash script
186  window.open("TicketHash","TicketHash","toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=600,height=340");
187  }
188  function pktwin(which) {
189  // open a new fullsize window for (www3/www6) packetdump
190  var pktExt = (which == 'my' ? '.prg' : '');
191  window.open("https://" + which + ".homecu.net/hcuadm/packetdump" + pktExt,"packet");
192  }
193 
194  var knownServers = ["www", "www3", "www4", "www5", "www6"]; <?php // Everything else is Odyssey. ?>
195 
196  $(document).ready(function() {
197  $("#menuChoices").kendoMenu({
198  hoverDelay: 300,
199  popupCollision: false
200  });
201 
202  // make menu visible
203  $("#menuChoices").css("display", "block");
204 
205  // use a data source to get linkage with the uid
206  var dataSource = new kendo.data.DataSource({
207  data: gridData,
208  schema: {
209  model: {
210  id: "row_id"
211  }
212  },
213  filter: {field: "closed", operator: "eq", value: false}
214  });
215 
216  // show the grid
217  var cuGrid = $('#cuGrid').kendoGrid({
218  dataSource: dataSource,
219  sortable: {
220  mode: "single",
221  allowUnsort: false
222  },
223  filterable: false,
224  scrollable: false,
225  editable: false,
226  selectable: false,
227  columns: [
228  { field: "cuLink", title: "Credit Union", width:110 },
229  { field: "vendor", title: "Vendor", width:80 },
230  { field: "orgname", title: "CU Name" },
231  { field: "state", title: "State", width:50 },
232  { field: "www", title: "Server", width:50 },
233  { field: "upg_status", title: "Odyssey Status", width:100 },
234  { field: "type", title: "Type", width:90 },
235  { field: "admin", title: " ", width:70 },
236  { field: "bank", title: " ", width:70 },
237  { field: "mindex", title: " ", width:70 }
238  ],
239  dataBound: function(e) {
240  setQuickSearch();
241  $("#showClosedCheckbox").click(function() {
242  var filter= $(this).prop("checked") ? null : {field: "closed", operator: "eq", value: false};
243  cuGrid.dataSource.filter(filter);
244  });
245  },
246  rowTemplate: kendo.template($("#rowTemplate").html())
247  }).data("kendoGrid");
248 
249  $(cuGrid.tbody).on("click", "td", function (e) {
250  var row = $(this).closest("tr");
251  var colIdx = $("td", row).index(this);
252  var rowId = $(e.currentTarget).closest("tr").attr("id");
253 
254  var dataRow = dataSource.get(rowId);
255 
256  // column name to indices pretties
257  const column = {
258  creditunion : 0,
259  vendorcode : 1,
260  webpagelink : 2,
261  state : 3,
262  webserver : 4,
263  status : 5,
264  type : 6,
265  adminlink : 7,
266  bankinglink : 8,
267  mindexlink : 9
268  };
269 
270  // handle every cell different
271  if ( colIdx == column.creditunion ) {
272  // either a link or index
273  if ( dataRow["culine"] == true ) {
274  // go to the cu
275  location.href = "<?php echo $infourl?>/hcuadm/cuindex.prg?action=fetch&rowid="+dataRow["cucode"]+"&vc="+dataRow["vendor"]+"&wc="+dataRow["www"];
276  }
277  } else if ( colIdx == column.vendorcode ) {
278  // link to cu web page
279  if ( dataRow["vendor"].length > 0 ) {
280  view_vendor( dataRow["vendor"] );
281  }
282  } else if ( colIdx == column.webpagelink ) {
283  // link to cu web page
284  if ( dataRow["orglink"].length > 0 ) {
285  var urlToOpen = "http://"+dataRow["orglink"];
286  window.open( urlToOpen, "_blank");
287  }
288  } else if ( colIdx == column.webserver ) {
289  // www server
290  if ( dataRow["www"].length > 0 ) {
291  if (dataRow["www"] != 'ivr') {
292  location.href = "<?php echo $infourl?>/hcuadm/servindex.prg?rowid="+dataRow["www"];
293  }
294  }
295  } else if ( colIdx == column.status) {
296  location.href = "<?php echo $infourl?>/hcuadm/cuindex.prg?action=fetch&rowid="+dataRow["cucode"]+"&vc="+dataRow["vendor"]+"&wc=<?php echo $_SERVER['HTTP_HOST']; ?>";
297  } else if ( colIdx == column.adminlink ) {
298  // admin
299  if ( dataRow["admin"] == true && dataRow["www"].length > 0 ) {
300  var urlToOpen = "";
301  if (dataRow["www"] == "ivr") {
302  var server = "https://" + dataRow["www"] + ".homecu.net";
303  urlToOpen = server + "/hcuadm/ivr_mntc?action=admin_login&cu=" + dataRow["cucode"];
304  } else if (dataRow["www"].indexOf("localhost") !== -1) {
305  urlToOpen = "/hcuadm/suAdminUser.prg?cucode=" + dataRow["cucode"] + "&adminuser=" + dataRow["cucode"];
306  } else if (knownServers.indexOf(dataRow["www"]) !== -1) { <?php // Mammoth ?>
307  var server = "https://" + dataRow["www"] + ".homecu.net";
308  urlToOpen = server + "/hcuadm/adm_ticket?username=" + dataRow["cucode"];
309  } else { <?php // Odyssey ?>
310  var server = "https://" + dataRow["www"];
311  urlToOpen = server + "/hcuadm/suAdminUser.prg?cucode=" + dataRow["cucode"] + "&adminuser=" + dataRow["cucode"];
312  }
313  window.open( urlToOpen, "_blank");
314  }
315  } else if ( colIdx == column.bankinglink ) {
316  // banking
317  if ( dataRow["bank"] == true && dataRow["www"].length > 0 ) {
318  var urlToOpen = "";
319  if (dataRow["www"].indexOf("localhost") !== -1) {
320  urlToOpen = "/hcuadm/suCuUser.prg?cucode=" + dataRow["cucode"];
321  } else if (knownServers.indexOf(dataRow["www"]) !== -1) { <?php // Mammoth ?>
322  var server = "https://" + dataRow["www"] + ".homecu.net";
323  urlToOpen = server + "/hcuadm/mem_ticket?cu=" + dataRow["cucode"];
324  } else { <?php // Odyssey ?>
325  var server = "https://" + dataRow["www"];
326  urlToOpen = server + "/hcuadm/suCuUser.prg?cucode=" + dataRow["cucode"];
327  }
328  urlToOpen += dataRow['defBankType'] !== '' ? "&obMbrLogin=" + dataRow['defBankType'] : "";
329  window.open( urlToOpen, "_blank");
330  }
331  } else if ( colIdx == column.mindexlink ) {
332  // mindex
333  var urlToOpen = "";
334  if (dataRow["www"].indexOf("localhost") !== -1) {
335  urlToOpen = "/banking/hcuLogin.prg?cu=" + dataRow["cucode"].toUpperCase();
336  } else if (knownServers.indexOf(dataRow["www"]) !== -1) { <?php // Mammoth ?>
337  var server = "https://" + dataRow["www"] + ".homecu.net";
338  if ([5,6].indexOf(dataRow["mindex"]) !== -1) {
339  urlToOpen = server + "/fi/" + dataRow["cucode"];
340  } else {
341  urlToOpen = server + "/~" + dataRow["cucode"];
342  }
343  urlToOpen += "/mindex.html";
344  } else { <?php // Odyssey ?>
345  var server = "https://" + dataRow["www"];
346  urlToOpen = server + "/banking/hcuLogin.prg?cu=" + dataRow["cucode"].toUpperCase();
347  }
348  window.open( urlToOpen, "_blank");
349  }
350  });
351 
352  var keywords = {batch: true, live: true, asp: true, ivr: true, voip: true, webonly: true, upgrade: true, conversion: true, closed: true, setup: true,
353  hbupgrade: true, beta: true, complete: true};
354  var keywordMultiselect = $("#keywordMultiselect").kendoMultiSelect({
355  dataSource: {
356  data: Object.keys(keywords)
357  },
358  placeholder: "Select Keywords...",
359  change: function () {
360  var selected= this.value();
361  var currentString= $("#id_search").val();
362  var oldArray= currentString.split(" ");
363  var newArray= [];
364  var lookup= {};
365  for(var i=0; i!= selected.length; i++)
366  {
367  lookup[selected[i]]= true;
368  }
369  for(var i=0; i!= oldArray.length; i++)
370  {
371  var word= oldArray[i].trim();
372  if (word == "")
373  continue;
374 
375  // If the keyword is not in the predefined list of keywords or if it is selected, then add it the new list. Otherwise, mark it to not add it later.
376  if (typeof(keywords[oldArray[i]]) == "undefined")
377  newArray.push(oldArray[i]);
378  else if (typeof(lookup[oldArray[i]]) != "undefined" && lookup[oldArray[i]])
379  {
380  newArray.push(oldArray[i]);
381  lookup[oldArray[i]]= false; // prevent adding duplicate words
382  }
383  else
384  lookup[oldArray[i]]= false;
385  }
386  // Add keywords selected in the multiselect if they aren't already in the list.
387  for(var i=0; i!=selected.length; i++)
388  {
389  if (lookup[selected[i]] == "undefined" || lookup[selected[i]])
390  newArray.push(selected[i]);
391  }
392  $("#id_search").val(newArray.join(" "));
393  $("#id_search").keyup();
394  }
395  }).data("kendoMultiSelect");
396 
397  /*$('input#id_search').quicksearch('table#culist tbody tr');*/
398 
399  function setQuickSearch() {
400  // this has to be after the grid is created!!!
401  $('input#id_search').quicksearch('div#cuGrid tbody tr', {
402  'stripeRows': ['odd', 'even'],
403  'loader': 'span.loading'
404  });
405 
406  $("#id_search").focus();
407 
408  $("#id_search").keyup(function () {
409  var newArray= $(this).val().split(" ");
410  var multiselectArray= [];
411  for (var key in keywords) // clear out flags in keywords.
412  {
413  if (keywords.hasOwnProperty(key))
414  keywords[key]= true;
415  }
416  for (var i=0; i!=newArray.length; i++)
417  {
418  var word= newArray[i].trim();
419  if (word != "" && typeof(keywords[newArray[i]]) != "undefined" && keywords[newArray[i]])
420  {
421  multiselectArray.push(newArray[i]);
422  keywords[newArray[i]]= false; // prevent duplicates in array.
423  }
424  }
425  $("#keywordMultiselect").data("kendoMultiSelect").value(multiselectArray);
426  });
427  }
428  });
429  function Close_DropDown( idToClose ) {
430  $("#" +idToClose).css("visibility","hidden");
431  }
432  // -->
433  </script>
434 <script id="rowTemplate" type="text/x-kendo-template">
435  <tr data-uid="#= uid #" id="#= id #">
436  <td>
437  #if ( culine ) {# <span class='lcolor #= color#'>#= cuLink#</span> #} else {# #= cuLink# #}#
438  </td>
439  <td>
440  # if ( vendor.length > 0 ) { # <span class='lcolor'>#=vendor#</span>#}#
441  </td>
442  <td>
443  # if ( orglink.length > 0 ) {# <span class='lcolor'>#= orgname#</span> #} else { # #= orgname # #}#
444  </td>
445  <td>
446  #= state#
447  </td>
448  <td>
449  # if ( www.length > 0 ) {# <span class='lcolor'>#= www#</span> #} else { # #}#
450  </td>
451  <td>
452  #if ( upg_status ) {# <span class='lcolor #= color#'>#= upg_status #</span> #} else {# #= upg_status # #}#
453  </td>
454  <td>
455  #= type#
456  </td>
457  <td>
458  # if ( admin ) { # <span class='lcolor'>Admin</span>#}#
459  </td>
460  <td>
461  # if ( bank ) { # <span class='lcolor'>Banking</span>#}#
462  </td>
463  <td>
464  # if ( mindex ) { # <span class='lcolor'> # if ( mindex == 999) { # login # } else { # mindex # } #</span>#}#
465  </td>
466  </tr>
467 </script>
468  <div class='k-block toTop'>
469  <div id="toTopSection">
470  <a href=#top>Back To Top</a>
471  </div>
472  </div>
473 <?php
474  echo "<a id=\"top\" name=\"top\"></a>";
475  echo "<div class='dmsculist.prg' style='width:95%; border-radius: 5px;'>\n";
476  echo "<div class='bar' style='width:100%; text-align:center;'>SELECT CREDIT UNION</div>";
477  spewmenu();
478 
479  // this feature causes a sorting issue in the grid because extra characters are put in with the CU Name
480  if ( false ) {
481  echo "<div style='padding-top:25px; text-align:center;'>";
482  echo "Index: ";
483  for ($adx=ord("A"); $adx <= ord("Z"); $adx++) {
484  echo "<a href=#" . chr($adx) . ">" . chr($adx) . "</a> &nbsp;";
485  }
486  echo "</div>";
487  }
488 ?>
489 <div style='text-align:center; padding-left:40%; padding-top:10px; height: 30px;'>
490  <span style='float:left;'>Search List:
491  <input type='text' name='search' size=30 id='id_search' placeholder='Search' autofocus style='display: inline;font-size: 1.2em;' class='k-input' />
492  </span>
493  <span style='float:left; margin-left:5px;'>
494  <div id='keywordMultiselect' style='width: 200px;'></div>
495  </span>
496  <span style="float:left; margin-left: 15px;">
497  Show closed: <input id='showClosedCheckbox' type='checkbox'>
498  </span>
499  <span style='float:left;'><span class='loading' style='display: none;'>Loading...</span></span>
500 </div>
501 <?php
502  $RGB = "odd";
503  if ($use_field <> "N") {
504  $cur_ascii = ord("A") - 1; // Start at the character before A
505  $lst_ascii = ord("A") - 1; // Start at the character before A
506  }
507  $gridData = array();
508  $totalCount = 0;
509  $closedCount = 0;
510  $liveCount = 0;
511  $batchCount = 0;
512  $webonlyCount = 0;
513  $upgradeCount = 0;
514  $www3Count = 0;
515  $www4Count = 0;
516  $www5Count = 0;
517  $www6Count = 0;
518  $myCount = 0;
519  $localCount = 0;
520 
521  for ($row = 0; list($user_name, $www_server, $vendor, $orgname, $homepage, $system_options, $cu_state, $date_live) = db_fetch_array($sth,$row); $row ++) {
522  $user_name = trim($user_name);
523 
524  $indexLink = "";
525  if ( false ) {
526  $cur_ascii = (ord(strtoupper(substr($$use_field, 0, 1))) > $cur_ascii ? ord(strtoupper(substr($$use_field, 0, 1))) : $cur_ascii);
527  if (($cur_ascii <> $lst_ascii) && (($cur_ascii >= ord("A")) && ($cur_ascii <= ord("Z")))) {
528  //Insert links for missing letters, but display only the current letter
529  for ($adx = $lst_ascii + 1; $adx <= $cur_ascii; $adx++) {
530  $indexLink .= sprintf("<a name=%s></a>\n", chr($adx));
531  }
532 
533  $lst_ascii = $cur_ascii;
534 
535  }
536  }
537 
538  // display list w/link to self ?action=fetch and ?action=delete
539  $admlink = "";
540  $memlink = "";
541  $mnulink = "";
542 
543  // Create the Vendor link for the menu item
544  $vendor_url = "<a href=\"javascript:view_vendor('" . trim($vendor) . "')\" onMouseOver=\"status='View " .
545  trim($vendor) . " Information'; return true;\" onMouseOut=\"status='';\">" . trim($vendor) . "</a>";
546  $vend_link = (trim($vendor) == '' ? "" : $vendor_url);
547  $vend_show = (trim($vendor) == '' ? "" : "&vc=". trim($vendor));
548  $www_show = (trim($www_server) == '' ? "" : "&wc=$www_server");
549 
550  $orglink = ("$homepage" == "" ? $orgname : "<a href='http://$homepage' target='_blank'>$orgname</a>");
551 
552  if ((($system_options & $SYS_TYPE_CLOSED) != $SYS_TYPE_CLOSED) && !((($system_options & $SYS_TYPE_IVR) == $SYS_TYPE_IVR || ($system_options & $SYS_TYPE_VOIP) == $SYS_TYPE_VOIP) && (($system_options & $SYS_TYPE_BATCH) != $SYS_TYPE_BATCH && ($system_options & $SYS_TYPE_LIVE) != $SYS_TYPE_LIVE))) {
553  $admlink = (trim($www_server) == '' ? false : true);
554  }
555  if ((($system_options & $SYS_TYPE_CLOSED) != $SYS_TYPE_CLOSED) && (($system_options & $SYS_TYPE_WEBONLY) != $SYS_TYPE_WEBONLY) && !((($system_options & $SYS_TYPE_IVR) == $SYS_TYPE_IVR || ($system_options & $SYS_TYPE_VOIP) == $SYS_TYPE_VOIP) && (($system_options & $SYS_TYPE_BATCH) != $SYS_TYPE_BATCH && ($system_options & $SYS_TYPE_LIVE) != $SYS_TYPE_LIVE))) {
556  $memlink = (trim($www_server) == '' ? false : true);
557  }
558  if ((($system_options & $SYS_TYPE_CLOSED) != $SYS_TYPE_CLOSED) && (($system_options & $SYS_TYPE_WEBONLY) != $SYS_TYPE_WEBONLY) && !((($system_options & $SYS_TYPE_IVR) == $SYS_TYPE_IVR || ($system_options & $SYS_TYPE_VOIP) == $SYS_TYPE_VOIP) && (($system_options & $SYS_TYPE_BATCH) != $SYS_TYPE_BATCH && ($system_options & $SYS_TYPE_LIVE) != $SYS_TYPE_LIVE))){
559  switch (trim(strtolower($www_server))) {
560  case "":
561  $mnulink = 0;
562  break;
563  case "www3":
564  $mnulink = 3;
565  break;
566  case "www5":
567  $mnulink = 5;
568  break;
569  case "www6":
570  $mnulink = 6;
571  break;
572  default:
573  $mnulink = 999;
574  break;
575  }
576  }
577  $print_HomeCU_Type = "";
578  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_BATCH ? "B" : "");
579  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_LIVE ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_LIVE ? "L" : "") : "");
580  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_ASP ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_ASP ? "A" : "") : "");
581  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_IVR ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_IVR ? "I" : "") : "");
582  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_VOIP ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_VOIP ? "V" : "") : "");
583  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_WEBONLY ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_WEBONLY ? "W" : "") : "");
584  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_UPGRADE ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_UPGRADE ? "U" : "") : "");
585  // $print_HomeCU_Type .= ($system_options & $SYS_TYPE_CLOSED ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_CLOSED ? "C" : "") : "");
586  $print_HomeCU_Type = ($system_options & $SYS_TYPE_CLOSED ? "C" : $print_HomeCU_Type);
587 
588  // ** CREATE KEY WORDS
589  $search_HomeCU_Type = "";
590  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_BATCH ? ":BATCH:" : "");
591  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_LIVE ? ":LIVE:" : "");
592  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_ASP ? ":LIVE:ASP:" : "");
593  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_IVR ? ":IVR:" : "");
594  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_VOIP ? ":VOIP:" : "");
595  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_WEBONLY ? ":WEBONLY:" : "");
596  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_UPGRADE ? ":UPGRADE:CONVERSION:" : "");
597  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_CLOSED ? ":CLOSED" : "");
598  /* Add Search String for the Upgrade Status */
599  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_UPG_TEST ? ":SETUP:HBUPGRADE:UPGRADE" : "");
600  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_UPG_BETA ? ":BETA:HBUPGRADE:UPGRADE" : "");
601  $search_HomeCU_Type .= ($system_options & $SYS_TYPE_UPG_COMP ? ":COMPLETE:HBUPGRADE:UPGRADE" : "");
602 
603  // gather some stats
604  if ( ($system_options & $SYS_TYPE_CLOSED) == $SYS_TYPE_CLOSED ) {
605  $closedCount++;
606  } else {
607  if ( ($system_options & $SYS_TYPE_BATCH) == $SYS_TYPE_BATCH ) {
608  $batchCount++;
609  }
610  if ( ($system_options & $SYS_TYPE_LIVE) == $SYS_TYPE_LIVE ) {
611  $liveCount++;
612  }
613  if ( ($system_options & $SYS_TYPE_WEBONLY) == $SYS_TYPE_WEBONLY ) {
614  $webonlyCount++;
615  }
616  }
617  // which server - exclude closed and webonly
618  if ( (($system_options & $SYS_TYPE_CLOSED) != $SYS_TYPE_CLOSED) && (($system_options & $SYS_TYPE_WEBONLY) != $SYS_TYPE_WEBONLY) ) {
619  $serverTest = trim(strtolower($www_server));
620  if ( $serverTest === "www3" ) {
621  $www3Count++;
622  } else if ( $serverTest === "www4" ) {
623  $www4Count++;
624  } else if ( $serverTest === "www5" ) {
625  $www5Count++;
626  } else if ( $serverTest === "www6" ) {
627  $www6Count++;
628  } else if ( $serverTest === "my.homecu.net") {
629  $myCount++;
630  } else if ( strpos($serverTest, "localhost") !== false) {
631  $localCount++;
632  }
633  }
634 
635  $linkColor = (($system_options & $SYS_TYPE_CLOSED) == $SYS_TYPE_CLOSED ? 'lclosed' : '');
636  // place the first letter anchors with the name of the CU
637  $cuLink = sprintf( "$indexLink%s", $user_name ); // what about link color if not active???
638  $wwwLink = sprintf( "<span class='lcolor'>%s</span>", trim($www_server) );
639  $type = sprintf( "%s&nbsp;<span style='display:none;'>%s</span>", $print_HomeCU_Type, $search_HomeCU_Type );
640 
641  if ($date_live != '') {
642  $obMbrLogin = 'CLS'; // Classic
643  } else {
644  $obMbrLogin = 'UPG'; // Default to Upgrade if date_live is NOT set, this is a new CU.
645  }
646  /*
647  * Create the string for the HB Upgrade Status
648  */
649  $hbStatusText = '';
650  if ($system_options & $SYS_TYPE_UPG_TEST) {
651  $hbStatusText = 'SETUP';
652  } elseif ($system_options & $SYS_TYPE_UPG_BETA) {
653  $hbStatusText = 'BETA';
654  } elseif ($system_options & $SYS_TYPE_UPG_COMP) {
655  $hbStatusText = 'COMP';
656  $obMbrLogin = 'UPG'; // Upgrade -- Always set to UPG
657  // another statistic
658  $upgradeCount++;
659  } else if ($system_options & $SYS_TYPE_WEBONLY) {
660  $hbStatusText = 'N/A';
661  }
662  // make an array entry of the data
663  $dataEntry = array( "row_id" => $row, "culine" => true, "cuLink" => $cuLink, "cucode" => $user_name, "vendor" => trim($vendor),
664  "orgname" => $orgname, "orglink" => $homepage, "color" => $linkColor,
665  "state" => trim($cu_state), "www" => trim($www_server), "upg_status" => $hbStatusText,"type" => $type,
666  "admin" => $admlink, "bank" => $memlink, "defBankType" => $obMbrLogin, "mindex" => $mnulink, "closed" => ($system_options & $SYS_TYPE_CLOSED) != 0);
667  // add it to the grid data array
668  $gridData[] = $dataEntry;
669 
670  $totalCount++;
671  }
672 
673 
674  echo "<div id='cuGrid'></div>\n";
675  $finalIndexLink = "";
676  if ($use_field <> "N") {
677  if ($cur_ascii < ord("Z")) {
678  for ($adx = $cur_ascii + 1; $adx <= ord("Z"); $adx++) {
679  $finalIndexLink .= sprintf("<a name=%s></a>\n", chr($adx));
680  }
681  }
682  }
683  echo $finalIndexLink;
684 
685  echo "Live: $liveCount, Batch: $batchCount, WebOnly: $webonlyCount, Total: $totalCount, Closed: $closedCount, Net: " . ($totalCount - $closedCount);
686  echo " &nbsp; &nbsp; &nbsp; Server counts - ";
687  $separator = "";
688  if ( $www3Count > 0 ) {
689  echo "{$separator}www3: $www3Count";
690  $separator = ", ";
691  }
692  if ( $www4Count > 0 ) {
693  echo "{$separator}www4: $www4Count";
694  $separator = ", ";
695  }
696  if ( $www5Count > 0 ) {
697  echo "{$separator}www5: $www5Count";
698  $separator = ", ";
699  }
700  if ( $www6Count > 0 ) {
701  echo "{$separator}www6: $www6Count";
702  $separator = ", ";
703  }
704  if ( $myCount > 0) {
705  echo "{$separator}Odyssey: $myCount";
706  $separator = ", ";
707  }
708  if ( $localCount > 0) {
709  echo "{$separator}Localhost: $localCount";
710  $separator = ", ";
711  }
712 
713  echo " &nbsp; &nbsp; &nbsp; Odyssey Migrations Remaining: " . ($liveCount + $batchCount - $upgradeCount);
714 
715  // end the border
716  echo "</div>\n";
717 
718  print "<script language=\"javascript\">\n";
719  print "<!--\n";
720  print " var gridData = " . json_encode( $gridData ) . "\n";
721  print "// -->\n";
722  print "</script>\n";
723 
724  $set_sys_opt[0] = "";
725  $set_sys_opt[1] = "";
726  $set_sys_opt[2] = "";
727  $set_sys_opt[4] = "";
728  $set_sys_opt[8] = "";
729  $set_sys_opt[16] = "";
730  $set_sys_opt[32] = "";
731  $set_sys_opt[64] = "";
732  if ($bit_sys_opt > 0) {
733  foreach ($set_sys_opt as $key=>$value) {
734  $set_sys_opt[$key] = (($key & $bit_sys_opt) > 0 ? "CHECKED" : "");
735  }
736  }
737  print <<< print_html
738 
739  <div id="ShowId" class="dtl" style="position:absolute;left:0px;top:0px;visibility:hidden;border:1px solid black;">
740  <form action="/hcuadm/mtrList.prg?action=list&orderby={$orderby}" method="post">
741  <table border=0 cellpadding=0 cellspacing=0 width='%'>
742  <tr>
743  <td class='iright'>
744  <input type='checkbox' name='sys_opt[]' value='1' {$set_sys_opt[1]}>Batch
745  </td>
746  </tr>
747  <tr>
748  <td class='iright'>
749  <input type='checkbox' name='sys_opt[]' value='2' {$set_sys_opt[2]}>Live
750  </td>
751  </tr>
752  <tr>
753  <td class='iright'>
754  <input type='checkbox' name='sys_opt[]' value='4' {$set_sys_opt[4]}>ASP
755  </td>
756  </tr>
757  <tr>
758  <td class='iright'>
759  <input type='checkbox' name='sys_opt[]' value='8' {$set_sys_opt[8]}>IVR
760  </td>
761  </tr>
762  <tr>
763  <td class='iright'>
764  <input type='checkbox' name='sys_opt[]' value='16' {$set_sys_opt[16]}>Web Only
765  </td>
766  </tr>
767  <tr>
768  <td class='iright'>
769  <input type='checkbox' name='sys_opt[]' value='32' {$set_sys_opt[32]}>Upgrade / Conversion
770  </td>
771  </tr>
772  <tr>
773  <td class='iright'>
774  <input type='checkbox' name='sys_opt[]' value='64' {$set_sys_opt[64]}>Closed CU
775  </td>
776  </tr>
777  <tr>
778  <td class='iright'>
779  <input type='checkbox' name='sys_opt[]' value='0' {$set_sys_opt[0]}>ALL
780  </td>
781  </tr>
782  <tr>
783  <td class='iright'>
784  <hr>
785  </td>
786  </tr>
787  <tr>
788  <td class='iright' >
789  <a href='javascript:Close_DropDown("ShowId");'>Close</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
790  <input type='submit' name='btnShowType' value='Show'>
791  </td>
792  </tr>
793  </table>
794  </form>
795  </div>
796 print_html;
797  cu_footer();
798  }
799 function spewmenu() {
800 # actual menu code is in menu.js
801 global $use_cookie, $PHP_SELF, $ivrHostName, $Hu, $infourl, $SYSENV, $link;
802  $checkhost = substr(strtolower($_SERVER['HTTP_HOST']),0,4);
803  $rdcinq=' <li>Mobile RDC Inquiry
804  <ul>
805  <li><a href="https://my.homecu.net/hcuadm/hcuRDCStatus.prg">Odyssey</a></li>
806  <li><a href="https://www3.homecu.net/hcuadm/hcuRDCStatus">Live (www3)</a></li>
807  <li><a href="https://www6.homecu.net/hcuadm/hcuRDCStatus">Live (www6)</a></li>
808  <li><a href="https://www5.homecu.net/hcuadm/hcuRDCStatus">Batch</a></li>
809  </ul>
810  </li>';
811  $loggingReportLink= "
812  <li>Vendor Logging Report
813  <ul>
814  <li><a href=\"https://my.homecu.net/hcuadm/loggingReport.prg\">Odyssey</a></li>
815  <li><a href=\"https://www3.homecu.net/hcuadm/loggingReport\">Live (www3)</a></li>
816  <li><a href=\"https://www6.homecu.net/hcuadm/loggingReport\">Live (www6)</a></li>
817  <li><a href=\"https://www5.homecu.net/hcuadm/loggingReport\">Batch</a></li>
818  </ul>
819  </li>";
820 
821  // Only show Translation Maintenance in devmode=1
822  $transAm = "";
823  if ($SYSENV['devmode'] == 1) {
824  $transAm = "<li><a href=\"hcuTransAm.prg?callback={$_SERVER["HTTP_HOST"]}\">Translation Maintenance</a></li>";
825  }
826 
827  $server = strtolower($_SERVER['HTTP_HOST']);
828 
829  $trustedReportLink = "<li><a href='TrustedReport.prg'>Trusted Vendor Report</a></li>";
830 
831  $billingMenu = CheckPerm($link, $Hu, "billing", $_SERVER['REMOTE_ADDR']) ? "<li><a href='/billing/index.prg'>Billing System</a></li>" : "";
832 
833 // This feature was taken out since not being implemented yet
834 // <li><a href="ProdImpStat">Product Feature Status</a></li>
835 //print '<div style="width:90%; margin-left:5%;">';
836 print <<< MENU
837 <ul id="menuChoices" style='display:none;'>
838  <li>Tools
839  <ul>
840  <li><a href="javascript:keywin()">Generate Key</a></li>
841  <li>Packet Tester
842  <ul>
843  <li><a href="javascript:pktwin('my')">Odyssey</a></li>
844  <li><a href="javascript:pktwin('www3')">www3</a></li>
845  <li><a href="javascript:pktwin('www6')">www6</a></li>
846  </ul>
847  </li>
848  <li><a href="quickedit.prg">Quick Edits</a></li>
849  <li><a href="javascript:hashwin()">Ticket Hashes</a></li>
850 
851  <li><a href="https://wiki.boi.homecu.int/">HomeCU Wiki</a></li>
852 
853  $transAm
854  $rdcinq
855  $loggingReportLink
856  $billingMenu
857  <li>App Report<ul><li><a href="appreport_gp_client.prg">Google Play</a></li></ul></li>
858  <li><a href="/hcuadm/mBroadcastEmail.prg">Broadcast Emails</a></li>
859  </ul>
860  </li>
861 
862  <li>Reports
863  <ul>
864  <li><a href="cuissues_report.prg">Current Jobs</a></li>
865  <li><a href="adm_reports.prg">Banking Reports</a></li>
866  <li><a href="stmnt_reports.prg">eStatement Reports</a></li>
867  <li><a href="info_reports.prg">Info Reports</a></li>
868  <li><a href="showflags.prg">Processing Flags</a></li>
869  <li><a href="showhavetrans.prg">Transaction Settings</a></li>
870  <li><a href="domain_email_report.prg">E-Mail Reporting</a></li>
871  <li><a href="miPayReport.prg">iPay Reporting</a></li>
872  <li>Alerts / Recur
873  <ul>
874  <li><a href="https://my.homecu.net/hcuadm/alertrecreport.prg">Odyssey</a></li>
875  <li><a href="https://www3.homecu.net/hcuadm/alertrecreport">www3</a></li>
876  <li><a href="https://www6.homecu.net/hcuadm/alertrecreport">www6</a></li>
877  </ul>
878  </li>
879  <li><a href="gatherlaststatus.prg">Last Live Status</a></li>
880  <li><a href="cuproduct_report.prg?show_product=1">Current CU Products</a></li>
881  <li><a href="https://{$ivrHostName}/hcuadm/ivr_report">IVR Report</a></li>
882  <li>Core Requests
883  <ul>
884  <li><a href="mCorerequestsReport.prg">Odyssey</a></li>
885  <li><a href="https://www3.homecu.net/hcuadm/corerequests_report">www3</a></li>
886  <li><a href="https://www6.homecu.net/hcuadm/corerequests_report">www6</a></li>
887  </ul>
888  </li>
889  $trustedReportLink
890  <li><a href="TrustedVendorByCu.prg">Vendor Report by CU</a></li>
891  </ul>
892 
893  </li>
894  <li>Tables
895  <ul>
896  <li><a href="cuinfoedit.prg">Add CU</a></li>
897  <li><a href="admin_msg.prg">Admin Messages</a></li>
898  <li><a href="cuprogmntc.prg">Admin Programs</a></li>
899  <li><a href="admin_survey.prg">Surveys</a></li>
900  <li><a href="cuquest.prg">Challenge Questions</a></li>
901  <li><a href="cuimage.prg">Image Vendors</a></li>
902  <li><a href="cuissuesmntc.prg">Maintain Job Templates</a></li>
903  <li><a href="hcuusers.prg">Monitor Users</a></li>
904  <li><a href="cusso.prg">SSO Vendors</a></li>
905  <li><a href="cutrans.prg">Transaction Codes</a></li>
906  <li><a href="cuvndr.prg">Vendors</a></li>
907  <li><a href="cutrustvendor.prg">Trusted Vendors</a></li>
908  <li><a href="hcu_prod_list.prg">Products</a></li>
909  <li><a href="lnappLookup.prg">Online Loan Lookups</a></li>
910  <li><a href="hcu_custom_mntc.prg">Custom Content Files</a></li>
911  <li><a href="mEstmntMntc.prg">eStatement Maintenance</a></li>
912  <li><a href="https://{$ivrHostName}/hcuadm/ivr_mntc_msg.prg">IVR Message Codes</a></li>
913  <li><a href="mFeatureLst.prg">Home CU Features</a></li>
914  </ul>
915  </li>
916 MENU;
917 
918 // if ($use_cookie) {
919  // * Print Reset Link for Cookie
920  print "<li><a href='$PHP_SELF?action=list&reset_cookie=1'>Reset Monitor View</a></li>";
921 // }
922 
923 // note: there is some pixel width used by a border or something
924 print <<<MENU
925  <li><a href="/hcuadm/hcu_logout.prg">Logoff Monitor</a></li>
926 </ul>
927 MENU;
928 
929 //print '</div>';
930 
931 }