Odyssey
hcuErrorPage.i
1 <?php
2  /*
3  * hcuErrorPage
4  *
5  * This script could be used for a one place stop for drastic errors.
6  * some questions must be answered.
7  *
8  * This script may be processed multiple ways.
9  *
10  * As a stand alone..
11  * most likely from the hcuService script when a main error has been thrown
12  *
13  * As an include... ??
14  *
15  * Service Code Options
16  *
17  * 200/201/202
18  * STALE PACKET DATA
19  * Error Codes returned by core for LIVE Digital Banking.
20  * The script will mainly STOP for this type of error code.
21  * It is intended to handle stopping the code from continuing. But in
22  * a nice way.
23  *
24  * 900
25  * DATABASE ERROR / MASTER DIGITAL BANKING STATUS OFFLINE (digitalbanking_status)
26  * The script will STOP .. SEVERE ERROR -- Do not continue
27  *
28  * 902
29  * DIGITAL BANKING SET OFFLINE
30  * Digital banking is set to offline - Print the service message and STOP
31  *
32  * 911
33  * UNABLE TO CONTACT CORE ERROR
34  * This message is posted if we are UNABLE To retrieve information from the
35  * core
36  *
37  * 915
38  * FEATURE NOT AVAILABLE
39  * Used when a digital banking feature is NOT configured properly for a credit union.
40  * At this time, it will always print the 'Feature Unavailable' in the header section.
41  * And prints the serviceErrorMsg string in the content
42  *
43  * 916
44  * FEATURE NOT AVAILABLE (WITH CLOSE WINDOW)
45  * Used when a digital banking 3rd-party feature is NOT configured properly for a credit union.
46  * An optional title can be printed in the header section, and prints the serviceErrorMsg
47  * string in the content
48  * NOTE: The branding is already started.
49  *
50  * 917
51  * ERROR OCCURRED
52  * General error message.
53  * An optional title can be printed in the header section, and the serviceErrorMsgs
54  * is an array or a string.
55  * NOTE: The branding is already started.
56  *
57  * DEFAULT
58  * PAGE NOT FOUND
59  * If the Error Code is NOT found when passing into this script, the
60  * script will flush the current buffer and attempt to print a 404 Page
61  * Not Found message
62  *
63  */
64 
65  // ** require_once will NOT load the precontent again, if it was already called..
66 switch ($serviceErrorCode):
67  case '902':
68  // ** The Credit union is down
69  require_once('hcuPreContent.i');
70  print <<< printHtml
71  <div class='col-xs-12 col-md-8 col-lg-6'>
72  <div class='k-block k-error-colored hcu-error-margin'>
73  <div class="k-shadow k-header">
74  <span>Digital Banking Error</span>
75  </div>
76  <div class='hcu-error-padding'>
77  <span>{$serviceErrorMsg}</span>
78  </div>
79  </div>
80  </div>
81 printHtml;
82  require_once('hcuPostContent.i');
83  break;
84  case '900':
85  // ** DATABASE ISSUE -- THIS IS AN OVERALL SERVICE ISSUE --
86  // ** A generic page at this point so they don't get a 404, but they
87  // ** They can't continue
88 
89  $noBrand = false;
90  if (!is_array($HB_ENV)) {
91  $noBrand = true;
92  } elseif (!array_key_exists('cloudfrontDomainName', $HB_ENV) || !array_key_exists('homecuKendoVersion', $HB_ENV)) {
93  $noBrand = true;
94  }
95  if ($noBrand || true) {
96  print "<!DOCTYPE HTML>
97  <html>
98  <head>
99  <title>Digital Banking Error</title>
100  </head>
101  <body>
102  <div class='col-xs-12 col-md-8 col-lg-6'>
103  <div class='k-block k-error-colored hcu-error-margin'>
104  <div class='k-shadow k-header'>
105  <span>Digital Banking Error</span>
106  </div>
107 
108  <div class='hcu-error-padding'>
109  <span>The system is temporarily unavailable.</span>
110 
111  <br></br>
112 
113  <span>Please try back in a few minutes.</span>
114 
115  <br><br>
116 
117  <span>$serviceErrorMsg</span>
118  </div>
119  </div>
120  </div>
121  </body>
122  </html>";
123  } else {
124  print <<< printErrorPage
125  <?xml version="1.0"?><!DOCTYPE html>
126  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
127  <head>
128  <title>Digital Banking Error</title>
129  <!-- <meta charset="ISO-8859-1"/> -->
130  <meta name="robots" content="noindex,nofollow" />
131  <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8;" />
132 
133  <link href='https://{$HB_ENV['cloudfrontDomainName']}/homecu/css/KendoUI/{$HB_ENV['homecuKendoVersion']}/kendo.common.min.css' rel='stylesheet'/>
134  <link href='https://{$HB_ENV['cloudfrontDomainName']}/homecu/css/KendoUI/{$HB_ENV['homecuKendoVersion']}/kendo.uniform.min.css' rel='stylesheet'/>
135  <script type='text/javascript' src='https://{$HB_ENV['cloudfrontDomainName']}/jquery/js/jquery-1.10.2.min.js.jgz'></script>
136  <script src='https://{$HB_ENV['cloudfrontDomainName']}/homecu/js/KendoUI/{$HB_ENV['homecuKendoVersion']}/kendo.custom.min.js.jgz'></script>
137  </head>
138  <body>
139  <div class='col-xs-12 col-md-8 col-lg-6'>
140  <div class="k-block k-error-colored hcu-error-margin">
141  <div class='k-shadow k-header'>
142  <span>Digital Banking Error</span>
143  </div>
144 
145  <div class='hcu-error-padding'>
146  <span>The system is temporarily unavailable.</span>
147  </br><br>
148  <span>Please try back in a few minutes.</span>
149  </div>
150  </div>
151  </div>
152  </body>
153  </html>
154 
155 printErrorPage;
156  }
157  break;
158  case '200':
159  case '201':
160  case '202':
161  require_once('hcuPostContent.i');
162  break;
163  case '911':
164  // * This is created by the Digital Banking program.
165  // ** IT IS NOT RETURNED BY CORE **
166  require_once('hcuPreContent.i');
167 ?>
168  <div class="col-xs-12 col-md-8 col-lg-6">
169  <div class="k-block k-error-colored hcu-error-margin">
170  <div class="k-shadow k-header">
171  <span><?php echo $MC->msg('Unable to load', HCU_DISPLAY_AS_HTML); ?></span>
172  </div>
173 
174  <div class="hcu-error-padding">
175  <span><?php echo "{$MC->msg('Credit Union responded', HCU_DISPLAY_AS_HTML)} : {$HB_ENV['packetStatus']['reason']} ({$HB_ENV['packetStatus']['status']})"; ?></span>
176  <br><br>
177  <span><?php echo $MC->msg('Please try again later', HCU_DISPLAY_AS_HTML); ?></span>
178  </div>
179  </div>
180  </div>
181 <?php
182  require_once('hcuPostContent.i');
183  break;
184  case '915':
185  // * Feature Not Available
186  require_once('hcuPreContent.i');
187 ?>
188  <div class="col-xs-12 col-md-8 col-lg-6">
189  <div class="k-block k-info-colored hcu-info-margin">
190  <div class="k-shadow k-header">
191  <span><?php echo $MC->msg('Feature Unavailable', HCU_DISPLAY_AS_HTML); ?></span>
192  </div>
193 
194  <div class="hcu-info-padding">
195  <span><?php echo $serviceErrorMsg; ?></span>
196  </div>
197  </div>
198  </div>
199 <?php
200  require_once('hcuPostContent.i');
201  break;
202  case '916':
203  // * Feature Not Available - with close button
204 ?>
205  <div class="col-xs-12 col-md-8 col-lg-6">
206  <div class="k-block k-info-colored hcu-info-margin">
207  <div class="k-shadow k-header">
208  <span><?php echo ($serviceErrorTitle == "" ? $MC->msg('Feature Unavailable', HCU_DISPLAY_AS_HTML) : $serviceErrorTitle); ?></span>
209  </div>
210 
211  <div class="hcu-info-padding">
212  <span><?php echo $serviceErrorMsg; ?></span>
213 
214  <br><br>
215 
216  <button type="button" class="k-button" onClick="window.close()">
217  <span class="k-icon k-i-close btn-icon-custom"></span>
218  <?php echo $MC->msg('Close Window', HCU_DISPLAY_AS_HTML) ?>
219  </button>
220  </div>
221  </div>
222  </div>
223 <?php
224  break;
225  case '917':
226  // * Error occurred - optional title, errors can be a string or array.
227  // make a single string for the errors
228  if (is_array( $serviceErrorMsgs ) ) {
229  $serviceErrorString = implode( "<br />", $serviceErrorMsgs );
230  } else {
231  $serviceErrorString = $serviceErrorMsgs;
232  }
233 ?>
234  <div class="col-xs-12 col-md-8 col-lg-6">
235  <div class="k-block k-info-colored hcu-info-margin">
236  <div class="k-shadow k-header">
237  <span><?php echo ($serviceErrorTitle == "" ? $MC->msg('Error Occurred', HCU_DISPLAY_AS_HTML) : $serviceErrorTitle); ?></span>
238  </div>
239 
240  <div class="hcu-info-padding">
241  <span><?php echo $serviceErrorString; ?></span>
242  </div>
243  </div>
244  </div>
245 <?php
246  break;
247  case '918':
248  ob_clean();
249  /*
250  * Load the page...
251  */
252  require_once('hcuPreContent.i');
253 
254  // Set the response of this page to be 400 (bad request) -- Some exception happened, not much can be done
255  // http_response_code(400);
256 ?><!DOCTYPE HTML>
257 <html>
258  <head>
259  <title>Digital Banking Error</title>
260 
261  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
262  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
263  <meta name="viewport" content="width=device-width, initial-scale=1" />
264 
265  <style>
266  .error-content {
267  background-color: #EFEFEF;
268  min-width: 300px;
269  max-width: 500px;
270  margin: auto !important;
271  padding: 20px;
272  -webkit-border-radius: 5px;
273  -moz-border-radius: 5px;
274  border-radius: 5px;
275 
276  text-align: center;
277  }
278 
279  .page-title {
280  text-align: center;
281  }
282  .title-caption {
283  border-top: 2px solid;
284  border-bottom: 2px solid #333;
285  border-color: rgba(51, 51, 51, .4);
286  margin: auto !important;
287  display: inline-block;
288  padding: 10px;
289  }
290  .return-section {
291  margin-top: 20px;
292  }
293  .return-section button {
294  -webkit-border-radius: 10px;
295  -moz-border-radius: 10px;
296  border-radius: 10px;
297  color: #FFF;
298  background: #26B336;
299  border-color: #26B336;
300  padding: 5px 20px 5px 20px;
301  text-decoration: none;
302  font-size: 1.4em;
303 
304  }
305  @media (min-width: 768px) {
306  width: 500px;
307 
308  }
309  </style>
310 
311  <script>
312  function ReturnToPage() {
313  document.location = 'http://www.google.com';
314  }
315  </script>
316  </head>
317  <body>
318  <div class="error-content">
319 
320  <div class="page-title">
321  <div class="title-caption">
322  Page Error
323  </div>
324  </div>
325  <div class="">
326  <h1>
327  Page request failed
328  </h1>
329  </div>
330  <div class="">
331  <h3>
332  We have logged the error and an engineer will look in to it.
333  </h3>
334  </div>
335  <div class="">
336  Return to your product here
337  </div>
338  <div class="return-section">
339  <button id="btnReturn" name="btnReturn" onClick="ReturnToPage();">Return</button>
340  </div>
341  </div>
342 
343  </body>
344 </html>
345 <?php
346  break;
347  default:
348 
349  ob_clean();
350  header("HTTP/1.0 404 Not Found");
351 
352 ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
353 <html lang="en">
354 <head>
355  <meta name="robots" content="noindex, nofollow">
356  <title>404 Page Not Found</title>
357 </head>
358 <body>
359 
360  <h1>Page Not found</h1>
361  <p>The page you have looked for does not exist.
362  </p>
363 
364 
365 </body>
366 </html>
367 <?php
368  endswitch;