Odyssey
imp_notes.prg
1 <?php
2 $monLibrary= dirname(__FILE__) . "/../library";
3 require_once("$monLibrary/cu_top.i");
4 require_once("$monLibrary/ck_hticket.i");
5 
6  if (!CheckPerm($link, $Hu, basename($_SERVER['SCRIPT_NAME']), $_SERVER['REMOTE_ADDR'])) {
7  // ** Permissions failed
8  // ** redirect to new page
9  header("Location: /hcuadm/hcu_noperm.prg");
10  exit;
11  }
12 
13 $dms_ok=array('cuid'=>'string');
14 
15 dms_import($dms_ok);
16 
17  // This will print the notes for the passed in credit union
18  cu_header("Credit Union Notes");
19 echo "
20  <table cellspacing=\"1\" cellpadding=\"1\" border=\"0\" width=\"100%\" class=\"dmsbg\"><tr><td>
21 ";
22  if (isset($cuid)) {
23  // Lookup the information and get the notes
24  $sql = "SELECT misc_notes
25  FROM cuinfo
26  WHERE user_name = '" . prep_save($cuid) . "' ";
27 
28  $notes_rs = db_query($sql, $link);
29  $notes_row = db_fetch_array($notes_rs, 0);
30 ?>
31 
32  <table cellspacing="0" cellpadding="1" border="0" width="100%">
33  <tr>
34  <td colspan="3" class="barb" align="left" nowrap width="100%">
35  Notes for <?php echo $cuid; ?>
36  </td>
37  </tr>
38  <tr>
39  <td width="100%" class="dtll">
40  <?php
41  // I want to transform each linefeed into a <br> tag
42  $format_notes = str_replace("\n", "<br>", htmlspecialchars($notes_row['misc_notes']));
43  //echo htmlspecialchars($notes_row['misc_notes']);
44  echo $format_notes;
45  ?>
46  </td>
47  </tr>
48  </table>
49 <?php
50  } else {
51  echo "Incorrect information";
52  }
53 
54 ?>
55 <div class="dtl"><input type="button" name="btnClose" value="Close Window" onclick="window.close()"></div>
56  </td></tr></table>
57 </body>
58 </html>