Пример #1
0
                         $day = 'U';
                     }
                 }
                 $period_select .= "<OPTION value={$period['ID']}" . (CpvId() == $period['ID'] ? ' SELECTED' : '') . ">" . $period['CPSHORT'] . "-" . $day . "</OPTION>";
                 if (CpvId() == $period['ID']) {
                     $_SESSION['UserPeriod'] = $period['PERIOD_ID'];
                 }
             }
             $period_select .= "</SELECT>";
         }
     }
 }
 if ($incl_page != 'attendance/MissingAttendance.php' && $incl_page != 'attendance/TakeAttendance.php') {
     if (!$_SESSION['take_mssn_attn']) {
         if (!isset($_REQUEST['process'])) {
             $QI = DBQuery('SELECT DISTINCT cpv.ID,cpv.PERIOD_ID,cp.COURSE_PERIOD_ID,sp.TITLE,cp.SHORT_NAME as CPSHORT, cpv.DAYS,cpv.COURSE_PERIOD_DATE,sp.SHORT_NAME,cp.MARKING_PERIOD_ID,cpv.DAYS,sp.SORT_ORDER,c.TITLE AS COURSE_TITLE,cp.TITLE as COURSE_PERIOD_TITLE FROM course_periods cp,course_period_var cpv, school_periods sp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cpv.PERIOD_ID=sp.PERIOD_ID AND cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID AND cp.SYEAR=\'' . UserSyear() . '\' AND cp.SCHOOL_ID=\'' . UserSchool() . '\' AND (cp.TEACHER_ID=\'' . UserStaffID() . '\' OR cp.SECONDARY_TEACHER_ID=\'' . UserStaffID() . '\') AND (cp.MARKING_PERIOD_ID IN (' . GetAllMP_mod(GetMPTable(GetMP(UserMP(), 'TABLE')), UserMP()) . ') OR cp.MARKING_PERIOD_ID IS NULL) GROUP BY cp.COURSE_PERIOD_ID ORDER BY sp.SORT_ORDER ');
             $RET = DBGet($QI);
             $period_select = "Choose Period: <SELECT name=period onChange='this.form.submit();'>";
             $period_select .= "<OPTION value='na' selected>N/A</OPTION>";
             foreach ($RET as $period) {
                 $period_select .= "<OPTION value={$period['ID']}" . (CpvId() == $period['ID'] ? ' SELECTED' : '') . ">" . $period['COURSE_PERIOD_TITLE'] . "</OPTION>";
                 if (CpvId() == $period['ID']) {
                     $_SESSION['UserPeriod'] = $period['PERIOD_ID'];
                 }
             }
             $period_select .= "</SELECT>";
         }
     }
 }
 $profile = DBGet(DBQuery('SELECT PROFILE FROM staff WHERE STAFF_ID=' . UserID()));
 if ($profile[1]['PROFILE'] == "admin") {
Пример #2
0
 }
 if (isset($_REQUEST['date1']) && $_REQUEST['date1'] != '') {
     $extra['WHERE'] .= ' AND POSITION(\'' . get_db_day(date('l', strtotime($_REQUEST['date1']))) . '\' IN cpv.days)>0 AND (cpv.COURSE_PERIOD_DATE=\'' . date('Y-m-d', strtotime($_REQUEST['date1'])) . '\' OR cpv.COURSE_PERIOD_DATE IS NULL)';
 }
 $extra['WHERE'] .= '  AND ssm.SYEAR=sr.SYEAR AND sr.COURSE_ID=c.COURSE_ID AND sr.COURSE_PERIOD_ID=p_cp.COURSE_PERIOD_ID AND cpv.COURSE_PERIOD_ID=p_cp.COURSE_PERIOD_ID ';
 if ($_REQUEST['include_inactive'] != 'Y') {
     if (isset($_REQUEST['date1']) && $_REQUEST['date1'] != '') {
         $extra['WHERE'] .= '   AND (\'' . date('Y-m-d', strtotime($_REQUEST['date1'])) . '\' BETWEEN sr.START_DATE AND sr.END_DATE  OR (sr.END_DATE IS NULL AND sr.START_DATE<=\'' . date('Y-m-d', strtotime($_REQUEST['date1'])) . '\')) ';
     } else {
         $extra['WHERE'] .= ' AND (\'' . date('Y-m-d', strtotime($date)) . '\' BETWEEN sr.START_DATE AND sr.END_DATE OR (sr.END_DATE IS NULL AND sr.START_DATE<=\'' . date('Y-m-d', strtotime($date)) . '\')) ';
     }
 }
 if ($_REQUEST['mp_id'] && (User('PROFILE_ID') != 0 && User('PROFILE_ID') != 3 && User('PROFILE_ID') != 4)) {
     $extra['WHERE'] .= ' AND sr.MARKING_PERIOD_ID=' . $_REQUEST['mp_id'] . '';
 } else {
     $extra['WHERE'] .= ' AND (sr.MARKING_PERIOD_ID IN (' . GetAllMP_mod(GetMPTable(GetMP($_REQUEST['mp_id'], 'TABLE')), $_REQUEST['mp_id']) . ') or sr.MARKING_PERIOD_ID is NULL)';
 }
 $extra['functions'] = array('MARKING_PERIOD_ID' => 'GetMP', 'DAYS' => '_makeDays');
 $extra['group'] = array('STUDENT_ID');
 $RET = GetStuList($extra);
 foreach ($RET as $ri => $rd) {
     foreach ($rd as $rdi => $rdd) {
         $get_det = DBGet(DBQuery('SELECT cpv.DAYS,cpv.COURSE_PERIOD_DATE,CONCAT(sp.START_TIME,\'' . ' to ' . '\', sp.END_TIME) AS DURATION,r.TITLE as ROOM FROM course_period_var cpv,school_periods sp,rooms r WHERE sp.PERIOD_ID=cpv.PERIOD_ID AND cpv.ROOM_ID=r.ROOM_ID AND cpv.COURSE_PERIOD_ID=' . $rdd['COURSE_PERIOD_ID']));
         if ($rdd['SCHEDULE_TYPE'] == 'FIXED') {
             $RET[$ri][$rdi]['DAYS'] = _makeDays($get_det[1]['DAYS']);
             $time = explode(' to ', $get_det[1]['DURATION']);
             $get_det[1]['DURATION'] = date("g:i A", strtotime($time[0])) . ' to ' . date("g:i A", strtotime($time[1]));
             unset($time);
             $RET[$ri][$rdi]['DURATION'] = $get_det[1]['DURATION'];
             $RET[$ri][$rdi]['ROOM'] = $get_det[1]['ROOM'];
         } else {