forked from OS4ED/openSIS-Classic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrepareDataTable.php
161 lines (138 loc) · 5.99 KB
/
PrepareDataTable.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
<?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/>.
#
#***************************************************************************************
error_reporting(0);
include 'Warehouse.php';
include('lang/language.php');
session_start();
if($_REQUEST['loadpage'])
{
foreach($_SESSION['PEGI_MODS'] as $pagemods_key => $pagemods_val)
{
$_REQUEST[$pagemods_key] = $pagemods_val;
}
$loading_page = $_REQUEST['loadpage'];
if($loading_page == 1)
{
$row = 0;
$ini_point = 1;
$end_point = 50;
}
else
{
$row = (($loading_page * 50) - 50);
$ini_point = $row;
$end_point = ($loading_page * 50);
}
if($end_point > $_SESSION['AL_RES_COUNT'])
{
$end_point = $_SESSION['AL_RES_COUNT'];
}
$rowperpage = 50;
$entries_data = array(
"aaIni" => $ini_point,
"aaEnd" => $end_point,
"aaTot" => $_SESSION['AL_RES_COUNT'],
"aaCur" => $loading_page,
"fxRow" => $rowperpage
);
$ListOutputFunc = $_SESSION['LISTOUTPUT_FUNC'];
$extra = $_SESSION['PEGI_EXTRA'];
$extra['LIMIT'] = $row.','.$rowperpage;
if(isset($_SESSION['PEGI_REQUESTS'])) {
foreach($_SESSION['PEGI_REQUESTS'] as $R_key => $R_val) {
$_REQUEST[$R_key] = $R_val;
}
}
if($_SESSION['PEGI_MODS']['modname'] == 'attendance/StudentSummary.php')
{
$students_RET = GetStuList_Absence_Summary($extra);
}
else
{
$students_RET = GetStuList($extra);
}
$res_len_set = '';
foreach($students_RET as $one_stu_data)
{
if(isset($one_stu_data['STUDENT_ID']))
{
$res_len_set .= $one_stu_data['STUDENT_ID'].',';
}
}
$res_len_set = rtrim($res_len_set, ',');
echo "<script>\n";
echo 'var res_length = document.getElementById(\'res_len\');
if(res_length) { res_length.value=\'\'; res_length.value=\''.$res_len_set.'\'; }
var div_selected_cbx = document.getElementById(\'hidden_checkboxes\');
if(div_selected_cbx) { div_selected_cbx.innerHTML = \'\'; }
';
echo "</script>\n";
if($ListOutputFunc != '') {
$ListOutputFunc($students_RET, $_SESSION['PEGI_COLS'], $_SESSION['PEGI_SINGULAR'], $_SESSION['PEGI_PLURAL'], $_SESSION['PEGI_LINK'], $entries_data, $_SESSION['PEGI_LOGRP'], $_SESSION['PEGI_OPTION']);
} else {
echo '<div class="m-20 p-10"><div class="alert alert-styled-left alert-danger"><b>'. _error .':</b> '. _cannotGeneratePagination .'</div></div>';
}
}
// FUNCTIONS LISTED HERE
function _makeChooseCheckbox($value, $title) {
global $THIS_RET;
if($_SESSION['PEGI_MODS']['modname'] == 'grades/ReportCards.php' || $_SESSION['PEGI_MODS']['modname'] == 'scheduling/PrintSchedules.php' || $_SESSION['PEGI_MODS']['modname'] == 'grades/FinalGrades.php' || $_SESSION['PEGI_MODS']['modname'] == 'users/TeacherPrograms.php?include=grades/ProgressReports.php' || $_SESSION['PEGI_MODS']['modname'] == 'grades/ProgressReports.php')
{
return '<INPUT type=checkbox name=st_arr[] value=' . $value . '>';
}
else if($_SESSION['PEGI_MODS']['modname'] == 'attendance/AddAbsences.php' || $_SESSION['PEGI_MODS']['modname'] == 'eligibility/AddActivity.php' || $_SESSION['PEGI_MODS']['modname'] == 'scheduling/MassDrops.php')
{
return "<INPUT type=checkbox name=student[" . $THIS_RET['STUDENT_ID'] . "] value=Y>";
}
else if($_SESSION['PEGI_MODS']['modname'] == 'scheduling/MassSchedule.php' || $_SESSION['PEGI_MODS']['modname'] == 'grades/Transcripts.php')
{
return "<input name=unused[$THIS_RET[STUDENT_ID]] value=" . $THIS_RET[STUDENT_ID] . " type='checkbox' id=$THIS_RET[STUDENT_ID] onClick='setHiddenCheckboxStudents(\"student[$THIS_RET[STUDENT_ID]]\",this,$THIS_RET[STUDENT_ID]);' />";
}
else if($_SESSION['PEGI_MODS']['modname'] == 'scheduling/MassRequests.php')
{
return "<INPUT type=checkbox name=unused[" . $THIS_RET['STUDENT_ID'] . "] value=Y id=$THIS_RET[STUDENT_ID] onClick='setHiddenCheckboxStudents(\"student[$THIS_RET[STUDENT_ID]]\",this,$THIS_RET[STUDENT_ID]);'>";
}
else if($_SESSION['PEGI_MODS']['modname'] == 'students/AssignOtherInfo.php')
{
return "<INPUT type=checkbox name=student[" . $THIS_RET['STUDENT_ID'] . "] value=Y id=$THIS_RET[STUDENT_ID] onClick='setHiddenCheckboxStudents(\"st_arr[]\",this,$THIS_RET[STUDENT_ID]);'>";
}
else
{
return "<input class='student_label_cbx' name=unused[$THIS_RET[STUDENT_ID]] value=" . $THIS_RET[STUDENT_ID] . " type='checkbox' id=$THIS_RET[STUDENT_ID] onClick='setHiddenCheckboxStudents(\"st_arr[]\",this,$THIS_RET[STUDENT_ID]);' />";
}
}
function _makeStateValue($value) {
global $THIS_RET, $date;
if ($value == '0.0')
return 'None';
elseif ($value == '.5')
return 'Half-Day';
else
return 'Full-Day';
}
?>