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
27 <?php
require 'header.php'; ?
>
28 <main id
="group-details">
29 <div
class="container-group">
30 <span
class="hidden title"><?php
echo text($groupData['group_name']);?
></span
>
32 <div id
="main-component" class="col-md-8 col-sm-12">
34 <div
class="col-md-8 col-sm-12">
36 <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
>
37 <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
>
40 <div
class="col-md-4 col-sm-4">
41 <button onclick
="newGroup()"><?php
echo xlt('Add encounter'); ?
></button
>
43 <?php
if($readonly == ''): ?
>
44 <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
>
45 <button id
="saveUpdates" class="float-right"><?php
echo xlt('Save');?
></button
>
47 <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
>
52 <div
class="col-md-12">
53 <div id
="component-border">
54 <form method
="post" id
='editGroup' name
="editGroup">
55 <input type
="hidden" name
="group_id" value
="<?php echo isset($groupData['group_id']) ? attr($groupData['group_id']) : '';?>">
56 <div
class="row group-row">
57 <div
class="col-md-6 col-sm-7">
59 <div
class="col-md-4 col-sm-5">
60 <span
class="bold"><?php
echo xlt("Group's name") ?
>:</span
>
62 <div
class="col-md-8 col-sm-7">
63 <input type
="text" name
="group_name" class="full-width" value
="<?php echo attr($groupData['group_name']);?>" <?php
echo $readonly; ?
>>
67 <div
class="col-md-2 col-sm-3">
68 <span
class="bold"><?php
echo xlt('Group number') ?
>:</span
>
69 <span
><?php
echo text($groupData['group_id'])?
></span
>
71 <div
class="col-md-4">
73 <div
class="col-md-6 col-sm-6 attach-input">
74 <span
class="bold"><?php
echo xlt('Status'); ?
>:</span
>
76 <div
class="col-md-6 col-sm-6">
77 <select name
="group_status" class="full-width" value
="<?php echo attr($groupData['group_status']);?>" <?php
echo $readonly; ?
>>
78 <?php
foreach($statuses as $key => $status): ?
>
79 <option value
="<?php echo attr($key);?>" <?php
echo $key == $groupData['group_status'] ?
'selected' : ''; ?
>><?php
echo xlt($status); ?
></option
>
86 <div
class="row group-row">
87 <div
class="col-md-6">
88 <span
class="bold"><?php
echo xlt('Type of group'); ?
>:</span
>
89 <label
class="radio-inline radio-pos">
90 <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'); ?
>
92 <label
class="radio-inline radio-pos">
93 <input type
="radio" value
="2" name
="group_type" <?php
echo $groupData['group_type'] == '2' ?
'checked' : '';?
> <?php
echo $readonly; ?
>><?php
echo xlt('Open'); ?
>
95 <label
class="radio-inline radio-pos">
96 <input type
="radio" value
="3" name
="group_type" <?php
echo $groupData['group_type'] == '3' ?
'checked' : '';?
> <?php
echo $readonly; ?
>><?php
echo xlt('Train'); ?
>
99 <div
class="col-md-6">
100 <span
class="bold"><?php
echo xlt('Obligatory participation'); ?
>:</span
>
101 <label
class="radio-inline radio-pos">
102 <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'); ?
>
104 <label
class="radio-inline radio-pos">
105 <input type
="radio" value
="2" name
="group_participation" <?php
echo $groupData['group_participation'] == '2' ?
'checked' : '';?
> <?php
echo $readonly; ?
>><?php
echo xlt('Optional'); ?
>
109 <div
class="row group-row">
110 <div
class="col-md-6 col-sm-6">
112 <div
class="col-md-5 col-sm-6">
113 <span
class="bold"><?php
echo xlt('Starting date'); ?
>:</span
>
115 <div
class="col-md-offset1 col-md-6 col-sm-6">
116 <input type
="text" name
="group_start_date" class="full-width datepicker" value
="<?php echo attr($groupData['group_start_date']);?>" <?php
echo $readonly; ?
>>
120 <div
class="col-md-6 col-sm-6">
122 <div
class="col-md-5 col-sm-6">
123 <span
class="bold"><?php
echo xlt('Ending date'); ?
>:</span
>
125 <div
class="col-md-6 col-sm-6">
126 <input type
="text" name
="group_end_date" class="full-width datepicker" value
="<?php echo $groupData['group_end_date'] == '0000-00-00' ? '' : attr($groupData['group_end_date']) ;?>" <?php
echo $readonly; ?
>>
131 <div
class="row group-row">
132 <div
class="col-md-6">
134 <div
class="col-md-4 col-sm-5">
135 <span
class="bold"><?php
echo xlt('Main counselors'); ?
>:</span
>
137 <div
class="col-md-8 col-sm-7">
138 <select name
="counselors[]" multiple
class="full-width" <?php
echo $readonly; ?
>>
139 <?php
foreach($users as $user): ?
>
140 <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
>
146 <div
class="col-md-6">
148 <div
class="col-md-3 col-sm-5">
149 <span
class="bold"><?php
echo xlt('Notes'); ?
>:</span
>
151 <div
class="col-md-9 col-sm-7">
152 <textarea name
="group_notes" class="full-width" style
="height: 70px" <?php
echo $readonly; ?
>><?php
echo text($groupData['group_notes']);?
></textarea
>
157 <div
class="row group-row">
158 <div
class="col-md-8">
160 <div
class="col-md-4 col-sm-5">
161 <span
class="bold"><?php
echo xlt('Guest counselors'); ?
>:</span
>
163 <div
class="col-md-8 col-sm-7">
164 <input type
="text" name
="group_guest_counselors" class="full-width" value
="<?php echo attr($groupData['group_guest_counselors']);?>" <?php
echo $readonly; ?
>>
169 <div
class="row group-row">
170 <div
class="col-md-9 col-sm 12">
171 <?php
if($savingStatus == 'exist'): ?
>
172 <div id
="exist-group"><h4
class="group-error-msg"><?php
echo text($message) ?
></h4
><button id
="cancel-save"><?php
echo xlt('cancel') ?
></button
><button type
="submit" value
="save_anyway" name
="save"><?php
echo xlt('Creating anyway') ?
></button
></div
>
174 <?php
if($savingStatus == 'success'): ?
>
175 <h4
class="group-success-msg"><?php
echo text($message) ?
></h4
>
177 <?php
if($savingStatus == 'failed'): ?
>
178 <h4
class="group-serror-msg"><?php
echo text($message) ?
></h4
>
187 <div id
="appointment-component" class="col-md-2 col-sm-12">
188 <?php
require 'appointmentComponent.php';?
>
194 $
(document
).ready(function(){
195 $
('.datepicker').datetimepicker({
196 <?php
$datetimepicker_timepicker = false; ?
>
197 <?php
$datetimepicker_formatInput = false; ?
>
198 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
199 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
202 $
('#cancel-save').on('click', function(e
){
204 $
('#exist-group').hide();
207 $
('#saveUpdates').on('click', function () {
208 $
('#editGroup').append('<input type="hidden" name="save">').submit();
211 function refreshme() {
212 top
.restoreSession();
217 <?php
if ($GLOBALS['new_tabs_layout']) : ?
>
218 top
.restoreSession();
219 parent
.left_nav
.loadFrame('gcv4','enc','forms/newGroupEncounter/new.php?autoloaded=1&calenc=')
221 top
.restoreSession();
222 top
.frames
['RBot'].location
= '<?php echo $GLOBALS['web_root
'] . "/interface/" ?>' +
'forms/newGroupEncounter/new.php?autoloaded=1&calenc=';
226 parent
.left_nav
.setTherapyGroup(<?php
echo attr($groupData['group_id'])?
>,'<?php echo attr($groupData['group_name
'])?>');
227 <?php
if (!$GLOBALS['new_tabs_layout']) : ?
>
228 top
.restoreSession();
229 parent
.left_nav
.loadFrame('enc2', 'RBot', '/patient_file/history/encounters.php');
230 $
(parent
.Title
.document
.getElementById('clear_active')).hide();
232 /* show the encounters menu in the title menu (code like interface/forms/newGroupEncounter/save.php) */
234 $result4 = sqlStatement("SELECT fe.encounter,fe.date,openemr_postcalendar_categories.pc_catname FROM form_groups_encounter AS fe ".
235 " 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']));
238 EncounterDateArray
=new Array;
239 CalendarCategoryArray
=new Array;
240 EncounterIdArray
=new Array;
243 if(sqlNumRows($result4)>0)
244 while($rowresult4 = sqlFetchArray($result4))
247 EncounterIdArray
[Count
]='<?php echo attr($rowresult4['encounter
']); ?>';
248 EncounterDateArray
[Count
]='<?php echo attr(oeFormatShortDate(date("Y-m-d", strtotime($rowresult4['date
'])))); ?>';
249 CalendarCategoryArray
[Count
]='<?php echo attr(xl_appt_category($rowresult4['pc_catname
'])); ?>';
254 top
.window
.parent
.left_nav
.setPatientEncounter(EncounterIdArray
,EncounterDateArray
,CalendarCategoryArray
);
256 <?php
$use_validate_js = 1;?
>
257 <?php
validateUsingPageRules($_SERVER['PHP_SELF'] . '?method=groupDetails');?
>
258 <?php
require 'footer.php'; ?
>