3 * interface/therapy_groups/therapy_groups_views/groupDetailsGeneralData.php contains group details view .
5 * This is the therapy group detail screen for the chosen group.
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>;.
22 * @author Shachar Zilbershlag <shaharzi@matrix.co.il>
23 * @author Amiel Elboim <amielel@matrix.co.il>
24 * @link http://www.open-emr.org
29 <?php
$edit = acl_check("groups", "gadd", false, 'write');?
>
30 <?php
$edit_encounter = acl_check("groups", "glog", false, 'write');?
>
31 <?php
$view = acl_check("groups", "gadd", false, 'view');?
>
34 <?php
require 'header.php'; ?
>
35 <?php
if ($view ||
$edit) :?
>
37 <main id
="group-details">
38 <div
class="container-group">
39 <span
class="hidden title"><?php
echo text($groupData['group_name']);?
></span
>
41 <div id
="main-component" class="col-md-8 col-sm-12">
43 <div
class="col-md-8 col-sm-12">
45 <li
class="current"><a href
="<?php echo $GLOBALS['rootdir'] . '/therapy_groups/index.php?method=groupDetails&group_id=' . attr($groupData['group_id']); ?>"><?php
echo xlt('General data');?
></a
></li
>
46 <li
><a href
="<?php echo $GLOBALS['rootdir'] . '/therapy_groups/index.php?method=groupParticipants&group_id=' . attr($groupData['group_id']); ?>"><?php
echo xlt('Participants ');?
></a
></li
>
49 <div
class="col-md-4 col-sm-4">
51 <?php
if ($edit_encounter) :?
>
52 <button onclick
="newGroup()"><?php
echo xlt('Add encounter'); ?
></button
>
54 <?php
if ($readonly == '') : ?
>
55 <button
class="float-right" onclick
="location.href='<?php echo $GLOBALS['rootdir'] . '/therapy_groups/index.php?method=groupDetails&group_id=' . attr($groupData['group_id']); ?>'"><?php
echo xlt('Cancel');?
></button
>
56 <button id
="saveUpdates" class="float-right"><?php
echo xlt('Save');?
></button
>
58 <button
class="float-right" onclick
="location.href='<?php echo $GLOBALS['rootdir'] . '/therapy_groups/index.php?method=groupDetails&editGroup=1&group_id=' . attr($groupData['group_id']); ?>'"><?php
echo xlt('Update');?
></button
>
64 <div
class="col-md-12">
65 <div id
="component-border">
66 <form method
="post" id
='editGroup' name
="editGroup">
67 <input type
="hidden" name
="group_id" value
="<?php echo isset($groupData['group_id']) ? attr($groupData['group_id']) : '';?>">
68 <div
class="row group-row">
69 <div
class="col-md-6 col-sm-7">
71 <div
class="col-md-4 col-sm-5">
72 <span
class="bold"><?php
echo xlt("Group's name") ?
>:</span
>
74 <div
class="col-md-8 col-sm-7">
75 <input type
="text" name
="group_name" class="full-width" value
="<?php echo attr($groupData['group_name']);?>" <?php
echo $readonly; ?
>>
79 <div
class="col-md-2 col-sm-3">
80 <span
class="bold"><?php
echo xlt('Group number') ?
>:</span
>
81 <span
><?php
echo text($groupData['group_id'])?
></span
>
83 <div
class="col-md-4">
85 <div
class="col-md-6 col-sm-6 attach-input">
86 <span
class="bold"><?php
echo xlt('Status'); ?
>:</span
>
88 <div
class="col-md-6 col-sm-6">
89 <select name
="group_status" class="full-width" value
="<?php echo attr($groupData['group_status']);?>" <?php
echo $readonly; ?
>>
90 <?php
foreach ($statuses as $key => $status) : ?
>
91 <option value
="<?php echo attr($key);?>" <?php
echo $key == $groupData['group_status'] ?
'selected' : ''; ?
>><?php
echo xlt($status); ?
></option
>
98 <div
class="row group-row">
99 <div
class="col-md-6">
100 <span
class="bold"><?php
echo xlt('Type of group'); ?
>:</span
>
101 <label
class="radio-inline radio-pos">
102 <input type
="radio" value
="1" name
="group_type" <?php
echo is_null($groupData['group_type']) ||
$groupData['group_type'] == '1' ?
'checked' : '';?
> <?php
echo $readonly; ?
>><?php
echo xlt('Closed'); ?
>
104 <label
class="radio-inline radio-pos">
105 <input type
="radio" value
="2" name
="group_type" <?php
echo $groupData['group_type'] == '2' ?
'checked' : '';?
> <?php
echo $readonly; ?
>><?php
echo xlt('Open'); ?
>
107 <label
class="radio-inline radio-pos">
108 <input type
="radio" value
="3" name
="group_type" <?php
echo $groupData['group_type'] == '3' ?
'checked' : '';?
> <?php
echo $readonly; ?
>><?php
echo xlt('Train'); ?
>
111 <div
class="col-md-6">
112 <span
class="bold"><?php
echo xlt('Obligatory participation'); ?
>:</span
>
113 <label
class="radio-inline radio-pos">
114 <input type
="radio" value
="1" name
="group_participation" <?php
echo is_null($groupData['group_participation']) ||
$groupData['group_participation'] == '1' ?
'checked' : '';?
> <?php
echo $readonly; ?
>><?php
echo xlt('Mandatory'); ?
>
116 <label
class="radio-inline radio-pos">
117 <input type
="radio" value
="2" name
="group_participation" <?php
echo $groupData['group_participation'] == '2' ?
'checked' : '';?
> <?php
echo $readonly; ?
>><?php
echo xlt('Optional'); ?
>
121 <div
class="row group-row">
122 <div
class="col-md-6 col-sm-6">
124 <div
class="col-md-5 col-sm-6">
125 <span
class="bold"><?php
echo xlt('Starting date'); ?
>:</span
>
127 <div
class="col-md-offset1 col-md-6 col-sm-6">
128 <input type
="text" name
="group_start_date" class="full-width datepicker" value
="<?php echo attr(oeFormatShortDate($groupData['group_start_date']));?>" <?php
echo $readonly; ?
>>
132 <div
class="col-md-6 col-sm-6">
134 <div
class="col-md-5 col-sm-6">
135 <span
class="bold"><?php
echo xlt('Ending date'); ?
>:</span
>
137 <div
class="col-md-6 col-sm-6">
138 <input type
="text" name
="group_end_date" class="full-width datepicker" value
="<?php echo $groupData['group_end_date'] == '0000-00-00' ? '' : attr(oeFormatShortDate($groupData['group_end_date'])) ;?>" <?php
echo $readonly; ?
>>
143 <div
class="row group-row">
144 <div
class="col-md-6">
146 <div
class="col-md-4 col-sm-5">
147 <span
class="bold"><?php
echo xlt('Main Counselors'); ?
>:</span
>
149 <div
class="col-md-8 col-sm-7">
150 <select name
="counselors[]" multiple
class="full-width" <?php
echo $readonly; ?
>>
151 <?php
foreach ($users as $user) : ?
>
152 <option value
="<?php echo attr($user['id']);?>" <?php
echo !is_null($groupData['counselors']) && in_array($user['id'], $groupData['counselors']) ?
'selected' : '';?
>><?php
echo text($user['fname'] . ' ' . $user['lname']);?
></option
>
158 <div
class="col-md-6">
160 <div
class="col-md-3 col-sm-5">
161 <span
class="bold"><?php
echo xlt('Notes'); ?
>:</span
>
163 <div
class="col-md-9 col-sm-7">
164 <textarea name
="group_notes" class="full-width" style
="height: 70px" <?php
echo $readonly; ?
>><?php
echo text($groupData['group_notes']);?
></textarea
>
169 <div
class="row group-row">
170 <div
class="col-md-8">
172 <div
class="col-md-4 col-sm-5">
173 <span
class="bold"><?php
echo xlt('Guest counselors'); ?
>:</span
>
175 <div
class="col-md-8 col-sm-7">
176 <input type
="text" name
="group_guest_counselors" class="full-width" value
="<?php echo attr($groupData['group_guest_counselors']);?>" <?php
echo $readonly; ?
>>
181 <div
class="row group-row">
182 <div
class="col-md-9 col-sm 12">
183 <?php
if ($savingStatus == 'exist') : ?
>
184 <div id
="exist-group"><h4
class="group-error-msg"><?php
echo text($message) ?
></h4
> <?php
if ($edit) :
185 ?
><button id
="cancel-save"><?php
echo xlt('cancel') ?
></button
><button type
="submit" value
="save_anyway" name
="save"><?php
echo xlt('Creating anyway') ?
></button
><?php
188 <?php
if ($savingStatus == 'success') : ?
>
189 <h4
class="group-success-msg"><?php
echo text($message) ?
></h4
>
191 <?php
if ($savingStatus == 'failed') : ?
>
192 <h4
class="group-serror-msg"><?php
echo text($message) ?
></h4
>
201 <div id
="appointment-component" class="col-md-2 col-sm-12">
202 <?php
require 'appointmentComponent.php';?
>
208 $
(document
).ready(function(){
209 $
('.datepicker').datetimepicker({
210 <?php
$datetimepicker_timepicker = false; ?
>
211 <?php
$datetimepicker_showseconds = false; ?
>
212 <?php
$datetimepicker_formatInput = true; ?
>
213 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
214 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
217 $
('#cancel-save').on('click', function(e
){
219 $
('#exist-group').hide();
222 $
('#saveUpdates').on('click', function () {
223 $
('#editGroup').append('<input type="hidden" name="save">').submit();
226 function refreshme() {
227 top
.restoreSession();
228 location
.href
= "<?php echo $GLOBALS['webroot'] . '/interface/therapy_groups/index.php?method=groupDetails&group_id='. attr($groupId) ?>";
232 <?php
if ($GLOBALS['new_tabs_layout']) : ?
>
233 top
.restoreSession();
234 parent
.left_nav
.loadFrame('gcv4','enc','forms/newGroupEncounter/new.php?autoloaded=1&calenc=')
236 top
.restoreSession();
237 top
.frames
['RBot'].location
= '<?php echo $GLOBALS['web_root
'] . "/interface/" ?>' +
'forms/newGroupEncounter/new.php?autoloaded=1&calenc=';
241 parent
.left_nav
.setTherapyGroup(<?php
echo attr($groupData['group_id'])?
>,'<?php echo attr($groupData['group_name
'])?>');
242 <?php
if (!$GLOBALS['new_tabs_layout']) : ?
>
243 top
.restoreSession();
244 parent
.left_nav
.loadFrame('enc2', 'RBot', '/patient_file/history/encounters.php');
245 $
(parent
.Title
.document
.getElementById('clear_active')).hide();
247 /* show the encounters menu in the title menu (code like interface/forms/newGroupEncounter/save.php) */
249 $result4 = sqlStatement("SELECT fe.encounter,fe.date,openemr_postcalendar_categories.pc_catname FROM form_groups_encounter AS fe ".
250 " left join openemr_postcalendar_categories on fe.pc_catid=openemr_postcalendar_categories.pc_catid WHERE fe.group_id = ? order by fe.date desc", array( $groupData['group_id']));
253 EncounterDateArray
=new Array;
254 CalendarCategoryArray
=new Array;
255 EncounterIdArray
=new Array;
258 if (sqlNumRows($result4)>0) {
259 while ($rowresult4 = sqlFetchArray($result4)) {
261 EncounterIdArray
[Count
]='<?php echo attr($rowresult4['encounter
']); ?>';
262 EncounterDateArray
[Count
]='<?php echo attr(oeFormatShortDate(date("Y-m-d", strtotime($rowresult4['date
'])))); ?>';
263 CalendarCategoryArray
[Count
]='<?php echo attr(xl_appt_category($rowresult4['pc_catname
'])); ?>';
269 top
.window
.parent
.left_nav
.setPatientEncounter(EncounterIdArray
,EncounterDateArray
,CalendarCategoryArray
);
271 <?php
$use_validate_js = 1;?
>
272 <?php
validateUsingPageRules($_SERVER['PHP_SELF'] . '?method=groupDetails');?
>
273 <?php
require 'footer.php'; ?
>
277 <div
class="container">
279 <div
class="row alert alert-info">
280 <h1
class="col-md-12"><i
class="col-md-3 glyphicon glyphicon-alert"></i
><span
class="col-md-6"><?php
echo xlt("access not allowed");?
></span
></h1
>