3 * The outside frame that holds all of the OpenEMR User Interface.
5 * LICENSE: This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
17 * @author Brady Miller <brady@sparmy.com>
18 * @link http://www.open-emr.org
21 $fake_register_globals=false;
22 $sanitize_all_escapes=true;
24 /* Include our required headers */
25 require_once('../globals.php');
26 require_once("$srcdir/formdata.inc.php");
28 // Creates a new session id when load this outer frame
29 // (allows creations of separate OpenEMR frames to view patients concurrently
30 // on different browser frame/windows)
31 // This session id is used below in the restoreSession.php include to create a
32 // session cookie for this specific OpenEMR instance that is then maintained
33 // within the OpenEMR instance by calling top.restoreSession() whenever
34 // refreshing or starting a new script.
35 if (isset($_POST['new_login_session_management'])) {
36 // This is a new login, so create a new session id and remove the old session
37 session_regenerate_id(true);
40 // This is not a new login, so create a new session id and do NOT remove the old session
41 session_regenerate_id(false);
44 $_SESSION["encounter"] = '';
46 // Fetch the password expiration date
48 if($GLOBALS['password_expiration_days'] != 0){
50 $q= (isset($_POST['authUser'])) ?
$_POST['authUser'] : '';
51 $result = sqlStatement("select pwd_expiration_date from users where username = ?", array($q));
52 $current_date = date('Y-m-d');
53 $pwd_expires_date = $current_date;
54 if($row = sqlFetchArray($result)) {
55 $pwd_expires_date = $row['pwd_expiration_date'];
58 // Display the password expiration message (starting from 7 days before the password gets expired)
59 $pwd_alert_date = date('Y-m-d', strtotime($pwd_expires_date . '-7 days'));
61 if (strtotime($pwd_alert_date) != '' &&
62 strtotime($current_date) >= strtotime($pwd_alert_date) &&
63 (!isset($_SESSION['expiration_msg'])
64 or $_SESSION['expiration_msg'] == 0)) {
66 $_SESSION['expiration_msg'] = 1; // only show the expired message once
71 //display the php file containing the password expiration message.
72 $frame1url = "pwd_expires_alert.php";
74 else if (!empty($_POST['patientID'])) {
75 $patientID = 0 +
$_POST['patientID'];
76 if (empty($_POST['encounterID'])) {
77 // Open patient summary screen (without a specific encounter)
78 $frame1url = "../patient_file/summary/demographics.php?set_pid=".attr($patientID);
81 // Open patient summary screen with a specific encounter
82 $encounterID = 0 +
$_POST['encounterID'];
83 $frame1url = "../patient_file/summary/demographics.php?set_pid=".attr($patientID)."&set_encounterid=".attr($encounterID);
86 else if (isset($_GET['mode']) && $_GET['mode'] == "loadcalendar") {
87 $frame1url = "calendar/index.php?pid=" . attr($_GET['pid']);
88 if (isset($_GET['date'])) $frame1url .= "&date=" . attr($_GET['date']);
90 else if ($GLOBALS['concurrent_layout']) {
92 if ($GLOBALS['default_top_pane']) {
93 $frame1url=attr($GLOBALS['default_top_pane']);
95 $frame1url = "main_info.php";
100 $frame1url = "main.php?mode=" . attr($_GET['mode']);
103 $nav_area_width = '130';
104 if (!empty($GLOBALS['gbl_nav_area_width'])) $nav_area_width = $GLOBALS['gbl_nav_area_width'];
109 <?php
echo text($openemr_name) ?
>
111 <script type
="text/javascript" src
="../../library/js/jquery-1.9.1.min.js"></script
>
112 <script type
="text/javascript" src
="../../library/topdialog.js"></script
>
114 <script language
='JavaScript'>
115 <?php
require($GLOBALS['srcdir'] . "/restoreSession.php"); ?
>
117 // This counts the number of frames that have reported themselves as loaded.
118 // Currently only left_nav and Title do this, so the maximum will be 2.
119 // This is used to determine when those frames are all loaded.
120 var loadedFrameCount
= 0;
122 function allFramesLoaded() {
123 // Change this number if more frames participate in reporting.
124 return loadedFrameCount
>= 2;
132 * for RTL layout we need to change order of frames in framesets
134 $lang_dir = $_SESSION['language_direction'];
136 $sidebar_tpl = "<frameset rows='*,0' frameborder='0' border='0' framespacing='0'>
137 <frame src='left_nav.php' name='left_nav' />
138 <frame src='daemon_frame.php' name='Daemon' scrolling='no' frameborder='0'
139 border='0' framespacing='0' />
142 $main_tpl = "<frameset rows='60%,*' id='fsright' bordercolor='#999999' frameborder='1'>" ;
143 $main_tpl .= "<frame src='". $frame1url ."' name='RTop' scrolling='auto' />
144 <frame src='messages/messages.php?form_active=1' name='RBot' scrolling='auto' /></frameset>";
146 // Please keep in mind that border (mozilla) and framespacing (ie) are the
147 // same thing. use both.
148 // frameborder specifies a 3d look, not whether there are borders.
150 if ($GLOBALS['concurrent_layout']) {
152 if (empty($GLOBALS['gbl_tall_nav_area'])) {
153 // not tall nav area ?>
154 <frameset rows
='<?php echo attr($GLOBALS['titleBarHeight
']) + 5 ?>,*' frameborder
='1' border
='1' framespacing
='1' onunload
='imclosing()'>
155 <frame src
='main_title.php' name
='Title' scrolling
='no' frameborder
='1' noresize
/>
156 <?php
if($lang_dir != 'rtl'){ ?
>
158 <frameset cols
='<?php echo attr($nav_area_width) . ',*'; ?>' id
='fsbody' frameborder
='1' border
='4' framespacing
='4'>
159 <?php
echo $sidebar_tpl ?
>
160 <?php
echo $main_tpl ?
>
165 <frameset cols
='<?php echo '*,' . attr($nav_area_width); ?>' id
='fsbody' frameborder
='1' border
='4' framespacing
='4'>
166 <?php
echo $main_tpl ?
>
167 <?php
echo $sidebar_tpl ?
>
175 <?php
} else { // use tall nav area ?>
177 <frameset cols
='<?php echo attr($nav_area_width); ?>,*' id
='fsbody' frameborder
='1' border
='4' framespacing
='4' onunload
='imclosing()'>
178 <frameset rows
='*,0' frameborder
='0' border
='0' framespacing
='0'>
179 <frame src
='left_nav.php' name
='left_nav' />
180 <frame src
='daemon_frame.php' name
='Daemon' scrolling
='no' frameborder
='0'
181 border
='0' framespacing
='0' />
183 <frameset rows
='<?php echo attr($GLOBALS['titleBarHeight
']) + 5 ?>,*' frameborder
='1' border
='1' framespacing
='1'>
184 <frame src
='main_title.php' name
='Title' scrolling
='no' frameborder
='1' />
185 <frameset rows
='60%,*' id
='fsright' bordercolor
='#999999' frameborder
='1' border
='4' framespacing
='4'>
186 <frame src
='<?php echo $frame1url ?>' name
='RTop' scrolling
='auto' />
187 <frame src
='messages/messages.php?form_active=1' name
='RBot' scrolling
='auto' />
192 <?php
} // end tall nav area ?>
194 <?php
} else { // start old layout ?>
197 <frameset rows
="<?php echo attr($GLOBALS[navBarHeight]).",".attr($GLOBALS[titleBarHeight]) ?>,*"
198 cols
="*" frameborder
="no" border
="0" framespacing
="0"
199 onunload
="imclosing()">
200 <frame src
="main_navigation.php" name
="Navigation" scrolling
="no" noresize frameborder
="no">
201 <frame src
="main_title.php" name
="Title" scrolling
="no" noresize frameborder
="no">
202 <frame src
='<?php echo $frame1url ?>' name
='Main' scrolling
='auto' noresize frameborder
='no'>
204 <noframes
><body bgcolor
="#FFFFFF">
205 <?php
echo xlt('Frame support required'); ?
>
208 <?php
} // end old layout ?>