fixes to prior commit
[openemr.git] / services / ProviderService.php
blob2718d31e29202b2ad06f0542b3c8e4dec447929b
1 <?php
2 /**
3 * ProviderService
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Matthew Vita <matthewvita48@gmail.com>
8 * @copyright Copyright (c) 2018 Matthew Vita <matthewvita48@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 namespace OpenEMR\Services;
15 class ProviderService
18 /**
19 * Default constructor.
21 public function __construct()
25 public function getAll()
27 $sql = "SELECT id,
28 fname,
29 lname,
30 mname,
31 username
32 FROM users
33 WHERE authorized = 1 AND active = 1";
35 $statementResults = sqlStatement($sql);
37 $results = array();
38 while ($row = sqlFetchArray($statementResults)) {
39 array_push($results, $row);
42 return $results;
45 public function getById($id)
47 $sql = "SELECT id,
48 fname,
49 lname,
50 mname,
51 username
52 FROM users
53 WHERE authorized = 1 AND active = 1 AND id = ?";
55 return sqlQuery($sql, $id);