Odyssey
lnappdisclosure.i
1 <?php
2 /*
3  * NAME -- lnappdisclosure
4  * PURPOSE -- This is a generic Loan Disclosure form.. it will be used to slurp
5  * in a real file and display the contents. It should show the file
6  * along with an 'Approve' and 'Disapprove' button..
7  * This form should also popup as a stand alone page, loading in the contents
8  * of the real file and show a 'Close Window' Button.
9  *
10 
11 // * This script is meant to be a passthru, so include it INLINE where you want,
12  * it will set a variable so you can determine if information was printed and
13  * a disclosure is being displayed
14 
15  * Variables that can be set
16  * lnapp_disclosure_respid
17  * lnapp_disclosure_loanid
18  * lnapp_disclosure_standalone
19  * lnapp_disclosure_display
20 */
21 
22  $lnapp_disclosure_display = False;
23  $lnapp_disclosure_filename = "";
24 
25  if (!isset($lnapp_disclosure_standalone)) {
26  $lnapp_disclosure_standalone = false;
27  }
28 
29  // * I need to get the loan disclosure file name
30  if (isset($lnapp_disclosure_loanid)) {
31  $sql = "SELECT loandisclosure_fragment
32  FROM lnappschemamaster
33  WHERE loanid = " . intval($lnapp_disclosure_loanid) . " ";
34  } elseif (isset($lnapp_disclosure_respid)) {
35  $sql = "SELECT loandisclosure_fragment
36  FROM lnappschemamaster
37  JOIN lnappuserresponse on lnappuserresponse.loanid = lnappschemamaster.loanid
38  WHERE respid = " . intval($lnapp_disclosure_respid) . " ";
39 
40  }
41 
42  // ** Check to see if a disclosure file has been set for the loan they selected
43  if ($sql != '') {
44  $disc_rs = db_query($sql, $dbh);
45  if ($disc_rs) {
46  // * Retrieve the filename value
47  list($lnapp_disclosure_filename) = db_fetch_array($disc_rs);
48  }
49  }
50 
51  // * if the disclosure file was set, then check for the existance of such file
52  if ($lnapp_disclosure_filename != '' && $DMSAPP_CUHOME_PATH != '') {
53  // * VALIDATE THE EXISTENCE of this file
54  if (file_exists($DMSAPP_CUHOME_PATH . $lnapp_disclosure_filename)) {
55  // ** FILE EXISTS -- SO I WILL BE SHOWING
56  $lnapp_disclosure_display = True;
57  }
58  }
59 
60  // * Do you like green eggs and ham?!? Does the file exist?
61  if ($lnapp_disclosure_display) {
62  // ** IT exists -- SO SHOW IT ALREADY!!!
63  // Pretty much just slurp it into where we sit..
64  // * This script needs to be inserted inside the
65  print "<div id='disclosure-content' class='container-fluid'><div class='row'><div class='col-xs-12'><div class='panel panel-default'><div class='panel-body'>";
66 
67  readfile($DMSAPP_CUHOME_PATH . $lnapp_disclosure_filename);
68 
69  print "</div></div></div></div></div>";
70 
71 
72  // ** Now based on how the script is being called, determined by the
73  // * lnapp_disclosure_standalone value --
74  // TRUE -- Then show a Close WINDOW button as this should be shown in it's
75  // * Own window
76  // FALSE -- Then show tow buttons 'Approve' and 'Disapprove'
77  // ** If Approve is SELECTED -- Then go to the form that is requesting
78  // * the disclosure
79  // ** If Disapprove is SELECTED then go back to Main Menu
80  if ($lnapp_disclosure_standalone) {
81  // ** CLOSE WINDOW BUTTON ONLY
82 ?>
83  <form id="frmDisclosure" name="frmDisclosure" method="post" action="#">
84  <div id='disclosure-buttons' class='container-fluid'>
85 
86  <div class="row">
87  <div class="col-xs-12">
88  <a class="" href="#" style="margin-left: 6px" id='linkFormClose' label="entry"><span id=''>Close Window</span></a>
89  </div>
90  </div>
91  </div>
92  </form>
93  <script>
94  $('a[id^=linkFormClose]').click(function() {
95  window.close();
96  });
97  </script>
98 
99 <?php
100  } else {
101  // ** Approve / Disapprove Button
102  ?>
103  <form id="frmDisclosure" name="frmDisclosure" method="post" action="#">
104  <div id='disclosure-buttons' class='container-fluid'>
105  <div class="row">
106  <div class="col-xs-12">
107  <div class="line-separator"></div>
108  </div>
109  </div>
110  <div class="row">
111  <div class="col-xs-12 ">
112  <span class="hidden-xs">
113  <a class="" href="<?php echo $self_full_url; ?>?f=portal" xstyle="margin-left: 6px" id='linkFormCancel' label="portal"><span id=''>Cancel</span></a>
114  </span>
115 
116  <button class="k-button k-primary hcu-xs-100-only" hrefx="#" id='linkFormApprove'><span id=''>I Approve</span></button>
117  <span class="visible-xs-block">
118  <div class="">&nbsp;</div>
119  <a class="k-button hcu-all-100" href="<?php echo $self_full_url; ?>?f=portal" xstyle="margin-left: 6px" id='linkFormCancel' label="portal"><span id=''>Cancel</span></a>
120  </span>
121  </div>
122  </div>
123  </div>
124  <input type='hidden' id='btnFormDisclosure' name='btnFormDisclosure' value=''>
125  </form>
126  <script>
127  $('a[id^=linkFormApprove]').click(function() {
128  target = $(this).attr("label");
129  $('#btnFormDisclosure').val(target);
130  //window.alert("<?php echo $self_full_url; ?>?f=" + target);
131  //console.log($("#frmDisclosure").attr('action'));
132  $("#frmDisclosure").attr('action', "<?php echo $self_full_url; ?>?f=" + target + "&new=<?php echo intval($_GET['new']); ?>");
133  $("#frmDisclosure").submit();
134  //console.log($("#frmDisclosure").attr('action'));
135  });
136 
137  </script>
138 
139 <?php
140  }
141  }
142 ?>
143 
144 
145 
146