11 $serviceShowInfo =
true;
12 $serviceLoadMenu =
true;
13 $serviceShowMenu =
true;
14 $serviceAllowReadonly =
true;
17 require_once(dirname(__FILE__) .
'/../library/hcuService.i');
23 PermCheckFeatureScreen($dbh, $HB_ENV, $MC, FEATURE_ESTATEMENTS);
24 $SPEEDBUMP_FEATURE =
"ES";
25 require_once(dirname(__FILE__) .
'/../includes/hcuAccountSelector.i');
26 $Ca = $HB_ENV[
"selected_account"];
28 $string= array(
"filter" => FILTER_DEFAULT);
29 $parameters = array(
"a" => array(
"action" =>
"",
"st_id" =>
"",
"account" =>
""));
30 HCU_ImportVars($parameters,
"a", array(
"action" => $string,
"st_id" => $string,
"account" => $string));
31 extract($parameters[
"a"]);
33 $account = isset($account) ? trim($account) :
"";
34 $account = $account ==
"" ?
"" :
"&account=$account";
36 $startStopMessage =
"";
39 if ($action ==
"statement" ) {
43 $pdfInfo = Create_PDF_Statement( $stId, $HB_ENV, $MC, $Ca );
45 # else spew the content 46 if ( $pdfInfo[
"status"][
"code"] ==
"0" ) {
51 print
"<div class='container-fluid'>";
54 for ( $i = 0; $i < count( $pdfInfo[
"errors"] ); $i++ ) {
55 if ( strlen( $errorMessage ) ) $errorMessage .=
"<br>";
57 $errorMessage .= $pdfInfo[
"errors"][$i];
60 print
"<div class='row'>";
61 print
"<div class='col-xs-12 col-sm-8' style='color:red; font-size:larger;'>$errorMessage</div>";
65 if ( count( $pdfInfo[
"errors"] ) ) {
66 print
"<div class='row'>";
67 print
"<div class='col-xs-12 col-sm-8' style='margin:50px 25px;'>{$MC->msg('Please try again later', HCU_DISPLAY_AS_HTML) }</div>";
75 }
else if ($action ===
"esTermsStart" || $action ===
"esTermsStop" ) {
76 $HB_ENV[
'esProcessMode'] = $action ==
"esTermsStart" ?
"start" : ( $action ==
"esTermsStop" ?
"stop" :
"");
77 $esResults = Post_CUEStmt($dbh, $HB_ENV, $MC, $Ca);
80 if ( $esResults[
"status"][
"code"] ==
"000" ) {
82 $startStopMessage = $esResults[
"homecuInfo"];
84 $startStopMessage =
"";
85 for ( $i = 0; $i < count( $esResults[
"status"][
"errors"] ); $i++ ) {
86 if ( strlen( $startStopMessage ) ) {
87 $startStopMessage .=
"<br>";
90 $startStopMessage .=
"<div style='margin:50px 25px; color:red; font-size:larger;'>{$esResults["status
"]["errors
"][$i]}</div>";
98 $chome = $HB_ENV[
"chome"];
99 $Flang = $HB_ENV[
"Flang"];
105 require_once(dirname(__FILE__) .
'/../includes/hcuPreContent.i');
111 $Flang = (trim($Flang) ==
"" ?
"en_US" : trim($Flang));
113 if ( $HB_ENV[
'offline'] !=
"N" ) {
114 $thisPageErrors = $HB_ENV[
"offlinemsg"];
115 throw new Exception( HCU_JsonEncode( $thisPageErrors ), 1);
119 $eStmtInfo = Get_Estmt($dbh, $HB_ENV, $MC, $Ca);
121 if ( $eStmtInfo[
"status"][
"code"] ==
"999" && count( $eStmtInfo[
"status"][
"errors"] ) > 0 ) {
123 $thisPageErrors = $eStmtInfo[
"status"][
"errors"];
124 throw new Exception( HCU_JsonEncode( $thisPageErrors ), 2);
128 <div
class=
"k-content" style=
'font-size:12px;'>
129 <div
id=
"messageWindow" name=
"messageWindow"></div>
133 if ( strlen( $startStopMessage ) ) { ?>
134 <div
class=
"col-xs-12 hcuSpacer"><div
class=
"k-block k-info-colored"><?php echo $startStopMessage; ?></div></div>
138 if ( strlen( $errorMessage ) ) {
139 print
"<p>$errorMessage</p>";
145 $noticesAry = Get_NoticeInfo($dbh, $HB_ENV, $MC,
"D",
"esNotice",
true);
148 $hasNoticePopup =
false;
149 if ( $noticesAry[
"status"][
"code"] ==
"000" && count($noticesAry[
"notice"]) > 0 && $noticesAry[
"notice"][0][
"notice_id"] ) {
151 $noticeOption = $noticesAry[
'notice'][0];
153 $noticeOptions = Array (
154 'docsid' => $noticeOption[
'notice_id'],
155 'docstype' => $noticeOption[
'notice_type'],
158 'expireTime' => mktime() + 86400
161 $encryptedDocDetails = HCU_PayloadEncode($HB_ENV[
'Cu'], $noticeOptions);
163 $noticeOptions[
'noticeOnly'] = 1;
165 $encryptedDocDetailsNoticeOnly = HCU_PayloadEncode($HB_ENV[
'Cu'], $noticeOptions);
169 if ($noticeOption[
'notice_popup'] > 0) {
170 $hasNoticePopup =
true;
171 $noticeURL = $HB_ENV[
'homebankingpath'] .
'/hcuViewNotice.prg?cu=' . $HB_ENV[
'cu'] .
'&x=' . urlencode($encryptedDocDetails);
175 $noticeURLNoticeOnly = $HB_ENV[
'homebankingpath'] .
'/hcuViewNotice.prg?cu=' . $HB_ENV[
'cu'] .
'&x=' . urlencode($encryptedDocDetailsNoticeOnly);
178 $newsletterList = HCU_array_key_exists(
"pdflinks", $eStmtInfo[
"estmt"]) ? $eStmtInfo[
"estmt"][
"pdflinks"] : array();
179 $eStmtList = HCU_array_key_exists(
"toclinks", $eStmtInfo[
"estmt"]) ? $eStmtInfo[
"estmt"][
"toclinks"] : array();
182 <?php
if ($account !=
"") { ?>
184 <div
class=
"col-xs-12">
185 <h4><?php echo $MC->msg(
"Account #", HCU_DISPLAY_AS_HTML) . $Ca; ?></h4>
190 $newsletters = array();
193 if ( count( $newsletterList ) ) { ?>
194 <div
class=
"col-xs-12 col-sm-6 col-lg-8"><div
class=
"panel panel-default">
195 <div
class=
"panel-heading"><?php echo $MC->msg(
'Newsletters', HCU_DISPLAY_AS_HTML); ?></div>
196 <div
class=
"panel-body" id=
"listViewNewsletters"></div>
201 if ( $eStmtInfo[
"estmt"][
"enrolled"] ==
"W" ) {
203 $statementMessage = $MC->msg(
'Statement Not Found', HCU_DISPLAY_AS_HTML) .
" " . $MC->msg(
'Statement Missing', HCU_DISPLAY_AS_HTML) .
" " . $MC->msg(
"Statements Stop", HCU_DISPLAY_AS_HTML);
205 $termsName =
"esTermsStop";
206 $termsTitle = $MC->msg(
"Stop e-Statements", HCU_DISPLAY_AS_JS );
207 }
else if ( $eStmtInfo[
"estmt"][
"enrolled"] ==
"Y" ) {
208 $statementMessage = $MC->msg(
"Statements Stop", HCU_DISPLAY_AS_HTML);
210 $termsName =
"esTermsStop";
211 $termsTitle = $MC->msg(
"Stop e-Statements", HCU_DISPLAY_AS_JS );
213 $statementMessage = $MC->msg(
'Account not set for EStatements', HCU_DISPLAY_AS_HTML) .
". " . $MC->msg(
'Sign up fast', HCU_DISPLAY_AS_HTML);
215 $termsName =
"esTermsStart";
216 $termsTitle = $MC->msg(
"Start e-Statements", HCU_DISPLAY_AS_JS);
220 $hasTermsPopup =
false;
221 if ( $start ==
"start" ) {
222 $termsAry = Get_NoticeInfo($dbh, $HB_ENV, $MC,
"D", $termsName);
229 if ( $termsAry[
"status"][
"code"] ==
"000" && $termsAry[
"notice"][0][
"notice_id"] ) {
231 $termsOption = $termsAry[
'notice'][0];
233 $termsOptions = Array (
234 'docsid' => $termsOption[
'notice_id'],
235 'docstype' => $termsOption[
'notice_type'],
238 'expireTime' => mktime() + 86400,
239 "accountnumber" => $Ca
242 $encryptedDocDetails = HCU_PayloadEncode($HB_ENV[
'Cu'], $termsOptions);
245 $hasTermsPopup =
true;
247 $termsURL = $HB_ENV[
'homebankingpath'] .
'/hcuViewNotice.prg?cu=' . $HB_ENV[
'cu'] .
'&x=' . urlencode($encryptedDocDetails);
251 <div
class=
"col-xs-12 col-sm-6 col-lg-4"><div
class=
"panel panel-default">
252 <div
class=
"panel-heading"><?php echo $MC->msg(
'EStatement Service', HCU_DISPLAY_AS_HTML); ?></div>
253 <div
class=
"panel-body">
254 <?php echo $statementMessage; ?>
255 <?php
if ( $start ==
"start" ) { ?>
256 <a
id=
'termsButton'><?php echo $MC->msg(
"Click Here", HCU_DISPLAY_AS_HTML); ?></a>
258 <a onClick=
'location.href="<?php echo $HB_ENV['homebankingpath
'] . '/hcuStatementStop.prg?
' . $HB_ENV['cuquery
'] . $account; ?>"'>
259 <?php echo $MC->msg(
"Click Here", HCU_DISPLAY_AS_HTML); ?></a>
266 if ( $start ==
"start" ) {
268 $actionPath = $HB_ENV[
'loginpath'] .
"/" . $HB_ENV[
'currentscript'] .
"?" . $HB_ENV[
'cuquery'] .
"$account";
270 <form
class=
'' id=
'formAcceptTerms' name=
'formAcceptTerms' method=
"post" action=
'$actionPath'>
271 <input type=
"hidden" name=
"action" value=
"$termsName" />
272 <input type=
"hidden" name=
"notice_id" value=
"{$termsAry["notice
"][0]["notice_id
"]}" />
278 for ( $i = 0; $i < count( $newsletterList ); $i++ ) {
279 $newsletters[] = array(
"eStmtTitle" => trim($newsletterList[$i][
"pdftitle"]),
"eStmtType" =>
"",
"eStmtLink" => $newsletterList[$i][
"pdfpath"]);
282 $eStmtData = array();
283 if ( count( $eStmtList ) ) { ?>
285 <div
class=
"col-xs-12"><div
class=
"panel panel-default">
286 <div
class=
"panel-heading"><?php echo $MC->msg(
'E-Statements', HCU_DISPLAY_AS_HTML); ?>
288 <ul
id=
'filterStatements'>
289 <li><?php echo $MC->msg(
'Filter', HCU_DISPLAY_AS_HTML); ?>
291 <li><?php echo $MC->msg(
'All Available', HCU_DISPLAY_AS_HTML); ?></li>
292 <li><?php echo $MC->msg(
'Monthly', HCU_DISPLAY_AS_HTML); ?></li>
293 <li><?php echo $MC->msg(
'Quarterly', HCU_DISPLAY_AS_HTML); ?></li>
294 <li><?php echo $MC->msg(
'Annual', HCU_DISPLAY_AS_HTML); ?></li>
299 <div
class=
"panel-body" id=
"listViewStatements"></div>
303 for ( $i = 0; $i < count( $eStmtList ); $i++ ) {
304 $eStmtLink =
"{$HB_ENV['homebankingpath']}/hcuStatement.prg?action=statement{$account}&cu={$Cu}&Flang={$Flang}";
305 $eStmtLink .=
"&st_id=" . $eStmtList[$i][
'PerKey'];
307 $eStmtLink .=
"&c=" . $eStmtList[$i][
'PerTokn'];
309 $eStmtData[] = array(
"eStmtTitle" => trim($eStmtList[$i][
"PerDesc"]),
310 "eStmtType" => $eStmtList[$i][
"PerType"],
"eStmtTypeText" => $eStmtList[$i][
"PerTypeText"],
311 "eStmtLink" => $eStmtLink
323 <div
class=
"col-xs-12">
324 <a
id=
"msgButton"><?php echo $noticeOption[
"notice_linkdisplay"] ?></a>
333 #listViewStatements { 345 min-height: 90px; <?php
348 display:
inline-block;
353 padding: 5px 0px 5px 5px;
371 text-transform: uppercase;
380 text-decoration:none;
381 background-color: #fff;
384 background-color: #f0713a;
395 .k-menu .k-group.k-popup{
398 .k-widget.k-menu-horizontal > .k-item{
401 #filterStatements .k-link { 405 @media (max-width: 600px) {
417 $(document).ready(
function() {
418 var newsletters = <?php echo HCU_JsonEncode($newsletters); ?>;
419 var estatements = <?php echo HCU_JsonEncode($eStmtData); ?>;
422 var noticeURLNoticeOnly =
"<?php echo isset($noticeURLNoticeOnly) ? trim($noticeURLNoticeOnly) : ''; ?>";
423 var termsURL =
"<?php echo isset($termsURL) ? trim($termsURL) : ''; ?>";
424 var termsTitle =
"<?php echo isset($termsTitle) ? trim($termsTitle) : ''; ?>";
425 var noticeURL =
"<?php echo isset($noticeURL) ? trim($noticeURL) : ''; ?>";
427 $(
"#listViewNewsletters").kendoListView({
428 dataSource: newsletters,
429 template: kendo.template($(
"#newsletterTemplate").html())
432 $(
"#listViewStatements").kendoListView({
433 dataSource: estatements,
434 template: kendo.template($(
"#statementTemplate").html())
437 $(
"#filterStatements").kendoMenu({
438 select: onFilterSelect
441 $(
".statement" ).hover(
443 $( this ).addClass(
"k-info-colored" );
445 $( this ).removeClass(
"k-info-colored" );
449 function onFilterSelect(e) {
450 var selectedText = $(e.item).text();
452 var showMonthly =
"inline-block";
453 var showQuarterly =
"inline-block";
454 var showAnnual =
"inline-block";
455 if ( selectedText ===
"<?php echo $MC->msg("Monthly
", HCU_DISPLAY_AS_JS); ?>" ) {
456 showQuarterly =
"none";
458 }
else if ( selectedText ===
"<?php echo $MC->msg("Quarterly
", HCU_DISPLAY_AS_JS); ?>" ) {
459 showMonthly =
"none";
461 }
else if ( selectedText ===
"<?php echo $MC->msg("Annual
", HCU_DISPLAY_AS_JS); ?>" ) {
462 showMonthly =
"none";
463 showQuarterly =
"none";
466 $(
".monthly").css(
"display",showMonthly);
467 $(
".quarterly").css(
"display",showQuarterly);
468 $(
".annual").css(
"display",showAnnual);
471 function PostResponse() {
473 document.formAcceptTerms.submit();
476 $(
"#msgButton").click(
function() {
477 openWindow = ShowNotice(noticeURLNoticeOnly);
479 $(
"#termsButton").click(
function() {
480 openWindow = ShowNotice(termsURL, termsTitle, PostResponse );
484 if ( $hasTerms && $hasTermsPopup ) {
487 openWindow = ShowNotice(termsURL, termsTitle, PostResponse );
489 }
else if ( $hasNotice && $hasNoticePopup ) {
490 # pop open new window for ~cu/EStatement.html (lower priority) 492 openWindow = ShowNotice(noticeURL);
496 $(document).on(
"click",
".k-overlay",
function () {
507 function createWindow(type, contentString, title) {
509 if ( $HB_ENV[
"platform"] ==
"ADA" || $HB_ENV[
"platform"] ==
"APP" ) {
512 window.location.href = contentString;
517 window.open(contentString,
"print_view",
"width=825, height=650, resizable=yes");
523 function GetNotice() {
524 $(document.body).append(
'<div id="noticeWindow"></div>');
525 $(
'#noticeWindow').kendoWindow({
527 actions: [
"Close" ],
530 title:
"<?php echo $MC->msg("Important
", HCU_DISPLAY_AS_JS) ?>",
533 refresh:
function() {this.center();},
535 var dialog = $(
"#noticeWindow").data(
"kendoWindow");
538 activate:
function(e) {
539 $(
".k-window").height(
"");
540 $(
".k-content-frame").height(
"");
545 var dialog = $(
"#noticeWindow").data(
'kendoWindow');
546 dialog.center().open();
550 <script type=
"text/x-kendo-template" id=
"newsletterTemplate">
551 <div
class=
"statement k-block k-shadow k-link" onClick=
'createWindow("newsletter", "#= eStmtLink#", "#= eStmtTitle #")'>
552 <span
class=
"newsletter-text fa fa-file fa-2x col-xs-3 col-sm-2" title=
"#= eStmtTitle#"></span>
553 <div
class=
"col-xs-9 col-sm-10 hcu-nopadding">
554 <h3
class=
"col-xs-12">#= eStmtTitle#</h3>
555 <h4
class=
"col-xs-12">#= eStmtType#</h4>
559 <script type=
"text/x-kendo-template" id=
"statementTemplate">
560 <div
class=
"statement 561 #if ( eStmtType === "Monthly
" ) { # 563 #} else if ( eStmtType === "Quarterly
" ) { # 565 #} else if ( eStmtType === "Annual
" ) { # 568 k-block k-shadow k-link" onClick=
'createWindow("statement", "#= eStmtLink#", "#= eStmtTitle#")'>
569 <span
class=
"fa fa-file-text fa-2x col-xs-3 col-sm-2" title=
"#= eStmtTitle #"></span>
570 <div
class=
"col-xs-9 col-sm-10 hcu-nopadding">
571 <h3
class=
"col-xs-12">#= eStmtTitle#</h3>
572 <h4
class=
"col-xs-12">#= eStmtTypeText#</h4>
581 }
catch (Exception $ex) {
584 $thisPageErrors = HCU_JsonDecode($ex->getMessage());
587 $serviceErrorCode =
'917';
588 $serviceErrorTitle =
"";
589 $serviceErrorMsgs = $thisPageErrors;
591 require_once(dirname(__FILE__) .
'/../includes/hcuErrorPage.i');
596 require_once(dirname(__FILE__) .
'/../includes/hcuPostContent.i');