-
Notifications
You must be signed in to change notification settings - Fork 1
/
Modules.php
executable file
·1330 lines (1131 loc) · 70.3 KB
/
Modules.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?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 info@os4ed.com.
#
# 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('Redirect_root.php');
include("functions/ParamLib.php");
$url=validateQueryString(curPageURL());
if($url===FALSE){
header('Location: index.php');
}
$isajax="modules";
//$btn = $_REQUEST['btn'];
$btn = optional_param('btn','',PARAM_ALPHA);
if($btn == 'Update' || $btn == ''){
$btn = 'old';
}
$nsc = optional_param('nsc','',PARAM_SPCL);
if($_REQUEST['new_school']!='true')
//if(optional_param('new_school','',PARAM_NOTAGS)!='true')
{
$ns = "NT";
}
else
{
$ns = "TT";
}
$handle=opendir("js");
while ($file = readdir($handle)) {
$filelst = "$filelst,$file";
}
closedir($handle);
$filelist = explode(",",$filelst);
if(count($filelist)>3)
{
for ($count=1;$count<count($filelist);$count++) {
$filename=$filelist[$count];
if(($filename != ".") && ($filename != "..") && ($filename!=""))
echo "<script src='js/".$filename."'></script>";
}
}
echo "<script type='text/javascript'>
function changeColors(){
var aTags = document.getElementsByTagName(\"a\");
for(i=0;i<aTags.length;i++){
if(document.getElementsByTagName('a')[i].id=='hm')
document.getElementsByTagName('a')[i].className = 'submenuitem';
}
}
</script>";
error_reporting(1);
//error_reporting(E_ALL); // uncomment this to view error on page
$start_time = time();
include 'Warehouse.php';
$old_school = UserSchool();
$old_syear = UserSyear();
///Newly added
//if((!$_SESSION['UserMP'] || ($_REQUEST['school'] && $_REQUEST['school'] != $old_school) || ($_REQUEST['syear'] && $_REQUEST['syear'] != $old_syear)) && User('PROFILE')!='parent')
if((!$_SESSION['UserMP'] || (optional_param('school','',PARAM_SPCL) && optional_param('school','',PARAM_SPCL) != $old_school) || (optional_param('syear',0,PARAM_SPCL) && optional_param('syear',0,PARAM_SPCL) != $old_syear)) && User('PROFILE')!='parent')
$_SESSION['UserMP'] = GetCurrentMP('QTR',DBDate());
//// Newly added
array_rwalk($_REQUEST,'strip_tags');
if(!isset($_REQUEST['_openSIS_PDF']))
{
Warehouse('header');
$css = trim(getCSS());
echo "<link rel='stylesheet' type='text/css' href='themes/".trim($css)."/".trim($css).".css'>";
echo "<link rel='stylesheet' type='text/css' href='styles/help.css'>";
if(strpos($_REQUEST['modname'],'misc/')===false)
echo '<script language="JavaScript">if(window == top && (!window.opener || window.opener.location.href.substring(0,(window.opener.location.href.indexOf("&")!=-1?window.opener.location.href.indexOf("&"):window.opener.location.href.replace("#","").length))!=window.location.href.substring(0,(window.location.href.indexOf("&")!=-1?window.location.href.indexOf("&"):window.location.href.replace("#","").length)))) window.location.href = "index.php";</script>';
echo "<BODY onload='newLoad()' style='overflow-x:hidden; min-windth:900px;'>";
}
//if(!$_SESSION['UserSchool'])
//{
// if(User('PROFILE')=='admin' && (!User('SCHOOLS') || strpos(User('SCHOOLS'),','.User('CURRENT_SCHOOL_ID').',')!==false))
// $_SESSION['UserSchool'] = User('CURRENT_SCHOOL_ID');
// elseif(User('PROFILE')=='student')
// $_SESSION['UserSchool'] = trim(User('SCHOOLS'),',');
////}
// elseif(User('PROFILE')=='teacher')
// {
//// $mp = GetAllMP('QTR',UserMP());
//// if(!isset($mp))
//// $mp = GetAllMP('SEM',UserMP());
//// if(!isset($mp))
//// $mp = GetAllMP('FY',UserMP());
//// $QI = DBQuery("SELECT cp.SCHOOL_ID FROM course_periods cp, school_periods sp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR='".UserSyear()."' AND cp.TEACHER_ID='".User('STAFF_ID')."''".(UserMP()?' AND cp.MARKING_PERIOD_ID IN ('.$mp.')':'')."' ORDER BY sp.SORT_ORDER LIMIT 1");
// $QI = DBQuery("SELECT cp.SCHOOL_ID FROM course_periods cp, school_periods sp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR='".UserSyear()."' AND (cp.TEACHER_ID='".User('STAFF_ID')."' OR cp.SECONDARY_TEACHER_ID='".User('STAFF_ID')."') ORDER BY sp.SORT_ORDER LIMIT 1");
// $RET = DBGet($QI);
// $_SESSION['UserSchool'] = $RET[1]['SCHOOL_ID'];
// }
//}
echo "
<center>
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"wrapper\">
<tr>
<td ><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td class=\"banner\" valign=\"top\"><table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align=\"left\"> </td>
<td align=\"right\"><div class=\"user_info\">".date('l F j, Y')." | ".User('NAME')." | <a href='index.php?modfunc=logout' class='logout'>Log Out</a>";
/****************************************************************************************/
if(User('PROFILE')=='teacher')
{
echo "<br /><br />
<table cellspacing=\"0\"><tr><td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns&act=school method=POST><INPUT type=hidden name=modcat value='' id=modcat_input>";
$RET= DBGet(DBQuery('SELECT s.ID,s.TITLE FROM schools s,staff st INNER JOIN staff_school_relationship ssr USING(staff_id) WHERE s.id=ssr.school_id AND ssr.syear=\''.UserSyear().'\' AND st.staff_id=\''.$_SESSION[STAFF_ID].'\' AND (ssr.END_DATE>=curdate() OR ssr.END_DATE=\'0000-00-00\')'));
echo "<SELECT name=school onChange='this.form.submit();'>";
foreach($RET as $school){
echo "<OPTION style='padding-right:8px;' value=$school[ID]".((UserSchool()==$school['ID'])?' SELECTED':'').">".$school['TITLE']."</OPTION>";
}
echo "</SELECT>";
//===================================================================================================
echo "</FORM></td><td></td>";
echo "<td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns&act=syear method=POST><INPUT type=hidden name=modcat value='' id=modcat_input>";
$school_years_RET=DBGet(DBQuery("SELECT YEAR(sy.START_DATE)AS START_DATE,YEAR(sy.END_DATE)AS END_DATE FROM school_years sy,staff st INNER JOIN staff_school_relationship ssr USING(staff_id) WHERE ssr.SYEAR=sy.SYEAR AND sy.school_id=ssr.school_id AND sy.school_id=".UserSchool()." AND st.staff_id=$_SESSION[STAFF_ID]"));
echo "<SELECT name=syear onChange='this.form.submit();' style='width:80;'>";
foreach($school_years_RET as $school_years)
{
echo "<OPTION value=$school_years[START_DATE]".((UserSyear()==$school_years['START_DATE'])?' SELECTED':'').">$school_years[START_DATE]".($school_years[END_DATE]!=$school_years[START_DATE]? "-".$school_years['END_DATE']:'').'</OPTION>';
}
echo '</SELECT>';
echo "</FORM></td><td></td>";
echo "<td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns&act=mp method=POST><INPUT type=hidden name=modcat value='' id=modcat_input>";
$RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE FROM school_quarters WHERE SCHOOL_ID='".UserSchool()."' AND SYEAR='".UserSyear()."' ORDER BY SORT_ORDER"));
if(!isset($_SESSION['UserMP']))
{
$_SESSION['UserMP'] = GetCurrentMP('QTR',DBDate());
$allMP='QTR';
}
if(!$RET)
{
$RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE FROM school_semesters WHERE SCHOOL_ID='".UserSchool()."' AND SYEAR='".UserSyear()."' ORDER BY SORT_ORDER"));
if(!isset($_SESSION['UserMP']))
{
$_SESSION['UserMP'] = GetCurrentMP('SEM',DBDate());
$allMP='SEM';
}
}
if(!$RET)
{
$RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE FROM school_years WHERE SCHOOL_ID='".UserSchool()."' AND SYEAR='".UserSyear()."' ORDER BY SORT_ORDER"));
if(!isset($_SESSION['UserMP']))
{
$_SESSION['UserMP'] = GetCurrentMP('FY',DBDate());
$allMP='FY';
}
}
#print_r($RET);
echo "<SELECT name=mp onChange='this.form.submit();'>";
if(count($RET))
{
if(!UserMP())
$_SESSION['UserMP'] = $RET[1]['MARKING_PERIOD_ID'];
#print_r($RET);
foreach($RET as $quarter)
{
echo "<OPTION value=$quarter[MARKING_PERIOD_ID]".(UserMP()==$quarter['MARKING_PERIOD_ID']?' SELECTED':'').">".$quarter['TITLE']."</OPTION>";
}
}
echo "</SELECT>";
//Marking Period
echo '</FORM></td></tr>';
echo '</table>';
echo '<table cellspacing=\"0\">';
echo '<tr><td style="color:#fff;">Subject</td><td></td>
<td style="color:#fff">Course</td><td></td>
<td style="color:#fff">Course Period</td></tr>';
echo "<tr><td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns&act=subject method=POST><INPUT type=hidden name=modcat value='' id=modcat_input>";
$sub = DBQuery("SELECT DISTINCT cs.TITLE, cs.SUBJECT_ID,cs.SCHOOL_ID FROM course_subjects as cs,course_details as cd WHERE cs.SUBJECT_ID=cd.SUBJECT_ID AND cd.SYEAR='".UserSyear()."' AND (cd.TEACHER_ID='".User('STAFF_ID')."' OR cd.SECONDARY_TEACHER_ID='".User('STAFF_ID')."') AND cs.SCHOOL_ID='".UserSchool()."' AND cd.MARKING_PERIOD_ID IN (".GetAllMP($allMP,UserMP()).")");
$RET = DBGet($sub);
if(!UserSubject()){
$_SESSION['UserSubject']=$RET[1]['SUBJECT_ID'];
}
echo "<SELECT name=subject onChange='this.form.submit();'>";
if(count($RET)>0)
{
foreach($RET as $subject){
echo "<OPTION id=$subject[SUBJECT_ID] value=$subject[SUBJECT_ID]".((UserSubject()==$subject['SUBJECT_ID'])?' SELECTED':'').">".$subject['TITLE']."</OPTION>";
}
}
else
{
echo '<OPTION value="">n/a</OPTION>';
}
echo "</SELECT>";
//===================================================================================================
echo "</FORM></td><td></td>";
echo "<td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns&act=course method=POST><INPUT type=hidden name=modcat value='' id=modcat_input>";
$course = DBQuery("SELECT DISTINCT cd.COURSE_TITLE, cd.COURSE_ID,cd.SUBJECT_ID,cd.SCHOOL_ID FROM course_details cd WHERE (cd.TEACHER_ID='".User('STAFF_ID')."' OR cd.SECONDARY_TEACHER_ID='".User('STAFF_ID')."') AND cd.SYEAR='".UserSyear()."' AND cd.SCHOOL_ID='".UserSchool()."' AND cd.SUBJECT_ID='".UserSubject()."' AND cd.MARKING_PERIOD_ID IN (".GetAllMP($allMP,UserMP()).")");
$RET = DBGet($course);
if(!UserCourse()){
$_SESSION['UserCourse']=$RET[1]['COURSE_ID'];
}
echo "<SELECT name=course onChange='this.form.submit();'>";
if(count($RET)>0)
{
foreach($RET as $course){
echo "<OPTION id=$course[COURSE_ID] value=$course[COURSE_ID]".((UserCourse()==$course['COURSE_ID'])?' SELECTED':'').">".$course['COURSE_TITLE']."</OPTION>";
}
}
else
{
echo '<OPTION value="">n/a</OPTION>';
}
echo "</SELECT>";
//===================================================================================================
echo "</FORM></td><td></td>";
echo "<td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns&act=period method=POST><INPUT type=hidden name=modcat value='' id=modcat_input>";
//$QI = DBQuery("SELECT DISTINCT cp.PERIOD_ID,cp.COURSE_PERIOD_ID,sp.TITLE,sp.SHORT_NAME,c.SUBJECT_ID,cp.MARKING_PERIOD_ID,cp.DAYS,cp.SCHOOL_ID,sp.SORT_ORDER,c.TITLE AS COURSE_TITLE FROM course_periods cp, school_periods sp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR='".UserSyear()."' AND cp.TEACHER_ID='".User('STAFF_ID')."' AND cp.SCHOOL_ID='".UserSchool()."' AND c.SUBJECT_ID='".UserSubject()."' AND cp.COURSE_ID='".UserCourse()."' ORDER BY sp.SORT_ORDER ");
$QI = DBQuery("SELECT cp.COURSE_PERIOD_ID,cp.COURSE_ID,cp.TITLE,cp.SCHOOL_ID,cpv.PERIOD_ID FROM course_periods cp,course_period_var cpv WHERE cp.SYEAR='".UserSyear()."' AND cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID AND cp.SCHOOL_ID='".UserSchool()."' AND cp.COURSE_ID='".UserCourse()."' AND (TEACHER_ID='".User('STAFF_ID')."' OR SECONDARY_TEACHER_ID='".User('STAFF_ID')."') AND MARKING_PERIOD_ID IN (".GetAllMP($allMP,UserMP()).")");
$RET = DBGet($QI);
$fy_id = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM school_years WHERE SYEAR='".UserSyear()."' AND SCHOOL_ID='".UserSchool()."'"));
$fy_id = $fy_id[1]['MARKING_PERIOD_ID'];
if(!UserCoursePeriod()){
$_SESSION['UserCoursePeriod'] = $RET[1]['COURSE_PERIOD_ID'];
}
echo "<SELECT name=period onChange='this.form.submit();'>";
if(count($RET)>0)
{
foreach($RET as $period)
{
echo "<OPTION id=$period[COURSE_PERIOD_ID] value=$period[COURSE_PERIOD_ID]".((UserCoursePeriod()==$period['COURSE_PERIOD_ID'])?' SELECTED':'').">".$period['TITLE']."</OPTION>";
if(UserCoursePeriod()==$period['COURSE_PERIOD_ID'])
{
$_SESSION['UserPeriod'] = $period['PERIOD_ID'];
$_SESSION['UserCoursePeriod'] = $period['COURSE_PERIOD_ID'];
}
}
}
else
{
echo '<OPTION value="">n/a</OPTION>';
}
echo "</SELECT>";
echo "</FORM></td>";
echo '</tr></table></div>';
echo "</td></tr></table></td></tr>";
} ##################Only for Teacher End##################
if(User('PROFILE')!='teacher')
{
echo "<br><br><table cellpadding=2 cellspacing=0><tr><td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns method=POST>
<INPUT type=hidden name=modcat value='' id=modcat_input>
";
if(User('PROFILE')=='admin')
{
// $schools = substr(str_replace(",","','",User('SCHOOLS')),2,-2);
// #$QI = DBQuery("SELECT ID,TITLE FROM schools ORDER BY ID DESC".($schools?" WHERE ID IN ($schools)":''));
// $QI = DBQuery("SELECT ID,TITLE FROM schools ORDER BY ID DESC");
//
// // ---------------------------- School id start ----------------------------------------------------------------- //
// $staff = $_SESSION['STAFF_ID'];
// $sid = DBGet(DBQuery("SELECT SCHOOLS FROM staff WHERE STAFF_ID = $staff"));
// $sch = $sid[1]['SCHOOLS'];
// $count = substr_count( $sch, ',' );
// $prv_count = $count - 1;
// $sids = explode(",", $sch);
// // ----------------------------- School id end ------------------------------------------------------------------ //
//
// $schools = substr(str_replace(",","','",User('SCHOOLS')),2,-2);
// $sql_school = "SELECT ID,TITLE FROM schools WHERE ";
// for($i=1; $i<$prv_count; $i++)
// $sql_school.="ID=$sids[$i] or ";
//
// $sql_school.="ID=$sids[$prv_count] ORDER BY ID DESC";
//
// $QI = DBQuery($sql_school);
// $RET = DBGet($QI);
// if(!UserSchool())
// {
// $_SESSION['UserSchool'] = $RET[1]['ID'];
// DBQuery("UPDATE staff SET CURRENT_SCHOOL_ID='".UserSchool()."' WHERE STAFF_ID='".User('STAFF_ID')."'");
// }
// if(!UserSchool())
// {
// $_SESSION['UserSchool'] = $RET[1]['ID'];
// DBQuery("UPDATE staff SET CURRENT_SCHOOL_ID='".UserSchool()."' WHERE STAFF_ID='".User('STAFF_ID')."'");
// }
$RET= DBGet(DBQuery("SELECT DISTINCT s.ID,s.TITLE FROM schools s,staff st INNER JOIN staff_school_relationship ssr USING(staff_id) WHERE s.id=ssr.school_id AND st.staff_id=$_SESSION[STAFF_ID] ORDER BY s.TITLE asc"));
echo "<SELECT name=school onChange='this.form.submit();'>";
foreach($RET as $school)
echo "<OPTION style='padding-right:8px;' value=$school[ID]".((UserSchool()==$school['ID'])?' SELECTED':'').">".$school['TITLE']."</OPTION>";
echo "</SELECT> ";
}
//if(1)
//{
// if(User('PROFILE')!='student')
// $sql = "SELECT DISTINCT sy.SYEAR FROM school_years sy,staff s WHERE s.SYEAR=sy.SYEAR AND s.USERNAME=(SELECT USERNAME FROM staff WHERE STAFF_ID='$_SESSION[STAFF_ID]')";
// else
// $sql = "SELECT DISTINCT sy.SYEAR FROM school_years sy,student_enrollment se WHERE se.SYEAR=sy.SYEAR AND se.STUDENT_ID='$_SESSION[STUDENT_ID]'";
// $years_RET = DBGet(DBQuery($sql));
//}
//else
// echo $years_RET = array(1=>array('SYEAR'=>"$DefaultSyear"));
if(User('PROFILE')=='parent')
{
$RET = DBGet(DBQuery("SELECT sju.STUDENT_ID, se.SCHOOL_ID FROM students s,students_join_people sju, student_enrollment se WHERE s.STUDENT_ID=sju.STUDENT_ID AND sju.PERSON_ID='".User('STAFF_ID')."' AND se.SYEAR=".UserSyear()." AND se.STUDENT_ID=sju.STUDENT_ID AND (('".DBDate()."' BETWEEN se.START_DATE AND se.END_DATE OR se.END_DATE IS NULL) AND '".DBDate()."'>=se.START_DATE)"));
foreach($RET as $student)
$_SESSION['UserSchool'] = $student['SCHOOL_ID'];
}
if(User('PROFILE')=='parent' || User('PROFILE')=='teacher')
{
if(!$_SESSION['UserSchool'])
{
$sch_id = DBGet(DBQuery("SELECT CURRENT_SCHOOL_ID FROM staff WHERE STAFF_ID='".User('STAFF_ID')."'"));
$sch_id = $sch_id[1]['CURRENT_SCHOOL_ID'];
$_SESSION['UserSchool'] = $sch_id;
}
}
echo '</FORM></td>';
echo "<td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns method=POST>
<INPUT type=hidden name=modcat value='' id=modcat_input>";
#if(User('PROFILE')=='admin')
#{
$school_years_RET1=DBGet(DBQuery("SELECT START_DATE,END_DATE FROM school_years WHERE SCHOOL_ID=".UserSchool()));
$school_years_RET1=$school_years_RET1[1];
$school_years_RET1['START_DATE']=explode("-",$school_years_RET1['START_DATE']);
$school_years_RET1['START_DATE']=$school_years_RET1['START_DATE'][0];
$school_years_RET1['END_DATE']=explode("-",$school_years_RET1['END_DATE']);
$school_years_RET1['END_DATE']=$school_years_RET1['END_DATE'][0];
echo "<SELECT name=syear onChange='this.form.submit();'>";
#foreach($years_RET as $year)
# {
//if($school_years_RET1['END_DATE']==$school_years_RET1['START_DATE']+1)
if($school_years_RET1['END_DATE']>$school_years_RET1['START_DATE'])
{
if(User('PROFILE')=='student'){
$school_years_RET=DBGet(DBQuery("SELECT DISTINCT sy.START_DATE,sy.END_DATE FROM school_years sy,student_enrollment se WHERE se.SYEAR=sy.SYEAR AND se.STUDENT_ID='$_SESSION[STUDENT_ID]' AND sy.SCHOOL_ID=".UserSchool()." "));
}
elseif(User('PROFILE')=='parent'){
if(UserStudentID()=='')
{
$stu_ID=DBGet(DBQuery("SELECT sju.STUDENT_ID,CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME,se.SCHOOL_ID FROM students s,students_join_people sju, student_enrollment se WHERE s.STUDENT_ID=sju.STUDENT_ID AND sju.PERSON_ID='".User('STAFF_ID')."' AND se.SYEAR=".UserSyear()." AND se.STUDENT_ID=sju.STUDENT_ID AND (('".DBDate()."' BETWEEN se.START_DATE AND se.END_DATE OR se.END_DATE IS NULL) AND '".DBDate()."'>=se.START_DATE)"));
$stu_ID=$stu_ID[1]['STUDENT_ID'];
}
else
$stu_ID=UserStudentID();
$school_years_RET=DBGet(DBQuery("SELECT DISTINCT sy.START_DATE,sy.END_DATE FROM school_years sy,student_enrollment se WHERE se.SYEAR=sy.SYEAR AND se.STUDENT_ID=".$stu_ID." AND sy.SCHOOL_ID=".UserSchool()." "));
}
else{
$school_years_RET=DBGet(DBQuery("SELECT sy.START_DATE,sy.END_DATE FROM school_years sy ,staff s INNER JOIN staff_school_relationship ssr ON s.staff_id=ssr.staff_id WHERE sy.school_id=ssr.school_id AND sy.syear=ssr.syear AND sy.SCHOOL_ID=".UserSchool()." AND s.staff_id='$_SESSION[STAFF_ID]'"));
}
foreach($school_years_RET as $school_years)
{
$school_years['START_DATE']=explode("-",$school_years['START_DATE']);
$school_years['START_DATE']=$school_years['START_DATE'][0];
$school_years['END_DATE']=explode("-",$school_years['END_DATE']);
$school_years['END_DATE']=$school_years['END_DATE'][0];
echo "<OPTION value=$school_years[START_DATE]".((UserSyear()==$school_years['START_DATE'])?' SELECTED':'')."> $school_years[START_DATE]-".($school_years['END_DATE'])."</OPTION>";
}
}
else if($school_years_RET1['END_DATE']==$school_years_RET1['START_DATE'])
{
if(User('PROFILE')=='student')
$school_years_RET=DBGet(DBQuery("SELECT DISTINCT sy.START_DATE,sy.END_DATE FROM school_years sy,student_enrollment se WHERE se.SYEAR=sy.SYEAR AND se.STUDENT_ID='$_SESSION[STUDENT_ID]' AND sy.SCHOOL_ID=".UserSchool()." "));
elseif(User('PROFILE')=='parent'){
if(UserStudentID()=='')
{
$stu_ID=DBGet(DBQuery("SELECT sju.STUDENT_ID,CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME,se.SCHOOL_ID FROM students s,students_join_people sju, student_enrollment se WHERE s.STUDENT_ID=sju.STUDENT_ID AND sju.PERSON_ID='".User('STAFF_ID')."' AND se.SYEAR=".UserSyear()." AND se.STUDENT_ID=sju.STUDENT_ID AND (('".DBDate()."' BETWEEN se.START_DATE AND se.END_DATE OR se.END_DATE IS NULL) AND '".DBDate()."'>=se.START_DATE)"));
$stu_ID=$stu_ID[1]['STUDENT_ID'];
}
else
$stu_ID=UserStudentID();
$school_years_RET=DBGet(DBQuery("SELECT DISTINCT sy.START_DATE,sy.END_DATE FROM school_years sy,student_enrollment se WHERE se.SYEAR=sy.SYEAR AND se.STUDENT_ID=".$stu_ID." AND sy.SCHOOL_ID=".UserSchool()." "));
}
else
{
if(UserSchool())
$school_years_RET=DBGet(DBQuery("SELECT sy.START_DATE,sy.END_DATE FROM school_years sy ,staff s INNER JOIN staff_school_relationship ssr ON s.staff_id=ssr.staff_id WHERE sy.school_id=ssr.school_id AND sy.syear=ssr.syear AND sy.SCHOOL_ID=".UserSchool()." AND s.staff_id='$_SESSION[STAFF_ID]'"));
else
$school_years_RET=DBGet(DBQuery("SELECT sy.START_DATE,sy.END_DATE FROM school_years sy ,staff s WHERE s.SYEAR=sy.SYEAR AND s.USERNAME=(SELECT USERNAME FROM staff WHERE STAFF_ID='$_SESSION[STAFF_ID]')"));
}
foreach($school_years_RET as $school_years)
{
$school_years['START_DATE']=explode("-",$school_years['START_DATE']);
$school_years_RET['START_DATE']=$school_years['START_DATE'][0];
echo "<OPTION value=$school_years_RET[START_DATE]".((UserSyear()==$school_years_RET['START_DATE'])?' SELECTED':'').">$school_years_RET[START_DATE]</OPTION>";
}
}
#}
echo '</SELECT> ';
echo '</FORM></td>';
echo "<td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns method=POST>
<INPUT type=hidden name=modcat value='' id=modcat_input>";
if(User('PROFILE')=='parent')
{
$RET = DBGet(DBQuery("SELECT sju.STUDENT_ID,CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME,se.SCHOOL_ID FROM students s,students_join_people sju, student_enrollment se WHERE s.STUDENT_ID=sju.STUDENT_ID AND sju.PERSON_ID='".User('STAFF_ID')."' AND se.SYEAR=".UserSyear()." AND se.STUDENT_ID=sju.STUDENT_ID AND (('".DBDate()."' BETWEEN se.START_DATE AND se.END_DATE OR se.END_DATE IS NULL) AND '".DBDate()."'>=se.START_DATE)"));
if(!UserStudentID())
$_SESSION['student_id'] = $RET[1]['STUDENT_ID'];
echo "<SELECT name=student_id onChange='this.form.submit();'>";
if(count($RET))
{
foreach($RET as $student)
{
echo "<OPTION value=$student[STUDENT_ID]".((UserStudentID()==$student['STUDENT_ID'])?' SELECTED':'').">".$student['FULL_NAME']."</OPTION>";
if(UserStudentID()==$student['STUDENT_ID'])
$_SESSION['UserSchool'] = $student['SCHOOL_ID'];
}
}
echo "</SELECT> ";
if(!UserMP())
$_SESSION['UserMP'] = GetCurrentMP('QTR',DBDate());
}
echo '</FORM></td>';
// if(User('PROFILE')=='teacher')
// {
// //if(UserMP())
// // $QI = DBQuery("SELECT DISTINCT cp.PERIOD_ID,cp.COURSE_PERIOD_ID,sp.TITLE,sp.SHORT_NAME,cp.MARKING_PERIOD_ID,cp.DAYS,cp.SCHOOL_ID,sp.SORT_ORDER,c.TITLE AS COURSE_TITLE FROM course_periods cp, school_periods sp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR='".UserSyear()."' AND cp.TEACHER_ID='".User('STAFF_ID')."' AND cp.MARKING_PERIOD_ID IN (".GetAllMP('QTR',UserMP()).") ORDER BY sp.SORT_ORDER ");
// //else
// $QI = DBQuery("SELECT DISTINCT cp.PERIOD_ID,cp.COURSE_PERIOD_ID,sp.TITLE,sp.SHORT_NAME,cp.MARKING_PERIOD_ID,cp.DAYS,cp.SCHOOL_ID,sp.SORT_ORDER,c.TITLE AS COURSE_TITLE FROM course_periods cp, school_periods sp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR='".UserSyear()."' AND cp.TEACHER_ID='".User('STAFF_ID')."' ORDER BY sp.SORT_ORDER ");
// $RET = DBGet($QI);
// // get the fy marking period id, there should be exactly one fy marking period
// $fy_id = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM school_years WHERE SYEAR='".UserSyear()."' AND SCHOOL_ID='".UserSchool()."'"));
// $fy_id = $fy_id[1]['MARKING_PERIOD_ID'];
//
// if(!UserPeriod())
// $_SESSION['UserPeriod'] = $RET[1]['PERIOD_ID'];
// if(!UserCoursePeriod())
// $_SESSION['UserCoursePeriod'] = $RET[1]['COURSE_PERIOD_ID'];
//
// echo "<SELECT name=period onChange='document.forms[0].submit();'>";
// foreach($RET as $period)
// {
// echo "<OPTION id=$period[COURSE_PERIOD_ID] value=$period[COURSE_PERIOD_ID]".((UserCoursePeriod()==$period['COURSE_PERIOD_ID'])?' SELECTED':'').">".$period['SHORT_NAME'].($period['MARKING_PERIOD_ID']!=$fy_id?' '.GetMP($period['MARKING_PERIOD_ID'],'SHORT_NAME'):'').(strlen($period['DAYS'])<5?' '.$period['DAYS']:'').' - '.$period['COURSE_TITLE']."</OPTION>";
// if(UserCoursePeriod()==$period['COURSE_PERIOD_ID'])
// {
// #if($period['SCHOOL_ID']!=UserSchool())
// # unset($_SESSION['UserMP']);
// $_SESSION['UserSchool'] = $period['SCHOOL_ID'];
// $_SESSION['UserPeriod'] = $period['PERIOD_ID'];
// }
// }
// echo "</SELECT> ";
// }
//For Marking Period
echo "<td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn=$btn&nsc=$ns method=POST>
<INPUT type=hidden name=modcat value='' id=modcat_input>";
$RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE FROM school_quarters WHERE SCHOOL_ID='".UserSchool()."' AND SYEAR='".UserSyear()."' ORDER BY SORT_ORDER"));
if(!isset($_SESSION['UserMP']))
$_SESSION['UserMP'] = GetCurrentMP('QTR',DBDate());
if(!$RET)
{
$RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE FROM school_semesters WHERE SCHOOL_ID='".UserSchool()."' AND SYEAR='".UserSyear()."' ORDER BY SORT_ORDER"));
if(!isset($_SESSION['UserMP']))
$_SESSION['UserMP'] = GetCurrentMP('SEM',DBDate());
}
if(!$RET)
{
$RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE FROM school_years WHERE SCHOOL_ID='".UserSchool()."' AND SYEAR='".UserSyear()."' ORDER BY SORT_ORDER"));
if(!isset($_SESSION['UserMP']))
$_SESSION['UserMP'] = GetCurrentMP('FY',DBDate());
}
#print_r($RET);
echo "<SELECT name=mp onChange='this.form.submit();'>";
if(count($RET))
{
if(!UserMP())
$_SESSION['UserMP'] = $RET[1]['MARKING_PERIOD_ID'];
foreach($RET as $quarter)
echo "<OPTION value=$quarter[MARKING_PERIOD_ID]".(UserMP()==$quarter['MARKING_PERIOD_ID']?' SELECTED':'').">".$quarter['TITLE']."</OPTION>";
}
echo "</SELECT>";
//Marking Period
echo '</FORM></td></tr></table></div>';
echo "</td></tr></table></td></tr>";
}##################Porfile Not Teacher End##########################################
if(UserStudentID() && User('PROFILE')!='parent' && User('PROFILE')!='student')
{
$RET = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME,MIDDLE_NAME,NAME_SUFFIX FROM students WHERE STUDENT_ID='".UserStudentID()."'"));
}
if(UserStaffID() && User('PROFILE')=='admin')
{
if(UserStudentID())
$RET = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME FROM staff WHERE STAFF_ID='".UserStaffID()."'"));
}
echo "
<tr>
<td class=\"content\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td align=\"center\" ><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"content_wrapper\">
<tr>
<td class=\"menubar\" style='padding-left:20px; padding-right:20px;'>";
#------------------------------------------------------------ menu Scroller _---------------------------------------------
echo " <div class='scrollable'>
<div id='cdnavheader'>
<ul id='thumbs'>
";
#------------------------------------------------------------ menu Scroller ends _---------------------------------------------
require('Menu.php');
echo "<li><a style='cursor:hand;' href='#' onmouseup='check_content(\"ajax.php?modname=misc/Portal.php\");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"Home\";document.getElementById(\"cframe\").src = \"Bottom.php?modcat=home\"'><span>" ."Home". "</span></a></li>";
foreach($_openSIS['Menu'] as $modcat=>$programs)
{
if(count($_openSIS['Menu'][$modcat]))
{
$keys = array_keys($_openSIS['Menu'][$modcat]);
$menu = false;
foreach($keys as $key_index=>$file)
{
if(!is_numeric($file))
$menu = true;
}
if(!$menu)
continue;
if(User('PROFILE')!='admin' && $modcat=="School_Setup")
{
echo "<li><a style='cursor:hand;' HREF=# onmouseup='check_content(\"ajax.php?modname=$modcat/Search.php\");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)."\";document.getElementById(\"cframe\").src = \"Bottom.php?modcat=".$modcat."\"'><span>School Info</span></a></li>";
}
elseif(User('PROFILE')!='admin' && $modcat=="Users")
{
echo "<li><a style='cursor:hand;' HREF=# onmouseup='check_content(\"ajax.php?modname=$modcat/Search.php\");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)."\";document.getElementById(\"cframe\").src = \"Bottom.php?modcat=".$modcat."\"'><span>My Info</span></a></li>";
}
elseif(User('PROFILE')=='student' && $modcat=="Students")
{
echo "<li><a style='cursor:hand;' HREF=# onmouseup='check_content(\"ajax.php?modname=$modcat/Search.php\");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)."\";document.getElementById(\"cframe\").src = \"Bottom.php?modcat=".$modcat."\"'><span>My Info</span></a></li>";
}
elseif(User('PROFILE')=='student' && $modcat=="Scheduling")
{
echo "<li><a style='cursor:hand;' HREF=# onmouseup='check_content(\"ajax.php?modname=$modcat/Search.php\");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)."\";document.getElementById(\"cframe\").src = \"Bottom.php?modcat=".$modcat."\"'><span>Schedule</span></a></li>";
}
elseif($modcat=="Messaging")
{
echo "<li><a style='cursor:hand;' HREF=# onmouseup='check_content(\"ajax.php?modname=$modcat/Inbox.php\");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)."\";document.getElementById(\"cframe\").src = \"Bottom.php?modcat=".$modcat."\"'><span>Messaging</span></a></li>";
}
else
{
if($modcat=='Eligibility')
echo "<li><a style='cursor:hand;' HREF=# onmouseup='check_content(\"ajax.php?modname=$modcat/Search.php\");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"Extracurricular\";document.getElementById(\"cframe\").src = \"Bottom.php?modcat=".$modcat."\"'><span>Extracurricular</span></a></li>";
else
echo "<li><a style='cursor:hand;' HREF=# onmouseup='check_content(\"ajax.php?modname=$modcat/Search.php\");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)."\";document.getElementById(\"cframe\").src = \"Bottom.php?modcat=".$modcat."\"'><span>".str_replace('_',' ',$modcat)."</span></a></li>";
}
}
}
#------------------------------------------------------------ menu Scroller _---------------------------------------------
echo"</ul></div></div>";
echo " </td></tr>";
#------------------------------------------------------------ menu Scroller ends _---------------------------------------------
echo "<tr>
<td class=\"submenubar_bg\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td class=\"submenubar\" style='padding-left:10px; padding-right:10px;'>";
echo "<div id='submenu_1' style='display:none;'>
<table cellspacing=0 celpadding=0 border=0 width=100%><tr><td width=60% valign=middle class='welcome'><b>Welcome to openSIS Student Information System</b></td><td width=40% class='version'>Version : ".$openSISVersion." | Release Date : ".$builddate."</td></tr></table>
</div>";
$i = 2;
foreach($_openSIS['Menu'] as $modcat=>$programs)
{
if(count($_openSIS['Menu'][$modcat]))
{
$keys = array_keys($_openSIS['Menu'][$modcat]);
$menu = false;
foreach($keys as $key_index=>$file)
{
if(!is_numeric($file))
$menu = true;
}
if(!$menu)
continue;
echo "<div id='submenu_".$i."' style='display:none'>";
$int=0;
$mm = 0;
foreach($keys as $key_index=>$file)
{
$int = $int+1;
//if($_GET["student_id"]=="new")
if(optional_param('student_id','',PARAM_ALPHANUM)=="new")
{
if($modcat=="Students")
{
if($int==2)
{
$style="class='submenu_link'";
}
else
{
$style="class='submenuitem'";
}
}
}
//elseif($_REQUEST["staff_id"]=="new")
elseif(optional_param("staff_id",'',PARAM_ALPHANUM)=="new")
{
if($modcat=="Users")
{
if($int==2)
{
$style="class='submenu_link'";
}
else
{
$style="class='submenuitem'";
}
}
}else
{
//if($_REQUEST['modname']==$file)
if(optional_param('modname','',PARAM_URL)==$file)
{
$style="class='submenu_link'";
}else
{
$style="class='submenuitem'";
}
}
$title = $_openSIS['Menu'][$modcat][$file];
if($mm==0)
{
if(substr($file,0,7)=='http://')
echo "<A ".$style." HREF=$file target=body >$title</A> | ";
elseif(substr($file,0,7)=='HTTP://')
echo "<A ".$style." HREF=$file target=_blank>$title</A> | ";
elseif(!is_numeric($file))
if(User('PROFILE')=='student' && $title=="Student Info"){
echo "<A ".$style." id=hm HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"changeColors(); this.className='submenu_link'; document.getElementById('cframe').src='Bottom.php?modname=".$file."';\">My Information</A> | ";
}
elseif(User('PROFILE')=='student' && $title=="Schedule"){
echo "<A ".$style." id=hm HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"changeColors(); this.className='submenu_link'; document.getElementById('cframe').src='Bottom.php?modname=".$file."';\">My Schedule</A> | ";
}
elseif(User('PROFILE')=='student' && $title=="Student Requests"){
echo "<A ".$style." id=hm HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"changeColors(); this.className='submenu_link'; document.getElementById('cframe').src='Bottom.php?modname=".$file."';\">My Requests</A> | ";
}
else
{
if($modcat=='Eligibility')
echo "<A ".$style." id=hm HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"Extracurricular >> "."$title\"' onmouseup=\"changeColors(); this.className='submenu_link'; document.getElementById('cframe').src='Bottom.php?modname=".str_replace('&', '?',$file)."';\">$title</A> | ";
else
{
if(User('PROFILE_ID')!=0 && User('PROFILE')=='admin')
{
if($modcat=='Tools' && $title!='Backup Database')
echo "<A ".$style." id=hm HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"changeColors(); this.className='submenu_link'; document.getElementById('cframe').src='Bottom.php?modname=".str_replace('&', '?',$file)."';\">$title</A> | ";
if($modcat!='Tools')
echo "<A ".$style." id=hm HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"changeColors(); this.className='submenu_link'; document.getElementById('cframe').src='Bottom.php?modname=".str_replace('&', '?',$file)."';\">$title</A> | ";
}
else
echo "<A ".$style." id=hm HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"changeColors(); this.className='submenu_link'; document.getElementById('cframe').src='Bottom.php?modname=".str_replace('&', '?',$file)."';\">$title</A> | ";
}
}
elseif($keys[$key_index+1] && !is_numeric($keys[$key_index+1]))
{
$mm=$mm+1;
if(User('PROFILE_ID')!=0 && User('PROFILE')=='admin')
{
if($modcat=='Tools' && $title!='Reports')
echo '<label class="dd_menuitem" id="mm_'.$modcat.'_'.$mm.'"><b>'.$title.'</b> <img src="themes/'.trim($css).'/mnu_drpdwn.gif" /> | </label> '.'<div id="menu_child_'.$modcat.'_'.$mm.'" style="position: absolute; visibility: hidden; width:200px;">';
// if($modcat=='Tools' && $title!='Backup Database')
// echo "<A ".$style." id=hm HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"changeColors(); this.className='submenu_link'; document.getElementById('cframe').src='Bottom.php?modname=".str_replace('&', '?',$file)."';\">$title</A> | ";
if($modcat!='Tools')
echo '<label class="dd_menuitem" id="mm_'.$modcat.'_'.$mm.'"><b>'.$title.'</b> <img src="themes/'.trim($css).'/mnu_drpdwn.gif" /> | </label> '.'<div id="menu_child_'.$modcat.'_'.$mm.'" style="position: absolute; visibility: hidden; width:200px;">';
}
else
echo '<label class="dd_menuitem" id="mm_'.$modcat.'_'.$mm.'"><b>'.$title.'</b> <img src="themes/'.trim($css).'/mnu_drpdwn.gif" /> | </label> '.'<div id="menu_child_'.$modcat.'_'.$mm.'" style="position: absolute; visibility: hidden; width:200px;">';
}
}elseif($mm>0)
{
$menumm = $mm;
if(substr($file,0,7)=='http://')
echo "<A id=dd class='dd_submenuitem' HREF=$file target=body >$title</A>";
elseif(substr($file,0,7)=='HTTP://')
echo "<A id=dd class='dd_submenuitem' HREF=$file target=_blank>$title</A>";
elseif(!is_numeric($file))
{
if($modcat=='Eligibility')
echo "<A id=dd class='dd_submenuitem' HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"Extracurricular >> "."$title\"' onmouseup=\"document.getElementById('cframe').src='Bottom.php?modname=".$file."';\">$title</A>";
else
{
if(User('PROFILE_ID')!=0 && User('PROFILE')=='admin')
{
if($modcat=='Tools' && $title!='At a Glance' && $title!='Institute Reports' && $title!='Institute Custom Field Reports')
echo "<A id=dd class='dd_submenuitem' HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"document.getElementById('cframe').src='Bottom.php?modname=".$file."';\">$title</A>";
// if($modcat=='Tools' && $title!='Backup Database')
// echo "<A ".$style." id=hm HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"changeColors(); this.className='submenu_link'; document.getElementById('cframe').src='Bottom.php?modname=".str_replace('&', '?',$file)."';\">$title</A> | ";
if($modcat!='Tools')
echo "<A id=dd class='dd_submenuitem' HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"document.getElementById('cframe').src='Bottom.php?modname=".$file."';\">$title</A>";
}
else
echo "<A id=dd class='dd_submenuitem' HREF=# onClick='check_content(\"ajax.php?modname=".$file." \");' target=body onmousedown='document.getElementById(\"header\").innerHTML = \"".str_replace('_',' ',$modcat)." >> "."$title\"' onmouseup=\"document.getElementById('cframe').src='Bottom.php?modname=".$file."';\">$title</A>";
}
}
elseif($keys[$key_index+1] && !is_numeric($keys[$key_index+1]))
{
$mm=$mm+1;
echo '</div><label class="dd_menuitem" id="mm_'.$modcat.'_'.$mm.'"><b>'.$title.'</b> <img src="themes/'.trim($css).'/mnu_drpdwn.gif" /> | </label>'.'<div id="menu_child_'.$modcat.'_'.$mm.'" style="position: absolute; visibility: hidden; width=200px;">';
}
echo '<script type="text/javascript">
createmenu("mm_'.$modcat.'_'.$menumm.'", "menu_child_'.$modcat.'_'.$menumm.'", "hover", "y", "pointer");
</script>';
}
echo "</b>";
}
echo "</div></div></DIV>";
$i=$i+1;
}
}
echo " </div> ";
echo '</tr></table></td></tr>';
$append='';
if($_REQUEST['page_display'])
$append='?page_display='.$_REQUEST['page_display'];
if($_REQUEST['include'] && $_REQUEST['modname']=='Students/Student.php')
$append='?include='.$_REQUEST['include'];
echo "
<tr >
<td class=\"pageheading_bg\"><div class=heading><table width='100%' cellpadding='0' cellspacing='0'><tr><td valign='top'>";
echo " <div class=\"page_heading_breadcrumb\"><label id='header' name='header'></label> </td><td>";
## for opera echo '<div id="showhelp"><a href="javascript:void(0);" onclick="inter=setInterval(\'ShowBox(helpdiv, 380, 503, 630, 188, showhelp)\',1);return false;"><b>Help</b></a></div>';
echo '<div id="showhelp" style="padding-top:33px;"><a href="javascript:void(0);" onclick="inter=setInterval(\'ShowBox(helpdiv, 380, 499, 499, 211, showhelp)\',1);return false;"><b>Help</b></a></div></td></tr></table>';
echo '
<div style="height:0px; margin-top:-6px; width=0px; position: absolute; overflow:hidden; visibility: hidden; text-align:left; " id="helpdiv">
<div class="help_div">
<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td align=right style=" height:25px; padding-right:5px;"><a href="javascript:void(0);" onclick="inter=setInterval(\'HideBox(helpdiv, showhelp)\',1);return false;"><b>Hide Help</b></a></td></tr></table>
</div>
<div style="background-image:url(themes/Black/help_top.gif); width:495px; height:17px;"></div>
<iframe id="cframe" src="Bottom.php?modname='.$_REQUEST['modname'].$append.'" width="493" height=194px frameborder="0" scrolling="no" style="background-image:url(themes/Black/help_bg.gif); width:495px; background-repeat:repeat-y; background-color:transparent; text-align:left " >
</iframe>
<div style="background-image:url(themes/Black/help_bottom.gif); background-repeat:no-repeat; width:495px; height:10px;"></div>
</div>
';
echo "</div></div>";
echo "</td>
</tr>
<tr>
<td valign=\"top\" class=\"txt_container_bg\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td class=\"txt_bg\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td class=\"txt_container\" valign=\"top\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td class=\"txt_padding\">
" ;
echo "<div id='content' name='content'>";
//For Student or User Informat
//===================== For changing student id =====================
#$admin_COMMON=" FROM students s,student_enrollment ssm,address a WHERE s.STUDENT_ID=ssm.STUDENT_ID AND a.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR=".UserSyear()." AND ssm.SCHOOL_ID=".UserSchool()." ";
if(User('PROFILE')=='admin')
{
$admin_COMMON_FROM=" FROM students s, address a,student_enrollment ssm ";
$admin_COMMON_WHERE=" WHERE s.STUDENT_ID=ssm.STUDENT_ID AND a.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR=".UserSyear()." AND ssm.SCHOOL_ID=".UserSchool()." ";
// if($_REQUEST['mp_comment'] || $_SESSION['smc'])
if(optional_param('mp_comment','',PARAM_NOTAGS) || $_SESSION['smc'])
{
$admin_COMMON_FROM .=" ,student_mp_comments smc";
$admin_COMMON_WHERE .=" AND smc.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['smc']='1';
}
//if($_REQUEST['goal_description'] || $_REQUEST['goal_title'] || $_SESSION['g'])
if(optional_param('goal_description','',PARAM_NOTAGS) || optional_param('goal_title','',PARAM_NOTAGS) || $_SESSION['g'])
{
$admin_COMMON_FROM .=" ,goal g ";
$admin_COMMON_WHERE .=" AND g.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['g']='1';
}
//if($_REQUEST['progress_name'] || $_REQUEST['progress_description'] || $_SESSION['p'])
if(optional_param('progress_name','',PARAM_NOTAGS) ||optional_param('progress_description','',PARAM_NOTAGS) || $_SESSION['p'])
{
$admin_COMMON_FROM .=" ,progress p ";
$admin_COMMON_WHERE .=" AND p.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['p']='1';
}
//if($_REQUEST['doctors_note_comments'] || $_REQUEST['med_day'] || $_REQUEST['med_month'] || $_REQUEST['med_year'] || $_SESSION['smn'])
if(optional_param('doctors_note_comments','',PARAM_NOTAGS) || optional_param('med_day','',PARAM_NOTAGS) || optional_param('med_month','',PARAM_NOTAGS) || optional_param('med_year','',PARAM_NOTAGS) || $_SESSION['smn'])
{
$admin_COMMON_FROM .=" ,student_medical_notes smn ";
$admin_COMMON_WHERE .=" AND smn.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['smn']='1';
}
//if($_REQUEST['type'] || $_REQUEST['imm_comments'] || $_REQUEST['imm_day'] || $_REQUEST['imm_month'] || $_REQUEST['imm_year'] || $_SESSION['sm'])
if(optional_param('type','',PARAM_NOTAGS) || optional_param('imm_comments','',PARAM_NOTAGS) || optional_param('imm_day','',PARAM_NOTAGS) || optional_param('imm_month','',PARAM_NOTAGS) || optional_param('imm_year','',PARAM_NOTAGS) || $_SESSION['sm'])
{
// $admin_COMMON_FROM .=" ,student_medical sm ";
$admin_COMMON_FROM .=" ,student_immunization sm ";
$admin_COMMON_WHERE .=" AND sm.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['sm']='1';
}
// if($_REQUEST['ma_day'] || $_REQUEST['ma_month'] || $_REQUEST['ma_year'] || $_REQUEST['med_alrt_title'] || $_SESSION['sma'])
if(optional_param('ma_day','',PARAM_NOTAGS) || optional_param('ma_month','',PARAM_NOTAGS) ||optional_param('ma_year','',PARAM_NOTAGS) || optional_param('med_alrt_title','',PARAM_NOTAGS) || $_SESSION['sma'])
{
$admin_COMMON_FROM .=" ,student_medical_alerts sma ";
$admin_COMMON_WHERE .=" AND sma.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['sma']='1';
}
// if($_REQUEST['nv_day'] || $_REQUEST['nv_month'] || $_REQUEST['nv_year'] || $_REQUEST['reason'] || $_REQUEST['result'] || $_REQUEST['med_vist_comments'] || $_SESSION['smv'])
if(optional_param('nv_day','',PARAM_NOTAGS) || optional_param('nv_month','',PARAM_NOTAGS) ||optional_param('nv_year','',PARAM_NOTAGS) || optional_param('reason','',PARAM_NOTAGS) || optional_param('result','',PARAM_NOTAGS)|| optional_param('med_vist_comments','',PARAM_NOTAGS) || $_SESSION['smv'])
{
$admin_COMMON_FROM .=" ,student_medical_visits smv ";
$admin_COMMON_WHERE .=" AND smv.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['smv']='1';
}
$admin_COMMON= $admin_COMMON_FROM . $admin_COMMON_WHERE;
}
if(User('PROFILE')=='teacher')
{
$teacher_COMMON_FROM=" FROM students s, student_enrollment ssm, course_periods cp,
schedule ss,address a ";
$teacher_COMMON_WHERE=" WHERE a.STUDENT_ID=s.STUDENT_ID AND s.STUDENT_ID=ssm.STUDENT_ID AND ssm.STUDENT_ID=ss.STUDENT_ID AND ssm.SYEAR=cp.SYEAR AND ssm.SYEAR=ss.SYEAR AND cp.COURSE_ID=ss.COURSE_ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.MARKING_PERIOD_ID IN (".GetAllMP('',$queryMP).")
AND (cp.TEACHER_ID='".User('STAFF_ID')."' OR cp.SECONDARY_TEACHER_ID='".User('STAFF_ID')."') AND cp.COURSE_PERIOD_ID='".UserCoursePeriod()."' AND (ssm.START_DATE IS NOT NULL AND ('".DBDate()."'<=ssm.END_DATE OR ssm.END_DATE IS NULL)) AND ssm.SYEAR=".UserSyear()." AND ssm.SCHOOL_ID=".UserSchool()." ";
// if($_REQUEST['mp_comment'] || $_SESSION['smc'])
if(optional_param('mp_comment','',PARAM_SPCL) || $_SESSION['smc'])
{
$teacher_COMMON_FROM .=" ,student_mp_comments smc";
$teacher_COMMON_WHERE .=" AND smc.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['smc']='1';
}
//if($_REQUEST['goal_description'] || $_REQUEST['goal_title'] || $_SESSION['g'])
if(optional_param('goal_description','',PARAM_SPCL) || optional_param('goal_title','',PARAM_SPCL) || $_SESSION['g'])
{
$teacher_COMMON_FROM .=" ,goal g ";
$teacher_COMMON_WHERE .=" AND g.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['g']='1';
}
//if($_REQUEST['progress_name'] || $_REQUEST['progress_description'] || $_SESSION['p'])
if(optional_param('progress_name','',PARAM_NOTAGS) || optional_param('progress_description','',PARAM_NOTAGS) || $_SESSION['p'])
{
$teacher_COMMON_FROM .=" ,progress p ";
$teacher_COMMON_WHERE .=" AND p.STUDENT_ID=s.STUDENT_ID ";
$_SESSION['p']='1';
}
//if($_REQUEST['doctors_note_comments'] || $_REQUEST['med_day'] || $_REQUEST['med_month'] || $_REQUEST['med_year'] || $_SESSION['smn'])
if(optional_param('doctors_note_comments','',PARAM_NOTAGS) || optional_param('med_day','',PARAM_NOTAGS) || optional_param('med_month','',PARAM_NOTAGS) ||optional_param('med_year','',PARAM_NOTAGS) || $_SESSION['smn'])
{
$teacher_COMMON_FROM .=" ,student_medical_notes smn ";
$teacher_COMMON_WHERE .=" AND smn.STUDENT_ID=s.STUDENT_ID ";