本文整理匯總了PHP中Buttons函數的典型用法代碼示例。如果您正苦於以下問題:PHP Buttons函數的具體用法?PHP Buttons怎麽用?PHP Buttons使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Buttons函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PrepareSchool
PrepareSchool(SessionSchool(), '', SessionCurSchool());
Warehouse('searchgrade');
Warehouse('searchyear');
if (defined('PRINT_LETTER')) {
echo '<TR><TD>Letter Text</TD><TD>';
echo '<TEXTAREA name=letter rows=10 cols=50>
Dear __PARENTS__,
Your child, __STUDENT__ (__STUDENT_ID__) now has a balance of __BALANCE__. It should be refilled as soon as possible to avoid running out.
--Administration
</TEXTAREA>';
echo '</TD></TR>';
}
echo '<TR><TD colspan=2 align=center>';
Buttons('Find', 'Reset');
echo '</TD></TR>';
echo '</TABLE>';
echo '</FORM>';
PopTable('footer');
}
if ($_REQUEST['modfunc'] == 'list') {
$_REQUEST['balance_low'] = ereg_replace('[^0-9]', '', $_REQUEST['balance_low']);
$_REQUEST['balance_high'] = ereg_replace('[^0-9]', '', $_REQUEST['balance_high']);
if ($_REQUEST['balance_low'] > $_REQUEST['balance_high']) {
$tmp = $_REQUEST['balance_high'];
$_REQUEST['balance_high'] = $_REQUEST['balance_low'];
$_REQUEST['balance_low'] = $tmp;
}
}
if ($_REQUEST[modfunc] == 'list' && ($_REQUEST[editor] == 'stubilling' || $_REQUEST[editor] == 'lunch')) {
示例2: PopTable
PopTable('header', 'Advanced');
echo "<FORM name=percentform action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&list_by_day=" . strip_tags(trim($_REQUEST[list_by_day])) . "&day_start=" . strip_tags(trim($_REQUEST[day_start])) . "&day_end=" . strip_tags(trim($_REQUEST[day_end])) . "&month_start=" . strip_tags(trim($_REQUEST[month_start])) . "&month_end=" . strip_tags(trim($_REQUEST[month_end])) . "&year_start=" . strip_tags(trim($_REQUEST[year_start])) . "&year_end=" . strip_tags(trim($_REQUEST[year_end])) . " method=POST>";
echo '<TABLE>';
Search('general_info', $extra['grades']);
if (!isset($extra)) {
$extra = array();
}
Widgets('user', $extra);
if ($extra['search']) {
echo $extra['search'];
}
Search('student_fields', is_array($extra['student_fields']) ? $extra['student_fields'] : array());
if (User('PROFILE') == 'admin') {
echo '<CENTER><INPUT type=checkbox name=_search_all_schools value=Y' . (Preferences('DEFAULT_ALL_SCHOOLS') == 'Y' ? ' CHECKED' : '') . '><font color=black>Search All Schools</font></CENTER><BR>';
}
echo '<CENTER>' . Buttons('Submit') . '</CENTER>';
echo '</FORM>';
PopTable('footer');
}
if (!$_REQUEST['modfunc']) {
if (!isset($extra)) {
$extra = array();
}
Widgets('user');
if ($_REQUEST['advanced'] == 'Y') {
Widgets('all');
}
$extra['WHERE'] .= appendSQL('');
$extra['WHERE'] .= CustomFields('where');
echo "<FORM name=ada_from id=ada_from onSubmit='return formcheck_ada_dates();' action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&list_by_day=" . strip_tags(trim($_REQUEST[list_by_day])) . " method=POST>";
$advanced_link = " <A HREF=Modules.php?modname={$_REQUEST['modname']}&modfunc=search&list_by_day={$_REQUEST['list_by_day']}&day_start={$_REQUEST['day_start']}&day_end={$_REQUEST['day_end']}&month_start={$_REQUEST['month_start']}&month_end={$_REQUEST['month_end']}&year_start={$_REQUEST['year_start']}&year_end={$_REQUEST['year_end']}>Advanced</A>";
示例3: PopTable
case 'parent':
case 'student':
echo '<BR>';
PopTable('header', 'Search');
if ($extra['pdf'] != true) {
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc={$_REQUEST['modfunc']}&search_modfunc=list&next_modname={$_REQUEST['next_modname']}" . $extra['action'] . " method=POST>";
} else {
echo "<FORM action=for_export.php?modname={$_REQUEST['modname']}&modfunc={$_REQUEST['modfunc']}&search_modfunc=list&next_modname={$_REQUEST['next_modname']}" . $extra['action'] . " method=POST target=_blank>";
}
echo '<TABLE border=0>';
if ($extra['search']) {
echo $extra['search'];
}
echo '<TR><TD colspan=2 align=center>';
echo '<BR>';
echo Buttons('Submit', 'Reset');
echo '</TD></TR>';
echo '</TABLE>';
echo '</FORM>';
PopTable('footer');
break;
}
} else {
if (!$_REQUEST['next_modname']) {
$_REQUEST['next_modname'] = 'Students/Student.php';
}
if ($_REQUEST['address_group']) {
$extra['SELECT'] .= ',sam.ADDRESS_ID';
if (!($_REQUEST['expanded_view'] == 'true' || $_REQUEST['addr'] || $extra['addr'])) {
$extra['FROM'] = " LEFT OUTER JOIN STUDENTS_JOIN_ADDRESS sam ON (sam.STUDENT_ID=ssm.STUDENT_ID AND sam.RESIDENCE='Y')" . $extra['FROM'];
}
示例4: _
echo '</TD><TD>';
echo '<TABLE class="width-100p"><TR><TD class="center"><BR />';
if ($extra['search_second_col']) {
echo $extra['search_second_col'];
}
if (User('PROFILE') == 'admin') {
//modif Francois: add <label> on checkbox
//modif Francois: if only one school, no Search All Schools option
if (SchoolInfo('SCHOOLS_NB') > 1) {
echo '<label><INPUT type="checkbox" name="_search_all_schools" value="Y"' . (Preferences('DEFAULT_ALL_SCHOOLS') == 'Y' ? ' checked' : '') . '> ' . _('Search All Schools') . '</label><BR />';
}
} else {
echo '<label><INPUT type="checkbox" name="include_inactive" value="Y"> ' . _('Include Parents of Inactive Students') . '</label><BR />';
}
echo '<BR />';
echo Buttons(_('Submit'), _('Reset'));
echo '</TD></TR>';
echo '</TABLE>';
if ($extra['second_col']) {
echo '<BR /><TABLE>' . $extra['second_col'] . '</TABLE>';
}
echo '</TD></TR>';
echo '<TR class="valign-top"><TD><TABLE class="width-100p cellspacing-0 cellpadding-0"><TR><TD>';
if ($_REQUEST['advanced'] == 'Y') {
$extra['search'] = '';
StaffWidgets('all', $extra);
if ($extra['search']) {
echo '<TABLE class="postbox cellpadding-0 cellspacing-0"><TR><TH>';
echo '<H3>' . _('Widgets') . '</H3></TH></TR>';
echo $extra['search'];
echo '</TABLE><br />';
示例5: mySearch
function mySearch($type, $extra = '')
{
global $extra;
if ($_REQUEST['search_modfunc'] == 'search_fnc' || !$_REQUEST['search_modfunc']) {
echo '<BR>';
PopTable('header', 'Search');
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc={$_REQUEST['modfunc']}&search_modfunc=list&next_modname={$_REQUEST['next_modname']} method=POST>";
echo '<TABLE border=0>';
$RET = DBGet(DBQuery("SELECT STAFF_ID,CONCAT(LAST_NAME,LAST_NAME,', ',FIRST_NAME) AS FULL_NAME FROM STAFF WHERE PROFILE='teacher' AND position('," . UserSchool() . ",' IN SCHOOLS)>0 AND SYEAR='" . UserSyear() . "' ORDER BY FULL_NAME"));
echo '<TR><TD align=right width=120>Teacher</TD><TD>';
echo "<SELECT name=teacher_id style='max-width:250;'><OPTION value=''>N/A</OPTION>";
foreach ($RET as $teacher) {
echo "<OPTION value={$teacher['STAFF_ID']}>{$teacher['FULL_NAME']}</OPTION>";
}
echo '</SELECT>';
echo '</TD></TR>';
$RET = DBGet(DBQuery("SELECT SUBJECT_ID,TITLE FROM COURSE_SUBJECTS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY TITLE"));
echo '<TR><TD align=right width=120>Subject</TD><TD>';
echo "<SELECT name=subject_id style='max-width:250;'><OPTION value=''>N/A</OPTION>";
foreach ($RET as $subject) {
echo "<OPTION value={$subject['SUBJECT_ID']}>{$subject['TITLE']}</OPTION>";
}
echo '</SELECT>';
$RET = DBGet(DBQuery("SELECT PERIOD_ID,TITLE FROM SCHOOL_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY SORT_ORDER"));
echo '<TR><TD align=right width=120>Period</TD><TD>';
echo "<SELECT name=period_id style='max-width:250;'><OPTION value=''>N/A</OPTION>";
foreach ($RET as $period) {
echo "<OPTION value={$period['PERIOD_ID']}>{$period['TITLE']}</OPTION>";
}
echo '</SELECT>';
echo '</TD></TR>';
Widgets('course');
echo $extra['search'];
echo '<TR><TD colspan=2 align=center>';
echo '<BR>';
echo Buttons('Submit', 'Reset');
echo '</TD></TR>';
echo '</TABLE>';
echo '</FORM>';
PopTable('footer');
} else {
DrawHeader('', $extra['header_right']);
DrawHeader($extra['extra_header_left'], $extra['extra_header_right']);
if (User('PROFILE') == 'admin') {
if ($_REQUEST['teacher_id']) {
$where .= " AND cp.TEACHER_ID='{$_REQUEST['teacher_id']}'";
}
if ($_REQUEST['first']) {
$where .= " AND UPPER(s.FIRST_NAME) LIKE '" . strtoupper($_REQUEST['first']) . "%'";
}
if ($_REQUEST['w_course_period_id']) {
if ($_REQUEST['w_course_period_id_which'] == 'course') {
$where .= " AND cp.COURSE_ID=(SELECT COURSE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $_REQUEST['w_course_period_id'] . "')";
} else {
$where .= " AND cp.COURSE_PERIOD_ID='" . $_REQUEST['w_course_period_id'] . "'";
}
}
if ($_REQUEST['subject_id']) {
$from .= ",COURSES c";
$where .= " AND c.COURSE_ID=cp.COURSE_ID AND c.SUBJECT_ID='" . $_REQUEST['subject_id'] . "'";
}
if ($_REQUEST['period_id']) {
$where .= " AND cp.PERIOD_ID='" . $_REQUEST['period_id'] . "'";
}
$sql = "SELECT cp.COURSE_PERIOD_ID,cp.TITLE,sp.ATTENDANCE FROM COURSE_PERIODS cp,SCHOOL_PERIODS sp{$from} WHERE cp.SCHOOL_ID='" . UserSchool() . "' AND cp.SYEAR='" . UserSyear() . "' AND sp.PERIOD_ID=cp.PERIOD_ID{$where}";
} elseif (User('PROFILE') == 'teacher') {
$sql = "SELECT cp.COURSE_PERIOD_ID,cp.TITLE,sp.ATTENDANCE FROM COURSE_PERIODS cp,SCHOOL_PERIODS sp WHERE cp.SCHOOL_ID='" . UserSchool() . "' AND cp.SYEAR='" . UserSyear() . "' AND cp.TEACHER_ID='" . User('STAFF_ID') . "' AND sp.PERIOD_ID=cp.PERIOD_ID";
} else {
$sql = "SELECT cp.COURSE_PERIOD_ID,cp.TITLE,sp.ATTENDANCE FROM COURSE_PERIODS cp,SCHOOL_PERIODS sp,SCHEDULE ss WHERE cp.SCHOOL_ID='" . UserSchool() . "' AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.SYEAR='" . UserSyear() . "' AND ss.STUDENT_ID='" . UserStudentID() . "' AND (CURRENT_DATE>=ss.START_DATE AND (ss.END_DATE IS NULL OR CURRENT_DATE<=ss.END_DATE)) AND sp.PERIOD_ID=cp.PERIOD_ID";
}
$sql .= ' ORDER BY sp.PERIOD_ID';
$course_periods_RET = DBGet(DBQuery($sql), array('COURSE_PERIOD_ID' => '_makeChooseCheckbox'));
$LO_columns = array('COURSE_PERIOD_ID' => '</A><INPUT type=checkbox value=Y name=controller onclick="checkAll(this.form,this.form.controller.checked,\'cp_arr\');"><A>', 'TITLE' => 'Course Period');
ListOutput($course_periods_RET, $LO_columns, 'Course Period', 'Course Periods');
}
}
示例6: mySearch
function mySearch($type, $extra = '')
{
global $extra;
if ($_REQUEST['search_modfunc'] == 'search_fnc' || !$_REQUEST['search_modfunc']) {
echo '<BR>';
PopTable('header', 'Search');
echo "<FORM action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&modfunc=" . strip_tags(trim($_REQUEST[modfunc])) . "&search_modfunc=list&next_modname=" . strip_tags(trim($_REQUEST[next_modname])) . " method=POST>";
echo '<TABLE border=0>';
$RET = DBGet(DBQuery('SELECT s.STAFF_ID,CONCAT(s.LAST_NAME,\'' . ',' . '\',s.FIRST_NAME) AS FULL_NAME FROM staff s,staff_school_relationship ssr WHERE s.STAFF_ID=ssr.STAFF_ID AND s.PROFILE=\'' . 'teacher' . '\' AND position(\'' . UserSchool() . '\' IN ssr.SCHOOL_ID)>0 AND ssr.SYEAR=\'' . UserSyear() . '\' ORDER BY FULL_NAME'));
echo '<TR><TD align=right width=120>Teacher</TD><TD>';
echo "<SELECT name=teacher_id style='max-width:250;'><OPTION value=''>N/A</OPTION>";
foreach ($RET as $teacher) {
echo "<OPTION value={$teacher['STAFF_ID']}>{$teacher['FULL_NAME']}</OPTION>";
}
echo '</SELECT>';
echo '</TD></TR>';
$RET = DBGet(DBQuery('SELECT SUBJECT_ID,TITLE FROM course_subjects WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' ORDER BY TITLE'));
echo '<TR><TD align=right width=120>Subject</TD><TD>';
echo "<SELECT name=subject_id style='max-width:250;'><OPTION value=''>N/A</OPTION>";
foreach ($RET as $subject) {
echo "<OPTION value={$subject['SUBJECT_ID']}>{$subject['TITLE']}</OPTION>";
}
echo '</SELECT>';
$RET = DBGet(DBQuery('SELECT PERIOD_ID,TITLE FROM school_periods WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY SORT_ORDER'));
echo '<TR><TD align=right width=120>Period</TD><TD>';
echo "<SELECT name=period_id style='max-width:250;'><OPTION value=''>N/A</OPTION>";
foreach ($RET as $period) {
echo "<OPTION value={$period['PERIOD_ID']}>{$period['TITLE']}</OPTION>";
}
echo '</SELECT>';
echo '</TD></TR>';
Widgets('course');
echo $extra['search'];
echo '<TR><TD colspan=2 align=center>';
echo '<BR>';
echo Buttons('Submit', 'Reset');
echo '</TD></TR>';
echo '</TABLE>';
echo '</FORM>';
PopTable('footer');
} else {
DrawHeader('', $extra['header_right']);
DrawHeader($extra['extra_header_left'], $extra['extra_header_right']);
if (User('PROFILE') == 'admin') {
if ($_REQUEST['teacher_id']) {
$where .= ' AND cp.TEACHER_ID=\'' . $_REQUEST[teacher_id] . '\'';
}
if ($_REQUEST['first']) {
$where .= ' AND UPPER(s.FIRST_NAME) LIKE \'' . strtoupper($_REQUEST['first']) . '%' . '\'';
}
if ($_REQUEST['w_course_period_id']) {
if ($_REQUEST['w_course_period_id_which'] == 'course') {
$where .= ' AND cp.COURSE_ID=(SELECT COURSE_ID FROM course_periods WHERE COURSE_PERIOD_ID=\'' . $_REQUEST['w_course_period_id'] . '\')';
} else {
$where .= ' AND cp.COURSE_PERIOD_ID=\'' . $_REQUEST['w_course_period_id'] . '\'';
}
}
if ($_REQUEST['subject_id']) {
$from .= ',courses c';
$where .= ' AND c.COURSE_ID=cp.COURSE_ID AND c.SUBJECT_ID=\'' . $_REQUEST['subject_id'] . '\'';
}
if ($_REQUEST['period_id']) {
$where .= " AND cpv.PERIOD_ID='" . $_REQUEST['period_id'] . "'";
}
$sql = 'SELECT cp.COURSE_PERIOD_ID,cp.TITLE,sp.ATTENDANCE FROM course_periods cp,course_period_var cpv,school_periods sp' . $from . ' WHERE cp.SCHOOL_ID=\'' . UserSchool() . '\' AND cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID AND cp.SYEAR=\'' . UserSyear() . '\' AND sp.PERIOD_ID=cpv.PERIOD_ID' . $where . '';
} elseif (User('PROFILE') == 'teacher') {
$sql = 'SELECT cp.COURSE_PERIOD_ID,cp.TITLE,sp.ATTENDANCE FROM course_periods cp,course_period_var cpv,school_periods sp WHERE cp.SCHOOL_ID=\'' . UserSchool() . '\' AND cp.SYEAR=\'' . UserSyear() . '\' AND cp.TEACHER_ID=\'' . User('STAFF_ID') . '\' AND sp.PERIOD_ID=cpv.PERIOD_ID AND cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID';
} else {
$sql = 'SELECT cp.COURSE_PERIOD_ID,cp.TITLE,sp.ATTENDANCE FROM course_periods cp,course_period_var cpv,school_periods sp,schedule ss WHERE cp.SCHOOL_ID=\'' . UserSchool() . '\' AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.SYEAR=\'' . UserSyear() . '\' AND ss.STUDENT_ID=\'' . UserStudentID() . '\' AND (CURRENT_DATE>=ss.START_DATE AND (ss.END_DATE IS NULL OR CURRENT_DATE<=ss.END_DATE)) AND sp.PERIOD_ID=cpv.PERIOD_ID AND cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID';
}
$sql .= ' GROUP BY cp.COURSE_PERIOD_ID ORDER BY sp.PERIOD_ID';
$course_periods_RET = DBGet(DBQuery($sql), array('COURSE_PERIOD_ID' => '_makeChooseCheckbox'));
$_SESSION['count_course_periods'] = count($course_periods_RET);
$LO_columns = array('COURSE_PERIOD_ID' => '</A><INPUT type=checkbox value=Y name=controller onclick="checkAll(this.form,this.form.controller.checked,\'cp_arr\');"><A>', 'TITLE' => 'Course Period');
ListOutput($course_periods_RET, $LO_columns, 'Course Period', 'Course Periods');
}
}
示例7: foreach
foreach ($RET as $subject) {
echo "<OPTION value={$subject['SUBJECT_ID']}>{$subject['TITLE']}</OPTION>";
}
echo '</SELECT>';
$RET = DBGet(DBQuery("SELECT PERIOD_ID,TITLE FROM school_periods WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY SORT_ORDER"));
echo '<TR><TD align=right>' . _('Period') . '</TD><TD>';
echo "<SELECT name=period_id style='max-width:250;'><OPTION value=''>N/A</OPTION>";
foreach ($RET as $period) {
echo "<meta charset='UTF-8'><OPTION value={$period['PERIOD_ID']}>{$period['TITLE']}</OPTION>";
}
echo '</SELECT>';
echo '</TD></TR>';
Widgets('course');
echo '<TR><TD colspan=2 align=center>';
echo '<BR>';
echo Buttons('' . _('Submit') . '', '' . _('Reset') . '');
echo '</TD></TR>';
echo '</TABLE>';
echo '</FORM>';
PopTable('footer');
}
}
function mySearch($extra)
{
// echo "<FORM action=Modules.php?modname=$_REQUEST[modname]&modfunc=save&search_modfunc=list&_openSIS_PDF=true onsubmit=document.forms[0].relation.value=document.getElementById(\"relation\").value; method=POST>";
// echo "<FORM name=exp id=exp action=for_export.php?modname=$_REQUEST[modname]&modfunc=save&search_modfunc=list&_openSIS_PDF=true onsubmit=document.forms[0].relation.value=document.getElementById(\"relation\").value; method=POST target=_blank>";
echo "<FORM name=exp id=exp action=for_export.php?modname={$_REQUEST['modname']}&head_html=Teacher+Class+List&modfunc=save&search_modfunc=list&_openSIS_PDF=true onsubmit=document.forms[0].relation.value=document.getElementById(\"relation\").value; method=POST target=_blank>";
echo '<DIV id=fields_div></DIV>';
DrawHeader('', $extra['header_right']);
DrawHeader($extra['extra_header_left'], $extra['extra_header_right']);
if (User('PROFILE') == 'admin') {
示例8: mySearch
function mySearch($type, $extra = '')
{
global $extra;
if ($_REQUEST['search_modfunc'] == 'search_fnc' || !$_REQUEST['search_modfunc']) {
$_SESSION['Search_PHP_SELF'] = PreparePHP_SELF($_SESSION['_REQUEST_vars'], array('bottom_back'));
if ($_SESSION['Back_PHP_SELF'] != 'course') {
$_SESSION['Back_PHP_SELF'] = 'course';
unset($_SESSION['List_PHP_SELF']);
}
echo '<script type="text/javascript">parent.help.location.reload();</script>';
echo '<BR />';
PopTable('header', _('Find a Course'));
echo '<FORM action="Modules.php?modname=' . $_REQUEST['modname'] . '&modfunc=' . $_REQUEST['modfunc'] . '&search_modfunc=list&next_modname=' . $_REQUEST['next_modname'] . '" method="POST">';
echo '<TABLE>';
$RET = DBGet(DBQuery("SELECT STAFF_ID,LAST_NAME||', '||FIRST_NAME AS FULL_NAME FROM STAFF WHERE PROFILE='teacher' AND (SCHOOLS IS NULL OR position('," . UserSchool() . ",' IN SCHOOLS)>0) AND SYEAR='" . UserSyear() . "' ORDER BY FULL_NAME"));
echo '<TR><TD style="text-align:right; width:120px:">' . _('Teacher') . '</TD><TD>';
echo '<SELECT name="teacher_id" style="max-width:250;"><OPTION value="">' . _('N/A') . '</OPTION>';
foreach ($RET as $teacher) {
echo '<OPTION value="' . $teacher['STAFF_ID'] . '">' . $teacher['FULL_NAME'] . '</OPTION>';
}
echo '</SELECT>';
echo '</TD></TR>';
$RET = DBGet(DBQuery("SELECT SUBJECT_ID,TITLE FROM COURSE_SUBJECTS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY TITLE"));
echo '<TR><TD style="text-align:right; width:120px:">' . _('Subject') . '</TD><TD>';
echo '<SELECT name="subject_id" style="max-width:250;"><OPTION value="">' . _('N/A') . '</OPTION>';
foreach ($RET as $subject) {
echo '<OPTION value="' . $subject['SUBJECT_ID'] . '">' . $subject['TITLE'] . '</OPTION>';
}
echo '</SELECT>';
$RET = DBGet(DBQuery("SELECT PERIOD_ID,TITLE FROM SCHOOL_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY SORT_ORDER"));
echo '<TR><TD style="text-align:right; width:120px:">' . _('Period') . '</TD><TD>';
echo "<SELECT name=period_id style='max-width:250;'><OPTION value=''>" . _('N/A') . "</OPTION>";
foreach ($RET as $period) {
echo "<OPTION value={$period['PERIOD_ID']}>{$period['TITLE']}</OPTION>";
}
echo '</SELECT>';
echo '</TD></TR>';
Widgets('course');
echo $extra['search'];
echo '<TR><TD colspan="2" class="center">';
echo '<BR />';
echo Buttons(_('Submit'), _('Reset'));
echo '</TD></TR>';
echo '</TABLE>';
echo '</FORM>';
PopTable('footer');
} else {
DrawHeader('', $extra['header_right']);
DrawHeader($extra['extra_header_left'], $extra['extra_header_right']);
if (User('PROFILE') == 'admin') {
if ($_REQUEST['teacher_id']) {
$where .= " AND cp.TEACHER_ID='{$_REQUEST['teacher_id']}'";
}
if ($_REQUEST['first']) {
$where .= " AND UPPER(s.FIRST_NAME) LIKE '" . mb_strtoupper($_REQUEST['first']) . "%'";
}
if ($_REQUEST['w_course_period_id']) {
if ($_REQUEST['w_course_period_id_which'] == 'course') {
$where .= " AND cp.COURSE_ID=(SELECT COURSE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $_REQUEST['w_course_period_id'] . "')";
} else {
$where .= " AND cp.COURSE_PERIOD_ID='" . $_REQUEST['w_course_period_id'] . "'";
}
}
if ($_REQUEST['subject_id']) {
$from .= ",COURSES c";
$where .= " AND c.COURSE_ID=cp.COURSE_ID AND c.SUBJECT_ID='" . $_REQUEST['subject_id'] . "'";
}
//modif Francois: multiple school periods for a course period
if ($_REQUEST['period_id']) {
//$where .= " AND cp.PERIOD_ID='".$_REQUEST['period_id']."'";
$where .= " AND cpsp.PERIOD_ID='" . $_REQUEST['period_id'] . "' AND cp.COURSE_PERIOD_ID=cpsp.COURSE_PERIOD_ID";
$from .= ",COURSE_PERIOD_SCHOOL_PERIODS cpsp";
}
//$sql = "SELECT cp.COURSE_PERIOD_ID,cp.TITLE,sp.ATTENDANCE FROM COURSE_PERIODS cp,SCHOOL_PERIODS sp$from WHERE cp.SCHOOL_ID='".UserSchool()."' AND cp.SYEAR='".UserSyear()."' AND sp.PERIOD_ID=cp.PERIOD_ID$where";
$sql = "SELECT cp.COURSE_PERIOD_ID,cp.TITLE FROM COURSE_PERIODS cp{$from} WHERE cp.SCHOOL_ID='" . UserSchool() . "' AND cp.SYEAR='" . UserSyear() . "'{$where}";
} elseif (User('PROFILE') == 'teacher') {
//modif Francois: multiple school periods for a course period
//$sql = "SELECT cp.COURSE_PERIOD_ID,cp.TITLE,sp.ATTENDANCE FROM COURSE_PERIODS cp,SCHOOL_PERIODS sp WHERE cp.SCHOOL_ID='".UserSchool()."' AND cp.SYEAR='".UserSyear()."' AND cp.TEACHER_ID='".User('STAFF_ID')."' AND sp.PERIOD_ID=cp.PERIOD_ID";
$sql = "SELECT cp.COURSE_PERIOD_ID,cp.TITLE FROM COURSE_PERIODS cp WHERE cp.SCHOOL_ID='" . UserSchool() . "' AND cp.SYEAR='" . UserSyear() . "' AND cp.TEACHER_ID='" . User('STAFF_ID') . "'";
} else {
//modif Francois: multiple school periods for a course period
//$sql = "SELECT cp.COURSE_PERIOD_ID,cp.TITLE,sp.ATTENDANCE FROM COURSE_PERIODS cp,SCHOOL_PERIODS sp,SCHEDULE ss WHERE cp.SCHOOL_ID='".UserSchool()."' AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.SYEAR='".UserSyear()."' AND ss.STUDENT_ID='".UserStudentID()."' AND (CURRENT_DATE>=ss.START_DATE AND (ss.END_DATE IS NULL OR CURRENT_DATE<=ss.END_DATE)) AND sp.PERIOD_ID=cp.PERIOD_ID";
$sql = "SELECT cp.COURSE_PERIOD_ID,cp.TITLE FROM COURSE_PERIODS cp,SCHEDULE ss WHERE cp.SCHOOL_ID='" . UserSchool() . "' AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.SYEAR='" . UserSyear() . "' AND ss.STUDENT_ID='" . UserStudentID() . "' AND (CURRENT_DATE>=ss.START_DATE AND (ss.END_DATE IS NULL OR CURRENT_DATE<=ss.END_DATE))";
}
//$sql .= ' ORDER BY sp.PERIOD_ID';
$course_periods_RET = DBGet(DBQuery($sql), array('COURSE_PERIOD_ID' => '_makeChooseCheckbox'));
$LO_columns = array('COURSE_PERIOD_ID' => '</A><INPUT type="checkbox" value="Y" name="controller" onclick="checkAll(this.form,this.form.controller.checked,\'cp_arr\');" checked /><A>', 'TITLE' => _('Course Period'));
if (!$_REQUEST['LO_save'] && !$extra['suppress_save']) {
$_SESSION['List_PHP_SELF'] = PreparePHP_SELF($_SESSION['_REQUEST_vars'], array('bottom_back'));
if ($_SESSION['Back_PHP_SELF'] != 'course') {
$_SESSION['Back_PHP_SELF'] = 'course';
unset($_SESSION['Search_PHP_SELF']);
}
echo '<script type="text/javascript">parent.help.location.reload();</script>';
}
echo '<INPUT type="hidden" name="relation">';
ListOutput($course_periods_RET, $LO_columns, 'Course Period', 'Course Periods');
}
}