Highway to PSR2
[openemr.git] / interface / orders / procedure_provider_list.php
blobc06d878120d3a3b29c2f47f12538cef35660c4b0
1 <?php
2 /**
3 * Maintenance for the list of procedure providers.
5 * Copyright (C) 2012 Rod Roark <rod@sunsetsystems.com>
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 2
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 Rod Roark <rod@sunsetsystems.com>
24 use OpenEMR\Core\Header;
26 require_once("../globals.php");
27 require_once("$srcdir/acl.inc");
28 require_once("$srcdir/options.inc.php");
30 $popup = empty($_GET['popup']) ? 0 : 1;
32 $form_name = trim($_POST['form_name']);
34 $query = "SELECT pp.* FROM procedure_providers AS pp";
35 $query .= " ORDER BY pp.name";
36 $res = sqlStatement($query);
38 <html>
40 <head>
41 <?php Header::setupHeader(); ?>
42 <title><?php echo xlt('Procedure Providers'); ?></title>
44 <?php if ($popup) { ?>
45 <script type="text/javascript" src="../../library/topdialog.js"></script>
46 <?php } ?>
48 <script language="JavaScript">
50 <?php if ($popup) {
51 require($GLOBALS['srcdir'] . "/restoreSession.php");
52 } ?>
54 // Callback from popups to refresh this display.
55 function refreshme() {
56 // location.reload();
57 document.forms[0].submit();
60 // Process click to pop up the add window.
61 function doedclick_add() {
62 top.restoreSession();
63 dlgopen('procedure_provider_edit.php?ppid=0', '_blank', 700, 550);
66 // Process click to pop up the edit window.
67 function doedclick_edit(ppid) {
68 top.restoreSession();
69 dlgopen('procedure_provider_edit.php?ppid=' + ppid, '_blank', 700, 550);
72 </script>
74 </head>
76 <body class="body_top">
77 <div class="container">
78 <div class="row">
79 <div class="col-xs-12">
80 <form method='post' action='procedure_provider_list.php'>
81 <div class="page-header">
82 <h1><?php echo xlt('Procedure Providers');?></h1>
83 </div>
84 <div class="btn-group">
85 <button type="button" name="form_search" class="btn btn-default btn-refresh" onclick="refreshme()"><?php echo xlt('Refresh');?></button>
86 <button type="button" class="btn btn-default btn-add" onclick="doedclick_add()"><?php echo xlt('Add New');?></button>
87 </div>
89 <table class="table table-striped table-hover">
90 <thead>
91 <tr>
92 <th title='<?php echo xla('Click to view or edit'); ?>'><?php echo xlt('Name'); ?></th>
93 <th><?php echo xlt('NPI'); ?></th>
94 <th><?php echo xlt('Protocol'); ?></th>
95 </tr>
96 </thead>
97 <tbody>
98 <?php
99 while ($row = sqlFetchArray($res)) {
100 if (acl_check('admin', 'practice')) {
101 $trTitle = xl('Edit') . ' ' . $row['name'];
102 echo " <tr class='detail' style='cursor:pointer' " .
103 "onclick='doedclick_edit(" . $row['ppid'] . ")' title='" . attr($trTitle) . "'>\n";
104 } else {
105 $trTitle = $displayName . " (" . xl("Not Allowed to Edit") . ")";
106 echo " <tr class='detail $bgclass' title='" . attr($trTitle) . "'>\n";
109 echo " <td>" . text($row['name']) . "</td>\n";
110 echo " <td>" . text($row['npi']) . "</td>\n";
111 echo " <td>" . text($row['protocol']) . "</td>\n";
112 echo " </tr>\n";
115 </tbody>
116 </table>
117 </div>
118 </div>
119 </body>
120 </html>