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