* @author Brady Miller * @copyright Copyright (c) 2019 Brady Miller * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ require_once(dirname(__FILE__) . "/FeeSheet.class.php"); require_once(dirname(__FILE__) . "/api.inc"); class FeeSheetHtml extends FeeSheet { // Dynamically generated JavaScript to maintain justification codes. public $justinit = "var f = document.forms[0];\n"; function __construct($pid = 0, $encounter = 0) { parent::__construct($pid, $encounter); } // Build a drop-down list of providers. This includes users who // have the word "provider" anywhere in their "additional info" // field, so that we can define providers (for billing purposes) // who do not appear in the calendar. // public static function genProviderOptionList($toptext, $default = 0, $inactive = false) { $s = ''; // Get user's default facility, or 0 if none. $drow = sqlQuery("SELECT facility_id FROM users where username = ?", [$_SESSION['authUser']]); $def_facility = 0 + $drow['facility_id']; // $sqlarr = array($def_facility); $query = "SELECT id, lname, fname, facility_id FROM users WHERE " . "( authorized = 1 OR info LIKE '%provider%' ) AND username != '' "; if (!$GLOBALS['include_inactive_providers']) { $query .= " AND active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' )"; } // If restricting to providers matching user facility... if (!empty($GLOBALS['gbl_restrict_provider_facility'])) { $query .= " AND ( facility_id = 0 OR facility_id = ? )"; $query .= " ORDER BY lname, fname"; } else { // If not restricting then sort the matching providers first. $query .= " ORDER BY (facility_id = ?) DESC, lname, fname"; } $res = sqlStatement($query, $sqlarr); $s .= ""; while ($row = sqlFetchArray($res)) { $provid = $row['id']; $s .= "