Change format of initial comment block.
[openemr.git] / interface / main / main_screen.php
blob5edef72d69d7ef60bd7e83cdb66d6c3445c357ec
1 <?php
2 /** The outside frame that holds all of the OpenEMR User Interface.
3 */
5 /* Include our required headers */
6 require_once('../globals.php');
7 require_once("$srcdir/formdata.inc.php");
9 $_SESSION["encounter"] = '';
11 // Fetch the password expiration date
12 $is_expired=false;
13 if($GLOBALS['password_expiration_days'] != 0){
14 $is_expired=false;
15 $q=formData('authUser','P');
16 $result = sqlStatement("select pwd_expiration_date from users where username = '".$q."'");
17 $current_date = date('Y-m-d');
18 $pwd_expires_date = $current_date;
19 if($row = sqlFetchArray($result)) {
20 $pwd_expires_date = $row['pwd_expiration_date'];
23 // Display the password expiration message (starting from 7 days before the password gets expired)
24 $pwd_alert_date = date('Y-m-d', strtotime($pwd_expires_date . '-7 days'));
26 if (strtotime($pwd_alert_date) != '' &&
27 strtotime($current_date) >= strtotime($pwd_alert_date) &&
28 (!isset($_SESSION['expiration_msg'])
29 or $_SESSION['expiration_msg'] == 0)) {
30 $is_expired = true;
31 $_SESSION['expiration_msg'] = 1; // only show the expired message once
35 if ($is_expired) {
36 //display the php file containing the password expiration message.
37 $frame1url = "pwd_expires_alert.php";
39 else if (!empty($_POST['patientID'])) {
40 $patientID = 0 + $_POST['patientID'];
41 $frame1url = "../patient_file/summary/demographics.php?set_pid=$patientID";
43 else if ($GLOBALS['athletic_team']) {
44 $frame1url = "../reports/players_report.php?embed=1";
46 else if (isset($_GET['mode']) && $_GET['mode'] == "loadcalendar") {
47 $frame1url = "calendar/index.php?pid=" . $_GET['pid'];
48 if (isset($_GET['date'])) $frame1url .= "&date=" . $_GET['date'];
50 else if ($GLOBALS['concurrent_layout']) {
51 // new layout
52 if ($GLOBALS['default_top_pane']) {
53 $frame1url=$GLOBALS['default_top_pane'];
54 } else {
55 $frame1url = "main_info.php";
58 else {
59 // old layout
60 $frame1url = "main.php?mode=" . $_GET['mode'];
63 $nav_area_width = $GLOBALS['athletic_team'] ? '230' : '130';
64 if (!empty($GLOBALS['gbl_nav_area_width'])) $nav_area_width = $GLOBALS['gbl_nav_area_width'];
66 <html>
67 <head>
68 <title>
69 <?php echo $openemr_name ?>
70 </title>
71 <script type="text/javascript" src="../../library/topdialog.js"></script>
73 <script language='JavaScript'>
74 <?php require($GLOBALS['srcdir'] . "/restoreSession.php"); ?>
76 // This counts the number of frames that have reported themselves as loaded.
77 // Currently only left_nav and Title do this, so the maximum will be 2.
78 // This is used to determine when those frames are all loaded.
79 var loadedFrameCount = 0;
81 function allFramesLoaded() {
82 // Change this number if more frames participate in reporting.
83 return loadedFrameCount >= 2;
85 </script>
87 </head>
89 <?php
91 // Please keep in mind that border (mozilla) and framespacing (ie) are the
92 // same thing. use both.
93 // frameborder specifies a 3d look, not whether there are borders.
95 if ($GLOBALS['concurrent_layout']) {
96 // start new layout
97 if (empty($GLOBALS['gbl_tall_nav_area'])) {
98 // not tall nav area ?>
99 <frameset rows='<?php echo $GLOBALS['titleBarHeight'] + 5 ?>,*' frameborder='1' border='1' framespacing='1' onunload='imclosing()'>
100 <frame src='main_title.php' name='Title' scrolling='no' frameborder='1' noresize />
101 <frameset cols='<?php echo $nav_area_width; ?>,*' id='fsbody' frameborder='1' border='4' framespacing='4'>
102 <frameset rows='*,0' frameborder='0' border='0' framespacing='0'>
103 <frame src='left_nav.php' name='left_nav' />
104 <frame src='daemon_frame.php' name='Daemon' scrolling='no' frameborder='0'
105 border='0' framespacing='0' />
106 </frameset>
107 <?php if (empty($GLOBALS['athletic_team'])) { ?>
108 <frameset rows='60%,*' id='fsright' bordercolor='#999999' frameborder='1'>
109 <?php } else { ?>
110 <frameset rows='100%,*' id='fsright' bordercolor='#999999' frameborder='1'>
111 <?php } ?>
112 <frame src='<?php echo $frame1url ?>' name='RTop' scrolling='auto' />
113 <frame src='messages/messages.php?form_active=1' name='RBot' scrolling='auto' />
114 </frameset>
115 </frameset>
116 </frameset>
118 <?php } else { // use tall nav area ?>
120 <frameset cols='<?php echo $nav_area_width; ?>,*' id='fsbody' frameborder='1' border='4' framespacing='4' onunload='imclosing()'>
121 <frameset rows='*,0' frameborder='0' border='0' framespacing='0'>
122 <frame src='left_nav.php' name='left_nav' />
123 <frame src='daemon_frame.php' name='Daemon' scrolling='no' frameborder='0'
124 border='0' framespacing='0' />
125 </frameset>
126 <frameset rows='<?php echo $GLOBALS['titleBarHeight'] + 5 ?>,*' frameborder='1' border='1' framespacing='1'>
127 <frame src='main_title.php' name='Title' scrolling='no' frameborder='1' />
128 <?php if (empty($GLOBALS['athletic_team'])) { ?>
129 <frameset rows='60%,*' id='fsright' bordercolor='#999999' frameborder='1' border='4' framespacing='4'>
130 <?php } else { ?>
131 <frameset rows='100%,*' id='fsright' bordercolor='#999999' frameborder='1' border='4' framespacing='4'>
132 <?php } ?>
133 <frame src='<?php echo $frame1url ?>' name='RTop' scrolling='auto' />
134 <frame src='messages/messages.php?form_active=1' name='RBot' scrolling='auto' />
135 </frameset>
136 </frameset>
137 </frameset>
139 <?php } // end tall nav area ?>
141 <?php } else { // start old layout ?>
143 </head>
144 <frameset rows="<?php echo "$GLOBALS[navBarHeight],$GLOBALS[titleBarHeight]" ?>,*"
145 cols="*" frameborder="no" border="0" framespacing="0"
146 onunload="imclosing()">
147 <frame src="main_navigation.php" name="Navigation" scrolling="no" noresize frameborder="no">
148 <frame src="main_title.php" name="Title" scrolling="no" noresize frameborder="no">
149 <frame src='<?php echo $frame1url ?>' name='Main' scrolling='auto' noresize frameborder='no'>
150 </frameset>
151 <noframes><body bgcolor="#FFFFFF">
152 Frame support required
153 </body></noframes>
155 <?php } // end old layout ?>
157 </html>