13 require_once(dirname(__FILE__) .
'/../../shared/library/dms_imp_val.i');
14 require_once(dirname(__FILE__) .
'/../../shared/library/hcuCommon.i');
16 $string= array(
"filter" => FILTER_DEFAULT);
17 $actualString= array(
"filter" => FILTER_SANITIZE_STRING);
19 $parameters= array(
"a" => array(
"action" =>
""));
20 HCU_ImportVars($parameters,
"a", array(
"action" => $actualString));
21 extract($parameters[
"a"]);
23 if ($action ===
"esTermsStop" ) {
28 $serviceShowInfo =
false;
29 $serviceLoadMenu =
false;
30 $serviceShowMenu =
false;
33 require_once(dirname(__FILE__) .
'/../library/hcuService.i');
39 if (!PermCheckFeatureScreen($dbh, $HB_ENV, $MC, FEATURE_ESTATEMENTS,
'',
false)) {
40 throw new Exception (HCU_JsonEncode($MC->msg(
'Rights not set', HCU_DISPLAY_AS_HTML)));
43 $SPEEDBUMP_FEATURE =
"ES";
44 require_once(dirname(__FILE__) .
'/../includes/hcuAccountSelector.i');
45 $Ca = $HB_ENV[
"selected_account"];
47 HCU_ImportVars($HB_ENV,
"HCUPOST", array(
"stop_reason" => $string,
"account" => $string,
"formTerms" => $string,
"termsAgree" => $string,
"cu" => $string));
49 $account= HCU_array_key_exists(
"account", $HB_ENV[
"HCUPOST"]) ? trim($HB_ENV[
"HCUPOST"][
"account"]) :
"";
50 $account= $account ==
"" ?
"" :
"&account=$account";
52 $retStatus_ary = Array(
54 'homecuErrors' => Array(),
58 if ( strlen( $HB_ENV[
'HCUPOST'][
'formTerms'] ) > 0 &&
59 $HB_ENV[
'HCUPOST'][
'termsAgree'] ==
"Y" ) {
61 $formTermsAry= HCU_PayloadDecode($HB_ENV[
"Cu"], $HB_ENV[
'HCUPOST'][
'formTerms']);
64 if ( $formTermsAry[
'formTimeExpire'] > mktime() &&
65 $formTermsAry[
'formView'] ==
"stop" ) {
67 $HB_ENV[
'esProcessMode'] = $formTermsAry[
'formView'];
69 $esResults = Post_CUEStmt($dbh, $HB_ENV, $MC, $Ca);
71 if ( $esResults[
"status"][
"code"] ==
"000" ) {
75 $retStatus_ary[
'homecuInfo'] = $esResults[
"homecuInfo"];
78 $esTermsArray = Get_NoticeInfo($dbh, $HB_ENV, $MC,
'D',
"esTermsStop");
81 $HB_ENV[
"HCUPOST"][
"notice_type"] =
"C";
82 $HB_ENV[
"HCUPOST"][
"notice_id"] = intval($esTermsArray[
'notice'][0][
'notice_id']);
83 $HB_ENV[
"HCUPOST"][
"notice_device"] =
"M";
84 $HB_ENV[
"HCUPOST"][
"notice_response"] = array(
"answer" => 1 );
85 $HB_ENV[
"HCUPOST"][
"notice_cancel"] =
"0";
86 $HB_ENV[
"HCUPOST"][
"notice_accountnumber"] = $Ca;
88 $results = Update_NoticeInfo($dbh, $HB_ENV, $MC);
90 if ($results[
"status"][
"code"] !==
"000") {
91 throw new exception ($results[
"status"][
"errors"]);
95 if (is_array($esResults[
'status'][
'errors'])) {
97 $postError = $esResults[
'status'][
'errors'][0];
99 $postError = $esResults[
'status'][
'errors'];
101 throw new Exception($postError, 999);
105 throw new Exception($MC->msg(
'Feature Unavailable', HCU_DISPLAY_AS_RAW));
108 throw new Exception($MC->msg(
'Feature Unavailable', HCU_DISPLAY_AS_RAW));
110 }
catch (Exception $ex) {
113 if ($ex->getMessage() !=
'') {
114 $retStatus_ary[
'homecuErrors'][] = $ex->getMessage();
119 header(
'Content-type: application/json');
120 $retStatusJson = HCU_JsonEncode($retStatus_ary);
121 print $retStatusJson;
126 $serviceShowInfo =
true;
127 $serviceLoadMenu =
true;
128 $serviceShowMenu =
true;
129 $serviceShowBanner =
true;
130 $serviceAllowReadonly =
true;
133 require_once(dirname(__FILE__) .
'/../library/hcuService.i');
140 PermCheckFeatureScreen($dbh, $HB_ENV, $MC, FEATURE_ESTATEMENTS);
142 $SPEEDBUMP_FEATURE =
"ES";
143 require_once(dirname(__FILE__) .
'/../includes/hcuAccountSelector.i');
144 $Ca = $HB_ENV[
"selected_account"];
146 HCU_ImportVars($HB_ENV,
"HCUPOST", array(
"cu" => $string,
"formView" => $string,
"formTerms" => $string,
"formAction" => $string,
"account" => $string));
148 $account = HCU_array_key_exists(
"account", $HB_ENV[
"HCUPOST"]) ? trim($HB_ENV[
"HCUPOST"][
"account"]) :
"";
149 $account = $account ==
"" ?
"" :
"&account=$account";
154 $chome = $HB_ENV[
"chome"];
155 $Flang = $HB_ENV[
"Flang"];
157 $serviceMenuScript =
'hcuStatement';
159 require_once(dirname(__FILE__) .
'/../includes/hcuPreContent.i');
165 $retCUStatus = Get_EstmtEnrollStatus($dbh, $HB_ENV, $MC, $Ca);
166 if (!$retCUStatus[
'status'][
'code'] ==
'999') {
167 if ($retCUStatus[
'status'][
'errors'][0] !=
'') {
168 $errMsg = $retCUStatus[
'status'][
'errors'][0];
170 $errMsg = $pMC->msg(
'Contact CU', HCU_DISPLAY_AS_RAW);
172 throw new Exception($errMsg, 1);
176 $setOptionsArray = Array(
"formView" =>
"stop",
"formTimeExpire" => mktime() + 86400);
177 $setFormTerms = HCU_PayloadEncode($Cu, $setOptionsArray);
180 $esTermsArray = Get_NoticeInfo($dbh, $HB_ENV, $MC,
'D',
"esTermsStop");
184 if ($esTermsArray[
'status'][
'code'] !=
'000' || count($esTermsArray[
"notice"]) == 0 || $esTermsArray[
'notice'][0][
'notice_text'] ==
'') {
186 throw new Exception($MC->msg(
'Feature Not Set', HCU_DISPLAY_AS_HTML) .
'. ' . $MC->msg(
'Contact CU', HCU_DISPLAY_AS_HTML), 2);
189 $cbAnswer = $esTermsArray[
"notice"][0][
"notice_answers"][0][
"answer_text"];
191 <script type=
"text/javascript">
192 $(document).ready(
function() {
193 var kendoWindow = $(
"<div />").kendoWindow({
195 title:
"<?php echo $MC->msg("Complete
", HCU_DISPLAY_AS_JS) ?>",
205 homecuTooltip.reset();
206 homecuTooltip.bind({ systemEmail:
"<?php echo $MC->msg("Use MemberSettings
", HCU_DISPLAY_AS_JS); ?>" });
208 $.homecuValidator.setup({formValidate:
"esForm", formErrorTitle:
"<?php echo $MC->msg("Error Occurred
", HCU_DISPLAY_AS_JS) ?>", validateOnClick:
"btnPositive"});
210 $(
'#btnPositive').click(
function() {
211 if ($.homecuValidator.homecuValidate) {
214 $.post(
"hcuStatementStop.prg?cu=<?php echo $HB_ENV['cu']; ?><?php echo $account; ?>", $(
'#esForm').serialize(),
219 RequestSuccessful =
false;
226 if (NoticeResp[
'homecuErrors']) {
228 if (NoticeResp[
'homecuErrors'].length > 0) {
230 $.homecuValidator.displayMessage(NoticeResp[
'homecuErrors'], $.homecuValidator.settings.statusError);
231 RequestSuccessful =
false;
236 if (NoticeResp[
'homecuInfo'] && !RequestSuccessful) {
238 if (NoticeResp[
'homecuInfo'].length > 0) {
241 $(
'#formTerms').val(
'');
242 $(
'#postResponse').html(NoticeResp[
'homecuInfo']);
243 kendoWindow.data(
"kendoWindow").content($(
'#submitResponse').html()).center().open();
244 RequestSuccessful =
true;
247 if (!RequestSuccessful) {
249 throw '<?php echo $MC->msg('Bill Pay Error
', HCU_DISPLAY_AS_JS); ?>';
253 $.homecuValidator.displayMessage(err, $.homecuValidator.settings.statusError);
254 kendoWindow.data(
"kendoWindow").close();
257 .done (
function (data) {
260 .fail(
function(jqXHR, textStatus) {
262 $.homecuValidator.displayMessage(
'<?php echo $MC->msg('problem encountered
', HCU_DISPLAY_AS_JS); ?>', $.homecuValidator.settings.statusError);
263 $(
'#formTerms').val(
'');
270 var btnPositive = $(
"#btnPositive").kendoButton({
273 if ( $(
"#stop_reason").val().length === 0 ) {
274 btnPositive.enable(
false);
278 }).data(
"kendoButton");
280 $(
"#termsAgree").click(
function() {
284 $(
"#stop_reason").keyup(
function() {
288 function EnablePositiveBtn() {
289 if ( $(
"#stop_reason").val().length === 0 || !$(
"#termsAgree").prop(
"checked") ) {
290 btnPositive.enable(
false);
292 btnPositive.enable(
true);
297 <div
class=
'k-content container-fluid' id=
"profile" style=
"max-width:500px;" >
298 <form
id=
'esForm' NAME=
'esForm' class=
'formInputx' ACTION=
'<?php echo $HB_ENV['loginpath
'] . "/" . $HB_ENV['currentscript
'] . "?" . $HB_ENV['cuquery
']; ?><?php echo $account; ?>' 300 <input type=
'hidden' id=
'formTerms' name=
'formTerms' value=
'<?php echo $setFormTerms ?>'>
301 <INPUT TYPE=
'hidden' NAME=
'action' VALUE=
'esTermsStop'>
304 <div
class=
"col-xs-12">
307 <div style=
"max-height: 400px;overflow: auto">
308 <?php
if ($account !=
"") { ?>
309 <h4><?php echo $MC->msg(
"Account #", HCU_DISPLAY_AS_HTML) . $Ca; ?></h4>
311 <h3><?php echo $MC->msg(
"E-STATEMENT STOP REQUEST", HCU_DISPLAY_AS_HTML) ?></h3>
312 <?php echo $esTermsArray[
'notice'][0][
'notice_text']; ?>
318 <div
class=
"col-xs-12">
320 <div style=
"margin:10px 0;">
321 <input required type=
"checkbox" 325 validationMessage=
"<?php echo $MC->msg('REQUIRED FIELDS', HCU_DISPLAY_AS_HTML) ?>">
326 <?php echo $cbAnswer ?><span
class=
"k-invalid-msg" data-
for=
"termsAgree"></span>
331 <div
class=
"col-xs-12">
333 <div
class=
'field-label-wrapper'>
334 <label
for=
"stop_reason"><?php echo $MC->msg(
'Why Stop', HCU_DISPLAY_AS_HTML) ?>: </label>
336 <textarea required
id=
'stop_reason' name=
'stop_reason' rows=
'4' cols=
'40' wrap=
"virtual" class=
'k-textbox' style=
'width:100%; max-width:450px;' validationMessage=
"<?php echo $MC->msg('REQUIRED FIELDS', HCU_DISPLAY_AS_HTML) ?>"></textarea>
340 <div
class=
"col-xs-12">
343 <div
class=
"col-xs-12 col-sm-6 hcu-xs-btn-margin-top">
344 <button
id=
'btnNegative' onclick=
"document.location='<?php echo $HB_ENV['loginpath'] . "/hcuStatement.prg?
" . $HB_ENV['cuquery']; ?><?php echo $account; ?>'" name=
'btnNegative' type=
"button" class=
"k-button" style=
"width:100%;"><span
class=
"fa fa-times"></span> <?php print $esTermsArray[
'notice'][0][
'notice_negative_caption']; ?></button>
346 <div
class=
"col-xs-12 col-sm-6 hcu-xs-btn-margin-top" style=
'text-align:right'>
347 <?php
if ($esTermsArray[
'notice'][0][
'notice_positive_caption'] !=
''): ?>
348 <button
id=
'btnPositive' name=
'btnPositive' type=
"button" class=
"k-button" style=
"width:100%;"><span
class=
"fa fa-check"></span> <?php print $esTermsArray[
'notice'][0][
'notice_positive_caption']; ?></button>
354 <div
id=
'submitResponse' style=
'display:none;'>
355 <div
class=
'k-block'>
356 <div
class=
'k-header k-shadow' style=
"text-align:center"><?php echo $MC->msg(
'Credit Union responded', HCU_DISPLAY_AS_HTML); ?> <span
id=
"displayStatus"></span></div>
358 <span
id=
'postResponse'><?php echo $MC->msg(
'Thank you your request will be sent', HCU_DISPLAY_AS_HTML); ?></span>
362 <button type=
"button" id=
"btnContinue" name=
"btnContinue" onclick=
"window.location='<?php echo $HB_ENV['loginpath'] . "/hcuAccounts.prg?
" . $HB_ENV['cuquery']; ?>'" class=
"k-button"><span
class=
"fa fa-arrow-right"></span> <?php echo $MC->msg(
'Continue', HCU_DISPLAY_AS_HTML); ?></button>
367 }
catch (Exception $err) {
371 <div
class=
'formContent'>
373 <div
class=
"col-xs-12">
374 <div
class=
"" style=
"max-height: 600px;overflow: auto">
375 <?php echo $err->getMessage(); ?>
378 <div
class=
"col-xs-12">
381 <div
class=
"col-xs-12">
382 <button
id=
'btnNegative' onclick=
"document.location='<?php echo $HB_ENV['loginpath'] . "/hcuAccounts.prg?
" . $HB_ENV['cuquery']; ?>'" name=
'btnNegative' type=
"button" class=
"k-button"><span
class=
"fa fa-arrow-right"></span> <?php echo $MC->msg(
'Continue', HCU_DISPLAY_AS_HTML); ?></button>
398 require_once(dirname(__FILE__) .
'/../includes/hcuPostContent.i');