demographics_dashboard_part_2 (#1903)
[openemr.git] / interface / patient_file / transaction / transactions.php
blobb5a10e6fcacb67f398dcc548e0e0524068662ade
1 <?php
2 include_once("../../globals.php");
3 include_once("$srcdir/transactions.inc");
4 require_once("$srcdir/options.inc.php");
6 use OpenEMR\Core\Header;
7 use OpenEMR\Menu\PatientMenuRole;
8 ?>
9 <html>
10 <head>
11 <title><?php echo xlt('Patient Transactions');?></title>
12 <?php Header::setupHeader('common'); ?>
14 <script type="text/javascript">
15 // Called by the deleteme.php window on a successful delete.
16 function imdeleted() {
17 top.restoreSession();
18 location.href = '../../patient_file/transaction/transactions.php';
20 // Process click on Delete button.
21 function deleteme(transactionId) {
22 top.restoreSession();
23 dlgopen('../deleter.php?transaction=' + transactionId, '_blank', 500, 450);
24 return false;
26 <?php require_once("$include_root/patient_file/erx_patient_portal_js.php"); // jQuery for popups for eRx and patient portal ?>
27 </script>
28 </head>
30 <body class="body_top">
31 <div class="container">
32 <!--<h1><?php echo xlt('Patient Transactions');?></h1>-->
33 <?php $header_title = xl('Patient Transactions for');?>
34 <div class="row">
35 <div class="col-sm-12">
36 <?php require_once("$include_root/patient_file/summary/dashboard_header.php");?>
37 </div>
38 </div>
39 <div class="row" >
40 <div class="col-sm-12">
41 <?php
42 $list_id = "nav-list5"; // to indicate nav item is active, count and give correct id
43 // Collect the patient menu then build it
44 $menuPatient = new PatientMenuRole();
45 $menuPatient->displayHorizNavBarMenu();
47 </div>
48 </div>
49 <div class="row">
50 <div class="col-sm-12">
51 <div class="btn-group">
52 <!--<a href="../summary/demographics.php" class="btn btn-default btn-back" onclick="top.restoreSession()">
53 <?php echo xlt('Back to Patient'); ?></a>-->
54 <a href="add_transaction.php" class="btn btn-default btn-add" onclick="top.restoreSession()">
55 <?php echo xlt('Create New Transaction'); ?></a>
56 <a href="print_referral.php" class="btn btn-default btn-print" onclick="top.restoreSession()">
57 <?php echo xlt('View/Print Blank Referral Form'); ?></a>
58 </div>
59 </div>
60 </div>
61 <br>
62 <div class="row">
63 <div class="col-sm-12 text">
65 <?php
66 if ($result = getTransByPid($pid)) {
69 <table class="table table-striped">
70 <thead>
71 <tr>
72 <th>&nbsp;</th>
73 <th><?php echo xlt('Type'); ?></th>
74 <th><?php echo xlt('Date'); ?></th>
75 <th><?php echo xlt('User'); ?></th>
76 <th><?php echo xlt('Details'); ?></th>
77 </tr>
78 </thead>
79 <tbody>
80 <?php
81 foreach ($result as $item) {
82 if (!isset($item['body'])) {
83 $item['body'] = '';
86 if (getdate() == strtotime($item['date'])) {
87 $date = "Today, " . date('D F ds', strtotime($item['date']));
88 } else {
89 $date = date('D F ds', strtotime($item['date']));
92 $date = oeFormatShortDate($item['refer_date']);
93 $id = $item['id'];
94 $edit = xl('View/Edit');
95 $view = xl('Print'); //actually prints or displays ready to print
96 $delete = xl('Delete');
97 $title = xl($item['title']);
99 <tr>
100 <td>
101 <div class="btn-group oe-pull-toward">
102 <a href='add_transaction.php?transid=<?php echo attr($id); ?>&title=<?php echo attr($title); ?>&inmode=edit'
103 onclick='top.restoreSession()'
104 class='btn btn-default btn-edit'>
105 <?php echo text($edit); ?>
106 </a>
107 <?php if (acl_check('admin', 'super')) { ?>
108 <a href='#'
109 onclick='deleteme(<?php echo attr($id); ?>)'
110 class='btn btn-default btn-delete'>
111 <?php echo text($delete); ?>
112 </a>
113 <?php } ?>
114 <?php if ($item['title'] == 'LBTref') { ?>
115 <a href='print_referral.php?transid=<?php echo attr($id); ?>' onclick='top.restoreSession();'
116 class='btn btn-print btn-default'>
117 <?php echo text($view); ?>
118 </a>
119 <?php } ?>
120 </div>
121 </td>
122 <!--<td><?php echo generate_display_field(['data_type' => 99, 'list_id' => 'Transactions'], $item['title']); ?></td>-->
123 <td><?php echo getLayoutTitle('Transactions', $item['title']); ?></td>
124 <td><?php echo text($date); ?></td>
125 <td><?php echo text($item['user']); ?></td>
126 <td><?php echo text($item['body']); ?></td>
127 </tr>
128 <?php
131 </tbody>
132 </table>
134 <?php
135 } else {
137 <span class="text"><i class="fa fa-exclamation-circle oe-text-orange" aria-hidden="true"></i> <?php echo xlt('There are no transactions on file for this patient.'); ?></span>
138 <?php
141 </div>
142 </div>
143 </div><!--end of container div-->
144 <?php
145 //home of the help modal ;)
146 //$GLOBALS['enable_help'] = 0; // Please comment out line if you want help modal to function on this page
147 if ($GLOBALS['enable_help'] == 1) {
148 echo "<script>var helpFile = 'transactions_dashboard_help.php'</script>";
149 require "$include_root/help_modal.php";
152 <script>
153 var listId = '#' + '<?php echo text($list_id); ?>';
154 $(document).ready(function(){
155 $(listId).addClass("active");
157 </script>
158 </body>
159 </html>