more organization of autoloaded files (#424)
[openemr.git] / interface / patient_file / summary / list_amendments.php
blobc67b696f64a7fb4df2e62ebe8b04366a058b6cc1
1 <?php
2 /**
3 * List Amendments
5 * Copyright (C) 2014 Ensoftek
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @package OpenEMR
19 * @author Hema Bandaru <hemab@drcloudemr.com>
20 * @link http://www.open-emr.org
23 //SANITIZE ALL ESCAPES
24 $sanitize_all_escapes=true;
27 //STOP FAKE REGISTER GLOBALS
28 $fake_register_globals=false;
31 include_once("../../globals.php");
32 include_once("$srcdir/options.inc.php");
36 <html>
37 <head>
38 <?php html_header_show();?>
40 <!-- supporting javascript code -->
41 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-2-1/index.js"></script>
42 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script>
43 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
46 <!-- page styles -->
47 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
49 <style>
50 .highlight {
51 color: green;
53 tr.selected {
54 background-color: white;
56 </style>
58 <!-- pop up calendar -->
59 <style type="text/css">@import url(<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.css);</style>
60 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.js"></script>
61 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
62 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script>
63 <script type="text/javascript">
64 function checkForAmendments() {
65 var amendments = "";
66 $("#list_amendments input:checkbox:checked").each(function() {
67 amendments += $(this).val() + ",";
68 });
70 if ( amendments == '' ) {
71 alert("<?php echo xls('Select amendments to print'); ?>");
72 return;
75 // Call the function to print
76 var url = "print_amendments.php?ids=" + amendments;
77 window.open(url);
80 function checkUncheck(option) {
81 $("input[name='check_list[]']").each( function () {
82 var optionFlag = ( option ) ? true : false;
83 $(this).attr('checked',optionFlag);
84 });
86 </script>
87 </head>
89 <body class="body_top">
91 <form action="list_amendments.php" name="list_amendments" id="list_amendments" method="post" onsubmit='return top.restoreSession()'>
93 <span class="title"><?php echo xlt('List'); ?></span>&nbsp;
94 <?php
95 $query = "SELECT * FROM amendments WHERE pid = ? ORDER BY amendment_date DESC";
96 $resultSet = sqlStatement($query,array($pid));
97 if ( sqlNumRows($resultSet)) { ?>
98 <table cellspacing="0" cellpadding="0" style="width:100%">
99 <tr>
100 <td><a href="javascript:checkForAmendments();" class="css_button"><span><?php echo xlt("Print Amendments"); ?></span></a></td>
101 <td align="right">
102 <a href="#" class="small" onClick="checkUncheck(1);"><span><?php echo xlt('Check All');?></span></a> |
103 <a href="#" class="small" onClick="checkUncheck(0);"><span><?php echo xlt('Clear All');?></span></a>
104 </td>
105 </tr>
106 </table>
107 <div id="patient_stats">
108 <br>
109 <table border=0 cellpadding=0 cellspacing=0 style="margin-bottom:1em;">
111 <tr class='head'>
112 <th style="width:5%"></th>
113 <th style="width:15%" align="left"><?php echo xlt('Requested Date'); ?></th>
114 <th style="width:40%" align="left"><?php echo xlt('Request Description'); ?></th>
115 <th style="width:25%" align="left"><?php echo xlt('Requested By'); ?></th>
116 <th style="width:15%" align="left"><?php echo xlt('Request Status'); ?></th>
117 </tr>
119 <?php while($row = sqlFetchArray($resultSet)) {
120 $amendmentLink = "<a href=add_edit_amendments.php?id=" . attr($row['amendment_id']) . ">" . oeFormatShortDate($row['amendment_date']) . "</a>";
122 <tr class="amendmentrow" id="<?php echo attr($row['amendment_id']); ?>">
123 <td><input id="check_list[]" name="check_list[]" type="checkbox" value="<?php echo attr($row['amendment_id']); ?>"></td>
124 <td class=text><?php echo $amendmentLink; ?> </td>
125 <td class=text><?php echo text($row['amendment_desc']); ?> </td>
126 <td class=text><?php echo generate_display_field(array('data_type'=>'1','list_id'=>'amendment_from'), $row['amendment_by']); ?> </td>
127 <td class=text><?php echo generate_display_field(array('data_type'=>'1','list_id'=>'amendment_status'), $row['amendment_status']); ?> </td>
128 </tr>
129 <?php } ?>
130 </table>
131 </div>
132 <?php } else { ?>
133 <span style="color:red">
134 <br>
135 <?php echo xlt("No amendment requests available"); ?>
136 </span>
137 <?php } ?>
138 </form>
139 </body>
141 </html>