示例#1
0
function PDFStop($handle)
{
    global $htmldocPath, $htmldocAssetsPath;
    unset($_SESSION['orientation']);
    if ($htmldocPath) {
        if ($htmldocAssetsPath) {
            $html = str_replace('assets/', $htmldocAssetsPath, ob_get_contents());
        } else {
            $html = ob_get_contents();
        }
        ob_end_clean();
        // Gen temp file and save contents
        $temphtml = tempnam('', 'html');
        $temphtml_tmp = substr($temphtml, 0, strrpos($temphtml, '.')) . 'html';
        rename($temphtml_tmp, $temphtml);
        $fp = @fopen($temphtml, "w+");
        if (!$fp) {
            die("Can't open {$temphtml}");
        }
        fputs($fp, '<HTML><HEAD><TITLE></TITLE></HEAD><BODY>' . $html . '</BODY></HTML>');
        @fclose($fp);
        header("Cache-Control: public");
        header("Pragma: ");
        header("Content-Type: application/pdf");
        header("Content-Disposition: inline; filename=\"" . str_replace('Print ', '', ProgramTitle()) . ".pdf\"\n");
        passthru("{$htmldocPath} {$handle['options']} \"{$temphtml}\"");
        @unlink($temphtml);
    } else {
        $html = ob_get_contents();
        ob_end_clean();
        echo '<HTML><HEAD><TITLE></TITLE></HEAD><BODY>' . $html . '</BODY></HTML>';
    }
}
示例#2
0
function PDFStop($handle)
{
    global $OutputType, $htmldocAssetsPath;
    if ($OutputType == "PDF") {
        $html = ob_get_contents();
        ob_end_clean();
        $html = '<HTML><BODY>' . $html . '</BODY></HTML>';
        require_once "dompdf/dompdf_config.inc.php";
        //require_once("convertcharset/ConvertCharset.class.php");
        //$html = $convertcharset->Convert($html, 'utf-8', 'iso-8859-1');
        /*
        
        $fp = @fopen($temphtml,"w");
        if (!$fp)
        	die("Can't open $temphtml");
        fputs($fp, $html);
        @fclose($fp);
        */
        $dompdf = new DOMPDF();
        $dompdf->load_html($html);
        $dompdf->render();
        $dompdf->stream(ProgramTitle() . ".pdf", array("Attachment" => 0));
        //header("Location:dompdf/dompdf.php?input_file=tmp/sis.htm&output_file=sample.pdf");
    } else {
        $html = ob_get_contents();
        ob_end_clean();
        $html = '<HTML><BODY>' . $html . '</BODY></HTML>';
        echo $html;
    }
}
示例#3
0
function PDFStop($handle)
{
    global $OutputType, $htmldocAssetsPath;
    if ($OutputType == "PDF") {
        $html = ob_get_contents();
        ob_end_clean();
        $html = '<HTML><BODY>' . $html . '</BODY></HTML>';
        require_once "dompdf/dompdf_config.inc.php";
        $dompdf = new DOMPDF();
        $dompdf->load_html($html);
        $dompdf->render();
        $dompdf->stream(ProgramTitle() . ".pdf", array("Attachment" => 0));
    } else {
        $html = ob_get_contents();
        ob_end_clean();
        $html = '<HTML><BODY>' . $html . '</BODY></HTML>';
        echo $html;
    }
}
示例#4
0
function PDFStop($handle)
{
    //global $htmldocPath,$htmldocAssetsPath;
    global $wkhtmltopdfPath, $wkhtmltopdfAssetsPath, $locale;
    $handle['orientation'] = $_SESSION['orientation'];
    unset($_SESSION['orientation']);
    $html_content = ob_get_clean();
    //convert to HTML page with CSS
    $html = '<!DOCTYPE html><HTML lang="' . mb_substr($locale, 0, 2) . '" ' . (mb_substr($locale, 0, 2) == 'he' || mb_substr($locale, 0, 2) == 'ar' ? ' dir="RTL"' : '') . '><HEAD><meta charset="UTF-8" />';
    if ($handle['css']) {
        $html .= '<link rel="stylesheet" type="text/css" href="assets/themes/' . Preferences('THEME') . '/stylesheet.css" />';
    }
    //modif Francois: bugfix wkhtmltopdf screen resolution on linux
    //see: https://code.google.com/p/wkhtmltopdf/issues/detail?id=118
    $html .= '<TITLE>' . str_replace(_('Print') . ' ', '', ProgramTitle()) . '</TITLE></HEAD><BODY><div style="width:' . (!empty($handle['orientation']) && $handle['orientation'] == 'landscape' ? '1448' : '1024') . 'px">' . $html_content . '</div></BODY></HTML>';
    //modif Francois: wkhtmltopdf
    if (!empty($wkhtmltopdfPath)) {
        if (!empty($wkhtmltopdfAssetsPath)) {
            $html = str_replace('assets/', $wkhtmltopdfAssetsPath, $html);
        }
        require 'classes/Wkhtmltopdf.php';
        try {
            //indicate to create PDF in the temporary files system directory
            $wkhtmltopdf = new Wkhtmltopdf(array('path' => sys_get_temp_dir()));
            $wkhtmltopdf->setBinPath($wkhtmltopdfPath);
            if (!empty($handle['orientation']) && $handle['orientation'] == 'landscape') {
                $wkhtmltopdf->setOrientation(Wkhtmltopdf::ORIENTATION_LANDSCAPE);
            }
            if (!empty($handle['margins']) && is_array($handle['margins'])) {
                $wkhtmltopdf->setMargins($handle['margins']);
            }
            $wkhtmltopdf->setTitle(utf8_decode(str_replace(_('Print') . ' ', '', ProgramTitle())));
            //directly pass HTML code
            $wkhtmltopdf->setHtml($html);
            //MODE_EMBEDDED displays PDF in browser, MODE_DOWNLOAD forces PDF download
            $wkhtmltopdf->output(Wkhtmltopdf::MODE_EMBEDDED, str_replace(array(_('Print') . ' ', ' '), array('', '_'), utf8_decode(ProgramTitle())) . '.pdf');
        } catch (Exception $e) {
            echo $e->getMessage();
        }
    } else {
        echo $html;
    }
}
示例#5
0
<?php

