another thing related to development version incrementation
[openemr.git] / interface / forms / CAMOS / view.php
blob8e5a89dc767dda1556ade4a4b5a547e245ff8e88
1 <!-- view.php -->
2 <?php
3 include_once("../../globals.php");
4 include_once("../../../library/api.inc");
5 formHeader("Form: CAMOS");
6 $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php';
7 $textarea_rows = 22;
8 $textarea_cols = 90;
9 ?>
10 <html><head>
11 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
12 <script type="text/javascript">
13 function checkall(){
14 var f = document.my_form;
15 var x = f.elements.length;
16 var i;
17 for(i=0;i<x;i++) {
18 if (f.elements[i].type == 'checkbox') {
19 f.elements[i].checked = true;
23 function uncheckall(){
24 var f = document.my_form;
25 var x = f.elements.length;
26 var i;
27 for(i=0;i<x;i++) {
28 if (f.elements[i].type == 'checkbox') {
29 f.elements[i].checked = false;
33 function content_focus() {
35 function content_blur() {
37 function show_edit(t) {
38 var e = document.getElementById(t);
39 if (e.style.display == 'none') {
40 e.style.display = 'inline';
41 return;
43 else {
44 e.style.display = 'none';
47 </script>
48 <?php html_header_show();?>
49 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
50 </head>
51 <body class="body_top">
52 <form method=post action="<?php echo $rootdir?>/forms/CAMOS/save.php?mode=delete&id=<?php echo $_GET["id"];?>" name="my_form">
53 <h1> <?php xl('CAMOS','e'); ?> </h1>
54 <input type="submit" name="delete" value="<?php xl('Delete Selected Items','e'); ?>" />
55 <input type="submit" name="update" value="<?php xl('Update Selected Items','e'); ?>" />
56 <?php
57 echo "<a href='".$GLOBALS['webroot'] . "/interface/patient_file/encounter/$returnurl'>[" . xl('do nothing') . "]</a>";
59 <br/><br/>
60 <input type='button' value='<?php xl('Select All','e'); ?>'
61 onClick='checkall()'>
62 <input type='button' value='<?php xl('Unselect All','e'); ?>'
63 onClick='uncheckall()'>
64 <br/><br/>
65 <?php
66 //experimental code start
68 $pid = $GLOBALS['pid'];
69 $encounter = $GLOBALS['encounter'];
71 $query = "select t1.id, t1.content from form_CAMOS as t1 join forms as t2 " .
72 "on (t1.id = t2.form_id) where t2.form_name like 'CAMOS%' " .
73 "and t2.encounter like $encounter and t2.pid = $pid";
75 $statement = sqlStatement($query);
76 while ($result = sqlFetchArray($statement)) {
77 print "<input type=button value='" . xl('Edit') . "' onClick='show_edit(\"id_textarea_".$result['id']."\")'>";
78 print "<input type=checkbox name='ch_".$result['id']."'> ".$result['content']."<br/>\n";
79 print "<div id=id_textarea_".$result['id']." style='display:none'>\n";
80 print "<textarea name=textarea_".$result['id']." cols=$textarea_cols rows= $textarea_rows onFocus='content_focus()' onBlur='content_blur()' >".$result['content']."</textarea><br/>\n";
81 print "</div>\n";
85 //experimental code end
87 </form>
88 <?php
90 formFooter();