Odyssey
MbrExtKey.prg
1 <?php
2 
3 /*
4  * File: MbrExtKey
5  *
6  * Purpose: Maintain key data for external vendors locally at HomeCU
7  *
8  */
9 
10 require_once("$sharedLibrary/cutrusted.i");
11 
12 $dms_ok = array('action' => 'string', 'trustid' => 'string', 'cu' => 'string', 'member' => 'string');
13 dms_import_v2($SYSENV, "EXTKEY", $dms_ok);
14 extract($SYSENV["EXTKEY"]);
15 $self= "$menu_link?ft=22"; // Just for the data calls.
16 
17 require_once("$admLibrary/userSupportTabs.i");
18 
19 $findTab= null;
20 foreach($tabs as $tab)
21 {
22  if ($tab->name == "find")
23  {
24  $findTab= $tab;
25  break;
26  }
27 }
28 
29 try {
30 # if no {$Cu}extkey table, bail out
31  if (!isset($Cu)) {
32  throw new Exception('Missing Expected Parameters');
33  }
34  $extkey_sql = "select count(*) from pg_class where relname='" . strtolower($Cu) . "extkey'";
35  $extkey_rs = db_query($extkey_sql, $dbh);
36  list($extkeyexists) = db_fetch_array($extkey_rs, 0);
37  if ($extkeyexists == 0) {
38  throw new Exception("External Key Table Missing");
39  }
40 
41 # if no cutrusteddetail for eligible vendors (local EZCARD info or local MIR info or local DMI info ) bail out
42 # trusted detail keys for ExtKey-eligible vendors will start with 'Hcu'. Comes back in cutd_list result
43 # with key {$Cu}|Hcu....
44 // $parms = array('Cu' => $Cu, 'trustedid' => $trustid); # would select only trustid vendor but we need all Hcu... for menu
45  # start with all trusted detail for this client
46  $parms = array('Cu' => $Cu);
47  $return = cutd_list($dbh, $parms);
48 
49  if ($return['status']['Response'] == 'true' && is_array($return['data'])) {
50  # filter keys containing '|Hcu' into tablist. These are the ones to populate MemberMaint menu tabs
51  $tablist = array_flip(array_filter(array_keys($return['data']), function($k) {
52  return strpos($k, '|Hcu');
53  }));
54  # and now filter to just the trustid requested & throw error if not found
55  $return['data'] = array_intersect_key($return['data'], array("$Cu|$trustid" => 1));
56  }
57  if (sizeof($return['data']) == 0) {
58  throw new Exception('Trusted Detail Missing or not Valid');
59  }
60 
61  switch ($trustid) {
62  case "HcuEZCARD":
63  require_once ("$admLibrary/MbrExHcuEZCARD.i");
64  break;
65  case "HcuMIR":
66  require_once ("$admLibrary/MbrExHcuMIR.i");
67  break;
68  case "HcuDMI":
69  require_once ("$admLibrary/MbrExHcuDMI.i");
70  break;
71  default:
72  throw new Exception('Unrecognized Provider Mode');
73  break;
74  }
75 
76  ${"${trustid}i"}->parms_disp4edit($findTab, $searchTab, $menu_link, $Cu, $trustid);
77 } catch (Exception $ex) {
78  //Return error message
79  $error = ($ex->getMessage());
80  print $error;
81 }
82 
83 function printExtKeyStyle()
84 { ?>
85  <style>
86  .k-header a {
87  font-size: inherit !important;
88  }
89 
90  fieldset {
91  margin: 5px;
92  }
93 
94  /* Give same styling as if type="text" */
95  input[type="email"], input[type="password"] {
96  border-style: solid;
97  border-width: 1px;
98  font-family: inherit;
99  font-size: 100%;
100  }
101 
102  .k-edit-form-container {
103  width: 100%;
104  }
105 
106  fieldset {
107  border: 1px solid black;
108  border-radius: 5px;
109  padding: 5px;
110  }
111 
112  legend {
113  width: inherit;
114  margin-bottom: 0px;
115  font-size: inherit;
116  line-height: inherit;
117  border: 0px solid black;
118  }
119 
120  .contentDiv {
121  width: 98%;
122  }
123 
124  .editBtnDiv > * {
125  padding-right: 5px;
126  }
127 
128  .grid_12 {
129  margin-bottom: 5px;
130  }
131 
132  #mirPopupDiv {
133  text-align: left;
134  padding: 5px;
135  width: 98% !important;
136  }
137 
138  .row-fluid, .row {
139  padding: 0 !important;
140  margin: 5px !important;
141  margin-bottom: 5px !important;
142  }
143 
144  .row-fluid input, .row input {
145  display: inline;
146  }
147 
148  input[name="state"] {
149  width: 50px;
150  }
151 
152  input[name="zip"] {
153  width: 90px;
154  }
155 
156  input[name="middlename"] {
157  width: 6.4em;
158  }
159 
160  #stateDDL-list .k-item {
161  width: 88%;
162  overflow-x: hidden;
163  text-overflow: ellipsis;
164  white-space: nowrap;
165  }
166 
167  .k-popup-edit-form.k-window-content.k-content
168  {
169  overflow-x:hidden
170  }
171 
172  .k-grid-content-expander
173  {
174  display:none;
175  }
176 
177  .k-grid-norecords
178  {
179  padding-top:10px;
180  padding-bottom:10px;
181  }
182 }
183  </style>
184 <?php }