コード例 #1
0
ファイル: miscExport.fnc.php プロジェクト: linil/centreSIS
function _makeNextSchool($value, $column)
{
    global $THIS_RET, $_CENTRE;
    if ($value == '0') {
        return 'Retain';
    } elseif ($value == '-1') {
        return 'Do not enroll after this school year';
    } elseif ($value == $THIS_RET['SCHOOL_ID']) {
        return 'Next Grade at ' . GetSchool($value);
    } else {
        return GetSchool($value);
    }
}
コード例 #2
0
ファイル: Calendar.php プロジェクト: SysBind/opensis-ml
#  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/>.
#
#***************************************************************************************
include '../../Redirect_modules.php';
if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'print') {
    echo '<style type="text/css">.print_wrapper{font-family:arial;font-size:12px;}.print_wrapper table table{border-right:1px solid #666;border-bottom:1px solid #666;}.print_wrapper table td{font-size:12px;}</style>';
    echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
    echo "<tr><td  style=\"font-size:15px; font-weight:bold; padding-top:10px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">" . _('List of Events') . "</div></td><td align=right style=\"padding-top:10px;\">" . ProperDate(DBDate()) . "<br />" . _('Powered by openSIS') . "</td></tr><tr><td colspan=2 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
    echo "<div class=print_wrapper>";
    ListOutputFloat($_SESSION['events_RET'], array('SCHOOL_DATE' => _('Date'), 'TITLE' => _('Event'), 'DESCRIPTION' => _('Description')), _('Event'), _('Events'), '', '', array('search' => false, 'count' => false));
    echo "</div>";
    #ListOutput($_SESSION['events_RET'],array('SCHOOL_DATE'=>'Date','TITLE'=>'Event','DESCRIPTION'=>'Description'),'Event','Events');
}
if (!$_REQUEST['month']) {
    $_REQUEST['month'] = date("n");
} else {
    $_REQUEST['month'] = MonthNWSwitch($_REQUEST['month'], 'tonum') * 1;
}
if (!$_REQUEST['year']) {
    $_REQUEST['year'] = date("Y");
}
$time = mktime(0, 0, 0, $_REQUEST['month'], 1, $_REQUEST['year']);
DrawBC("" . _('School Setup') . ">> " . ProgramTitle());
コード例 #3
0
ファイル: PrintAllCourses.php プロジェクト: 26746647/openSIS
 				(select CONCAT(LAST_NAME,' ',FIRST_NAME,' ',MIDDLE_NAME,' ') from staff where staff_id=course_periods.teacher_id) as teacher, 
 				room as location,days,course_period_id,course_id
 				from course_periods where school_id='".UserSchool()."' and syear='".UserSyear()."' ".$where." order by subject,COURSE_TITLE";
 				
                                 
 
 			$ret = DBGet(DBQuery($sql));
                  * 
                  */
 $sql_subject = 'SELECT SUBJECT_ID,TITLE FROM  course_subjects WHERE
                                     SCHOOL_ID=' . UserSchool() . ' AND SYEAR= ' . UserSyear();
 $sql_subject_ret = DBGet(DBQuery($sql_subject));
 if (count($sql_subject_ret)) {
     foreach ($sql_subject_ret as $subject) {
         echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
         echo "<tr><td width=105>" . DrawLogo() . "</td><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">All Courses</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
         echo '<table border="0" width="100%" align="center"><tr><td><font face=verdana size=-1><b>' . $subject['TITLE'] . '</b></font></td></tr><tr>';
         $sql_course = 'SELECT COURSE_ID,TITLE FROM  courses WHERE
                                     SCHOOL_ID=' . UserSchool() . ' AND SYEAR= ' . UserSyear() . ' AND SUBJECT_ID=' . $subject['SUBJECT_ID'];
         $sql_course_ret = DBGet(DBQuery($sql_course));
         foreach ($sql_course_ret as $course) {
             echo '<table border="0"><tr><td style=padding-left:40px;><font face=verdana size=-1><b>' . $course['TITLE'] . '</b></font></td></tr></table>';
             $sql_course_period = 'SELECT TITLE FROM  course_periods WHERE
                                     SCHOOL_ID=' . UserSchool() . ' AND SYEAR= ' . UserSyear() . ' AND COURSE_ID=' . $course['COURSE_ID'];
             $sql_course_period_ret = DBGet(DBQuery($sql_course_period));
             foreach ($sql_course_period_ret as $course_period) {
                 echo '<table border="0" width="100%"><tr><td style=padding-left:80px;><font face=verdana size=-1><b>' . $course_period['TITLE'] . '</b></font></td></tr></table>';
             }
         }
         echo '</tr><tr><td colspan="2" valign="top" align="right">';
         echo '</td></tr></table>';
コード例 #4
0
 $RET = GetStuList($extra);
 if (count($RET)) {
     include 'modules/Students/includes/functions.php';
     //------------Comment Heading -----------------------------------------------------
     //$categories_RET = DBGet(DBQuery("SELECT ID,TITLE,INCLUDE FROM STUDENT_FIELD_CATEGORIES ORDER BY SORT_ORDER,TITLE"),array(),array('ID'));
     // get the address and contacts custom fields, create the select lists and expand select and codeds options
     $address_categories_RET = DBGet(DBQuery("SELECT c.ID AS CATEGORY_ID,c.TITLE AS CATEGORY_TITLE,c.RESIDENCE,c.MAILING,c.BUS,f.ID,f.TITLE,f.TYPE,f.SELECT_OPTIONS,f.DEFAULT_SELECTION,f.REQUIRED FROM ADDRESS_FIELD_CATEGORIES c,ADDRESS_FIELDS f WHERE f.CATEGORY_ID=c.ID ORDER BY c.SORT_ORDER,c.TITLE,f.SORT_ORDER,f.TITLE"), array(), array('CATEGORY_ID'));
     $people_categories_RET = DBGet(DBQuery("SELECT c.ID AS CATEGORY_ID,c.TITLE AS CATEGORY_TITLE,c.CUSTODY,c.EMERGENCY,f.ID,f.TITLE,f.TYPE,f.SELECT_OPTIONS,f.DEFAULT_SELECTION,f.REQUIRED FROM PEOPLE_FIELD_CATEGORIES c,PEOPLE_FIELDS f WHERE f.CATEGORY_ID=c.ID ORDER BY c.SORT_ORDER,c.TITLE,f.SORT_ORDER,f.TITLE"), array(), array('CATEGORY_ID'));
     explodeCustom($address_categories_RET, $address_custom, 'a');
     explodeCustom($people_categories_RET, $people_custom, 'p');
     unset($_REQUEST['modfunc']);
     $handle = PDFStart();
     foreach ($RET as $student) {
         $_SESSION['student_id'] = $student['STUDENT_ID'];
         echo "<table width=100% style=\" font-family:Arial; font-size:12px;\" >";
         echo "<tr><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Student Information Report</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=2 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
         echo "<table cellspacing=0  border=\"0\" style=\"border-collapse:collapse\">";
         echo "<tr><td colspan=3 style=\"height:18px\"></td></tr>";
         if ($StudentPicturesPath && (($file = @fopen($picture_path = $StudentPicturesPath . UserSyear() . '/' . UserStudentID() . '.JPG', 'r')) || ($file = @fopen($picture_path = $StudentPicturesPath . (UserSyear() - 1) . '/' . UserStudentID() . '.JPG', 'r')))) {
             echo '<tr><td width=300><IMG SRC="' . $picture_path . '?id=' . rand(6, 100000) . '" width=150  style="padding:4px; background-color:#fff; border:1px solid #333" ></td><td width=12px></td>';
         } else {
             echo '<tr><td width=300><IMG SRC="assets/noimage.jpg?id=' . rand(6, 100000) . '" width=144  style="padding:4px; background-color:#fff; border:1px solid #333"></td><td width=12px></td>';
         }
         fclose($file);
         #$sql=DBGet(DBQuery("SELECT s.CUSTOM_200000000 AS GENDER, s.CUSTOM_200000001 AS ETHNICITY, s.CUSTOM_200000002 AS COMMON_NAME,  s.CUSTOM_200000003 AS SOCIAL_SEC_NO, s.CUSTOM_200000004 AS BIRTHDAY, s.CUSTOM_200000005 AS LANGUAGE, s.CUSTOM_200000006 AS PHYSICIAN_NAME, s.CUSTOM_200000007 AS PHYSICIAN_PHONO,s.custom_200000008 AS HOSPITAL,se.START_DATE AS START_DATE,sec.TITLE AS STATUS, se.NEXT_SCHOOL AS ROLLING  FROM STUDENTS s, STUDENT_ENROLLMENT se,STUDENT_ENROLLMENT_CODES sec WHERE s.STUDENT_ID='".$_SESSION['student_id']."' AND s.STUDENT_ID=se.STUDENT_ID AND se.SYEAR=sec.SYEAR"));
         # ---------------- Sql Including Comment ------------------------------- #
         #$sql=DBGet(DBQuery("SELECT s.CUSTOM_200000000 AS GENDER, s.CUSTOM_200000001 AS ETHNICITY, s.CUSTOM_200000002 AS COMMON_NAME,  s.CUSTOM_200000003 AS SOCIAL_SEC_NO, s.CUSTOM_200000004 AS BIRTHDAY, s.CUSTOM_200000005 AS LANGUAGE, s.CUSTOM_200000006 AS PHYSICIAN_NAME, s.CUSTOM_200000007 AS PHYSICIAN_PHONO,s.custom_200000008 AS HOSPITAL,se.START_DATE AS START_DATE,sec.TITLE AS STATUS, se.NEXT_SCHOOL AS ROLLING, smc.comment AS COMMENT  FROM STUDENTS s, STUDENT_ENROLLMENT se,STUDENT_ENROLLMENT_CODES sec, STUDENT_MP_COMMENTS smc WHERE s.STUDENT_ID='".$_SESSION['student_id']."' AND s.STUDENT_ID=se.STUDENT_ID AND s.STUDENT_ID=smc.STUDENT_ID AND se.SYEAR=sec.SYEAR"));
         #$sql=DBGet(DBQuery("SELECT s.CUSTOM_200000000 AS GENDER, s.CUSTOM_200000001 AS ETHNICITY, s.CUSTOM_200000002 AS COMMON_NAME,  s.CUSTOM_200000003 AS SOCIAL_SEC_NO, s.CUSTOM_200000004 AS BIRTHDAY, s.CUSTOM_200000005 AS LANGUAGE, s.CUSTOM_200000006 AS PHYSICIAN_NAME, s.CUSTOM_200000007 AS PHYSICIAN_PHONO,s.custom_200000008 AS HOSPITAL,s.custom_200000009 AS MCOMNT,s.custom_200000011 AS DNOTE,se.START_DATE AS START_DATE,sec.TITLE AS STATUS, se.NEXT_SCHOOL AS ROLLING, smc.comment AS COMMENT  FROM STUDENTS s, STUDENT_ENROLLMENT se,STUDENT_ENROLLMENT_CODES sec, STUDENT_MP_COMMENTS smc WHERE s.STUDENT_ID='".$_SESSION['student_id']."' AND s.STUDENT_ID=se.STUDENT_ID AND s.STUDENT_ID=smc.STUDENT_ID AND se.SYEAR=sec.SYEAR"));
         $sql = DBGet(DBQuery("SELECT s.gender AS GENDER, s.ethnicity AS ETHNICITY, s.common_name AS COMMON_NAME,  s.social_security AS SOCIAL_SEC_NO, s.birthdate AS BIRTHDAY, s.email AS EMAIL, s.phone AS PHONE, s.language AS LANGUAGE, s.physician AS PHYSICIAN_NAME, s.physician_phone AS PHYSICIAN_PHONO,s.preferred_hospital AS HOSPITAL,se.START_DATE AS START_DATE,sec.TITLE AS STATUS, se.NEXT_SCHOOL AS ROLLING  FROM STUDENTS s, STUDENT_ENROLLMENT se,STUDENT_ENROLLMENT_CODES sec WHERE s.STUDENT_ID='" . $_SESSION['student_id'] . "' AND s.STUDENT_ID=se.STUDENT_ID AND se.SYEAR=sec.SYEAR"));
         $sql = $sql[1];
         $medical_note = DBGet(DBQuery("SELECT doctors_note_date AS MCOMNT,doctors_note_comments AS DNOTE FROM STUDENT_MEDICAL_NOTES WHERE  STUDENT_ID='" . $_SESSION['student_id'] . "' "));
コード例 #5
0
ファイル: ListOutput.fnc.php プロジェクト: SysBind/opensis-ml
function PrintCatalog($result, $column_names, $singular = '', $plural = '', $link = false, $group = false, $options = false)
{
    if (!isset($options['save'])) {
        $options['save'] = true;
    }
    if (!isset($options['print'])) {
        $options['print'] = true;
    }
    if (!isset($options['search'])) {
        $options['search'] = true;
    }
    if (!isset($options['center'])) {
        $options['center'] = true;
    }
    if (!isset($options['count'])) {
        $options['count'] = true;
    }
    if (!isset($options['sort'])) {
        $options['sort'] = true;
    }
    if (!$link) {
        $link = array();
    }
    if (!isset($options['add'])) {
        if (!AllowEdit() || $_REQUEST['_openSIS_PDF']) {
            if ($link) {
                unset($link['add']);
                unset($link['remove']);
            }
        }
    }
    // PREPARE LINKS ---
    $result_count = $display_count = count($result);
    $num_displayed = 100000;
    $extra = "page={$_REQUEST['page']}&LO_sort={$_REQUEST['LO_sort']}&LO_direction={$_REQUEST['LO_direction']}&LO_search=" . urlencode($_REQUEST['LO_search']);
    $tmp_REQUEST = $_REQUEST;
    unset($tmp_REQUEST['page']);
    unset($tmp_REQUEST['LO_sort']);
    unset($tmp_REQUEST['LO_direction']);
    unset($tmp_REQUEST['LO_search']);
    unset($tmp_REQUEST['remove_prompt']);
    unset($tmp_REQUEST['remove_name']);
    unset($tmp_REQUEST['LO_save']);
    unset($tmp_REQUEST['PHPSESSID']);
    #$PHP_tmp_SELF = PreparePHP_SELF($tmp_REQUEST);
    $PHP_tmp_SELF = str_replace('>', '', PreparePHP_SELF($tmp_REQUEST));
    // END PREPARE LINKS ---
    // UN-GROUPING
    $group_count = count($group);
    if (!is_array($group)) {
        $group_count = false;
    }
    //$side_color = Preferences('COLOR');
    $side_color = 'bgcolor="#f5f5f5"';
    if ($group_count && $result_count) {
        $color = 'style=" background-color:#fff; padding:3px 4px 3px 4px;"';
        $group_result = $result;
        unset($result);
        $result[0] = '';
        foreach ($group_result as $item1) {
            if ($group_count == 1) {
                if ($color == 'bgcolor="#f5f5f5"') {
                    $color = $side_color;
                } else {
                    $color = 'bgcolor="#f5f5f5"';
                }
            }
            foreach ($item1 as $item2) {
                if ($group_count == 1) {
                    $i++;
                    if (count($group[0]) && $i != 1) {
                        foreach ($group[0] as $column) {
                            $item2[$column] = str_replace('<!-- <!--', '<!--', '<!-- ' . str_replace('-->', '--><!--', $item2[$column])) . ' -->';
                        }
                    }
                    $item2['row_color'] = $color;
                    $result[] = $item2;
                } else {
                    if ($group_count == 2) {
                        if ($color == 'bgcolor="#ffffff"') {
                            $color = $side_color;
                        } else {
                            $color = 'bgcolor="#ffffff"';
                        }
                    }
                    foreach ($item2 as $item3) {
                        if ($group_count == 2) {
                            $i++;
                            if (count($group[0]) && $i != 1) {
                                foreach ($group[0] as $column) {
                                    $item3[$column] = '<!-- ' . $item3[$column] . ' -->';
                                }
                            }
                            if (count($group[1]) && $i != 1) {
                                foreach ($group[1] as $column) {
                                    $item3[$column] = '<!-- ' . $item3[$column] . ' -->';
                                }
                            }
                            $item3['row_color'] = $color;
                            $result[] = $item3;
                        } else {
                            if ($group_count == 3) {
                                if ($color == 'bgcolor="#ffffff"') {
                                    $color = $side_color;
                                } else {
                                    $color = 'bgcolor="#ffffff"';
                                }
                            }
                            foreach ($item3 as $item4) {
                                if ($group_count == 3) {
                                    $i++;
                                    if (count($group[2]) && $i != 1) {
                                        foreach ($group[2] as $column) {
                                            unset($item4[$column]);
                                        }
                                    }
                                    $item4['row_color'] = $color;
                                    $result[] = $item4;
                                }
                            }
                        }
                    }
                }
            }
            $i = 0;
        }
        unset($result[0]);
        $result_count = count($result);
        unset($_REQUEST['LO_sort']);
    }
    // END UN-GROUPING
    $_LIST['output'] = true;
    // PRINT HEADINGS, PREPARE PDF, AND SORT THE LIST ---
    if ($_LIST['output'] != false) {
        if ($result_count != 0) {
            $count = 0;
            $remove = count($link['remove']['variables']);
            $cols = count($column_names);
            // HANDLE SEARCHES ---
            if ($result_count && $_REQUEST['LO_search'] && $_REQUEST['LO_search'] != 'Search') {
                $_REQUEST['LO_search'] = $search_term = str_replace('\\\\"', '"', $_REQUEST['LO_search']);
                $_REQUEST['LO_search'] = $search_term = ereg_replace('[^a-zA-Z0-9 _"]*', '', strtolower($search_term));
                if (substr($search_term, 0, 0) != '"' && substr($search_term, -1) != '"') {
                    $search_term = ereg_replace('"', '', $search_term);
                    while ($space_pos = strpos($search_term, ' ')) {
                        $terms[strtolower(substr($search_term, 0, $space_pos))] = 1;
                        $search_term = substr($search_term, $space_pos + 1);
                    }
                    $terms[trim($search_term)] = 1;
                } else {
                    $search_term = ereg_replace('"', '', $search_term);
                    $terms[trim($search_term)] = 1;
                }
                unset($terms['of']);
                unset($terms['the']);
                unset($terms['a']);
                unset($terms['an']);
                unset($terms['in']);
                foreach ($result as $key => $value) {
                    $values[$key] = 0;
                    foreach ($value as $name => $val) {
                        $val = ereg_replace('[^a-zA-Z0-9 _]+', '', strtolower($val));
                        if (strtolower($_REQUEST['LO_search']) == $val) {
                            $values[$key] += 25;
                        }
                        foreach ($terms as $term => $one) {
                            if (ereg($term, $val)) {
                                $values[$key] += 3;
                            }
                        }
                    }
                    if ($values[$key] == 0) {
                        unset($values[$key]);
                        unset($result[$key]);
                        $result_count--;
                        $display_count--;
                    }
                }
                if ($result_count) {
                    array_multisort($values, SORT_DESC, $result);
                    $result = ReindexResults($result);
                    $values = ReindexResults($values);
                    $last_value = 1;
                    $scale = 100 / $values[$last_value];
                    for ($i = $last_value; $i <= $result_count; $i++) {
                        $result[$i]['RELEVANCE'] = '<!--' . (int) ($values[$i] * $scale) . '--><IMG SRC="assets/pixel_grey.gif" width=' . (int) ($values[$i] * $scale) . ' height=10>';
                    }
                }
                $column_names['RELEVANCE'] = "Relevance";
                if (is_array($group) && count($group)) {
                    $options['count'] == false;
                    $display_zero = true;
                }
            }
            // END SEARCHES ---
            if ($_REQUEST['LO_sort']) {
                foreach ($result as $sort) {
                    if (substr($sort[$_REQUEST['LO_sort']], 0, 4) != '<!--') {
                        $sort_array[] = $sort[$_REQUEST['LO_sort']];
                    } else {
                        $sort_array[] = substr($sort[$_REQUEST['LO_sort']], 4, strpos($sort[$_REQUEST['LO_sort']], '-->') - 5);
                    }
                }
                if ($_REQUEST['LO_direction'] == -1) {
                    $dir = SORT_DESC;
                } else {
                    $dir = SORT_ASC;
                }
                if ($result_count > 1) {
                    if (is_int($sort_array[1]) || is_double($sort_array[1])) {
                        array_multisort($sort_array, $dir, SORT_NUMERIC, $result);
                    } else {
                        array_multisort($sort_array, $dir, $result);
                    }
                    for ($i = $result_count - 1; $i >= 0; $i--) {
                        $result[$i + 1] = $result[$i];
                    }
                    unset($result[0]);
                }
            }
        }
        // HANDLE SAVING THE LIST ---
        if ($_REQUEST['LO_save'] == '1') {
            if (!$options['save_delimiter'] && Preferences('DELIMITER') == 'CSV') {
                $options['save_delimiter'] = 'comma';
            }
            switch ($options['save_delimiter']) {
                case 'comma':
                    $extension = 'csv';
                    break;
                case 'xml':
                    $extension = 'xml';
                    break;
                default:
                    $extension = 'xls';
                    break;
            }
            ob_end_clean();
            if ($options['save_delimiter'] != 'xml') {
                foreach ($column_names as $key => $value) {
                    $output .= str_replace('&nbsp;', ' ', eregi_replace('<BR>', ' ', ereg_replace('<!--.*-->', '', $value))) . ($options['save_delimiter'] == 'comma' ? ',' : "\t");
                }
                $output .= "\n";
            }
            foreach ($result as $item) {
                foreach ($column_names as $key => $value) {
                    if ($options['save_delimiter'] == 'comma' && !$options['save_quotes']) {
                        $item[$key] = str_replace(',', ';', $item[$key]);
                    }
                    $item[$key] = eregi_replace('<SELECT.*SELECTED\\>([^<]+)<.*</SELECT\\>', '\\1', $item[$key]);
                    $item[$key] = eregi_replace('<SELECT.*</SELECT\\>', '', $item[$key]);
                    $output .= ($options['save_quotes'] ? '"' : '') . ($options['save_delimiter'] == 'xml' ? '<' . str_replace(' ', '', $value) . '>' : '') . ereg_replace('<[^>]+>', '', ereg_replace("<div onclick='[^']+'>", '', ereg_replace(' +', ' ', ereg_replace('&[^;]+;', '', str_replace('<BR>&middot;', ' : ', str_replace('&nbsp;', ' ', $item[$key])))))) . ($options['save_delimiter'] == 'xml' ? '</' . str_replace(' ', '', $value) . '>' . "\n" : '') . ($options['save_quotes'] ? '"' : '') . ($options['save_delimiter'] == 'comma' ? ',' : "\t");
                }
                $output .= "\n";
            }
            header("Cache-Control: public");
            header("Pragma: ");
            header("Content-Type: application/{$extension}");
            header("Content-Disposition: inline; filename=\"" . ProgramTitle() . ".{$extension}\"\n");
            if ($options['save_eval']) {
                eval($options['save_eval']);
            }
            echo $output;
            exit;
        }
        // END SAVING THE LIST ---
        if ($options['center']) {
            #echo '<CENTER>';
            if ($result_count > $num_displayed || ($options['count'] || $display_zero) && (($result_count == 0 || $display_count == 0) && $plural || ($result_count == 0 || $display_count == 0))) {
                #echo "<TABLE border=0 cellspacing=3 cellpadding=6>" ;
                if (isset($_REQUEST['_openSIS_PDF'])) {
                    #echo " width=98%";
                    echo " <TR><TD align=center>";
                }
            }
        }
        if ($options['count'] || $display_zero) {
            if (($result_count == 0 || $display_count == 0) && $plural) {
                echo "<div style=text-align:left><table cellpadding=1 cellspacing=0 ><tr><td ></td><td ><b>No {$plural} were found.</b></td></tr><tr><td colspan=2 ></td></tr></table></div>";
            } elseif ($result_count == 0 || $display_count == 0) {
                echo '<div style=text-align:left><table cellpadding=1 cellspacing=0 ><tr><td ></td><td ><b>None were found.</b></td></tr><tr><td colspan=2></td></tr></table></div>';
            }
        }
        if ($result_count != 0 || $_REQUEST['LO_search'] && $_REQUEST['LO_search'] != 'Search') {
            if (!isset($_REQUEST['_openSIS_PDF'])) {
                if (!$_REQUEST['page']) {
                    $_REQUEST['page'] = 1;
                }
                if (!$_REQUEST['LO_direction']) {
                    $_REQUEST['LO_direction'] = 1;
                }
                $start = ($_REQUEST['page'] - 1) * $num_displayed + 1;
                $stop = $start + ($num_displayed - 1);
                if ($stop > $result_count) {
                    $stop = $result_count;
                }
                if ($result_count > $num_displayed) {
                    $where_message = "<SMALL>Displaying {$start} through {$stop}</SMALL>";
                    echo "" . _('Go to Page') . " ";
                    if (ceil($result_count / $num_displayed) <= 10) {
                        for ($i = 1; $i <= ceil($result_count / $num_displayed); $i++) {
                            if ($i != $_REQUEST['page']) {
                                $pages .= "<A HREF={$PHP_tmp_SELF}&LO_sort={$_REQUEST['LO_sort']}&LO_direction={$_REQUEST['LO_direction']}&LO_search=" . urlencode($_REQUEST['LO_search']) . "&page={$i}>{$i}</A>, ";
                            } else {
                                $pages .= "{$i}, ";
                            }
                        }
                        $pages = substr($pages, 0, -2) . "<BR>";
                    } else {
                        for ($i = 1; $i <= 7; $i++) {
                            if ($i != $_REQUEST['page']) {
                                $pages .= "<A HREF={$PHP_tmp_SELF}&LO_sort={$_REQUEST['LO_sort']}&LO_direction={$_REQUEST['LO_direction']}&LO_search=" . urlencode($_REQUEST['LO_search']) . "&page={$i}>{$i}</A>, ";
                            } else {
                                $pages .= "{$i}, ";
                            }
                        }
                        $pages = substr($pages, 0, -2) . " ... ";
                        for ($i = ceil($result_count / $num_displayed) - 2; $i <= ceil($result_count / $num_displayed); $i++) {
                            if ($i != $_REQUEST['page']) {
                                $pages .= "<A HREF={$PHP_tmp_SELF}&LO_sort={$_REQUEST['LO_sort']}&LO_direction={$_REQUEST['LO_direction']}&LO_search=" . urlencode($_REQUEST['LO_search']) . "&page={$i}>{$i}</A>, ";
                            } else {
                                $pages .= "{$i}, ";
                            }
                        }
                        $pages = substr($pages, 0, -2) . " &nbsp;<A HREF={$PHP_tmp_SELF}&LO_sort={$_REQUEST['LO_sort']}&LO_direction={$_REQUEST['LO_direction']}&LO_search=" . urlencode($_REQUEST['LO_search']) . "&page=" . ($_REQUEST['page'] + 1) . ">Next Page</A><BR>";
                    }
                    echo $pages;
                    echo '</TD></TR></TABLE>';
                    echo '<BR>';
                }
            } else {
                $start = 1;
                $stop = $result_count;
                if ($cols > 8 || $_REQUEST['expanded_view']) {
                    $_SESSION['orientation'] = 'landscape';
                    $repeat_headers = 16;
                } else {
                    $repeat_headers = 26;
                }
                if ($options['print']) {
                    $html = explode('', strtolower(ob_get_contents()));
                    $html = $html[count($html) - 1];
                    echo '</TD></TR></TABLE>';
                    $br = substr_count($html, '<br>') + substr_count($html, '</p>') + substr_count($html, '</tr>') + substr_count($html, '</h1>') + substr_count($html, '</h2>') + substr_count($html, '</h3>') + substr_count($html, '</h4>') + substr_count($html, '</h5>');
                    if ($br % 2 != 0) {
                        $br++;
                        echo '<BR>';
                    }
                } else {
                    echo '</TD></TR></TABLE>';
                }
            }
            // END MISC ---
            // WIDTH = 100%
            echo '<TABLE width=98% border=0 cellspacing=0 cellpadding=0><TR>';
            // SEARCH BOX & MORE HEADERS
            if ($where_message || $singular && $plural || !isset($_REQUEST['_openSIS_PDF']) && $options['search']) {
                echo '<TD align=center>';
                //echo '<TABLE cellpadding=1 width=100% border=1 style="border-collapse:collapse" >';
                //echo "<TR><TD align=left valign=middle>";
                //if($singular && $plural && $options['count'])
                //{
                /*f($display_count > 1)
                			echo "<table cellpadding=5 cellspacing=5 class=alert_box align=left ><tr><td class=notice></td><td class=notice_msg ><b>$display_count $plural were found.</b></td></tr></table>";
                		elseif($display_count==1)
                			echo "<table cellpadding=5 cellspacing=5 class=alert_box align=left ><tr><td class=notice></td><td class=notice_msg ><b>1 $singular was found.</b></td></tr></table>";*/
                //if($where_message)
                //echo '<br>'.$where_message;
                //}
                if ($options['save'] && !isset($_REQUEST['_openSIS_PDF']) && $result_count > 0) {
                    //echo str_replace("Modules.php", "for_export.php", $PHP_tmp_SELF);
                    //echo "<table cellpadding=0 cellspacing=0 class=download align=left ><tr><td><A HREF=".str_replace('Modules.php', 'for_export.php', $PHP_tmp_SELF)."&$extra&LO_save=1&_openSIS_PDF=true ><IMG SRC=assets/download.png border=0 alt=\"Download\" title=\"Download\"></a></td></tr></table>";
                    //echo "<br><br><table class=download ><tr><td><A HREF=".str_replace('Modules.php', 'for_export.php', $PHP_tmp_SELF)."&$extra&_openSIS_PDF=true ><IMG SRC=assets/download.png border=0></a></td><td><A HREF=".str_replace('Modules.php', 'for_export.php', $PHP_tmp_SELF)."&$extra&_openSIS_PDF=true >Download</A></td></tr></table>";
                    echo '</TD>';
                }
                $colspan = 1;
                if (!isset($_REQUEST['_openSIS_PDF']) && $options['search']) {
                    $tmp_REQUEST = $_REQUEST;
                    unset($tmp_REQUEST['LO_search']);
                    unset($tmp_REQUEST['page']);
                    echo '<TD height="50" align=right valign=middle>';
                    echo "<INPUT type=text class='cell_medium' id=LO_search name=LO_search value='" . ($_REQUEST['LO_search'] && $_REQUEST['LO_search'] != 'Search' ? $_REQUEST['LO_search'] : 'Search\' style=\'color:BBBBBB\''), "' onfocus='if(this.value==\"Search\") this.value=\"\"; this.style.color=\"000000\";' onblur='if(this.value==\"\") {this.value=\"Search\"; this.style.color=\"BBBBBB\";}' onkeypress='if(event.keyCode==13){document.location.href=\"" . PreparePHP_SELF($tmp_REQUEST) . "&LO_search=\"+this.value; return false;} '>&nbsp;&nbsp;<INPUT type=button class='btn_go' value=Go onclick='document.location.href=\"" . PreparePHP_SELF($tmp_REQUEST) . "&LO_search=\"+document.getElementById(\"LO_search\").value;'></TD>";
                    $colspan++;
                }
                echo "</TR>";
                echo '<TR style="height:0;"><TD width=100% align=center colspan=' . $colspan . '><DIV id=LOx' . (count($column_names) + ($result_count != 0 && $cols && !isset($_REQUEST['_openSIS_PDF']) ? 1 : 0) + ($remove && !isset($_REQUEST['_openSIS_PDF']) ? 1 : 0)) . ' style="width:0; position: relative; height:0;"></DIV></TD></TR></TABLE>';
            } else {
                echo '<TD width=100% align=right><DIV id=LOx' . (count($column_names) + ($result_count != 0 && $cols && !isset($_REQUEST['_openSIS_PDF']) ? 1 : 0) + ($remove && !isset($_REQUEST['_openSIS_PDF']) ? 1 : 0)) . ' style="width:0; position: relative; height:0;"></DIV>';
            }
            // END SEARCH BOX ----
            echo '</TD></TR><TR><TD>';
            // SHADOW
            if (!isset($_REQUEST['_openSIS_PDF'])) {
                echo '<TABLE width=100% cellpadding=0 cellspacing=0><TR><TD align=center>';
            }
            echo "<TABLE cellpadding=6 width=100% cellspacing=1 border=\"1px solid #a9d5e9 \" style=\"border-collapse:collapse\" align=center>";
            if (!isset($_REQUEST['_openSIS_PDF']) && $stop - $start > 10) {
                echo '<THEAD>';
            }
            if (!isset($_REQUEST['_openSIS_PDF'])) {
                echo '<TR>';
            }
            $i = 1;
            if ($remove && !isset($_REQUEST['_openSIS_PDF']) && $result_count != 0) {
                //THIS LINE IS FOR COLUMN HEADING
                echo "<TD class=subtabs><DIV id=LOx{$i} style='position: relative;'></DIV></TD>";
                $i++;
            }
            if ($result_count != 0 && $cols && !isset($_REQUEST['_openSIS_PDF'])) {
                foreach ($column_names as $key => $value) {
                    if ($_REQUEST['LO_sort'] == $key) {
                        $direction = -1 * $_REQUEST['LO_direction'];
                    } else {
                        $direction = 1;
                    }
                    //THIS LINE IS FOR COLUMN HEADING
                    echo "<TD class=subtabs><DIV id=LOx{$i} style='position: relative;'></DIV>";
                    echo "<A ";
                    if ($options['sort']) {
                        echo "HREF={$PHP_tmp_SELF}&page={$_REQUEST['page']}&LO_sort={$key}&LO_direction={$direction}&LO_search=" . urlencode($_REQUEST['LO_search']);
                    }
                    echo " class=column_heading><b>{$value}</b></A>";
                    if ($i == 1) {
                        echo "<DIV id=LOy0 style='position: relative;'></DIV>";
                    }
                    echo "</TD>";
                    $i++;
                }
                //echo '<TD width=0><DIV id=LO'.$i.'></DIV></TD>';
                echo "</TR>";
            }
            $color = 'bgcolor="#ffffff"';
            //style="height: 300px; overflow: auto; padding-right: 16px;"
            if (!isset($_REQUEST['_openSIS_PDF']) && $stop - $start > 10) {
                echo '</THEAD><TBODY>';
            }
            // mab - enable add link as first or last
            if ($result_count != 0 && $link['add']['first'] && $stop - $start >= $link['add']['first']) {
                //if($remove && !isset($_REQUEST['_openSIS_PDF']))
                //	$cols++;
                if ($link['add']['link'] && !isset($_REQUEST['_openSIS_PDF'])) {
                    echo "<TR><TD colspan=" . ($remove ? $cols + 1 : $cols) . " align=left class=even>" . button('add', $link['add']['title'], $link['add']['link']) . "</TD></TR>";
                } elseif ($link['add']['span'] && !isset($_REQUEST['_openSIS_PDF'])) {
                    echo "<TR><TD colspan=" . ($remove ? $cols + 1 : $cols) . " align=left class=even>" . button('add') . $link['add']['span'] . "</TD></TR>";
                } elseif ($link['add']['html'] && $cols) {
                    echo "<TR {$color}>";
                    if ($remove && !isset($_REQUEST['_openSIS_PDF']) && $link['add']['html']['remove']) {
                        echo "<TD class=even align=left>" . $link['add']['html']['remove'] . "</TD>";
                    } elseif ($remove && !isset($_REQUEST['_openSIS_PDF'])) {
                        echo "<TD class=even align=left>" . button('add') . "</TD>";
                    }
                    foreach ($column_names as $key => $value) {
                        echo "<TD class=even align=left >" . $link['add']['html'][$key] . "</TD>";
                    }
                    echo "</TR>";
                    $count++;
                }
            }
            for ($i = $start; $i <= $stop; $i++) {
                $item = $result[$i];
                if (isset($_REQUEST['_openSIS_PDF']) && $options['print'] && count($item)) {
                    foreach ($item as $key => $value) {
                        $value = eregi_replace('<SELECT.*SELECTED\\>([^<]+)<.*</SELECT\\>', '\\1', $value);
                        $value = eregi_replace('<SELECT.*</SELECT\\>', '', $value);
                        if (strpos($value, 'LO_field') === false) {
                            $item[$key] = str_replace(' ', '&nbsp;', ereg_replace("<div onclick='[^']+'>", '', $value));
                        } else {
                            $item[$key] = ereg_replace("<div onclick='[^']+'>", '', $value);
                        }
                    }
                }
                if ($item['row_color']) {
                    $color = $item['row_color'];
                } elseif ($color == 'bgcolor="#ffffff"') {
                    $color = $side_color;
                } else {
                    $color = 'bgcolor="#ffffff"';
                }
                //$color = '#EDF3FE';
                if (isset($_REQUEST['_openSIS_PDF']) && $count % $repeat_headers == 0) {
                    if ($count != 0) {
                        echo '</TABLE>';
                        echo "<div style=\"page-break-after: always;\"></div>";
                        echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
                        echo "<tr><td width=105>" . DrawLogo() . "</td><td style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">" . _('Student Advanced Report') . "</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />" . _('Powered by openSIS') . "</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
                        echo '<TABLE cellpadding=6 width=100% cellspacing=1 border="1px solid #a9d5e9 " style="border-collapse:collapse" align=center>';
                    }
                    echo "<TR>";
                    if ($remove && !isset($_REQUEST['_openSIS_PDF'])) {
                        echo "<TD bgcolor=#d3d3d3></TD>";
                    }
                    if ($cols) {
                        foreach ($column_names as $key => $value) {
                            echo "<TD bgcolor=#d3d3d3 >" . str_replace(' ', '&nbsp;', $value) . "</TD>";
                        }
                    }
                    echo "</TR>";
                }
                if ($count == 0) {
                    $count = $br;
                }
                echo "<TR {$color}>";
                $count++;
                if ($remove && !isset($_REQUEST['_openSIS_PDF'])) {
                    $button_title = $link['remove']['title'];
                    $button_link = $link['remove']['link'];
                    if (count($link['remove']['variables'])) {
                        foreach ($link['remove']['variables'] as $var => $val) {
                            $button_link .= "&{$var}=" . $item[$val];
                        }
                    }
                    echo "<TD {$color}>" . button('remove', $button_title, $button_link) . "</TD>";
                }
                if ($cols) {
                    foreach ($column_names as $key => $value) {
                        if ($link[$key] && !isset($_REQUEST['_openSIS_PDF'])) {
                            echo "<TD {$color} >";
                            if ($key == 'FULL_NAME') {
                                echo '<DIV id=LOy' . ($count - $br) . ' style="height: 100%; min-height: 100%; position: relative;">';
                            }
                            if ($link[$key]['js'] === true) {
                                echo "<A HREF=# onclick='window.open(\"{$link[$key][link]}";
                                if (count($link[$key]['variables'])) {
                                    foreach ($link[$key]['variables'] as $var => $val) {
                                        echo "&{$var}=" . urlencode($item[$val]);
                                    }
                                }
                                echo "\",\"\",\"scrollbars=yes,resizable=yes,width=800,height=400\");'";
                                if ($link[$key]['extra']) {
                                    echo ' ' . $link[$key]['extra'];
                                }
                                echo ">";
                            } else {
                                echo "<A HREF={$link[$key][link]}";
                                if (count($link[$key]['variables'])) {
                                    foreach ($link[$key]['variables'] as $var => $val) {
                                        echo "&{$var}=" . urlencode($item[$val]);
                                    }
                                }
                                if ($link[$key]['extra']) {
                                    echo ' ' . $link[$key]['extra'];
                                }
                                echo " onclick='grabA(this); return false;'>";
                            }
                            if ($color == Preferences('HIGHLIGHT')) {
                                echo '';
                            } else {
                                echo '<b>';
                            }
                            echo $item[$key];
                            echo '</b>';
                            if (!$item[$key]) {
                                echo '***';
                            }
                            echo "</A>";
                            if ($key == 'FULL_NAME') {
                                echo '</DIV>';
                            }
                            echo "</TD>";
                        } else {
                            echo "<TD {$color} >";
                            if ($key == 'FULL_NAME') {
                                echo '<DIV id=LOy' . ($count - $br) . '  style="position: relative;">';
                            }
                            if ($color == Preferences('HIGHLIGHT')) {
                                echo '';
                            }
                            echo $item[$key];
                            if (!$item[$key]) {
                                echo '&nbsp;';
                            }
                            if ($key == 'FULL_NAME') {
                                echo '<DIV>';
                            }
                            echo "</TD>";
                        }
                    }
                }
                echo "</TR>";
            }
            if ($result_count != 0 && (!$link['add']['first'] || $link['add']['first'] && $stop - $start < $link['add']['first'])) {
                if ($link['add']['link'] && !isset($_REQUEST['_openSIS_PDF'])) {
                    echo "<TR><TD colspan=" . ($remove ? $cols + 1 : $cols) . " align=left class=even>" . button('add', $link['add']['title'], $link['add']['link']) . "</TD></TR>";
                } elseif ($link['add']['span'] && !isset($_REQUEST['_openSIS_PDF'])) {
                    echo "<TR><TD colspan=" . ($remove ? $cols + 1 : $cols) . " align=left class=even>" . button('add') . $link['add']['span'] . "</TD></TR>";
                } elseif ($link['add']['html'] && $cols) {
                    if ($count % 2) {
                        $color = 'bgcolor=#ffffff';
                    } else {
                        $color = $side_color;
                    }
                    echo "<TR {$color}>";
                    if ($remove && !isset($_REQUEST['_openSIS_PDF']) && $link['add']['html']['remove']) {
                        echo "<TD bgcolor=#ffffff align=left>" . $link['add']['html']['remove'] . "</TD>";
                    } elseif ($remove && !isset($_REQUEST['_openSIS_PDF'])) {
                        echo "<TD bgcolor=#ffffff align=left >" . button('add') . "</TD>";
                    }
                    foreach ($column_names as $key => $value) {
                        echo "<TD bgcolor=#ffffff align=left  valign=top>" . $link['add']['html'][$key] . "</TD>";
                    }
                    echo "</TR>";
                }
            }
            if ($result_count != 0) {
                if (!isset($_REQUEST['_openSIS_PDF']) && $stop - $start > 10) {
                    echo '</TBODY>';
                }
                echo "</TABLE>";
                if (!isset($_REQUEST['_openSIS_PDF'])) {
                    echo '</TD ></TR></TABLE>';
                }
                echo "</TD ></TR>";
                echo "</TABLE>";
                if ($options['center']) {
                    echo '';
                }
            }
        }
        if ($result_count == 0) {
            if ($result_count > $num_displayed || ($options['count'] || $display_zero) && (($result_count == 0 || $display_count == 0) && $plural || ($result_count == 0 || $display_count == 0))) {
                if ($link['add']['link'] && !isset($_REQUEST['_openSIS_PDF'])) {
                    echo '<table width=120px cellspacing=8 cellpadding=6 ><tr><TD align=left class=lone_add >' . button('add', $link['add']['title'], $link['add']['link']) . '</td></tr></table>';
                } elseif (($link['add']['html'] || $link['add']['span']) && count($column_names) && !isset($_REQUEST['_openSIS_PDF'])) {
                    $color = $side_color;
                    if ($options['center']) {
                        echo '<TABLE width=100% cellpadding=0 cellspacing=0><TR><TD align=center>';
                    }
                    if ($link['add']['html']) {
                        echo "<TABLE cellpadding=6 cellspacing=1 width=96% class=\"grid\"><TR><TD class=subtabs></TD>";
                        foreach ($column_names as $key => $value) {
                            echo "<TD class=subtabs><A><b>" . str_replace(' ', '&nbsp;', $value) . "</b></A></TD>";
                        }
                        echo "</TR>";
                        echo "<TR class=odd>";
                        if ($link['add']['html']['remove']) {
                            echo "<TD >" . $link['add']['html']['remove'] . "</TD>";
                        } else {
                            echo "<TD>" . button('add') . "</TD>";
                        }
                        foreach ($column_names as $key => $value) {
                            echo "<TD >" . $link['add']['html'][$key] . "</TD>";
                        }
                        echo "</TR>";
                        echo "</TABLE>";
                    } elseif ($link['add']['span'] && !isset($_REQUEST['_openSIS_PDF'])) {
                        echo "<TABLE><TR><TD align=center>" . button('add') . $link['add']['span'] . "</TD></TR></TABLE>";
                    }
                    echo "</TD></TR></TABLE>";
                    if ($options['center']) {
                        echo '</CENTER>';
                    }
                }
            }
        }
        if ($result_count != 0) {
            if ($options['yscroll']) {
                echo '<div id="LOy_layer" style="position: absolute; top: 0; left: 0; visibility:hidden;">';
                echo '<TABLE cellpadding=6 id=LOy_table>';
                $i = 1;
                if ($cols && !isset($_REQUEST['_openSIS_PDF'])) {
                    $color = $side_color;
                    foreach ($result as $item) {
                        echo "<TR><TD {$color}  id=LO_row{$i}>";
                        if ($color == Preferences('HIGHLIGHT')) {
                            echo '';
                        }
                        echo $item['FULL_NAME'];
                        if (!$item['FULL_NAME']) {
                            echo '&nbsp;';
                        }
                        if ($color == Preferences('HIGHLIGHT')) {
                            echo '';
                        }
                        echo "</TD></TR>";
                        $i++;
                        if ($item['row_color']) {
                            $color = $item['row_color'];
                        } elseif ($color == 'class=even') {
                            $color = $side_color;
                        } else {
                            $color = 'class=even';
                        }
                    }
                }
                echo '</TABLE>';
                echo '</div>';
            }
            echo '<div id="LOx_layer" style="position: absolute; top: 0; left: 0; visibility:hidden;">';
            echo '<div style="page-break-before: inherit;">&nbsp;</div>';
            echo '<TABLE cellpadding=6 id=LOx_table><TR>';
            $i = 1;
            if ($remove && !isset($_REQUEST['_openSIS_PDF']) && $result_count != 0) {
                echo "<TD class=grid id=LO_col{$i}></TD>";
                $i++;
            }
            if ($cols && !isset($_REQUEST['_openSIS_PDF'])) {
                foreach ($column_names as $key => $value) {
                    echo '<TD class=grid id=LO_col' . $i . '><A class=column_heading><b>' . str_replace('controller', '', $value) . '</b></A></TD>';
                    $i++;
                }
            }
            echo '</TR></TABLE>';
            echo '</div>';
        }
    }
}
コード例 #6
0
            }
        }
    }
    unset($_REQUEST['food_service']);
    unset($_SESSION['_REQUEST_vars']['food_service']);
}
if ($_REQUEST['submit']['print']) {
    $events_RET = DBGet(DBQuery("SELECT TITLE,DESCRIPTION,to_char(SCHOOL_DATE,'dd-MON-yy') AS SCHOOL_DATE FROM CALENDAR_EVENTS WHERE SCHOOL_DATE BETWEEN '" . date('d-M-y', $time) . "' AND '" . date('d-M-y', $time_last) . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND (TITLE='" . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . "' OR TITLE='No School')"), array(), array('SCHOOL_DATE'));
    $skip = date("w", $time);
    echo '<!-- MEDIA TOP 1in --><P><span class="center">';
    echo '<TABLE style="border: solid 2px; background-color: #fff;" class="cellpadding-3">' . "\n";
    if ($_REQUEST['_ROSARIO_PDF']) {
        if (is_file('assets/dailymenu' . UserSchool() . '.jpg')) {
            echo '<TR class="center"><TD colspan="7"><img src="assets/dailymenu' . UserSchool() . '.jpg"></TD></TR>' . "\n";
        } else {
            echo '<TR class="center"><TD colspan="7"><span style="color:black" class="sizep2"><b>' . GetSchool(UserSchool()) . '</b></span></TD></TR>' . "\n";
        }
    }
    //modif Francois: display locale with strftime()
    echo '<TR class="center"><TD colspan="2">' . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . '</TD><TD colspan="3"><span style="color:black" class="sizep2"><b>' . ProperDate(date('Y.m.d', mktime(0, 0, 0, $_REQUEST['month'], 1, $_REQUEST['year']))) . '</b></span></TD><TD colspan="2">' . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . '</TD></TR>' . "\n";
    echo '<TR style="text-align:center; background-color:#808080">' . "\n";
    echo '<TD style="width:100px;"><span style="color:white"><b>' . _('Sunday') . '</b></span></TD><TD style="width:100px;"><span style="color:white"><b>' . _('Monday') . '</b></span></TD><TD style="width:100px;"><span style="color:white"><b>' . _("Tuesday") . '</b></span></TD><TD style="width:100px;"><span style="color:white"><b>' . _("Wednesday") . '</b></span></TD><TD style="width:100px;"><span style="color:white"><b>' . _("Thursday") . '</b></span></TD><TD style="width:100px;"><span style="color:white"><b>' . _("Friday") . '</b></span></TD><TD style="width:100px;"><span style="color:white"><b>' . _("Saturday") . '</b></span></TD>' . "\n";
    echo '</TR>';
    if ($skip) {
        echo '<TR style="height:100px;"><TD style="background-color:#C0C0C0;" colspan="' . $skip . '">&nbsp;</TD>' . "\n";
    }
    for ($i = 1; $i <= $last; $i++) {
        if ($skip % 7 == 0) {
            echo '<TR style="height:0px;">';
        }
        $day_time = mktime(0, 0, 0, $_REQUEST['month'], $i, $_REQUEST['year']);
コード例 #7
0
ファイル: PrintCatalog.php プロジェクト: jicheng17/fenghua
        $where = ' AND MARKING_PERIOD_ID=' . $_REQUEST['marking_period_id'];
    }
    $sql = 'select distinct
				(select title from course_subjects where subject_id=(select subject_id from courses where course_id=course_periods.course_id)) as subject,
				(select title from courses where course_id=course_periods.course_id) as COURSE_TITLE,course_id
				from course_periods where school_id=\'' . UserSchool() . '\' and syear=\'' . UserSyear() . '\' ' . $where . ' order by subject,COURSE_TITLE';
    $ret = DBGet(DBQuery($sql));
    if (count($ret)) {
        foreach ($ret as $s_id) {
            echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
            $mark_name_rp = DBGet(DBQuery('SELECT TITLE,SHORT_NAME,\'2\'  FROM school_quarters WHERE MARKING_PERIOD_ID=\'' . $_REQUEST['marking_period_id'] . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' UNION SELECT TITLE,SHORT_NAME,\'1\'  FROM school_semesters WHERE MARKING_PERIOD_ID=\'' . $_REQUEST['marking_period_id'] . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' UNION SELECT TITLE,SHORT_NAME,\'0\'  FROM school_years WHERE MARKING_PERIOD_ID=\'' . $_REQUEST['marking_period_id'] . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' ORDER BY 3'));
            $mark_name_rpt = $mark_name_rp[1]['TITLE'];
            if ($mark_name_rpt != '') {
                echo "<tr><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Course catalog by Term: " . $mark_name_rpt . "</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
            } else {
                echo "<tr><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Course catalog by Term: All</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
            }
            echo '<div align="center">';
            echo '<table border="0" width="97%" align="center"><tr><td><font face=verdana size=-1><b>' . $s_id['SUBJECT'] . '</b></font></td></tr>';
            echo '<tr><td align="right"><table border="0" width="97%"><tr><td><font face=verdana size=-1><b>' . $s_id['COURSE_TITLE'] . '</b></font></td></tr>';
            if (!$_REQUEST['marking_period_id']) {
                $sql_periods = 'SELECT cp.SHORT_NAME,(SELECT TITLE FROM school_periods WHERE period_id=cpv.period_id) AS PERIOD,r.TITLE as ROOM,cpv.DAYS,(SELECT CONCAT(LAST_NAME,\' \',FIRST_NAME,\' \') from staff where staff_id=cp.TEACHER_ID) as TEACHER from course_periods cp,course_period_var cpv,rooms r where cp.course_id=' . $s_id['COURSE_ID'] . ' and cp.syear=\'' . UserSyear() . '\' and cp.course_period_id=cpv.course_period_id and cpv.room_id=r.room_id and cp.school_id=\'' . UserSchool() . '\'';
            } else {
                $sql_periods = 'SELECT distinct cp.SHORT_NAME,(select CONCAT(START_TIME,\' - \',END_TIME,\' \') from school_periods where period_id=cpv.period_id) as PERIOD,r.TITLE as ROOM,cpv.DAYS,(select CONCAT(LAST_NAME,\' \',FIRST_NAME,\' \') from staff where staff_id=cp.TEACHER_ID) as TEACHER from course_periods cp,course_period_var cpv,rooms r where cp.course_id=' . $s_id['COURSE_ID'] . ' and cp.syear=\'' . UserSyear() . '\' and cp.course_period_id=cpv.course_period_id and cpv.room_id=r.room_id and cp.school_id=\'' . UserSchool() . '\' and cp.marking_period_id=\'' . $_REQUEST['marking_period_id'] . '\'';
            }
            $period_list = DBGet(DBQuery($sql_periods));
            ##############################################List Output Generation##################################################
            $columns = array('SHORT_NAME' => 'Course', 'PERIOD' => 'Time', 'DAYS' => 'Days', 'ROOM' => 'Location', 'TEACHER' => 'Teacher');
            echo '<tr><td colspan="2" valign="top" align="right">';
            PrintCatalog($period_list, $columns, 'Course', 'Courses', '', '', array('search' => false));
            echo '</td></tr></table></td></tr></table></td></tr>';
コード例 #8
0
ファイル: PrintSchedules.php プロジェクト: jicheng17/fenghua
                 $gd['DURATION'] = date("g:i A", strtotime($time[0])) . ' to ' . date("g:i A", strtotime($time[1]));
                 unset($time);
                 $temp_duration[$gd['DURATION']] = $gd['DURATION'];
                 $temp_room[$gd['ROOM']] = $gd['ROOM'];
             }
             $RET[$ri][$rdi]['DAYS'] = _makeDays(implode('', $temp_days));
             $RET[$ri][$rdi]['DURATION'] = implode(',', $temp_duration);
             $RET[$ri][$rdi]['ROOM'] = implode(',', $temp_room);
         }
     }
 }
 if (count($RET)) {
     $handle = PDFStart();
     foreach ($RET as $student_id => $courses) {
         echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
         echo "<tr><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Student Schedules Report</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
         unset($_openSIS['DrawHeader']);
         echo '<br>';
         echo '<table  border=0>';
         echo '<tr><td>Student ID:</td>';
         echo '<td>' . $courses[1]['STUDENT_ID'] . '</td></tr>';
         echo '<tr><td>Student Name:</td>';
         echo '<td>' . $courses[1]['FULL_NAME'] . '</td></tr>';
         echo '<tr><td>Student Grade:</td>';
         echo '<td>' . $courses[1]['GRADE_ID'] . '</td></tr>';
         if ($_REQUEST['mailing_labels'] == 'Y') {
             $mail_address = DBGet(DBQuery('SELECT STREET_ADDRESS_1,STREET_ADDRESS_2,CITY,STATE,ZIPCODE FROM student_address WHERE TYPE=\'Mail\' AND  STUDENT_ID=' . $courses[1]['STUDENT_ID']));
             $mail_address = $mail_address[1]['STREET_ADDRESS_1'] . ($mail_address[1]['STREET_ADDRESS_2'] != '' ? ' ' . $mail_address[1]['STREET_ADDRESS_2'] : ' ') . '<br>' . $mail_address[1]['CITY'] . ', ' . $mail_address[1]['STATE'] . ' ' . $mail_address[1]['ZIPCODE'];
             echo '<tr><td>Malling Details:</td>';
             echo '<td>' . ($mail_address != '' ? $mail_address : 'N/A') . '</td></tr>';
         }
コード例 #9
0
ファイル: CopySchool.php プロジェクト: linil/centreSIS
<?php

$tables = array('SCHOOL_PERIODS' => _('School Periods'), 'SCHOOL_MARKING_PERIODS' => _('Marking Periods'), 'REPORT_CARD_GRADES' => _('Report Card Grade Codes'), 'REPORT_CARD_COMMENTS' => _('Report Card Comment Codes'), 'ELIGIBILITY_ACTIVITIES' => _('Eligibility Activity Codes'), 'ATTENDANCE_CODES' => _('Attendance Codes'), 'SCHOOL_GRADELEVELS' => _('Grade Levels'));
$table_list = '<TABLE align=left>';
foreach ($tables as $table => $name) {
    $table_list .= '<TR><TD><INPUT type=checkbox value=Y name=tables[' . $table . '] CHECKED></TD><TD>' . $name . '</TD></TR>';
}
$table_list .= '</TABLE></CENTER><BR><small>' . _('New School\'s Title') . '</small> <INPUT type=text name=title value="' . _('New School') . '"><CENTER>';
DrawHeader(ProgramTitle());
if (Prompt(_('Confirm Copy School'), sprintf(_('Are you sure you want to copy the data for %s to a new school?'), GetSchool(UserSchool())), $table_list)) {
    if (count($_REQUEST['tables'])) {
        $id = DBGet(DBQuery("SELECT " . db_seq_nextval('SCHOOLS_SEQ') . " AS ID" . FROM_DUAL));
        $id = $id[1]['ID'];
        DBQuery("INSERT INTO SCHOOLS (ID,SYEAR,TITLE) values('{$id}','" . UserSyear() . "','" . str_replace("\\'", "''", $_REQUEST['title']) . "')");
        DBQuery("UPDATE STAFF SET SCHOOLS=rtrim(SCHOOLS,',')||',{$id},' WHERE STAFF_ID='" . User('STAFF_ID') . "' AND SCHOOLS IS NOT NULL");
        foreach ($_REQUEST['tables'] as $table => $value) {
            _rollover($table);
        }
    }
    echo '<FORM action=Modules.php?modname=' . $_REQUEST['modname'] . ' method=POST>';
    echo '<script language=JavaScript>parent.side.location="' . $_SESSION['Side_PHP_SELF'] . '?modcat="+parent.side.document.forms[0].modcat.value;</script>';
    DrawHeader('<IMG SRC=assets/check.gif>' . sprintf(_('The data have been copied to a new school called "%s".'), $_REQUEST['title']), '<INPUT type=submit value="' . _('OK') . '>"');
    echo '</FORM>';
    unset($_SESSION['_REQUEST_vars']['tables']);
    unset($_SESSION['_REQUEST_vars']['delete_ok']);
}
function _rollover($table)
{
    global $id;
    switch ($table) {
        case 'SCHOOL_PERIODS':
コード例 #10
0
 if ($row_mp_detail['grandparent_id'] != -1) {
     $mp_string .= ' or s.marking_period_id=' . $row_mp_detail[1]['GRANDPARENT_ID'] . '';
 }
 # -------------------------- Date Function Start ------------------------------- #
 function cov_date($dt)
 {
     $temp_date = explode("-", $dt);
     $final_date = $temp_date[1] . '-' . $temp_date[2] . '-' . $temp_date[0];
     return $final_date;
 }
 # -------------------------- Date Function End ------------------------------- #
 if (count($RET_stu)) {
     $handle = PDFStart();
     foreach ($RET_stu as $student_id => $courses) {
         echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
         echo "<tr><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Student Daily Schedule</div></td><td style=\"font-size:15px; font-weight:bold; padding-top:20px;\"> Schedule for: " . $row_mp_detail[1]['TITLE'] . " : " . cov_date($row_mp_detail[1]['START_DATE']) . " - " . cov_date($row_mp_detail[1]['END_DATE']) . "</td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "</td></tr><tr><td colspan=4 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
         # --------------------------------------- Start Change ------------------------------------------- #
         $st_data = DBGet(DBQuery("SELECT * FROM students WHERE student_id = " . $courses[1]['STUDENT_ID']));
         unset($_openSIS['DrawHeader']);
         echo '<br>';
         echo '<table  border=0>';
         echo '<tr><td>Student ID:</td>';
         echo '<td>' . $courses[1]['STUDENT_ID'] . '</td></tr>';
         echo '<tr><td>Student Name:</td>';
         echo '<td><b>' . $courses[1]['FULL_NAME'] . '</b></td></tr>';
         echo '<tr><td>' . $courses[1]['GRD_LVL'] . '</td>';
         echo '<td>' . $st_data[1]['CUSTOM_10'] . '</td></tr>';
         echo '</table>';
         $sch_exist = DBGet(DBQuery("SELECT COUNT(s.id) AS SCH_COUNT FROM schedule s WHERE s.syear=" . UserSyear() . "\r\n\t\t\t\t\tAND s.student_id='" . $courses[1]['STUDENT_ID'] . "'\r\n\t\t\t\t\tAND s.school_id=" . UserSchool() . "\r\n\t\t\t\t\tAND {$mp_string} )"));
         $sch_exist_yn = $sch_exist[1]['SCH_COUNT'];
         if ($sch_exist_yn != 0) {
コード例 #11
0
ファイル: ReferralLog.php プロジェクト: SoftScape/opensis
     $extra['SELECT'] .= ',r.' . $column;
 }
 $extra['FROM'] .= ',DISCIPLINE_REFERRALS r ';
 $extra['WHERE'] .= " AND r.STUDENT_ID=ssm.STUDENT_ID AND r.SYEAR=ssm.SYEAR ";
 if (strpos($extra['FROM'], 'DISCIPLINE_REFERRALS dr') !== false) {
     $extra['WHERE'] .= ' AND r.ID=dr.ID';
 }
 $extra['group'] = array('STUDENT_ID');
 $extra['ORDER'] = ',r.ENTRY_DATE';
 $RET = GetStuList($extra);
 if (count($RET)) {
     foreach ($RET as $student_id => $referrals) {
         unset($_FOCUS['DrawHeader']);
         DrawHeader(Config('TITLE') . ' ' . _('Discipline Log'));
         DrawHeader($referrals[1]['FULL_NAME'], $referrals[1]['STUDENT_ID']);
         DrawHeader(GetSchool(UserSchool()), $courses[1]['GRADE_ID']);
         if ($start_date && $end_date) {
             DrawHeader(ProperDate($start_date) . ' - ' . ProperDate($end_date));
         } else {
             DrawHeader(_('School Year') . ': ' . UserSyear() . ' - ' . (UserSyear() + 1));
         }
         echo '<BR>';
         foreach ($referrals as $referral) {
             echo '<TABLE cellpadding=5><TR>';
             if ($_REQUEST['elements']['ENTRY_DATE']) {
                 echo '<TD><small><font color=gray>' . _('Date') . ': </font></small><b>' . ProperDate($referral['ENTRY_DATE']) . '</b></TD>';
             }
             if ($_REQUEST['elements']['STAFF_ID']) {
                 echo '<TD><small><font color=gray>' . _('Reporter') . ': </font></small><b>' . GetTeacher($referral['STAFF_ID']) . '</b></TD>';
             }
             $end_tr = false;
コード例 #12
0
        $where = ' AND c.course_id=cp.course_id AND c.grade_level=' . $_REQUEST['id'];
    }
    $sql = 'select distinct
				(select title from course_subjects where subject_id=(select subject_id from courses where course_id=cp.course_id)) as subject,
				(select title from courses where course_id=cp.course_id) as COURSE_TITLE,cp.course_id
				from course_periods cp' . $from . ' where cp.school_id=\'' . UserSchool() . '\' and cp.syear=\'' . UserSyear() . '\' ' . $where . ' order by subject,COURSE_TITLE';
    $ret = DBGet(DBQuery($sql));
    if (count($ret)) {
        foreach ($ret as $s_id) {
            echo "<meta charset='UTF-8'><table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
            $grade_level_RET = DBGet(DBQuery('SELECT TITLE FROM school_gradelevels WHERE id=\'' . $_REQUEST['id'] . '\''));
            $grade_title = $grade_level_RET[1]['TITLE'];
            if ($grade_title != '') {
                echo "<meta charset='UTF-8'><tr><td width=105>" . DrawLogo() . "</td><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">" . _('Course') . "" . _('catalog by Grade Level') . " : " . $grade_title . "</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
            } else {
                echo "<meta charset='UTF-8'><tr><td width=105>" . DrawLogo() . "</td><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">" . _('Course') . "" . _('catalog by Grade Level') . "\t: " . _('All') . "</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
            }
            echo '<div align="center">';
            echo '<table border="0" width="97%" align="center"><tr><td><font face=verdana size=-1><b>' . $s_id['SUBJECT'] . '</b></font></td></tr>';
            echo '<tr><td align="right"><table border="0" width="97%"><tr><td><font face=verdana size=-1><b>' . $s_id['COURSE_TITLE'] . '</b></font></td></tr>';
            $sql_periods = 'SELECT cp.SHORT_NAME,(SELECT TITLE FROM school_periods WHERE period_id=cp.period_id) AS PERIOD,cp.ROOM,cp.DAYS,(SELECT CONCAT(LAST_NAME,\' \',FIRST_NAME,\' \') from staff where staff_id=cp.TEACHER_ID) as TEACHER from course_periods cp where cp.course_id=' . $s_id['COURSE_ID'] . ' and cp.syear=\'' . UserSyear() . '\' and cp.school_id=\'' . UserSchool() . '\'';
            $period_list = DBGet(DBQuery($sql_periods));
            ##############################################List Output Generation##################################################
            $columns = array('SHORT_NAME' => '' . _('Course'), 'PERIOD' => '' . _('Time'), 'DAYS' => '' . _('Days'), 'ROOM' => '' . _('Location'), 'TEACHER' => '' . _('Teacher'));
            echo '<tr><td colspan="2" valign="top" align="right">';
            PrintCatalog($period_list, $columns, _('Course'), _('Courses'), '', '', array('search' => false));
            echo '</td></tr></table></td></tr></table></td></tr>';
            ######################################################################################################################
            echo '</table></div>';
            echo "<meta charset='UTF-8'><div style=\"page-break-before: always;\"></div>";
        }
コード例 #13
0
ファイル: MassAdd.php プロジェクト: SoftScape/opensis
            $_REQUEST['syear'] = $defined[SYEAR];
            $_REQUEST['title'] = $defined[TITLE];
            $_REQUEST['account_id'] = $defined[ACCOUNT_ID];
            $_REQUEST['amount'] = $defined[AMOUNT];
            $_REQUEST['date'] = $defined[DUE_DATE];
        }
        $sql = "INSERT INTO STU_BILLING_FEES \n\t\t\t\t\t(ID,GLOBAL_ID,ACCOUNT_ID,STUDENT_ID,TITLE,AMOUNT,EFFECTIVE_DATE,DUE_DATE,SYEAR,SCHOOL,GRADE) \n\t\t\t\t\t(SELECT " . db_seq_nextval('STU_BILLING_FEES_SEQ') . "," . $global_id[1][GLOBAL_ID] . ",'" . $_REQUEST['account_id'] . "',ssm.STUDENT_ID,\n\t\t\t\t\t\t'" . $_REQUEST['title'] . "','" . $_REQUEST['amount'] . "','{$effective_date}',\n\t\t\t\t\t\t'" . $_REQUEST['date'] . "','" . $_REQUEST['syear'] . "',\n\t\t\t\t\t\t'" . $_REQUEST['school'] . "','" . $_REQUEST['grade'] . "'\n\t\t\t\t\tFROM STU_SCHOOL_MEETS ssm \n\t\t\t\t\tWHERE\n\t\t\t\t\t\tssm.SYEAR='{$_REQUEST['syear']}' AND ssm.ACTIVE='A' ";
        if ($_REQUEST[grade]) {
            $sql .= "AND ssm.GRADE='{$_REQUEST['grade']}' ";
        }
        if ($_REQUEST[school]) {
            $sql .= "AND ssm.SCHOOL='{$_REQUEST['school']}' ";
        }
        $sql .= ')';
        DBQuery($sql);
        $note[] = 'The Student Billing Fee ' . $title . ' has been Applied to all students ' . ($_REQUEST[grade] ? 'in ' . GetGrade($_REQUEST[grade]) : '') . ' ' . ($_REQUEST[school] ? 'at ' . GetSchool($_REQUEST[school]) : '');
        unset($_REQUEST[modfunc]);
    }
}
if ($_REQUEST[modfunc] == 'delete') {
    if (DeletePrompt('fee for all applicable students')) {
        DBQuery("DELETE FROM STU_BILLING_FEES WHERE GLOBAL_ID={$_REQUEST['id']}");
        $note[] = "That Fee has been Deleted for All Applicable Students";
        unset($_REQUEST[modfunc]);
    }
}
if (!$_REQUEST[modfunc]) {
    // LIST
    if ($note) {
        echo '<TABLE width=100%><TR><TD bgcolor=#E8E8E9><font size=-1>';
        ErrorMessage($note, 'note');
コード例 #14
0
ファイル: Letters.php プロジェクト: fabioassuncao/rosariosis
     } else {
         DBQuery("UPDATE TEMPLATES SET TEMPLATE = '" . $REQUEST_letter_text . "' WHERE MODNAME = '" . $_REQUEST['modname'] . "' AND STAFF_ID = '" . User('STAFF_ID') . "'");
     }
     $REQUEST_letter_text = nl2br(str_replace("''", "'", str_replace('  ', ' &nbsp;', $REQUEST_letter_text)));
     $css = true;
     $handle = PDFStart($css);
     foreach ($RET as $student) {
         $student_points = $total_points = 0;
         unset($_ROSARIO['DrawHeader']);
         if ($_REQUEST['mailing_labels'] == 'Y') {
             echo '<BR /><BR /><BR />';
         }
         //DrawHeader(ParseMLField(Config('TITLE')).' Letter');
         DrawHeader('&nbsp;');
         DrawHeader($student['FULL_NAME'], $student['STUDENT_ID']);
         DrawHeader($student['GRADE_ID'], GetSchool(UserSchool()));
         //DrawHeader('',GetMP(GetCurrentMP('QTR',DBDate(),false)));
         DrawHeader(ProperDate(DBDate()));
         if ($_REQUEST['mailing_labels'] == 'Y') {
             echo '<BR /><BR /><TABLE class="width-100p"><TR><TD style="width:50px;"> &nbsp; </TD><TD>' . $student['MAILING_LABEL'] . '</TD></TR></TABLE><BR />';
         }
         $letter_text = $REQUEST_letter_text;
         foreach ($student as $column => $value) {
             $letter_text = str_replace('__' . $column . '__', $value, $letter_text);
         }
         echo '<BR />' . $letter_text;
         echo '<div style="page-break-after: always;"></div>';
     }
     PDFStop($handle);
 } else {
     BackPrompt(_('No Students were found.'));
コード例 #15
0
ファイル: Schools.php プロジェクト: jeffthestampede/excelsior
            echo '
				<SCRIPT language="JavaScript">
				window.location="Side.php?school_id=new&modcat=' . strip_tags(trim($_REQUEST['modcat'])) . '";
				</SCRIPT>
				';
        }
    }
}
if (clean_param($_REQUEST['copy'], PARAM_ALPHAMOD) == 'done') {
    echo '<br><strong>School has been created successfully.</strong>';
} else {
    if (!$_REQUEST['modfunc']) {
        if (!$_REQUEST['new_school']) {
            $schooldata = DBGet(DBQuery('SELECT * FROM schools WHERE ID=\'' . UserSchool() . '\''));
            $schooldata = $schooldata[1];
            $school_name = GetSchool(UserSchool());
        } else {
            $school_name = 'Add a School';
        }
        echo "<FORM name=school  id=school  enctype='multipart/form-data'  METHOD='POST' ACTION='Modules.php?modname=" . strip_tags(trim($_REQUEST['modname'])) . "&modfunc=update&btn=" . $_REQUEST['button'] . "&new_school={$_REQUEST['new_school']}'>";
        PopTable_wo_header('header');
        echo "<table border=0 align=center><tr><td>";
        echo "<TABLE align=center>";
        echo "<TR><TD class='label'><b>School Name:<font color=red>*</font></b></td><td>" . TextInput($schooldata['TITLE'], 'values[TITLE]', '', 'class=cell_floating size=24 onKeyUp=checkDuplicateName(1,this,' . $schooldata['ID'] . '); onBlur=checkDuplicateName(1,this,' . $schooldata['ID'] . ');') . "</td></TR>";
        echo "<input type=hidden id=checkDuplicateNameTable1 value='schools'/>";
        echo "<input type=hidden id=checkDuplicateNameField1 value='title'/>";
        echo "<input type=hidden id=checkDuplicateNameMsg1 value='school name'/>";
        echo "<TR ALIGN=LEFT><TD class='label'><b>Address:<font color=red>*</font></b></TD><td>" . TextInput($schooldata['ADDRESS'], 'values[ADDRESS]', '', 'class=cell_floating maxlength=100 size=24') . "</td></TR>";
        echo "<TR ALIGN=LEFT><TD class='label'><b>City:<font color=red>*</font></b></TD><td>" . TextInput($schooldata['CITY'], 'values[CITY]', '', 'maxlength=100, class=cell_floating size=24') . "</td></TR>";
        echo "<TR ALIGN=LEFT><TD class='label'><b>State:<font color=red>*</font></b></TD><td>" . TextInput($schooldata['STATE'], 'values[STATE]', '', 'maxlength=10 class=cell_floating size=24') . "</td></TR>";
        echo "<TR ALIGN=LEFT><TD class='label'><b>Zip/Postal Code:<font color=red>*</font></b></TD><td>" . TextInput($schooldata['ZIPCODE'], 'values[ZIPCODE]', '', 'maxlength=10 class=cell_floating size=24') . "</td></TR>";
コード例 #16
0
ファイル: PrintClassLists.php プロジェクト: linil/centreSIS
        if (!$extra['DATE'] || DBDate('postgres') > $extra['DATE']) {
            $extra['DATE'] = DBDate();
        }
        // get the fy marking period id, there should be exactly one fy marking period
        $fy_id = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM SCHOOL_MARKING_PERIODS WHERE MP='FY' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
        $fy_id = $fy_id[1]['MARKING_PERIOD_ID'];
        $course_periods_RET = DBGet(DBQuery("SELECT cp.TITLE,cp.COURSE_PERIOD_ID,cp.PERIOD_ID,cp.MARKING_PERIOD_ID,cp.MP,cp.DAYS,c.TITLE AS COURSE_TITLE,cp.TEACHER_ID,(SELECT LAST_NAME||', '||FIRST_NAME FROM STAFF WHERE STAFF_ID=cp.TEACHER_ID) AS TEACHER FROM COURSE_PERIODS cp,COURSES c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.COURSE_PERIOD_ID IN ({$cp_list}) ORDER BY TEACHER"));
        $first_extra = $extra;
        $handle = PDFStart();
        $PCL_UserCoursePeriod = $_SESSION['UserCoursePeriod'];
        // save/restore for teachers
        foreach ($course_periods_RET as $teacher_id => $course_period) {
            unset($_CENTRE['DrawHeader']);
            DrawHeader(Config('TITLE') . ' - ' . _('Class List'));
            DrawHeader($course_period['TEACHER'], $course_period['COURSE_TITLE'] . ' ' . GetPeriod($course_period['PERIOD_ID']) . ($course_period['MARKING_PERIOD_ID'] != "{$fy_id}" ? ' - ' . GetMP($course_period['MARKING_PERIOD_ID']) : '') . (strlen($course_period['DAYS']) < 5 ? ' - ' . $course_period['DAYS'] : ''));
            DrawHeader(GetSchool(UserSchool()), ProperDate(DBDate()));
            $_CENTRE['User'] = array(1 => array('STAFF_ID' => $course_period['TEACHER_ID'], 'NAME' => 'name', 'PROFILE' => 'teacher', 'SCHOOLS' => ',' . UserSchool() . ',', 'SYEAR' => UserSyear()));
            $_SESSION['UserCoursePeriod'] = $course_period['COURSE_PERIOD_ID'];
            $extra = $first_extra;
            $extra['MP'] = $course_period['MARKING_PERIOD_ID'];
            $extra['MPTable'] = $course_period['MP'];
            $extra['suppress_save'] = true;
            include 'modules/misc/Export.php';
            echo '<!-- NEW PAGE -->';
        }
        $_SESSION['UserCoursePeriod'] = $PCL_UserCoursePeriod;
        PDFStop($handle);
    } else {
        BackPrompt(_('You must choose at least one course period.'));
    }
}
コード例 #17
0
ファイル: PrintRequests.php プロジェクト: linil/centreSIS
                    unset($_CENTRE['DrawHeader']);
                    DrawHeader(Config('TITLE') . ' - ' . _('Student Requests'));
                    DrawHeader($address[1]['FULL_NAME'], $address[1]['STUDENT_ID']);
                    DrawHeader($address[1]['GRADE_ID']);
                    DrawHeader(GetSchool(UserSchool()));
                    DrawHeader(ProperDate(DBDate()));
                    echo '<BR><BR><TABLE width=100%><TR><TD width=50> &nbsp; </TD><TD>' . $address[1]['MAILING_LABEL'] . '</TD></TR></TABLE><BR>';
                    ListOutput($address, $columns, _('Request'), _('Requests'), array(), array(), array('center' => false, 'print' => false));
                    echo '<!-- NEW PAGE -->';
                }
            } else {
                unset($_CENTRE['DrawHeader']);
                DrawHeader(Config('TITLE') . ' - ' . _('Student Requests'));
                DrawHeader($courses[1]['FULL_NAME'], $courses[1]['STUDENT_ID']);
                DrawHeader($courses[1]['GRADE_ID']);
                DrawHeader(GetSchool(UserSchool()));
                DrawHeader(ProperDate(DBDate()));
                ListOutput($courses, $columns, _('Request'), _('Requests'), array(), array(), array('center' => false, 'print' => false));
                echo '<!-- NEW PAGE -->';
            }
        }
        PDFStop($handle);
    } else {
        BackPrompt(_('No Students were found.'));
    }
}
function _makeExtra($value, $title = '')
{
    global $THIS_RET;
    if ($THIS_RET['WITH_TEACHER_ID']) {
        $return .= Localize('colon', _('With')) . '&nbsp;' . GetTeacher($THIS_RET['WITH_TEACHER_ID']) . '<BR>';
コード例 #18
0
ファイル: CourseCatalog.php プロジェクト: jicheng17/fenghua
function CreateList($dli = '', $pli = '', $sli = '', $cli = '', $mp = '', $mp_name = '')
{
    $PHP_tmp_SELF = PreparePHP_SELF($tmp_REQUEST);
    if ($sli != '') {
        $s_ret = DBGet(DBQuery("select title from course_subjects where subject_id='" . $sli . "'"));
    }
    if ($cli != '') {
        $c_ret = DBGet(DBQuery("select title from courses where course_id='" . $cli . "'"));
    }
    if ($mp != '') {
        $sql = 'SELECT MARKING_PERIOD_ID,TITLE,SHORT_NAME,\'2\'  FROM school_quarters WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' and marking_period_id=\'' . $mp . '\' UNION SELECT MARKING_PERIOD_ID,TITLE,SHORT_NAME,\'1\' FROM school_semesters WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' and marking_period_id=\'' . $mp . '\' UNION SELECT MARKING_PERIOD_ID,TITLE,SHORT_NAME,\'0\'  FROM school_years WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' and marking_period_id=\'' . $mp . '\' ORDER BY 3,4';
        $mp_ret1 = DBGet(DBQuery($sql));
        $mp_name = $mp_ret1[1]['TITLE'];
    }
    if ($mp == '') {
        $where = '';
        $heading = "All available classes";
    } else {
        if ($sli == '') {
            $where = 'and marking_period_id=\'' . $mp . '\' and course_id in (select course_id from  courses where subject_id in (select subject_id from course_subjects))';
            $heading = "All available classes for <font color='black'>" . $mp_name . " -> " . $d_ret[1]['TITLE'] . " -> " . $p_ret[1]['TITLE'] . "</font>";
        } else {
            if ($cli == '') {
                $where = 'and marking_period_id=\'' . $mp . '\' and course_id in (select Course_Id from courses where subject_id = \'' . $_REQUEST['subject_id'] . '\' and School_Id=\'' . UserSchool() . '\')';
                $heading = "All available classes for <font color='black'>" . $mp_name . " -> " . $d_ret[1]['TITLE'] . " -> " . $p_ret[1]['TITLE'] . " -> " . $s_ret[1]['TITLE'] . "</font>";
            } else {
                $where = 'and marking_period_id=\'' . $mp . '\' and course_id=\'' . $cli . '\'';
                $heading = "All available classes for <font color='black'>" . $mp_name . " -> " . $d_ret[1]['TITLE'] . " -> " . $p_ret[1]['TITLE'] . " -> " . $s_ret[1]['TITLE'] . " -> " . $c_ret[1]['TITLE'] . "</font>";
            }
        }
    }
    $sql = 'select
                (select title from courses where course_id=course_periods.course_id) as course,
                (select title from course_subjects where subject_id=(select subject_id from courses where course_id=course_periods.course_id)) as subject,
                short_name,(select CONCAT(START_TIME,\' - \',END_TIME,\' \') from school_periods where period_id=course_period_var.period_id) as period_time, (select title from school_periods where period_id=course_period_var.period_id) as period, marking_period_id, (select title from marking_periods where marking_period_id=course_periods.marking_period_id) as mp,
                (select CONCAT(LAST_NAME,\' \',FIRST_NAME,\' \') from staff where staff_id=course_periods.teacher_id) as teacher, rooms.title as location,days,course_periods.course_period_id,course_periods.begin_date,course_periods.end_date,course_periods.SCHEDULE_TYPE,course_period_var.ID AS CPV_ID from course_periods,course_period_var,rooms where course_periods.school_id=\'' . UserSchool() . '\' and course_period_var.room_id=rooms.room_id and course_periods.course_period_id=course_period_var.course_period_id and course_periods.syear=\'' . UserSyear() . '\' ' . $where . '  GROUP BY course_period_var.COURSE_PERIOD_ID ORDER BY course_period_var.ID';
    $ret_temp = DBGet(DBQuery($sql));
    $ret = array();
    $i = 1;
    $days_arr = array("Monday" => 'M', "Tuesday" => 'T', "Wednesday" => 'W', "Thursday" => 'H', "Friday" => 'F', "Saturday" => 'S', "Sunday" => 'U');
    echo "<br><br>";
    foreach ($ret_temp as $ri => $rd) {
        $time = explode(' - ', $rd['PERIOD_TIME']);
        $rd['PERIOD_TIME'] = date("g:i A", strtotime($time[0])) . ' - ' . date("g:i A", strtotime($time[1]));
        unset($time);
        if ($rd['SCHEDULE_TYPE'] == 'FIXED') {
            $ret[$i] = $rd;
        } else {
            $get_det = DBGet(DBQuery('SELECT cpv.*,CONCAT(sp.START_TIME,\' - \',sp.END_TIME,\' \') as PERIOD_TIME,sp.TITLE as PERIOD,r.TITLE AS LOCATION FROM course_period_var cpv,school_periods sp,rooms r WHERE cpv.COURSE_PERIOD_ID=' . $rd['COURSE_PERIOD_ID'] . ' AND cpv.PERIOD_ID=sp.PERIOD_ID AND cpv.ROOM_ID=r.ROOM_ID'));
            $ret[$i] = $rd;
            if (count($get_det) > 1) {
                foreach ($get_det as $gi => $gd) {
                    if ($rd['CPV_ID'] != $gd['ID']) {
                        $time = explode(' - ', $gd['PERIOD_TIME']);
                        $gd['PERIOD_TIME'] = date("g:i A", strtotime($time[0])) . ' - ' . date("g:i A", strtotime($time[1]));
                        unset($time);
                        $ret[$i]['PERIOD_TIME'] = $ret[$i]['PERIOD_TIME'] . ' , ' . $gd['PERIOD_TIME'];
                        $ret[$i]['PERIOD'] = $ret[$i]['PERIOD'] . ' , ' . $gd['PERIOD'];
                        $ret[$i]['LOCATION'] = $ret[$i]['LOCATION'] . ' , ' . $gd['LOCATION'];
                        if ($rd['SCHEDULE_TYPE'] == 'VARIABLE') {
                            $ret[$i]['DAYS'] = $ret[$i]['DAYS'] . ' , ' . $gd['DAYS'];
                        } else {
                            $ret[$i]['DAYS'] = $ret[$i]['DAYS'] . ' , ' . $days_arr[$gd['DAYS']];
                        }
                    }
                }
                $final_days = explode(' , ', $ret[$i]['DAYS']);
                $final_days = array_unique($final_days);
                $final_days = implode(' , ', $final_days);
                $ret[$i]['DAYS'] = $final_days;
            }
        }
        $i++;
    }
    //        exit;
    $html = "<b>" . $heading . "</b><br>\n        <A HREF=" . str_replace('Modules.php', 'ForExport.php', $PHP_tmp_SELF) . "&create_excel=true&LO_save=1&_openSIS_PDF=true > <IMG SRC=assets/download.png border=0 vspace=0 hspace=0></A>\n        <br>";
    $html .= "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
    $html .= "<tr><td  style=\"font-size:15px; font-weight:bold;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Student Schedules Report</div></td><td align=right style=\"padding-top:10px;\">" . ProperDate(DBDate()) . "</td></tr><tr><td colspan=2 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
    ########################################List Output Generation ####################################################
    $columns = array('SUBJECT' => 'Subject', 'COURSE' => 'Course', 'MP' => 'Marking Period', 'PERIOD_TIME' => 'Time', 'PERIOD' => 'Period', 'DAYS' => 'Days', 'LOCATION' => 'Location', 'TEACHER' => 'Teacher');
    if ($_REQUEST['print'] == 'list') {
        echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
        echo "<tr><td  style=\"font-size:15px; font-weight:bold;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Course Catalog</div></td><td align=right style=\"padding-top:10px;\">" . ProperDate(DBDate()) . "</td></tr><tr><td colspan=2 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
    }
    echo '<style type="text/css">.print-div td{font-size:12px;font-family:arial;}</style><div class="print-div">';
    ListOutputFloat($ret, $columns, 'Course', 'Courses', '', '', array('search' => false, 'count' => false));
    echo '</div>';
    echo "<div style=\"page-break-before: always;\"></div>";
    ##########################################################################################################
}
コード例 #19
0
    //============================
    $tables = array('staff' => 'Staff', 'school_periods' => 'School Periods', 'school_years' => 'Marking Periods', 'school_calendars' => 'Calendars', 'report_card_grade_scales' => 'Report Card Grade Codes', 'course_subjects' => 'Subjects', 'courses' => 'Courses', 'course_periods' => 'Course Periods', 'student_enrollment' => 'Students', 'report_card_comments' => 'Report Card Comment Codes', 'honor_roll' => 'Honor Roll Setup', 'attendance_codes' => 'Attendance Codes', 'student_enrollment_codes' => 'Student Enrollment Codes');
    $no_school_tables = array('student_enrollment_codes' => true, 'staff' => true);
    $required = array('staff' => true, 'school_years' => true, 'student_enrollment' => true, 'student_enrollment_codes' => true);
    $table_list = '<TABLE align=center>';
    $table_list .= '<tr><td colspan=3 class=clear></td></tr>';
    foreach ($tables as $table => $name) {
        $table_list .= '<TR><td width=1%></td><TD width=5%><INPUT type=checkbox value=Y  name=' . $table . ' CHECKED ' . ($required[$table] ? ' disabled="disabled"' : '') . ' onchange="validate_rollover(this.form,this)"></TD><TD width=94%>' . $name . '</TD></TR>';
    }
    $table_list .= '</TABLE>';
    //===============================
    if (Prompt_rollover('Confirm Rollover', 'Are you sure you want to roll the data for ' . $cur_session . ' to the next school year?', $table_list)) {
        echo "<script type='text/javascript'>back_before_roll();</script>";
    }
} else {
    Prompt_rollover_back('Rollover Completed', 'Data has been rolledover for ' . $cur_session . ' for ' . GetSchool(UserSchool()) . '');
}
foreach ($tables as $table => $name) {
    echo '<INPUT type=hidden name=hide_' . $table . ' id="chk_' . $table . '" value="' . $_REQUEST[$table] . '">';
}
echo '   
		<td align="left" valign="top">
        <TABLE><TR><TD><div id="staff"></div></TD></TR>
        <TR><TD><div id="school_periods"></div></TD></TR>
        <TR><TD><div id="school_years"></div></TD></TR>
        <TR><TD><div id="attendance_calendars"></div></TD></TR>
        <TR><TD><div id="report_card_grade_scales"></div></TD></TR>
        <TR><TD><div id="course_subjects"></div></TD></TR>
        <TR><TD><div id="courses"></div></TD></TR>
        <TR><TD><div id="course_periods"></div></TD></TR>
        <TR><TD><div id="student_enrollment"></div></TD></TR>
コード例 #20
0
function CreateList($dli = '', $pli = '', $sli = '', $cli = '', $mp = '', $mp_name = '')
{
    $PHP_tmp_SELF = PreparePHP_SELF($tmp_REQUEST);
    if ($sli != '') {
        $s_ret = DBGet(DBQuery("select title from COURSE_SUBJECTS where subject_id='" . $sli . "'"));
    }
    if ($cli != '') {
        $c_ret = DBGet(DBQuery("select title from COURSES where course_id='" . $cli . "'"));
    }
    if ($mp != '') {
        $sql = "SELECT MARKING_PERIOD_ID,TITLE,SHORT_NAME,'2'  FROM SCHOOL_QUARTERS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' and marking_period_id='" . $mp . "' UNION SELECT MARKING_PERIOD_ID,TITLE,SHORT_NAME,'1' FROM SCHOOL_SEMESTERS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' and marking_period_id='" . $mp . "' UNION SELECT MARKING_PERIOD_ID,TITLE,SHORT_NAME,'0'  FROM SCHOOL_YEARS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' and marking_period_id='" . $mp . "' ORDER BY 3,4";
        $mp_ret1 = DBGet(DBQuery($sql));
        $mp_name = $mp_ret1[1]['TITLE'];
    }
    if ($mp == '') {
        $where = '';
        $heading = "All available classes";
    } else {
        if ($sli == '') {
            $where = "and marking_period_id='" . $mp . "' and course_id in (select course_id from  COURSES where subject_id in (select subject_id from COURSE_SUBJECTS))";
            $heading = "All available classes for <font color='black'>" . $mp_name . " -> " . $d_ret[1]['TITLE'] . " -> " . $p_ret[1]['TITLE'] . "</font>";
        } else {
            if ($cli == '') {
                $where = "and marking_period_id='" . $mp . "' and course_id in (select Course_Id from COURSES where subject_id = '" . $_REQUEST['subject_id'] . "' and School_Id='" . UserSchool() . "')";
                #$where = "and marking_period_id='".$mp."' and course_id in (select Course_Id from courses where subject_id = '".$_REQUEST['subject_id']."' and School_Id='".UserSchool()."')";
                $heading = "All available classes for <font color='black'>" . $mp_name . " -> " . $d_ret[1]['TITLE'] . " -> " . $p_ret[1]['TITLE'] . " -> " . $s_ret[1]['TITLE'] . "</font>";
            } else {
                $where = "and marking_period_id='" . $mp . "' and course_id='" . $cli . "'";
                $heading = "All available classes for <font color='black'>" . $mp_name . " -> " . $d_ret[1]['TITLE'] . " -> " . $p_ret[1]['TITLE'] . " -> " . $s_ret[1]['TITLE'] . " -> " . $c_ret[1]['TITLE'] . "</font>";
            }
        }
    }
    /*
    	
    	$sql = "select
                    (select title from COURSES where course_id=COURSE_PERIODS.course_id) as course,
                    (select title from COURSE_SUBJECTS where subject_id=(select subject_id from COURSES where 						course_id=COURSE_PERIODS.course_id)) as subject,
                    short_name,(select CONCAT(START_TIME,' - ',END_TIME,' ') from SCHOOL_PERIODS where period_id=COURSE_PERIODS.period_id) as period,
    
                    marking_period_id,
                    (select CONCAT(LAST_NAME,' ',FIRST_NAME,' ',MIDDLE_NAME,' ') from STAFF where staff_id=COURSE_PERIODS.teacher_id) as teacher,
                    room as location,days,course_period_id
                    from COURSE_PERIODS where school_id='".UserSchool()."' and syear='".UserSyear()."' ".$where."";
    */
    $sql = "select\r\n                (select title from COURSES where course_id=COURSE_PERIODS.course_id) as course,\r\n                (select title from COURSE_SUBJECTS where subject_id=(select subject_id from COURSES where \t\t\t\t\t\tcourse_id=COURSE_PERIODS.course_id)) as subject,\r\n                short_name,(select CONCAT(START_TIME,' - ',END_TIME,' ') from SCHOOL_PERIODS where period_id=COURSE_PERIODS.period_id) as period_time, (select title from SCHOOL_PERIODS where period_id=COURSE_PERIODS.period_id) as period, marking_period_id, (select title from MARKING_PERIODS where marking_period_id=COURSE_PERIODS.marking_period_id) as mp,\r\n                (select CONCAT(LAST_NAME,' ',FIRST_NAME,' ') from STAFF where staff_id=COURSE_PERIODS.teacher_id) as teacher, room as location,days,course_period_id from COURSE_PERIODS where school_id='" . UserSchool() . "' and syear='" . UserSyear() . "' " . $where . "";
    $ret = DBGet(DBQuery($sql));
    $html = "<b>" . $heading . "</b><br>\r\n        <A HREF=" . str_replace('Modules.php', 'for_export.php', $PHP_tmp_SELF) . "&create_excel=true&LO_save=1&_openSIS_PDF=true > <IMG SRC=assets/download.png border=0 vspace=0 hspace=0></A>\r\n        <br>";
    $html .= "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
    $html .= "<tr><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Student Schedules Report</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=2 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
    ########################################List Output Generation ####################################################
    $columns = array('SUBJECT' => 'Subject', 'COURSE' => 'Course', 'MP' => 'Marking Period', 'PERIOD_TIME' => 'Time', 'PERIOD' => 'Period', 'DAYS' => 'Days', 'LOCATION' => 'Location', 'TEACHER' => 'Teacher');
    if ($_REQUEST['print'] == 'list') {
        echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
        echo "<tr><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Course Catalog</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=2 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
    }
    ListOutputFloat($ret, $columns, 'Course', 'Courses', '', '', array('search' => false, 'count' => false));
    echo "<div style=\"page-break-before: always;\"></div>";
    ##########################################################################################################
}
コード例 #21
0
ファイル: FDFReportCards.php プロジェクト: linil/centreSIS
         $this_PDF = str_replace('/T(values[abs][' . GetMP($mp, 'SORT_ORDER') . '])', "/T(values[{$student_count}][abs][1])", $this_PDF);
         $this_PDF = str_replace('(default[abs][' . GetMP($mp, 'SORT_ORDER') . '])', '( ' . count($attendance_day_RET[$student_id][$qtr]) . ' )', $this_PDF);
     }
     foreach ($_REQUEST['mp_arr'] as $mp) {
         $columns[$mp] = GetMP($mp, $mp_TITLE);
     }
     $this_PDF = str_replace('/T(values[students][USER_NAME])', "/T(values[{$student_count}][students][USER_NAME])", $this_PDF);
     $this_PDF = str_replace('(default[students][USER_NAME])', '(' . User('NAME') . ')', $this_PDF);
     $this_PDF = str_replace('/T(values[students][FULL_NAME])', "/T(values[{$student_count}][students][FULL_NAME])", $this_PDF);
     $this_PDF = str_replace('(default[students][FULL_NAME])', '(' . $course_periods[$course_period_id][key($course_periods[$course_period_id])][1]['FULL_NAME'] . ')', $this_PDF);
     $this_PDF = str_replace('/T(values[students][STUDENT_ID])', "/T(values[{$student_count}][students][STUDENT_ID])", $this_PDF);
     $this_PDF = str_replace('(default[students][STUDENT_ID])', '(' . $course_periods[$course_period_id][key($course_periods[$course_period_id])][1]['STUDENT_ID'] . ')', $this_PDF);
     $this_PDF = str_replace('/T(values[students][GRADE_ID])', "/T(values[{$student_count}][students][GRADE_ID])", $this_PDF);
     $this_PDF = str_replace('(default[students][GRADE_ID])', '(' . ereg_replace("<!-- [0-9]+ -->", '', $course_periods[$course_period_id][key($course_periods[$course_period_id])][1]['GRADE_ID']) . ')', $this_PDF);
     $this_PDF = str_replace('/T(values[students][SCHOOL])', "/T(values[{$student_count}][students][SCHOOL])", $this_PDF);
     $this_PDF = str_replace('(default[students][SCHOOL])', '(' . GetSchool(UserSchool()) . ')', $this_PDF);
     $this_PDF = str_replace('/T(values[students][SYEAR])', "/T(values[{$student_count}][students][SYEAR])", $this_PDF);
     $this_PDF = str_replace('(default[students][SYEAR])', '(' . UserSyear() . ' - ' . (UserSyear() + 1) . ')', $this_PDF);
     fwrite($FP, $this_PDF);
     @fclose($FP);
     $card = $tempfile;
     $tempfile = tempnam('', 'html');
     exec("/usr/local/bin/pdftk {$card} output {$tempfile} flatten");
     @unlink($card);
     $cards .= $tempfile . " *\n";
     $delete_cards[] = $tempfile;
     $count_cards++;
 }
 $cards = substr($cards, 0, -1);
 $sourcefile = tempnam('', 'html');
 $FP = @fopen($sourcefile, "w");
コード例 #22
0
     $addresses = array(0 => array());
 }
 foreach ($addresses as $address) {
     unset($_ROSARIO['DrawHeader']);
     if ($_REQUEST['mailing_labels'] == 'Y') {
         echo '<BR /><BR /><BR />';
     }
     //modif Francois: add school logo
     $logo_pic = 'assets/school_logo.jpg';
     $picwidth = 110;
     if (file_exists($logo_pic)) {
         echo '<TABLE><TR><TD style="width:' . $picwidth . 'px;"><img src="' . $logo_pic . '" width="' . $picwidth . '" /></TD><TD class="width-100p">';
     }
     DrawHeader(_('Report Card'));
     DrawHeader($mps[key($mps)][1]['FULL_NAME'], $mps[key($mps)][1]['STUDENT_ID']);
     DrawHeader($mps[key($mps)][1]['GRADE_ID'], GetSchool(UserSchool()));
     //modif Francois: add school year
     DrawHeader(_('School Year') . ': ' . FormatSyear(UserSyear(), Config('SCHOOL_SYEAR_OVER_2_YEARS')));
     $count_lines = 4;
     if ($_REQUEST['elements']['mp_absences'] == 'Y') {
         $count = 0;
         //modif Francois: fix error Invalid argument supplied for foreach()
         if (is_array($attendance_day_RET[$student_id][$last_mp])) {
             foreach ($attendance_day_RET[$student_id][$last_mp] as $abs) {
                 $count += 1 - $abs['STATE_VALUE'];
             }
         }
         $mp_absences = Localize('colon', sprintf(_('Absences in %s'), GetMP($last_mp, 'TITLE'))) . ' ' . $count;
     }
     if ($_REQUEST['elements']['ytd_absences'] == 'Y') {
         $count = 0;
コード例 #23
0
ファイル: CopySchool.php プロジェクト: SoftScape/opensis
#  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/>.
#**************************************************************************
$tables = array('SCHOOL_PERIODS' => 'School Periods', 'SCHOOL_YEARS' => 'Marking Periods', 'REPORT_CARD_GRADES' => 'Report Card Grade Codes', 'REPORT_CARD_COMMENTS' => 'Report Card Comment Codes', 'ELIGIBILITY_ACTIVITIES' => 'Eligibility Activity Codes', 'ATTENDANCE_CODES' => 'Attendance Codes', 'SCHOOL_GRADELEVELS' => 'Grade Levels');
$table_list = '<TABLE align=center cellspacing="5" cellpadding="3" border=0><tr><td ><b>New School\'s Title:&nbsp;&nbsp;</b><INPUT type=text name=title value="New School"  class="cell_medium_wide"></td></tr>';
foreach ($tables as $table => $name) {
    $table_list .= '<TR><TD><INPUT type=checkbox value=Y name=tables[' . $table . '] CHECKED> ' . $name . '</TD></TR>';
}
$table_list .= '</TABLE>';
DrawBC("School Setup > " . ProgramTitle());
if (Prompt_Copy_School('Confirm Copy School', 'Are you sure you want to copy the data for ' . GetSchool(UserSchool()) . ' to a new school?', $table_list)) {
    if (count($_REQUEST['tables'])) {
        $id = DBGet(DBQuery("SELECT " . db_seq_nextval('SCHOOLS_SEQ') . " AS ID" . FROM_DUAL));
        $id = $id[1]['ID'];
        DBQuery("INSERT INTO SCHOOLS (ID,TITLE) values('" . $id . "','" . str_replace("\\'", "''", $_REQUEST['title']) . "')");
        DBQuery("UPDATE STAFF SET SCHOOLS=CONCAT(SCHOOLS,',','{$id}') WHERE STAFF_ID='" . User('STAFF_ID') . "' AND SCHOOLS IS NOT NULL");
        foreach ($_REQUEST['tables'] as $table => $value) {
            _rollover($table);
        }
    }
    echo '<FORM action=Modules.php?modname=' . $_REQUEST['modname'] . ' method=POST>';
    echo '<script language=JavaScript>parent.side.location="' . $_SESSION['Side_PHP_SELF'] . '?modcat="+parent.side.document.forms[0].modcat.value;</script>';
    echo "<br><br>";
    DrawHeaderHome('<IMG SRC=assets/check.gif> &nbsp;The data have been copied to a new school called "' . $_REQUEST['title'] . '".', '<INPUT  type=submit value=OK class="btn_medium">');
    echo '</FORM>';
    unset($_SESSION['_REQUEST_vars']['tables']);
コード例 #24
0
 }
 if ($_REQUEST['elements']['comments'] == 'Y') {
     foreach ($all_commentsA_RET as $comment) {
         $columns['C' . $comment[1]['ID']] = $comment[1]['TITLE'];
     }
     $columns['COMMENT'] = 'Comment';
 }
 if ($_REQUEST['elements']['gpa'] == 'Y') {
     $columns['GPA'] = 'GPA';
 }
 //start of report card print
 $handle = PDFStart();
 if (!isset($_REQUEST['elements']['percents']) || isset($_REQUEST['elements']['percents']) && $_REQUEST['elements']['percents'] == 'Y') {
     foreach ($RET as $student_id => $course_periods) {
         echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
         echo "<tr><td width=105>" . DrawLogo() . "</td><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . ' (' . $cur_session . ')' . "<div style=\"font-size:12px;\">Student Report Card</div></td><td align=right style=\"padding-top:20px\">" . ProperDate(DBDate()) . "<br \\>Powered by openSIS</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
         echo '<!-- MEDIA SIZE 8.5x11in -->';
         if (!isset($_REQUEST['elements']['percents']) || isset($_REQUEST['elements']['percents']) && $_REQUEST['elements']['percents'] == 'Y') {
             $comments_arr = array();
             $comments_arr_key = count($all_commentsA_RET) > 0;
             unset($grades_RET);
             $i = 0;
             $total_grade_point = 0;
             $Total_Credit_Hr_Attempted = 0;
             foreach ($course_periods as $course_period_id => $mps) {
                 $i++;
                 $grades_RET[$i]['COURSE_TITLE'] = $mps[key($mps)][1]['COURSE_TITLE'];
                 $grades_RET[$i]['TEACHER'] = $mps[key($mps)][1]['TEACHER'];
                 $grades_RET[$i]['TEACHER_ID'] = $mps[key($mps)][1]['TEACHER_ID'];
                 $grades_RET[$i]['CGPA'] = round($mps[key($mps)][1]['UNWEIGHTED_GPA'], 3);
                 if ($mps[key($mps)][1]['WEIGHTED_GP'] && $mps[key($mps)][1]['COURSE_WEIGHT']) {
コード例 #25
0
 ////	$extra['functions']['TEACHER'] = '_makeTeacher';
 //	$extra['group']	= array('STUDENT_ID');
 //	//$extra['group']	= array('STUDENT_ID','COURSE_PERIOD_ID');
 //        $RET = GetStuList($extra);
 // print_r($RET);
 $RET = DBGet(DBQuery("SELECT DISTINCT s.STUDENT_ID, CONCAT(s.LAST_NAME,', ',coalesce(s.COMMON_NAME,s.FIRST_NAME)) AS FULL_NAME FROM students s,student_standards ss, report_card_grades rcg, course_periods cp\r\n        WHERE ss.GRADE_ID=rcg.ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND s.STUDENT_ID=ss.STUDENT_ID\r\n        AND s.STUDENT_ID IN ({$st_list})\r\n        "));
 if (count($RET)) {
     $grade_RET = DBGet(DBQuery("SELECT TITLE, COMMENT FROM report_card_grades WHERE SCHOOL_ID=" . UserSchool() . " AND SYEAR=" . UserSyear()));
     $handle = PDFStart();
     foreach ($RET as $student) {
         /*echo "SELECT DISTINCT cp.COURSE_PERIOD_ID AS CP_ID, cp.TITLE AS CP_TITLE, cp.MARKING_PERIOD_ID, CONCAT(st.TITLE, ' ', st.LAST_NAME, ' ',st.FIRST_NAME) AS TEACHER FROM STUDENTS s,STUDENT_STANDARDS ss, REPORT_CARD_GRADES rcg, COURSE_PERIODS cp, MARKING_PERIODS mp, STAFF st
           WHERE ss.GRADE_ID=rcg.ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND s.STUDENT_ID=ss.STUDENT_ID AND cp.MARKING_PERIOD_ID=mp.MARKING_PERIOD_ID AND cp.TEACHER_ID=st.STAFF_ID
           AND s.STUDENT_ID=$student[STUDENT_ID]";*/
         $periods = DBGet(DBQuery("SELECT DISTINCT cp.COURSE_PERIOD_ID AS CP_ID, cp.TITLE AS CP_TITLE, cp.MARKING_PERIOD_ID, CONCAT(st.TITLE, ' ', st.LAST_NAME, ' ',st.FIRST_NAME) AS TEACHER FROM students s,student_standards ss, report_card_grades rcg, course_periods cp, marking_periods mp, staff st\r\n                WHERE ss.GRADE_ID=rcg.ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND s.STUDENT_ID=ss.STUDENT_ID AND cp.MARKING_PERIOD_ID=mp.MARKING_PERIOD_ID AND cp.TEACHER_ID=st.STAFF_ID\r\n                AND s.STUDENT_ID={$student['STUDENT_ID']}"));
         echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
         echo "<tr><td style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Elementary Grades " . GetMp(UserMp()) . "</div><div style=\"font-size:12px;\">Student: " . $student[FULL_NAME] . " &nbsp;( " . $student[STUDENT_ID] . " )</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=2 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
         echo "<table >";
         echo '<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0" class="course_period_tbl">';
         echo '<TR><TH align="left">Attendance</TH>';
         $mp_RET = DBGet(DBQuery("SELECT DISTINCT mp.TITLE, mp.MARKING_PERIOD_ID FROM marking_periods mp, course_periods cp, attendance_period ap\r\n                WHERE mp.MARKING_PERIOD_ID=cp.MARKING_PERIOD_ID\r\n                AND cp.SCHOOL_ID=" . UserSchool() . " AND cp.SYEAR=" . UserSyear() . "\r\n                AND cp.COURSE_PERIOD_ID=ap.COURSE_PERIOD_ID AND ap.STUDENT_ID={$student['STUDENT_ID']}"));
         $mp_name = DBGet(DBQuery("SELECT DISTINCT mp.SHORT_NAME,mp.MARKING_PERIOD_ID FROM marking_periods mp WHERE mp.SCHOOL_ID=" . UserSchool() . " AND mp.SYEAR=" . UserSyear() . ""));
         foreach ($mp_name as $mp1) {
             echo '<TH align="center" width="60px">' . $mp1[SHORT_NAME] . '</TH>';
         }
         echo '</TR>';
         $atteadance_code_RET = DBGet(DBQuery("SELECT ID, TITLE FROM attendance_codes WHERE SCHOOL_ID=" . UserSchool() . " AND SYEAR=" . UserSyear() . " ORDER BY SORT_ORDER, TITLE"));
         foreach ($atteadance_code_RET as $ac) {
             echo '<TR>';
             echo '<TD class="course_period">' . $ac[TITLE] . '</TD>';
             //echo '<TD class="course_period"></TD>';
             //echo '<TD class="course_period"></TD>';
コード例 #26
0
ファイル: DailyMenus.php プロジェクト: SoftScape/opensis
        }
    }
    unset($_REQUEST['food_service']);
    unset($_SESSION['_REQUEST_vars']['food_service']);
}
if ($_REQUEST['submit']['print']) {
    $events_RET = DBGet(DBQuery("SELECT TITLE,DESCRIPTION,DATE_FORMAT(SCHOOL_DATE,'%d-%b-%y') AS SCHOOL_DATE FROM CALENDAR_EVENTS WHERE SCHOOL_DATE BETWEEN '" . date('d-M-y', $time) . "' AND '" . date('d-M-y', $time_last) . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND (TITLE='" . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . "' OR TITLE='No School')"), array(), array('SCHOOL_DATE'));
    $skip = date("w", $time);
    echo "<!-- MEDIA TOP 1in -->\n<P><CENTER>\n";
    echo "<TABLE border=2 cellpadding=3 bgcolor=#FFFFFF>\n";
    if ($_REQUEST['_CENTRE_PDF']) {
        if ($file = @fopen($CentrePath . '/assets/dailymenu' . UserSchool() . '.jpg', 'r')) {
            echo "<TR align=center><TD colspan=7><img src='assets/dailymenu" . UserSchool() . ".jpg'></TD></TR>\n";
            fclose($file);
        } else {
            echo "<TR align=center><TD colspan=7><font color=black size=+3><b>" . GetSchool(UserSchool()) . "</b></font></TD></TR>\n";
        }
    }
    echo "<TR align=center><TD colspan=2>" . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . "</TD><TD colspan=3><font color=black size=+2><b>" . date('F Y', mktime(0, 0, 0, $_REQUEST['month'], 1, $_REQUEST['year'])) . "</b></font></TD><TD colspan=2>" . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . "</TD></TR>\n";
    echo "<TR bgcolor=#808080 align=center>\n";
    echo "<TD width=100><font color=white><b>Sunday</b></font></TD>\n<TD width=100><font color=white><b>Monday</b></font></TD>\n<TD width=100><font color=white><b>Tuesday</b></font></TD>\n<TD width=100><font color=white><b>Wednesday</b></font></TD>\n<TD width=100><font color=white><b>Thursday</b></font></TD>\n<TD width=100><font color=white><b>Friday</b></font></TD>\n<TD width=100><font color=white><b>Saturday</b></font></TD>\n";
    echo "</TR>\n";
    if ($skip) {
        echo "<TR height=100><TD bgcolor=#C0C0C0 colspan=" . $skip . ">&nbsp;</TD>\n";
    }
    for ($i = 1; $i <= $last; $i++) {
        if ($skip % 7 == 0) {
            echo "<TR height=100>";
        }
        $day_time = mktime(0, 0, 0, $_REQUEST['month'], $i, $_REQUEST['year']);
        $date = strtoupper(date('d-M-y', $day_time));
コード例 #27
0
ファイル: LunchTotals.php プロジェクト: linil/centreSIS
<?php

DrawHeader(ProgramTitle());
$begin_date = $_REQUEST['day_begin'] . '-' . $_REQUEST[month_begin] . '-' . $_REQUEST[year_begin];
$end_date = $_REQUEST[day_end] . '-' . $_REQUEST[month_end] . '-' . $_REQUEST[year_end];
DrawHeader(ProperDate($begin_date) . ' - ' . ProperDate($end_date) . ' : ' . GetSchool($_REQUEST[sch]));
// LUNCH DEBITS
$sql = "SELECT MENU_ID," . db_case(array('FSC', "''", "'REG'", "'1'", "'FREE'", "'2'", "'REDUCED'")) . " as FSC,\n\t\t\tcount(*) as COUNT \n\t\tFROM STU_BILLING_ACT_LUNCH sba,STUDENT_ENROLLMENT se \n\t\tWHERE se.SYEAR=sba.SYEAR AND se.STUDENT_ID=sba.STUDENT_ID AND se.SCHOOL_ID='" . UserSchool() . "' AND ";
$sql .= "PAYMENT_DATE BETWEEN '{$begin_date}' AND '{$end_date}'\n\t\tGROUP BY MENU_ID,FSC";
$QI = DBQuery($sql);
$counts_RET = DBGet($QI, array(), array('MENU_ID', 'FSC'));
$sql = "SELECT ID,SCHOOL_ID,TITLE FROM LUNCH_MENU WHERE SCHOOL_ID='" . UserSchool() . "' ";
$QI = DBQuery($sql);
$menu_RET = DBGet($QI, array(), array('SCHOOL_ID'));
$columns = array('TITLE' => 'Lunch Item', 'REG_COUNT' => 'Regular Purchases', 'FREE_COUNT' => 'Free Purchases', 'REDUCED_COUNT' => 'Reduced Purchases', 'TOTAL' => 'Total');
foreach ($menu_RET as $school => $items) {
    unset($RET);
    $RET[] = '';
    foreach ($items as $item) {
        $total = $counts_RET[$item[ID]]['REG'][1]['COUNT'] + $counts_RET[$item[ID]]['FREE'][1]['COUNT'] + $counts_RET[$item[ID]]['REDUCED'][1]['COUNT'];
        $RET[] = array('TITLE' => $item[TITLE], 'REG_COUNT' => $counts_RET[$item[ID]]['REG'][1]['COUNT'], 'FREE_COUNT' => $counts_RET[$item[ID]]['FREE'][1]['COUNT'], 'REDUCED_COUNT' => $counts_RET[$item[ID]]['REDUCED'][1]['COUNT'], 'TOTAL' => $total);
    }
    unset($RET[0]);
    ListOutput($RET, $columns, '.', '.', '', array(), array('save' => false));
}
コード例 #28
0
        echo '</TD></TR>';
    }
    echo '<TR><TD colspan=2 align=center>';
    Buttons('Find', 'Reset');
    echo '</TD></TR>';
    echo '</TABLE>';
    PopTable('footer');
}
if ($_REQUEST[modfunc] == 'list') {
    $begin_date = $_REQUEST[day_begin] . '-' . $_REQUEST[month_begin] . '-' . $_REQUEST[year_begin];
    $end_date = $_REQUEST[day_end] . '-' . $_REQUEST[month_end] . '-' . $_REQUEST[year_end];
    $account_title = DBGet(DBQuery("SELECT TITLE FROM STU_BILLING_ACCOUNTS WHERE ID='{$_REQUEST['account_id']}'"));
    if ($account_title[1]) {
        $account_title = ' : ' . $account_title[1]['TITLE'];
    }
    DrawHeader(ucwords(str_replace('stubilling', 'student billing ', str_replace('lunch', 'lunch ', $_REQUEST[type]))) . ' : ' . ProperDate($begin_date) . ' - ' . ProperDate($end_date) . ' : ' . GetSchool($_REQUEST[sch]) . $account_title);
    echo '<BR>';
    echo '<TABLE>';
    switch ($_REQUEST[type]) {
        case 'stubillingcredits':
            // STUBILLING CREDITS
            $sql = "SELECT s.LAST_NAME||', '||s.FIRST_NAME as FULL_NAME,sba.STUDENT_ID,sum(AMOUNT) as AMOUNT FROM STU_BILLING_ACT sba,STUDENTS s ";
            if ($_REQUEST[sch]) {
                $sql .= ",STU_SCHOOL_MEETS ssm WHERE ssm.SYEAR=sba.SYEAR AND ssm.STUDENT_ID=sba.STUDENT_ID AND ssm.SCHOOL='{$_REQUEST['sch']}' AND s.STUDENT_ID=ssm.STUDENT_ID AND ";
            } else {
                $sql .= "WHERE ";
            }
            $sql .= "s.STUDENT_ID=sba.STUDENT_ID AND sba.PAYMENT_DATE BETWEEN '{$begin_date}' AND '{$end_date}' AND (sba.LUNCH_PAYMENT!='Y' OR sba.LUNCH_PAYMENT IS NULL) " . ($_REQUEST[account_id] ? "AND ACCOUNT_ID='{$_REQUEST['account_id']}'" : '') . " GROUP BY sba.STUDENT_ID,FULL_NAME";
            break;
        case 'stubillingdebits':
            // STUBILLING CREDITS
コード例 #29
0
ファイル: StudentLabels.php プロジェクト: SysBind/opensis-ml
     }
     if ($_REQUEST['room']) {
         $extra['SELECT'] .= ',(SELECT cp.ROOM FROM course_periods cp WHERE cp.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\') AS ROOM';
     }
 }
 $RET = GetStuList($extra);
 if (count($RET)) {
     $skipRET = array();
     for ($i = ($_REQUEST['start_row'] - 1) * $max_cols + $_REQUEST['start_col']; $i > 1; $i--) {
         $skipRET[-$i] = array('LAST_NAME' => ' ');
     }
     $handle = PDFstart();
     $cols = 0;
     $rows = 0;
     echo "<meta charset='UTF-8'><table width=100%  border=0 style=\" font-family:Arial; font-size:12px;\" >";
     echo "<meta charset='UTF-8'><tr><td width=105>" . DrawLogo() . "</td><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">" . _('Student Labels') . "</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br \\>" . _('Powered by openSIS') . "</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
     echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" style=font-family:Arial; font-size:12px;>';
     foreach ($skipRET + $RET as $i => $student) {
         if ($cols < 1) {
             echo '<tr>';
         }
         echo '<td width="33.3%" height="86" align="center" valign="middle">';
         echo '<table border=0 align=center>';
         echo '<tr>';
         echo '<td align=center>' . $student['NICK_NAME'] . ' ' . $student['LAST_NAME'] . '</td></tr>';
         if ($_REQUEST['teacher']) {
             echo '<tr><td align=center>' . _('Teacher') . ':';
             echo '' . $student['TEACHER'] . '</td></tr>';
         }
         if ($_REQUEST['room']) {
             echo '<tr><td align=center>' . _('Room No :') . '';
コード例 #30
0
 if ($row_mp_detail['grandparent_id'] != -1) {
     $mp_string .= ' or s.marking_period_id=' . $row_mp_detail['grandparent_id'] . '';
 }
 # -------------------------- Date Function Start ------------------------------- #
 function cov_date($dt)
 {
     $temp_date = explode("-", $dt);
     $final_date = $temp_date[1] . '-' . $temp_date[2] . '-' . $temp_date[0];
     return $final_date;
 }
 # -------------------------- Date Function End ------------------------------- #
 if (count($RET_stu)) {
     $handle = PDFStart();
     foreach ($RET_stu as $student_id => $courses) {
         echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
         echo "<tr><td width=105>" . DrawLogo() . "</td><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">" . _('Student Daily Schedule') . "</div></td><td style=\"font-size:15px; font-weight:bold; padding-top:20px;\"> " . _('Schedule for') . ": " . $row_mp_detail['title'] . " : " . cov_date($row_mp_detail['start_date']) . " - " . cov_date($row_mp_detail['end_date']) . "</td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />" . _('Powered by openSIS') . "</td></tr><tr><td colspan=4 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
         # --------------------------------------- Start Change ------------------------------------------- #
         $st_data = DBGet(DBQuery("SELECT * FROM students WHERE student_id = " . $courses[1]['STUDENT_ID']));
         unset($_openSIS['DrawHeader']);
         echo '<br>';
         echo '<table  border=0>';
         /*echo '<tr><td>Student ID:</td>';
         		echo '<td>'.$courses[1]['STUDENT_ID'] .'</td></tr>';*/
         echo '<tr><td>' . _('Student ID') . ':</td>';
         echo '<td>' . $courses[1]['STUDENT_ID'] . '</td></tr>';
         echo '<tr><td>' . _('Student Name') . ':</td>';
         echo '<td><b>' . $courses[1]['FULL_NAME'] . '</b></td></tr>';
         echo '<tr><td>' . $courses[1]['GRD_LVL'] . '</td>';
         echo '<td>' . $st_data[1]['CUSTOM_10'] . '</td></tr>';
         echo '</table>';
         $sch_exist = DBGet(DBQuery("SELECT COUNT(s.id) AS SCH_COUNT FROM schedule s WHERE s.syear=" . UserSyear() . "\n\t\t\t\t\tAND s.student_id='" . $courses[1]['STUDENT_ID'] . "'\n\t\t\t\t\tAND s.school_id=" . UserSchool() . "\n\t\t\t\t\tAND {$mp_string} )"));