-
Notifications
You must be signed in to change notification settings - Fork 207
/
Warehouse.php
186 lines (152 loc) · 7.4 KB
/
Warehouse.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
#**************************************************************************
# openSIS is a free student information system for public and non-public
# schools from Open Solutions for Education, Inc. web: www.os4ed.com
#
# openSIS is web-based, open source, and comes packed with features that
# include student demographic info, scheduling, grade book, attendance,
# report cards, eligibility, transcripts, parent portal,
# student portal and more.
#
# Visit the openSIS web site at http://www.opensis.com to learn more.
# If you have question regarding this system or the license, please send
# an email to [email protected].
#
# This program is released under the terms of the GNU General Public License as
# published by the Free Software Foundation, version 2 of the License.
# See license.txt.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
if (!defined('WAREHOUSE_PHP')) {
define("WAREHOUSE_PHP", 1);
$staticpath = dirname(__FILE__) . '/';
require_once($staticpath . "ConfigInc.php");
require_once("DatabaseInc.php");
//Create Default Year Picture Folder
// if (!file_exists($StudentPicturesPath)) {
// mkdir($StudentPicturesPath);
// }
// Load functions.
if ($handle = opendir("$openSISPath/functions")) {
if (!is_array($IgnoreFiles))
$IgnoreFiles = Array();
while (false !== ($file = readdir($handle))) {
// if filename isn't '.' '..' or in the Ignore list... load it.
if ($file != "." && $file != ".." && !in_array($file, $IgnoreFiles)) {
if (file_exists("$openSISPath/functions/$file"))
require_once("$openSISPath/functions/$file");
}
}
}
// Start Session.
session_start();
if (!$_SESSION['STAFF_ID'] && !$_SESSION['STUDENT_ID'] && strpos($_SERVER['PHP_SELF'], 'index.php') === false) {
header('Location: index.php');
exit;
}
function Warehouse($mode, $extra = '') {
global $__SHOW_FOOTER, $_openSIS;
switch ($mode) {
case 'header':
echo "<!DOCTYPE html><html lang=\"en\" ".((langDirection()=='rtl')?'dir="rtl"':'dir="ltr')."><head><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">";
echo "<title>" . Config('TITLE') . "</title><link rel=\"shortcut icon\" href=\"favicon.ico\">";
//echo '<link href="assets/css/export_print.css" rel="stylesheet" type="text/css">';
if (basename($_SERVER['PHP_SELF']) != 'index.php' && basename($_SERVER['PHP_SELF']) != 'Ajax.php')
echo "<noscript><meta http-equiv=REFRESH content='0;url=index.php?modfunc=logout&reason=javascript' /></noscript>";
if (basename($_SERVER['PHP_SELF']) == 'index.php')
echo "<noscript><meta http-equiv=REFRESH content='0;url=EnableJavascript.php' /></noscript>";
echo $extra;
echo "<script language=\"JavaScript\" type=\"text/javascript\">";
if (basename($_SERVER['PHP_SELF']) == 'index.php')
echo "if(parent.frames.length > 0){ parent.location.href = 'index.php?modfunc=logout'; }";
echo "function newLoad(){ }
var locked;
function putFocus()
{
if(document.forms.length > 0)
{
document.forms[0].elements[0].focus();
}
}
function addHTML(html,id,replace)
{
if(locked!=false)
{
if(replace==true)
document.getElementById(id).innerHTML = html;
else
document.getElementById(id).innerHTML = document.getElementById(id).innerHTML + html;
}
}
function changeHTML(show,hide)
{
for(key in show)
document.getElementById(key).innerHTML = document.getElementById(show[key]).innerHTML;
for(i=0;i<hide.length;i++)
document.getElementById(hide[i]).innerHTML = '';
}
function checkAll(form,value,name_like)
{
if(value==true)
checked = true;
else
checked = false;
for(i=0;i<form.elements.length;i++)
{
if(form.elements[i].type=='checkbox' && form.elements[i].name!='controller' && form.elements[i].name.substr(0,name_like.length)==name_like)
form.elements[i].checked = checked;
}
}
</script>";
// <link rel='stylesheet' type='text/css' href='styles/Help.css'>";
// echo "<link rel=stylesheet type=text/css href=styles/Calendar.css>";
echo "</head>";
break;
case "footer":
echo '</td></tr></table>';
for ($i = 1; $i <= $_openSIS['PrepareDate']; $i++) {
echo '<script type="text/javascript">
Calendar.setup({
monthField : "monthSelect' . $i . '",
dayField : "daySelect' . $i . '",
yearField : "yearSelect' . $i . '",
ifFormat : "%d-%b-%y",
button : "trigger' . $i . '",
align : "Tl",
singleClick : true
});
</script>';
}
echo '</body>';
echo '</html>';
break;
}
}
}
/*
function checkAll(form,value,name_like)
{
if(value==true)
checked = true;
else
checked = false;
var arr_len=document.getElementById('res_len').value;
var count = document.getElementById('res_length').value;
var stu_list=document.getElementById('res_len').value;
var res_list = stu_list.split(',');
for(i=0;i<count;i++)
{
var check_id = res_list[i];
console.log(check_id);
document.getElementById(check_id).checked = true;
}
}
*/