supporting data peculiar to ippf issue types
[openemr.git] / interface / patient_file / encounter / dbc_diagnose_as1.php
blob5da9b1f79260df7c4049a66d02155deea3206a55
1 <?php include_once("../../../interface/globals.php");?>
3 <html><head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <script type="text/javascript" src="../../../library/js/jquery.js"></script>
8 <script type="text/javascript">
9 function win() {
10 window.opener.location.reload(true);
11 self.close();
13 </script>
15 <script type="text/javascript">
16 $(document).ready(function(){
17 $('#box2').hide(); $('#box3').hide(); $('#box4').hide();
18 $('#box1').bind('change', function(){
19 $('#box2').html(
20 $.ajax({
21 type: 'POST',
22 url: 'as.php',
23 data: 'z=' + $('#box1').val() + '&lvl=1',
24 async: false
25 }).responseText
27 });
28 $('#box1').bind('focus', function(){
29 $('#box2').show(); $('#box3').hide(); $('#box4').hide(); $('#box5').hide();
30 });
33 $('#box2').bind('change', function(){
34 $('#box3').html(
35 $.ajax({
36 type: 'POST',
37 url: 'as.php',
38 data: 'z=' + $('#box2').val() + '&lvl=1',
39 async: false
40 }).responseText
42 });
43 // if empty box, prevent the next to show
44 $('#box2').bind('click', function(){
45 if ( $('#box2').val() != 0 ) {
46 $('#box3').show(); }
47 else {
48 $('#box3').hide();}
49 $('#box4').hide(); $('#box5').hide();
50 });
54 $('#box3').bind('change', function(){
55 $('#box4').html(
56 $.ajax({
57 type: 'POST',
58 url: 'as.php',
59 data: 'z=' + $('#box3').val() + '&lvl=1',
60 async: false
61 }).responseText
63 });
64 // if empty box, prevent the next to show
65 $('#box3').bind('click', function(){
66 if ( $('#box3').val() != 0 ) {
67 $('#box4').show(); }
68 else {
69 $('#box4').hide(); $('#box5').hide();
71 });
73 $('#box4').bind('change', function(){
74 $('#box5').html(
75 $.ajax({
76 type: 'POST',
77 url: 'as.php',
78 data:'z=' + $('#box4').val() + '&lvl=1',
79 async: false
80 }).responseText
82 });
83 // if empty box, prevent the next to show
84 $('#box4').bind('click', function(){
85 if ( $('#box4').val() != 0 ) {
86 $('#box5').show(); }
87 else {
88 $('#box5').hide();
90 });
93 });
94 </script>
96 <?php
97 if ( isset($_POST['saveas']) ) {
98 // same logic as in javascript validation
99 if ( $_POST['box5'] ) $as = $_POST['box5'];
100 elseif ( $_POST['box4']) $as = $_POST['box4'];
101 elseif ( $_POST['box3']) $as = $_POST['box3'];
102 elseif ( $_POST['box2']) $as = $_POST['box2'];
103 elseif ( $_POST['box1']) $as = $_POST['box1'];
105 //$main = ($_POST['mainas'] == 'on') ? 'on' : '';
107 if ( verify_code($as, 2) ) {
108 $_SESSION['as1'][] = $as;
109 } else {
110 echo '<script>alert("You must select again!")</script>';
112 //var_dump($_SESSION['as1']);
113 // verify the limit for diagnoses
114 if ( count($_SESSION['as1']) == 3 )
115 echo '<script>window.close();</script>';
119 </head>
121 <body onunload="win();" bgcolor="#A4FF8B">
122 <p>Choose your AS I diagnose</p>
124 <form method="post" target="_self">
125 <table border=0 cellspacing=0 cellpadding=0 >
126 <tr>
127 <td width='1%' nowrap>
128 <select name="box1" id="box1">
129 <?php
130 $rlvone = records_level1('as1');
131 foreach ($rlvone as $rlv) {
132 echo '<option value=\'' .$rlv['cl_diagnose_code']. '\'>' .substr($rlv['cl_diagnose_element'], 0, 70). '</option>';
133 } ?>
134 </select>
135 </td></tr>
136 <tr><td>
137 <select id="box2" name="box2"></select>
138 </td></tr>
139 <tr><td>
140 <select id="box3" name="box3"></select>
141 </td></tr>
142 </tr>
143 <tr><td>
144 <select id="box4" name="box4"></select>
145 </td></tr>
146 <tr><td>
147 <select id="box5" name="box5"></select>
148 </td></tr>
150 </table>
151 <input type="submit" value="Choose" name="saveas"/>
152 <input type="button" value="Close" onclick="window.close();" />
153 </form>
156 </body>
157 </html>