| [ PHPXref.com ] | [ Generated: Sun Jul 20 17:52:21 2008 ] | [ Focus/SIS 1.0 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <? 2 /** 3 * @file Warehouse.php 2006-04-17 andrew $ 4 * @package Focus/SIS 5 * @copyright Copyright (C) 2006 Andrew Schmadeke. All rights reserved. 6 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt 7 * Focus/SIS is free software. This version may have been modified pursuant 8 * to the GNU General Public License, and as distributed it includes or 9 * is derivative of works licensed under the GNU General Public License or 10 * other free or open source software licenses. 11 * See COPYRIGHT.txt for copyright notices and details. 12 */ 13 14 if(WAREHOUSE_PHP==0) 15 { 16 define("WAREHOUSE_PHP",1); 17 $staticpath=dirname(__FILE__) . '/'; 18 19 require_once ($staticpath."config.inc.php"); 20 require_once ("database.inc.php"); 21 22 // Load functions. 23 if($handle = opendir("$FocusPath/functions")) 24 { 25 if(!is_array($IgnoreFiles)) 26 $IgnoreFiles=Array(); 27 28 while (false !== ($file = readdir($handle))) 29 { 30 // if filename isn't '.' '..' or in the Ignore list... load it. 31 if($file != "." && $file != ".." && !in_array($file,$IgnoreFiles)) 32 require_once("$FocusPath/functions/$file"); 33 } 34 } 35 36 // Start Session. 37 session_start(); 38 39 if(!$_SESSION['USERNAME'] && !$_SESSION['STUDENT_ID'] && strpos($_SERVER['PHP_SELF'],'index.php')===false) 40 { 41 header('Location: index.php'); 42 exit; 43 } 44 45 function Warehouse($mode) 46 { global $__SHOW_FOOTER,$_FOCUS; 47 48 switch($mode) 49 { 50 case 'header': 51 echo "<HTML><HEAD><TITLE>Focus/SIS School Software</TITLE>"; 52 if(basename($_SERVER['PHP_SELF'])!='index.php') 53 echo "<noscript><META http-equiv=REFRESH content='0;url=index.php?modfunc=logout&reason=javascript' /></noscript>"; 54 echo "<script language=\"JavaScript\" type=\"text/javascript\">"; 55 if(basename($_SERVER['PHP_SELF'])=='index.php') 56 echo " 57 if(parent.frames.length > 0) 58 { 59 parent.location.href = 'index.php?modfunc=logout'; 60 }"; 61 echo " 62 var locked; 63 function doOnload() 64 { 65 var layer; 66 if(layer = document.getElementById('LOx_layer')) 67 { 68 var right,left = getLeft(1); 69 layer.style.left = left; 70 layer.style.top = 0; 71 document.getElementById('LOx_table').left = left; 72 73 for(i=2;column = document.getElementById('LOx'+i);i++) 74 { 75 right = getLeft(i); 76 document.getElementById('LO_col'+(i-1)).width = right-left-14; 77 left = right; 78 } 79 document.getElementById('LO_col'+(i-2)).width = left-getLeft(i-2)-10; 80 total_width = getLeft(i-1)-getLeft(1) + 7; 81 document.getElementById('LOx_table').width = total_width; 82 if(navigator.userAgent.indexOf('Safari')==-1&&navigator.userAgent.indexOf('Microsoft Internet Explorer')==-1) 83 window.setInterval('doOnscroll()',50); 84 else 85 window.onscroll = doOnscroll; 86 window.onresize = doOnresize; 87 } 88 89 if(layer = document.getElementById('LOy_layer')) 90 { 91 var bottom,top = getTop(1); 92 layer.style.left = getLeft(1); 93 layer.style.top = top; 94 document.getElementById('LOy_table').left = left; 95 96 for(i=2;row = document.getElementById('LOy'+i);i++) 97 { 98 bottom = getTop(i); 99 document.getElementById('LO_row'+(i-1)).height = bottom-top-2; 100 top = bottom; 101 } 102 document.getElementById('LOy_table').width = getLeft(2)-getLeft(1); 103 if(navigator.userAgent.indexOf('Safari')==-1&&navigator.userAgent.indexOf('Microsoft Internet Explorer')==-1) 104 window.setInterval('doOnscroll()',50); 105 else 106 window.onscroll = doOnscroll; 107 window.onresize = doOnresize; 108 } 109 } 110 111 function doOnresize() 112 { 113 doOnload(); 114 doOnscroll(); 115 } 116 117 function doOnscroll() 118 { 119 var layer; 120 if(layer = document.getElementById(\"LOx_layer\")) 121 { 122 var pY = (window.document.body.scrollTop ? window.document.body.scrollTop : window.pageYOffset); 123 if(pY > getListTop()) 124 layer.style.visibility = \"visible\"; 125 else if(pY < getListTop()) 126 layer.style.visibility = \"hidden\"; 127 if(pY) 128 layer.style.top = (window.document.body.scrollTop ? window.document.body.scrollTop : window.pageYOffset); 129 } 130 131 if(layer = document.getElementById(\"LOy_layer\")) 132 { 133 var pX = (window.document.body.scrollLeft ? window.document.body.scrollLeft : window.pageXOffset); 134 if(pX > 0) 135 layer.style.visibility = \"visible\"; 136 else if(pX == 0) 137 layer.style.visibility = \"hidden\"; 138 if(pX) 139 layer.style.left = (window.document.body.scrollLeft ? window.document.body.scrollLeft : window.pageXOffset); 140 } 141 } 142 143 function getLeft(column_number) 144 { 145 var x = 0; 146 if(document.layers) 147 x = document.layers['LOx'+column_number].pageX; 148 else if(document.all || document.getElementById) 149 { 150 var cell = document.all ? document.all['LOx'+column_number] : document.getElementById('LOx'+column_number); 151 while(cell) 152 { 153 x += cell.offsetLeft; 154 cell = cell.offsetParent; 155 } 156 } 157 return x-8; 158 } 159 160 function getTop(row_number) 161 { 162 var y = 0; 163 if(document.layers) 164 y = document.layers['LOy'+row_number].pageY; 165 else if(document.all || document.getElementById) 166 { 167 var cell = document.all ? document.all['LOy'+row_number] : document.getElementById('LOy'+row_number); 168 while(cell) 169 { 170 y += cell.offsetTop; 171 cell = cell.offsetParent; 172 } 173 } 174 return y-8; 175 } 176 177 function getListTop() 178 { 179 var y = 0; 180 if(document.layers) 181 y = document.layers['LOx1'].pageY; 182 else if(document.all || document.getElementById) 183 { 184 var cell = document.all ? document.all['LOx1'] : document.getElementById('LOx1'); 185 while(cell) 186 { 187 y += cell.offsetTop; 188 cell = cell.offsetParent; 189 } 190 } 191 return y; 192 } 193 194 function putFocus() 195 { 196 if(document.forms.length > 0) 197 { 198 document.forms[0].elements[0].focus(); 199 } 200 } 201 202 function addHTML(html,id,replace) 203 { 204 if(locked!=false) 205 { 206 if(replace==true) 207 document.getElementById(id).innerHTML = html; 208 else 209 document.getElementById(id).innerHTML = document.getElementById(id).innerHTML + html; 210 } 211 } 212 213 function changeHTML(show,hide) 214 { 215 for(key in show) 216 document.getElementById(key).innerHTML = document.getElementById(show[key]).innerHTML; 217 for(i=0;i<hide.length;i++) 218 document.getElementById(hide[i]).innerHTML = ''; 219 } 220 221 function checkAll(form,value,name_like) 222 { 223 if(value==true) 224 checked = true; 225 else 226 checked = false; 227 228 for(i=0;i<form.elements.length;i++) 229 { 230 if(form.elements[i].type=='checkbox' && form.elements[i].name!='controller' && form.elements[i].name.substr(0,name_like.length)==name_like) 231 form.elements[i].checked = checked; 232 } 233 } 234 </script> 235 </HEAD> 236 <link rel=stylesheet type=text/css href=assets/themes/".Preferences('THEME')."/stylesheet.css>"; 237 echo ' <link rel="stylesheet" type="text/css" media="all" href="assets/jscalendar/calendar-blue2.css" /> 238 <script type="text/javascript" src="assets/jscalendar/calendar.js"></script> 239 <script type="text/javascript" src="assets/jscalendar/lang/calendar-en.js"></script> 240 <script type="text/javascript" src="assets/jscalendar/calendar-setup.js"></script> 241 <script type="text/javascript" src="assets/tipmessage/main15.js"></script>'; 242 243 break; 244 case "footer": 245 echo '</TD></TR></TABLE>'; 246 247 for($i=1;$i<=$_FOCUS['PrepareDate'];$i++) 248 { 249 echo '<script type="text/javascript"> 250 Calendar.setup({ 251 monthField : "monthSelect'.$i.'", 252 dayField : "daySelect'.$i.'", 253 yearField : "yearSelect'.$i.'", 254 ifFormat : "%d-%b-%y", 255 button : "trigger'.$i.'", 256 align : "Tl", 257 singleClick : true 258 }); 259 </script>'; 260 } 261 echo '</BODY>'; 262 echo '</HTML>'; 263 break; 264 } 265 } 266 } 267 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |