Odyssey
hcuAccounts.prg
1 <?php
2 /*
3  * File: hcuAccounts
4  *
5  * Purpose: To show the accounts for the member. This will be the portal screen
6  * that gives them access to the History / Info Screens
7  *
8  */
9 
10 $serviceViewFromCUAdmin = (isset($serviceViewFromCUAdmin) ? $serviceViewFromCUAdmin : false);
11 
12 
13 // ** INCLUDE MAIN GLOBAL SCRIPT -- Handles security / global variable values
14 if (!$serviceViewFromCUAdmin) {
15  // ** SET SCRIPT LEVEL VARIABLES
16  $serviceShowInfo = true;
17  $serviceLoadMenu = true;
18  $serviceShowMenu = true;
19  $serviceLiveCheck = true;
20 
21 
22  require_once(dirname(__FILE__) . '/../library/hcuService.i');
23 
24  // ** INSERT BUSINESS LOGIC FOR THIS FORM
25  /*
26  * suspendNotices
27  *
28  * This flag allows an override to suspend the presentation of all NOTICES
29  * on the account screen. The main reason this is set is when we are unable
30  * to get NEW data from the core, and instead we received stale data, 200, 201, 202
31  * The member will be presented an alternate message in this case. To inform
32  * them of the issue
33  *
34  * This field may be modified in hcuPreContent when the packetStatus information
35  * is evaluated
36  */
37  $suspendNotices = false;
38 }
39 
40 /*
41  * ** CHECK USER FEATURE PERMISSIONS **
42  * NOTE: DOES NOT RETURN ON FAILURE
43  */
44 PermCheckFeatureScreen($dbh, $HB_ENV, $MC, FEATURE_BASIC);
45 
46 // ** Fetch ALL the balances for this member
47  // ** Do this prior to hcuPreContent so the packet information
48  // * can be loaded
49 $Get_Balances_ary = Get_Balances($dbh, $HB_ENV);
50 // ** SET VARIABLES FOR WEBSITE FLAGS
51 // ** INCLUDE PRE CONTENT SCRIPT
52 if (!$serviceViewFromCUAdmin) {
53  require_once(dirname(__FILE__) . '/../includes/hcuPreContent.i');
54 } else {
55  include_once('/home/httpd/hcuinc/adminc/viewMemberAcct.content');
56 }
57 /*
58  * NOTICE DECLARATION SECTION
59  *
60  * This section will be used to determine which notices will be shown to the
61  * member. This may include, survey, marketing, promo...
62  *
63  */
64 $initialPopup = "";
65 if (!$suspendNotices) {
66  /*
67  * Credit Union Notices/Mesages
68  * PROMO / SURVEY / MARKETING
69  *
70  * Load all the available types available.
71  */
72  $popupMsgCode = '';
73 
74  // ** PROMO MESSAGE
75  if (($HB_ENV['Fmsg_tx'] & 16384) == 16384) {
76  // ** Retrieve Promo Messages
77  $HB_ENV['messageSuppressPromo'] = true;
78  }
79  // ** SURVEY MESSAGE
80  if (($HB_ENV['Fmsg_tx'] & 8) == 8) {
81  $HB_ENV['messageSuppressSurvey'] = true;
82  }
83  // ** Marketing Message
84  if (($HB_ENV['Fmsg_tx'] & 256) == 256) {
85  $HB_ENV['messageSuppressMsg'] = true;
86  }
87 
88  $accountNoticesAry = Get_NoticeInfo($dbh, $HB_ENV, $MC, "D", "ALL", true);
89 
90  /**
91  *
92  * @param array $noticeAry - This is the direct array of the actual notice items
93  * @param string $aryKey - current index in the array for the item being walked through
94  * @param array $accountNoticesAry -- REFERENCE to the original base array --
95  * used to create a structured array of the different types.
96  * be sure to call this item with the & to specify reference
97  *
98  * NO RETURN -- Changes made by reference
99  */
100  $filterNoticeType = function ($noticeAry, $aryKey) use (&$accountNoticesAry) {
101  // ** All Surveys are popup,
102  // ** marketing messages are decided based on the balances screen option
103  // ** Ignore any message with notice_popup set to -1
104  if ($noticeAry['notice_popup'] >= 0) {
105  $accountNoticesAry[$noticeAry['notice_type']][($noticeAry['notice_type'] == 'M' ? ($noticeAry['notice_popup'] == 1 ? 'popup' : 'embed') : 'popup')][] = $noticeAry;
106  }
107  };
108 
109 
110  // *** WALK through the available and separate into their different categories
111  array_walk($accountNoticesAry['notice'], $filterNoticeType);
112  $nextPopupChain = Array();
113 
114  // ** Check for Promo Message, ALL WILL BE SHOWN
115  $countPromoMsg = !empty( $accountNoticesAry['C'] ) ? count($accountNoticesAry['C']['popup']) : 0;
116  $hasPromoPopup= false;
117  if ($countPromoMsg > 0) {
118  $noticePromoURL = Array();
119  for ($msgIdx = 0; $msgIdx < $countPromoMsg; $msgIdx++) {
120  $promoFuncName = "showPromo{$msgIdx}";
121 
122  // ** Create Popup link for the survey
123  $promoOption = $accountNoticesAry['C']['popup'][$msgIdx];
124 
125  $promoOptions = Array (
126  'docsid' => $promoOption['notice_id'],
127  'docstype' => $promoOption['notice_type'],
128  'device' => 'D',
129  'noticeOnly' => $promoOption["notice_subtype"] == "P" ? "1" : "0",
130  'expireTime' => mktime() + 86400
131  );
132 
133  $encryptedDocDetails= HCU_PayloadEncode($HB_ENV['Cu'], $promoOptions);
134 
135  $noticePromoURL[] = $HB_ENV['homebankingpath'] . '/hcuViewNotice.prg?cu=' . $HB_ENV['cu'] . '&x=' . urlencode($encryptedDocDetails);
136 
137  // * Set Either the initial popup to function. or the function chain
138  if($initialPopup == '') {
139  $initialPopup = $promoFuncName . '()';
140  } else {
141  $nextPopupChain[] = ", {$promoFuncName}";
142  }
143  }
144 
145  $hasPromoPopup = true;
146  }
147 
148 
149  // ** CHECK FOR POPUP SURVEY
150  $countPopupSurvey = !empty($accountNoticesAry['S']) ? count($accountNoticesAry['S']['popup']) : 0;
151  $hasSurveyPopup = false;
152  if ($countPopupSurvey > 0) {
153  if ($countPopupSurvey > 1) {
154  $randSurveyIdx = rand(0, $countPopupSurvey - 1);
155  } else {
156  $randSurveyIdx = 0;
157  }
158 
159  // ** Create Popup link for the survey
160  $surveyOption = $accountNoticesAry['S']['popup'][$randSurveyIdx];
161 
162  $surveyOptions = Array (
163  'docsid' => $surveyOption['notice_id'],
164  'docstype' => $surveyOption['notice_type'],
165  'device' => 'D',
166  'noticeOnly' => '0',
167  'expireTime' => mktime() + 86400
168  );
169 
170  $encryptedDocDetails= HCU_PayloadEncode($HB_ENV['Cu'], $surveyOptions);
171 
172  $hasSurveyPopup = true;
173  $noticeSurveyURL = $HB_ENV['homebankingpath'] . '/hcuViewNotice.prg?cu=' . $HB_ENV['cu'] . '&x=' . urlencode($encryptedDocDetails);
174 
175  if ($initialPopup == '') {
176  $initialPopup = 'showSurvey();';
177  } else {
178  $nextPopupChain[] = ", showSurvey";
179  }
180  }
181  // ** CHECK FOR MARKETING MESSAGE POPUP
182  $countPopupMktMsg = !empty( $accountNoticesAry['M'] ) ? (HCU_array_key_exists('popup', $accountNoticesAry['M']) ? count($accountNoticesAry['M']['popup']) : 0) : 0;
183 
184  $hasMktMsgPopup = false;
185  if ($countPopupMktMsg > 0) {
186  if ($countPopupMktMsg > 1) {
187  $randMktMsgIdx = rand(0, $countPopupMktMsg - 1);
188  } else {
189  $randMktMsgIdx = 0;
190  }
191 
192  // ** Create Popup link for the survey
193  $messageOption = $accountNoticesAry['M']['popup'][$randMktMsgIdx];
194 
195  $messageOptions = Array (
196  'docsid' => $messageOption['notice_id'],
197  'docstype' => $messageOption['notice_type'],
198  'device' => 'D',
199  'noticeOnly' => '0',
200  'expireTime' => mktime() + 86400
201  );
202 
203  $encryptedDocDetails= HCU_PayloadEncode($HB_ENV['Cu'], $messageOptions);
204 
205  $hasMktMsgPopup = true;
206  $noticeMktMsgURL = $HB_ENV['homebankingpath'] . '/hcuViewNotice.prg?cu=' . $HB_ENV['cu'] . '&x=' . urlencode($encryptedDocDetails);
207 
208  if ($initialPopup == '') {
209  $initialPopup = 'showMktMsg();';
210  } else {
211  $nextPopupChain[] = ", showMktMsg";
212  }
213  }
214  // ** Find a Marketing Message to Display
215  if (HCU_array_key_exists('M', $accountNoticesAry)) {
216  $countEmbedMsg = count($accountNoticesAry['M']['embed']);
217  } else {
218  $countEmbedMsg = 0;
219  }
220  $showEmbedMsg = "";
221  if ($countEmbedMsg > 0) {
222  // Now find a random marketing message
223  if ($countEmbedMsg > 1) {
224  $randMsgIdx = rand(0, $countEmbedMsg - 1);
225  } else {
226  $randMsgIdx = 0;
227  }
228  // * we now have a marketing message to display - see if user clicked "Close" this session
229  $displayStart = ( $HB_ENV["Fmsg_tx"] & 0x8000 ) ? "display:none;" : "display:block;";
230 
231  /* Create a template for showing the marketing message */
232  $showEmbedMsg = "
233  <a id='slide-in-handle' class='hcu-slide-in-handle-custom' href='#'>&nbsp;<span id='slide-in-handle-content'>{$accountNoticesAry['M']['embed'][$randMsgIdx]['notice_title']}</span>&nbsp;</a>
234  <div id='slide-in-share' style='$displayStart'>
235  <div id='slide-in-content'>
236  <div id='slide-in-scroll'></div>
237  <div id='slide-in-content-close'><a href=''>Close</a></div>
238  </div>
239  </div>
240  <div class='col-xs-12 local-notify-spacer'>
241  </div>";
242  /* Save the message to be set in script later */
243  $showEmbedMsgContent = $accountNoticesAry['M']['embed'][$randMsgIdx]['notice_text'];
244  // ** Print the template
245  print $showEmbedMsg;
246  if ($initialPopup == '') {
247  $initialPopup = 'showMsgInset();';
248  } else {
249  $nextPopupChain[] = ", showMsgInset";
250  }
251 
252  }
253 
254 }
255 /*
256  * END OF NOTICE DECLARATION SECTION
257  */
258 ?>
259 
260 <div id="acctList" class="k-content" style="font-size: 12px;">
261 
262 <?php
263 
264 /*
265  * ** START CONTENT
266  */
267 
268 /*
269  * FOR Purposes of retrieving the credit cards, I need to fetch the ccinfourl.
270  * this value will be used to determine if I will be showing the 'Click for Activity'
271  * on the Credit Card table. It will only affect CC table, and ALL OR NOTHING
272  */
273 $sql = "SELECT ccinfourl
274  FROM cuadmin
275  WHERE cu = '{$HB_ENV['Cu']}' ";
276 
277 $sth = db_query($sql, $dbh);
278 if ($sth) { list($hisinfo) = db_fetch_array($sth, 0); }
279 $showCCActivity = !(trim($hisinfo) == '');
280 
281 
282 /*
283  * Display Fields
284  * PRIMARY KEY -- This is the corresponding key from the Get_Balances function
285  * {'dp', 'ln', 'cc'}
286  * -- acct_history - {true, false} -- Does the account specified
287  * have account Activity {true} OR
288  * Account does not have ANY activity, do not show the
289  * tooltip or activity link {false}
290  * Array of Arrays {'disp_title', 'disp_fieldname', 'disp_format'}
291  * -- disp_title - this is the display title for the field
292  * -- disp_fieldname - this is the fieldname corresponding to the Get_Balances
293  * array that is returned
294  * -- disp_format - IN MOBILE -- THIS WAS A FUNCTION -- In this script
295  * we are able to use the Kendo Formatting. This will simply be the type of
296  * formatting to be done to the data field. PHP does not need to do the formatting
297  * will be used to format the data
298  * FORMATS ARE
299  *
300  * -- disp_type -- This describes the type of display for this field options are :
301  * label - the information ONLY used the disp_fieldname and is displayed within an <h3>
302  * block - the information will show up using a block format, both the title and fieldname are used
303  *
304  * -- disp_OnBalances -- Does this field show up on the Balances screen {true, false}
305  *
306  * -- disp_OnDetails -- Does this field show up on the Details screen {true, false}
307  */
308 $Disp_Balances_ary = Array (
309  "dp" => Array(
310  "acct_title" => $MC->msg("Deposit Balances", HCU_DISPLAY_AS_HTML),
311  "acct_history" => true,
312  "fields" => Array(
313  "displaydesc" => Array(
314  "disp_title" => $MC->msg("Description", HCU_DISPLAY_AS_JS),
315  "disp_fieldname" => "displaydesc",
316  "disp_format" => "FormatText",
317  "disp_footerTmpl" => "count",
318  "disp_type" => "label",
319  "disp_OnBalances" => true,
320  "disp_OnDetails" => true,
321  "disp_OnWidth" => "0"),
322  "description" => Array(
323  "disp_title" => $MC->msg("Description", HCU_DISPLAY_AS_JS),
324  "disp_fieldname" => "description",
325  "disp_format" => "FormatText",
326  "disp_type" => "block",
327  "disp_OnBalances" => false,
328  "disp_OnDetails" => true,
329  "disp_OnWidth" => "12000"),
330  "currentbal" => Array(
331  "disp_title" => $MC->msg('Current', HCU_DISPLAY_AS_JS),
332  "disp_fieldname" => "currentbal",
333  "disp_format" => "FormatCurrency",
334  "disp_footerTmpl" => "sum",
335  "disp_type" => "block",
336  "disp_OnBalances" => true,
337  "disp_OnDetails" => true,
338  "disp_OnWidth" => "0"),
339  "availablebal" =>Array(
340  "disp_title" => $MC->msg('Available', HCU_DISPLAY_AS_JS),
341  "disp_fieldname" => "availablebal",
342  "disp_format" => "FormatCurrency",
343  "disp_footerTmpl" => "sum",
344  "disp_type" => "block",
345  "disp_OnBalances" => ($HB_ENV['Fset'] & GetFlagsetValue('CU_SHOWAVAILABLE')),
346  "disp_OnDetails" => ($HB_ENV['Fset'] & GetFlagsetValue('CU_SHOWAVAILABLE')),
347  "disp_OnWidth" => "0"),
348  "ytdinterest" => Array(
349  "disp_title" => $MC->msg('YTD Dividend', HCU_DISPLAY_AS_JS),
350  "disp_fieldname" => "ytdinterest",
351  "disp_format" => "FormatCurrency",
352  "disp_type" => "block",
353  "disp_OnBalances" => false,
354  "disp_OnDetails" => true,
355  "disp_OnWidth" => "12000"),
356  "lastyrinterest" => Array(
357  "disp_title" => $MC->msg('Prior Yr Dividend', HCU_DISPLAY_AS_JS),
358  "disp_fieldname" => "lastyrinterest",
359  "disp_format" => "FormatCurrency",
360  "disp_type" => "block",
361  "disp_OnBalances" => false,
362  "disp_OnDetails" => true,
363  "disp_OnWidth" => "12000"),
364  "hisinfo" => Array(
365  "disp_title" => 'hisinfo',
366  "disp_fieldname" => 'hisinfo',
367  "disp_format" => "FormatText",
368  "disp_type" => "block",
369  "disp_OnBalances" => false,
370  "disp_OnDetails" => false,
371  "disp_OnWidth" => "12000"),
372  "as_of_date" => Array(
373  "disp_title" => 'as_of_date',
374  "disp_fieldname" => 'as_of_date',
375  "disp_format" => "FormatText",
376  "disp_type" => "block",
377  "disp_OnBalances" => false,
378  "disp_OnDetails" => false,
379  "disp_OnWidth" => "12000")
380  )
381 ),
382  "ln" => Array(
383  "acct_title" => $MC->msg("Loan Balances", HCU_DISPLAY_AS_HTML),
384  "acct_history" => true,
385  "fields" => Array(
386  "displaydesc" => Array(
387  "disp_title" => $MC->msg("Description", HCU_DISPLAY_AS_JS),
388  "disp_fieldname" => "displaydesc",
389  "disp_format" => "FormatText",
390  "disp_footerTmpl" => "count",
391  "disp_type" => "label",
392  "disp_OnBalances" => true,
393  "disp_OnDetails" => true,
394  "disp_OnWidth" => "0"),
395  "description" => Array(
396  "disp_title" => $MC->msg("Description", HCU_DISPLAY_AS_JS),
397  "disp_fieldname" => "description",
398  "disp_format" => "FormatText",
399  "disp_type" => "block",
400  "disp_OnBalances" => true,
401  "disp_OnDetails" => true,
402  "disp_OnWidth" => "12000"),
403  "currentbal" => Array(
404  "disp_title" => $MC->msg('Balance', HCU_DISPLAY_AS_JS),
405  "disp_fieldname" => "currentbal",
406  "disp_format" => "FormatCurrency",
407  "disp_footerTmpl" => "sum",
408  "disp_type" => "block",
409  "disp_OnBalances" => true,
410  "disp_OnDetails" => true,
411  "disp_OnWidth" => "0"),
412  "paymentamount" => Array(
413  "disp_title" => $MC->msg('Payment', HCU_DISPLAY_AS_JS),
414  "disp_fieldname" => "paymentamount",
415  "disp_format" => "FormatCurrency",
416  "disp_type" => "block",
417  "disp_OnBalances" => true,
418  "disp_OnDetails" => true,
419  "disp_OnWidth" => "0"),
420  "interestrate" => Array(
421  "disp_title" => $MC->msg('Interest Rate', HCU_DISPLAY_AS_JS),
422  "disp_fieldname" => "interestrate",
423  "disp_format" => "FormatPercent",
424  "disp_type" => "block",
425  "disp_OnBalances" => false,
426  "disp_OnDetails" => true,
427  "disp_OnWidth" => "12000"),
428  "nextduedate" => Array(
429  "disp_title" => $MC->msg('Next Due', HCU_DISPLAY_AS_JS),
430  "disp_fieldname" => "nextduedate",
431  "disp_format" => "FormatDatePast",
432  "disp_type" => "block",
433  "disp_OnBalances" => true,
434  "disp_OnDetails" => true,
435  "disp_OnWidth" => "0"),
436  "payoff" => Array(
437  "disp_title" => ((($HB_ENV['Fset2'] & GetFlagsetValue("CU2_10DAYPAY")) == GetFlagsetValue("CU2_10DAYPAY")) ? $MC->msg("Todays Payoff", HCU_DISPLAY_AS_JS) : $MC->msg('Payoff', HCU_DISPLAY_AS_JS)),
438  "disp_fieldname" => "payoff",
439  "disp_format" => ((($HB_ENV['Fset2'] & GetFlagsetValue("CU2_CALL_PAYOFF"))==GetFlagsetValue("CU2_CALL_PAYOFF")) ? 'FormatText' : 'FormatCurrency'),
440  "disp_type" => "block",
441  "disp_OnBalances" => false,
442  "disp_OnDetails" => true,
443  "disp_OnWidth" => "12000"),
444  "creditlimit" => Array(
445  "disp_title" => $MC->msg('Limit', HCU_DISPLAY_AS_JS),
446  "disp_fieldname" => "creditlimit",
447  "disp_format" => "FormatCurrency",
448  "disp_type" => "block",
449  "disp_OnBalances" => false,
450  "disp_OnDetails" => true,
451  "disp_OnWidth" => "12000"),
452  "availablebal" => Array(
453  "disp_title" => $MC->msg('Available', HCU_DISPLAY_AS_JS),
454  "disp_fieldname" => "availablebal",
455  "disp_format" => "FormatCurrency",
456  "disp_footerTmpl" => "sum",
457  "disp_type" => "block",
458  "disp_OnBalances" => false,
459  "disp_OnDetails" => ($HB_ENV['Fset'] & GetFlagsetValue('CU_SHOWAVAILABLE')),
460  "disp_OnWidth" => "12000"),
461  "tenday" => Array(
462  "disp_title" => $MC->msg('Ten-days', HCU_DISPLAY_AS_JS) . ' ' . $MC->msg('Payoff', HCU_DISPLAY_AS_JS),
463  "disp_fieldname" => "tenday",
464  "disp_format" => 'FormatCurrency',
465  "disp_type" => "block",
466  "disp_OnBalances" => false,
467  "disp_OnDetails" => true,
468  "disp_OnWidth" => "12000"),
469  "ytdinterest" => Array(
470  "disp_title" => $MC->msg('YTD Dividend', HCU_DISPLAY_AS_JS),
471  "disp_fieldname" => "ytdinterest",
472  "disp_format" => "FormatCurrency",
473  "disp_type" => "block",
474  "disp_OnBalances" => false,
475  "disp_OnDetails" => true,
476  "disp_OnWidth" => "12000"),
477  "lastyrinterest" => Array(
478  "disp_title" => $MC->msg('Prior Yr Dividend', HCU_DISPLAY_AS_JS),
479  "disp_fieldname" => "lastyrinterest",
480  "disp_format" => "FormatCurrency",
481  "disp_type" => "block",
482  "disp_OnBalances" => false,
483  "disp_OnDetails" => true,
484  "disp_OnWidth" => "12000"),
485  "pastdue" => Array(
486  "disp_title" => 'pastdue',
487  "disp_fieldname" => 'pastdue',
488  "disp_format" => "FormatText",
489  "disp_type" => "block",
490  "disp_OnBalances" => false,
491  "disp_OnDetails" => false,
492  "disp_OnWidth" => "12000"),
493  "hisinfo" => Array(
494  "disp_title" => 'hisinfo',
495  "disp_fieldname" => 'hisinfo',
496  "disp_format" => "FormatText",
497  "disp_type" => "block",
498  "disp_OnBalances" => false,
499  "disp_OnDetails" => false,
500  "disp_OnWidth" => "12000"),
501  "as_of_date" => Array(
502  "disp_title" => 'as_of_date',
503  "disp_fieldname" => 'as_of_date',
504  "disp_format" => "FormatText",
505  "disp_type" => "block",
506  "disp_OnBalances" => false,
507  "disp_OnDetails" => false,
508  "disp_OnWidth" => "12000")
509  )
510 ),
511  "cc" => Array(
512  "acct_title" => $MC->msg("Credit Card Balances", HCU_DISPLAY_AS_HTML),
513  "acct_history" => $showCCActivity,
514  "fields" => Array(
515  "displaydesc" => Array(
516  "disp_title" => $MC->msg("Description", HCU_DISPLAY_AS_JS),
517  "disp_fieldname" => "displaydesc",
518  "disp_format" => "FormatText",
519  "disp_footerTmpl" => "count",
520  "disp_type" => "label",
521  "disp_OnBalances" => true,
522  "disp_OnDetails" => true,
523  "disp_OnWidth" => "0"),
524  "description" => Array(
525  "disp_title" => $MC->msg("Description", HCU_DISPLAY_AS_JS),
526  "disp_fieldname" => "description",
527  "disp_format" => "FormatText",
528  "disp_type" => "block",
529  "disp_OnBalances" => false,
530  "disp_OnDetails" => true,
531  "disp_OnWidth" => "12000"),
532  "currentbal" => Array(
533  "disp_title" => $MC->msg('Current Bal', HCU_DISPLAY_AS_JS),
534  "disp_fieldname" => "currentbal",
535  "disp_format" => "FormatCurrency",
536  "disp_footerTmpl" => "sum",
537  "disp_type" => "block",
538  "disp_OnBalances" => true,
539  "disp_OnDetails" => true,
540  "disp_OnWidth" => "0"),
541  "availablebal" => Array(
542  "disp_title" => $MC->msg('Available', HCU_DISPLAY_AS_JS),
543  "disp_fieldname" => "availablebal",
544  "disp_format" => ((($HB_ENV['Fset2'] & GetFlagsetValue("CU2_CALL_CCAVAIL"))==GetFlagsetValue("CU2_CALL_CCAVAIL")) ? 'FormatText' : 'FormatCurrency'),
545  "disp_footerTmpl" => "sum",
546  "disp_type" => "block",
547  "disp_OnBalances" => ($HB_ENV['Fset'] & GetFlagsetValue('CU_SHOWAVAILABLE')),
548  "disp_OnDetails" => ($HB_ENV['Fset'] & GetFlagsetValue('CU_SHOWAVAILABLE')),
549  "disp_OnWidth" => "12000"),
550  "paymentamount" => Array(
551  "disp_title" => $MC->msg('Min Due', HCU_DISPLAY_AS_JS),
552  "disp_fieldname" => "paymentamount",
553  "disp_format" => "FormatCurrency",
554  "disp_type" => "block",
555  "disp_OnBalances" => true,
556  "disp_OnDetails" => true,
557  "disp_OnWidth" => "0"),
558  "lastpaymentdate" => Array(
559  "disp_title" => $MC->msg('Last Paid', HCU_DISPLAY_AS_JS),
560  "disp_fieldname" => "lastpaymentdate",
561  "disp_format" => "FormatDate",
562  "disp_type" => "block",
563  "disp_OnBalances" => false,
564  "disp_OnDetails" => true,
565  "disp_OnWidth" => "12000"),
566  "nextduedate" => Array(
567  "disp_title" => $MC->msg('Next Due', HCU_DISPLAY_AS_JS),
568  "disp_fieldname" => "nextduedate",
569  "disp_format" => "FormatDatePast",
570  "disp_type" => "block",
571  "disp_OnBalances" => true,
572  "disp_OnDetails" => true,
573  "disp_OnWidth" => "0"),
574  "creditlimit" => Array(
575  "disp_title" => $MC->msg('Limit', HCU_DISPLAY_AS_JS),
576  "disp_fieldname" => "creditlimit",
577  "disp_format" => "FormatCurrency",
578  "disp_type" => "block",
579  "disp_OnBalances" => false,
580  "disp_OnDetails" => true,
581  "disp_OnWidth" => "12000"),
582  "interestrate" => Array(
583  "disp_title" => $MC->msg('Interest Rate', HCU_DISPLAY_AS_JS),
584  "disp_fieldname" => "interestrate",
585  "disp_format" => "FormatPercent",
586  "disp_type" => "block",
587  "disp_OnBalances" => false,
588  "disp_OnDetails" => true,
589  "disp_OnWidth" => "12000"),
590  "ytdinterest" => Array(
591  "disp_title" => $MC->msg('YTD Dividend', HCU_DISPLAY_AS_JS),
592  "disp_fieldname" => "ytdinterest",
593  "disp_format" => "FormatCurrency",
594  "disp_type" => "block",
595  "disp_OnBalances" => false,
596  "disp_OnDetails" => true,
597  "disp_OnWidth" => "12000"),
598  "lastyrinterest" => Array(
599  "disp_title" => $MC->msg('Prior Yr Dividend', HCU_DISPLAY_AS_JS),
600  "disp_fieldname" => "lastyrinterest",
601  "disp_format" => "FormatCurrency",
602  "disp_type" => "block",
603  "disp_OnBalances" => false,
604  "disp_OnDetails" => true,
605  "disp_OnWidth" => "12000"),
606  "pastdue" => Array(
607  "disp_title" => 'pastdue',
608  "disp_fieldname" => 'pastdue',
609  "disp_format" => "FormatText",
610  "disp_type" => "block",
611  "disp_OnBalances" => false,
612  "disp_OnDetails" => false,
613  "disp_OnWidth" => "12000"),
614  "hisinfo" => Array(
615  "disp_title" => 'hisinfo',
616  "disp_fieldname" => 'hisinfo',
617  "disp_format" => "FormatText",
618  "disp_type" => "block",
619  "disp_OnBalances" => false,
620  "disp_OnDetails" => false,
621  "disp_OnWidth" => "12000"),
622  "as_of_date" => Array(
623  "disp_title" => 'as_of_date',
624  "disp_fieldname" => 'as_of_date',
625  "disp_format" => "FormatText",
626  "disp_type" => "block",
627  "disp_OnBalances" => false,
628  "disp_OnDetails" => false,
629  "disp_OnWidth" => "12000")
630  )
631  )
632 );
633 
634 /**
635  * displayJsonData
636  * This is the data to be loaded by the kendo grids
637  * There will be multiple keys
638  * dp - Deposit Accounts
639  * ln - Loan Accounts
640  * cc - Credit Cards
641  * Each row will have the data to load for its type of accounts
642  */
643 $displayJsonData = Array();
644 /**
645  * displayRowTemplate
646  * This is the row template for the row. It will define which columns
647  * are visible to user and how the data is formatted.
648  */
649 $displayRowTemplate = Array();
650 /**
651  * displayConfiguredCols
652  * This is a join between the Disp_Balances_ary and the Get_Balances_ary for
653  * a certain account type.
654  * It should show the columns that are configured to be shown for the user
655  *
656  * There will be a key set for each type
657  * dp - Deposit Accounts
658  * ln - Loan Accounts
659  * cc - Credit Cards
660  *
661  */
662 $displayConfiguredCols = Array();
663 
664 if ($Get_Balances_ary['status']['code'] == '000') {
665  // ** WE HAVE DATA
666  foreach (array_keys($Disp_Balances_ary) as $disp_key ) {
667  // ** Loop through the DISPLAY Array , each section {dp, ln, cc} is a distinct
668  // HTML table to be displayed
669  $acct_cnt = 0;
670  $rowIdx = 0;
671  if (HCU_array_key_exists($disp_key, $Get_Balances_ary)) {
672  if (!is_null($Get_Balances_ary[$disp_key])) {
673  // ** The Member has accounts of this type.
674  // SO we start/end the table
675 
676  if (is_array($Get_Balances_ary[$disp_key]) === true) {
677 
678  foreach ($Get_Balances_ary[$disp_key] as $acctID => $acctRow) {
679  /*
680  * ODYSSEY RULES -
681  * view_balances - (true - normal view ),
682  * (false - don't show the row)
683  * view_transactions - (true - normal view),
684  * (false - don't allow them to click for history)
685  */
686  if (HCU_array_key_value('view_balances', $acctRow)) {
687  $displayJsonData[$disp_key][] = array_merge(Array("localRowIdx"=>$rowIdx++,"localaccountkey"=>hcu_encrypturl($acctID, $HB_ENV['historyHash']),"localaccounttype"=>$disp_key), $acctRow);
688 
689  // ** For each type.. here I need to check to see if columns are configured for the Credit Union
690  if (!HCU_array_key_exists($disp_key, $displayConfiguredCols)) {
691  $displayConfiguredCols[$disp_key] = array_intersect(array_keys($acctRow), array_keys($Disp_Balances_ary[$disp_key]['fields']));
692  }
693 
694  }
695  }
696  // ** There are rows present..
697 
698  }
699  }
700  }
701  }
702 } else {
703  // ** Error retrieving the data
704 }?>
705 
706 <style>
707 
708 [id^="hcuTable"] .k-grid-header .k-header {
709  text-align: center;
710 }
711 #slide-in-scroll {
712  overflow: scroll;
713 }
714 #slide-in-content {
715  display: table-cell;
716  vertical-align: middle;
717  padding: 10px;
718 }
719 #slide-in-content-close {
720  text-align: left;
721  display: table-row;
722  height:20px;
723 }
724 #slide-in-content-close a {
725  margin: 0 10px 10px 0;
726  text-decoration: underline;
727  font-weight: bold;
728  color: #333;
729  padding-left: 10px;
730 }
731 #slide-in-content-close a:visited,
732 #slide-in-content-close a:hover {
733  text-decoration: none;
734 }
735 #slide-in-share {
736  position: absolute;
737  top: 0px;
738  width: 100%;
739  z-index: 99;
740  background-color: #FAFAFA;
741  display: table;
742  box-shadow: 0px 0px 2px 0px #999 inset;
743  -webkit-box-shadow: 0px 0px 2px 0px #999 inset;
744 }
745 .slide-in-handle-icon {
746  color: #FFF;
747 }
748 #slide-in-handle {
749  position: absolute;
750  width: calc(100% - 10px);
751  display: block;
752  height: 25px;
753  border-top: 0;
754  padding: 5px;
755  top:0px;
756  text-align:center;
757  text-decoration: none;
758  z-index: 90;
759 
760 }
761 
762 #slide-in-handle-content {
763  font-size: 1.2em;
764  margin: 0px 1px 1px 1px;
765  height:19px;
766  padding-top: 4px;
767  text-decoration: underline;
768 }
769 #slide-in-share + #formStatus + #acctList {
770  /* IF there is a embedded mkt message, then adjust by using the css sibling selector */
771  margin-top: 15px;
772 }
773 .local-homecu-info {
774  color: rgba(0, 0, 0, .54);
775 }
776 .local-notify-spacer {
777  height: 35px;
778 }
779 @media (max-width: 767px) {
780  #slide-in-handle {
781  top: 51px;
782  }
783  #slide-in-share {
784  top: 51px;
785  }
786 
787  #body-wrapper.no-show-info #slide-in-handle, #body-wrapper.no-show-info #slide-in-share {
788  top: 135px;
789  }
790 
791  #homecuBannerArea + #body-wrapper #slide-in-handle, #homecuBannerArea + #body-wrapper #slide-in-share {
792  top: 51px;
793  }
794 
795  #homecuBannerArea + #body-wrapper.no-show-info #slide-in-handle, #homecuBannerArea + #body-wrapper.no-show-info #slide-in-share {
796  top: 135px;
797  }
798 }
799 </style>
800 <script >
801 var hcuDataConfig = <?php echo HCU_JsonEncode($displayConfiguredCols); ?>;
802 var hcuDatadp = <?php echo HCU_JsonEncode(HCU_array_key_value('dp', $displayJsonData)); ?>;
803 var hcuDatacc = <?php echo HCU_JsonEncode(HCU_array_key_value('cc', $displayJsonData)); ?>;
804 var hcuDataln = <?php echo HCU_JsonEncode(HCU_array_key_value('ln', $displayJsonData)); ?>;
805 
806 var hcuPendDs;
807 var expandedRow;
808 
809 <?php
810 /*
811 * Loop through the available account types {dp, ln, cc}
812 * Then loop through each of these lists in the returned data
813 * FOR EACH of these accounts I need to lookup the holds/pending/request info
814 */
815 ?>
816 var hcuDataPend = <?php
817  $pendingItemsData = Array();
818  foreach (array_keys($Disp_Balances_ary) as $acctType) {
819  if (HCU_array_key_exists($acctType, $Get_Balances_ary)) {
820  foreach (array_keys($Get_Balances_ary[$acctType]) as $acctKey) {
821  $getHPRHistoryAry = Get_AccountHPRDetails($dbh, $HB_ENV, $MC, $acctKey);
822  if (count($getHPRHistoryAry['holds']) > 0 || count($getHPRHistoryAry['pending']) > 0 || count($getHPRHistoryAry['requests']) > 0 ) {
823  foreach($getHPRHistoryAry as $pendType => $pendItems) {
824  if (count($pendItems) > 0) {
825  foreach ($pendItems as $pendDetail) {
826  if ($pendType == "holds") {
827  $listDate = $pendDetail['postdate'];
828  } else {
829  $listDate = "Pending";
830  }
831  $pendingItemsData[hcu_encrypturl($acctKey, $HB_ENV['historyHash'])][] = Array("pendDate" => $listDate, "pendDesc" => hcu_displayHtml($pendDetail['description']), "pendAmt" => $pendDetail['amount']);
832 
833  }
834  }
835  }
836  }
837  }
838  }
839  }
840 print HCU_JsonEncode($pendingItemsData);
841 ?>;
842 
843 $(document).ready(function(){
844 
845  // CLICK TO CLOSE POPUP, MUST CANCEL CHANGES BEFORE CLOSE
846  $(document).on('click', '.k-overlay', function() {
847  var wnd = $("#detailsPopUp").data("kendoWindow");
848  if (wnd !== undefined) {
849  wnd.close();
850  }
851  });
852 
853 <?php
854 
855 /*
856  * * BUILD EACH ACCOUNT TYPE kendo grid definition
857  *
858  */
859 foreach(array_keys($Disp_Balances_ary) as $acctType) {
860  // Loop through the keys {dp, ln, cc}
861  if (HCU_array_key_exists($acctType, $displayJsonData)) {
862  // displayJsonData will ONLY be set if rows were found...
863  // ** SO I want to display the table for this type..
864 ?>
865 
866  function htmlUnescape(str){
867  return str
868  .replace(/&quot;/g, '"')
869  .replace(/&#039;/g, "'")
870  .replace(/&lt;/g, '<')
871  .replace(/&gt;/g, '>')
872  .replace(/&amp;/g, '&');
873  }
874 
875  // MOBILE TABLES
876  $('#hcuMobileTable<?php echo $acctType; ?>').kendoGrid({
877  dataSource: {
878  data: hcuData<?php echo $acctType; ?>
879  },
880  rowTemplate: kendo.template($('#hcuDataMobileRow').html()),
881  altRowTemplate: kendo.template($('#hcuDataMobileRow').html()),
882  change: onChangeMobile,
883  selectable: 'cell',
884  scrollable: false,
885  pageable: false,
886  dataBound: function () {
887 
888  var titleActivity = "<?php echo $MC->msg("See Activity For", HCU_DISPLAY_AS_JS); ?>";
889  var titleDetails = "<?php echo $MC->msg("Open for Details", HCU_DISPLAY_AS_JS); ?>";
890  $('#hcuMobileTable<?php echo $acctType;?> table tbody tr').each(function(i) {
891 
892  // grid data
893  var grid = $("#hcuMobileTable<?php echo $acctType;?>").data("kendoGrid");
894  var gridRow = $(this);
895  var gridItem = grid.dataItem(gridRow);
896  var desc = htmlUnescape(gridItem.displaydesc);
897 
898  if ( gridItem.restrictions != "L" ) {
899  // set tooltips
900  $(this).find("td").each(function(j) {
901  if (j == 0) {
902  $(this).attr("title", titleDetails + " on " + desc);
903  $(this).find("a").attr("title", titleDetails).css("cursor", "pointer");
904  } else {
905  $(this).attr("title", titleActivity + " " + desc);
906  }
907 
908  });
909  }
910  });
911  },
912  columns: [
913  {
914  field: "displaydesc",
915  title: "Description"
916  },
917  {
918  command: { name: "showDetailsMobile", click: showDetailsMobile }, title: " ", width: 50
919  }
920  ]
921  }).data("kendoGrid");
922 
923  // DESKTOP TABLES
924  $('#hcuTable<?php echo $acctType;?>').kendoGrid({
925  dataSource: {
926  data: hcuData<?php echo $acctType; ?>,
927  pageable: false,
928  schema: {
929  model: {
930  fields: {
931  <?php
932  $dsFieldsList = Array();
933  foreach ($Disp_Balances_ary[$acctType]['fields'] as $fieldInfo) {
934  // ** Build an array with the information, then I will IMPLODE the array with commas creating the list
935 
936  switch ($fieldInfo['disp_format']) {
937  case 'FormatCurrency':
938  case 'FormatPercent':
939  $fieldFormat = 'number';
940  break;
941  case 'FormatDate':
942  case 'FormatDatePast':
943  $fieldFormat = 'date';
944  break;
945  default:
946  $fieldFormat = 'string';
947  }
948  $dsFieldsList[] = "{$fieldInfo['disp_fieldname']}: {type: \"{$fieldFormat}\"}";
949  }
950  print implode(",", $dsFieldsList);
951  ?>
952  }
953  }
954  },
955  aggregate: [
956  {field: "displaydesc", aggregate: "count"},
957  {field: "currentbal", aggregate: "sum"},
958  {field: "availablebal", aggregate: "sum"}
959  ]
960  },
961  sortable: {
962  mode: "single",
963  allowUnsort: false
964  },
965  rowTemplate: kendo.template($('#hcuDataRow').html()),
966  scrollable: false,
967  selectable: 'cell',
968  dataBound: function () {
969  $('#hcuTable<?php echo $acctType;?> table tbody tr').hover(
970  function() {
971  $(this).toggleClass("k-state-hover");
972  }
973  );
974 
975  var titleActivity = "<?php echo $MC->msg("See Activity For", HCU_DISPLAY_AS_JS); ?>";
976  var titleDetails = "<?php echo $MC->msg("Open for Details", HCU_DISPLAY_AS_JS); ?>";
977  $('#hcuTable<?php echo $acctType;?> table tbody tr').each(function(i) {
978 
979  // grid data
980  var grid = $("#hcuTable<?php echo $acctType;?>").data("kendoGrid");
981  var gridRow = $(this);
982  var gridItem = grid.dataItem(gridRow);
983  var desc = htmlUnescape(gridItem.displaydesc);
984 
985  if ( gridItem.restrictions != "L" ) {
986  // set tooltips
987  $(this).find("td").each(function(j) {
988  if (j == 0) {
989  $(this).attr("title", titleDetails + " on " + desc);
990  $(this).find("a").attr("title", titleDetails).css("cursor", "pointer");
991  } else {
992  $(this).attr("title", titleActivity + " " + desc);
993  }
994 
995  });
996  }
997  });
998  },
999  change: onChange,
1000  detailInit: showDetailsDesktop,
1001  detailExpand: expandRow,
1002  detailCollapse: collapseRow,
1003  columns: [
1004  <?php
1005  $dsFieldsList = Array();
1006  foreach ($Disp_Balances_ary[$acctType]['fields'] as $fieldKey => $fieldInfo) {
1007  if (array_search($fieldKey, $displayConfiguredCols[$acctType])) {
1008  // ** Build an array with the information, then I will IMPLODE the array with commas creating the list
1009  // * set cell template if can be shown in balances screen
1010 
1011  $columnFormat = "";
1012  $columnTempl = "";
1013  $columnAttr = "";
1014  $columnHdrAlign = "left";
1015  switch ($fieldInfo['disp_format']) {
1016  case 'FormatCurrency':
1017  $columnFormat = "{0:c}";
1018  if ($acctType === 'ln') {
1019  $nullText = $MC->msg("Call Us", HCU_DISPLAY_AS_JS);
1020  $columnTempl = "#if ({$fieldInfo['disp_fieldname']} === null) {##if ('{$fieldInfo['disp_fieldname']}' === 'tenday' && type === '18') {##='$nullText'##} else {##='N/A'##}##} else {##=kendo.toString({$fieldInfo['disp_fieldname']}, 'c')##}#";
1021  } else if ($acctType === 'cc') {
1022  $nullText = $MC->msg("Call Us", HCU_DISPLAY_AS_JS);
1023  $columnTempl = "#if ({$fieldInfo['disp_fieldname']} === null) {##if ('{$fieldInfo['disp_fieldname']}' === 'available' && " . (($HB_ENV['Fset2'] & GetFlagsetValue("CU2_CALL_CCAVAIL")) == GetFlagsetValue("CU2_CALL_CCAVAIL") ? 'true' : 'false') . ") {##='$nullText'##} else {##='N/A'##}##} else {##=kendo.toString({$fieldInfo['disp_fieldname']}, 'c')##}#";
1024  } else {
1025  $columnTempl = "#= ({$fieldInfo['disp_fieldname']} === null ? 'N/A' : kendo.toString({$fieldInfo['disp_fieldname']}, 'c'))#";
1026  }
1027  $columnHdrAlign = "right";
1028  break;
1029  case 'FormatPercent':
1030  $columnFormat = "{0:n}";
1031  $columnTempl = "#= ({$fieldInfo['disp_fieldname']} === null ? 'N/A' : kendo.toString({$fieldInfo['disp_fieldname']}, 'n') + '%')#";
1032  $columnHdrAlign = "right";
1033  break;
1034  case 'FormatDate':
1035  $columnTempl = "#= ({$fieldInfo['disp_fieldname']} === null ? 'N/A' : kendo.toString({$fieldInfo['disp_fieldname']}, 'MM/dd/yyyy'))#";
1036  $columnHdrAlign = "right";
1037  case 'FormatDatePast':
1038  $columnFormat = "{0:MM/dd/yyyy}";
1039  $columnTempl = "#if (pastdue !== null) {##if (pastdue === '1' && {$fieldInfo['disp_fieldname']} !== null && {$fieldInfo['disp_fieldname']} !== 'N/A') {#<span class='acct-past-due k-icon k-i-note'></span>&nbsp;#}##}##if ({$fieldInfo['disp_fieldname']} !== null) {##=kendo.toString({$fieldInfo['disp_fieldname']}, 'MM/dd/yyyy')##} else {##='N/A'##}#";
1040  $columnHdrAlign = "right";
1041  break;
1042 
1043  default:
1044  $columnFormat = "";
1045  // column template
1046  if ($fieldKey == 'displaydesc') {
1047  $columnTempl = "#: (displayname.length > 0) ? displayname : displaydesc #";
1048  } else {
1049  $columnTempl = "#: {$fieldInfo['disp_fieldname']}#";
1050  }
1051  }
1052 
1053  // * Set the Footer Template, which will be used for Aggregates
1054  $footerTmpl = "";
1055  if ( isset( $fieldInfo['disp_footerTmpl'] ) && ($fieldInfo['disp_footerTmpl'] != '') ) {
1056  switch ($fieldInfo['disp_footerTmpl']) {
1057  case 'count':
1058  $footerTmpl = "(#= kendo.toString(count, '0')#) ". $MC->msg('Accounts', HCU_DISPLAY_AS_JS) ."";
1059  break;
1060  case 'sum':
1061  $footerTmpl = "<span class='#= sum < 0 ? \'currency_negative\' : \'currency_positive\' #'>#= (isNaN(sum) ? '' : kendo.toString(sum, 'c')) #</span>";
1062  break;
1063  }
1064  }
1065 
1066  $dsFieldsList[] = "{
1067  field: \"{$fieldInfo['disp_fieldname']}\",
1068  title: \"" . ($fieldInfo['disp_title']) . "\",
1069  format: \"" . $columnFormat . "\",
1070  template: \"" . $columnTempl . "\",
1071  footerTemplate: \"" . $footerTmpl . "\",
1072  headerAttributes: {
1073  style: \"text-align: " . $columnHdrAlign . "\"
1074  },
1075  footerAttributes: {
1076  style: \"text-align: " . $columnHdrAlign . "\"
1077  },
1078  hidden: " . ($fieldInfo['disp_OnBalances'] === true ? "false" : "true") . ",
1079  minScreenWidth: {$fieldInfo['disp_OnWidth']}
1080  }";
1081  }
1082  }
1083  print implode(",", $dsFieldsList);
1084  ?>
1085  ]
1086  });
1087 
1088 <?php
1089 
1090  }
1091 }
1092 ?>
1093  function showDetailsDesktop (e) {
1094  // GET ROW DATA
1095  var data_item = e.data;
1096 
1097  // GENERATE DETAILS CONTENT USING ROW DATA
1098  var detail_content = generateDetailsContent(data_item);
1099 
1100  // GENERATE PENDING DATA WITH DETAILS CONTENT AND ROW DATA
1101  var window_content = generateDetailsPending(detail_content, data_item);
1102 
1103  // APPEND DETAILS CONTENT TO GRID DETAILS
1104  window_content = $(window_content);
1105  window_content.appendTo(e.detailCell);
1106  }
1107 
1108  function showDetailsMobile(e) {
1109  e.preventDefault();
1110 
1111  // GET ROW DATA
1112  var data_item = this.dataItem($(e.currentTarget).closest("tr"));
1113 
1114  // SEE IF WINDOW EXISTS
1115  var wnd = $("#detailsPopUp").data("kendoWindow");
1116 
1117  if (!wnd) {
1118  wnd = $("#detailsPopUp").kendoWindow({
1119  width: "95%",
1120  modal: true,
1121  visible: false,
1122  actions: ['Close']
1123  }).data("kendoWindow");
1124  }
1125 
1126  // GENERATE DETAILS CONTENT USING ROW DATA
1127  var detail_content = generateDetailsContent(data_item);
1128 
1129  // GENERATE PENDING DATA WITH DETAILS CONTENT AND ROW DATA
1130  var window_content = generateDetailsPending(detail_content, data_item);
1131 
1132  <?php // APPEND DETAILS CONTENT TO WINDOW. I cannot use the "title" function because it encrypts the special characters but that is already encoded below. ?>
1133  $(wnd.wrapper).find(".k-window-title").html(data_item.displaydesc);
1134 
1135  wnd.content(window_content);
1136  wnd.center();
1137  wnd.open();
1138  }
1139 
1140  function generateDetailsContent(template_data) {
1141  // GENERATE KENDO TEMPLATE USING template_data JSON
1142  var template = kendo.template($('#detailTemplate').html());
1143  var template_content = template(template_data);
1144 
1145  // RETURN HTML
1146  return template_content;
1147  }
1148 
1149  function generateDetailsPending(details_content, data_item) {
1150  // ONLY CREATE PENDING DATA IF ANY EXISTS
1151  if (hcuDataPend[data_item.localaccountkey] !== undefined) {
1152 
1153  // PENDING HEADER/CONTENT VARIABLES
1154  var pending_content = $(details_content);
1155  var pending_container = $("<div id='hcuPendingGrid'></div>");
1156  var pending_header = $("<span id='hcuPendingHdr'><?php echo $MC->msg("Pending Transactions", HCU_DISPLAY_AS_JS); ?></span>");
1157 
1158  // APPEND HEADER
1159  pending_header.appendTo(pending_content);
1160 
1161  // BUILD PENDING DATA GRID
1162  pending_container.kendoGrid({
1163  dataSource: {
1164  data: hcuDataPend[data_item.localaccountkey],
1165  pageable: false,
1166  schema: {
1167  model: {
1168  fields: {
1169  pendDate: {
1170  type: "string"
1171  },
1172  pendDesc: {
1173  type: "string"
1174  },
1175  pendAmt: {
1176  type: "number"
1177  }
1178  }
1179  }
1180  },
1181  aggregate: [
1182  {field: "pendDesc", aggregate: "count"},
1183  {field: "pendAmt", aggregate: "sum"}
1184  ]
1185  },
1186  autoBind: true,
1187  sortable: false,
1188  scrollable: false,
1189  columns: [
1190  {
1191  field: "pendDate",
1192  title: "<?php echo $MC->msg('Date', HCU_DISPLAY_AS_JS); ?>",
1193  hidden: false,
1194  headerAttributes: {
1195  style: "text-align: left;"
1196  },
1197  attributes: {
1198  tabindex: "0"
1199  }
1200  },
1201  {
1202  field: "pendDesc",
1203  title: "<?php echo $MC->msg('Description', HCU_DISPLAY_AS_JS); ?>",
1204  hidden: false,
1205  footerTemplate: " #= (count == 1 ? '' : kendo.toString(count, '0') + ' <?php echo $MC->msg('Pending Transactions', HCU_DISPLAY_AS_JS); ?>' ) # ",
1206  headerAttributes: {
1207  style: "text-align: left;"
1208  },
1209  attributes: {
1210  tabindex: "0"
1211  }
1212  },
1213  {
1214  field: "pendAmt",
1215  title: "<?php echo $MC->msg('Amount', HCU_DISPLAY_AS_JS); ?>",
1216  hidden: false,
1217  format: "{0:c}",
1218  footerTemplate: " <div style='text-align:right;'>#= (isNaN(sum) ? '' : (kendo.toString(sum, 'C'))) #</div>",
1219  headerAttributes: {
1220  style: "text-align: right;"
1221  },
1222  attributes: {
1223  style: "text-align: right;",
1224  tabindex: "0"
1225  }
1226  }
1227  ],
1228  dataBound: function(e) {
1229  $(this.element).find(".k-grid-header").hide();
1230  $(this.element).find(".k-grid-footer").hide();
1231  }
1232  });
1233 
1234  // APPEND GRID
1235  pending_container.appendTo(pending_content);
1236 
1237  // RETURN CONTENT WITH PENDING DATA
1238  return pending_content;
1239  } else {
1240 
1241  // RETUR CONTENT WITHOUT PENDING DATA
1242  return details_content;
1243  }
1244  }
1245 
1246  // ONLY THE FIRST CELL CAN GO TO HISTORY ON MOBILE
1247  // THE OTHER CELL MUST SHOW POPUP DETAILS
1248  function onChangeMobile(e) {
1249  e.preventDefault();
1250 
1251  var cell = this.select();
1252  var cell_index = cell.index();
1253 
1254  if (cell_index == 0) {
1255  var data_source = this.dataSource;
1256  var data_table_id = cell.closest('table').closest('div')[0].id;
1257  var data_item = data_source.view()[cell.closest("tr").index('#' + data_table_id + ' .k-master-row')];
1258 
1259 
1260  gotoHistoryTransactions(data_item);
1261  }
1262 
1263  // REMOVE SELECTED CLASS
1264  $(this.select()).removeClass('k-state-selected');
1265  }
1266 
1267  // ON DESKTOP ANY CELL IN THE ROW CAN GO TO HISTORY
1268  function onChange(e) {
1269  e.preventDefault();
1270 
1271  // CELL SELECTED
1272  var cell = this.select();
1273  var cell_index = cell.index();
1274 
1275  // ONLY GOTO HISTORY IF NOT DETAILS CELL
1276  if (cell_index != 0) {
1277  // ROW DATA ITEM
1278  var data_source = this.dataSource;
1279  var data_table = cell.closest('table');
1280  var data_table_id = data_table.closest('div')[0].id;
1281  var data_item = data_source.view()[cell.closest("tr").index('#' + data_table_id + ' .k-master-row')];
1282 
1283  // OPEN HISTORY
1284  gotoHistoryTransactions(data_item);
1285 
1286  // REMOVE SELECTED CLASS
1287  $(this.select()).removeClass('k-state-selected');
1288  }
1289  }
1290 
1291  function expandRow(e) {
1292 
1293  if (expandedRow !== undefined && expandedRow !== e.masterRow[0]) {
1294  <?php
1295  /*
1296  * We know the row.. NOW move up the tree to find the grid that
1297  * contains the row. Find the closest div that starts with hcuTable
1298  * Using this, I can reference the GRID information
1299  */
1300  ?>
1301  var grid = $(expandedRow.closest('[id^=hcuTable]')).data('kendoGrid')
1302  grid.collapseRow(expandedRow);
1303  }
1304  expandedRow = e.masterRow;
1305  $(e.masterRow).addClass('k-state-selected');
1306  }
1307  function collapseRow(e) {
1308  if (expandedRow !== undefined) {
1309  $(expandedRow).removeClass('k-state-selected');
1310  $removeRow = ($(expandedRow)[0].nextElementSibling ? $(expandedRow)[0].nextElementSibling : $(expandedRow)[0].nextSibling);
1311  if ($removeRow) {
1312  $(expandedRow)[0].parentNode.removeChild($removeRow);
1313  }
1314  }
1315  expandedRow = undefined;
1316  }
1317 
1318  // tooltip'ing
1319  homecuTooltip.reset();
1320  homecuTooltip.custom.content = "<?php echo $MC->msg('Payment Past Due', HCU_DISPLAY_AS_JS); ?>";
1321  $('.acct-past-due').kendoTooltip(homecuTooltip.custom);
1322  homecuTooltip.custom.filter = 'tr.k-master-row td';
1323  homecuTooltip.custom.showAfter = 2000;
1324  $('[id^=hcuTable].hcu-activity').kendoTooltip(homecuTooltip);
1325 
1326  $('[id^="hcuTable"] table tbody tr td a').hover(function() {
1327  $(this).attr('title', '');
1328  });
1329 
1330  $(".local-sync-tooltip").kendoTooltip({
1331 
1332  position: "top"
1333  });
1334 
1335  });
1336 
1337  function datarowHistoryLink(acctGrid, dataRow) {
1338 
1339  try {
1340  var selGrid = acctGrid.data('kendoGrid'),
1341  dataSource = selGrid.dataSource,
1342  dataItem = dataSource.data()[dataRow];
1343 
1344  gotoHistoryTransactions(dataItem);
1345  } catch (err) {
1346  window.alert('<?php echo $MC->msg('Error', HCU_DISPLAY_AS_JS); ?>');
1347  }
1348 
1349  return;
1350  }
1351 
1352  function gotoHistoryTransactions(dataItem) {
1353 
1354  try {
1355  if (dataItem) {
1356  if (dataItem.view_transactions) {
1357  if ((dataItem.localaccounttype === 'cc' && (dataItem.hisinfo !== '' && dataItem.hisinfo !== 'HomeCU')) || (dataItem.localaccounttype === 'ln' && dataItem.hisinfo !== '')) {
1358  <?php if (!$serviceViewFromCUAdmin): ?>
1359  window.open(dataItem.hisinfo);
1360  <?php endif; ?>
1361  } else if (dataItem.localaccounttype === 'cc' && dataItem.hisinfo === '') {
1362  // * DO NOTHING
1363  } else {
1364  ShowWaitWindow('Loading Data');
1365  <?php if (!$serviceViewFromCUAdmin): ?>
1366  var histHref = "<?php echo "{$HB_ENV['loginpath']}/hcuHistory.prg?{$HB_ENV['cuquery']}&a="?>" + dataItem.localaccountkey;
1367  <?php else: ?>
1368  var histHref = "<?php echo "{$menu_link}?ft={$scriptFt}&cmh=" . urlencode($currentMbrHash) . "&a="?>" + dataItem.localaccountkey;
1369  <?php endif; ?>
1370  // 07-19: Some devices are adding /favicon.ico to url's, breaking DB lookups. Add
1371  // ampersand wherever we set 'a' so params after 'a' value are ignored.
1372  histHref += '&';
1373  window.document.location = histHref;
1374  }
1375  }
1376  }
1377  } catch (err) {
1378  window.alert('<?php echo $MC->msg('Error', HCU_DISPLAY_AS_JS); ?>');
1379  }
1380 
1381  }
1382 
1383  function GetSyncTitle(pType, pAmt, pDate) {
1384  var haystack = "";
1385  var title = "";
1386  switch (pType){
1387  case "available":
1388  haystack = '<?php echo $MC->msg('Account Available Out Of Sync'); ?>';
1389  break;
1390  case "current":
1391  haystack = '<?php echo $MC->msg('Account Balance Out Of Sync'); ?>';
1392  break;
1393 
1394  }
1395  if (haystack !== '') {
1396  // * replace amount
1397  title = haystack.replace('#amount#', pAmt);
1398  // * replace date
1399  title = title.replace('#as_of#', pDate );
1400  }
1401  return title;
1402  }
1403  </script>
1404 
1405  </div>
1406  <div id="details"></div>
1407  <style type="text/css">
1408  /* ONLY THIS SCREEN MOVE THIS DOWN */
1409  .local-sync-tooltip, .local-locked {
1410  color: darkorange;
1411  }
1412  #formStatus {
1413  margin-top: 30px;
1414  }
1415 
1416  #hcuPendingHdr {
1417  font-weight: bold;
1418  display: block;
1419  margin-top: 10px;
1420  }
1421  #details-container
1422  {
1423  padding: 10px;
1424  border: 1px solid #bbb;
1425  border-radius: 5px;
1426  max-width: 600px;
1427  }
1428 
1429  #details-container h2
1430  {
1431  margin: 0;
1432  }
1433 
1434  #details-container em
1435  {
1436  color: #8c8c8c;
1437  }
1438 
1439  #details-container dt
1440  {
1441  margin:0;
1442  display: inline;
1443  }
1444 
1445  #hcuTabledp tr.k-detail-row,
1446  #hcuTableln tr.k-detail-row,
1447  #hcuTablecc tr.k-detail-row {
1448  background: transparent;
1449  }
1450 
1451  #hcuTabledp .expandFactor {visibility: visible;}
1452  #hcuTabledp .smallFactor {visibility: hidden;}
1453 
1454  #survey-lines .row:nth-child(odd) {
1455  background: #DDDDDD;
1456  padding: 3px;
1457  margin: 0;
1458  }
1459 
1460  #survey-lines .row:nth-child(even) {
1461  background: #FFFFFF;
1462  padding: 3px;
1463  margin: 0;
1464  }
1465 
1466  #survey-lines label {
1467  font-weight: normal;
1468  font-size: smaller;
1469  }
1470 
1471  #survey-lines .radio {
1472  margin: 0;
1473  }
1474 
1475  .nopadding {
1476  padding: 0;
1477  }
1478 
1479  @media (min-width: 768px) {
1480  .survey-button-right {
1481  text-align:right;
1482  }
1483 
1484  }
1485 
1486  #summary-info {
1487  width: 100%;
1488  display:table;
1489  }
1490  #summary-info .summary-row:hover {
1491  background-color: #eaeaea;
1492  }
1493  #summary-info .summary-row {
1494  display:table-row;
1495  }
1496  #summary-info .summary-desc {
1497  font-weight: bold;
1498  display:table-cell;
1499  text-align: left;
1500  padding: 2.5px 5px;
1501  border-bottom: 1px solid #ccc;
1502  }
1503  #summary-info .summary-value {
1504  display:table-cell;
1505  text-align: right;
1506  padding: 2.5px 5px;
1507  border-bottom: 1px solid #ccc;
1508  }
1509  .summary-value .summary-notice,
1510  .summary-desc .summary-notice {
1511  color: red;
1512  }
1513  .summary-data {
1514  color: #666;
1515  }
1516 
1517  .summary-data-notify {
1518  color: red;
1519  }
1520 
1521  .account_cell_desc {
1522  width: 50%;
1523  float: left;
1524 
1525  text-align: left;
1526  }
1527 
1528  .account_cell_value {
1529  width: 50%;
1530  float: left;
1531 
1532  text-align: right;
1533  }
1534 
1535  @media only screen and (max-width: 765px) {
1536  .mobile-hide {
1537  display: none !important;
1538  }
1539  }
1540 
1541  @media only screen and (min-width: 767px) {
1542  .desktop-hide {
1543  display: none !important;
1544  }
1545  }
1546 
1547  @media print {
1548  .no-print { display: none !important; }
1549  }
1550 
1551  @media only screen and (max-width: 500px) {
1552  .account_cell_desc {
1553  width: 100%;
1554  text-align: left;
1555  }
1556 
1557  .account_cell_value {
1558  width: 100%;
1559  text-align: left;
1560  }
1561  }
1562 
1563  td:focus {
1564  outline: 2px solid #5E9ED6;
1565  }
1566 
1567  .summary-row:focus {
1568  outline: 2px solid #5E9ED6;
1569  }
1570 
1571  #hcuPendingGrid tr:focus {
1572  outline: 2px solid #5E9ED6;
1573  }
1574 
1575  <?php if ($showEmbedMsg != ''): ?>
1576  #content {
1577  padding-top:30px;
1578  min-height: 400px;
1579  }
1580  <?php endif; ?>
1581 </style>
1582 <script type="text/x-kendo-template" id="detailTemplate">
1583  <div id="details-container" class="">
1584  <div id='summary-info' tabindex="0">
1585  # if ( data.restrictions == "R" ) { #
1586  <span class="local-locked fa fa-flag-o"></span> <?php echo $MC->msg('Account Readonly', HCU_DISPLAY_AS_JS); ?>
1587  # } #
1588 
1589  # if ( data.restrictions == "L" ) { #
1590  <span class="local-locked fa fa-lock"></span> <?php echo $MC->msg('Account Locked', HCU_DISPLAY_AS_JS); ?>
1591  # } else if (data.localaccounttype == 'dp') { #
1592  <?php if (is_array(HCU_array_key_value('dp', $displayConfiguredCols))): ?>
1593  <?php if (array_search('description', $displayConfiguredCols['dp'])): ?>
1594  <div class='summary-row' tabindex="0">
1595  <div class='summary-desc'><?php echo $MC->msg('Description', HCU_DISPLAY_AS_JS); ?></div>
1596  <div class='summary-value'>#= description #</div>
1597  </div>
1598  <?php endif; ?>
1599  <?php if (array_search('currentbal', $displayConfiguredCols['dp'])): ?>
1600  <div class='summary-row' tabindex="0">
1601  <div class='summary-desc'><?php echo $MC->msg('Current Bal', HCU_DISPLAY_AS_JS); ?></div>
1602  <div class='summary-value'>
1603  # if (data.out_of_sync) { #
1604  # var balanceTitle = GetSyncTitle('current', kendo.format("{0:c}", parseFloat(currentbal)), as_of_date); #
1605  <span class="local-sync-tooltip fa fa-exclamation-triangle" ></span> #= balanceTitle #
1606  # } else { #
1607  #= kendo.format("{0:c}", parseFloat(currentbal)) #
1608  # } #
1609  </div>
1610  </div>
1611  <?php endif; ?>
1612  <?php if (array_search('availablebal', $displayConfiguredCols['dp'])): ?>
1613  <div class='summary-row' tabindex="0">
1614  <div class='summary-desc'><?php echo $MC->msg('Available', HCU_DISPLAY_AS_JS); ?></div>
1615  <div class='summary-value'>
1616  # if (out_of_sync) {
1617  var balanceTitle = GetSyncTitle('available', kendo.format("{0:c}", parseFloat(availablebal)), as_of_date);
1618  #
1619  <span class="local-sync-tooltip fa fa-exclamation-triangle" ></span> #= balanceTitle #
1620  # } else { #
1621  #= kendo.format("{0:c}", parseFloat(availablebal)) #
1622  # } #
1623  </div>
1624  </div>
1625  <?php endif; ?>
1626  <?php if (array_search('ytdinterest', $displayConfiguredCols['dp'])): ?>
1627  <div class='summary-row' tabindex="0">
1628  <div class='summary-desc'><?php echo $MC->msg('YTD Interest', HCU_DISPLAY_AS_JS); ?></div>
1629  <div class='summary-value'>#= (ytdinterest === null ? 'N/A' : kendo.toString(parseFloat(ytdinterest), 'c')) #</div>
1630  </div>
1631  <?php endif; ?>
1632  <?php if (array_search('lastyrinterest', $displayConfiguredCols['dp'])): ?>
1633  <div class='summary-row' tabindex="0">
1634  <div class='summary-desc'><?php echo $MC->msg('Prior Yr Interest', HCU_DISPLAY_AS_JS); ?></div>
1635  <div class='summary-value'>#= (lastyrinterest === null ? 'N/A' : kendo.toString(parseFloat(lastyrinterest), 'c')) #</div>
1636  </div>
1637  <?php endif; ?>
1638  <?php endif; ?>
1639 
1640  # } else if (data.localaccounttype == 'ln') { #
1641 
1642  <?php if (is_array(HCU_array_key_value('ln', $displayConfiguredCols))): ?>
1643  <?php if (array_search('description', $displayConfiguredCols['ln'])): ?>
1644  <div class='summary-row' tabindex="0">
1645  <div class='summary-desc'><?php echo $MC->msg('Description', HCU_DISPLAY_AS_JS); ?></div>
1646  <div class='summary-value'>#= description #</div>
1647  </div>
1648  <?php endif; ?>
1649  <?php if (array_search('currentbal', $displayConfiguredCols['ln'])): ?>
1650  <div class='summary-row' tabindex="0">
1651  <div class='summary-desc'><?php echo $MC->msg('Current Bal', HCU_DISPLAY_AS_JS); ?></div>
1652  <div class='summary-value'>
1653  # if (data.out_of_sync) {
1654  var balanceTitle = GetSyncTitle('current', kendo.format("{0:c}", parseFloat(currentbal)), as_of_date);
1655  #
1656  <span class="local-sync-tooltip fa fa-exclamation-triangle" ></span> #= balanceTitle #
1657  # } else { #
1658  #= kendo.format("{0:c}", parseFloat(currentbal)) #
1659  # } #
1660  </div>
1661  </div>
1662  <?php endif; ?>
1663  <?php if (array_search('paymentamount', $displayConfiguredCols['ln'])): ?>
1664  <div class='summary-row' tabindex="0">
1665  <div class='summary-desc'><?php echo $MC->msg('Payment', HCU_DISPLAY_AS_JS); ?></div>
1666  <div class='summary-value'>#= (paymentamount === null ? 'N/A' : kendo.toString(parseFloat(paymentamount), 'c')) #</div>
1667  </div>
1668  <?php endif; ?>
1669  <?php if (array_search('nextduedate', $displayConfiguredCols['ln'])): ?>
1670  # if (data.nextduedate) { #
1671  <div class='summary-row' tabindex="0">
1672  <div class='summary-desc'>
1673  <?php echo $MC->msg('Next Due', HCU_DISPLAY_AS_JS); ?>
1674  # if (data.pastdue === '1' && (nextduedate !== null)) { #
1675  <span class="summary-data-notify">
1676  <?php echo $MC->msg('Payment Past Due', HCU_DISPLAY_AS_JS); ?>
1677  </span>
1678  # } #
1679  </div>
1680  <div class='summary-value #= (data.pastdue === '1' && (nextduedate !== null && nextduedate !== 'N/A') ? 'summary-notice' : '') #'>#= (nextduedate === null ? 'N/A' : kendo.toString(nextduedate, 'MM/dd/yyyy')) #</div>
1681 
1682  </div>
1683  # } #
1684  <?php endif; ?>
1685  <?php if (array_search('tenday', $displayConfiguredCols['ln'])): ?>
1686  <div class='summary-row' tabindex="0">
1687  <div class='summary-desc'><?php echo $MC->msg('Payoff', HCU_DISPLAY_AS_JS); ?></div>
1688  <div class='summary-value'></div>
1689  </div>
1690  <?php if (array_search('payoff', $displayConfiguredCols['ln'])): ?>
1691  <div class='summary-row' tabindex="0">
1692  <div class='summary-desc' style=''><?php echo $MC->msg("Todays Payoff", HCU_DISPLAY_AS_JS); ?></div>
1693  <div class='summary-value'>#= (payoff === null ? 'N/A' : kendo.toString(parseFloat(payoff), 'c')) #</div>
1694  </div>
1695  <?php endif; ?>
1696  <?php if (array_search('tenday', $displayConfiguredCols['ln'])): ?>
1697  <div class='summary-row' tabindex="0">
1698  <div class='summary-desc'><?php echo $MC->msg('Ten-days', HCU_DISPLAY_AS_JS) . ' ' . $MC->msg('Payoff', HCU_DISPLAY_AS_JS); ?></div>
1699  <div class='summary-value'>#= (tenday === null ? 'N/A' : kendo.toString(parseFloat(tenday), 'c')) #</div>
1700  </div>
1701  <?php endif; ?>
1702  <?php else: ?>
1703  <?php if (array_search('payoff', $displayConfiguredCols['ln'])): ?>
1704  <div class='summary-row' tabindex="0">
1705  <div class='summary-desc'><?php echo $MC->msg('Payoff', HCU_DISPLAY_AS_JS); ?></div>
1706  <div class='summary-value'>#= (payoff === null ? 'N/A' : (isNaN(payoff) ? kendo.toString(payoff) : kendo.toString(parseFloat(payoff), 'c'))) #</div>
1707  </div>
1708  <?php endif; ?>
1709  <?php endif; ?>
1710  <?php if (array_search('interestrate', $displayConfiguredCols['ln'])): ?>
1711  <div class='summary-row' tabindex="0">
1712  <div class='summary-desc'><?php echo $MC->msg('Interest Rate', HCU_DISPLAY_AS_JS); ?></div>
1713  <div class='summary-value'>#= (interestrate === null ? 'N/A' : kendo.toString(interestrate, 'n') + '%') #</div>
1714  </div>
1715  <?php endif; ?>
1716  <?php if (array_search('creditlimit', $displayConfiguredCols['ln'])): ?>
1717  # if (creditlimit > 0) { #
1718  <div class='summary-row' tabindex="0">
1719  <div class='summary-desc'><?php echo $MC->msg('Limit', HCU_DISPLAY_AS_JS); ?></div>
1720  <div class='summary-value'>#= (creditlimit === null ? 'N/A' : kendo.toString(parseFloat(creditlimit), 'c')) #</div>
1721  </div>
1722  # } #
1723  <?php endif; ?>
1724  <?php if (($HB_ENV['Fset'] & GetFlagsetValue('CU_SHOWAVAILABLE'))): ?>
1725  # if (creditlimit > 0) { #
1726  <div class='summary-row' tabindex="0">
1727  <div class='summary-desc'><?php echo $MC->msg('Available', HCU_DISPLAY_AS_JS); ?></div>
1728  <div class='summary-value'><!--#= (availablebal === null ? 'N/A' : kendo.toString(availablebal, 'c')) #-->
1729  # if (data.out_of_sync) {
1730  var balanceTitle = GetSyncTitle('available', kendo.format("{0:c}", parseFloat(availablebal)), as_of_date);
1731  #
1732  <span class="local-sync-tooltip fa fa-exclamation-triangle" ></span> #= balanceTitle #
1733  # } else { #
1734  #= isNaN(availablebal) ? availablebal : kendo.format("{0:c}", parseFloat(availablebal)) #
1735  # } #
1736  </div>
1737  </div>
1738  # } #
1739  <?php endif; ?>
1740  <?php if (array_search('ytdinterest', $displayConfiguredCols['ln'])): ?>
1741  <div class='summary-row' tabindex="0">
1742  <div class='summary-desc'><?php echo $MC->msg('YTD Interest', HCU_DISPLAY_AS_JS); ?></div>
1743  <div class='summary-value'>#= (ytdinterest === null ? 'N/A' : kendo.toString(parseFloat(ytdinterest), 'c')) #</div>
1744  </div>
1745  <?php endif; ?>
1746  <?php if (array_search('lastyrinterest', $displayConfiguredCols['ln'])): ?>
1747  <div class='summary-row' tabindex="0">
1748  <div class='summary-desc'><?php echo $MC->msg('Prior Yr Interest', HCU_DISPLAY_AS_JS); ?></div>
1749  <div class='summary-value'>#= (lastyrinterest === null ? 'N/A' : kendo.toString(parseFloat(lastyrinterest), 'c')) #</div>
1750  </div>
1751  <?php endif; ?>
1752  <?php endif; ?>
1753 
1754  # } else if (data.localaccounttype == 'cc') { #
1755 
1756  <?php if (is_array(HCU_array_key_value('cc', $displayConfiguredCols))): ?>
1757  <?php if (array_search('description', $displayConfiguredCols['cc'])): ?>
1758  <div class='summary-row' tabindex="0">
1759  <div class='summary-desc'><?php echo $MC->msg('Description', HCU_DISPLAY_AS_JS); ?></div>
1760  <div class='summary-value'>#= description #</div>
1761  </div>
1762  <?php endif; ?>
1763  <?php if (array_search('currentbal', $displayConfiguredCols['cc'])): ?>
1764  <div class='summary-row' tabindex="0">
1765  <div class='summary-desc'><?php echo $MC->msg('Current Bal', HCU_DISPLAY_AS_JS); ?></div>
1766  <div class='summary-value '>
1767  # if (data.out_of_sync) {
1768  var balanceTitle = GetSyncTitle('current', kendo.format("{0:c}", parseFloat(currentbal)), as_of_date);
1769  #
1770  <span class="local-sync-tooltip fa fa-exclamation-triangle" ></span> #= balanceTitle #
1771  # } else { #
1772  #= kendo.format("{0:c}", parseFloat(currentbal)) #
1773  # } #
1774  </div>
1775  </div>
1776  <?php endif; ?>
1777  <?php if (array_search('lastpaymentdate', $displayConfiguredCols['cc'])): ?>
1778  <div class='summary-row' tabindex="0">
1779  <div class='summary-desc'><?php echo $MC->msg('Last Paid', HCU_DISPLAY_AS_JS); ?></div>
1780  <div class='summary-value'>#= (lastpaymentdate === null ? 'N/A' : kendo.toString(lastpaymentdate, 'MM/dd/yyyy')) #</div>
1781  </div>
1782  <?php endif; ?>
1783  <?php if (array_search('paymentamount', $displayConfiguredCols['cc'])): ?>
1784  <div class='summary-row' tabindex="0">
1785  <div class='summary-desc'><?php echo $MC->msg('Min Due', HCU_DISPLAY_AS_JS); ?></div>
1786  <div class='summary-value'>#= (paymentamount === null ? 'N/A' : kendo.toString(parseFloat(paymentamount), 'c')) #</div>
1787  </div>
1788  <?php endif; ?>
1789  <?php if (array_search('nextduedate', $displayConfiguredCols['cc'])): ?>
1790  # if (data.nextduedate) { #
1791  <div class='summary-row' tabindex="0">
1792  <div class='summary-desc'>
1793  <?php echo $MC->msg('Next Due', HCU_DISPLAY_AS_JS); ?>
1794  # if (data.pastdue === '1' && (nextduedate !== null)) { #
1795  <span class="summary-data-notify">
1796  <?php echo $MC->msg('Payment Past Due', HCU_DISPLAY_AS_JS); ?>
1797  </span>
1798  # } #
1799  </div>
1800  <div class='summary-value #= (data.pastdue === '1' && (nextduedate !== null && nextduedate !== 'N/A') ? 'summary-notice' : '') #'>#= (nextduedate === null ? 'N/A' : kendo.toString(nextduedate, 'MM/dd/yyyy')) #</div>
1801  </div>
1802  # } #
1803  <?php endif; ?>
1804  <?php if (array_search('interestrate', $displayConfiguredCols['cc'])): ?>
1805  <div class='summary-row' tabindex="0">
1806  <div class='summary-desc'><?php echo $MC->msg('Interest Rate', HCU_DISPLAY_AS_JS); ?></div>
1807  <div class='summary-value'>#= (interestrate === null ? 'N/A' : kendo.toString(interestrate, 'n') + '%') #</div>
1808  </div>
1809  <?php endif; ?>
1810  <?php if (array_search('creditlimit', $displayConfiguredCols['cc'])): ?>
1811  <div class='summary-row' tabindex="0">
1812  <div class='summary-desc'><?php echo $MC->msg('Limit', HCU_DISPLAY_AS_JS); ?></div>
1813  <div class='summary-value'>#= (creditlimit === null ? 'N/A' : kendo.toString(parseFloat(creditlimit), 'c')) #</div>
1814  </div>
1815  <?php endif; ?>
1816  <?php if (array_search('availablebal', $displayConfiguredCols['cc'])): ?>
1817  <div class='summary-row' tabindex="0">
1818  <div class='summary-desc'><?php echo $MC->msg('Available', HCU_DISPLAY_AS_JS); ?></div>
1819  <div class='summary-value'><!--#= (availablebal === null ? 'N/A' : kendo.toString(availablebal, 'c')) #-->
1820  # if (data.out_of_sync) {
1821  var balanceTitle = GetSyncTitle('available', kendo.format("{0:c}", parseFloat(availablebal)), as_of_date);
1822  #
1823  <span class="local-sync-tooltip fa fa-exclamation-triangle" ></span>#= balanceTitle #
1824  # } else { #
1825  # if (isNaN(availablebal)) { #
1826  #= availablebal #
1827  # } else { #
1828  #= kendo.format("{0:c}", parseFloat(availablebal)) #
1829  # } #
1830  # } #
1831  </div>
1832  </div>
1833  <?php endif; ?>
1834  <?php if (array_search('ytdinterest', $displayConfiguredCols['cc'])): ?>
1835  <div class='summary-row' tabindex="0">
1836  <div class='summary-desc'><?php echo $MC->msg('YTD Interest', HCU_DISPLAY_AS_JS); ?></div>
1837  <div class='summary-value'>#= (ytdinterest === null ? 'N/A' : kendo.toString(parseFloat(ytdinterest), 'c')) #</div>
1838  </div>
1839  <?php endif; ?>
1840  <?php if (array_search('lastyrinterest', $displayConfiguredCols['cc'])): ?>
1841  <div class='summary-row' tabindex="0">
1842  <div class='summary-desc'><?php echo $MC->msg('Prior Yr Interest', HCU_DISPLAY_AS_JS); ?></div>
1843  <div class='summary-value'>#= (lastyrinterest === null ? 'N/A' : kendo.toString(parseFloat(lastyrinterest), 'c')) #</div>
1844  </div>
1845  <?php endif; ?>
1846  <?php endif; ?>
1847  # } #
1848  </div>
1849  </div>
1850 
1851 </script>
1852  <!--
1853  ** MOBILE **
1854  -->
1855  <script type="text/x-kendo-template" id="hcuDataMobileRow">
1856 
1857  <tr class='k-master-row'
1858  data-uid='#= uid #'
1859  dms-acctd-id='#: localaccountkey#'
1860  dms-template='template#: localaccounttype#'
1861  style='cursor: pointer;' >
1862 
1863  # if ( data.restrictions == "L" ) { #
1864  <td style="cursor:default" tabindex="0">
1865  <div class="account_cell_desc">
1866  <span>#= displaydesc #</span>
1867  </div>
1868  <div class="account_cell_value">
1869  <div><?php echo $MC->msg('Account Locked'); ?></div>
1870  </div>
1871  </td>
1872 
1873  <td title='<?php echo $MC->msg('Open for Details', HCU_DISPLAY_AS_JS); ?>' align="center" style="padding: 0;" tabindex="0">
1874  <a style="display: block; padding: 35% 0; color: black;" class="k-grid-showDetailsMobile">
1875  <span class="fa fa-2x fa-lock local-homecu-info local-locked" style="" aria-hidden="true" ></span>
1876  </a>
1877  </td>
1878  # } else { #
1879  <td title='<?php echo $MC->msg("See Activity For", HCU_DISPLAY_AS_JS) ?>' tabindex="0">
1880  <div class="account_cell_desc">
1881  <span>#= displaydesc #</span>
1882  </div>
1883  # if (!(data.localaccounttype == 'cc' && <?php echo HCU_JsonEncode(($HB_ENV['Fset2'] & GetFlagsetValue("CU2_CC18NOINFO")) == GetFlagsetValue("CU2_CC18NOINFO")); ?>)) { #
1884  <div class="account_cell_value">
1885  <div><?php echo $MC->msg('Current'); ?>:
1886  # if (data.out_of_sync) {
1887  var balanceTitle = GetSyncTitle('current', kendo.format("{0:c}", parseFloat(currentbal)), as_of_date);
1888  #
1889  <span class="local-sync-tooltip fa fa-exclamation-triangle" title="#= balanceTitle #" ></span>
1890  # } else { #
1891  #= kendo.format("{0:c}", parseFloat(currentbal)) #
1892  # } #
1893  </div>
1894 
1895  # if (data.availablebal) { #
1896  <div><?php echo $MC->msg('Available'); ?>:
1897  # if (data.out_of_sync) {
1898  var balanceTitle = GetSyncTitle('available', (data.availablebal) ? kendo.format("{0:c}", parseFloat(availablebal)) : 'N/A', as_of_date);
1899  #
1900  <span class="local-sync-tooltip fa fa-exclamation-triangle" title="#= balanceTitle #" ></span>
1901  # } else { #
1902  #= (data.availablebal) ? (isNaN(availablebal) ? availablebal : kendo.format("{0:c}", parseFloat(availablebal))) : 'N/A' #
1903  # } #
1904  </div>
1905 
1906  # } #
1907 
1908  </div>
1909  # } #
1910  </td>
1911 
1912  <td title='<?php echo $MC->msg('Open for Details', HCU_DISPLAY_AS_JS); ?>' align="center" style="padding: 0;" tabindex="0">
1913  <a style="display: block; padding: 35% 0; color: black;" class="k-grid-showDetailsMobile">
1914  # if ( data.restrictions == "R" ) { #
1915  <span class="fa fa-2x fa-flag-o local-homecu-info local-locked" style="" aria-hidden="true"></span>
1916  # } else { #
1917  <span class="fa fa-2x fa-info-circle local-homecu-info" style="" aria-hidden="true"></span>
1918  # } #
1919  </a>
1920  </td>
1921  # } #
1922  </tr>
1923  </script>
1924 
1925  <!--
1926  ** DESKTOP **
1927  -->
1928  <script type="text/x-kendo-template" id="hcuDataRow" >
1929  # if ( data.restrictions == "L" ) { #
1930  <tr class='k-master-row' style='cursor:default'>
1931  # } else { #
1932  <tr class='k-master-row' data-uid='#= uid #' dms-acctd-id='#: localaccountkey#' style='cursor: pointer;'>
1933  # } #
1934 
1935  <td class="k-hierarchy-cell" title="<?php echo $MC->msg('Open for Details', HCU_DISPLAY_AS_JS); ?>" >
1936  <a class="k-icon k-i-expand" href="##" title="" style="cursor: pointer;"></a>
1937  </td>
1938 
1939  # if ( data.restrictions == "L" ) { #
1940  <td role="gridcell" title="" style='text-align: left;' tabindex="0">#= displaydesc # <span class="local-locked fa fa-lock"></span></td>
1941  # if (!(data.localaccounttype == 'cc' && <?php echo HCU_JsonEncode(($HB_ENV['Fset2'] & GetFlagsetValue("CU2_CC18NOINFO")) == GetFlagsetValue("CU2_CC18NOINFO")); ?>)) { #
1942  <td role="gridcell" style='text-align: right;' tabindex="0">N/A</td>
1943  # if (data.paymentamount !== undefined) { #
1944  <td>&nbsp;</td>
1945  # } #
1946  <?php if ($HB_ENV['Fset'] & GetFlagsetValue('CU_SHOWAVAILABLE')) : ?>
1947  # if (data.localaccounttype == 'dp') { #
1948  <td role="gridcell" title="" style='text-align: right;' tabindex="0">N/A</td>
1949  # } #
1950  <?php endif; ?>
1951  <td style="display:none" role="gridcell" title="" tabindex="0">#= as_of_date #</td>
1952  # } #
1953  # } else { #
1954  <td role="gridcell" title="" style='text-align: left;' tabindex="0">#= displaydesc # # if ( data.restrictions == "R" ) { # <span class="local-locked fa fa-flag-o"></span> # } #</td>
1955  # if (!(data.localaccounttype == 'cc' && <?php echo HCU_JsonEncode(($HB_ENV['Fset2'] & GetFlagsetValue("CU2_CC18NOINFO")) == GetFlagsetValue("CU2_CC18NOINFO")); ?>)) { #
1956  <td role="gridcell" title="" style='text-align: right;' tabindex="0">
1957  # if (data.out_of_sync) {
1958  var balanceTitle = GetSyncTitle('current', kendo.format("{0:c}", parseFloat(currentbal)), as_of_date);
1959  #
1960  <span class="local-sync-tooltip fa fa-exclamation-triangle" title="#= balanceTitle #" ></span>
1961  # } else { #
1962  <span class="#= currentbal < 0 ? 'currency_negative' : 'currency_positive' #">#= kendo.format("{0:c}", currentbal) #</span>
1963  # } #
1964  </td>
1965  <!-- dp -->
1966  <!-- show available ?? -->
1967  <!-- ln -->
1968  <!-- cc/ln diff fieldname -->
1969  <!-- show available ?? -->
1970  # if (data.paymentamount !== undefined) { #
1971  <td role="gridcell" title="" style='text-align: right;' tabindex="0">
1972  <span class="#= data.paymentamount < 0 ? 'currency_negative' : 'currency_positive' #">#= kendo.format("{0:c}", data.paymentamount) #</span>
1973  </td>
1974  # } #
1975  <?php if ($HB_ENV['Fset'] & GetFlagsetValue('CU_SHOWAVAILABLE')) : ?>
1976  # if (data.localaccounttype == 'dp') { #
1977  <td role="gridcell" title="" style='text-align: right;' tabindex="0">
1978  # if (data.availablebal !== null) {
1979  var availableTitle = GetSyncTitle('available', kendo.format("{0:c}", parseFloat(availablebal)), as_of_date);
1980  #
1981  # if (data.out_of_sync) { #
1982  <span class="local-sync-tooltip fa fa-exclamation-triangle" title="#= availableTitle #" ></span>
1983  # } else { #
1984  <span class="#= data.availablebal < 0 ? 'currency_negative' : 'currency_positive' #">#= kendo.format("{0:c}", data.availablebal) #</span>
1985  # } #
1986  # } else { #
1987  <span></span>
1988  # } #
1989  </td>
1990  # } #
1991  <?php endif; ?>
1992  <td style="display:none" role="gridcell" title="" tabindex="0">#= as_of_date #</td>
1993  # if (data.localaccounttype !== 'dp') { #
1994  <td role="gridcell" title="" style='text-align: right;' tabindex="0">
1995  # if (data.nextduedate != null) { #
1996  <span class='#= (data.pastdue == '1' && (data.nextduedate != null && data.nextduedate != 'N/A') ? 'summary-data-notify' : '') #'>#= kendo.toString(data.nextduedate, 'MM/dd/yyyy'
1997  )#</span>
1998  # } else { #
1999  <span class=''>N/A</span>
2000  # } #
2001  # if (data.pastdue === '1' && (data.nextduedate !== null)) { #
2002  <span class="local-sync-tooltip fa fa-calendar" title="#= kendo.toString(data.nextduedate, 'MM/dd/yy') # - <?php echo $MC->msg('Payment Past Due', HCU_DISPLAY_AS_JS); ?>" ></span>
2003  # } #
2004  </td>
2005  # } #
2006  # } #
2007  # } #
2008  </tr>
2009  </script>
2010 
2011 <?php
2012  foreach(array_keys($Disp_Balances_ary) as $acctType) {
2013  // Loop through the keys {dp, ln, cc}
2014  if (HCU_array_key_exists($acctType, $displayJsonData)) {
2015 ?>
2016  <div style="margin: 0 15px;">
2017  <br/>
2018  <h4><?php echo $Disp_Balances_ary[$acctType]['acct_title']; ?><?php if($serviceViewFromCUAdmin) {echo ' (' . $HB_ENV['Cn'] . ')'; } ?></h4>
2019  </div>
2020 
2021  <!-- MOBILE TABLES -->
2022  <div style="margin: 15px; font-size: 12px;" id="hcuMobileTable<?php echo $acctType; ?>" class="desktop-hide no-print <?php echo ($Disp_Balances_ary[$acctType]['acct_history'] ? 'hcu-activity' : 'hcu-no-activity'); ?>"></div>
2023  <!-- DESKTOP TABLES -->
2024  <div style="margin: 15px; font-size: 12px;" class="mobile-hide hcu-grid-style" id="hcuTable<?php echo $acctType; ?>" class="<?php echo ($Disp_Balances_ary[$acctType]['acct_history'] ? 'hcu-activity' : 'hcu-no-activity'); ?>"></div>
2025 <?php
2026  }
2027 }
2028 ?>
2029 
2030 <!-- HTML FOR DETAILS POP UP -->
2031 <!-- ONLY FOR XS DEVICEES -->
2032 <div id="detailsPopUp" style="font-size: 12px;">
2033 </div>
2034 
2035 <?php
2036 /*
2037  * SHOW MESSAGES
2038  * This part of the script will put down code to actually show the necessary
2039  * messages. These may include the embedded marketing message popup promo,
2040  * popup mkt msg, or popup survey.
2041  * OR if there is a live connection error.
2042  */
2043 if ($showEmbedMsg != '' || $initialPopup != ''): ?>
2044 <script>
2045 <?php if ($showEmbedMsg != ''): ?>
2046 var userInterrupt = false;
2047 
2048 function showMsgInset() {
2049 
2050 setTimeout(function() {
2051  if (!userInterrupt) {
2052  $('#slide-in-share').slideUp("slow");
2053  }
2054 }, 8000);
2055 }
2056 
2057 $("#slide-in-handle").click(function(e) {
2058 
2059  userInterrupt = true;
2060  e.preventDefault();
2061 
2062  if ($('#slide-in-share').is(':hidden')) {
2063 
2064  $('#slide-in-share').slideDown('slow');
2065  } else {
2066 
2067  $('#slide-in-share').slideUp("slow");
2068 
2069  }
2070 });
2071 $('#slide-in-content-close').click(function(e) {
2072 e.preventDefault();
2073 userInterrupt = true;
2074 $('#slide-in-share').slideUp('slow');
2075 
2076 // flag it as user closed
2077 $.post("<?php echo "{$HB_ENV['homebankingpath']}/hcuViewNotice.prg?{$HB_ENV['cuquery']}" ?>", "action=close_embedded");
2078 });
2079 
2080 <?php endif; ?>
2081 $(document).ready(function() {
2082  <?php if ($showEmbedMsg != ''): ?>
2083  var showEmbedContent = <?php print ($showEmbedMsgContent != '' ? HCU_JsonEncode($showEmbedMsgContent) : "''"); ?>;
2084  $('#slide-in-scroll').html(showEmbedContent);
2085  $('#formStatus').insertAfter($('#slide-in-share'));
2086  <?php endif; ?>
2087 
2088  <?php echo $initialPopup; ?>
2089 
2090 });
2091 
2092 
2093 <?php if ($hasPromoPopup): ?>
2094  <?php foreach ($noticePromoURL as $promoKey => $promoURL): ?>
2095  function showPromo<?php echo $promoKey; ?>() {
2096  ShowNotice('<?php echo $promoURL; ?>', ''<?php echo array_shift($nextPopupChain); ?>);
2097  }
2098  <?php endforeach; ?>
2099 <?php endif; ?>
2100 <?php if ($hasSurveyPopup): ?>
2101  function showSurvey() {
2102  ShowNotice('<?php echo $noticeSurveyURL; ?>', '<?php echo $MC->msg('Survey', HCU_DISPLAY_AS_JS); ?>'<?php echo array_shift($nextPopupChain); ?>);
2103  }
2104 <?php endif; ?>
2105 <?php if ($hasMktMsgPopup): ?>
2106  function showMktMsg() {
2107  ShowNotice('<?php echo $noticeMktMsgURL; ?>', '<?php echo $HB_ENV['pname']; ?> <?php echo $MC->msg("Notice", HCU_DISPLAY_AS_JS); ?>'<?php echo array_shift($nextPopupChain); ?>);
2108  }
2109 <?php endif; ?>
2110 
2111 
2112 
2113 </script>
2114 <?php endif; ?>
2115 <?php
2116 
2117 if (!$serviceViewFromCUAdmin) {
2118 // ** INCLUDE POST CONTENT SCRIPT
2119 require_once(dirname(__FILE__) . '/../includes/hcuPostContent.i');
2120 }
2121 /*
2122  * ** END CONTENT
2123  */