Odyssey
imp_main.prg
1 <?php
2 /**
3  * Change History:
4  * 04/26/13 mbl - Removed usage of cuinfo.comments, cuinfo.contract_notes cuinfo.misc_notes
5  * to use new cuinfo_notes table.
6  * 05/01/13 mbl - Added fname, lname, decider to monitor_contact table.
7  */
8 
9 $monLibrary= dirname(__FILE__) . "/../library";
10 require_once("$monLibrary/cu_top.i");
11 require_once("$monLibrary/ck_hticket.i");
12 
13 #
14 # $data_mode [ADD | EDIT] controls whether we insert or update
15 # $data_status [PENDING | RUNNING] limits access to some
16 # input boxes based on date_live column in db.
17 #
18  if (!CheckPerm($link, $Hu, basename($_SERVER['SCRIPT_NAME']), $_SERVER['REMOTE_ADDR'])) {
19  // ** Permissions failed
20  // ** redirect to new page
21  header("Location: /hcuadm/hcu_noperm.prg");
22  exit;
23  }
24 
25 $dms_ok=array('addr1'=>'string','addr2'=>'string','admin_setup'=>'string',
26 'btnSave'=>'string','btnServ'=>'string','Cd'=>'string','ceo_mgr'=>'string',
27 'cfserver'=>'string','charter_number'=>'string','Charter'=>'string',
28 'city'=>'string','comments'=>'string','conn_type'=>'digits',
29 'contract_expires'=>'string','contract_notes'=>'string','conv_from'=>'string',
30 'Cs'=>'string','cuid'=>'string','cu_name'=>'string','cu_products'=>'array',
31 'Cu'=>'string','dec_31_assets'=>'string','dec_31_mem'=>'string',
32 'delrow'=>'digits','dns_provider'=>'string','domain_regis'=>'digits',
33 'home_page_url'=>'string','init_accts'=>'string','interface_install'=>'string',
34 'isp'=>'string','last_activity_date'=>'string','listserv'=>'string',
35 'mail_setup'=>'string','main_email'=>'string','main_phone'=>'string',
36 'mc'=>'array','mcdirty'=>'digits','misc_notes'=>'string','modem_num'=>'string',
37 'mode'=>'string','msg'=>'string','name'=>'string','next_contact_date'=>'string',
38 'serv_acct'=>'string','showrows'=>'digits','state'=>'string','Status'=>'string',
39 'system_options'=>'digits','sys_typ_asp'=>'digits','sys_typ_batch'=>'digits',
40 'sys_typ_closed'=>'digits','sys_typ_ivr'=>'digits','sys_typ_live'=>'digits',
41 'sys_typ_upgrade'=>'digits','sys_typ_webonly'=>'digits', 'sys_typ_voip'=>'digits',
42 'target_launch'=>'string','train_date'=>'string','user_name'=>'string',
43 'vendor'=>'string','web_host'=>'string','www_server'=>'string','zip'=>'string',
44 'renewal_term'=>'digits');
45 
46 dms_import($dms_ok);
47 
48 $conn_type = (isset($conn_type) ? $conn_type : "");
49 $domain_regis = (isset($domain_regis) ? $domain_regis : "");
50 $sys_typ_batch = (isset($sys_typ_batch) ? $sys_typ_batch : null);
51 $sys_typ_live = (isset($sys_typ_live) ? $sys_typ_live : null);
52 $sys_typ_asp = (isset($sys_typ_asp) ? $sys_typ_asp : null);
53 $sys_typ_ivr = (isset($sys_typ_ivr) ? $sys_typ_ivr : null);
54 $sys_typ_voip = (isset($sys_typ_voip) ? $sys_typ_voip : null);
55 $sys_typ_webonly = (isset($sys_typ_webonly) ? $sys_typ_webonly : null);
56 $sys_typ_upgrade = (isset($sys_typ_upgrade) ? $sys_typ_upgrade : null);
57 $sys_typ_closed = (isset($sys_typ_closed) ? $sys_typ_closed : null);
58 
59  $msg = "";
60 
61  if (!isset($mode))
62  $mode = "MAINT";
63 
64 if ($mode == 'MCMORE' ) { $showrows +=2; $mode='MAINT';}
65 if ($mode == 'MCROW'){
66  array_splice($mc,$delrow,1);
67  $showrows -= 1;
68  $mode='MAINT';
69 }
70 
71  switch ($mode) {
72  case "SAVE":
73  $err_msg = "";
74 // Main phone can be empty, but if entered must be full number w/area code
75 if ($main_phone <> "" && !(preg_match("/\d{3}-\d{3}-\d{4} ?(x\d+)?$/",$main_phone))) {
76  $err_msg .= "{Main Phone is not valid format} (use 999-999-9999 x9999)<br>";
77 }
78  // Date of First Upload, can be empty, but if value entered, must be correct date.
79  $target_launch = trim( $target_launch );
80  if (strlen($target_launch) > 0) {
81  if ( $target_launch != "FLEX" && $target_launch != "TBD" && !($target_launch = mdydate($target_launch)))
82  $err_msg .= "<li>{Target Launch Date} is an invalid date. A valid date must be entered, or the value 'FLEX', or the value 'TBD'.<br>";
83  } else {
84  $err_msg = "<li>Need a Target Launch Date.</li>";
85  }
86 
87  if (strlen($train_date) > 0)
88  if ( !($train_date = mdydate($train_date)))
89  $err_msg .= "<li>{Training Date} is an invalid date. A valid date must be entered or leave blank.<br>";
90 
91  if (strlen($admin_setup) > 0)
92  if ( !($admin_setup = mdydate($admin_setup)))
93  $err_msg .= "<li>{Admin Setup} is an invalid date. A valid date must be entered or leave blank.<br>";
94 
95  if (strlen($listserv) > 0)
96  if ( !($listserv = mdydate($listserv)))
97  $err_msg .= "<li>{Listserv Setup} is an invalid date. A valid date must be entered or leave blank.<br>";
98 
99  if (strlen($mail_setup) > 0)
100  if ( !($mail_setup = mdydate($mail_setup)))
101  $err_msg .= "<li>{Mail Setup} is an invalid date. A valid date must be entered or leave blank.<br>";
102 
103  if (strlen($interface_install) > 0)
104  if ( !($interface_install = mdydate($interface_install)))
105  $err_msg .= "<li>{Interface Install} is an invalid date. A valid date must be entered or leave blank.<br>";
106 
107  // Dec 31 Assets -- Validate the field after stripping format is a numeric field
108  if (strlen(trim($dec_31_assets)))
109  if ( !(is_numeric(strip_money($dec_31_assets))) )
110  $err_msg .= "<li>{Assets} is an invalid number. A valid number value must be entered or leave blank.<br>";
111 
112  // Dec 31 Membership -- Validate this is an Integer field.
113  if (strlen(trim($dec_31_mem)))
114  if ( !(is_integer(intval($dec_31_mem))))
115  $err_msg .= "<li>{# of Members} is an invalid number. A valid integer value must be entered or leave blank.<br>";
116 
117  if (strlen($next_contact_date) > 0)
118  if ( !($next_contact_date = mdydate($next_contact_date)))
119  $err_msg .= "<li>{Next Contact Date} is an invalid date. A valid date must be entered or leave blank.<br>";
120 
121  if (strlen($last_activity_date) > 0)
122  if ( !($last_activity_date = mdydate($last_activity_date)))
123  $err_msg .= "<li>{Last Activity Date} is an invalid date. A valid date must be entered or leave blank.<br>";
124 
125  if (strlen($contract_expires) > 0)
126  if ( !($contract_expires = mdydate($contract_expires)))
127  $err_msg .= "<li>{Contract Expires Date} is an invalid date. A valid date must be entered or leave blank.<br>";
128 
129  if (isset($btnServ) && strlen(trim($www_server)) == 0)
130  $err_msg .= "<li>To run CU Setup, a valid server must be selected. Please select a server before trying again.<br>";
131 
132  if (isset($btnServ) && strlen(trim($vendor)) == 0)
133  $err_msg .= "<li>To run CU Setup, a valid vendor must be selected. Please select a server before trying again.<br>";
134 
135  // ** Make sure the user has selected either live or batch for the CU if they are trying to run CU Setup
136  if (isset($btnServ) && (!isset($sys_typ_batch) && !isset($sys_typ_live) && !isset($sys_typ_webonly)))
137  $err_msg .= "<li>To run CU Setup, a valid HomeCU Type must be selected. Please select a either a live or batch option and try again.<br>";
138 
139  // ** Make sure one of the Home CU Type options is selected -- but there are rules on which ones may be selected
140  if (!isset($sys_typ_batch) && !isset($sys_typ_live) && !isset($sys_typ_ivr) && !isset($sys_typ_voip) && !isset($sys_typ_webonly)) {
141  $err_msg .= "<li>To complete setup, a valid HomeCU Type must be selected. Please select one of the Home CU Type options and try again.<br>";
142  } else {
143  // ** Check to make sure the selected options do NOT conflict
144  if (isset($sys_typ_webonly) && (isset($sys_typ_batch) || isset($sys_typ_live) || isset($sys_typ_asp))) {
145  $err_msg .= "<li>When Web Only is selected you may not choose one of these {live, batch, asp, upgrade}. Please select correctly and try again.<br>";
146  } elseif (isset($sys_typ_batch) && (isset($sys_typ_live))) {
147  $err_msg .= "<li>When Batch is selected you may not choose the 'Live' options. Please correct this and try again.<br>";
148  }
149 
150  }
151 
152  if (isset($btnServ) && strlen(trim($name)) == 0)
153  $err_msg .= "<li>To run CU Setup, a valid name must be selected. Please specify a name before trying again.<br>";
154 
155  if (isset($sys_typ_webonly) == 'W' && trim($vendor) != 'WEBONLY')
156  $err_msg .= "<li>To use the Web ONLY CU type, you must also select WEBONLY as the vendor. Please do so to continue.<br>";
157  if (isset($user_name) && $cuid == 'NEW') {
158  // We want to INSERT a record, BUT we must first be certain this account does NOT already exist
159  $cu_sql = "SELECT user_name
160  FROM cuinfo
161  WHERE user_name = '" . prep_save($user_name) . "' ";
162 
163  $go_save = db_cant_exist($cu_sql, $link);
164  $set_user = strtolower(trim($user_name));
165  if (!$go_save)
166  $err_msg = "<li>The credit union code you entered already exists, please select a unique code.";
167  } elseif (isset($cuid) && $cuid <> 'NEW') {
168  // We want to use the 'cuid' field to be sure this account already exists
169  $cu_sql = "SELECT user_name
170  FROM cuinfo
171  WHERE user_name = '" . prep_save($cuid) . "' ";
172  $go_save = db_must_exist($cu_sql, $link);
173  $set_user = strtolower(trim($cuid));
174  if (!$go_save)
175  $err_msg = "<li>The credit union code you are trying to save does not exist, please go back to the menu and reselect the code.";
176  } else {
177  $go_save = 0;
178  }
179 
180  if (strlen($set_user) == 0) {
181  // An error is here -- there should be a cuid from somewhere
182  $err_msg .= "<li>Please enter a Credit Union Code for this credit union.";
183  } else {
184 #
185 # build sql to delete & reinsert the monitor_contact rows:
186 #
187  $mcquery = "DELETE FROM monitor_contact WHERE user_name = '$set_user'; \n";
188 
189  // insert contact info
190 
191  for ($prow=0; $prow < $showrows; $prow++) {
192  $mcrole = trim($mc[$prow][0]);
193  $mcdecider = HCU_array_key_value(1, $mc[$prow]) == "Y" ? "Y" : "N";
194  $mcfname = trim($mc[$prow][2]);
195  $mclname = trim($mc[$prow][3]);
196  $mcphone = trim($mc[$prow][4]);
197  $mcemail = trim($mc[$prow][5]);
198  $mccomment = trim($mc[$prow][6]);
199  $drow = $prow+1;
200  $errcount=0;
201 
202  if ("$mcrole" <> '') {
203  if (("$mcfname" == "") && ($mclname == "")) {
204  $err_msg .= "{Error in CU Contact row $drow} Name Required.<br>";
205  $errcount += 1;
206  }
207 # skip this test --
208 # if phone is same as main phone Cerise shouldn't have to type twice
209 #
210 # if ("$mcphone" == "" && "$mcemail" == "") {
211 # $err_msg .= "{Error in CU Contact row $drow} Either Phone or Email required.<br>";
212 # $errcount += 1;
213 # }
214 # force phone to be ###-###-#### x######
215 # where the x###### part is optional
216 # and the # of digits after the x can vary from 1 to whatever fits in the field
217 
218  if ("$mcphone" <> "" && !(preg_match("/\d{3}-\d{3}-\d{4} ?(x\d+)?$/",$mcphone))) {
219  $err_msg .= "{Error in CU Contact row $drow} Invalid Phone number (use 999-999-9999 x9999)<br>";
220  $errcount += 1;
221  }
222  } else {
223  $errcount += 1;
224  }
225  if ($errcount == 0) {
226  $mcquery .= "insert into monitor_contact
227  (user_name, role, fname, phone, email, comment, lname, decider)
228  values ('" . prep_save($set_user) . "','" . prep_save($mcrole) . "','" . prep_save($mcfname) . "','" . prep_save($mcphone) . "','" . prep_save($mcemail). "','" . prep_save($mccomment) . "','" . prep_save($mclname) ."','" . prep_save($mcdecider) ."'); ";
229  }
230  }
231 }
232 
233 
234  if ($err_msg == "") {
235 
236  if ($go_save) {
237  // Set the values up that may be null, such as the Next Contact Date
238  if (trim($next_contact_date) == '')
239  $save_next_date = "NULL";
240  else
241  $save_next_date = "'" . trim($next_contact_date) . "'";
242 
243  if (trim($last_activity_date) == '')
244  $save_last_date = "NULL";
245  else
246  $save_last_date = "'" . trim($last_activity_date) . "'";
247 
248  if (trim($contract_expires) == '')
249  $save_exp_date = "NULL";
250  else
251  $save_exp_date = "'" . trim($contract_expires) . "'";
252 
253  if (trim($charter_number) != '') {
254  $charter_number= preg_replace('/\D/', '', $charter_number);
255  }
256 
257  // ** SET the {SYSTEM OPTIONS} value to be saved
258  $upd_sys_opt = (
259  (isset($sys_typ_batch) ? $sys_typ_batch : 0) +
260  (isset($sys_typ_live) ? $sys_typ_live : 0) +
261  (isset($sys_typ_asp) ? $sys_typ_asp : 0) +
262  (isset($sys_typ_ivr) ? $sys_typ_ivr : 0) +
263  (isset($sys_typ_voip) ? $sys_typ_voip : 0) +
264  (isset($sys_typ_webonly) ? $sys_typ_webonly : 0) +
265  (isset($sys_typ_upgrade) ? $sys_typ_upgrade : 0) +
266  (isset($sys_typ_closed) ? $sys_typ_closed : 0)
267  );
268 # // ** BATCH VALUE
269 # if (isset($sys_typ_batch)) { $upd_sys_opt += $SYS_TYPE_BATCH; }
270 # // ** LIVE VALUE
271 # if (isset($sys_typ_live)) { $upd_sys_opt += $SYS_TYPE_LIVE; }
272 # // ** LIVE ASP VALUE
273 # if (isset($sys_typ_asp)) { $upd_sys_opt += $SYS_TYPE_ASP; }
274 # // ** IVR VALUE
275 # if (isset($sys_typ_ivr)) { $upd_sys_opt += $SYS_TYPE_IVR; }
276 # // ** WEB ONLY VALUE
277 # if (isset($sys_typ_webonly)) { $upd_sys_opt += $SYS_TYPE_WEBONLY; }
278 # // ** Upgrade / Conversion VALUE
279 # if (isset($sys_typ_upgrade)) { $upd_sys_opt += $SYS_TYPE_UPGRADE; }
280 # // ** CLOSED CU VALUE
281 # if (isset($sys_typ_closed)) { $upd_sys_opt += $SYS_TYPE_CLOSED; }
282 
283 // print "UPdate -= $upd_sys_opt ";exit;
284 # set the list of characters not allowed in addresses
285 $nopunc=array(',','.');
286 
287  if ( $target_launch != "FLEX" && $target_launch != "TBD" ) {
288  $target_launch = dateformat("Y-m-d", $target_launch);
289  }
290 
291  if (isset($cuid) && $cuid <> 'NEW') {
292  // UPDATE the information into the table
293  $sql = "UPDATE cuinfo
294  SET name = '" . prep_save($name, 40) . "',
295  addr1 = '" . prep_save(str_replace($nopunc,"",$addr1), 40) . "',
296  addr2 = '" . prep_save(str_replace($nopunc,"",$addr2), 40) . "',
297  city = '" . prep_save(str_replace($nopunc,"",$city), 25) . "',
298  state = '" . prep_save($state, 15) . "',
299  zip = '" . prep_save($zip, 15) . "',
300  main_email = '" . prep_save($main_email, 40) . "',
301  main_phone = '" . prep_save($main_phone, 20) . "',
302  ceo_mgr = '" . prep_save($ceo_mgr, 40) . "',
303  vendor = '" . prep_save($vendor, 15) . "',
304  dec_31_assets = '" . prep_save(doubleval(strip_money($dec_31_assets))) . "',
305  dec_31_mem = '" . intval($dec_31_mem) . "',
306  home_page_url = '" . prep_save($home_page_url, 80) . "',
307  www_server = '" . prep_save($www_server, 10) . "',
308  charter_number= '" . prep_save($charter_number, 10) . "',
309  conn_type = '" . prep_save($conn_type, 10) . "',
310  dns_provider = '" . prep_save($dns_provider, 20) . "',
311  web_host = '" . prep_save($web_host, 20) . "',
312  target_launch = '" . prep_save($target_launch, 10) . "',
313  domain_regis = '" . intval($domain_regis) . "',
314  init_accts = '" . prep_save($init_accts, 20) . "',
315  modem_num = '" . prep_save($modem_num, 15) . "',
316  train_date = '" . prep_save($train_date, 10) . "',
317  serv_acct = '" . prep_save($serv_acct, 10) . "',
318  conv_from = '" . prep_save($conv_from, 20) . "',
319  admin_setup = '" . prep_save($admin_setup, 10) . "',
320  listserv = '" . prep_save($listserv, 10) . "',
321  mail_setup = '" . prep_save($mail_setup, 10) . "',
322  interface_install = '" . prep_save($interface_install, 10) . "',
323  next_contact_date = $save_next_date,
324  last_activity_date = $save_last_date,
325  contract_expires = $save_exp_date,
326  isp = '" . prep_save($isp, 20) . "',
327  system_options = $upd_sys_opt,
328  renewal_term = '" . intval($renewal_term) . "'
329  WHERE user_name = '$set_user'; ";
330 
331  $fail_msg = "Error Saving Information!!! An error occurred while saving the information, try again.";
332  $pass_msg = "The information was updated successfully!!";
333 
334  } else {
335 
336  // notes are saved in cuinfo_notes now (4/23/2013)
337  $contract_notes = "";
338  $comments = "";
339  $misc_notes = "";
340  $sql = "INSERT INTO cuinfo
341  ( user_name, name, addr1, addr2, city, state, zip, main_email,
342  main_phone, ceo_mgr, dec_31_assets, dec_31_mem, home_page_url,
343  vendor, www_server, charter_number, conn_type,
344  dns_provider, web_host, target_launch, domain_regis, init_accts,
345  modem_num, train_date, serv_acct, conv_from, admin_setup,
346  listserv, mail_setup, interface_install, contract_notes, comments,
347  misc_notes, next_contact_date, last_activity_date, contract_expires,
348  isp, system_options, renewal_term )
349  VALUES (
350  '" . prep_save($set_user, 12) . "',
351  '" . prep_save($name, 40) . "',
352  '" . prep_save(str_replace($nopunc,"",$addr1), 40) . "',
353  '" . prep_save(str_replace($nopunc,"",$addr2), 40) . "',
354  '" . prep_save(str_replace($nopunc,"",$city), 25) . "',
355  '" . prep_save($state, 15) . "',
356  '" . prep_save($zip, 15) . "',
357  '" . prep_save($main_email, 40) . "',
358  '" . prep_save($main_phone, 20) . "',
359  '" . prep_save($ceo_mgr, 40) . "',
360  '" . prep_save(doubleval(strip_money($dec_31_assets))) . "',
361  '" . prep_save(intval($dec_31_mem)) . "',
362  '" . prep_save($home_page_url, 80) . "',
363  '" . prep_save($vendor, 15) . "',
364  '" . prep_save($www_server, 10) . "',
365  '" . prep_save($charter_number, 10) . "',
366  '" . prep_save($conn_type, 10) . "',
367  '" . prep_save($dns_provider, 20) . "',
368  '" . prep_save($web_host, 20) . "',
369  '" . prep_save($target_launch, 10) . "',
370  '" . intval($domain_regis) . "',
371  '" . prep_save($init_accts, 20) . "',
372  '" . prep_save($modem_num, 15) . "',
373  '" . prep_save($train_date, 10) . "',
374  '" . prep_save($serv_acct, 10) . "',
375  '" . prep_save($conv_from, 20) . "',
376  '" . prep_save($admin_setup, 10) . "',
377  '" . prep_save($listserv, 10) . "',
378  '" . prep_save($mail_setup, 10) . "',
379  '" . prep_save($interface_install, 10) . "',
380  '" . prep_save($contract_notes) . "',
381  '" . prep_save($comments) . "',
382  '" . prep_save($misc_notes) . "',
383  $save_next_date, $save_last_date, $save_exp_date,
384  '" . prep_save($isp, 20) . "',
385  $upd_sys_opt,
386  '" . intval($renewal_term) . "'); ";
387 
388  $fail_msg = "Error Saving Data!!! An error occurred while saving the information, try again.";
389  $pass_msg = "New information was saved!!";
390  }
391 
392  // Take care of monitor contacts
393  $sql .= $mcquery;
394 
395  // Always delete any possible items from the cuproducts table for the specified user_name
396  $sql .= sprintf("DELETE FROM cuproducts WHERE user_name = '%s'; \n", $set_user);
397 
398  // Now if there are items selected in the HOME CU Products list then add some more query lines here
399 
400  $prod_elements = isset($cuproducts) ? count($cu_products) : 0;
401  for ($prod_count=0; $prod_count < $prod_elements; $prod_count++) {
402  // Items were selected in the list add them here
403  $sql .= sprintf("INSERT INTO cuproducts VALUES ('%s', '%s'); \n", prep_save($cu_products[$prod_count]), prep_save($set_user));
404  }
405 
406  // Now pass the query to the Database
407  if (!($db_result=db_query($sql, $link))) {
408  $err_msg = $fail_msg;
409  } else {
410  if (isset($btnServ)) {
411  // The user is going to a different server to run the CU Setup -- go there now
412  if (isset($sys_typ_batch)) {
413  $make_lb = "B";
414  } elseif (isset($sys_typ_live)) {
415  $make_lb = "L";
416  } elseif (isset($sys_typ_webonly)) {
417  $make_lb = "W";
418  }
419  header("Location: https://{$www_server}.homecu.net/hcuadm/makecu.prg?Cu=$set_user"
420  . "&Cl={$make_lb}&cu_name=" . urlencode($name) . "&Cv={$vendor}"
421  . "&Cr={$home_page_url}&Cs={$www_server}");
422  } else {
423  // Redirect back to the menu, which is a different page
424  header("Location: /hcuadm/imp_menu.prg?msg=$pass_msg");
425  }
426  exit;
427  }
428  }
429 
430  } else {
431  // We have an error in the form data, stop here fix the problem
432  // and fall thru to the Maintenance screen
433  $form_err = "Problems with the form were found!<br>
434  Fix these error before you save again.<br><br>
435  $err_msg";
436 
437  }
438 
439  case "MAINT":
440  $frm_set_st_batch = 0;
441  $frm_set_st_live = 0;
442  $frm_set_st_asp = 0;
443  $frm_set_st_ivr = 0;
444  $frm_set_st_webonly = 0;
445 
446  $url_string = "";
447 
448  // Determine if we are Adding or Editing
449  if ($cuid <> 'NEW') {
450  $data_mode = "EDIT";
451  // Attempting to load a cu ID, so we think we are editing
452 
453  $user_name = strtolower(trim($cuid));
454 
455  $query = "select date_live from cuinfo
456  where user_name = '$user_name'";
457 
458  $result = db_query($query, $link);
459  // Now check the status -- already implemented?
460 
461  $rcount=db_num_rows($result);
462  list($date_live) = db_fetch_array($result,0);
463  if ($rcount != 0) {
464  if ("$date_live" > "") {
465  $msg = "Credit Union $user_name already implemented";
466  $data_status = "RUNNING";
467  } else {
468  $data_status = "PENDING";
469  }
470  // If at anytime the num_rows is 0, then we assume we will ADD a new option
471  } else { # no rows found with given user_name
472  $msg = "Credit Union $user_name not found";
473  $data_mode='ADD';
474  $data_status = "PENDING";
475  }
476 
477  $url_string = "cuid=" . urlencode($cuid);
478  } else { # given cuid is NEW
479  $data_mode='ADD';
480  $data_status = "PENDING";
481  }
482 
483  cu_header("HomeCU - CU Implementation", "forms[0].addr1");
484 ?>
485 <link rel="stylesheet" type="text/css" media="all" href="/monitor/css/jquery-ui-1.8.18.custom.css"/>
486 <script type="text/javascript" src="/monitor/js/jquery-1.7.1.min.js"></script>
487 <script type="text/javascript" src="/monitor/js/jquery-ui-1.8.18.custom.min.js"></script>
488 <?php
489 /*
490  * Second reference to monitor_notes.css is needed to sustain the actual styles. The jqueryui css
491  * must override some of the same style names causing the Note styles to not display correctly
492  * mws 4/26/13
493  */
494 ?>
495 <link rel="stylesheet" type="text/css" media="all" href="/monitor/css/monitor_notes.css"/>
496 <style>.iright {font-weight:normal !important} </style>
497 
498  <script type="text/javascript">
499  $(function(){
500 
501  // Datepicker
502  $('#target_launch').datepicker({
503  inline: true
504  });
505  // Datepicker2
506  $('#next_contact_date').datepicker({
507  inline: true
508  });
509  //hover states on the static widgets
510  $('#dialog_link, ul#icons li').hover(
511  function() { $(this).addClass('ui-state-hover'); },
512  function() { $(this).removeClass('ui-state-hover'); }
513  );
514 
515  });
516  </script>
517 <style>
518 textarea.viewonly{
519 background-color:EDEDED;
520 }
521 
522 @media only screen and (min-width: 1500px) {
523 
524 #content {
525  position:absolute;
526  top:0px;
527  left:0px;
528  max-width: 750px;
529 }
530 
531 body {
532  margin-left: 750px;
533 }
534 #primary_content {
535 
536 }
537 </style>
538  <script language="javascript">
539  <!--
540  function post_ncua() {
541  var char_num = document.cuinfo.charter_number.value;
542  if (char_num.length == 0) {
543  alert ("You forgot to enter a charter number, please enter a number and try again.");
544  } else {
545  document.ncua.Charter.value = document.cuinfo.charter_number.value;
546  document.ncua.submit();
547  }
548  }
549  function post_domainedit() {
550  var cucode= document.cuinfo.user_name.value;
551  var cudomain = document.cuinfo.home_page_url.value;
552  var cuserver = document.cuinfo.www_server.value;
553  var err="";
554  if (cucode.length == 0) {
555  err = err + "CU Code must be set first\n";
556  }
557  if (cudomain.length == 0) {
558  err = err + "CU Domain must be set first\n";
559  }
560  if (cuserver.length == 0) {
561  err = err + "CU Server must be set first\n";
562  }
563  if (err.length != 0) {
564  alert (err);
565  } else {
566  document.domainedit.Cu.value = cucode;
567  document.domainedit.Cd.value = document.cuinfo.home_page_url.value;
568  document.domainedit.Cs.value = document.cuinfo.www_server.value;
569  document.domainedit.cu_name.value = document.cuinfo.name.value;
570  document.domainedit.submit();
571  }
572  }
573 
574  function set_date(datefield) {
575  var type;
576 
577  if (document.cuinfo.elements[datefield]) {
578  if (document.cuinfo.elements[datefield].type == "text") {
579  // Make sure we are modifying a text field
580  // Now set the value of the date field to todays date
581  document.cuinfo.elements[datefield].value = "<?php echo date('m/d/Y'); ?>";
582  }
583  }
584  }
585  function submitform(row)
586  {
587  document.cuinfo.delrow.value=row;
588  document.cuinfo.mode.value='MCROW';
589  document.cuinfo.submit();
590  }
591  function sendform(mode)
592  {
593  document.cuinfo.mode.value=mode;
594  document.cuinfo.submit();
595  }
596  // -->
597  </script>
598  <div id='primary_content' style="">
599  <form name="cuinfo" action="<?php echo $_SERVER['SCRIPT_NAME'] . "?" . $url_string; ?>" method="post">
600  <input type="hidden" name="mode" value="SAVE">
601  <table cellspacing="0" cellpadding="3" border=0 width="75%" class="dmsbg"><tr><td>
602  <table cellspacing="1" cellpadding="1" border=0 width="100%">
603  <tr><td class='barb'>CU Implementation</td></tr>
604  </table>
605 
606  <?php
607 #
608 
609  // If not already loaded, get the cu info from the database
610  $loadrec = isset($showrows);
611  if ($loadrec == 0 ) {
612  $query = "select name, addr1, addr2, city, state, zip, main_email,
613  main_phone, ceo_mgr, dec_31_assets, dec_31_mem, home_page_url,
614  vendor, www_server, charter_number, conn_type,
615  dns_provider, web_host, target_launch, domain_regis, init_accts,
616  modem_num, train_date, serv_acct, conv_from, admin_setup,
617  listserv, mail_setup, interface_install,
618  to_char(next_contact_date, 'MM/DD/YYYY') as next_contact_date,
619  to_char(last_activity_date, 'MM/DD/YYYY') as last_activity_date,
620  to_char(contract_expires, 'MM/DD/YYYY') as contract_expires,
621  isp, system_options, renewal_term
622  from cuinfo where user_name = '$cuid'";
623  $result = db_query($query, $link);
624 
625  // Now fetch the row
626  list( $name, $addr1, $addr2, $city, $state, $zip, $main_email,
627  $main_phone, $ceo_mgr, $dec_31_assets, $dec_31_mem, $home_page_url,
628  $vendor, $www_server, $charter_number, $conn_type,
629  $dns_provider, $web_host, $target_launch, $domain_regis,
630  $init_accts, $modem_num, $train_date, $serv_acct, $conv_from,
631  $admin_setup, $listserv, $mail_setup, $interface_install, $next_contact_date,
632  $last_activity_date, $contract_expires, $isp, $system_options,$renewal_term) = db_fetch_array($result,0);
633 
634 # load array of existing monitor contacts
635 $mc=array();
636  $mcsql= "select role, decider, trim(fname), trim(lname),
637  trim(phone), trim(email), trim(comment)
638  from monitor_contact
639  where user_name='$user_name'
640  order by role, id;";
641  $mclist = db_query($mcsql, $link);
642  for ($row=0;list($mcrole, $mcdecider, $mcfname, $mclname, $mcphone, $mcemail, $mccomment) = db_fetch_array($mclist,$row); $row++) {
643  $mc[$row][0]=$mcrole;
644  $mc[$row][1]=($mcdecider == "Y" ? "Y" : "N");
645  $mc[$row][2]=$mcfname;
646  $mc[$row][3]=$mclname;
647  $mc[$row][4]=$mcphone;
648  $mc[$row][5]=$mcemail;
649  $mc[$row][6]=$mccomment;
650  }
651 
652  $showrows=($row == 0 ? 2 : $row+1);
653  }
654 
655  // ** Moved this outside the loadrec "if" statement above.. Becauase when the form was posted it was not calling the dms_disphtml function
656  // ** to properly encode the string... by putting it out here it will encode the string for database load -- OR from the global namespace variables
657  // * that get set after posting
658  $name = dms_disphtml($name);
659  $addr1 = dms_disphtml($addr1);
660  $addr2 = dms_disphtml($addr2);
661  $city = dms_disphtml($city);
662  $state = dms_disphtml(strtoupper($state));
663  $zip = dms_disphtml($zip);
664  $ceo_mgr = dms_disphtml($ceo_mgr);
665  $main_email = dms_disphtml($main_email);
666  $main_phone = dms_disphtml($main_phone);
667  $home_page_url = dms_disphtml($home_page_url);
668  $vendor = dms_disphtml($vendor);
669  $www_server = dms_disphtml($www_server);
670  $conv_from = dms_disphtml($conv_from);
671  $charter_number = dms_disphtml($charter_number);
672  $dec_31_assets = dms_disphtml($dec_31_assets);
673  $dec_31_mem = dms_disphtml($dec_31_mem);
674  $conn_type = isset($conn_type) ? dms_disphtml($conn_type) : "";
675  $dns_provider = dms_disphtml($dns_provider);
676  $web_host = dms_disphtml($web_host);
677  $domain_regis = isset($domain_regis) ? dms_disphtml($domain_regis) : "";
678  $init_accts = dms_disphtml($init_accts);
679  $modem_num = dms_disphtml($modem_num);
680  $system_options = isset($system_options) ? $system_options : 0;
681 
682  $target_launch = trim($target_launch);
683  if ( $target_launch != "FLEX" && $target_launch != "TBD" ) {
684  $target_launch = dms_disphtml(dateformat("m/d/Y",$target_launch));
685  }
686 
687  $train_date = dms_disphtml($train_date);
688  $serv_acct = dms_disphtml($serv_acct);
689  $admin_setup = dms_disphtml($admin_setup);
690  $listserv = dms_disphtml($listserv);
691  $mail_setup = dms_disphtml($mail_setup);
692  $interface_install = dms_disphtml($interface_install);
693  $next_contact_date = dms_disphtml($next_contact_date);
694  $last_activity_date = dms_disphtml($last_activity_date);
695  $contract_expires = dms_disphtml($contract_expires);
696  $renewal_term = isset($renewal_term) ? dms_disphtml($renewal_term) : 0;
697  $isp = dms_disphtml($isp);
698 
699  $sys_typ_batch = ($system_options & $SYS_TYPE_BATCH ? $SYS_TYPE_BATCH : NULL);
700  $sys_typ_live = ($system_options & $SYS_TYPE_LIVE ? $SYS_TYPE_LIVE : NULL);
701  $sys_typ_asp = ($system_options & $SYS_TYPE_ASP ? $SYS_TYPE_ASP : NULL);
702  $sys_typ_ivr = ($system_options & $SYS_TYPE_IVR ? $SYS_TYPE_IVR : NULL);
703  $sys_typ_webonly = ($system_options & $SYS_TYPE_WEBONLY ? $SYS_TYPE_WEBONLY : NULL);
704  $sys_typ_upgrade = ($system_options & $SYS_TYPE_UPGRADE ? $SYS_TYPE_UPGRADE : NULL);
705  $sys_typ_closed = ($system_options & $SYS_TYPE_CLOSED ? $SYS_TYPE_CLOSED : NULL);
706  $sys_typ_voip = ($system_options & $SYS_TYPE_VOIP ? $SYS_TYPE_VOIP : NULL);
707 
708  ?>
709 
710  <table cellspacing="0" cellpadding="1" border=0 width="100%">
711  <tr>
712  <td class="dtl" align="left">
713  <a href="/hcuadm/imp_menu.prg">Implementation Menu</a>
714  &nbsp;|&nbsp;
715  <a href="<?php echo $infourl; ?>/monitor/mindex.html">Main Credit Union List</a>
716  </td>
717  <td class="dtl" align="right">
718  <a href="/hcuadm/imp_main.prg?cuid=<?php echo $cuid?>&mode=PRINT">View Printable Version</a>
719  </td>
720  </tr>
721  <?php
722  if (isset($form_err) && strlen($form_err) > 0) {
723  print("
724  <tr>
725  <td colspan=2 class=\"dtl\" align=\"center\">
726  <font color=\"red\">$form_err<p></font>
727  </td>
728  </tr>");
729  }
730  ?>
731 
732  <?php if ($msg != ""): ?>
733  <tr>
734  <td colspan="2" class="error" align="center">
735  <?php echo $msg; ?>
736  </td>
737  </tr>
738  <?php endif; ?>
739  </table>
740 
741  <table cellspacing="0" cellpadding="1" border="0" width="100%" bgcolor="white">
742  <tr>
743  <td colspan="2" class="barb" align="left">
744  Credit Union Setup
745  </td>
746  </tr>
747  <tr>
748  <td align="right" width="25%" class="ileft">
749  CU Code:
750  </td>
751  <td class="iright" width="75%">
752  <?php if ($data_mode == "ADD"): ?>
753  <input type="text" name="user_name" size="10" maxlength="10" value="<?php echo $user_name ?>">
754  &nbsp;lowercase value
755  <?php else:
756  echo "$user_name <input type=\"hidden\" name=\"user_name\" value=\"$user_name\">";
757  endif; ?>
758  </td>
759  </tr>
760  <tr>
761  <td align="right" class="ileft">
762  CU Name:
763  </td>
764  <td class="iright" width="">
765  <input type="text" name="name" size="30" maxlength="40" value="<?php echo $name ?>">
766  </td>
767  </tr>
768  <tr>
769  <td nowrap align="right" valign="top" class="ileft">
770  Home CU Type:
771  </td>
772  <td class="iright">
773  <?php
774  ?>
775  <table border=0 cellpadding=0 cellspacing=0 width='100%'>
776  <tr>
777  <td width='15%' class='iright'>
778  <input type='checkbox' name='sys_typ_batch' value='1' <?php echo (isset($sys_typ_batch) ? "CHECKED" : ""); echo ($data_status == 'RUNNING' ? ' disabled' : ""); ?>>Batch<br>
779  </td>
780  <td width='10%' class='iright'>
781  <input type='checkbox' name='sys_typ_ivr' value='8' <?php echo (isset($sys_typ_ivr) ? "CHECKED" : ""); echo (($data_status == 'RUNNING' && isset($sys_typ_ivr)) ? ' disabled' : ""); ?>>IVR<br>
782  </td>
783  <td width='25%' class='iright'>
784  <input type='checkbox' name='sys_typ_upgrade' value='32' <?php echo (isset($sys_typ_upgrade) ? "CHECKED" : ""); echo ($data_status == 'RUNNING' ? ' disabled' : ""); ?>>Upgrade / Conversion<br>
785  </td>
786  <td width='50%' class='iright'>
787  <input type='checkbox' name='sys_typ_closed' value='64' <?php echo (isset($sys_typ_closed) ? "CHECKED" : ""); echo ($data_status == 'RUNNING' ? ' disabled' : ""); ?>>Closed CU<br>
788  </td>
789  </tr>
790  <tr>
791  <td class='iright'>
792  <input type='checkbox' name='sys_typ_live' value='2' <?php echo (isset($sys_typ_live) ? "CHECKED" : ""); echo ($data_status == 'RUNNING' ? ' disabled' : ""); ?>>Live<br>
793  </td>
794  <td width='10%' class='iright'>
795  <input type='checkbox' name='sys_typ_voip' value='<?php echo $SYS_TYPE_VOIP; ?>' <?php echo (isset($sys_typ_voip) ? "CHECKED" : ""); echo (($data_status == 'RUNNING' && isset($sys_typ_voip)) ? ' disabled' : ""); ?>>VOIP<br>
796  </td>
797  <td class='iright'>
798  <input type='checkbox' name='sys_typ_asp' value='4' <?php echo (isset($sys_typ_asp) ? "CHECKED" : ""); echo ($data_status == 'RUNNING' ? ' disabled' : ""); ?>>ASP<br>
799  </td>
800  <td class='iright' colspan='1'>
801  &nbsp;
802  </td>
803  </tr>
804  <tr>
805  <td class='iright'>
806  <input type='checkbox' name='sys_typ_webonly' value='16' <?php echo (isset($sys_typ_webonly) ? "CHECKED" : ""); echo ($data_status == 'RUNNING' ? ' disabled' : ""); ?>>Web ONLY<br>
807  </td>
808  <td class='iright' colspan='3'>
809  &nbsp;
810 <?php if ($data_status == 'RUNNING'){
811  echo ($system_options & $SYS_TYPE_BATCH ? "<input type='hidden' name='sys_typ_batch' value='1'>" : "");
812  echo ($system_options & $SYS_TYPE_LIVE ? "<input type='hidden' name='sys_typ_live' value='2'>" : "");
813  echo ($system_options & $SYS_TYPE_ASP ? "<input type='hidden' name='sys_typ_asp' value='4'>" : "");
814  echo ($system_options & $SYS_TYPE_IVR ? "<input type='hidden' name='sys_typ_ivr' value='8'>" : "");
815  echo ($system_options & $SYS_TYPE_WEBONLY ? "<input type='hidden' name='sys_typ_webonly' value='16'>" : "");
816  echo ($system_options & $SYS_TYPE_UPGRADE ? "<input type='hidden' name='sys_typ_upgrade' value='32'>" : "");
817  echo ($system_options & $SYS_TYPE_CLOSED ? "<input type='hidden' name='sys_typ_closed' value='64'>" : "");
818  echo ($system_options & $SYS_TYPE_VOIP ? "<input type='hidden' name='sys_typ_voip' value='" . $SYS_TYPE_VOIP . "'>" : "");
819  echo "<input type='hidden' name='system_options' value='$system_options'>";
820 } ?>
821  </td>
822  </tr>
823  </table>
824  </td>
825  </tr>
826  <tr>
827  <td nowrap align="right" valign="top" class="ileft">
828  CU Server:
829  </td>
830 <?php if ($data_status == "PENDING"): ?>
831  <td class="iright">
832  <select name="www_server" size="1">
833  <option value="">Select Server...</option>
834  <option value="www" <?php if($www_server=="www") echo "SELECTED" ?>>www</option>
835  <option value="www3" <?php if($www_server=="www3") echo "SELECTED" ?>>www3</option>
836  <option value="www5" <?php if($www_server=="www5") echo "SELECTED" ?>>www5</option>
837  <option value="www6" <?php if($www_server=="www6") echo "SELECTED" ?>>www6</option>
838  <!-- FUTURE DEVELOPMENT<option value="ivr" <?php if($www_server=="ivr") echo "SELECTED" ?>>ivr (VOIP SERVICE ONLY)</option>-->
839  </select>
840  <input type="submit" name="btnServ" value="CU Setup">
841  </td>
842 <?php else: ?>
843  <td class="iright"> &nbsp;
844  <?php echo "$www_server"; ?><input type="hidden" name="www_server"
845  value="<?php echo $www_server; ?>">
846 <?php endif; ?>
847  </tr>
848  </table>
849  <table cellspacing="0" cellpadding="1" border="0" width="100%" bgcolor="white">
850  <tr>
851  <td colspan="2" class="barb" align="left">
852  Contact Information
853  </td>
854  </tr>
855  <tr>
856  <td align="right" width="25%" class="ileft" valign="top">
857  Address:
858  </td>
859  <td class='iright'>
860  <input type="text" name="addr1" size="30" maxlength="40" value="<?php echo $addr1 ?>">
861  </td>
862  </tr>
863 
864  <tr>
865  <td class="ileft">
866  &nbsp;
867  </td>
868  <td class='iright'>
869  <input type="text" name="addr2" size="30" maxlength="40" value="<?php echo $addr2 ?>">
870  </td>
871  </tr>
872 
873  <tr>
874  <td align="right" nowrap class="ileft">
875  City ST Zip:
876  </td>
877  <td class='iright'>
878  <input type="text" name="city" size="25" maxlength="25" value="<?php echo $city ?>">&nbsp;&nbsp;
879  <select name="state" size=1>
880  <OPTION VALUE="">&lt;Select State&gt;
881  <OPTION VALUE="AL" <?php if ($state == "AL")echo "SELECTED" ?>> Alabama
882  <OPTION VALUE="AK" <?php if ($state == "AK")echo "SELECTED" ?>> Alaska
883  <OPTION VALUE="AZ" <?php if ($state == "AZ")echo "SELECTED" ?>> Arizona
884  <OPTION VALUE="AR" <?php if ($state == "AR")echo "SELECTED" ?>> Arkansas
885  <OPTION VALUE="CA" <?php if ($state == "CA")echo "SELECTED" ?>> California
886  <OPTION VALUE="CO" <?php if ($state == "CO")echo "SELECTED" ?>> Colorado
887  <OPTION VALUE="CT" <?php if ($state == "CT")echo "SELECTED" ?>> Connecticut
888  <OPTION VALUE="DE" <?php if ($state == "DE")echo "SELECTED" ?>> Delaware
889  <OPTION VALUE="DC" <?php if ($state == "DC")echo "SELECTED" ?>> District of Columbia
890  <OPTION VALUE="FL" <?php if ($state == "FL")echo "SELECTED" ?>> Florida
891  <OPTION VALUE="GA" <?php if ($state == "GA")echo "SELECTED" ?>> Georgia
892  <OPTION VALUE="HI" <?php if ($state == "HI")echo "SELECTED" ?>> Hawaii
893  <OPTION VALUE="ID" <?php if ($state == "ID")echo "SELECTED" ?>> Idaho
894  <OPTION VALUE="IL" <?php if ($state == "IL")echo "SELECTED" ?>> Illinois
895  <OPTION VALUE="IN" <?php if ($state == "IN")echo "SELECTED" ?>> Indiana
896  <OPTION VALUE="IA" <?php if ($state == "IA")echo "SELECTED" ?>> Iowa
897  <OPTION VALUE="KS" <?php if ($state == "KS")echo "SELECTED" ?>> Kansas
898  <OPTION VALUE="KY" <?php if ($state == "KY")echo "SELECTED" ?>> Kentucky
899  <OPTION VALUE="LA" <?php if ($state == "LA")echo "SELECTED" ?>> Louisiana
900  <OPTION VALUE="ME" <?php if ($state == "ME")echo "SELECTED" ?>> Maine
901  <OPTION VALUE="MD" <?php if ($state == "MD")echo "SELECTED" ?>> Maryland
902  <OPTION VALUE="MA" <?php if ($state == "MA")echo "SELECTED" ?>> Massachusetts
903  <OPTION VALUE="MI" <?php if ($state == "MI")echo "SELECTED" ?>> Michigan
904  <OPTION VALUE="MN" <?php if ($state == "MN")echo "SELECTED" ?>> Minnesota
905  <OPTION VALUE="MS" <?php if ($state == "MS")echo "SELECTED" ?>> Mississippi
906  <OPTION VALUE="MO" <?php if ($state == "MO")echo "SELECTED" ?>> Missouri
907  <OPTION VALUE="MT" <?php if ($state == "MT")echo "SELECTED" ?>> Montana
908  <OPTION VALUE="NE" <?php if ($state == "NE")echo "SELECTED" ?>> Nebraska
909  <OPTION VALUE="NV" <?php if ($state == "NV")echo "SELECTED" ?>> Nevada
910  <OPTION VALUE="NH" <?php if ($state == "NH")echo "SELECTED" ?>> New Hampshire
911  <OPTION VALUE="NJ" <?php if ($state == "NJ")echo "SELECTED" ?>> New Jersey
912  <OPTION VALUE="NM" <?php if ($state == "NM")echo "SELECTED" ?>> New Mexico
913  <OPTION VALUE="NY" <?php if ($state == "NY")echo "SELECTED" ?>> New York
914  <OPTION VALUE="NC" <?php if ($state == "NC")echo "SELECTED" ?>> North Carolina
915  <OPTION VALUE="ND" <?php if ($state == "ND")echo "SELECTED" ?>> North Dakota
916  <OPTION VALUE="OH" <?php if ($state == "OH")echo "SELECTED" ?>> Ohio
917  <OPTION VALUE="OK" <?php if ($state == "OK")echo "SELECTED" ?>> Oklahoma
918  <OPTION VALUE="OR" <?php if ($state == "OR")echo "SELECTED" ?>> Oregon
919  <OPTION VALUE="PA" <?php if ($state == "PA")echo "SELECTED" ?>> Pennsylvania
920  <OPTION VALUE="RI" <?php if ($state == "RI")echo "SELECTED" ?>> Rhode Island
921  <OPTION VALUE="SC" <?php if ($state == "SC")echo "SELECTED" ?>> South Carolina
922  <OPTION VALUE="SD" <?php if ($state == "SD")echo "SELECTED" ?>> South Dakota
923  <OPTION VALUE="TN" <?php if ($state == "TN")echo "SELECTED" ?>> Tennessee
924  <OPTION VALUE="TX" <?php if ($state == "TX")echo "SELECTED" ?>> Texas
925  <OPTION VALUE="UT" <?php if ($state == "UT")echo "SELECTED" ?>> Utah
926  <OPTION VALUE="VT" <?php if ($state == "VT")echo "SELECTED" ?>> Vermont
927  <OPTION VALUE="VA" <?php if ($state == "VA")echo "SELECTED" ?>> Virginia
928  <OPTION VALUE="WA" <?php if ($state == "WA")echo "SELECTED" ?>> Washington
929  <OPTION VALUE="WV" <?php if ($state == "WV")echo "SELECTED" ?>> West Virginia
930  <OPTION VALUE="WI" <?php if ($state == "WI")echo "SELECTED" ?>> Wisconsin
931  <OPTION VALUE="WY" <?php if ($state == "WY")echo "SELECTED" ?>> Wyoming
932  <OPTION VALUE="TT" <?php if ($state == "TT")echo "SELECTED" ?>>Trinidad &amp; Tobago
933  <OPTION VALUE="VI" <?php if ($state == "VI")echo "SELECTED" ?>> U.S. Virgin Islands
934  <OPTION VALUE="PR" <?php if ($state == "PR")echo "SELECTED" ?>> Puerto Rico
935  </select>&nbsp;&nbsp;&nbsp;
936  <input type="text" name="zip" size="15" maxlength="15" value="<?php echo $zip ?>">
937  </td>
938  </tr>
939  <tr>
940  <td align="right" nowrap class="ileft">
941  CEO/MGR:
942  </td>
943  <td class='iright'>
944  <input type="text" name="ceo_mgr" size="30" maxlength="40" value="<?php echo $ceo_mgr ?>">
945  </td>
946  </tr>
947  <tr>
948  <td align="right" nowrap class="ileft">
949  Main Email:
950  </td>
951  <td class='iright'>
952 
953  <input type="text" name="main_email" size="30" maxlength="40" value="<?php echo $main_email ?>">
954  </td>
955  </tr>
956  <tr>
957  <td align="right" nowrap class="ileft">
958  Main Phone:
959  </td>
960  <td class='iright'>
961  <input type="text" name="main_phone" size="20" maxlength="20" value="<?php echo $main_phone ?>">
962  <span class="iegreen">###-###-####</span>
963  </td>
964  </tr>
965 <?php
966 
967 # show rows and empty input boxes
968 print "<tr><td colspan='2' class='barb'><hr></td></tr>
969  <tr><td colspan='2'>
970  <table align='center' cellspacing='0' cellpadding='0' border='0' width='100%' bgcolor=white>";
971  print "<tr class='ileft'>
972  <td>Role</td>
973  <td>Decider</td>
974  <td>First Name</td>
975  <td>Last Name</td>
976  <td>Phone</td>
977  <td>Email</td>
978  <td>Contact Info</td>
979  <td><input type=button value='+' onClick=\"sendform('MCMORE')\">&nbsp;
980  <input name='mcdirty' type='hidden' value=''>
981  <input type='hidden' name='showrows' value='$showrows'>
982  <input type='hidden' name='cuid' value='$cuid'>
983  <input type='hidden' name='delrow' value=''></td></tr>";
984 
985  for ($prow=0; $prow < $showrows; $prow++) {
986  $RGB = (($prow % 2 != 0) ? "even" : "odd");
987 
988  print "<tr class='$RGB'><td class='usu' valign='top'>
989  <select name='mc[$prow][0]'>
990  <option value=''>Select Role...</option>";
991  foreach ($cu_contact_role as $key => $value) {
992  print "<option value='$key' " . (HCU_array_key_exists($prow, $mc) ? (HCU_array_key_value(0, $mc[$prow]) == $key ? $mc[$prow][0] : "") : "") . ">$value</option>\n";
993  }
994  print "</select></td>\n";
995  // ** Note the value properties below use a double quote " to encapsulate the value --
996  // ** this is because by default the dms_disphtml does not encode '(single quotes)...
997  // ** So if a single quote was in the value it was not show up correctly
998 
999  #Decider
1000  print "<td class='usu' valign='top'><input type='checkbox' name='mc[$prow][1]' value='Y' onChange='javascript:document.forms[0].mcdirty.value=1'
1001  " . (HCU_array_key_exists($prow, $mc) ? (HCU_array_key_value(1, $mc[$prow]) == "Y" ? "CHECKED" : "") : "") . "></td>";
1002  #First Name
1003  print "<td class='usu' valign='top'><input type='text' size='20' maxlength='40' name='mc[$prow][2]'
1004  value='" . (HCU_array_key_exists($prow, $mc) ? (HCU_array_key_value(2, $mc[$prow]) ? dms_disphtml($mc[$prow][2]) : "") : "") . "' onChange='javascript:document.forms[0].mcdirty.value=1'></td>";
1005  #Last Name
1006  print "<td class='usu' valign='top'><input type='text' size='20' maxlength='40' name='mc[$prow][3]'
1007  value='" . (HCU_array_key_exists($prow, $mc) ? (HCU_array_key_value(3, $mc[$prow]) ? dms_disphtml($mc[$prow][3]) : "") : "") . "' onChange='javascript:document.forms[0].mcdirty.value=1'></td>";
1008  #Phone
1009  print "<td class='usu' valign='top'><input type='text' size='20' maxlength='20' name='mc[$prow][4]'
1010  value='" . (HCU_array_key_exists($prow, $mc) ? (HCU_array_key_value(4, $mc[$prow]) ? dms_disphtml($mc[$prow][4]) : "") : "") . "' onChange='javascript:document.forms[0].mcdirty.value=1'></td>";
1011  #Email
1012  print "<td class='usu' valign='top'><input type='text' size='20' maxlength='50' name='mc[$prow][5]'
1013  value='" . (HCU_array_key_exists($prow, $mc) ? (HCU_array_key_value(5, $mc[$prow]) ? dms_disphtml($mc[$prow][5]) : "") : "") . "' onChange='javascript:document.forms[0].mcdirty.value=1'></td>";
1014  #Comment
1015  print "<td class='usu' valign='top'><textarea name='mc[$prow][6]' rows='2' cols='20' wrap='virtual' onChange='javascript:document.forms[0].mcdirty.value=1'>
1016  " . (HCU_array_key_exists($prow, $mc) ? (HCU_array_key_value(6, $mc[$prow]) ? dms_disphtml($mc[$prow][6]) : "") : "") . "</textarea></td>";
1017 
1018  print "<td class='usu' valign='top'>&nbsp;<input type='button' value='X' onClick='submitform(\"$prow\");'>&nbsp;</td>";
1019 
1020  print "</tr>\n";
1021 
1022  }
1023 print "</td></tr></table>";
1024 
1025 #
1026 ?>
1027 </td></tr>
1028  </table>
1029  <table cellspacing="0" cellpadding="1" border="0" width="100%" bgcolor="white">
1030  <tr>
1031  <td colspan="2" class="barb" align="left">
1032  Account Information
1033  </td>
1034  </tr>
1035 
1036  <tr>
1037  <td align="right" nowrap class="ileft" width="25%">
1038  Charter Number:
1039  </td>
1040  <td class="iright" width="75%">
1041  <?php
1042  $cu_info = $charter_number;
1043  ?>
1044  <input type="text" name="charter_number" size="10" maxlength="10" value="<?php echo $cu_info ?>">
1045  <span class="iegreen">##</span>
1046  &nbsp;&nbsp;<input type="button" name="FindNCUA" value="Search NCUA" onclick="post_ncua()">
1047  </td>
1048  </tr>
1049  <tr>
1050  <td align="right" nowrap class="ileft">
1051  Domain:
1052  </td>
1053  <td class="iright">
1054  <span class="iegreen">&nbsp;http://&nbsp;</span>
1055  <?php
1056  $cu_info = $home_page_url;
1057  ?>
1058  <input type="text" name="home_page_url" size="32" maxlength="80" value="<?php echo $cu_info ?>">
1059  &nbsp;&nbsp;<input type="button" name="EditDomain" value="Save Map" onclick="post_domainedit()">
1060  </td>
1061  </tr>
1062  <tr>
1063  <td nowrap align="right" class="ileft">
1064  Assets:
1065  </td>
1066  <td nowrap class="iright">
1067  <?php
1068  $cu_info = $dec_31_assets;
1069  ?>
1070  <input type="text" name="dec_31_assets" size="6" maxlength="5" value="<?php echo $cu_info ?>">
1071  &nbsp;
1072  <span class="iegreen">$999.9 M</span>
1073  </td>
1074  </tr>
1075  <tr>
1076  <td nowrap align="right" class="ileft">
1077  # of Members:
1078  </td>
1079  <td nowrap class="iright">
1080  <?php
1081  $cu_info = $dec_31_mem;
1082  ?>
1083  <input type="text" name="dec_31_mem" size="5" maxlength="5" value="<?php echo $cu_info ?>">
1084  &nbsp;
1085  <span class="iegreen">##</span>
1086  </td>
1087  </tr>
1088 
1089  <?php
1090  $cu_info = $vendor;
1091  ?>
1092  <tr>
1093  <td class='ileft' align=right>Vendor: </td>
1094  <td class="iright"><select name="vendor" size="1">
1095  <option value="">&lt;&lt;Select&gt;&gt;
1096  <?php
1097  $sql = "SELECT * FROM cuvendors ORDER BY vendvar ";
1098  if ($sql_rs = db_query($sql, $link)) {
1099  $row_vnd = 0;
1100  while($sql_row = db_fetch_array($sql_rs, $row_vnd++)) {
1101  $code = htmlspecialchars(trim($sql_row['vendvar']));
1102  $value = htmlspecialchars(trim($sql_row['vendor']));
1103  if (trim($cu_info) == trim($sql_row['vendor'])) {
1104  $sel = "SELECTED";
1105  } else {
1106  $sel = "";
1107  }
1108 
1109  printf("\n<option value=\"%s\" %s>%s</option>",$value, $sel, $code);
1110  }
1111  }
1112  db_free_result($sql_rs);
1113  ?>
1114  </select></td>
1115  </tr>
1116  <tr>
1117  <td align="right" nowrap class="ileft">
1118  Connectivity Type:
1119  </td>
1120  <td class="iright">
1121  <?php
1122  $cu_info = $conn_type;
1123  ?>
1124  <select name="conn_type">
1125  <option value="">Select Type...</option>
1126  <option value="1"<?php if ($cu_info == "1") echo "SELECTED"; ?>>DSL</option>
1127  <option value="2"<?php if ($cu_info == "2") echo "SELECTED"; ?>>Cable</option>
1128  <option value="3"<?php if ($cu_info == "3") echo "SELECTED"; ?>>T1</option>
1129  <option value="4"<?php if ($cu_info == "4") echo "SELECTED"; ?>>Modem</option>
1130  <option value="5"<?php if ($cu_info == "5") echo "SELECTED"; ?>>Other</option>
1131  </select>
1132  </td>
1133  </tr>
1134  <tr>
1135  <td align="right" nowrap class="ileft">
1136  ISP:
1137  </td>
1138  <td class="iright">
1139  <?php
1140  $cu_info = $isp;
1141  ?>
1142  <input type="text" name="isp" size="30" maxlength="40" value="<?php echo $cu_info ?>">
1143  </td>
1144  </tr>
1145  <tr>
1146  <td align="right" nowrap class="ileft">
1147  DNS Provider:
1148  </td>
1149  <td class="iright">
1150  <?php
1151  $cu_info = $dns_provider;
1152  ?>
1153  <input type="text" name="dns_provider" size="20" maxlength="20" value="<?php echo $cu_info ?>">
1154  </td>
1155  </tr>
1156  <tr>
1157  <td align="right" nowrap class="ileft">
1158  Web Hoster:
1159  </td>
1160  <td class="iright">
1161  <?php
1162  $cu_info = $web_host;
1163  ?>
1164  <input type="text" name="web_host" size="20" maxlength="20" value="<?php echo $cu_info ?>">
1165  </td>
1166  </tr>
1167 
1168 
1169 
1170  </table>
1171  <table cellspacing="0" cellpadding="1" border="0" width="100%" bgcolor="white">
1172  <tr>
1173  <td colspan="2" class="barb" align="left">
1174  Implementation
1175  </td>
1176  </tr>
1177 
1178  <tr>
1179  <td align="right" nowrap valign="top" class="ileft" width="25%">
1180  Services Ordered:
1181  </td>
1182  <td valign="top" nowrap class="iright" width="75%">
1183  <?php
1184 ?>
1185  <?php // Create a query here to query the available
1186  // products from the cuprodlist table
1187 
1188 
1189  if (isset($cu_products))
1190  $cu_items = $cu_products;
1191  //$cu_items = explode("~", $cu_products);
1192 
1193  $prod_qry = "SELECT * FROM cuprodlist ORDER BY home_cu_desc";
1194  if ($hcu_prod_result = db_query($prod_qry, $link)) {
1195  //Items were found in the table so print them, otherwise leave options empty
1196  $prod_rows = db_num_rows($hcu_prod_result);
1197  for ($row = 0; $row < $prod_rows; $row++) {
1198  $hcu_prod_row = db_fetch_object( $hcu_prod_result, $row);
1199  // For each row we'll need to add it to the list, and look it up in the cuproducts table to see if the user has it selected
1200  $cu_code = htmlspecialchars(trim($hcu_prod_row->home_cu_code));
1201  $cu_desc = htmlspecialchars(trim($hcu_prod_row->home_cu_desc));
1202 
1203  $prod_select = "";
1204  if (! (isset($cu_products))) {
1205  $query = "SELECT * FROM cuproducts WHERE user_name = '{$cuid}' AND home_cu_code = '$cu_code'";
1206  if ($user_prod_result = db_query($query, $link))
1207  if (db_num_rows( $user_prod_result) > 0)
1208  $prod_select = "CHECKED";
1209  } else {
1210  // Products are set by a form variable so try to load them from there
1211  $sel_elements = count($cu_items); // get the selected items
1212  for ($element = 0; $element < $sel_elements; $element++) {
1213  if (trim($cu_items[$element]) == trim($cu_code))
1214  $prod_select = "CHECKED";
1215  }
1216 
1217  }
1218  //printf("<option value=\"%s\" %s>%s\n",$cu_code, $prod_select, $cu_desc);
1219  printf("<input type=\"checkbox\" name=\"cu_products[]\" value=\"%s\" %s>%s\n",$cu_code, $prod_select, $cu_desc);
1220  if (($row % 3) == 0 && $row != 0) {
1221  print "<br>";
1222  }
1223  }
1224  }
1225 
1226  ?>
1227  </td>
1228  </tr>
1229  <tr>
1230  <td align="right" nowrap class="ileft">
1231  Target Launch Date:
1232  </td>
1233  <td class="iright">
1234  <?php
1235  $cu_info = $target_launch;
1236  ?>
1237  <input type="text" name="target_launch" size="10" maxlength="10" id="target_launch" value="<?php echo $cu_info ?>" required>
1238 
1239 &nbsp;&nbsp;
1240  <span class="iegreen">MM/DD/YYYY</span>
1241  &nbsp;
1242  <a id="setFlex" style="font-size:12px;" href="#" onClick="$('#target_launch').val('FLEX'); return false;">FLEX</a>
1243  &nbsp;
1244  <a id="setTbd" style="font-size:12px;" href="#" onClick="$('#target_launch').val('TBD'); return false;">TBD</a>
1245  </td>
1246  </tr>
1247  <tr>
1248  <td align="right" nowrap class="ileft">
1249  Domain Registration:
1250  </td>
1251  <td class="iright">
1252  <?php
1253  $cu_info = $domain_regis;
1254  ?>
1255  <select name="domain_regis">
1256  <option value="">Select Type...</option>
1257  <option value="1" <?php if ($cu_info == "1") echo "SELECTED"; ?>>No Domain -- Need One</option>
1258  <option value="2" <?php if ($cu_info == "2") echo "SELECTED"; ?>>Have One -- Move Domain</option>
1259  <option value="3" <?php if ($cu_info == "3") echo "SELECTED"; ?>>Have One -- Repoint Domain</option>
1260  <option value="4" <?php if ($cu_info == "4") echo "SELECTED"; ?>>Have One -- No Action Needed</option>
1261  </select>
1262  </td>
1263  </tr>
1264  <tr>
1265  <td align="right" nowrap class="ileft">
1266  Initial Accounts:
1267  </td>
1268  <td class="iright">
1269  <?php
1270  $cu_info = $init_accts;
1271  ?>
1272  <input type="text" name="init_accts" size="20" maxlength="20" value="<?php echo $cu_info ?>">
1273  </td>
1274  </tr>
1275  <tr>
1276  <td align="right" nowrap class="ileft">
1277  Modem Number:
1278  </td>
1279  <td class="iright">
1280  <?php
1281  $cu_info = $modem_num;
1282  ?>
1283  <input type="text" name="modem_num" size="20" maxlength="20" value="<?php echo $cu_info ?>">
1284  <span class="iegreen">###-###-####</span>
1285  </td>
1286  </tr>
1287  <tr>
1288  <td align="right" nowrap class="ileft">
1289  Training Date:
1290  </td>
1291  <td class="iright">
1292  <?php
1293  $cu_info = $train_date;
1294  ?>
1295  <input type="text" name="train_date" size="10" maxlength="10" value="<?php echo $cu_info ?>">
1296  <a href="javascript:set_date('train_date')"><img src="/monitor/images/admin_tack.gif" alt="Today" border=0></a>&nbsp;&nbsp;
1297  <span class="iegreen">MM/DD/YYYY</span>
1298  </td>
1299  </tr>
1300  <tr>
1301  <td align="right" nowrap class="ileft">
1302  Server Account:
1303  </td>
1304  <td class="iright">
1305  <?php
1306  $cu_info = $serv_acct;
1307  ?>
1308  <input type="text" name="serv_acct" size="10" maxlength="10" value="<?php echo $cu_info ?>">
1309  </td>
1310  </tr>
1311  <tr>
1312  <td align="right" nowrap class="ileft">
1313  Converted From:
1314  </td>
1315  <td class="iright">
1316  <?php
1317  $cu_info = $conv_from;
1318  ?>
1319  <select name="conv_from">
1320  <option value="">Select From List...</option>
1321  <?php
1322  foreach ($cu_prov_list as $value) {
1323  print "<option value=\"$value\"" .
1324  ($value == $cu_info ? "SELECTED" : "") .
1325  ">$value</option>\n";
1326  }
1327  ?>
1328  </select>
1329  </td>
1330  </tr>
1331  <tr>
1332  <td align="right" nowrap class="ileft">
1333  Admin Setup:
1334  </td>
1335  <td class="iright">
1336  <?php
1337  $cu_info = $admin_setup;
1338  ?>
1339  <input type="text" name="admin_setup" size="10" maxlength="10" value="<?php echo $cu_info ?>">
1340  <a href="javascript:set_date('admin_setup')"><img src="/monitor/images/admin_tack.gif" alt="Today" border=0></a>&nbsp;&nbsp;
1341  <span class="iegreen">MM/DD/YYYY</span>
1342  </td>
1343  </tr>
1344  <tr>
1345  <td align="right" nowrap class="ileft">
1346  Listserv Setup:
1347  </td>
1348  <td class="iright">
1349  <?php
1350  $cu_info = $listserv;
1351  ?>
1352  <input type="text" name="listserv" size="10" maxlength="10" value="<?php echo $cu_info ?>">
1353  <a href="javascript:set_date('listserv')"><img src="/monitor/images/admin_tack.gif" alt="Today" border=0></a>&nbsp;&nbsp;
1354  <span class="iegreen">MM/DD/YYYY</span>
1355  </td>
1356  </tr>
1357  <tr>
1358  <td align="right" nowrap class="ileft">
1359  Mail Setup:
1360  </td>
1361  <td class="iright">
1362  <?php
1363  $cu_info = $mail_setup;
1364  ?>
1365  <input type="text" name="mail_setup" size="10" maxlength="10" value="<?php echo $cu_info ?>">
1366  <a href="javascript:set_date('mail_setup')"><img src="/monitor/images/admin_tack.gif" alt="Today" border=0></a>&nbsp;&nbsp;
1367  <span class="iegreen">MM/DD/YYYY</span>
1368  </td>
1369  </tr>
1370  <tr>
1371  <td align="right" nowrap class="ileft">
1372  Interface Installation:
1373  </td>
1374  <td class="iright">
1375  <?php
1376  $cu_info = $interface_install;
1377  ?>
1378  <input type="text" name="interface_install" size="10" maxlength="10" value="<?php echo $cu_info ?>">
1379  <a href="javascript:set_date('interface_install')"><img src="/monitor/images/admin_tack.gif" alt="Today" border=0></a>&nbsp;&nbsp;
1380  <span class="iegreen">MM/DD/YYYY</span>
1381  </td>
1382  </tr>
1383  <tr>
1384  <td align="right" nowrap class="ileft">
1385  Next Contact Date:
1386  </td>
1387  <td class="iright">
1388  <?php
1389  $cu_info = $next_contact_date;
1390  ?>
1391  <input type="text" name="next_contact_date" size="10" maxlength="10" id="next_contact_date" value="<?php echo $cu_info ?>">
1392 &nbsp;&nbsp;
1393  <span class="iegreen">MM/DD/YYYY</span>
1394  </td>
1395  </tr>
1396  <tr>
1397  <td align="right" nowrap class="ileft">
1398  Last Activity Date:
1399  </td>
1400  <td class="iright">
1401  <?php
1402  $cu_info = $last_activity_date;
1403  ?>
1404  <input type="text" name="last_activity_date" size="10" maxlength="10" value="<?php echo $cu_info ?>">
1405  <a href="javascript:set_date('last_activity_date')"><img src="/monitor/images/admin_tack.gif" alt="Today" border=0></a>&nbsp;&nbsp;
1406  <span class="iegreen">MM/DD/YYYY</span>
1407  </td>
1408  </tr>
1409  <tr>
1410  <td align="right" nowrap class="ileft">
1411  Contract Expires:
1412  </td>
1413  <td class="iright">
1414  <?php
1415  $cu_info = $contract_expires;
1416  ?>
1417  <input type="text" name="contract_expires" size="10" maxlength="10" value="<?php echo $cu_info ?>">
1418  <a href="javascript:set_date('contract_expires')" style=""><img src="/monitor/images/admin_tack.gif" alt="Today" border=0></a>&nbsp;&nbsp;
1419  <span class="iegreen">MM/DD/YYYY</span>&nbsp;&nbsp;&nbsp; Renewal Months: &nbsp;<input type="text" name="renewal_term" size="5" maxlength="3" value="<?php echo $renewal_term ?>">
1420  </td>
1421  </tr>
1422  <?php
1423  /*
1424  ?>
1425  <tr>
1426  <td align="right" nowrap class="ileft" valign="top">
1427  Comments:
1428  </td>
1429  <td class="iright">
1430  <?php
1431  $cu_info = $comments;
1432  ?>
1433  <textarea name="comments" rows="6" cols="60"><?php echo $cu_info; ?></textarea>
1434  </td>
1435  </tr>
1436  <tr>
1437  <td align="right" nowrap class="ileft" valign="top">
1438  Contract Notes:
1439  </td>
1440  <td class="iright">
1441  <?php
1442  $cu_info = $contract_notes;
1443  ?>
1444  <textarea name="contract_notes" rows="6" cols="60"><?php echo $cu_info; ?></textarea>
1445  </td>
1446  </tr>
1447  <tr>
1448  <td align="right" nowrap class="ileft" valign="top">
1449  Implementation Notes:
1450  </td>
1451  <td class="iright">
1452  <?php
1453  $cu_info = $misc_notes;
1454  ?>
1455  <textarea name="misc_notes" rows="6" cols="60" <?php echo ($data_status == 'RUNNING' ? " readonly class=viewonly" : ""); ?>><?php echo $cu_info; ?></textarea>
1456  </td>
1457  </tr>
1458  <?php
1459  */
1460  ?>
1461  <tr><td colspan="2" class="iright"><hr></td></tr>
1462  <tr>
1463  <td colspan="2" class="iright">
1464  <input type="submit" value="Add / Save" name="btnSave">&nbsp;
1465  <input type="button" value="Cancel" name="btnCancel" onclick="document.location='/hcuadm/imp_menu.prg'">&nbsp;
1466  </td>
1467  </tr>
1468  </table>
1469 
1470  </td></tr></table>
1471  </form>
1472  </div>
1473 <div style='clear:both;'></div>
1474 
1475 <div class="dtl">
1476 <?php
1477  if ($cuid != 'NEW') {
1478  // ** I am going to include the monitor_notes.data here -- This will do any data updates and load any data
1479  // Data portion of notes is not called directly from the monitor_notes.desktop
1480  // require('monitor_notes.data');
1481 
1482  // ** SHOW THE CURRENT NOTES
1483  require('monitor_notes.desktop');
1484  }
1485 ?>
1486 </div>
1487  <!--form action="https://www.ncua.gov/cgi-bin/cudataexpanded.exe?submit=1" method="post" name="ncua" target="ncua_result" -->
1488  <form action="https://webapps.ncua.gov/cgi-bin/cudataexpanded.exe" method="post" name="ncua" target="ncua_result">
1489  <input type="hidden" name="Status" value="A">
1490  <input type="hidden" name="cfserver" value="reports.ncua.gov">
1491  <input type="hidden" name="Charter" value="">
1492  <!--<input type="hidden" value="1" name="submit">-->
1493  </form>
1494  <form action="<?php echo $infourl; ?>/hcuadm/domainmap.prg" method="post" name="domainedit" target="DomainEdit">
1495  <input type="hidden" name="Cu" value="">
1496  <input type="hidden" name="Cd" value="">
1497  <input type="hidden" name="Cs" value="">
1498  <input type="hidden" name="cu_name" value="">
1499  </form>
1500  </body>
1501 </html>
1502 <?php
1503  break;
1504  case "PRINT":
1505  // This will print a printer friendly version, similar, but no input boxes
1506  // Determine if we are Adding or Editing
1507  $num_rows = 0;
1508  $url_string = "";
1509  $data_mode = "ADD";
1510  if (isset($cuid)) {
1511  // We are attempting to load a cu ID, so we are editing
1512  // Connect to the database - get the team information from the database
1513 
1514  $cuid = trim($cuid);
1515 
1516  $query = "select name, addr1, addr2, city, state, zip, main_email,
1517  main_phone, ceo_mgr, dec_31_assets, dec_31_mem, home_page_url,
1518  vendor, www_server, charter_number, conn_type,
1519  dns_provider, web_host, target_launch, domain_regis, init_accts,
1520  modem_num, train_date, serv_acct, conv_from, admin_setup,
1521  listserv, mail_setup, interface_install, contract_notes,comments,
1522  misc_notes,
1523  to_char(next_contact_date, 'MM/DD/YYYY') as next_contact_date,
1524  to_char(last_activity_date, 'MM/DD/YYYY') as last_activity_date,
1525  to_char(contract_expires, 'MM/DD/YYYY') as contract_expires,
1526  isp, system_options
1527  from cuinfo where user_name = '{$_GET['cuid']}' ";
1528 
1529  $result = db_query($query, $link);
1530 
1531  $num_rows = db_num_rows($result);
1532  if ($num_rows == 1) {
1533  $url_string .= "cuid=" . $cuid . "&";
1534  $data_mode = "EDIT";
1535  }
1536 
1537  // Now fetch the row
1538  list( $name, $addr1, $addr2, $city, $state, $zip, $main_email,
1539  $main_phone, $ceo_mgr, $dec_31_assets, $dec_31_mem, $home_page_url,
1540  $vendor, $www_server, $charter_number, $conn_type,
1541  $dns_provider, $web_host, $target_launch, $domain_regis,
1542  $init_accts, $modem_num, $train_date, $serv_acct, $conv_from,
1543  $admin_setup, $listserv, $mail_setup, $interface_install,
1544  $contract_notes, $comments, $misc_notes, $next_contact_date,
1545  $last_activity_date, $contract_expires, $isp, $system_options) = db_fetch_array($result,0);
1546 
1547 
1548  $name = dms_disphtml($name);
1549  $addr1 = dms_disphtml($addr1);
1550  $addr2 = dms_disphtml($addr2);
1551  $city = dms_disphtml($city);
1552  $state = dms_disphtml(strtoupper($state));
1553  $zip = dms_disphtml($zip);
1554  $ceo_mgr = dms_disphtml($ceo_mgr);
1555  $main_email = dms_disphtml($main_email);
1556  $main_phone = dms_disphtml($main_phone);
1557  $home_page_url = dms_disphtml($home_page_url);
1558  $vendor = dms_disphtml($vendor);
1559  $www_server = dms_disphtml($www_server);
1560  $conv_from = dms_disphtml($conv_from);
1561  $misc_notes = dms_disphtml($misc_notes);
1562  $contract_notes = dms_disphtml($contract_notes);
1563  $comments = dms_disphtml($comments);
1564  $charter_number = dms_disphtml($charter_number);
1565  $dec_31_assets = dms_disphtml($dec_31_assets);
1566  $dec_31_mem = dms_disphtml($dec_31_mem);
1567  $conn_type = dms_disphtml($conn_type);
1568  $dns_provider = dms_disphtml($dns_provider);
1569  $web_host = dms_disphtml($web_host);
1570  $domain_regis = dms_disphtml($domain_regis);
1571  $init_accts = dms_disphtml($init_accts);
1572  $modem_num = dms_disphtml($modem_num);
1573 
1574  $target_launch = trim($target_launch);
1575  if ( $target_launch != "FLEX" && $target_launch != "TBD" ) {
1576  $target_launch = dms_disphtml(dateformat("m/d/Y",$target_launch));
1577  }
1578  $train_date = dms_disphtml($train_date);
1579  $serv_acct = dms_disphtml($serv_acct);
1580  $admin_setup = dms_disphtml($admin_setup);
1581  $listserv = dms_disphtml($listserv);
1582  $mail_setup = dms_disphtml($mail_setup);
1583  $interface_install = dms_disphtml($interface_install);
1584  $next_contact_date = dms_disphtml($next_contact_date);
1585  $last_activity_date = dms_disphtml($last_activity_date);
1586  $contract_expires = dms_disphtml($contract_expires);
1587  $isp = dms_disphtml($isp);
1588 
1589 # load array of existing monitor contacts
1590 
1591 $mc=array();
1592  $mcsql= "select role, decider, trim(fname), trim(lname),
1593  trim(phone), trim(email), trim(comment)
1594  from monitor_contact
1595  where user_name='{$cuid}'
1596  order by role, id;";
1597  $mclist = db_query($mcsql, $link);
1598  for ($row=0;list($mcrole, $mcdecider, $mcfname, $mclname, $mcphone, $mcemail, $mccomment) = db_fetch_array($mclist,$row); $row++) {
1599  $mc[$row][0]=$mcrole;
1600  $mc[$row][1]=$mcdecider;
1601  $mc[$row][2]=trim($mcfname . " " . $mclname);
1602  $mc[$row][3]=$mcphone;
1603  $mc[$row][4]=$mcemail;
1604  $mc[$row][5]=$mccomment;
1605  }
1606  $showrows=$row;
1607 
1608  }
1609 
1610  cu_header ("HomeCU - CU Implementation");
1611 ?>
1612  <form>
1613  <br>
1614  <table cellspacing="1" cellpadding="1" border="0" width="60%">
1615  <tr>
1616  <td colspan="3" class="barb" align="left">
1617  Credit Union Setup
1618  </td>
1619  </tr>
1620  <tr>
1621  <td align="right" width="25%" class="ileft">
1622  CU Code:
1623  </td>
1624  <td class="iright" width="75%">&nbsp;
1625  <a href="/hcuadm/imp_main.prg?cuid=<?php echo $cuid; ?>&mode=MAINT"><?php echo htmlspecialchars(trim($cuid)); ?></a>
1626  </td>
1627  </tr>
1628  <tr>
1629  <td align="right" class="ileft">
1630  CU Name:
1631  </td>
1632  <td class="iright" width="">&nbsp;
1633  <?php echo $name; ?>
1634  </td>
1635  </tr>
1636  <tr>
1637  <td nowrap align="right" valign="top" class="ileft">
1638  Home CU Type:
1639  </td>
1640  <td class="iright">&nbsp;
1641  <?php
1642  $print_HomeCU_Type = "";
1643  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_BATCH ? "Batch" : "");
1644  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_LIVE ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_LIVE ? "Live" : "") : "");
1645  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_ASP ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_ASP ? "ASP" : "") : "");
1646  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_IVR ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_IVR ? "IVR" : "") : "");
1647  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_WEBONLY ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_WEBONLY ? "WEB ONLY" : "") : "");
1648  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_UPGRADE ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_UPGRADE ? "Upgrade / Conversion" : "") : "");
1649  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_CLOSED ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_CLOSED ? "CLOSED CU" : "") : "");
1650  $print_HomeCU_Type .= ($system_options & $SYS_TYPE_VOIP ? (strlen($print_HomeCU_Type) > 0 ? " / " : "") . ($system_options & $SYS_TYPE_VOIP ? "VOIP" : "") : "");
1651 
1652  print $print_HomeCU_Type;
1653  ?>
1654  </td>
1655  </tr>
1656  <tr>
1657  <td nowrap align="right" valign="top" class="ileft">
1658  CU Server:
1659  </td>
1660  <td class="iright">&nbsp;
1661  <?php echo $www_server; ?>
1662  </td>
1663  </tr>
1664  </table>
1665  <br><br>
1666  <table cellspacing="1" cellpadding="1" border="0" width="60%">
1667  <tr>
1668  <td colspan="3" class="barb" align="left">
1669  Contact Information
1670  </td>
1671  </tr>
1672  <tr>
1673  <td align="right" width="25%" class="ileft">
1674  CEO / Mgr:
1675  </td>
1676  <td class="iright" width="75%">&nbsp;
1677  <?php echo $ceo_mgr; ?>
1678  </td>
1679  </tr>
1680  <tr>
1681  <td align="right" class="ileft" valign="top">
1682  Address:
1683  </td>
1684  <td class="iright">&nbsp;
1685  <?php
1686  // Create the Address string
1687 
1688  $show_addr = "";
1689  $show_addr = $addr1;
1690  $show_addr .= (strlen($show_addr) > 0 ? "<br>&nbsp;" : "");
1691 
1692  if (strlen(trim($addr2)) > 0)
1693  $show_addr .= $addr2 . "<br>&nbsp;";
1694 
1695  $show_addr .= $city . " " .
1696  $state . " " .
1697  $zip;
1698 
1699  echo $show_addr;
1700  ?>
1701  </td>
1702  </tr>
1703  <tr>
1704  <td align="right" nowrap class="ileft">
1705  Main Phone:
1706  </td>
1707  <td class="iright">&nbsp;
1708  <?php echo htmlspecialchars(trim($main_phone)); ?>
1709  </td>
1710  </tr>
1711  <tr>
1712  <td align="right" nowrap class="ileft">
1713  Main E-mail:
1714  </td>
1715  <td class="iright">&nbsp;
1716  <?php echo $main_email; ?>
1717  </td>
1718  </tr>
1719 <tr><td colspan='2' class='barb'><hr></td></tr>
1720  <tr><td colspan='2'>
1721  <table align='center' cellspacing='0' cellpadding='0' border='0' width='100%' bgcolor=white>
1722  <tr class='ileft'>
1723  <td>Role</td>
1724  <td>Decider</td>
1725  <td>Name</td>
1726  <td>Phone</td>
1727  <td>Email</td>
1728  <td>Contact Info</td></tr>
1729 <?php
1730 
1731  for ($prow=0; $prow < sizeof($mc); $prow++) {
1732  $RGB = (($prow % 2 != 0) ? "even" : "odd");
1733 
1734  $prole=$mc[$prow][0];
1735  $pdesc=$cu_contact_role[$prole];
1736  print "<tr class='$RGB'><td class='usu' valign='top'>$pdesc</td>";
1737 
1738 #Decider
1739  print "<td class='usu' valign='top'>" . ($mc[$prow][1] == "Y" ? "Y" : "") .
1740 "</td>";
1741 #Name
1742  print "<td class='usu' valign='top'>" . dms_disphtml($mc[$prow][2]) .
1743 "</td>";
1744 #Phone
1745  print "<td class='usu' valign='top'>" . dms_disphtml($mc[$prow][3]) .
1746 "</td>";
1747 #Email
1748  print "<td class='usu' valign='top'>" . dms_disphtml($mc[$prow][4]) .
1749 "</td>";
1750 #Comment
1751  print "<td class='usu' valign='top'>&nbsp;" . dms_disphtml($mc[$prow][5]) .
1752 "</td>";
1753 
1754 print "</tr>\n";
1755 
1756  }
1757 print "</td></tr></table></td>";
1758 
1759 ?>
1760  </tr>
1761  </table>
1762  <br>
1763  <br>
1764  <table cellspacing="1" cellpadding="1" border="0" width="60%">
1765  <tr>
1766  <td colspan="2" class="barb" align="left">
1767  Account Information
1768  </td>
1769  </tr>
1770 
1771  <tr>
1772  <td align="right" nowrap class="ileft" width="25%">
1773  Charter Number:
1774  </td>
1775  <td class="iright" width="75%">&nbsp;
1776  <?php echo $charter_number; ?>
1777  </td>
1778  </tr>
1779  <tr>
1780  <td align="right" nowrap class="ileft">
1781  Domain:
1782  </td>
1783  <td class="iright">&nbsp;
1784  <?php echo $home_page_url; ?>
1785  </td>
1786  </tr>
1787  <tr>
1788  <td nowrap align="right" class="ileft">
1789  Assets:
1790  </td>
1791  <td nowrap class="iright">&nbsp;
1792  <?php echo $dec_31_assets; ?>
1793  </td>
1794  </tr>
1795  <tr>
1796  <td nowrap align="right" class="ileft">
1797  # of Members:
1798  </td>
1799  <td nowrap class="iright">&nbsp;
1800  <?php echo $dec_31_mem; ?>
1801  </td>
1802  </tr>
1803  <tr>
1804  <td class='ileft' align=right>Vendor: </td>
1805  <td class="iright">&nbsp;
1806  <?php echo $vendor; ?>
1807  </td>
1808  </tr>
1809  <tr>
1810  <td align="right" nowrap class="ileft">
1811  Connectivity Type:
1812  </td>
1813  <td class="iright">&nbsp;
1814  <?php
1815  $disp_type = "";
1816  switch ($conn_type) {
1817  case "1":
1818  $disp_type = "DSL";
1819  break;
1820  case "2":
1821  $disp_type = "Cable";
1822  break;
1823  case "3":
1824  $disp_type = "T1";
1825  break;
1826  case "4":
1827  $disp_type = "Modem";
1828  break;
1829  case "5":
1830  $disp_type = "Other";
1831  break;
1832  default:
1833  $disp_type = "UNKNOWN";
1834  break;
1835  }
1836  echo $disp_type;
1837  ?>
1838  </td>
1839  </tr>
1840  <tr>
1841  <td align="right" nowrap class="ileft">
1842  ISP:
1843  </td>
1844  <td class="iright">&nbsp;
1845  <?php echo $isp; ?>
1846  </td>
1847  </tr>
1848  <tr>
1849  <td align="right" nowrap class="ileft">
1850  DNS Provider:
1851  </td>
1852  <td class="iright">&nbsp;
1853  <?php echo $dns_provider; ?>
1854  </td>
1855  </tr>
1856  <tr>
1857  <td align="right" nowrap class="ileft">
1858  Web Hoster:
1859  </td>
1860  <td class="iright">&nbsp;
1861  <?php echo $web_host; ?>
1862  </td>
1863  </tr>
1864 
1865 
1866 
1867  </table>
1868  <br><br>
1869 
1870  <table cellspacing="1" cellpadding="1" border="0" width="60%">
1871  <tr>
1872  <td colspan="2" class="barb" align="left">
1873  Implementation
1874  </td>
1875  </tr>
1876 
1877  <tr>
1878  <td align="right" nowrap valign="top" class="ileft" width="25%">
1879  Services Ordered:
1880  </td>
1881  <td valign="top" nowrap class="iright" width="75%">
1882  <?php
1883 ?>
1884  <?php // Create a query here to query the available
1885  // products from the cuprodlist table
1886 
1887 
1888 
1889  $sql = "SELECT cuproducts.user_name, cuproducts.home_cu_code,
1890  cuprodlist.home_cu_desc
1891  FROM cuproducts
1892  JOIN cuprodlist on cuprodlist.home_cu_code = cuproducts.home_cu_code
1893  WHERE cuproducts.user_name = '{$cuid}'
1894  ORDER BY cuprodlist.home_cu_desc";
1895  $sql_rs = db_query($sql, $link);
1896  $row = 0;
1897  while ($sql_row = db_fetch_array($sql_rs, $row++)) {
1898  echo "&nbsp;" . htmlspecialchars(trim($sql_row['home_cu_desc'])) . "<br>";
1899  }
1900 
1901  ?>
1902  </td>
1903  </tr>
1904  <tr>
1905  <td align="right" nowrap class="ileft">
1906  Target Launch Date:
1907  </td>
1908  <td class="iright">&nbsp;
1909  <?php echo $target_launch; ?>
1910  </td>
1911  </tr>
1912  <tr>
1913  <td align="right" nowrap class="ileft">
1914  Domain Registration:
1915  </td>
1916  <td class="iright">&nbsp;
1917  <?php
1918  $disp_dom = "";
1919  switch ($domain_regis) {
1920  case "1":
1921  $disp_dom = "No Domain -- Need One";
1922  break;
1923  case "2":
1924  $disp_dom = "Have One -- Move Domain";
1925  break;
1926  case "3":
1927  $disp_dom = "Have One -- Repoint Domain";
1928  break;
1929  case "4":
1930  $disp_dom = "Have One -- No Action Needed";
1931  break;
1932  default:
1933  $disp_dom = "UNKNOWN";
1934  break;
1935  }
1936  echo $disp_dom;
1937  ?>
1938  </td>
1939  </tr>
1940  <tr>
1941  <td align="right" nowrap class="ileft">
1942  Initial Accounts:
1943  </td>
1944  <td class="iright">&nbsp;
1945  <?php echo $init_accts; ?>
1946  </td>
1947  </tr>
1948  <tr>
1949  <td align="right" nowrap class="ileft">
1950  Modem Number:
1951  </td>
1952  <td class="iright">&nbsp;
1953  <?php echo $modem_num; ?>
1954  </td>
1955  </tr>
1956  <tr>
1957  <td align="right" nowrap class="ileft">
1958  Training Date:
1959  </td>
1960  <td class="iright">&nbsp;
1961  <?php echo $train_date; ?>
1962  </td>
1963  </tr>
1964  <tr>
1965  <td align="right" nowrap class="ileft">
1966  Server Account:
1967  </td>
1968  <td class="iright">&nbsp;
1969  <?php echo $serv_acct; ?>
1970  </td>
1971  </tr>
1972  <tr>
1973  <td align="right" nowrap class="ileft">
1974  Converted From:
1975  </td>
1976  <td class="iright">&nbsp;
1977  <?php echo $conv_from; ?>
1978  </td>
1979  </tr>
1980  <tr>
1981  <td align="right" nowrap class="ileft">
1982  Admin Setup:
1983  </td>
1984  <td class="iright">&nbsp;
1985  <?php echo $admin_setup; ?>
1986  </td>
1987  </tr>
1988  <tr>
1989  <td align="right" nowrap class="ileft">
1990  Listserv Setup:
1991  </td>
1992  <td class="iright">&nbsp;
1993  <?php echo $listserv; ?>
1994  </td>
1995  </tr>
1996  <tr>
1997  <td align="right" nowrap class="ileft">
1998  Mail Setup:
1999  </td>
2000  <td class="iright">&nbsp;
2001  <?php echo $mail_setup; ?>
2002  </td>
2003  </tr>
2004  <tr>
2005  <td align="right" nowrap class="ileft">
2006  Interface Installation:
2007  </td>
2008  <td class="iright">&nbsp;
2009  <?php echo $interface_install; ?>
2010  </td>
2011  </tr>
2012  <tr>
2013  <td align="right" nowrap class="ileft">
2014  Next Contact Date:
2015  </td>
2016  <td class="iright">&nbsp;
2017  <?php echo $next_contact_date; ?>
2018  </td>
2019  </tr>
2020  <tr>
2021  <td align="right" nowrap class="ileft">
2022  Last Activity Date:
2023  </td>
2024  <td class="iright">&nbsp;
2025  <?php echo $last_activity_date; ?>
2026  </td>
2027  </tr>
2028  <tr>
2029  <td align="right" nowrap class="ileft">
2030  Contract Expires:
2031  </td>
2032  <td class="iright">&nbsp;
2033  <?php echo $contract_expires; ?>
2034  </td>
2035  </tr>
2036  <?php
2037  /*
2038  ?>
2039  <tr>
2040  <td align="right" nowrap class="ileft" valign="top">
2041  Contract Notes:
2042  </td>
2043  <td class="iright">&nbsp;
2044  <?php echo $contract_notes; ?>
2045  </td>
2046  </tr>
2047  <tr>
2048  <td align="right" nowrap class="ileft" valign="top">
2049  Implementation Notes:
2050  </td>
2051  <td class="iright">&nbsp;
2052  <?php echo $misc_notes; ?>
2053  </td>
2054  </tr>
2055  <tr>
2056  <td align="right" nowrap class="ileft" valign="top">
2057  Comments:
2058  </td>
2059  <td class="iright">&nbsp;
2060  <?php echo $comments; ?>
2061  </td>
2062  </tr>
2063  <?php
2064  */
2065  ?>
2066 
2067  </table>
2068  <br><br>
2069  <table cellspacing="1" cellpadding="1" border="0" width="60%">
2070  <tr>
2071  <td colspan="2" class="barb" align="left">
2072  Notes
2073  </td>
2074  </tr>
2075 
2076  <?php
2077  // Read the notes in from cuinfo_notes now
2078  $Today = date( "Y-m-d" );
2079  $sql = "select subject, messagetext, author, activitydate
2080  from cuinfo_notes
2081  where cu = '$cuid'
2082  and (dontshowafter is null OR dontshowafter > '$Today')
2083  order by activitydate DESC";
2084 
2085  $result = db_query($sql, $link);
2086 
2087  $row = 0;
2088  while ( $Row = db_fetch_array($result, $row++) ) {
2089  $activityDate = date( "m-d-Y", strtotime( $Row["activitydate"] ) );
2090  $notes = "(" . $Row["author"] . " / " . $activityDate . ")<br />" . dms_disphtml($Row["messagetext"]);
2091  print <<< printnote
2092  <tr>
2093  <td align="right" nowrap class="ileft" valign="top">
2094  {$Row["subject"]}
2095  </td>
2096  <td class="iright">&nbsp;
2097  {$notes}
2098  </td>
2099  </tr>
2100 printnote;
2101  }
2102 
2103  ?>
2104  <tr><td colspan="2"><hr></td></tr>
2105  </table>
2106 
2107 
2108  </form>
2109  </body>
2110 </html>
2111 <?php
2112  break;
2113  }
2114 ?>