本文整理汇总了PHP中PrepareDateSchedule函数的典型用法代码示例。如果您正苦于以下问题:PHP PrepareDateSchedule函数的具体用法?PHP PrepareDateSchedule怎么用?PHP PrepareDateSchedule使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PrepareDateSchedule函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PreparePHP_SELF
echo "<FORM name=scheaddr id=scheaddr action=" . PreparePHP_SELF() . " method=POST>";
DrawBC("Scheduling > " . ProgramTitle());
if ($_REQUEST['day_start'] && $_REQUEST['month_start'] && $_REQUEST['year_start']) {
$_REQUEST['placed_From'] = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['year_start'];
$start_date = date('Y-m-d', strtotime($_REQUEST['placed_From']));
} else {
$start_date = date("Y-m") . '-01';
}
if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
$_REQUEST['placed_End'] = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'];
$end_date = date('Y-m-d', strtotime($_REQUEST['placed_End']));
} else {
$end_date = date("Y-m-d");
}
if ($_REQUEST['flag'] != 'list') {
DrawHeaderHome(PrepareDateSchedule($start_date, '_start') . '<div style="padding:0px 6px; float:left;">-</div>' . PrepareDateSchedule($end_date, '_end'), '<INPUT type=submit class=btn_medium value=Go >');
}
echo '</FORM>';
if ($_REQUEST['modfunc'] == 'save') {
$a = count($_REQUEST['st_arr']);
if ($a == 0) {
echo "Sorry! No Students were selected";
} else {
if (count($_REQUEST['st_arr'])) {
$st_list = '\'' . implode('\',\'', $_REQUEST['st_arr']) . '\'';
$extra['WHERE'] = ' se.ID IN (' . $st_list . ')';
}
$start_date = $_REQUEST['sday'];
$end_date = $_REQUEST['eday'];
//$enrollment_RET = DBGet(DBQuery( "SELECT c.TITLE AS COURSE_TITLE,cp.TITLE,se.START_DATE AS START_DATE,NULL AS END_DATE,se.START_DATE AS DATE,se.STUDENT_ID,CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME FROM schedule se,students s,courses c,course_periods cp WHERE c.COURSE_ID=se.COURSE_ID AND cp.COURSE_PERIOD_ID=se.COURSE_PERIOD_ID AND cp.COURSE_ID=c.COURSE_ID AND s.STUDENT_ID=se.STUDENT_ID AND se.SCHOOL_ID='".UserSchool()."' AND se.START_DATE BETWEEN '$start_date' AND '$end_date' AND $extra[WHERE]
// UNION SELECT c.TITLE AS COURSE_TITLE,cp.TITLE,NULL AS START_DATE,se.END_DATE AS END_DATE,se.END_DATE AS DATE,se.STUDENT_ID,CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME FROM schedule se,students s,courses c,course_periods cp WHERE c.COURSE_ID=se.COURSE_ID AND cp.COURSE_PERIOD_ID=se.COURSE_PERIOD_ID AND cp.COURSE_ID=c.COURSE_ID AND s.STUDENT_ID=se.STUDENT_ID AND se.SCHOOL_ID='".UserSchool()."' AND se.END_DATE BETWEEN '$start_date' AND '$end_date' AND $extra[WHERE]
示例2: date
$_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';
break;
case 'Thu':
$day = 'H';
break;
default:
$day = substr($day, 0, 1);
break;
}
$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', GetCurrentMP('QTR', $date)) . ")\n\t\t\tAND cp.SYEAR='" . UserSyear() . "' AND cp.SCHOOL_ID='" . UserSchool() . "' AND s.PROFILE='teacher'\n\t\t\tAND cp.DOES_ATTENDANCE='Y' AND instr(cp.DAYS,'{$day}')>0" . ($_REQUEST['period'] ? " AND cp.PERIOD_ID='{$_REQUEST['period']}'" : '') . "\n\t\t\tAND NOT EXISTS (SELECT '' FROM ATTENDANCE_COMPLETED ac WHERE ac.STAFF_ID=cp.TEACHER_ID AND ac.SCHOOL_DATE='" . date('Y-m-d', strtotime($date)) . "' AND ac.PERIOD_ID=sp.PERIOD_ID)\n\t\t";
$RET = DBGet(DBQuery($sql), array(), array('STAFF_ID', 'PERIOD_ID'));
示例3: CreateSelect
$mp = CreateSelect($mp_RET, 'marking_period_id', 'Modules.php?modname=' . $_REQUEST['modname'] . '&view_mode=' . $_REQUEST['view_mode'] . '&marking_period_id=', $_REQUEST['marking_period_id']);
$view_mode = create_view_mode('Modules.php?modname=' . $_REQUEST['modname'] . '&marking_period_id=' . $_REQUEST['marking_period_id'] . '&view_mode=');
###################################################################3
$mp_id1 = $_REQUEST['marking_period_id'];
switch ($_REQUEST['view_mode']) {
case 'day_view':
if ((User('PROFILE_ID') == 3 || User('PROFILE_ID') == 4) && $date == '') {
$date = date('Y-m-d');
}
$mp_sql = 'SELECT MARKING_PERIOD_ID,START_DATE,END_DATE FROM marking_periods WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND \'' . date('Y-m-d', strtotime($date)) . '\' BETWEEN START_DATE AND END_DATE';
$mp_data = DBGet(DBQuery($mp_sql));
if (count($mp_data) == 0) {
$mp_sql = 'SELECT MARKING_PERIOD_ID,START_DATE,END_DATE FROM marking_periods WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\'';
$mp_data = DBGet(DBQuery($mp_sql));
}
DrawHeaderHome('<table width="100%" cellpadding="2" cellspacing="2"><tr><td align="left" width="175" valign="top"><table><tr><td>' . PrepareDateSchedule($date, '_date', false, array('submit' => true)) . '</td><td><INPUT type=submit class=btn_medium value=Go></td></tr></table></td><td align="left">Marking Period : ' . $mp . '</td><td align="right">Calendar View: ' . $view_mode) . '</td></tr></table>';
$full_day = date('l', strtotime($date));
$day = get_db_day($full_day);
$fy_id = DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM school_years WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
$fy_id = $fy_id[1]['MARKING_PERIOD_ID'];
for ($i = 1; $i <= count($mp_data); $i++) {
$mp_ids_arr[] = $mp_data[$i]['MARKING_PERIOD_ID'];
}
$sql = 'SELECT
s.COURSE_ID,
s.COURSE_PERIOD_ID,
s.MARKING_PERIOD_ID,
s.START_DATE,
s.END_DATE,
UNIX_TIMESTAMP(s.START_DATE) AS START_EPOCH,
UNIX_TIMESTAMP(s.END_DATE) AS END_EPOCH,
示例4: date
$_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'];
$date = $_REQUEST['year_date'] . '-' . $_REQUEST['month_date'] . '-' . $_REQUEST['day_date'];
}
DrawBC("Attendance > " . ProgramTitle());
$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 cp,course_period_var cpv WHERE cp.SYEAR=sp.SYEAR AND cpv.PERIOD_ID=sp.PERIOD_ID AND cpv.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=" . strip_tags(trim($_REQUEST[modname])) . " method=POST>";
DrawHeaderHome('<table><tr><td>' . PrepareDateSchedule($date, 'date', false, array('submit' => true)) . '</td><td> - </td><td>' . $period_select . '</td><td> : <INPUT type=submit class=btn_medium value=Go></td></tr></table>');
echo '</FORM>';
$day = date('D', strtotime($date));
switch ($day) {
case 'Sun':
$day = 'U';
break;
case 'Thu':
$day = 'H';
break;
default:
$day = substr($day, 0, 1);
break;
}
$p = optional_param('period', '', PARAM_SPCL);
$current_mp = GetCurrentMP('QTR', $date);
示例5: DBQuery
DBQuery("CALL SEAT_FILL()");
unset($_SESSION['_REQUEST_vars']['schedule']);
unset($_REQUEST['schedule']);
}
if (UserStudentID() && $_REQUEST['modfunc'] != 'choose_course' && $_REQUEST['modfunc'] != 'more_info') {
echo "<FORM name=modify id=modify action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&modfunc=modify METHOD=POST>";
$tmp_REQUEST = $_REQUEST;
unset($tmp_REQUEST['include_inactive']);
##################################################################
$years_RET = DBGet(DBQuery('SELECT MARKING_PERIOD_ID,TITLE,NULL AS SEMESTER_ID FROM school_years WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . "'"));
$semesters_RET = DBGet(DBQuery('SELECT MARKING_PERIOD_ID,TITLE,NULL AS SEMESTER_ID FROM school_semesters WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY SORT_ORDER'));
$uarters_RET = DBGet(DBQuery('SELECT MARKING_PERIOD_ID,TITLE,SEMESTER_ID FROM school_quarters WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY SORT_ORDER'));
$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 = CreateSelect($mp_RET, 'marking_period_id', 'Modules.php?modname=' . $_REQUEST['modname'] . '&marking_period_id=', $_REQUEST['marking_period_id']);
###################################################################3
DrawHeaderHome(PrepareDateSchedule($date, '_date', false, array('submit' => true)) . ' <INPUT type=checkbox name=include_inactive value=Y' . ($_REQUEST['include_inactive'] == 'Y' ? " CHECKED onclick='document.location.href=\"" . PreparePHP_SELF($tmp_REQUEST) . "&include_inactive=\";'" : " onclick='document.location.href=\"" . PreparePHP_SELF($tmp_REQUEST) . "&include_inactive=Y\";'") . '>Include Inactive Courses : Marking Period : ' . $mp . ' ', SubmitButton('Save', '', 'class=btn_medium onclick=\'formload_ajax("modify");\''));
$fy_id = DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM school_years WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
$fy_id = $fy_id[1]['MARKING_PERIOD_ID'];
$sql = 'SELECT
s.COURSE_ID as ACTION,
s.COURSE_ID,s.COURSE_PERIOD_ID,s.ID AS SCHEDULE_ID,
s.MARKING_PERIOD_ID,s.START_DATE,s.END_DATE,s.MODIFIED_DATE,s.MODIFIED_BY,
UNIX_TIMESTAMP(s.START_DATE) AS START_EPOCH,UNIX_TIMESTAMP(s.END_DATE) AS END_EPOCH,sp.PERIOD_ID,
cpv.PERIOD_ID,cp.MARKING_PERIOD_ID as COURSE_MARKING_PERIOD_ID,cp.MP,sp.SORT_ORDER,
c.TITLE,cp.COURSE_PERIOD_ID AS PERIOD_PULLDOWN,
s.STUDENT_ID,r.TITLE AS ROOM,(SELECT GROUP_CONCAT(cpv.DAYS) FROM course_period_var cpv WHERE cpv.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID) as DAYS,SCHEDULER_LOCK,CONCAT(st.LAST_NAME, \'' . ' ' . '\' ,st.FIRST_NAME) AS MODIFIED_NAME
FROM courses c,course_periods cp,course_period_var cpv,school_periods sp,rooms r,schedule s
LEFT JOIN staff st ON s.MODIFIED_BY = st.STAFF_ID
WHERE
s.COURSE_ID = c.COURSE_ID AND s.COURSE_ID = cp.COURSE_ID
AND s.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID
示例6: PreparePHP_SELF
# 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';
echo "<FORM name=add id=add action=" . PreparePHP_SELF() . " method=POST>";
DrawBC("Students > " . ProgramTitle());
if ($_REQUEST['day_start'] && $_REQUEST['month_start'] && $_REQUEST['year_start']) {
while (!VerifyDate($start_date = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['year_start'])) {
$_REQUEST['day_start']--;
}
} else {
$start_date = '01-' . strtoupper(date('M-y'));
}
if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
while (!VerifyDate($end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'])) {
$_REQUEST['day_end']--;
}
} else {
$end_date = DBDate();
}
DrawHeaderHome(PrepareDateSchedule($start_date, '_start') . ' - ' . PrepareDateSchedule($end_date, '_end'), '<INPUT type=submit class=btn_medium value=Go >');
echo '</FORM>';
$enrollment_RET = DBGet(DBQuery("SELECT se.START_DATE AS START_DATE,NULL AS END_DATE,se.START_DATE AS DATE,se.SCHOOL_ID,se.STUDENT_ID,CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME FROM STUDENT_ENROLLMENT se,STUDENTS s WHERE s.STUDENT_ID=se.STUDENT_ID AND se.START_DATE BETWEEN '{$start_date}' AND '{$end_date}' \r\n\t\t\t\t\t\t\t\tUNION SELECT NULL AS START_DATE,se.END_DATE AS END_DATE,se.END_DATE AS DATE,se.SCHOOL_ID,se.STUDENT_ID,CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME FROM STUDENT_ENROLLMENT se,STUDENTS s WHERE s.STUDENT_ID=se.STUDENT_ID AND se.END_DATE BETWEEN '{$start_date}' AND '{$end_date}'\r\n\t\t\t\t\t\t\t\tORDER BY DATE DESC"), array('START_DATE' => 'ProperDate', 'END_DATE' => 'ProperDate', 'SCHOOL_ID' => 'GetSchool'));
$columns = array('FULL_NAME' => 'Student', 'STUDENT_ID' => 'Student ID', 'SCHOOL_ID' => 'School', 'START_DATE' => 'Enrolled', 'END_DATE' => 'Dropped');
ListOutput($enrollment_RET, $columns, 'Enrollment Record', 'Enrollment Records');
示例7: PreparePHP_SELF
# 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';
echo "<FORM name=add id=add action=" . PreparePHP_SELF() . " method=POST>";
DrawBC("" . _('Students') . " > " . ProgramTitle());
if ($_REQUEST['day_start'] && $_REQUEST['month_start'] && $_REQUEST['year_start']) {
while (!VerifyDate($start_date = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['year_start'])) {
$_REQUEST['day_start']--;
}
} else {
$start_date = '01-' . strtoupper(date('M-y'));
}
if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
while (!VerifyDate($end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'])) {
$_REQUEST['day_end']--;
}
} else {
$end_date = DBDate();
}
DrawHeaderHome('<table><tr><td>' . PrepareDateSchedule($start_date, '_start') . '</td><td> - </td><td>' . PrepareDateSchedule($end_date, '_end'), '</td><td><INPUT type=submit class=btn_medium value=' . _('Go') . '></td></tr></table>');
echo '</FORM>';
$enrollment_RET = DBGet(DBQuery('SELECT IF(se.START_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\',se.START_DATE,NULL) AS START_DATE,IF(se.END_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\',se.END_DATE,NULL) AS END_DATE,se.START_DATE AS DATE,se.SCHOOL_ID,se.STUDENT_ID,CONCAT(s.LAST_NAME,\', \',s.FIRST_NAME) AS FULL_NAME,(SELECT TITLE FROM student_enrollment_codes seci WHERE se.enrollment_code=seci.id AND se.START_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\') AS ENROLLMENT_CODE,(SELECT TITLE FROM student_enrollment_codes seci WHERE se.drop_code=seci.id AND se.END_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\') AS DROP_CODE FROM student_enrollment se, students s WHERE s.STUDENT_ID=se.STUDENT_ID AND (se.START_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\' OR se.END_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\')
ORDER BY DATE DESC'), array('START_DATE' => 'ProperDate', 'END_DATE' => 'ProperDate', 'SCHOOL_ID' => 'GetSchool'));
$columns = array('FULL_NAME' => '' . _('Student') . '', 'STUDENT_ID' => '' . _('Student ID') . '', 'SCHOOL_ID' => '' . _('School') . '', 'START_DATE' => '' . _('Enrolled') . '', 'ENROLLMENT_CODE' => '' . _('Enrollment Code') . '', 'END_DATE' => '' . _('Dropped') . '', 'DROP_CODE' => '' . _('Drop Code') . '');
ListOutput($enrollment_RET, $columns, '' . _('Enrollment Record') . '', '' . _('Enrollment Records') . '');
示例8: while
}
if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
while (!VerifyDate($end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'])) {
$_REQUEST['day_end']--;
}
} else {
$max_date = DBGet(DBQuery("SELECT max(SCHOOL_DATE) AS MAX_DATE FROM ATTENDANCE_CALENDAR WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
if ($max_date[1]['MAX_DATE']) {
$end_date = $max_date[1]['MAX_DATE'];
} else {
$end_date = strtoupper(date('Y-m-d'));
}
}
DrawBC("School Setup >> " . ProgramTitle());
echo '<FORM action=Modules.php?modname=' . $_REQUEST['modname'] . '&modfunc=' . $_REQUEST['modfunc'] . '&month=' . $_REQUEST['month'] . '&year=' . $_REQUEST['year'] . ' METHOD=POST>';
DrawHeaderHome(PrepareDateSchedule($start_date, '_start') . ' - ' . PrepareDateSchedule($end_date, '_end') . ' <A HREF=Modules.php?modname=' . $_REQUEST['modname'] . '&month=' . $_REQUEST['month'] . '&year=' . $_REQUEST['year'] . '>Back to Calendar</A>', '<INPUT type=submit class=btn_medium value=Go>');
$functions = array('SCHOOL_DATE' => 'ProperDate');
// <A HREF=Modules.php?modname='.$_REQUEST["modname"].'&month='.$_REQUEST["month"].'&year='.$_REQUEST["year"].'>
$events_RET = DBGet(DBQuery("SELECT ID,SCHOOL_DATE,TITLE,DESCRIPTION FROM CALENDAR_EVENTS WHERE SCHOOL_DATE BETWEEN '" . $start_date . "' AND '" . $end_date . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"), $functions);
ListOutput($events_RET, array('SCHOOL_DATE' => 'Date', 'TITLE' => 'Event', 'DESCRIPTION' => 'Description'), 'Event', 'Events');
echo '</FORM>';
}
if (!$_REQUEST['modfunc']) {
DrawBC("School Setup >> " . ProgramTitle());
$last = 31;
while (!checkdate($_REQUEST['month'], $last, $_REQUEST['year'])) {
$last--;
}
$calendar_RET = DBGet(DBQuery("SELECT DATE_FORMAT(SCHOOL_DATE,'%d-%b-%y') as SCHOOL_DATE,MINUTES,BLOCK FROM ATTENDANCE_CALENDAR WHERE SCHOOL_DATE BETWEEN '" . date('Y-m-d', $time) . "' AND '" . date('Y-m-d', mktime(0, 0, 0, $_REQUEST['month'], $last, $_REQUEST['year'])) . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND CALENDAR_ID='" . $_REQUEST['calendar_id'] . "'"), array(), array('SCHOOL_DATE'));
if ($_REQUEST['minutes']) {
foreach ($_REQUEST['minutes'] as $date => $minutes) {
示例9: DBDate
} else {
$date = DBDate('mysql');
$_REQUEST['day_date'] = date('d');
$_REQUEST['month_date'] = strtoupper(date('M'));
$_REQUEST['year_date'] = date('y');
}
if ($_REQUEST['modname'] == 'scheduling/Scheduler.php' && !$_REQUEST['run']) {
$function = 'Prompt_Home_Schedule';
DrawBC("Scheduling > " . ProgramTitle());
} else {
$function = '_returnTrue';
}
if ($function('Confirm Scheduler Run', 'Are you sure you want to run the scheduler?', '<TABLE>
<TR><TD><INPUT type=checkbox name=test_mode value=Y onclick=showhidediv("div1",this);></TD><TD>Schedule Unscheduled Requests</TD></TR>
<TR><TD></TD><TD><div id=div1 style=display:none>' . PrepareDateSchedule($date, '_date', false, '') . '</div></TD></TR>
<TR><TD><INPUT type=checkbox name=delete_mode value=Y></TD><TD>Delete Current Schedules</TD></TR>
</TABLE>')) {
PopTable('header', 'Scheduler Progress');
echo '<CENTER><TABLE cellpadding=0 cellspacing=0><TR><TD><TABLE cellspacing=0 border=0><TR>';
for ($i = 1; $i <= 100; $i++) {
echo '<TD id=cell' . $i . ' width=3 ></TD>';
}
echo '</TR></TABLE></TD></TR></TABLE><BR><DIV id=percentDIV><IMG SRC=assets/spinning.gif> Processing Requests ... </DIV></CENTER>';
PopTable('footer');
ob_flush();
flush();
ini_set('MAX_EXECUTION_TIME', 0);
// get the fy marking period id, there should be exactly one fy marking period
$fy_id = DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM school_years WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
示例10: foreach
foreach ($periods_RET as $period) {
$period_select .= "<OPTION value={$period['PERIOD_ID']}" . ($_REQUEST['period_id'] == $period['PERIOD_ID'] ? ' SELECTED' : '') . ">{$period['TITLE']}</OPTION>";
}
}
$period_select .= '</SELECT>';
}
if (User('PROFILE') == 'teacher') {
$myclasses = '<SELECT name="myclasses" onchange="this.form.submit();">';
$myclasses .= '<OPTION value=""' . ($_REQUEST['myclasses'] == '' ? ' SELECTED' : '') . '>All course periods</OPTION>';
$myclasses .= '<OPTION value="my_classes"' . ($_REQUEST['myclasses'] == 'my_classes' ? ' SELECTED' : '') . '>All my course periods</OPTION>';
$myclasses .= '<OPTION value="selected_class"' . ($_REQUEST['myclasses'] == 'selected_class' ? ' SELECTED' : '') . '>Selected course period</OPTION>';
$myclasses .= '</SELECT>';
}
$PHP_tmp_SELF = PreparePHP_SELF();
echo "<FORM action={$PHP_tmp_SELF} method=POST>";
DrawHeaderHome('<table><tr><td>' . PrepareDateSchedule($start_date, 'start') . '</td><td> - </td><td>' . PrepareDateSchedule($end_date, 'end') . '</td><td> : <INPUT type=submit name=absence_go class=btn_medium value=Go></td><td>', $period_select . '</td><td>' . $myclasses . '</td></tr></table>');
echo '</FORM>';
}
if ($_REQUEST['period_id']) {
$extra['SELECT'] .= ',(SELECT count(*) FROM attendance_period ap,attendance_codes ac
WHERE ac.ID=ap.ATTENDANCE_CODE AND (ac.STATE_CODE=\'A\' OR ac.STATE_CODE=\'H\') AND ap.STUDENT_ID=ssm.STUDENT_ID
AND ap.PERIOD_ID=\'' . $_REQUEST[period_id] . '\'
AND ap.SCHOOL_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\') AS STATE_ABS';
$codes_RET = DBGet(DBQuery('SELECT ID,TITLE FROM attendance_codes WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND TABLE_NAME=\'0\' AND (DEFAULT_CODE!=\'Y\' OR DEFAULT_CODE IS NULL)'));
if (count($codes_RET) > 1) {
foreach ($codes_RET as $code) {
if ($_REQUEST['myclasses'] != '') {
$extra['SELECT'] .= ',(SELECT count(*) FROM attendance_period ap,attendance_codes ac,course_periods cp
WHERE ac.ID=ap.ATTENDANCE_CODE AND ac.ID=\'' . $code[ID] . '\' AND ap.PERIOD_ID=\'' . $_REQUEST[period_id] . '\' AND ap.STUDENT_ID=ssm.STUDENT_ID
AND ap.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND ' . ($_REQUEST['myclasses'] == 'my_classes' ? '(cp.TEACHER_ID=\'' . User('STAFF_ID') . '\' OR cp.SECONDARY_TEACHER_ID=\'' . User('STAFF_ID') . '\')' : 'cp.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\'') . '
AND ap.SCHOOL_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\') AS ABS_' . $code[ID];
示例11: while
if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
while (!VerifyDate($end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'])) {
$_REQUEST['day_end']--;
}
} else {
$max_date = DBGet(DBQuery('SELECT max(SCHOOL_DATE) AS MAX_DATE FROM attendance_calendar WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
if ($max_date[1]['MAX_DATE']) {
$end_date = $max_date[1]['MAX_DATE'];
} else {
$end_date = strtoupper(date('Y-m-d'));
}
}
DrawBC("School Setup >> " . ProgramTitle());
echo '<FORM action=Modules.php?modname=' . $_REQUEST['modname'] . '&modfunc=' . $_REQUEST['modfunc'] . '&month=' . $_REQUEST['month'] . '&year=' . $_REQUEST['year'] . ' METHOD=POST>';
#DrawHeaderHome(PrepareDateSchedule($start_date,'_start').' - '.PrepareDateSchedule($end_date,'_end').' <A HREF=Modules.php?modname='.$_REQUEST['modname'].'&month='.$_REQUEST['month'].'&year='.$_REQUEST['year'].'>Back to Calendar</A>','<INPUT type=submit class=btn_medium value=Go>');
DrawHeaderHome(PrepareDateSchedule($start_date, '_start') . ' <div style="float:left;"> - </div> ' . PrepareDateSchedule($end_date, '_end') . ' <div style="float:left; padding-left:5px; padding-top:2px;"><A HREF=Modules.php?modname=' . $_REQUEST['modname'] . '&calendar_id=' . $_REQUEST['calendar_id'] . '&month=' . $_REQUEST['month'] . '&year=' . $_REQUEST['year'] . '>Back to Calendar</A></div>', '<div style="float:left;"><INPUT type=submit class=btn_medium value=Go></div> <a href="for_export.php?modname=School_Setup/Calendar.php&modfunc=print&_openSIS_PDF=true" target=_blank ><img src="assets/print.png" alt="Print" title="Print" /> Print</a>');
$functions = array('SCHOOL_DATE' => 'ProperDate');
// <A HREF=Modules.php?modname='.$_REQUEST["modname"].'&month='.$_REQUEST["month"].'&year='.$_REQUEST["year"].'>
$events_RET = DBGet(DBQuery('SELECT ID,SCHOOL_DATE,TITLE,DESCRIPTION FROM calendar_events WHERE SCHOOL_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\' AND SYEAR=\'' . UserSyear() . '\' AND (calendar_id=\'' . $_REQUEST['calendar_id'] . '\' OR calendar_id=\'0\') ORDER BY SCHOOL_DATE DESC'), $functions);
$_SESSION['events_RET'] = $events_RET;
#echo "<a href=\"for_export.php?modname=$_REQUEST[modname]&modfunc=print&_openSIS_PDF=true\" target=_blank ><img src=\"assets/print_new.png\" alt=\"Print\" title=\"Print\" /></a>";
ListOutput($events_RET, array('SCHOOL_DATE' => 'Date', 'TITLE' => 'Event', 'DESCRIPTION' => 'Description'), 'Event', 'Events');
echo '</FORM>';
}
if (!$_REQUEST['modfunc']) {
DrawBC("School Setup >> " . ProgramTitle());
$last = 31;
while (!checkdate($_REQUEST['month'], $last, $_REQUEST['year'])) {
$last--;
}
$calendar_RET = DBGet(DBQuery('SELECT DATE_FORMAT(SCHOOL_DATE,\'%d-%b-%y\') as SCHOOL_DATE,MINUTES,BLOCK FROM attendance_calendar WHERE SCHOOL_DATE BETWEEN \'' . date('Y-m-d', $time) . '\' AND \'' . date('Y-m-d', mktime(0, 0, 0, $_REQUEST['month'], $last, $_REQUEST['year'])) . '\' AND SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND CALENDAR_ID=\'' . $_REQUEST['calendar_id'] . '\''), array(), array('SCHOOL_DATE'));
示例12: DrawBC
}
if ($month == 'NOV') {
$month = '11';
}
if ($month == 'DEC') {
$month = '12';
}
$end_date = $edateArr[2] . '-' . $month . '-' . $edateArr[0];
}
if (User('PROFILE') != 'student') {
DrawBC("School Setup >> " . ProgramTitle());
} else {
DrawBC("School Info >> " . ProgramTitle());
}
echo '<FORM action=Modules.php?modname=' . $_REQUEST['modname'] . '&modfunc=' . $_REQUEST['modfunc'] . '&month=' . $_REQUEST['month'] . '&year=' . $_REQUEST['year'] . ' METHOD=POST>';
DrawHeaderHome(PrepareDateSchedule($start_date, 'start') . ' <div style="float:left;"> -  </div> ' . PrepareDateSchedule($end_date, 'end') . ' <A HREF=Modules.php?modname=' . $_REQUEST['modname'] . '&month=' . $_REQUEST['month'] . '&year=' . $_REQUEST['year'] . '> -Back to Calendar</A>', '<INPUT type=submit class=btn_medium value=Go>');
$functions = array('SCHOOL_DATE' => 'ProperDate');
// <A HREF=Modules.php?modname='.$_REQUEST["modname"].'&month='.$_REQUEST["month"].'&year='.$_REQUEST["year"].'>
$events_RET = DBGet(DBQuery('SELECT ID,SCHOOL_DATE,TITLE,DESCRIPTION FROM calendar_events WHERE SCHOOL_DATE BETWEEN \'' . $start_date . '\' AND \'' . $end_date . '\' AND SYEAR=\'' . UserSyear() . '\' AND (calendar_id=\'' . $_REQUEST['calendar_id'] . '\' OR calendar_id=\'0\') ORDER BY SCHOOL_DATE'), $functions);
$_SESSION['events_RET'] = $events_RET;
echo '<div style="overflow:auto; width:820px;">';
echo '<div id="students" >';
ListOutput($events_RET, array('SCHOOL_DATE' => 'Date', 'TITLE' => 'Event', 'DESCRIPTION' => 'Description'), 'Event', 'Events');
echo '</div></div></FORM>';
}
if (!$_REQUEST['modfunc']) {
if (User('PROFILE') != 'student') {
DrawBC("School Setup >> " . ProgramTitle());
} else {
DrawBC("School Info >> " . ProgramTitle());
}
示例13: PreparePHP_SELF
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#**************************************************************************
echo "<FORM name=scheaddr id=scheaddr action=" . PreparePHP_SELF() . " method=POST>";
DrawBC("Scheduling > " . ProgramTitle());
if ($_REQUEST['day_start'] && $_REQUEST['month_start'] && $_REQUEST['year_start']) {
while (!VerifyDate($start_date = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['year_start'])) {
$_REQUEST['day_start']--;
}
} else {
$start_date = '01-' . strtoupper(date('M-y'));
}
if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
while (!VerifyDate($end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'])) {
$_REQUEST['day_end']--;
}
} else {
$end_date = DBDate();
}
if ($_REQUEST['flag'] != 'list') {
DrawHeaderHome(PrepareDateSchedule($start_date, '_start') . ' - ' . PrepareDateSchedule($end_date, '_end'), '<INPUT type=submit class=btn_medium value=Go onclick=\'formload_ajax("scheaddr");\'>');
}
echo '</FORM>';
echo "<FORM name=addr id=addr action='for_export.php?modname={$_REQUEST['modname']}&modfunc=save&include_inactive={$_REQUEST['include_inactive']}&_CENTRE_PDF=true&flag=list' method=POST target=_blank>";
$enrollment_RET = DBGet(DBQuery("SELECT c.TITLE AS COURSE_TITLE,cp.TITLE,se.START_DATE AS START_DATE,NULL AS END_DATE,se.START_DATE AS DATE,se.STUDENT_ID,s.CONCAT(LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME FROM SCHEDULE se,STUDENTS s,COURSES c,COURSE_PERIODS cp WHERE c.COURSE_ID=se.COURSE_ID AND cp.COURSE_PERIOD_ID=se.COURSE_PERIOD_ID AND cp.COURSE_ID=c.COURSE_ID AND s.STUDENT_ID=se.STUDENT_ID AND se.SCHOOL_ID='" . UserSchool() . "' AND se.START_DATE BETWEEN '{$start_date}' AND '{$end_date}' \n\t\t\t\t\t\t\tUNION SELECT c.TITLE AS COURSE_TITLE,cp.TITLE,NULL AS START_DATE,se.END_DATE AS END_DATE,se.END_DATE AS DATE,se.STUDENT_ID,s.LAST_NAME||', '||s.FIRST_NAME AS FULL_NAME FROM SCHEDULE se,STUDENTS s,COURSES c,COURSE_PERIODS cp WHERE c.COURSE_ID=se.COURSE_ID AND cp.COURSE_PERIOD_ID=se.COURSE_PERIOD_ID AND cp.COURSE_ID=c.COURSE_ID AND s.STUDENT_ID=se.STUDENT_ID AND se.SCHOOL_ID='" . UserSchool() . "' AND se.END_DATE BETWEEN '{$start_date}' AND '{$end_date}'\n\t\t\t\t\t\t\t\tORDER BY DATE DESC"), array('START_DATE' => 'ProperDate', 'END_DATE' => 'ProperDate'));
$columns = array('FULL_NAME' => 'Student', 'STUDENT_ID' => 'Student ID', 'COURSE_TITLE' => 'Course', 'TITLE' => 'Course Period', 'START_DATE' => 'Enrolled', 'END_DATE' => 'Dropped');
ListOutput($enrollment_RET, $columns, 'Schedule Record', 'Schedule Records');
if ($_REQUEST['flag'] != 'list') {
echo '<BR><CENTER><INPUT type=submit class=btn_xxlarge value=\'Create Add/Drop Report for Selected Students\'></CENTER>';
}
echo '</FORM>';