27 $serviceShowInfo =
false;
28 $serviceLoadMenu =
false;
29 $serviceShowMenu =
false;
30 $serviceAllowReadonly =
false;
31 $serviceSkipSecurity =
true;
34 require_once(dirname(__FILE__) .
'/../library/hcuService.i');
36 $string= array(
"filter" => FILTER_DEFAULT);
37 HCU_ImportVars($HB_ENV,
"HCUPOST", array(
"cu" => $string,
"notice_type" => $string,
"notice_id" => $string,
"notice_link" => $string,
"notice_device" => $string,
"notice_msg_show" => $string,
38 "notice_response" => HCUFILTER_INPUT_ARRAY,
"x" => $string,
"notice_cancel" => $string,
"tooLong" => $string,
"notice_accountnumber" => $string));
46 if (empty($HB_ENV[
'HCUPOST'][
'x']) && isset($HB_ENV[
'HCUPOST'][
'notice_id'])) {
48 'homecuInfo' =>
'CLOSE',
49 'homecuErrors' => Array(),
60 $retStatus_ary = Update_NoticeInfo($dbh, $HB_ENV, $MC);
65 if ($retStatus_ary[
'status'][
'code'] ==
'000') {
67 if ($retStatus_ary[
'response'][
'notice_action'] ==
'DISPLAY') {
70 if (is_array($retStatus_ary[
'response'][
'notice_results'])) {
72 if (count($retStatus_ary[
'response'][
'notice_results'][0][
'notice_answers']) > 0) {
74 foreach ($retStatus_ary[
'response'][
'notice_results'][0][
'notice_answers'] as $answer_idx => $answer_row) {
76 <div class='col-xs-12 hcu-nopadding'>{$answer_row['answer_text']}</div> 77 <div class='col-xs-12 hcu-nopadding'> 78 <div class='survey-result-show'> 79 <div id='ansid{$answer_idx}' dms-value='{$answer_row['answer_votes']}'></div> 84 if ($answer_html !=
'') {
88 <div id='s-result' class='container-fluid'> 90 <div class='col-xs-12 hcu-nopadding h4'> 91 {$retStatus_ary['response']['notice_results'][0]['notice_text']} 95 <div class='survey-results'> 100 <div class='col-xs-12 hcu-nopadding'> 101 <p class='total-votes'> 102 ({$MC->msg("Total Votes
", HCU_DISPLAY_AS_HTML)}: {$retStatus_ary['response']['notice_results'][0]['notice_answervotes_ttl']}) 108 <div class='col-xs-12 hcu-nopadding'> 109 <hr style='text-align:left; margin-left:0; color:rgba(0,0,0,.57); height:1px;'/> 113 <div class='col-xs-12 hcu-nopadding' style='text-align:right;'> 114 <button type='button' class='k-button hcu-xs-100-only' id='btnNeutral' onClick='NeutralBtnNotice(\$(this), \"\");'><span class=\"fa fa-arrow-right\"></span> {$MC->msg('Continue', HCU_DISPLAY_AS_HTML)}</button> 120 #s-result .k-progressbar-horizontal { 124 .survey-result-show { 125 margin: 3px 0 10px 5px; 127 #s-result .hcu-nopadding { 132 var progressbars = []; 133 $('.survey-results .survey-result-show div').each(function () { 134 var pb = $(this).kendoProgressBar({ 137 max: {$retStatus_ary['response']['notice_results'][0]['notice_answervotes_ttl']}, 141 }).data(\"kendoProgressBar\"); 142 progressbars.push(pb); 144 $.each(progressbars, function (i, pb) { 145 if (pb.wrapper.attr('dms-value') !== 0) { 146 pb.value(pb.wrapper.attr('dms-value')); 153 $retJson_ary[
'homecuInfo'] =
'DISPLAY';
154 $retJson_ary[
'homecuData'] = $answer_html;
162 $retJson_ary[
'homecuErrors'] = $retStatus_ary[
'status'][
'errors'];
166 header(
'Content-type: application/json');
167 print HCU_JsonEncode($retJson_ary);
169 }
catch (Exception $err) {
172 $retJson_ary[
'homecuErrors'] = $MC->msg(
'Errors found', HCU_DISPLAY_AS_RAW);
173 $retJson_ary[
'homecuInfo'] =
'CLOSE';
176 header(
'Content-type: application/json');
177 print HCU_JsonEncode($retJson_ary);
182 } elseif (isset($HB_ENV[
'HCUPOST'][
'x'])) {
188 $localValues = Array (
194 'noticeStrReplace' =>
'' 197 $docValues= HCU_PayloadDecode($HB_ENV[
"Cu"], $HB_ENV[
'HCUPOST'][
'x']);
198 if ($docValues[
'expireTime'] < mktime()) {
199 throw new Exception($MC->msg(
'Link Expired', HCU_DISPLAY_AS_HTML));
201 switch ($docValues[
'docstype']) {
204 $noticeAry = Get_NoticeInfo($dbh, $HB_ENV, $MC, $docValues[
'device'], $docValues[
'docstype'], 1, $docValues[
'docsid']);
208 if ( HCU_array_key_value(
"noticeStrReplace", $docValues) !=
'' ) {
209 $HB_ENV[
"noticeStrReplace"] = HCU_JsonDecode( $docValues[
"noticeStrReplace"] );
211 $noticeAry = Get_NoticeInfo($dbh, $HB_ENV, $MC, $docValues[
'device'],
'loadcms', 1, $docValues[
'docsid']);
226 $pageOption = Array (
229 'negativeAction' =>
'',
230 'positiveAction' =>
'',
231 'noticeScript' =>
'',
232 'checkboxScript' =>
'',
236 if ($noticeAry[
'status'][
'code'] !=
'000' ) {
238 throw new Exception($MC->msg(
'Errors found', HCU_DISPLAY_AS_HTML));
241 $noticeDetail = $noticeAry[
'notice'][0];
242 $pageOption[
'noticeText'] =
'<div style="padding-bottom: 20px">' . $noticeAry[
'notice'][0][
'notice_text'] .
'</div>';
243 $pageOption[
'noticeTitle'] = $noticeAry[
'notice'][0][
'notice_title'];
244 $notice_answers =
"";
245 $notice_type = ($noticeDetail[
'notice_answertype'] ==
'O' ?
'radio' :
'checkbox');
258 switch ($noticeDetail[
'notice_type']) {
261 if (strlen($noticeDetail[
'notice_intro']) > 0) {
262 $pageOption[
'noticeText'] =
"<div><h4>{$noticeDetail['notice_intro']}</h4></div>{$pageOption['noticeText']}";
264 if (count($noticeDetail[
'notice_answers']) > 0) {
265 foreach ($noticeDetail[
'notice_answers'] as $notice_answer_key => $notice_answer_array) {
266 $notice_answers .=
"<div class='row'><div class='{$notice_type}'><label for='response{$notice_answer_array['answer_id']}'><input type='{$notice_type}' class='noticeRequired' name='notice_response[]' id='response{$notice_answer_array['answer_id']}' value='{$notice_answer_array['answer_id']}'/> {$notice_answer_array['answer_text']}</label></div></div>";
269 $notice_answers =
"<div id='survey-lines'> 273 $pageOption[
'noticeText'] .= $notice_answers;
274 $pageOption[
'noticeScript'] = <<< printjs
275 $(document).ready(
function() {
276 $(
'.noticeRequired').click(
function() {
277 $(
'#btnPositive').removeClass(
'k-state-disabled');
282 $pageOption[
'negativeAction'] =
"<button type='button' class='k-button hcu-xs-100-only' id='btnNegative' data-always-post='true' onClick='NegativeBtnNotice(\$(this), \"{$noticeDetail['notice_posttarget']}\");'><span class=\"fa fa-times\"></span> {$noticeDetail["notice_negative_caption
"]}</button>";
284 $pageOption[
'positiveAction'] =
"<button type='button' class='k-button k-primary k-state-disabled hcu-xs-100-only' id='btnPositive' onClick='PositiveBtnNotice(\$(this), \"{$noticeDetail['notice_posttarget']}\");'><span class=\"fa fa-arrow-right\"></span> {$noticeDetail["notice_positive_caption
"]}</button>";
289 $pageOption[
'noticeText'] =
"<h4 style='text-align:center'>{$pageOption['noticeTitle']}</h4>{$pageOption['noticeText']}";
290 $pageOption[
'negativeAction'] =
"<label style='cursor:pointer;'><input type='checkbox' id='msgDone' name='notice_response[]' value='{$noticeDetail["notice_answers
"][0]["answer_id
"]}' class='noticeOptional'> {$noticeDetail["notice_answers
"][0]["answer_text
"]}</label>";
292 $pageOption[
'positiveAction'] =
"<button type='button' class='k-button k-primary hcu-xs-100-only' id='btnPositive' data-always-post='true' onClick='PositiveBtnNotice(\$(this), \"{$noticeDetail['notice_posttarget']}\");'><span class=\"fa fa-arrow-right\"></span> {$noticeDetail["notice_positive_caption
"]}</button>";
302 if ( in_array($noticeDetail[
"notice_subtype"], Array(
'D',
'A',
'E',
'P'))) {
304 if ( in_array($noticeDetail[
"notice_subtype"], Array(
'A',
'E',
'P'))) {
305 $dataPost =
"data-always-post='true'";
308 if ( $noticeDetail[
"notice_subtype"] ==
"E" ) {
309 $pageOption[
"promoScript"] =
" 310 $(document).ready(function() { 311 $('#ViewContent').click( function () { 312 location.href='{$HB_ENV['loginpath']}/hcuStatement.prg?{$HB_ENV['cuquery']}'; 314 $('#ViewContent').css('cursor','pointer'); 319 if (intval($docValues[
'noticeOnly']) != 1 && $noticeDetail[
"notice_subtype"] !=
'P') {
320 $pageOption[
'negativeAction'] =
"<label style='cursor:pointer;'><input type='checkbox' id='msgDone' name='notice_response[]' value='{$noticeDetail["notice_answers
"][0]["answer_id
"]}' class='noticeOptional'> {$noticeDetail["notice_answers
"][0]["answer_text
"]}</label>";
322 $pageOption[
'positiveAction'] =
"<button type='button' class='k-button k-primary hcu-xs-100-only' {$dataPost} id='btnPositive' onClick='PositiveBtnNotice(\$(this), \"{$noticeDetail['notice_posttarget']}\");'><span class=\"fa fa-arrow-right\"></span> {$noticeDetail["notice_positive_caption
"]}</button>";
324 if (intval($docValues[
'noticeOnly']) != 1) {
325 $pageOption[
'negativeAction'] =
"<label style='cursor:pointer;'><input type='checkbox' id='msgDone' name='notice_response[]' value='{$noticeDetail["notice_answers
"][0]["answer_id
"]}' class='noticeOptional'> {$noticeDetail["notice_answers
"][0]["answer_text
"]}</label>";
327 $pageOption[
"checkboxScript"] =
" 328 $(document).ready(function() { 329 $('#msgDone').click(function() { 330 if ( $('#msgDone').prop('checked') ) { 331 $('#btnPositive').css('display', 'inline'); 332 $('#btnNegative').css('display', 'none'); 334 $('#btnPositive').css('display', 'none'); 335 $('#btnNegative').css('display', 'inline'); 340 $pageOption[
'positiveAction'] =
"<button type='button' class='k-button k-primary hcu-xs-100-only' id='btnPositive' onClick='PositiveBtnNotice(\$(this), \"{$noticeDetail['notice_posttarget']}\");' style='display:none;'><span class=\"fa fa-arrow-right\"></span> {$noticeDetail["notice_positive_caption
"]}</button>" .
341 "<button type='button' class='k-button hcu-xs-100-only' id='btnNegative' onClick='NegativeBtnNotice(\$(this), \"{$noticeDetail['notice_posttarget']}\");'><span class=\"fa fa-times\"></span> {$noticeDetail["notice_negative_caption
"]}</button>";
344 $pageOption[
'positiveAction'] =
"<button type='button' class='k-button k-primary hcu-xs-100-only' id='btnPositive' onClick='NeutralBtnNotice(\$(this), \"\");'><span class=\"fa fa-arrow-right\"></span> {$noticeDetail["notice_neutral_caption
"]}</button>";
350 $tooLong = HCU_array_key_exists(
"tooLong", $docValues) ? $docValues[
"tooLong"] == true :
false;
351 $tooLong = $tooLong ?
"tooLong" :
"";
353 $accountnumber = HCU_array_key_value(
"accountnumber", $docValues);
354 $accountnumberInput = $accountnumber ===
false ?
"" :
"<input type='hidden' name='notice_accountnumber' value='" . trim($accountnumber) .
"'>";
357 $pageBody = <<< printHtml
358 <?xml version=
"1.0"?><!DOCTYPE html>
359 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:lang=
"en" lang=
"en">
361 <title>{$pageOption[
'noticeTitle']}</title>
362 <meta charset=
"ISO-8859-1"/>
363 <meta name=
"robots" content=
"noindex,nofollow" />
364 <meta http-equiv=
"X-UA-Compatible" content=
"IE=8" />
366 {$pageOption[
'noticeScript']}
367 {$pageOption[
'checkboxScript']}
368 {$pageOption[
'promoScript']}
374 .hcu-notice-button-right {
377 #notice-window .row .col-xs-12 { 380 #notice-window .row ul { 386 <div
id=
'notice-window' class=
"container-fluid $tooLong">
387 <form
id=
'noticeForm'>
388 <input type=
'hidden' name=
'notice_type' value=
'{$noticeDetail['notice_type
']}'>
389 <input type=
'hidden' name=
'notice_id' value=
'{$noticeDetail['notice_id
']}'>
390 <input type=
'hidden' name=
'notice_device' value=
'{$docValues['device
']}'>
391 <input type=
'hidden' id=
'notice_cancel' name=
'notice_cancel' value=
'0'>
394 <div
id=
"ViewContent">
396 {$pageOption[
'noticeText']}
398 <hr
class=
"hrBar" style=
'text-align:left; margin-left:0; color:rgba(0,0,0,0.54); height:1px;'/>
399 <div
class=
"acceptability container-fluid">
400 <div
class=
"row acceptability">
401 <div
class=
"col-xs-12 col-sm-6 hcu-nopadding">
402 {$pageOption[
'negativeAction']}
404 <div
class=
"col-xs-12 col-sm-6 hcu-nopadding hcu-notice-button-right">
405 {$pageOption[
'positiveAction']}
421 }
catch (Exception $err) {
426 $serviceErrorTitle =
"";
427 $serviceErrorString = $err->getMessage();
428 $serviceErrorCode =
'916';
430 require_once(dirname(__FILE__) .
'/../includes/hcuErrorPage.i');
434 }
else if ( $_REQUEST[
"action"] ===
"close_embedded" ) {
436 header(
'Content-Type: application/json');
439 $PROMO_CLOSED = 0x8000;
440 $Fmsg_tx = $HB_ENV[
"Fmsg_tx"] |= $PROMO_CLOSED;
442 SetTicket($HB_ENV, $_COOKIE[
'Ticket'],
"Fmsg_tx=$Fmsg_tx");
451 $notice_text =
"<H1>Not Found</H1> 452 The requested file was not found on this server<P> 454 <ADDRESS>{$_SERVER['SERVER_SIGNATURE']}</ADDRESS>";
455 $notice_title =
"404 Not Found";
458 <?xml version=
"1.0"?><!DOCTYPE html>
459 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:lang=
"en" lang=
"en">
461 <title>{$notice_title}</title>
462 <meta name=
"robots" content=
"noindex,nofollow" />
463 <meta http-equiv=
"X-UA-Compatible" content=
"IE=8" />
466 <div
id=
'ViewContent'>