本文整理汇总了PHP中BackPrompt函数的典型用法代码示例。如果您正苦于以下问题:PHP BackPrompt函数的具体用法?PHP BackPrompt怎么用?PHP BackPrompt使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BackPrompt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ListOutputPrint
}
echo '</table>';
//echo '<div style="font-size:18px; font-weight:bold; ">'.Config('TITLE').' Student Schedule</div><div style="height:20px;"></div>';
//echo '<div>'.$courses[1]['FULL_NAME'].' - #'.$courses[1]['STUDENT_ID']. '</div>';
//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;"> </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>';
示例2: foreach
foreach ($_REQUEST['values']['STUDENT_ENROLLMENT'][UserStudentID()] as $column => $value) {
$sql .= "{$column}='" . str_replace(''', "''", $value) . "',";
}
$sql = mb_substr($sql, 0, -1) . " WHERE STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'";
DBQuery($sql);
}
} else {
if ($_REQUEST['assign_student_id']) {
$student_id = $_REQUEST['assign_student_id'];
if (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='{$student_id}'")))) {
BackPrompt(_('That RosarioSIS ID is already taken. Please select a different one.'));
}
} elseif (empty($_REQUEST['students']['FIRST_NAME']) || empty($_REQUEST['students']['LAST_NAME']) || empty($_REQUEST['values']['STUDENT_ENROLLMENT']['new']['GRADE_ID'])) {
BackPrompt(_('Please fill in the required fields'));
} elseif ($_REQUEST['moodle_create_student'] && empty($_REQUEST['students']['USERNAME'])) {
BackPrompt(_('Please fill in the required fields'));
} else {
do {
$student_id = DBGet(DBQuery('SELECT ' . db_seq_nextval('STUDENTS_SEQ') . ' AS STUDENT_ID ' . FROM_DUAL));
$student_id = $student_id[1]['STUDENT_ID'];
} while (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='" . $student_id . "'"))));
}
$sql = "INSERT INTO STUDENTS ";
$fields = 'STUDENT_ID,';
$values = "'" . $student_id . "',";
foreach ($_REQUEST['students'] as $column => $value) {
if ($column == 'USERNAME' && $value) {
if (DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE USERNAME='" . $value . "'"))) {
$value = '';
}
}
示例3: foreach
break;
case 'QTR':
$fields .= 'SEMESTER_ID,';
$values .= '\'' . $_REQUEST['semester_id'] . '\',';
break;
case 'PRO':
$fields .= 'QUARTER_ID,';
$values .= '\'' . $_REQUEST['quarter_id'] . '\',';
break;
}
$go = false;
foreach ($columns as $column => $value) {
$value = paramlib_validation($column, trim($value));
if ($column == 'START_DATE' || $column == 'END_DATE' || $column == 'POST_START_DATE' || $column == 'POST_END_DATE') {
if (!VerifyDate($value) && $value != '') {
BackPrompt('Not all of the dates were entered correctly.');
}
}
if ($value) {
if ($column == 'START_DATE' && $columns['START_DATE'] != '') {
if (strtotime($dates['START_DATE']) <= strtotime($columns['START_DATE'])) {
$fields .= $column . ',';
$values .= '\'' . str_replace("'", "''", str_replace("\\'", "''", $value)) . '\',';
$go = true;
} else {
$err_msg = "Start date cannot be earlier than {$nm} start date";
$_REQUEST['marking_period_id'] = 'new';
break 2;
}
}
if ($column == 'END_DATE' && $columns['END_DATE'] != '') {
示例4: DBGet
$password = $this_school_mod['PASSWORD'];
$this_school_RET = DBGet(DBQuery("SELECT * FROM staff_school_info WHERE STAFF_ID=" . $_REQUEST[staff_id]));
$this_school = $this_school_RET[1];
if (isset($_REQUEST['staff']['PROFILE']) && $_REQUEST['staff']['PROFILE'] != $profile_RET[1]['PROFILE_ID']) {
if ($_REQUEST['staff']['PROFILE'] == 'admin') {
$_REQUEST['staff']['PROFILE_ID'] = '1';
} elseif ($_REQUEST['staff']['PROFILE'] == 'teacher') {
$_REQUEST['staff']['PROFILE_ID'] = '2';
} elseif ($_REQUEST['staff']['PROFILE'] == 'parent') {
$_REQUEST['staff']['PROFILE_ID'] = '4';
}
}
if ($_REQUEST['staff']['USERNAME'] && $_REQUEST['staff']['USERNAME'] != $profile_RET[1]['USERNAME']) {
$existing_staff = DBGet(DBQuery('SELECT ssr.SYEAR FROM staff s,staff_school_relationship ssr WHERE s.STAFF_ID=ssr.STAFF_ID AND s.USERNAME=\'' . $_REQUEST['staff']['USERNAME'] . '\' AND ssr.SYEAR=(SELECT SYEAR FROM staff_school_relationship WHERE STAFF_ID=\'' . $_REQUEST[staff_id] . '\')'));
if (count($existing_staff)) {
BackPrompt('A user with that username already exists for the ' . $existing_staff[1]['SYEAR'] . ' school year. Choose a different username and try again.');
}
}
if (count($_REQUEST['month_staff'])) {
foreach ($_REQUEST['month_staff'] as $column => $value) {
$_REQUEST['staff'][$column] = $_REQUEST['day_staff'][$column] . '-' . $_REQUEST['month_staff'][$column] . '-' . $_REQUEST['year_staff'][$column];
if ($_REQUEST['staff'][$column] == '--') {
$_REQUEST['staff'][$column] = '';
} elseif (!VerifyDate($_REQUEST['staff'][$column])) {
unset($_REQUEST['staff'][$column]);
$note = "The invalid date could not be saved. ";
}
}
}
unset($_REQUEST['day_staff']);
unset($_REQUEST['month_staff']);
示例5: DBGet
if (optional_param('modfunc', '', PARAM_NOTAGS) == 'save') {
if ($_REQUEST['activity_id']) {
$current_RET = DBGet(DBQuery('SELECT STUDENT_ID FROM student_eligibility_activities WHERE ACTIVITY_ID=\'' . $_SESSION['activity_id'] . '\' AND SYEAR=\'' . UserSyear() . '\''), array(), array('STUDENT_ID'));
foreach ($_REQUEST['student'] as $student_id => $yes) {
if (!$current_RET[$student_id]) {
/*$sql = "INSERT INTO student_eligibility_activities (SYEAR,STUDENT_ID,ACTIVITY_ID)
values('".UserSyear()."','".$student_id."','".$_REQUEST['activity_id']."')";*/
$sql = 'INSERT INTO student_eligibility_activities (SYEAR,STUDENT_ID,ACTIVITY_ID)
values(\'' . UserSyear() . '\',\'' . $student_id . '\',\'' . optional_param('activity_id', '', PARAM_SPCL) . '\')';
DBQuery($sql);
}
}
unset($_REQUEST['modfunc']);
$note = "That activity has been added to the selected students.";
} else {
BackPrompt('You must choose an activity.');
}
}
DrawBC("Extracurricular > " . ProgramTitle());
if ($note) {
DrawHeader('<table><tr><td><IMG SRC=assets/check.gif></td><td class=notice_msg>' . $note . '</td></tr></table>');
}
if ($_REQUEST['search_modfunc'] == 'list') {
echo "<FORM name=addact id=addact action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save METHOD=POST>";
#DrawHeader('',SubmitButton('Add Activity to Selected Students'));
#echo '<BR>';
echo '<CENTER><TABLE cellpadding=6><TR><TD align=right><b>Activity</b></TD>';
echo '<TD>';
$activities_RET = DBGet(DBQuery('SELECT ID,TITLE FROM eligibility_activities WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
echo '<SELECT name=activity_id><OPTION value="">N/A</OPTION>';
if (count($activities_RET)) {
示例6: PreparePHP_SELF
if ($mps[$last_mp][1]['COMMENT_TITLE']) {
$grades_RET[$i]['COMMENT'] .= $sep . $mps[$last_mp][1]['COMMENT_TITLE'];
}
}
}
}
if (count($_REQUEST['mp_arr']) == 1) {
$link['remove']['link'] = PreparePHP_SELF($_REQUEST, array(), array('modfunc' => 'delete'));
$link['remove']['variables'] = array('student_id' => 'STUDENT_ID', 'course_period_id' => 'COURSE_PERIOD_ID', 'marking_period_id' => 'MARKING_PERIOD_ID');
}
ListOutput($grades_RET, $columns, '.', '.', $link);
} else {
BackPrompt(_('No Students were found.'));
}
} else {
BackPrompt(_('You must choose at least one student and one marking period'));
}
}
if (!$_REQUEST['modfunc']) {
DrawHeader(ProgramTitle());
if ($_REQUEST['search_modfunc'] == 'list') {
$_CENTRE['allow_edit'] = true;
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save&include_inactive={$_REQUEST['include_inactive']} method=POST>";
$extra['header_right'] = SubmitButton(_('Create Grade Lists for Selected Students'));
$attendance_codes = DBGet(DBQuery("SELECT SHORT_NAME,ID FROM ATTENDANCE_CODES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND (DEFAULT_CODE!='Y' OR DEFAULT_CODE IS NULL) AND TABLE_NAME='0'"));
$extra['extra_header_left'] = '<TABLE>';
$extra['extra_header_left'] .= '<TR><TD colspan=2><b>' . Localize('colon', _('Include on Grade List')) . '</b></TD></TR>';
$extra['extra_header_left'] .= '<TR><TD></TD><TD><TABLE>';
$extra['extra_header_left'] .= '<TR>';
$extra['extra_header_left'] .= '<TD><INPUT type=checkbox name=elements[teacher] value=Y CHECKED>' . _('Teacher') . '</TD>';
$extra['extra_header_left'] .= '<TD></TD>';
示例7: mb_substr
if ($value) {
$fields .= $column . ',';
$values .= "'" . $value . "',";
$go = true;
}
}
$sql .= '(' . mb_substr($fields, 0, -1) . ') values(' . mb_substr($values, 0, -1) . ')';
}
// CHECK TO MAKE SURE ONLY ONE MP & ONE GRADING PERIOD IS OPEN AT ANY GIVEN TIME
$dates_RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM SCHOOL_MARKING_PERIODS WHERE MP='{$_REQUEST['mp_term']}' AND (true=false" . ($columns['START_DATE'] ? " OR '" . $columns['START_DATE'] . "' BETWEEN START_DATE AND END_DATE" : '') . ($columns['END_DATE'] ? " OR '" . $columns['END_DATE'] . "' BETWEEN START_DATE AND END_DATE" : '') . ($columns['START_DATE'] && $columns['END_DATE'] ? " OR START_DATE BETWEEN '" . $columns['START_DATE'] . "' AND '" . $columns['END_DATE'] . "'\n\t\t\t\tOR END_DATE BETWEEN '" . $columns['START_DATE'] . "' AND '" . $columns['END_DATE'] . "'" : '') . ") AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'" . ($id != 'new' ? " AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' AND MARKING_PERIOD_ID!='{$id}'" : '')));
$posting_RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM SCHOOL_MARKING_PERIODS WHERE MP='{$_REQUEST['mp_term']}' AND (true=false" . ($columns['POST_START_DATE'] ? " OR '" . $columns['POST_START_DATE'] . "' BETWEEN POST_START_DATE AND POST_END_DATE" : '') . ($columns['POST_END_DATE'] ? " OR '" . $columns['POST_END_DATE'] . "' BETWEEN POST_START_DATE AND POST_END_DATE" : '') . ($columns['POST_START_DATE'] && $columns['POST_END_DATE'] ? " OR POST_START_DATE BETWEEN '" . $columns['POST_START_DATE'] . "' AND '" . $columns['POST_END_DATE'] . "'\n\t\t\t\tOR POST_END_DATE BETWEEN '" . $columns['POST_START_DATE'] . "' AND '" . $columns['POST_END_DATE'] . "'" : '') . ") AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'" . ($id != 'new' ? " AND MARKING_PERIOD_ID!='{$id}'" : '')));
if (count($dates_RET)) {
BackPrompt(sprintf(_('The beginning and end dates you specified for this marking period overlap with those of "%s".'), GetMP($dates_RET[1]['MARKING_PERIOD_ID'])) . " " . _("Only one marking period can be open at any time."));
}
if (count($posting_RET)) {
BackPrompt(sprintf(_('The grade posting dates you specified for this marking period overlap with those of "%s".'), GetMP($posting_RET[1]['MARKING_PERIOD_ID'])) . " " . _("Only one grade posting period can be open at any time."));
}
if ($go) {
DBQuery($sql);
}
} else {
$error = ErrorMessage(array(_('Please enter a valid Sort Order.')));
}
}
unset($_REQUEST['tables']);
unset($_SESSION['_REQUEST_vars']['tables']);
}
if ($_REQUEST['modfunc'] == 'delete' & AllowEdit()) {
$extra = array();
switch ($_REQUEST['mp_term']) {
case 'FY':
示例8: DBQuery
}
if ($next_school != '') {
DBQuery("UPDATE STUDENT_ENROLLMENT SET NEXT_SCHOOL='" . $next_school . "' WHERE SYEAR='" . UserSyear() . "' AND STUDENT_ID IN (" . substr($students, 1) . ") ");
}
if ($calendar) {
DBQuery("UPDATE STUDENT_ENROLLMENT SET CALENDAR_ID='" . $calendar . "' WHERE SYEAR='" . UserSyear() . "' AND STUDENT_ID IN (" . substr($students, 1) . ") ");
}
if (!$note) {
$note = '<IMG SRC=assets/check.gif>' . _('The specified information was applied to the selected students.');
}
unset($_REQUEST['modfunc']);
unset($_REQUEST['values']);
unset($_SESSION['_REQUEST_vars']['modfunc']);
unset($_SESSION['_REQUEST_vars']['values']);
} else {
BackPrompt(_('You must choose at least one field and one student'));
}
}
DrawHeader(ProgramTitle());
if (!$_REQUEST['modfunc']) {
$extra['link'] = array('FULL_NAME' => false);
$extra['SELECT'] = ",CAST (NULL AS CHAR(1)) AS CHECKBOX";
if ($_REQUEST['search_modfunc'] == 'list') {
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save METHOD=POST>";
DrawHeader('', SubmitButton(_('Save')));
echo '<BR>';
if ($_REQUEST['category_id']) {
$fields_RET = DBGet(DBQuery("SELECT ID,TITLE,TYPE,SELECT_OPTIONS FROM CUSTOM_FIELDS WHERE CATEGORY_ID='{$_REQUEST['category_id']}'"), array(), array('TYPE'));
} else {
$fields_RET = DBGet(DBQuery("SELECT ID,TITLE,TYPE,SELECT_OPTIONS FROM CUSTOM_FIELDS"), array(), array('TYPE'));
}
示例9: substr
}
$sql = substr($sql, 0, -1) . " WHERE STAFF_ID='" . UserStaffID() . "'";
if (User('PROFILE') == 'admin') {
DBQuery($sql);
}
} else {
if ($_REQUEST['staff']['PROFILE'] == 'admin') {
$_REQUEST['staff']['PROFILE_ID'] = '1';
} elseif ($_REQUEST['staff']['PROFILE'] == 'teacher') {
$_REQUEST['staff']['PROFILE_ID'] = '2';
} elseif ($_REQUEST['staff']['PROFILE'] == 'parent') {
$_REQUEST['staff']['PROFILE_ID'] = '3';
}
$existing_staff = DBGet(DBQuery("SELECT 'exists' FROM STAFF WHERE USERNAME='" . $_REQUEST['staff']['USERNAME'] . "' AND SYEAR='" . UserSyear() . "'"));
if (count($existing_staff)) {
BackPrompt(_('A user with that username already exists for the current school year.') . ' ' . _('Choose a different username and try again.'));
}
$staff_id = DBGet(DBQuery('SELECT ' . db_seq_nextval('STAFF_SEQ') . ' AS STAFF_ID' . FROM_DUAL));
$staff_id = $staff_id[1]['STAFF_ID'];
$sql = "INSERT INTO STAFF ";
$fields = 'SYEAR,STAFF_ID,';
$values = "'" . UserSyear() . "','" . $staff_id . "',";
if (basename($_SERVER['PHP_SELF']) == 'index.php') {
$fields .= 'PROFILE,';
$values = "'" . Config('SYEAR') . "'" . substr($values, strpos($values, ',')) . "'none',";
}
foreach ($_REQUEST['staff'] as $column => $value) {
if ($value) {
$fields .= $column . ',';
$values .= "'" . str_replace("\\'", "''", $value) . "',";
}
示例10: unset
$_REQUEST[$var] = $students_RET['1'][$val];
}
}
if (!is_array($students_RET[1]['STUDENT_ID'])) {
$_SESSION['student_id'] = $students_RET[1]['STUDENT_ID'];
if (User('PROFILE') == 'admin') {
$_SESSION['UserSchool'] = $students_RET[1]['LIST_SCHOOL_ID'];
}
if (User('PROFILE') == 'teacher') {
$_SESSION['UserSchool'] = $students_RET[1]['SCHOOL_ID'];
}
echo '<script language=JavaScript>parent.side.location="' . $_SESSION['Side_PHP_SELF'] . '?modcat="+parent.side.document.forms[0].modcat.value;</script>';
unset($_REQUEST['search_modfunc']);
}
if ($_REQUEST['modname'] != $_REQUEST['next_modname']) {
$modname = $_REQUEST['next_modname'];
if (strpos($modname, '?')) {
$modname = substr($_REQUEST['next_modname'], 0, strpos($_REQUEST['next_modname'], '?'));
}
if (strpos($modname, '&')) {
$modname = substr($_REQUEST['next_modname'], 0, strpos($_REQUEST['next_modname'], '&'));
}
if ($_REQUEST['modname']) {
$_REQUEST['modname'] = $modname;
}
include 'modules/' . $modname;
}
} else {
BackPrompt('No students were found.');
}
}
示例11: DrawHeader
<?php
DrawHeader(ProgramTitle());
Widgets('activity');
Widgets('course');
Widgets('eligibility');
Search('student_id', $extra);
if ($_REQUEST['modfunc'] == 'add' && AllowEdit()) {
//modif Francois: fix bug add the same activity more than once
$activity_RET = DBGet(DBQuery("SELECT ACTIVITY_ID FROM STUDENT_ELIGIBILITY_ACTIVITIES WHERE STUDENT_ID='" . UserStudentID() . "' AND ACTIVITY_ID='" . $_REQUEST['new_activity'] . "' AND SYEAR='" . UserSyear() . "'"));
if (count($activity_RET)) {
BackPrompt(_('The activity you selected is already assigned to this student!'));
}
DBQuery("INSERT INTO STUDENT_ELIGIBILITY_ACTIVITIES (STUDENT_ID,ACTIVITY_ID,SYEAR) values('" . UserStudentID() . "','" . $_REQUEST['new_activity'] . "','" . UserSyear() . "')");
unset($_REQUEST['modfunc']);
}
if ($_REQUEST['modfunc'] == 'remove' && AllowEdit()) {
if (DeletePrompt(_('Activity'))) {
DBQuery("DELETE FROM STUDENT_ELIGIBILITY_ACTIVITIES WHERE STUDENT_ID='" . UserStudentID() . "' AND ACTIVITY_ID='" . $_REQUEST['activity_id'] . "' AND SYEAR='" . UserSyear() . "'");
unset($_REQUEST['modfunc']);
}
}
if (UserStudentID() && !$_REQUEST['modfunc']) {
$start_end_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_CONFIG WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND PROGRAM='eligibility' AND TITLE IN ('START_DAY','END_DAY')"));
if (count($start_end_RET)) {
foreach ($start_end_RET as $value) {
${$value}['TITLE'] = $value['VALUE'];
}
}
switch (date('D')) {
case 'Mon':
示例12: _
if ($exists_RET[$table][1]['COUNT'] > 0) {
//modif Francois: add <label> on checkbox
$table_list .= '<TR><TD><label><INPUT type="checkbox" value="Y" name="tables[' . $table . ']"><span style="color:grey"> ' . $name . ' (' . $exists_RET[$table][1]['COUNT'] . ')</span></label></TD></TR>';
} else {
$table_list .= '<TR><TD><label><INPUT type="checkbox" value="Y" name="tables[' . $table . ']" checked /> ' . $name . '</label></TD></TR>';
}
}
$table_list .= '</TABLE><BR />' . '* ' . _('You <i>must</i> roll users, school periods, marking periods, calendars, attendance codes, and report card codes at the same time or before rolling courses.') . '<BR /><BR />* ' . _('You <i>must</i> roll enrollment codes at the same time or before rolling students.') . '<BR /><BR />* ' . _('You <i>must</i> roll courses at the same time or before rolling report card comments.') . '<BR /><BR />' . _('Greyed items have already have data in the next school year (They might have been rolled).') . '<BR /><BR />' . _('Rolling greyed items will delete already existing data in the next school year.');
DrawHeader(ProgramTitle());
//modif Francois: school year over one/two calendar years format
if (Prompt(_('Confirm') . ' ' . _('Rollover'), sprintf(_('Are you sure you want to roll the data for %s to the next school year?'), FormatSyear(UserSyear(), Config('SCHOOL_SYEAR_OVER_2_YEARS'))), $table_list)) {
if ($_REQUEST['tables']['COURSES'] && (!$_REQUEST['tables']['STAFF'] && $exists_RET['STAFF'][1]['COUNT'] < 1 || !$_REQUEST['tables']['SCHOOL_PERIODS'] && $exists_RET['SCHOOL_PERIODS'][1]['COUNT'] < 1 || !$_REQUEST['tables']['SCHOOL_MARKING_PERIODS'] && $exists_RET['SCHOOL_MARKING_PERIODS'][1]['COUNT'] < 1 || !$_REQUEST['tables']['ATTENDANCE_CALENDARS'] && $exists_RET['ATTENDANCE_CALENDARS'][1]['COUNT'] < 1 || !$_REQUEST['tables']['REPORT_CARD_GRADES'] && $exists_RET['REPORT_CARD_GRADES'][1]['COUNT'] < 1)) {
BackPrompt(_('You <i>must</i> roll users, school periods, marking periods, calendars, and report card codes at the same time or before rolling courses.'));
}
if ($_REQUEST['tables']['REPORT_CARD_COMMENTS'] && (!$_REQUEST['tables']['COURSES'] && $exists_RET['COURSES'][1]['COUNT'] < 1)) {
BackPrompt(_('You <i>must</i> roll courses at the same time or before rolling report card comments.'));
}
if (count($_REQUEST['tables'])) {
foreach ($_REQUEST['tables'] as $table => $value) {
//if($exists_RET[$table][1]['COUNT']>0)
// DBQuery("DELETE FROM $table WHERE SYEAR='".$next_syear."'".(!$no_school_tables[$table]?" AND SCHOOL_ID='".UserSchool()."'":''));
Rollover($table);
}
}
echo '<FORM action="Modules.php?modname=' . $_REQUEST['modname'] . '" method="POST">';
// DrawHeader('<IMG SRC=assets/check.png>'._('The data have been rolled.'),'<INPUT type=submit value="'._('OK').'">');
//modif Francois: Moodle integrator
echo $moodleError;
echo '<div class="updated"><IMG SRC="assets/check.png" class="alignImg"> ' . _('The data have been rolled.'), '<INPUT type="submit" value="' . _('OK') . '" /></div>';
echo '</FORM>';
unset($_SESSION['_REQUEST_vars']['tables']);
示例13: substr
$sql = substr($sql, 0, -1) . " WHERE STUDENT_ID='" . UserStudentID() . "'";
DBQuery($sql);
}
if (count($_REQUEST['values']['STUDENT_ENROLLMENT'][UserStudentID()])) {
$sql = "UPDATE STUDENT_ENROLLMENT SET ";
foreach ($_REQUEST['values']['STUDENT_ENROLLMENT'][UserStudentID()] as $column => $value) {
$sql .= "{$column}='" . str_replace("\\'", "''", str_replace(''', "''", $value)) . "',";
}
$sql = substr($sql, 0, -1) . " WHERE STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'";
DBQuery($sql);
}
} else {
if ($_REQUEST['assign_student_id']) {
$student_id = $_REQUEST['assign_student_id'];
if (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='{$student_id}'")))) {
BackPrompt(_('That Centre ID is already taken. Please select a different one.'));
}
} else {
do {
$student_id = DBGet(DBQuery('SELECT ' . db_seq_nextval('STUDENTS_SEQ') . ' AS STUDENT_ID ' . FROM_DUAL));
$student_id = $student_id[1]['STUDENT_ID'];
} while (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='" . $student_id . "'"))));
}
$sql = "INSERT INTO STUDENTS ";
$fields = 'STUDENT_ID,';
$values = "'" . $student_id . "',";
foreach ($_REQUEST['students'] as $column => $value) {
if ($column == 'USERNAME' && $value) {
if (DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE USERNAME='" . str_replace("\\'", "''", $value) . "'"))) {
$value = '';
}
示例14: foreach
foreach ($link['FULL_NAME']['variables'] as $var => $val) {
$_REQUEST[$var] = $staff_RET['1'][$val];
}
}
if (!is_array($staff_RET[1]['STAFF_ID'])) {
$_SESSION['staff_id'] = $staff_RET[1]['STAFF_ID'];
echo '<script type="text/javascript">parent.side.location="' . $_SESSION['Side_PHP_SELF'] . '?modcat="+parent.side.document.forms[0].modcat.value;</script>';
unset($_REQUEST['search_modfunc']);
}
if ($_REQUEST['modname'] != $_REQUEST['next_modname']) {
$modname = $_REQUEST['next_modname'];
if (mb_strpos($modname, '?')) {
$modname = mb_substr($_REQUEST['next_modname'], 0, mb_strpos($_REQUEST['next_modname'], '?'));
}
if (mb_strpos($modname, '&')) {
$modname = mb_substr($_REQUEST['next_modname'], 0, mb_strpos($_REQUEST['next_modname'], '&'));
}
if ($_REQUEST['modname']) {
$_REQUEST['modname'] = $modname;
}
//modif Francois: security fix, cf http://www.securiteam.com/securitynews/6S02U1P6BI.html
if (mb_substr($modname, -4, 4) != '.php' || mb_strpos($modname, '..') !== false || !is_file('modules/' . $modname)) {
HackingLog();
} else {
include 'modules/' . $modname;
}
}
} else {
BackPrompt(_('No Users were found.'));
}
}
示例15: date
echo '</TABLE>';
echo '<TABLE width=80%>';
echo '<TR><TD width=65%><FONT size=1><BR></TD></TR>';
echo '<TR><TD><FONT size=4>' . $student['TEACHER'] . '<BR></FONT><FONT size=0>Teacher</FONT></TD>';
echo '<TD><FONT size=3>' . $mp_RET[1]['TITLE'] . '<BR></FONT><FONT size=0>Marking Period</FONT></TD></TR>';
echo '<TR><TD><FONT size=4>' . $school_info_RET[1]['PRINCIPAL'] . '<BR></FONT><FONT size=0>Principal</FONT></TD>';
echo '<TD><FONT size=3>' . date('F j, Y', strtotime($mp_RET[1]['END_DATE'])) . '<BR></FONT><FONT size=0>Date</FONT></TD></TR>';
echo '</TABLE>';
echo '</CENTER>';
echo "<div style=\"page-break-before: always;\"></div>";
echo '<!-- NEW PAGE -->';
}
PDFStop($handle);
}
} else {
BackPrompt('You must choose at least one student');
}
} elseif ($_REQUEST['modfunc'] == 'save') {
echo '<font color=red>First setup the Honor Roll(grades->Setup->Honor Roll Setup)..</font>';
}
if (!$_REQUEST['modfunc']) {
if ($_REQUEST['search_modfunc'] == 'list') {
$sem = GetParentMP('SEM', UserMP());
$fy = GetParentMP('FY', $sem);
$pros = GetChildrenMP('PRO', UserMP());
if ($fy) {
$gradedmp = DBGet(DBQuery('SELECT count(*) as GRADES from student_report_card_grades where marking_period_id=' . $fy . ''));
}
if (!$gradedmp[1]['GRADES'] && $sem) {
$gradedmp = DBGet(DBQuery('SELECT count(*) as GRADES from student_report_card_grades where marking_period_id=' . $sem . ''));
$mp = $sem;