- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / system_admin / edv_system_timeout.php
blob60b0141ef014ac10ea5b6d0644f8323963a96324
1 <?php
2 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
3 require('./roots.php');
4 require($root_path.'include/inc_environment_global.php');
5 /**
6 * CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02
7 * GNU General Public License
8 * Copyright 2002,2003,2004,2005 Elpidio Latorilla
9 * elpidio@care2x.org,
11 * See the file "copy_notice.txt" for the licence notice
14 # Default maximum values for the time out time
15 $def_max_hours=0;
16 $def_max_mins=15; # 15 minutes
17 $def_max_secs=59; # 59 seconds
19 $lang_tables[]='startframe.php';
20 $lang_tables[]='date_time.php';
21 define('LANG_FILE','edp.php');
22 $local_user='ck_edv_user';
23 require_once($root_path.'include/inc_front_chain_lang.php');
25 $breakfile='edv-system-admi-welcome.php'.URL_APPEND;
26 $thisfile=basename(__FILE__);
28 $GLOBAL_CONFIG=array();
29 require_once($root_path.'include/care_api_classes/class_globalconfig.php');
30 # Create object linking our global config array to the object
31 $glob_obj=new GlobalConfig($GLOBAL_CONFIG);
33 # Save data if save mode
34 if(isset($mode)&&$mode=='save'){
36 # Validate time values
37 if(!is_numeric($HTTP_POST_VARS['thours'])||$HTTP_POST_VARS['thours']>24) $HTTP_POST_VARS['thours']=0;
38 if(!is_numeric($HTTP_POST_VARS['tmins'])||$HTTP_POST_VARS['tmins']>59||$HTTP_POST_VARS['tmins']<1) $HTTP_POST_VARS['tmins']=$def_max_mins;
39 if(!is_numeric($HTTP_POST_VARS['tsecs'])||$HTTP_POST_VARS['tsecs']>59) $HTTP_POST_VARS['tsecs']=$def_max_tsecs;
41 # combine the values to final format HoursMinsSecs
42 //$HTTP_POST_VARS['timeout_time']=$HTTP_POST_VARS['thours'].$HTTP_POST_VARS['tmins'].$HTTP_POST_VARS['tsecs'];
43 $HTTP_POST_VARS['timeout_time']=date('His',mktime($HTTP_POST_VARS['thours'],$HTTP_POST_VARS['tmins'],$HTTP_POST_VARS['tsecs'],1,1,1971));
45 $filter='timeout_'; # The index filter
47 $numeric=FALSE; # Values are not strictly numeric
48 $addslash=FALSE; # Slashes should be added to the stored values
50 # Save the configuration
51 $glob_obj->saveConfigArray($HTTP_POST_VARS,$filter,$numeric,'',$addslash);
53 # Loop back to self to get the newly stored values
54 header("location:$thisfile".URL_REDIRECT_APPEND."&save_ok=1");
55 exit;
56 # Else get current global data
57 }else{
58 $glob_obj->getConfig('timeout_%');
59 # Parse the time value to hours mins and secs
60 $buffer='000000'.$GLOBAL_CONFIG['timeout_time'];
61 $thours=substr($buffer,-6,2);
62 $tmins=substr($buffer,-4,2);
63 $tsecs=substr($buffer,-2);
66 # Start Smarty templating here
67 /**
68 * LOAD Smarty
70 # Note: it is advisable to load this after the inc_front_chain_lang.php so
71 # that the smarty script can use the user configured template theme
73 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
74 $smarty = new smarty_care('system_admin');
76 # Title in toolbar
77 $smarty->assign('sToolbarTitle',$LDTimeOut);
79 # href for help button
80 $smarty->assign('pbHelp',"javascript:gethelp('timeout.php')");
82 # href for close button
83 $smarty->assign('breakfile',$breakfile);
85 # Window bar title
86 $smarty->assign('sWindowTitle',$LDTimeOut);
88 # Buffer page output
90 ob_start();
94 <ul>
95 <FONT class="prompt">
96 <p>
97 <?php
99 if(isset($save_ok)&&$save_ok) echo '<img '.createMascot($root_path,'mascot1_r.gif','0','absmiddle').'>'.$LDDataSaved.'<p>';
101 echo $LDEnterInfo;
104 </font>
107 <form action="<?php echo $thisfile ?>" method="post" name="quickinfo">
108 <table border=0 cellspacing=1 cellpadding=5>
109 <tr valign=top>
110 <td class="wardlisttitlerow" align="right"><FONT color="#0000cc"><b><nobr><?php echo $LDTimeOutActive ?></nobr></b> </FONT></td>
111 <td class="wardlistrow1">
112 <input type="radio" name="timeout_inactive" value="0" <?php if(!$GLOBAL_CONFIG['timeout_inactive']) echo 'checked' ?>> <nobr><?php echo $LDYes ?>&nbsp;&nbsp;&nbsp;
113 <input type="radio" name="timeout_inactive" value="1" <?php if($GLOBAL_CONFIG['timeout_inactive']) echo 'checked' ?>> <?php echo $LDNo ?></nobr>
114 </td>
115 <td class="wardlistrow2"><?php echo $LDTimeOutTxt ?></td>
116 </tr>
117 <tr valign=top>
118 <td class="wardlisttitlerow" align="right"><FONT color="#0000cc"><b><nobr><?php echo $LDTimeOutTime ?></nobr></b> </FONT></td>
119 <td class="wardlistrow1"><nobr>
120 <input type="text" name="thours" size=2 maxlength=2 value=<?php echo $thours ?>> <?php echo $LDHours ?>&nbsp;
121 <input type="text" name="tmins" size=2 maxlength=2 value=<?php echo $tmins ?>> <?php echo $LDMinutes ?>&nbsp;
122 <input type="text" name="tsecs" size=2 maxlength=2 value=<?php echo $tsecs ?>> <?php echo $LDSeconds ?></nobr>
124 </td>
125 <td class="wardlistrow2"><?php echo $LDTimeOutTimeTxt ?></td>
126 </tr>
127 </table>
129 <?php if($item_no) $save_button='update.gif'; else $save_button='savedisc.gif'; ?>
130 <input type="image" <?php echo createLDImgSrc($root_path,$save_button,'0') ?>>&nbsp;&nbsp;&nbsp;&nbsp;
131 <a href="<?php echo $breakfile ?>"><img <?php echo createLDImgSrc($root_path,'cancel.gif','0') ?>></a>
132 <?php if($item_no) : ?>
133 <a href="<?php echo $thisfile.''.URL_APPEND.'&from='.$from ?>"><img <?php echo createLDImgSrc($root_path,'newcurrency.gif','0') ?>></a>
134 <?php endif ?>
135 <input type="hidden" name="sid" value="<?php echo $sid;?>">
136 <input type="hidden" name="lang" value="<?php echo $lang; ?>">
137 <input type="hidden" name="mode" value="save">
138 </form>
140 </ul>
142 <?php
144 $sTemp = ob_get_contents();
145 ob_end_clean();
147 # Assign page output to the mainframe template
149 $smarty->assign('sMainFrameBlockData',$sTemp);
151 * show Template
153 $smarty->display('common/mainframe.tpl');