fix: Smarty cal php82 warnings (#6316)
[openemr.git] / interface / orders / procedure_provider_list.php
blobc8f2f9c2a6cbe9a88d7a379b3b7d081337225837
1 <?php
3 /**
4 * Maintenance for the list of procedure providers.
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Rod Roark <rod@sunsetsystems.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2012 Rod Roark <rod@sunsetsystems.com>
11 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
16 require_once("$srcdir/options.inc.php");
18 use OpenEMR\Common\Acl\AclMain;
19 use OpenEMR\Common\Csrf\CsrfUtils;
20 use OpenEMR\Common\Twig\TwigContainer;
21 use OpenEMR\Core\Header;
23 if (!AclMain::aclCheckCore('admin', 'users')) {
24 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Procedure Providers")]);
25 exit;
28 $form_name = trim($_POST['form_name'] ?? '');
30 $form_inactive = empty($_POST['form_inactive']) ? false : true;
32 $query = "SELECT pp.* FROM procedure_providers AS pp";
34 if (!$form_inactive) {
35 $query .= " WHERE active = '1'";
38 $query .= " ORDER BY pp.name";
39 $res = sqlStatement($query);
42 <!DOCTYPE html>
43 <html>
44 <head>
45 <?php Header::setupHeader(); ?>
47 <title><?php echo xlt('Procedure Providers'); ?></title>
49 <script>
50 // Callback from popups to refresh this display.
51 function refreshme() {
52 document.forms[0].submit();
55 // Process click to pop up the add window.
56 function doedclick_add() {
57 top.restoreSession();
58 var addTitle = '<i class="fa fa-plus" style="width:20px;" aria-hidden="true"></i> ' + <?php echo xlj("Add Mode"); ?>;
59 let scriptTitle = 'procedure_provider_edit.php?ppid=0&csrf_token_form=' + <?php echo js_url(CsrfUtils::collectCsrfToken()); ?>;
60 dlgopen(scriptTitle, '_blank', 800, 750, false, addTitle);
63 // Process click to pop up the edit window.
64 function doedclick_edit(ppid) {
65 top.restoreSession();
66 var editTitle = '<i class="fa fa-pencil-alt" style="width:20px;" aria-hidden="true"></i> ' + <?php echo xlj("Edit Mode"); ?> + ' ';
67 let scriptTitle = 'procedure_provider_edit.php?ppid=' + ppid + '&csrf_token_form=' + <?php echo js_url(CsrfUtils::collectCsrfToken()); ?>;
68 dlgopen(scriptTitle, '_blank', 800, 750, false, editTitle);
70 </script>
71 </head>
72 <body>
73 <?php
74 if ($GLOBALS['enable_help'] == 1) {
75 $help_icon = '<a class="oe-pull-away oe-help-redirect" data-target="#myModal" data-toggle="modal" href="#" id="help-href" name="help-href" style="color: var(--gray700)" title="' . xla("Click to view Help") . '"><i class="fa fa-question-circle" aria-hidden="true"></i></a>';
76 } elseif ($GLOBALS['enable_help'] == 2) {
77 $help_icon = '<a class="oe-pull-away oe-help-redirect" data-target="#myModal" data-toggle="modal" href="#" id="help-href" name="help-href" style="color: var(--gray300) !important" title="' . xla("To enable help - Go to Administration > Globals > Features > Enable Help Modal") . '"><i class="fa fa-question-circle" aria-hidden="true"></i></a>';
78 } elseif ($GLOBALS['enable_help'] == 0) {
79 $help_icon = '';
82 <div class="container mt-3">
83 <div class="row">
84 <div class="col-sm-12">
85 <div class="page-title">
86 <h2><?php echo xlt('Procedure Providers');?><?php echo $help_icon; ?></h2>
87 </div>
88 </div>
89 </div>
90 <div class="row">
91 <div class="col-sm">
92 <div class="btn-group">
93 <button type="button" class="btn btn-primary btn-add" onclick="doedclick_add()"><?php echo xlt('Add New{{Provider}}');?></button>
94 </div>
95 </div>
96 </div>
97 <div class="row">
98 <div class="col-sm-12">
99 <form method='post' action='procedure_provider_list.php'>
100 <div class="form-check-inline mt-3">
101 <input type='checkbox' class="form-check-input mr-2 " id="form_inactive" name='form_inactive'
102 value='1' onclick='submit()' <?php echo ($form_inactive) ? 'checked ' : ''; ?>>
103 <label class="form-check-label bold" for="form_inactive" ><?php echo xlt('Include Inactive Providers'); ?></label>
104 </div>
105 <div class="table-responsive mt-2">
106 <table class="table table-striped table-hover">
107 <thead>
108 <tr>
109 <th title='<?php echo xla('Click to view or edit'); ?>'><?php echo xlt('Name'); ?></th>
110 <th><?php echo xlt('NPI'); ?></th>
111 <th><?php echo xlt('Protocol'); ?></th>
112 <th class="text-center"><?php echo xlt('Edit'); ?></th>
113 </tr>
114 </thead>
115 <tbody>
116 <?php
117 while ($row = sqlFetchArray($res)) {
118 echo " <tr class='detail'>";
119 echo " <td>" . text($row['name']) . "</td>\n";
120 echo " <td>" . text($row['npi']) . "</td>\n";
121 echo " <td>" . text($row['protocol']) . "</td>\n";
122 if (AclMain::aclCheckCore('admin', 'practice')) {
123 $trTitle = xl('Edit') . ' ' . $row['name'];
124 echo " <td class='text-center text-body'><span style='cursor: pointer;' onclick='doedclick_edit(" . attr_js($row['ppid']) . ")' class='haskids fa fa-pencil-alt' title='" . attr($trTitle) . "'></span></td>\n";
125 } else {
126 $trTitle = xl("Not Allowed to Edit") . ' ' . $row['name'];
127 echo " <td class='text-center'><span style='color: var(--gray400); cursor: no-drop;' class='haskids fa fa-pencil-alt' title='" . attr($trTitle) . "'></span></td>\n";
129 echo " </tr>\n";
132 </tbody>
133 </table>
134 </div>
135 </form>
136 </div>
137 </div>
138 </div><!-- End of container div -->
139 <?php
140 //home of the help modal ;)
141 //$GLOBALS['enable_help'] = 0; // Please comment out line if you want help modal to function on this page
142 if ($GLOBALS['enable_help'] == 1) {
143 echo "<script>var helpFile = 'procedure_provider_help.php'</script>";
144 //help_modal.php lives in interface, set path accordingly
145 require "../help_modal.php";
148 </body>
149 </html>