include '../../Redirect_modules.php';
DrawBC(_('School Setup') . " >> " . ProgramTitle());
if ($_REQUEST['page_display']) {
    echo '<style type="text/css">
.back_preference { padding:2px 0px 10px 8px; text-align:left; margin:5px 5px; }
</style>';
    echo "<div class=back_preference><a href=Modules.php?modname={$_REQUEST['modname']}><strong>&laquo;" . _('Back to System Preference') . "</strong>\n</a></div><br/>";
}
if (clean_param($_REQUEST['page_display'], PARAM_ALPHAMOD) == 'system_preference') {
    if (clean_param($_REQUEST['action'], PARAM_ALPHAMOD) == 'update' && clean_param($_REQUEST['button'], PARAM_ALPHAMOD) == _('Save') && clean_param($_REQUEST['values'], PARAM_NOTAGS) && $_POST['values'] && User('PROFILE') == 'admin') {
        $sql = 'UPDATE system_preference SET ';
        foreach ($_REQUEST['values'] as $column => $value) {
            $value = paramlib_validation($column, $value);
            $sql .= $column . '=\'' . str_replace("\\'", "''", $value) . '\',';
        }
        $sql = substr($sql, 0, -1) . ' WHERE SCHOOL_ID=\'' . UserSchool() . '\'';
        DBQuery($sql);
    } elseif (clean_param($_REQUEST['action'], PARAM_ALPHAMOD) == 'insert' && clean_param($_REQUEST['button'], PARAM_ALPHAMOD) == 'Save' && clean_param($_REQUEST['values'], PARAM_NOTAGS) && $_POST['values'] && User('PROFILE') == 'admin') {
        $sql = 'INSERT INTO system_preference SET ';
        foreach ($_REQUEST['values'] as $column => $value) {
            $value = paramlib_validation($column, $value);
            $sql .= $column . '=\'' . str_replace("\\'", "''", $value) . '\',';
        }
        $sql = substr($sql, 0, -1) . ',school_id=\'' . UserSchool() . '\'';
        DBQuery($sql);
    }
    $sys_pref = DBGet(DBQuery('SELECT * FROM system_preference WHERE SCHOOL_ID=' . UserSchool()));
    $sys_pref = $sys_pref[1];
    PopTable('header', _('Half-day and full-day minutes'));
示例#6
0
function db_show_error($sql, $failnote, $additional = '')
{
    global $openSISTitle, $openSISVersion, $openSISNotifyAddress;
    PopTable('header', 'Error');
    $tb = debug_backtrace();
    $error = $tb[1]['file'] . " at " . $tb[1]['line'];
    echo "\r\n\t\t<TABLE CELLSPACING=10 BORDER=0>\r\n\t\t\t<TD align=right><b>Date:</TD>\r\n\t\t\t<TD><pre>" . date("m/d/Y h:i:s") . "</pre></TD>\r\n\t\t</TR><TR>\r\n\t\t\t<TD align=right><b>Failure Notice:</b></TD>\r\n\t\t\t<TD><pre> {$failnote} </pre></TD>\r\n\t\t</TR><TR>\r\n\t\t\t<TD align=right><b>SQL:</b></TD>\r\n\t\t\t<TD>{$sql}</TD>\r\n\t\t</TR>\r\n\t\t</TR><TR>\r\n\t\t\t<TD align=right><b>Traceback:</b></TD>\r\n\t\t\t<TD>{$error}</TD>\r\n\t\t</TR>\r\n\t\t</TR><TR>\r\n\t\t\t<TD align=right><b>Additional Information:</b></TD>\r\n\t\t\t<TD>{$additional}</TD>\r\n\t\t</TR>\r\n\t\t</TABLE>";
    /*echo "
    		<TABLE CELLSPACING=10 BORDER=0>
    			<TR><TD align=right><b>Date:</TD>
    			<TD><pre>".date("m/d/Y h:i:s")."</pre></TD>
    		</TR><TR>
    			<TD align=right></TD>
    			<TD>openSIS has encountered an error that could have resulted from any of the following:
    			<br/>
    			<ul>
    			<li>Invalid data input</li>
    			<li>Database SQL error</li>
    			<li>Program error</li>
    			</ul>
    			
    			Please take this screen shot and send it to your openSIS representative for debugging and resolution.
    			</TD>
    		</TR>
    		
    		</TABLE>";*/
    //Something you have asked the system to do has thrown a database error.  A system administrator has been notified, and the problem will be fixed as soon as possible.  It might be that changing the input parameters sent to this program will cause it to run properly.  Thanks for your patience.
    PopTable('footer');
    echo "<!-- SQL STATEMENT: \n\n {$sql} \n\n -->";
    /*if(false && function_exists('mysql_query'))
    	{
    		$link = @mysql_connect('os4ed.com','openSIS_log','openSIS_log');
    		@mysql_select_db('openSIS_log');
    		@mysql_query("INSERT INTO SQL_ERROR_LOG (HOST_NAME,IP_ADDRESS,LOGIN_DATE,VERSION,PHP_SELF,DOCUMENT_ROOT,SCRIPT_NAME,MODNAME,USERNAME,SQL,REQUEST) values('$_SERVER[SERVER_NAME]','$_SERVER[SERVER_ADDR]','".date('Y-m-d')."','$openSISVersion','$_SERVER[PHP_SELF]','$_SERVER[DOCUMENT_ROOT]','$_SERVER[SCRIPT_NAME]','$_REQUEST[modname]','".User('USERNAME')."','$sql','".ShowVar($_REQUEST,'Y', 'N')."')");
    		@mysql_close($link);
    	}*/
    if ($openSISNotifyAddress) {
        $message = "System: {$openSISTitle} \n";
        $message .= "Date: " . date("m/d/Y h:i:s") . "\n";
        $message .= "Page: " . $_SERVER['PHP_SELF'] . ' ' . ProgramTitle() . " \n\n";
        $message .= "Failure Notice:  {$failnote} \n";
        $message .= "Additional Info: {$additional} \n";
        $message .= "\n {$sql} \n";
        $message .= "Request Array: \n" . ShowVar($_REQUEST, 'Y', 'N');
        $message .= "\n\nSession Array: \n" . ShowVar($_SESSION, 'Y', 'N');
        mail($openSISNotifyAddress, 'openSIS Database Error', $message);
    }
    die;
}
示例#7
0
                    //echo '<div>'.$courses[1]['GRADE_ID'].' Grade</div>';
                    //echo '<div>'.ProperDate($date),$_REQUEST['mp_id']?GetMP($_REQUEST['mp_id']):''.'</div>';
                    ListOutputPrint($courses, $columns, '' . _('Course') . '', '' . _('Courses') . '', array(), array(), array('center' => false, 'print' => false));
                    echo '<div style="page-break-before: always;">&nbsp;</div><!-- NEW PAGE -->';
                }
            }
            PDFStop($handle);
        } else {
            BackPrompt(_('No Students were found.'));
        }
    } else {
        BackPrompt(_('You must choose at least one student.'));
    }
}
if (!$_REQUEST['modfunc']) {
    DrawBC("" . _('Scheduling') . " >> " . ProgramTitle());
    if ($_REQUEST['search_modfunc'] == 'list') {
        $mp_RET = DBGet(DBQuery('SELECT MARKING_PERIOD_ID,TITLE,SORT_ORDER,1 AS TBL FROM school_years WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' UNION SELECT MARKING_PERIOD_ID,TITLE,SORT_ORDER,2 AS TBL FROM school_semesters WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' UNION SELECT MARKING_PERIOD_ID,TITLE,SORT_ORDER,3 AS TBL FROM school_quarters WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY TBL,SORT_ORDER'));
        $mp_select = '<SELECT name=mp_id><OPTION value="">' . _('N/A') . '';
        foreach ($mp_RET as $mp) {
            $mp_select .= '<OPTION value=' . $mp['MARKING_PERIOD_ID'] . '>' . $mp['TITLE'];
        }
        $mp_select .= '</SELECT>';
        echo "<meta charset='UTF-8'><FORM name=sch id=sch action=for_export.php?modname={$_REQUEST['modname']}&head_html=Student+Schedules+Report&modfunc=save&include_inactive={$_REQUEST['include_inactive']}&_openSIS_PDF=true method=POST target=_blank>";
        #$extra['header_right'] = '<INPUT type=submit value=\'Create Schedules for Selected Students\'>';
        PopTable_wo_header('header');
        $extra['extra_header_left'] = '<TABLE>';
        $extra['extra_header_left'] .= '<TR><TD align=right width=120>' . _('Marking Period') . '</TD><TD>' . $mp_select . '</TD></TR>';
        $extra['extra_header_left'] .= '<TR><TD align=right width=120>' . _('Include only courses active as of') . '</TD><TD>' . PrepareDate('', '_include_active_date') . '</TD></TR>';
        Widgets('mailing_labels', true);
        $extra['extra_header_left'] .= $extra['search'];
#
#  This program is released under the terms of the GNU General Public License as
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../Redirect_modules.php';
DrawBC("Gradebook > " . ProgramTitle());
if (!$_REQUEST['mp']) {
    $_REQUEST['mp'] = UserMP();
}
$sem = GetParentMP('SEM', UserMP());
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
$mp_select = "<SELECT name=mp onchange='document.forms[0].submit();'><OPTION value=" . UserMP() . ">" . GetMP(UserMP()) . "</OPTION><OPTION value=" . $sem . ($sem == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($sem) . "</OPTION><OPTION value=E" . $sem . ('E' . $sem == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($sem) . ' Exam</OPTION></SELECT>';
DrawHeaderHome($mp_select);
echo '</FORM>';
$sql = "SELECT CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) as FULL_NAME,s.STAFF_ID,g.REPORT_CARD_GRADE_ID FROM STUDENT_REPORT_CARD_GRADES g,STAFF s,COURSE_PERIODS cp WHERE g.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND cp.TEACHER_ID=s.STAFF_ID AND cp.SYEAR=s.SYEAR AND cp.SYEAR=g.SYEAR AND cp.SYEAR='" . UserSyear() . "' AND g.MARKING_PERIOD_ID='" . $_REQUEST['mp'] . "'";
$grouped_RET = DBGet(DBQuery($sql), array(), array('STAFF_ID', 'REPORT_CARD_GRADE_ID'));
$grades_RET = DBGet(DBQuery("SELECT rg.ID,rg.TITLE FROM REPORT_CARD_GRADES rg,REPORT_CARD_GRADE_SCALES rs WHERE rg.SCHOOL_ID='" . UserSchool() . "' AND rg.SYEAR='" . UserSyear() . "' AND rs.ID=rg.GRADE_SCALE_ID ORDER BY rs.SORT_ORDER,rs.ID,rg.BREAK_OFF IS NOT NULL DESC,rg.BREAK_OFF DESC,rg.SORT_ORDER"));
if (count($grouped_RET)) {
    foreach ($grouped_RET as $staff_id => $grades) {
        $i++;
        $teachers_RET[$i]['FULL_NAME'] = $grades[key($grades)][1]['FULL_NAME'];
 $columns = array();
 $extra['SELECT'] .= ',NULL AS STATE_VALUE,NULL AS PHONE';
 $extra['functions']['PHONE'] = '_makePhone';
 $extra['functions']['STATE_VALUE'] = '_makeStateValue';
 $extra['columns_before']['PHONE'] = '' . _('Contact') . '';
 $extra['columns_after']['STATE_VALUE'] = '' . _('Present') . '';
 $extra['BackPrompt'] = false;
 $extra['Redirect'] = false;
 $extra['new'] = true;
 foreach ($periods_RET as $period) {
     $extra['SELECT'] .= ',\'' . '' . '\' AS PERIOD_' . $period['PERIOD_ID'];
     $extra['functions']['PERIOD_' . $period['PERIOD_ID']] = '_makeCodePulldown';
     $extra['columns_after']['PERIOD_' . $period['PERIOD_ID']] = $period['SHORT_NAME'];
 }
 echo "<FORM action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
 DrawHeader(ProgramTitle(), '<INPUT type=submit value=' . _('Update') . '>');
 if ($REQ_codes) {
     foreach ($REQ_codes as $code) {
         $code_pulldowns .= _makeCodeSearch($code);
     }
 } elseif ($abs) {
     $code_pulldowns = _makeCodeSearch('A');
 } else {
     $code_pulldowns = _makeCodeSearch();
 }
 if (UserStudentID()) {
     $current_student_link = "<A HREF=Modules.php?modname={$_REQUEST['modname']}&modfunc=student&month_date={$_REQUEST['month_date']}&day_date={$_REQUEST['day_date']}&year_date={$_REQUEST['year_date']}&student_id=" . UserStudentID() . ">Current Student</A></TD><TD>";
 }
 DrawHeader(PrepareDate($date, '_date'), '<TABLE><TR><TD>' . $current_student_link . button('add', '', "# onclick='javascript:addHTML(\"" . str_replace('"', '\\"', _makeCodeSearch()) . "\",\"code_pulldowns\"); return false;'") . '</TD><TD><DIV id=code_pulldowns>' . $code_pulldowns . '</DIV></TD></TR></TABLE>');
 $_REQUEST['search_modfunc'] = 'list';
 Search('student_id', $extra);
                    }
                }
            }
            PDFStop($handle);
        } else {
            BackPrompt('No Students were found.');
        }
    } else {
        BackPrompt('You must choose at least one student.');
    }
    unset($_SESSION['student_id']);
    //echo '<pre>'; var_dump($_REQUEST['modfunc']); echo '</pre>';
    $_REQUEST['modfunc'] = true;
}
if (!$_REQUEST['modfunc']) {
    DrawBC("Students >> " . ProgramTitle());
    if ($_REQUEST['search_modfunc'] == 'list') {
        echo "<FORM action=for_export.php?modname={$_REQUEST['modname']}&modfunc=save&include_inactive={$_REQUEST['include_inactive']}&_search_all_schools={$_REQUEST['_search_all_schools']}&_openSIS_PDF=true method=POST target=_blank>";
        //$extra['header_right'] = '<INPUT type=submit value=\'Print Info for Selected Students\'>';
        $extra['extra_header_left'] = '<TABLE>';
        //Widgets('mailing_labels',true);
        $extra['extra_header_left'] .= $extra['search'];
        $extra['search'] = '';
        $extra['extra_header_left'] .= '';
        if (User('PROFILE_ID')) {
            $can_use_RET = DBGet(DBQuery("SELECT MODNAME FROM PROFILE_EXCEPTIONS WHERE PROFILE_ID='" . User('PROFILE_ID') . "' AND CAN_USE='Y'"), array(), array('MODNAME'));
        } else {
            $can_use_RET = DBGet(DBQuery("SELECT MODNAME FROM STAFF_EXCEPTIONS WHERE USER_ID='" . User('STAFF_ID') . "' AND CAN_USE='Y'"), array(), array('MODNAME'));
        }
        $categories_RET = DBGet(DBQuery("SELECT ID,TITLE,INCLUDE FROM STUDENT_FIELD_CATEGORIES ORDER BY SORT_ORDER,TITLE"));
        $extra['extra_header_left'] .= '';
示例#11
0
    $tabcolor_s = '#DFDFDF';
    $textcolor_s = '#999999';
    $tabcolor_u = Preferences('HEADER');
    $textcolor_u = '#FFFFFF';
} else {
    $tabcolor_s = Preferences('HEADER');
    $textcolor_s = '#FFFFFF';
    $tabcolor_u = '#DFDFDF';
    $textcolor_u = '#999999';
}
$header = '<TABLE class="cellpadding-0 cellspacing-0" style="height:14px;"><TR>';
//modif Francois: remove DrawTab params
$header .= '<TD style="width:10px;"></TD><TD>' . DrawTab(_('Students'), "Modules.php?modname={$_REQUEST['modname']}&day_date={$_REQUEST['day_date']}&month_date={$_REQUEST['month_date']}&year_date={$_REQUEST['year_date']}&type=student") . '</TD>';
$header .= '<TD style="width:10px;"></TD><TD>' . DrawTab(_('Users'), "Modules.php?modname={$_REQUEST['modname']}&day_date={$_REQUEST['day_date']}&month_date={$_REQUEST['month_date']}&year_date={$_REQUEST['year_date']}&type=staff") . '</TD>';
$header .= '<TD style="width:10px;"></TD></TR></TABLE>';
DrawHeader(($_SESSION['FSA_type'] == 'staff' ? _('User') : _('Student')) . ' ' . ProgramTitle(), User('PROFILE') == 'student' ? '' : '<TABLE style="background-color:#ffffff;"><TR><TD>' . $header . '</TD></TR></TABLE>');
if ($_REQUEST['search_modfunc'] == 'list') {
    $PHP_tmp_SELF = PreparePHP_SELF();
    echo '<FORM action="' . $PHP_tmp_SELF . '" method="POST">';
    DrawHeader(PrepareDate($date, '_date') . ' : <INPUT type=submit value=' . _('Go') . '>');
    echo '</FORM>';
    include 'modules/Food_Service/' . ($_REQUEST['type'] == 'staff' ? 'Users' : 'Students') . '/BalanceReport.php';
}
$extra['new'] = true;
$extra['force_search'] = true;
$extra['SELECT'] = ",fsa.ACCOUNT_ID,fst.BALANCE";
//$extra['SELECT'] .= ",(SELECT BALANCE FROM FOOD_SERVICE_TRANSACTIONS WHERE ACCOUNT_ID=fsa.ACCOUNT_ID AND TIMESTAMP<date '".$date."'+1 ORDER BY TIMESTAMP DESC LIMIT 1) AS BALANCE";
$extra['FROM'] = ",FOOD_SERVICE_STUDENT_ACCOUNTS fsa,FOOD_SERVICE_TRANSACTIONS fst";
$extra['WHERE'] = " AND fsa.STUDENT_ID=ssm.STUDENT_ID AND fst.ACCOUNT_ID=fsa.ACCOUNT_ID AND fst.BALANCE>'0' AND fst.TRANSACTION_ID=(SELECT TRANSACTION_ID FROM FOOD_SERVICE_TRANSACTIONS WHERE ACCOUNT_ID=fsa.ACCOUNT_ID AND TIMESTAMP<date '" . $date . "'+1 ORDER BY TIMESTAMP DESC LIMIT 1)";
$extra['functions'] = array('ACCOUNT_ID' => '_total');
$extra['columns_before'] = array('ACCOUNT_ID' => _('Account ID'));
示例#12
0
function db_show_error($sql, $failnote, $additional = '')
{
    global $openSISTitle, $openSISVersion, $openSISNotifyAddress, $openSISMode;
    $tb = debug_backtrace();
    $error = $tb[1]['file'] . " at " . $tb[1]['line'];
    echo "\n                    <TABLE CELLSPACING=10 BORDER=0>\n                            <TD align=right><b>Date:</TD>\n                            <TD><pre>" . date("m/d/Y h:i:s") . "</pre></TD>\n                    </TR><TR>\n                            <TD align=right><b>Failure Notice:</b></TD>\n                            <TD><pre> {$failnote} </pre></TD>\n                    </TR><TR>\n                            <TD align=right><b>SQL:</b></TD>\n                            <TD>{$sql}</TD>\n                    </TR>\n                    </TR><TR>\n                            <TD align=right><b>Traceback:</b></TD>\n                            <TD>{$error}</TD>\n                    </TR>\n                    </TR><TR>\n                            <TD align=right><b>Additional Information:</b></TD>\n                            <TD>{$additional}</TD>\n                    </TR>\n                    </TABLE>";
    echo "\n\t\t<TABLE CELLSPACING=10 BORDER=0>\n\t\t\t<TR><TD align=right><b>Date:</TD>\n\t\t\t<TD><pre>" . date("m/d/Y h:i:s") . "</pre></TD>\n\t\t</TR><TR>\n\t\t\t<TD align=right></TD>\n\t\t\t<TD>openSIS has encountered an error that could have resulted from any of the following:\n\t\t\t<br/>\n\t\t\t<ul>\n\t\t\t<li>Invalid data input</li>\n\t\t\t<li>Database SQL error</li>\n\t\t\t<li>Program error</li>\n\t\t\t</ul>\n\t\t\t\n\t\t\tPlease take this screen shot and send it to your openSIS representative for debugging and resolution.\n\t\t\t</TD>\n\t\t</TR>\n\t\t\n\t\t</TABLE>";
    echo "<!-- SQL STATEMENT: \n\n {$sql} \n\n -->";
    if ($openSISNotifyAddress) {
        $message = "System: {$openSISTitle} \n";
        $message .= "Date: " . date("m/d/Y h:i:s") . "\n";
        $message .= "Page: " . $_SERVER['PHP_SELF'] . ' ' . ProgramTitle() . " \n\n";
        $message .= "Failure Notice:  {$failnote} \n";
        $message .= "Additional Info: {$additional} \n";
        $message .= "\n {$sql} \n";
        $message .= "Request Array: \n" . ShowVar($_REQUEST, 'Y', 'N');
        $message .= "\n\nSession Array: \n" . ShowVar($_SESSION, 'Y', 'N');
        mail($openSISNotifyAddress, 'openSIS Database Error', $message);
    }
    die;
}
示例#13
0
#
#  This program is released under the terms of the GNU General Public License as
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../Redirect_modules.php';
DrawBC("Tools >> " . ProgramTitle());
if (isset($_REQUEST['del'])) {
    if ($_REQUEST['day_start'] && $_REQUEST['month_start'] && $_REQUEST['year_start']) {
        $start_date = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . substr($_REQUEST['year_start'], 2, 4);
        $org_start_date = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['year_start'];
        $conv_st_date = con_date($org_start_date);
    }
    if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
        $end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . substr($_REQUEST['year_end'], 2, 4);
        $org_end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'];
        $conv_end_date = con_date_end($org_end_date);
    }
    # ------------------------------- Deletion Of Log Records ----------------------------- #
    if (isset($conv_st_date) && isset($conv_end_date)) {
        $sql_del = DBQuery('DELETE FROM login_records WHERE LOGIN_TIME >=\'' . $conv_st_date . '\' AND LOGIN_TIME <=\'' . $conv_end_date . '\'');
        echo '<center><font color="red"><b>Log deleted successfully</b></font></center>';
示例#14
0
    $textcolor_s = '#999999';
    $tabcolor_u = Preferences('HEADER');
    $textcolor_u = '#FFFFFF';
} else {
    $tabcolor_s = Preferences('HEADER');
    $textcolor_s = '#FFFFFF';
    $tabcolor_u = '#DFDFDF';
    $textcolor_u = '#999999';
}
//$header = '<TABLE border=0 cellpadding=0 cellspacing=0 height=14><TR>';
//$header .= '<TD width=10></TD><TD>'.DrawTab('Students',"Modules.php?modname=$_REQUEST[modname]&day_start=$_REQUEST[day_start]&month_start=$_REQUEST[month_start]&year_start=$_REQUEST[year_start]&day_end=$_REQUEST[day_end]&month_end=$_REQUEST[month_end]&year_end=$_REQUEST[year_end]&type=student",$tabcolor_s,$textcolor_s,'_circle',array('tabcolor'=>Preferences('HEADER'),'textcolor'=>'#FFFFFF')).'</TD>';
//$header .= '<TD width=10></TD><TD>'.DrawTab('Users',   "Modules.php?modname=$_REQUEST[modname]&day_start=$_REQUEST[day_start]&month_start=$_REQUEST[month_start]&year_start=$_REQUEST[year_start]&day_end=$_REQUEST[day_end]&month_end=$_REQUEST[month_end]&year_end=$_REQUEST[year_end]&type=staff",  $tabcolor_u,$textcolor_u,'_circle',array('tabcolor'=>Preferences('HEADER'),'textcolor'=>'#FFFFFF')).'</TD>';
//$header .= '<TD width=10></TD></TR></TABLE>';
//$header = "";
//DrawHeader(($_REQUEST['type']=='staff'?'User ':'******').ProgramTitle(),'<TABLE bgcolor=#ffffff><TR><TD>'.$header.'</TD></TR></TABLE>');
DrawBC("Food Service >> " . ProgramTitle());
if ($_REQUEST['modfunc'] == 'delete') {
    require_once 'modules/Food_Service/includes/DeletePromptX.fnc.php';
    if ($_REQUEST['item_id'] != '') {
        if (DeletePromptX('transaction item')) {
            require_once 'modules/Food_Service/includes/DeleteTransactionItem.fnc.php';
            DeleteTransactionItem($_REQUEST['transaction_id'], $_REQUEST['item_id'], $_REQUEST['type']);
            unset($_REQUEST['modfunc']);
            unset($_REQUEST['delete_ok']);
            unset($_SESSION['_REQUEST_vars']['modfunc']);
            unset($_SESSION['_REQUEST_vars']['delete_ok']);
        }
    } else {
        if (DeletePromptX('transaction')) {
            require_once 'modules/Food_Service/includes/DeleteTransaction.fnc.php';
            DeleteTransaction($_REQUEST['transaction_id'], $_REQUEST['type']);
示例#15
0
$program_config = DBGet(DBQuery("SELECT * FROM PROGRAM_CONFIG WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' AND PROGRAM='grades'"), array(), array('TITLE'));
if ($_REQUEST['values']) {
    DBQuery("DELETE FROM PROGRAM_USER_CONFIG WHERE USER_ID='" . User('STAFF_ID') . "' AND PROGRAM='Gradebook'");
    foreach ($_REQUEST['values'] as $title => $value) {
        DBQuery("INSERT INTO PROGRAM_USER_CONFIG (USER_ID,PROGRAM,TITLE,VALUE) values('" . User('STAFF_ID') . "','Gradebook','{$title}','" . str_replace('%', '', $value) . "')");
    }
}
$config_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_USER_CONFIG WHERE USER_ID='" . User('STAFF_ID') . "' AND PROGRAM='Gradebook'"), array(), array('TITLE'));
if (count($config_RET)) {
    foreach ($config_RET as $title => $value) {
        $programconfig[$title] = $value[1]['VALUE'];
    }
}
$grades = DBGet(DBQuery("SELECT cp.TITLE AS CP_TITLE,c.TITLE AS COURSE_TITLE,cp.COURSE_PERIOD_ID,rcg.TITLE,rcg.ID FROM REPORT_CARD_GRADES rcg,COURSE_PERIODS cp,COURSES c WHERE cp.COURSE_ID=c.COURSE_ID AND cp.TEACHER_ID='" . User('STAFF_ID') . "' AND cp.SCHOOL_ID=rcg.SCHOOL_ID AND cp.SYEAR=rcg.SYEAR AND cp.SYEAR='" . UserSyear() . "' AND rcg.GRADE_SCALE_ID=cp.GRADE_SCALE_ID AND cp.GRADE_SCALE_ID IS NOT NULL AND DOES_BREAKOFF='Y' ORDER BY rcg.BREAK_OFF IS NOT NULL DESC,rcg.BREAK_OFF DESC,rcg.SORT_ORDER DESC"), array(), array('COURSE_PERIOD_ID'));
echo '<FORM action="Modules.php?modname=' . $_REQUEST['modname'] . '" method="POST">';
DrawHeader(_('Gradebook') . ' - ' . ProgramTitle());
DrawHeader('', '<INPUT type="submit" value="' . _('Save') . '" />');
echo '<BR />';
PopTable('header', _('Configuration'));
echo '<fieldset>';
//modif Francois: add translation
//modif Francois: css WPadmin
echo '<legend><b>' . _('Assignments') . '</b></legend>';
echo '<TABLE>';
if (count($grades)) {
    //if(!$programconfig['ROUNDING'])
    //	$programconfig['ROUNDING'] = 'NORMAL';
    //modif Francois: add <label> on radio
    echo '<TR><TD colspan="3"><TABLE><TR><TD colspan="8"><B>' . _('Score Rounding') . '</B></TD></TR><TR><TD style="text-align:right"><label><INPUT type="radio" name="values[ROUNDING]" value=UP' . ($programconfig['ROUNDING'] == 'UP' ? ' checked' : '') . '>&nbsp;' . _('Up') . '</label></TD><TD style="text-align:right"><label><INPUT type="radio" name="values[ROUNDING]" value=DOWN' . ($programconfig['ROUNDING'] == 'DOWN' ? ' checked' : '') . '>&nbsp;' . _('Down') . '</label></TD><TD style="text-align:right"><label><INPUT type="radio" name="values[ROUNDING]" value="NORMAL"' . ($programconfig['ROUNDING'] == 'NORMAL' ? ' checked' : '') . '>&nbsp;' . _('Normal') . '</label></TD><TD style="text-align:right"><label><INPUT type="radio" name="values[ROUNDING]" value="' . ($programconfig['ROUNDING'] == '' ? ' checked' : '') . '">&nbsp;' . _('None') . '</label></TD></TR></TABLE></TD></TR>';
}
if (!$programconfig['ASSIGNMENT_SORTING']) {
示例#16
0
function ListOutputGrade($result, $column_names, $singular = '', $plural = '', $link = false, $group = false, $options = false, $for_window = '')
{
    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($_REQUEST['page'])) {
        if ($_REQUEST['list_type'] == $singular) {
            $Request_page = $_REQUEST['page'];
        }
    }
    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 = 'class=odd';
    if ($group_count && $result_count) {
        $color = 'class=even';
        $group_result = $result;
        unset($result);
        $result[0] = '';
        foreach ($group_result as $item1) {
            if ($group_count == 1) {
                if ($color == 'class=even') {
                    $color = $side_color;
                } else {
                    $color = 'class=even';
                }
            }
            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 == 'class=even') {
                            $color = $side_color;
                        } else {
                            $color = 'class=even';
                        }
                    }
                    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 == 'class=even') {
                                    $color = $side_color;
                                } else {
                                    $color = 'class=even';
                                }
                            }
                            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']) {
                $r = array();
                $a = array();
                $t = array();
                $c = 0;
                for ($i = 1; $i <= count($result); $i++) {
                    if (array_key_exists("FULL_NAME", $result[$i])) {
                        array_push($a, $i);
                    }
                }
                $l = 0;
                $k = 0;
                foreach ($result as $column => $value) {
                    for ($n = 0; $n < count($a); $n++) {
                        if ($column == $a[$n]) {
                            $k = $k + 1;
                        }
                    }
                    $t[$k][$l] = $value;
                    $l++;
                }
                for ($h = 1; $h <= count($a); $h++) {
                    foreach ($t[$h] 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 (count($t) > 1) {
                        if (is_int($sort_array[1]) || is_double($sort_array[1])) {
                            array_multisort($sort_array, $dir, SORT_NUMERIC, $t[$h]);
                        } else {
                            array_multisort($sort_array, $dir, $t[$h]);
                        }
                        // print_r($t[$h]);
                        $inc = 0;
                        $pos = 0;
                        $flag = true;
                        $inc = 0;
                        $select = $_REQUEST['LO_sort'];
                        for ($c = 0; $c < count($t[$h]); $c++) {
                            if (array_key_exists($_REQUEST['LO_sort'], $t[$h][$c])) {
                                $temp = $t[$h][$c];
                                if ($temp[$select]) {
                                    $inc++;
                                    if ($flag) {
                                        $pos = $c;
                                        $flag = false;
                                    }
                                }
                            }
                        }
                        $abc = array_slice($t[$h], $pos, $inc);
                        if ($pos == 0) {
                            $cde = array_slice($t[$h], $inc, count($t[$h]) - 1);
                        } else {
                            $cde = array_slice($t[$h], 0, $pos);
                        }
                        if ($inc != 0) {
                            $t[$h] = array_merge($abc, $cde);
                        }
                        echo "<br/>";
                        array_push($result, $t[$h]);
                    }
                    for ($i = $result_count - 1; $i >= 0; $i--) {
                        $result[$i + 1] = $result[$i];
                    }
                    unset($result[0]);
                    $sort_array = "";
                }
                // $name_sort=array();
                $bgcolor_sort = array();
                for ($h = 1; $h <= count($t); $h++) {
                    for ($n = 0; $n < count($t[$h]); $n++) {
                        if ($_REQUEST['LO_sort'] == "FULL_NAME") {
                            if (array_key_exists("FULL_NAME", $t[$h][$n])) {
                                $name_sort[] = array_shift($t[$h][$n]);
                            }
                            if (array_key_exists("bgcolor", $t[$h][$n])) {
                                $bgcolor_sort[] = array_shift($t[$h][$n]);
                            }
                        } else {
                            if (array_key_exists("FULL_NAME", $t[$h][$n])) {
                                $FULL_NAME = array_shift($t[$h][$n]);
                            }
                            if (array_key_exists("bgcolor", $t[$h][$n])) {
                                $bgcolor = array_shift($t[$h][$n]);
                            }
                            $t[$h][0][FULL_NAME] = $FULL_NAME;
                            $t[$h][0][bgcolor] = $bgcolor;
                        }
                    }
                }
                for ($h = 1; $h <= count($t); $h++) {
                    for ($n = 0; $n < count($t[$h]); $n++) {
                        if (array_key_exists("0", $t[$h][$n])) {
                            $mkperiod = $t[$h][$n]['MARKING_PERIOD_ID'];
                            $t[$h][$n][$mkperiod] = $t[$h][$n][0];
                        }
                    }
                }
                //print_r($name_sort);
                if ($_REQUEST['LO_sort'] == "FULL_NAME") {
                    array_multisort($name_sort, $dir);
                    for ($h = 1; $h <= count($t); $h++) {
                        $t[$h][0][FULL_NAME] = $name_sort[$h - 1];
                    }
                }
                $result = "";
                for ($n = 1; $n <= count($a); $n++) {
                    $result = array_merge((array) $result, $t[$n]);
                }
            }
        }
        // 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=5 cellspacing=5 class=alert_box ><tr><td class=alert></td><td class=alert_msg ><b>" . _('No') . " {$plural} " . _('were found.') . "</b></td></tr><tr><td colspan=2 class=clear></td></tr></table></div>";
            } elseif ($result_count == 0 || $display_count == 0) {
                echo '<div style=text-align:left><table cellpadding=5 cellspacing=5 class=alert_box ><tr><td class=alert></td><td class=alert_msg ><b>' . _('None were found.') . '</b></td></tr><tr><td colspan=2 class=clear></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) {
                    echo $where_message = "<strong><br>\n\t\t\t\t\t\t\t\t\t    {$start} " . _('through') . " {$stop}</strong>";
                    echo "<div style=text-align:right;margin-top:-14px;padding-right:15px><strong>" . _('Go to Page') . " ";
                    if (ceil($result_count / $num_displayed) <= 10) {
                        for ($i = 1; $i <= ceil($result_count / $num_displayed); $i++) {
                            if ($i != $Request_page) {
                                if ($for_window == 'for_window') {
                                    $pages .= "<A HREF=" . str_replace('Modules.php', 'for_window.php', $PHP_tmp_SELF) . "&LO_sort={$_REQUEST['LO_sort']}&LO_direction={$_REQUEST['LO_direction']}&LO_search=" . urlencode($_REQUEST['LO_search']) . "&page={$i}&list_type={$singular}>{$i}</A>, ";
                                } else {
                                    $pages .= "<A HREF={$PHP_tmp_SELF}&LO_sort={$_REQUEST['LO_sort']}&LO_direction={$_REQUEST['LO_direction']}&LO_search=" . urlencode($_REQUEST['LO_search']) . "&page={$i}&list_type={$singular}>{$i}</A>, ";
                                }
                            } else {
                                $pages .= "{$i}, ";
                            }
                        }
                        $pages = substr($pages, 0, -2);
                    } 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></div>';
                    echo '</strong></div>';
                    //echo '<BR>';
                }
            } else {
                $start = 1;
                $stop = $result_count;
                if ($cols > 8 || $_REQUEST['expanded_view']) {
                    $_SESSION['orientation'] = 'landscape';
                    $repeat_headers = 16;
                } else {
                    $repeat_headers = 27;
                }
                if ($options['print']) {
                    $html = explode('<!-- new page -->', 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=0 class=\\"grid\\">';
                echo "<TR><TD align=left valign=middle>";
                if ($singular && $plural && $options['count']) {
                    if ($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']) {
                    $_REQUEST['portal_search'] = 'true';
                    $tmp_REQUEST = $_REQUEST;
                    unset($tmp_REQUEST['LO_search']);
                    unset($tmp_REQUEST['page']);
                    echo '<TD height="50" align=right valign=middle style="white-space:nowrap;">&nbsp;&nbsp;';
                    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 "<link rel='stylesheet' type='text/css' href='styles/paging.css' />\n";
                echo '<div id="pagerNavPosition"></div>';
                echo '<TABLE width=100% cellpadding=0 cellspacing=0><TR><TD align=center>';
            }
            echo "<TABLE id='results' cellpadding=6 width=96% cellspacing=1 class=\"grid\" 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']) {
                        if ($for_window == 'for_window') {
                            echo "HREF=#";
                        } else {
                            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 = 'class=even';
            //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 == 'class=even') {
                    $color = $side_color;
                } else {
                    $color = 'class=even';
                }
                //$color = '#EDF3FE';
                if (isset($_REQUEST['_openSIS_PDF']) && $count % $repeat_headers == 0) {
                    if ($count != 0) {
                        echo '</TABLE><TABLE cellpadding=6 width=820 class=\\"grid\\">';
                        echo '<!-- NEW PAGE -->';
                    }
                    echo "<TR>";
                    if ($remove && !isset($_REQUEST['_openSIS_PDF'])) {
                        echo "<TD class=grid></TD>";
                    }
                    if ($cols) {
                        foreach ($column_names as $key => $value) {
                            echo "<TD class=grid >" . 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'];
                    //if(!$button_title)
                    //$button_title = 'Remove';
                    $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($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) {
                    if ($count % 2) {
                        $color = 'class=even';
                    } else {
                        $color = $side_color;
                    }
                    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 class=grid_button>" . button('add') . "</TD>";
                    }
                    foreach ($column_names as $key => $value) {
                        echo "<TD class=even 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>";
                // SHADOW
                if (!isset($_REQUEST['_openSIS_PDF'])) {
                    echo '</TD ></TR></TABLE>';
                    echo "<script language='javascript' type='text/javascript'>\n";
                    #echo "alert('calling pager');\n";
                    $number_rec = 100;
                    echo "var pager = new Pager('results',{$number_rec});\n";
                    echo "pager.init();\n";
                    echo "pager.showPageNav('pager', 'pagerNavPosition');\n";
                    echo "pager.showPage(1);\n";
                    echo "</script>\n";
                }
                echo "</TD ></TR>";
                echo "</TABLE>";
                if ($options['center']) {
                    echo '';
                }
            }
            // END PRINT THE LIST ---
        }
        if ($result_count == 0) {
            // mab - problem with table closing if not opened above - do same conditional?
            if ($result_count > $num_displayed || ($options['count'] || $display_zero) && (($result_count == 0 || $display_count == 0) && $plural || ($result_count == 0 || $display_count == 0))) {
                #echo '<td>'; //edited for Search in parents (user>> associate student with parents)
                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 '<CENTER>';
                        // WIDTH=100%
                        //echo "<TABLE cellpadding=1 bgcolor=#f8f8f9 width=100%><TR><TD>";
                        // SHADOW
                        echo '<TABLE width=100% cellpadding=0 cellspacing=0><TR><TD align=center>';
                    }
                    if ($link['add']['html']) {
                        /*Here also change the colour for left corner*/
                        echo "<TABLE cellpadding=6 cellspacing=1 width=96% class=\"grid\"><TR><TD class=subtabs></TD>";
                        foreach ($column_names as $key => $value) {
                            //Here to change the ListOutput Header Colour
                            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>";
                    }
                    // SHADOW
                    //echo '</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 '<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>';
        }
    }
}
示例#17
0
    unset($_REQUEST['modfunc']);
    unset($_SESSION['_REQUEST_vars']['staff']);
    unset($_SESSION['_REQUEST_vars']['modfunc']);
    if (User('STAFF_ID') == $_REQUEST['staff_id']) {
        unset($_openSIS['User']);
        echo '<script language=JavaScript>parent.side.location="' . $_SESSION['Side_PHP_SELF'] . '?modcat="+parent.side.document.forms[0].modcat.value;</script>';
    }
}
$extra['SELECT'] = ',LAST_LOGIN';
$extra['columns_after'] = array('LAST_LOGIN' => 'Last Login');
$extra['functions'] = array('LAST_LOGIN' => 'makeLogin');
if (basename($_SERVER['PHP_SELF']) != 'index.php') {
    if ($_REQUEST['staff_id'] == 'new') {
        DrawBC("Users > Add a User");
    } else {
        DrawBC("Users > " . ProgramTitle());
    }
    SearchStaff('staff_id', $extra);
} else {
    DrawHeader('Create Account');
}
if ($_REQUEST['modfunc'] == 'delete' && basename($_SERVER['PHP_SELF']) != 'index.php' && AllowEdit()) {
    # ------------------------------------  For Certification Start ------------------------------------------- #
    if (DeletePrompt('certification')) {
        DBQuery("DELETE FROM staff_certification WHERE STAFF_CERTIFICATION_ID='{$_REQUEST['certification_id']}'");
        unset($_REQUEST['modfunc']);
        $_REQUEST['certification_id'] = 'new';
    }
}
if ((UserStaffID() || $_REQUEST['staff_id'] == 'new') && (basename($_SERVER['PHP_SELF']) != 'index.php' || !$_REQUEST['staff']['USERNAME']) && $_REQUEST['modfunc'] != 'delete' && $_SESSION['fn'] != 'user' && $_REQUEST['modfunc'] != 'remove') {
    if ($_REQUEST['modfunc'] != 'delete' || $_REQUEST['delete_ok'] == '1') {
示例#18
0
#
#  This program is released under the terms of the GNU General Public License as
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../Redirect_modules.php';
DrawBC("" . _('Attendance') . " > " . ProgramTitle());
$message = '<TABLE><TR><TD colspan=7 align=center>' . _('From') . ' ' . PrepareDate(DBDate(), '_min') . ' ' . _('to') . ' ' . PrepareDate(DBDate(), '_max') . '</TD></TR></TABLE>';
if (Prompt_Home(_('Confirm'), _('When do you want to recalculate the daily attendance?'), $message)) {
    $current_RET = DBGet(DBQuery('SELECT DISTINCT DATE_FORMAT(SCHOOL_DATE,\'%d-%m-%Y\') as SCHOOL_DATE FROM attendance_calendar WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\''), array(), array('SCHOOL_DATE'));
    $students_RET = GetStuList();
    $begin = mktime(0, 0, 0, MonthNWSwitch($_REQUEST['month_min'], 'to_num'), $_REQUEST['day_min'] * 1, $_REQUEST['year_min']) + 43200;
    $end = mktime(0, 0, 0, MonthNWSwitch($_REQUEST['month_max'], 'to_num'), $_REQUEST['day_max'] * 1, $_REQUEST['year_max']) + 43200;
    for ($i = $begin; $i <= $end; $i += 86400) {
        if ($current_RET[strtoupper(date('d-M-y', $i))]) {
            foreach ($students_RET as $student) {
                UpdateAttendanceDaily($student['STUDENT_ID'], date('d-M-y', $i));
            }
        }
    }
    unset($_REQUEST['modfunc']);
    DrawHeader('<table><tr><td><IMG SRC=assets/check.gif></td><td>' . _('The Daily Attendance for that timeframe has been recalculated.') . '</td></tr></table>');
示例#19
0
#  This program is released under the terms of the GNU General Public License as
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../Redirect_modules.php';
include 'modules/Grades/config.inc.php';
DrawBC("GradeBook >> " . ProgramTitle());
$mp_RET = DBGet(DBQuery('SELECT MP FROM course_periods WHERE course_period_id = \'' . UserCoursePeriod() . '\''));
if ($mp_RET[1]['MP'] == 'SEM') {
    $sem = GetParentMP('SEM', UserMP());
    $pros = GetChildrenMP('PRO', UserMP());
}
if ($mp_RET[1]['MP'] == 'FY') {
    $sem = GetParentMP('SEM', UserMP());
    if ($sem) {
        $fy = GetParentMP('FY', $sem);
    } else {
        $fy = GetParentMP('FY', UserMP());
    }
    $pros = GetChildrenMP('PRO', UserMP());
}
if ($mp_RET[1]['MP'] == 'QTR') {
示例#20
0
    $start_time = $start;
    $start_date = strtoupper(date('d-M-y', $start_time));
    $end_date = strtoupper(date('d-M-y', $end));
} else {
    $start_time = $_REQUEST['start_date'];
    $start_date = strtoupper(date('d-M-y', $start_time));
    $end_date = strtoupper(date('d-M-y', $start_time + 60 * 60 * 24 * 7));
}
$QI = DBQuery("SELECT PERIOD_ID,TITLE FROM SCHOOL_PERIODS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY SORT_ORDER ");
$periods_RET = DBGet($QI);
$period_select = "&nbsp;<SELECT name=period><OPTION value=''>All</OPTION>";
foreach ($periods_RET as $period) {
    $period_select .= "<OPTION value={$period['PERIOD_ID']}" . ($_REQUEST['period'] == $period['PERIOD_ID'] ? ' SELECTED' : '') . ">" . $period['TITLE'] . "</OPTION>";
}
$period_select .= "</SELECT>";
DrawBC("Eligibility > " . ProgramTitle());
echo "<FORM name=teach_comp id=teach_comp action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
$begin_year = DBGet(DBQuery("SELECT min(unix_timestamp(SCHOOL_DATE)) as SCHOOL_DATE FROM ATTENDANCE_CALENDAR WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'"));
$begin_year = $begin_year[1]['SCHOOL_DATE'];
if ($start && $begin_year) {
    $date_select = "<OPTION value={$start}>" . date('M d, Y', $start) . ' - ' . date('M d, Y', $end) . '</OPTION>';
    for ($i = $start - 60 * 60 * 24 * 7; $i >= $begin_year; $i -= 60 * 60 * 24 * 7) {
        $date_select .= "<OPTION value={$i}" . ($i + 86400 >= $start_time && $i - 86400 <= $start_time ? ' SELECTED' : '') . ">" . date('M d, Y', $i) . ' - ' . date('M d, Y', $i + 1 + ($END_DAY - $START_DAY) * 60 * 60 * 24) . '</OPTION>';
    }
}
DrawHeaderHome('<SELECT name=start_date>' . $date_select . '</SELECT>' . $period_select, '<INPUT type=submit class=btn_medium value=Go onclick=\'formload_ajax("teach_comp");\'>');
echo '</FORM>';
$sql = "SELECT CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME,sp.TITLE,cp.PERIOD_ID,s.STAFF_ID \n\t\tFROM STAFF s,COURSE_PERIODS cp,SCHOOL_PERIODS sp \n\t\tWHERE \n\t\t\tsp.PERIOD_ID = cp.PERIOD_ID\n\t\t\tAND cp.TEACHER_ID=s.STAFF_ID AND cp.MARKING_PERIOD_ID IN (" . GetAllMP('QTR', UserMP()) . ")\n\t\t\tAND cp.SYEAR='" . UserSyear() . "' AND cp.SCHOOL_ID='" . UserSchool() . "' AND s.PROFILE='teacher'\n\t\t\t" . ($_REQUEST['period'] ? " AND cp.PERIOD_ID='{$_REQUEST['period']}'" : '') . "\n\t\t\tAND NOT EXISTS (SELECT '' FROM ELIGIBILITY_COMPLETED ac WHERE ac.STAFF_ID=cp.TEACHER_ID AND ac.PERIOD_ID = sp.PERIOD_ID AND ac.SCHOOL_DATE BETWEEN '" . date('Y-m-d', $start_time) . "' AND '" . date('Y-m-d', $start_time + 60 * 60 * 24 * 7) . "')";
$RET = DBGet(DBQuery($sql), array(), array('STAFF_ID', 'PERIOD_ID'));
$i = 0;
if (count($RET)) {
示例#21
0
            } else {
                $select_stu = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME FROM STUDENTS WHERE STUDENT_ID='" . $student_id . "'"));
                $select_stu = $select_stu[1]['FIRST_NAME'] . "&nbsp;" . $select_stu[1]['LAST_NAME'];
                $clash .= $select_stu . "<br>";
            }
        }
        unset($_REQUEST['modfunc']);
        unset($_SESSION['MassSchedule.php']);
    } else {
        //BackPrompt('You must choose a Course');
        ShowErr('You must choose a Course');
        for_error();
    }
}
if ($_REQUEST['modfunc'] != 'choose_course') {
    DrawBC("Scheduling > " . ProgramTitle());
    if ($_REQUEST['search_modfunc'] == 'list') {
        echo "<FORM name=sav id=sav action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save method=POST>";
        #DrawHeader('',SubmitButton('Add Course to Selected Students'));
        PopTable_wo_header('header');
        echo '<TABLE><TR><TD>Course to Add</TD><TD><DIV id=course_div>';
        if ($_SESSION['MassSchedule.php']) {
            $course_title = DBGet(DBQuery("SELECT TITLE FROM COURSES WHERE COURSE_ID='" . $_SESSION['MassSchedule.php']['course_id'] . "'"));
            $course_title = $course_title[1]['TITLE'];
            $period_title = DBGet(DBQuery("SELECT TITLE FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $_SESSION['MassSchedule.php']['course_period_id'] . "'"));
            $period_title = $period_title[1]['TITLE'];
            echo "{$course_title} - {$_REQUEST['course_weight']}<BR>{$period_title}";
        }
        echo '</DIV>' . "<A HREF=# onclick='window.open(\"for_window.php?modname={$_REQUEST['modname']}&modfunc=choose_course\",\"\",\"scrollbars=yes,resizable=yes,width=800,height=400\");'>Choose a Course</A></TD></TR>";
        echo '<TR><TD>Start Date</TD><TD>' . PrepareDate(DBDate(), '') . '</TD></TR>';
        echo '<TR><TD>Marking Period</TD><TD>';
 $columns = array();
 $extra['SELECT'] .= ',NULL AS STATE_VALUE,NULL AS PHONE';
 $extra['functions']['PHONE'] = '_makePhone';
 $extra['functions']['STATE_VALUE'] = '_makeStateValue';
 $extra['columns_before']['PHONE'] = 'Contact';
 $extra['columns_after']['STATE_VALUE'] = 'Present';
 $extra['BackPrompt'] = false;
 $extra['Redirect'] = false;
 $extra['new'] = true;
 foreach ($periods_RET as $period) {
     $extra['SELECT'] .= ",'' AS PERIOD_" . $period['PERIOD_ID'];
     $extra['functions']['PERIOD_' . $period['PERIOD_ID']] = '_makeCodePulldown';
     $extra['columns_after']['PERIOD_' . $period['PERIOD_ID']] = $period['SHORT_NAME'];
 }
 echo "<FORM action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
 DrawHeader(ProgramTitle(), '<INPUT type=submit value=Update>');
 if ($REQ_codes) {
     foreach ($REQ_codes as $code) {
         $code_pulldowns .= _makeCodeSearch($code);
     }
 } elseif ($abs) {
     $code_pulldowns = _makeCodeSearch('A');
 } else {
     $code_pulldowns = _makeCodeSearch();
 }
 if (UserStudentID()) {
     $current_student_link = "<A HREF=Modules.php?modname={$_REQUEST['modname']}&modfunc=student&month_date={$_REQUEST['month_date']}&day_date={$_REQUEST['day_date']}&year_date={$_REQUEST['year_date']}&student_id=" . UserStudentID() . ">Current Student</A></TD><TD>";
 }
 DrawHeader(PrepareDate($date, '_date'), '<TABLE><TR><TD>' . $current_student_link . button('add', '', "# onclick='javascript:addHTML(\"" . str_replace('"', '\\"', _makeCodeSearch()) . "\",\"code_pulldowns\"); return false;'") . '</TD><TD><DIV id=code_pulldowns>' . $code_pulldowns . '</DIV></TD></TR></TABLE>');
 $_REQUEST['search_modfunc'] = 'list';
 Search('student_id', $extra);
示例#23
0
#
#  This program is released under the terms of the GNU General Public License as
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../RedirectModulesInc.php';
DrawBC("Extracurricular > " . ProgramTitle());
Widgets('activity');
Widgets('course');
Widgets('eligibility');
Search('student_id', $extra);
if ($_REQUEST['modfunc'] == 'add' || $_REQUEST['student_id']) {
    if ($_REQUEST['student_id']) {
        $RET = DBGet(DBQuery('SELECT FIRST_NAME,LAST_NAME,MIDDLE_NAME,NAME_SUFFIX FROM students WHERE STUDENT_ID=\'' . $_REQUEST['student_id'] . '\''));
    } else {
        $RET = DBGet(DBQuery('SELECT FIRST_NAME,LAST_NAME,MIDDLE_NAME,NAME_SUFFIX FROM students WHERE STUDENT_ID=\'' . UserStudentID() . '\''));
    }
    $count_student_RET = DBGet(DBQuery('SELECT COUNT(*) AS NUM FROM students'));
    if ($count_student_RET[1]['NUM'] > 1) {
        DrawHeaderHome('Selected Student: ' . $RET[1]['FIRST_NAME'] . '&nbsp;' . ($RET[1]['MIDDLE_NAME'] ? $RET[1]['MIDDLE_NAME'] . ' ' : '') . $RET[1]['LAST_NAME'] . '&nbsp;' . ' (<A HREF=Side.php?student_id=new&modcat=' . clean_param($_REQUEST['modcat'], PARAM_NOTAGS) . '><font color=red>Search Again</font></A>) | <A HREF=Modules.php?modname=' . clean_param($_REQUEST['modname'], PARAM_NOTAGS) . '&search_modfunc=list&next_modname=Students/Student.php&ajax=true&bottom_back=true&return_session=true target=body>Back to Student List</A>');
    } else {
        if ($count_student_RET[1]['NUM'] == 1) {
示例#24
0
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#**************************************************************************
if ($_REQUEST['month_date'] && $_REQUEST['day_date'] && $_REQUEST['year_date']) {
    while (!VerifyDate($date = $_REQUEST['day_date'] . '-' . $_REQUEST['month_date'] . '-' . $_REQUEST['year_date'])) {
        $_REQUEST['day_date']--;
    }
} else {
    $_REQUEST['day_date'] = date('d');
    $_REQUEST['month_date'] = strtoupper(date('M'));
    $_REQUEST['year_date'] = date('y');
    $date = $_REQUEST['day_date'] . '-' . $_REQUEST['month_date'] . '-' . $_REQUEST['year_date'];
}
DrawBC("Attendance > " . ProgramTitle());
//$QI = DBQuery("SELECT PERIOD_ID,TITLE FROM SCHOOL_PERIODS WHERE SCHOOL_ID='".UserSchool()."' AND SYEAR='".UserSyear()."' ORDER BY SORT_ORDER ");
$QI = DBQuery("SELECT sp.PERIOD_ID,sp.TITLE FROM SCHOOL_PERIODS sp WHERE sp.SCHOOL_ID='" . UserSchool() . "' AND sp.SYEAR='" . UserSyear() . "' AND EXISTS (SELECT '' FROM COURSE_PERIODS WHERE SYEAR=sp.SYEAR AND PERIOD_ID=sp.PERIOD_ID AND DOES_ATTENDANCE='Y') ORDER BY sp.SORT_ORDER");
$periods_RET = DBGet($QI, array(), array('PERIOD_ID'));
$period_select = "<SELECT name=period><OPTION value=''>All</OPTION>";
foreach ($periods_RET as $id => $period) {
    $period_select .= "<OPTION value={$id}" . ($_REQUEST['period'] == $id ? ' SELECTED' : '') . ">" . $period[1]['TITLE'] . "</OPTION>";
}
$period_select .= "</SELECT>";
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
DrawHeaderHome(PrepareDateSchedule($date, '_date', false, array('submit' => true)) . ' - ' . $period_select . ' : <INPUT type=submit class=btn_medium value=Go>');
echo '</FORM>';
$day = date('D', strtotime($date));
switch ($day) {
    case 'Sun':
        $day = 'U';
示例#25
0
                    echo '<td width="33.3%" height="86" align="center" valign="middle">&nbsp;</td>';
                    $cols++;
                }
                if ($cols == $max_cols) {
                    echo '</tr>';
                }
                echo '</table>';
            }
            PDFstop($handle);
        } else {
            BackPrompt(_('No Students were found.'));
        }
    }
}
if (!$_REQUEST['modfunc']) {
    DrawBC("" . _('Students') . " >> " . ProgramTitle());
    if ($_REQUEST['search_modfunc'] == 'list') {
        echo "<FORM action=for_export.php?modname={$_REQUEST['modname']}&modfunc=save&include_inactive={$_REQUEST['include_inactive']}&_search_all_schools={$_REQUEST['_search_all_schools']}" . (User('PROFILE') == 'admin' ? "&w_course_period_id_which={$_REQUEST['w_course_period_id_which']}&w_course_period_id={$_REQUEST['w_course_period_id']}" : '') . "&_openSIS_PDF=true method=POST target=_blank>";
        //$extra['header_right'] = '<INPUT type=submit value=\'Create Labels for Selected Students\'>';
        $extra['extra_header_left'] = '<TABLE style="margin-top:-30px;">';
        $extra['extra_header_left'] .= '<TR><TD><b>' . _('Include on Labels:') . '</b></TD></TR>';
        if (User('PROFILE') == 'admin') {
            if ($_REQUEST['w_course_period_id_which'] == 'course_period' && $_REQUEST['w_course_period_id']) {
                $course_RET = DBGet(DBQuery('SELECT CONCAT(s.FIRST_NAME,' . ' ' . ',s.LAST_NAME) AS TEACHER,cp.ROOM FROM staff s,course_periods cp WHERE s.STAFF_ID=cp.TEACHER_ID AND cp.COURSE_PERIOD_ID=\'' . $_REQUEST[w_course_period_id] . '\''));
                $extra['extra_header_left'] .= '<TR><TD><INPUT type=checkbox name=teacher value=Y>' . _('Teacher') . ' (' . $course_RET[1]['TEACHER'] . ')</TD></TR>';
                $extra['extra_header_left'] .= '<TR><TD><INPUT type=checkbox name=room value=Y>' . _('Room') . ' (' . $course_RET[1]['ROOM'] . ')</TD></TR>';
            } else {
                $extra['extra_header_left'] .= '<TR><TD><INPUT type=checkbox name=teacher value=Y>' . _('Attendance Teacher') . '</TD></TR>';
                $extra['extra_header_left'] .= '<TR><TD><INPUT type=checkbox name=room value=Y>' . _('Attendance Room') . '</TD></TR>';
            }
        } else {
示例#26
0
        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;\">User 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 >";
        include 'modules/miscellaneous/UserExport.php';
    }
}
if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'call') {
    $_SESSION['st_arr'] = $_REQUEST['st_arr'];
    echo "<FORM action=ForExport.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&head_html=Staff+Advanced+Report&modfunc=save&search_modfunc=list&_openSIS_PDF=true&_dis_user={$_REQUEST['_dis_user']}&_search_all_schools={$_REQUEST['_search_all_schools']} method=POST target=_blank>";
    echo '<DIV id=fields_div></DIV>';
    echo '<br/>';
    include 'modules/miscellaneous/UserExport.php';
    echo '<BR><CENTER><INPUT type=submit value=\'Create Report for Selected users\' class=btn_xxlarge></CENTER>';
    echo "</FORM>";
}
if (!$_REQUEST['modfunc'] || $_REQUEST['modfunc'] == 'list') {
    DrawBC("users >> " . ProgramTitle());
    if ($_REQUEST['modfunc'] == 'list') {
        $extra['columns_after'] = array('LAST_LOGIN' => 'Last Login');
        $extra['functions'] = array('LAST_LOGIN' => 'makeLogin');
        $extra['SELECT'] = ',LAST_LOGIN,CONCAT(\'<INPUT type=checkbox name=st_arr[] value=\',s.STAFF_ID,\' checked>\') AS CHECKBOX';
        $extra['columns_before'] = array('CHECKBOX' => '</A><INPUT type=checkbox value=Y name=controller checked onclick="checkAll(this.form,this.form.controller.checked,\'st_arr\');"><A>');
        $extra['options']['search'] = false;
        echo "<FORM action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&modfunc=call method=POST>";
        echo '<DIV id=fields_div></DIV>';
        if ($_REQUEST['_dis_user']) {
            echo '<INPUT type=hidden name=_dis_user value=' . strip_tags(trim($_REQUEST['_dis_user'])) . '>';
        }
        if ($_REQUEST['_search_all_schools']) {
            echo '<INPUT type=hidden name=_search_all_schools value=' . strip_tags(trim($_REQUEST['_search_all_schools'])) . '>';
        }
        Search('staff_id', $extra);
示例#27
0
            $sql = 'INSERT INTO eligibility (STUDENT_ID,SCHOOL_DATE,SYEAR,PERIOD_ID,COURSE_PERIOD_ID,ELIGIBILITY_CODE) values(\'' . $student_id . '\',\'' . DBDate() . '\',\'' . UserSyear() . '\',\'' . UserPeriod() . '\',\'' . $course_period_id . '\',\'' . $value . '\')';
        }
        DBQuery($sql);
    }
    $RET = DBGet(DBQuery('SELECT \'completed\' AS COMPLETED FROM eligibility_completed WHERE STAFF_ID=\'' . User('STAFF_ID') . '\' AND SCHOOL_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\' AND PERIOD_ID=\'' . UserPeriod() . '\''));
    if (!count($RET)) {
        DBQuery('INSERT INTO eligibility_completed (STAFF_ID,SCHOOL_DATE,PERIOD_ID) values(\'' . User('STAFF_ID') . '\',\'' . DBDate() . '\',\'' . UserPeriod() . '\')');
    }
    $current_RET = DBGet(DBQuery('SELECT ELIGIBILITY_CODE,STUDENT_ID FROM eligibility WHERE SCHOOL_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\' AND PERIOD_ID=\'' . UserPeriod() . '\''), array(), array('STUDENT_ID'));
}
$extra['SELECT'] .= ",'' AS PASSING,'' AS BORDERLINE,'' AS FAILING,'' AS INCOMPLETE";
$extra['functions'] = array('PASSING' => 'makeRadio', 'BORDERLINE' => 'makeRadio', 'FAILING' => 'makeRadio', 'INCOMPLETE' => 'makeRadio');
$columns = array('PASSING' => '' . _('Passing') . '', 'BORDERLINE' => '' . _('Borderline') . '', 'FAILING' => '' . _('Failing') . '', 'INCOMPLETE' => '' . _('Incomplete') . '');
$stu_RET = GetStuList($extra);
echo "<FORM ACTION=Modules.php?modname={$_REQUEST['modname']} method=POST>";
DrawHeaderHome(ProgramTitle());
if ($today > $END_DAY || $today < $START_DAY || $today == $START_DAY && date('Gi') < $START_HOUR . $START_MINUTE || $today == $END_DAY && date('Gi') > $END_HOUR . $END_MINUTE) {
    if ($START_HOUR > 12) {
        $START_HOUR -= 12;
        $START_M = 'PM';
    } else {
        $START_M = 'AM';
    }
    if ($END_HOUR > 12) {
        $END_HOUR -= 12;
        $END_M = 'PM';
    } else {
        $END_M = 'AM';
    }
    echo ErrorMessage(array('' . _('You can only enter eligibility from') . '' . $days[$START_DAY] . ' ' . $START_HOUR . ':' . $START_MINUTE . ' ' . $START_M . ' ' . _('to') . ' ' . $days[$END_DAY] . ' ' . $END_HOUR . ':' . $END_MINUTE . ' ' . $END_M), 'error');
} else {
示例#28
0
#
#  This program is released under the terms of the GNU General Public License as
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../Redirect_modules.php';
DrawBC("School Setup > " . ProgramTitle());
if (!$_REQUEST['marking_period_id'] && count($fy_RET = DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM school_years WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' ORDER BY SORT_ORDER'))) == 1 && !$_REQUEST['ajax']) {
    $_REQUEST['marking_period_id'] = $fy_RET[1]['MARKING_PERIOD_ID'];
    $_REQUEST['mp_term'] = 'FY';
}
unset($_SESSION['_REQUEST_vars']['marking_period_id']);
unset($_SESSION['_REQUEST_vars']['mp_term']);
//print_r($_POST);
//include 'validation_markingperiods.php';
switch ($_REQUEST['mp_term']) {
    case 'FY':
        $table = 'school_years';
        if ($_REQUEST['marking_period_id'] == 'new') {
            $title = 'New Year';
        }
        break;
示例#29
0
#
#  This program is released under the terms of the GNU General Public License as
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../Redirect_modules.php';
DrawHeader(ProgramTitle());
Widgets('request');
if (!UserStudentID()) {
    echo '<BR>';
}
Search('student_id', $extra);
if (!$_REQUEST['modfunc'] && UserStudentID()) {
    $_REQUEST['modfunc'] = 'choose';
}
if ($_REQUEST['modfunc'] == 'verify') {
    $QI = DBQuery("SELECT TITLE,COURSE_ID,SUBJECT_ID FROM COURSES WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'");
    $courses_RET = DBGet($QI, array(), array('COURSE_ID'));
    //$QI = DBQuery("SELECT COURSE_WEIGHT,COURSE_ID FROM COURSE_WEIGHTS WHERE SCHOOL_ID='".UserSchool()."' AND SYEAR='".UserSyear()."'");
    //$weights_RET = DBGet($QI,array(),array('COURSE_ID','COURSE_WEIGHT'));
    DBQuery("DELETE FROM SCHEDULE_REQUESTS WHERE STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "'");
    foreach ($_REQUEST['courses'] as $subject => $courses) {
示例#30
0
            break;
    }
    $handle = PDFStart();
    Warehouse('header');
    echo '<TABLE><TR><TD><IMG SRC=assets/logo.gif></TD><TD><h1>' . $title . ' Handbook<BR><small>Version 1.5</small></h1></TD></TR></TABLE><div class=break></div><!-- NEW PAGE -->';
    foreach ($help as $program => $value) {
        if (strpos($program, '/')) {
            $modcat = str_replace('_', ' ', substr($program, 0, strpos($program, '/')));
            if ($modcat != $old_modcat) {
                echo '<!-- NEW PAGE --><TABLE border=0><TR><TD><IMG SRC=assets/icons/' . str_replace(' ', '_', $modcat) . '.gif></TD><TD><h1><font color=#333366>' . $modcat . '</font></h1></TD></TR></TABLE><div class=break></div>';
            }
            $old_modcat = $modcat;
        }
        echo '<h2><font color=#333366>';
        $_REQUEST['modname'] = $program;
        if ($program == 'default') {
            echo 'openSIS School Information System ' . $title . ' Handbook<BR><small>Version 1.5</small>';
        } else {
            echo ProgramTitle();
        }
        echo '</font></h2>';
        echo '<TABLE border=0  bgcolor=#DDDDDD width=100%><TR><TD>';
        if ($student == true) {
            $value = str_replace('your child', 'yourself', str_replace('your child\'s', 'your', $value));
        }
        echo $value;
        echo '</TD></TR></TABLE><BR>';
    }
    Warehouse('footer_plain');
    PDFStop($handle);
}