Highway to PSR2
[openemr.git] / interface / therapy_groups / therapy_groups_models / group_statuses_model.php
blob758b41322b55cee714b0a5200c76ce570259b6a7
1 <?php
2 /**
3 * interface/therapy_groups/therapy_groups_models/group_statuses_model.php contains the model for therapy group statuses.
5 * This model fetches the statuses list for therapy group appointments from the DB.
7 * Copyright (C) 2016 Shachar Zilbershlag <shaharzi@matrix.co.il>
8 * Copyright (C) 2016 Amiel Elboim <amielel@matrix.co.il>
10 * LICENSE: This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 3
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
21 * @package OpenEMR
22 * @author Shachar Zilbershlag <shaharzi@matrix.co.il>
23 * @author Amiel Elboim <amielel@matrix.co.il>
24 * @link http://www.open-emr.org
27 class Group_Statuses
30 const TABLE = 'list_options';
32 /**
33 * Gets group appointment statuses
34 * @return ADORecordSet_mysqli
36 public function getGroupStatuses()
38 $sql = 'SELECT option_id, title FROM ' . self::TABLE . ' WHERE list_id = ?;';
39 $result = sqlStatement($sql, array('groupstat'));
40 $final_result =array();
41 while ($row = sqlFetchArray($result)) {
42 $final_result[] = $row;
45 return $final_result;
48 /**
49 * Gets group meeting attendance statuses
50 * @return ADORecordSet_mysqli
52 public function getGroupAttendanceStatuses()
54 $sql = 'SELECT option_id, title FROM ' . self::TABLE . ' WHERE list_id = ?;';
55 $result = sqlStatement($sql, array('attendstat'));
56 $final_result =array();
57 while ($row = sqlFetchArray($result)) {
58 $row['title']=xla(trim($row['title']));
59 $final_result[] = $row;
62 return $final_result;