本文整理汇总了PHP中PrepareDate函数的典型用法代码示例。如果您正苦于以下问题:PHP PrepareDate函数的具体用法?PHP PrepareDate怎么用?PHP PrepareDate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PrepareDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DateInput
function DateInput($value, $name, $title = '', $div = true, $allow_na = true)
{
if (Preferences('HIDDEN') != 'Y') {
$div = false;
}
if (AllowEdit() && !$_REQUEST['_openSIS_PDF']) {
if ($value == '' || $div == false) {
return PrepareDate($value, "_{$name}", $allow_na) . ($title != '' ? '<BR><small>' . (strpos(strtolower($title), '<font ') === false ? '<FONT color=' . Preferences('TITLES') . '>' : '') . $title . (strpos(strtolower($title), '<font ') === false ? '</FONT>' : '') . '</small>' : '');
} else {
return "<DIV id='div{$name}'><div onclick='javascript:addHTML(\"" . str_replace('"', '\\"', PrepareDate($value, "_{$name}", true, array('Y' => 1, 'M' => 1, 'D' => 1))) . ($title != '' ? '<BR><small>' . (strpos(strtolower($title), '<font ') === false ? '<FONT color=' . Preferences('TITLES') . '>' : '') . $title . (strpos(strtolower($title), '<font ') === false ? '</FONT>' : '') . '</small>' : '') . "\",\"div{$name}\",true)'>" . ($value != '' ? ProperDate($value) : '-') . ($title != '' ? '<BR><small>' . (strpos(strtolower($title), '<font ') === false ? '<FONT color=' . Preferences('TITLES') . '>' : '') . $title . (strpos(strtolower($title), '<font ') === false ? '</FONT>' : '') . '</small>' : '') . '</div></DIV>';
}
} else {
return ($value != '' ? ProperDate($value) : '-') . ($title != '' ? '<BR><small>' . (strpos(strtolower($title), '<font ') === false ? '<FONT color=' . Preferences('TITLES') . '>' : '') . $title . (strpos(strtolower($title), '<font ') === false ? '</FONT>' : '') . '</small>' : '');
}
}
示例2: DateInput
function DateInput($value, $name, $title = '', $div = true, $allow_na = true)
{
if (Preferences('HIDDEN') != 'Y') {
$div = false;
}
if (AllowEdit() && !isset($_REQUEST['_ROSARIO_PDF'])) {
if ($value == '' || $div == false) {
return PrepareDate($value, '_' . $name, $allow_na) . ($title != '' ? '<BR />' . (mb_strpos(mb_strtolower($title), '<span ') === false ? '<span class="legend-gray">' : '') . $title . (mb_strpos(mb_strtolower($title), '<span ') === false ? '</span>' : '') . '' : '');
} else {
$return = '<DIV id="div' . $name . '"><div class="onclick" onclick=\'javascript:addHTML("';
$toEscape = PrepareDate($value, '_' . $name, $allow_na, array('Y' => 1, 'M' => 1, 'D' => 1)) . ($title != '' ? '<BR />' . (mb_strpos(mb_strtolower($title), '<span ') === false ? '<span class="legend-gray">' : '') . str_replace("'", ''', $title) . (mb_strpos(mb_strtolower($title), '<span ') === false ? '</span>' : '') : '');
$return .= str_replace('"', '\\"', $toEscape);
$return .= '","div' . $name . '",true)\'><span class="underline-dots">' . ($value != '' ? ProperDate($value) : '-') . '</span>' . ($title != '' ? '<BR />' . (mb_strpos(mb_strtolower($title), '<span ') === false ? '<span class="legend-gray">' : '') . $title . (mb_strpos(mb_strtolower($title), '<span ') === false ? '</span>' : '') . '' : '') . '</div></DIV>';
return $return;
}
} else {
return ($value != '' ? ProperDate($value) : '-') . ($title != '' ? '<BR />' . (mb_strpos(mb_strtolower($title), '<span ') === false ? '<span class="legend-gray">' : '') . $title . (mb_strpos(mb_strtolower($title), '<span ') === false ? '</span>' : '') . '' : '');
}
}
示例3: _makeSearchInput
/**
* Make Search Input
*
* @param string $field text|numeric|select|date|radio|grade|school|timespan|test_no|other.
*
* @return string Search Input HTML
*/
function _makeSearchInput($field)
{
$div = false;
$value = $_REQUEST['bottom_back'] == 'true' && isset($_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']]) ? $_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']] : '';
switch ($field['TYPE']) {
case 'text':
/*return "<INPUT type=text name=cust[{$field[COLUMN_NAME]}] size=30".(($_REQUEST['bottom_back']=='true' && $_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']])?' value="'.$_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']].'"':'').">";*/
return TextInput($value, 'cust[' . $field['COLUMN_NAME'] . ']', 'size="20"', $div);
break;
case 'numeric':
/*return "<small>Between</small> <INPUT type=text name=cust_begin[{$field[COLUMN_NAME]}] size=3 maxlength=11".(($_REQUEST['bottom_back']=='true' && $_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']])?' value="'.$_SESSION['_REQUEST_vars']['cust_begin'][$field['COLUMN_NAME']].'"':'')."> <small>&</small> <INPUT type=text name=cust_end[{$field[COLUMN_NAME]}] size=3 maxlength=11".(($_REQUEST['bottom_back']=='true' && $_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']])?' value="'.$_SESSION['_REQUEST_vars']['cust_end'][$field['COLUMN_NAME']].'"':'').">";*/
return '<small>' . _('Between') . '</small> ' . TextInput($_REQUEST['bottom_back'] == 'true' && isset($_SESSION['_REQUEST_vars']['cust_begin'][$field['COLUMN_NAME']]) ? $_SESSION['_REQUEST_vars']['cust_begin'][$field['COLUMN_NAME']] : '', 'cust_begin[' . $field['COLUMN_NAME'] . ']', '', 'size="3" maxlength="11"', $div) . '<small>&</small>' . TextInput($_REQUEST['bottom_back'] == 'true' && isset($_SESSION['_REQUEST_vars']['cust_end'][$field['COLUMN_NAME']]) ? $_SESSION['_REQUEST_vars']['cust_end'][$field['COLUMN_NAME']] : '', 'cust_end[' . $field['COLUMN_NAME'] . ']', '', 'size="3" maxlength="11"', $div);
break;
case 'select':
$options = explode("\r", str_replace(array("\r\n", "\n"), "\r", $field['SELECT_OPTIONS']));
/*if($_REQUEST['bottom_back']=='true' && $_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']])
$bb_option = $_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']];
else
$bb_option = '';
$return = "<SELECT name=cust[{$field[COLUMN_NAME]}] style='max-width:250;'><OPTION value=''>N/A</OPTION><OPTION value='!'".($bb_option=='!'?' SELECTED':'').">No Value</OPTION>";
foreach ( (array) $options as $option )
{
//$return .= "<OPTION value=\"$option\"".(($field['COLUMN_NAME']=='CUSTOM_44' && $field['TITLE']=='District' && $option==$_SESSION['district'])?' SELECTED':'').($bb_option==$option?' SELECTED':'').">$option</OPTION>";
$return .= '<option value="' . $option . '"' . ( $bb_option == $option ? ' selected' : '' ) . '>' .
$option . '</option>';
}
$return .= '</SELECT>';*/
foreach ((array) $options as $option) {
$options_with_keys[$option] = $option;
}
return SelectInput($value, 'cust[' . $field['COLUMN_NAME'] . ']', '', array('!' => _('No Value')) + $options_with_keys, 'N/A', 'style="max-width:250px;"', $div);
break;
case 'date':
return '<small>' . _('Between') . '</small> ' . PrepareDate($value, '_cust_begin[' . $field['COLUMN_NAME'] . ']', true, array('short' => true, 'C' => false)) . ' <small>&</small> ' . PrepareDate('', '_cust_end[' . $field['COLUMN_NAME'] . ']', true, array('short' => true, 'C' => false));
break;
case 'radio':
/*return "<table clsss=cellpadding=0 cellspacing=0><tr><td width=30 align=center>
<input name='cust[{$field[COLUMN_NAME]}]' type='radio' value='Y'".(($_REQUEST['bottom_back']=='true' && $_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']]=='Y')?' CHECKED':'')." /> Yes
</td><td width=25 align=center>
<input name='cust[{$field[COLUMN_NAME]}]' type='radio' value='N'".(($_REQUEST['bottom_back']=='true' && $_SESSION['_REQUEST_vars']['cust'][$field['COLUMN_NAME']])?' CHECKED':'')." /> No
</td></tr></table>";*/
return RadioInput($value, 'cust[' . $field['COLUMN_NAME'] . ']', $title = '', array('Y' => _('Yes'), 'N' => _('No')), false, '', $div);
break;
case 'grade':
$grades_RET = DBGet(DBQuery("SELECT DISTINCT TITLE,ID,SORT_ORDER\n\t\t\t\tFROM SCHOOL_GRADELEVELS\n\t\t\t\tWHERE SCHOOL_ID='" . UserSchool() . "'\n\t\t\t\tORDER BY SORT_ORDER"));
/*$return = '<SELECT name="grade"><OPTION value=""></OPTION>';
foreach ($grades_RET as $grade)
$return .= "<OPTION value=" . $grade['ID'] . ">".$grade['TITLE'].'</OPTION>';
$return .= '</SELECT>';*/
$grade_options = array();
foreach ((array) $grades_RET as $grade) {
$grade_options[$grade['ID']] = $grade['TITLE'];
}
return SelectInput('', 'grade', '', $grade_options, 'N/A', '', $div);
break;
case 'schools':
return CheckboxInput('', '_search_all_schools', _('Search All Schools'), '', true);
break;
case 'timespan':
$start_date = '01-' . mb_strtoupper(date('M-y'));
$end_date = DBDate();
return '<small>' . _('Between') . '</small> ' . PrepareDate($start_date, '_start', true, array('short' => true, 'C' => false)) . ' <small>&</small> ' . PrepareDate($end_date, '_end', true, array('short' => true, 'C' => false));
break;
/*case 'test_no':
$select = SelectInput(
'',
'test_no[]',
'',
array(
'1' => 1,
'2' => 2,
'3' => 3,
'4' => 4,
'5' => 5,
'6' => 6,
'7' => 7,
'8' => 8,
'9' => 9,
'10' => 10,
'0' => _( 'Final' ),
),
'N/A',
'',
$div
);
$select = "<select name='test_no[]'>";
$vals = array('1'=>1,'2'=>2,'3'=>3,'4'=>4,'5'=>5,'6'=>6,'7'=>7,'8'=>8,'9'=>9,'10'=>10,'0'=>'Final');
$select .= '<OPTION value="">N/A</OPTION>';
foreach ($vals as $i=>$val)
//.........这里部分代码省略.........
示例4: DrawBC
}
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'];
$extra['search'] = '';
$extra['extra_header_left'] .= '</TABLE>';
}
$extra['link'] = array('FULL_NAME' => false);
$extra['SELECT'] = ',s.STUDENT_ID AS CHECKBOX';
$extra['functions'] = array('CHECKBOX' => '_makeChooseCheckbox');
$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;
$extra['new'] = true;
//$extra['force_search'] = true;
Widgets('request');
Widgets('course');
Search('student_id', $extra);
示例5: DrawBC
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>';
//echo '<SELECT name=marking_period_id><OPTION value=0>Full Year</OPTION>';
$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"));
$quarters_RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE,SEMESTER_ID FROM SCHOOL_QUARTERS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY SORT_ORDER"));
echo '<SELECT name=marking_period_id><OPTION value=' . $years_RET[1]['MARKING_PERIOD_ID'] . '>' . $years_RET[1]['TITLE'] . '</OPTION>';
foreach ($semesters_RET as $mp) {
echo "<OPTION value={$mp['MARKING_PERIOD_ID']}>" . $mp['TITLE'] . '</OPTION>';
}
foreach ($quarters_RET as $mp) {
echo "<OPTION value={$mp['MARKING_PERIOD_ID']}>" . $mp['TITLE'] . '</OPTION>';
}
echo '</SELECT>';
echo '</TD></TR>';
echo '</TABLE>';
示例6: DrawBC
DrawBC("Scheduling > " . ProgramTitle());
echo '<input type="hidden" name="marking_period_id" value=' . strip_tags(trim($_REQUEST['marking_period_id'])) . ' >';
$students_RET = GetStuList($extra);
$LO_columns = array('FULL_NAME' => 'Student', 'STUDENT_ID' => 'Student ID', 'ALT_ID' => 'Alternate ID', 'GRADE_ID' => 'Grade', 'PHONE' => 'Phone');
if (is_array($extra['columns_before'])) {
$columns = $extra['columns_before'] + $LO_columns;
$LO_columns = $columns;
}
if (is_array($extra['columns_after'])) {
$columns = $LO_columns + $extra['columns_after'];
}
if (!$extra['columns_before'] && !$extra['columns_after']) {
$columns = $LO_columns;
}
if (count($students_RET) > 0) {
echo '<TABLE><TR><TD>Drop Date</TD><TD>' . PrepareDate(DBDate(), '') . '</TD></TR></TABLE>';
}
if (count($students_RET) > 1 || $link['add'] || !$link['FULL_NAME'] || $extra['columns_before'] || $extra['columns_after'] || $extra['BackPrompt'] == false && count($students_RET) == 0 || $extra['Redirect'] === false && count($students_RET) == 1) {
$tmp_REQUEST = $_REQUEST;
unset($tmp_REQUEST['expanded_view']);
if ($_REQUEST['expanded_view'] != 'true' && !UserStudentID() && count($students_RET) != 0) {
DrawHeader("<div><A HREF=" . PreparePHP_SELF($tmp_REQUEST) . "&expanded_view=true class=big_font ><img src=\"themes/blue/expanded_view.png\" />Expanded View</A></div><div class=break ></div>", $extra['header_right']);
DrawHeader(str_replace('<BR>', '<BR> ', substr($_openSIS['SearchTerms'], 0, -4)));
} elseif (!UserStudentID() && count($students_RET) != 0) {
DrawHeader("<div><A HREF=" . PreparePHP_SELF($tmp_REQUEST) . "&expanded_view=false class=big_font><img src=\"themes/blue/expanded_view.png\" />Original View</A></div><div class=break ></div>", $extra['header_right']);
DrawHeader(str_replace('<BR>', '<BR> ', substr($_openSIS['Search'], 0, -4)));
}
DrawHeader($extra['extra_header_left'], $extra['extra_header_right']);
if ($_REQUEST['LO_save'] != '1' && !$extra['suppress_save']) {
$_SESSION['List_PHP_SELF'] = PreparePHP_SELF($_SESSION['_REQUEST_vars']);
echo '<script language=JavaScript>parent.help.location.reload();</script>';
示例7: elseif
}
} elseif (count($periods_RET) == 1) {
foreach ($periods_RET as $period) {
$period_select .= "<OPTION value=" . $period['PERIOD_ID'] . ($_REQUEST['period_id'] == $period['PERIOD_ID'] || !isset($_REQUEST['period_id']) ? ' SELECTED' : '') . ">" . $period['TITLE'] . '</OPTION>';
}
if (!isset($_REQUEST['period_id'])) {
$_REQUEST['period_id'] = $period['PERIOD_ID'];
}
}
} else {
$period_select .= '<OPTION value="PERIOD"' . ($_REQUEST['period_id'] ? ' SELECTED' : '') . '>By Period</OPTION>';
}
$period_select .= '</SELECT>';
echo "<FORM action={$PHP_tmp_SELF} method=POST>";
echo "<div style='width:795px; overflow:scroll; overflow-y:hidden;'>";
DrawHeaderHome('<table><tr><td>' . PrepareDate($start_date, '_start') . '</td><td> - </td><td>' . PrepareDate($end_date, '_end') . '</td><td> : </td><td>' . $period_select . ' : <INPUT type=submit class=btn_medium value=Go></td></tr></table>');
}
$cal_RET = DBGet(DBQuery('SELECT DISTINCT SCHOOL_DATE,CONCAT(\'_\',DATE_FORMAT(SCHOOL_DATE,\'%y%b%d\')) AS SHORT_DATE FROM attendance_calendar WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SCHOOL_DATE BETWEEN \'' . date('Y-m-d', strtotime($start_date)) . '\' AND \'' . date('Y-m-d', strtotime($end_date)) . '\' ORDER BY SCHOOL_DATE'));
if (UserStudentID() || $_REQUEST['student_id'] || User('PROFILE') == 'parent') {
// JUST TO SET USERSTUDENTID()
Search('student_id');
if ($_REQUEST['period_id']) {
$sql = 'SELECT
cp.TITLE as COURSE_PERIOD,sp.TITLE as PERIOD,cpv.PERIOD_ID
FROM
schedule s,courses c,course_periods cp,course_period_var cpv,school_periods sp
WHERE
s.COURSE_ID = c.COURSE_ID AND s.COURSE_ID = cp.COURSE_ID AND cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID
AND s.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND cpv.PERIOD_ID = sp.PERIOD_ID AND cpv.DOES_ATTENDANCE=\'Y\'
AND s.SYEAR = c.SYEAR AND cp.MARKING_PERIOD_ID IN (' . GetAllMP('QTR', UserMP()) . ')
AND s.STUDENT_ID=\'' . UserStudentID() . '\' AND s.SYEAR=\'' . UserSyear() . '\'
示例8: Preferences
} 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'));
$extra['columns_after'] = array('BALANCE' => _('Balance'));
$extra['group'] = $extra['LO_group'] = array('ACCOUNT_ID');
$extra['link'] = array('FULL_NAME' => false);
Search('student_id', $extra);
示例9: array
$types += array($menu['TITLE'] => array('DESCRIPTION' => $menu['TITLE'], 'COUNT' => 0, 'AMOUNT' => 0, 'ITEMS' => $items));
}
$type_select = _('Type') . '<SELECT name=type_select><OPTION value=\'\'>' . _('Not Specified') . '</OPTION>';
foreach ($types as $short_name => $type) {
$type_select .= '<OPTION value=' . $short_name . ($_REQUEST['type_select'] == $short_name ? ' SELECTED' : '') . '>' . $type['DESCRIPTION'] . '</OPTION>';
}
$type_select .= '</SELECT>';
$staff_RET = DBGet(DBquery('SELECT STAFF_ID,FIRST_NAME||\' \'||LAST_NAME AS FULL_NAME FROM STAFF WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOLS LIKE \'%,' . UserSchool() . ',%\' AND PROFILE=\'admin\' ORDER BY LAST_NAME'));
$staff_select = _('User') . '<SELECT name=staff_select><OPTION value=\'\'>' . _('Not Specified') . '</OPTION>';
foreach ($staff_RET as $staff) {
$staff_select .= '<OPTION value=' . $staff['STAFF_ID'] . ($_REQUEST['staff_select'] == $staff['STAFF_ID'] ? ' SELECTED' : '') . '>' . $staff['FULL_NAME'] . '</OPTION>';
}
$staff_select .= '</SELECT>';
$PHP_tmp_SELF = PreparePHP_SELF();
echo "<FORM action={$PHP_tmp_SELF} method=POST>";
DrawHeader(PrepareDate($date, '_date') . ' : ' . $type_select . ' : ' . $staff_select . ' : <INPUT type=submit value=' . _('Go') . '>', CheckBoxOnclick('by_name') . _('Sort by Name'));
echo '</FORM>';
if ($_REQUEST['type_select']) {
$where = "AND fst.SHORT_NAME='" . $_REQUEST['type_select'] . "' ";
}
if ($_REQUEST['staff_select']) {
$where = "AND fst.SELLER_ID='" . $_REQUEST['staff_select'] . "' ";
}
if ($_REQUEST['detailed_view'] != 'true') {
DrawHeader("<A HREF=" . PreparePHP_SELF($_REQUEST, array(), array('detailed_view' => 'true')) . '>' . _('Detailed View') . '</A>');
} else {
DrawHeader("<A HREF=" . PreparePHP_SELF($_REQUEST, array(), array('detailed_view' => 'false')) . '>' . _('Original View') . '</A>');
}
include 'modules/Food_Service/' . ($_REQUEST['type'] == 'staff' ? 'Users' : 'Students') . '/ActivityReport.php';
//echo '<pre>'; var_dump($RET); echo '</pre>';
//echo '<pre>'; var_dump($types); echo '</pre>';
示例10: elseif
} elseif ($month == 'SEP') {
$month = '09';
} elseif ($month == 'OCT') {
$month = '10';
} elseif ($month == 'NOV') {
$month = '11';
} elseif ($month == 'DEC') {
$month = '12';
}
$final_date = $year . "-" . $month . "-" . $day;
$date = $final_date;
}
//echo $date;
//--------- if end --------------//
//------------------------------ Date Edit End -------------------------------------------//
DrawHeader('<TABLE><TR><TD>' . PrepareDate($date, '_date', false, array('submit' => true)) . '</TD><TD> </TD><TD>' . SubmitButton('Go', '', 'class=btn_medium') . '</TD><TR></TABLE>', '<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>');
$categories_RET = DBGet(DBQuery("SELECT ID,TITLE FROM ATTENDANCE_CODE_CATEGORIES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
$tmp_REQUEST = $_REQUEST;
unset($tmp_REQUEST['table']);
unset($tmp_REQUEST['codes']);
$tmp_PHP_SELF = PreparePHP_SELF($tmp_REQUEST);
if (count($categories_RET)) {
echo '<center><div style="margin-bottom:-25px;"><TABLE border=0 cellpadding=0 cellspacing=0 style="border:1;border-style: none none solid none;"><TR><TD>';
echo '<TABLE height=1><TR><TD height=1></TD></TR></TABLE>';
$header = '<TABLE border=0 cellpadding=0 cellspacing=0 height=14><TR>';
if ($_REQUEST['table'] !== '0') {
$tabcolor = '#DFDFDF';
$textcolor = '#999999';
} else {
$tabcolor = Preferences('HIGHLIGHT');
$textcolor = '#000000';
示例11: DrawHeader
<?php
DrawHeader('Daily Transactions');
if ($_REQUEST[modfunc] == '') {
echo '<BR>';
PopTable('header', 'Search');
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=list method=POST>";
echo '<TABLE>';
echo '<TR><TD>Beginning Date</TD><TD>' . PrepareDate('_begin', DBDate(), false) . '</TD></TR>';
echo '<TR><TD>Ending Date</TD><TD>' . PrepareDate('_end', DBDate(), false) . '</TD></TR>';
PrepareSchool(SessionSchool(), '', SessionCurSchool());
echo '<TR><TD>Report</TD><TD>';
echo '<SELECT name=type>
<OPTION value=stubillingcredits>Student Billing Credits</OPTION>
<OPTION value=stubillingdebits>Student Billing Debits</OPTION>
<OPTION value="stubillingwaived debits">Student Billing Waived Debits</OPTION>
<OPTION value=lunchcredits>Lunch Credits</OPTION>
<OPTION value=lunchdebits>Lunch Debits</OPTION>
</SELECT>';
echo '</TD></TR>';
$accounts_RET = DBGet(DBQuery("SELECT ID,TITLE FROM STU_BILLING_ACCOUNTS WHERE SYEAR='" . GetSysYear() . "'"));
if (count($accounts_RET)) {
echo '<TR><TD>Account</TD><TD>';
echo '<SELECT name=account_id>
<OPTION value="">Not Specified</OPTION>';
foreach ($accounts_RET as $value) {
echo "<OPTION value={$value['ID']}>{$value['TITLE']}</OPTION>";
}
echo '</SELECT>';
echo '</TD></TR>';
}
示例12: DBGet
$description_select .= '<OPTION value="' . $description['DESCRIPTION'] . '">' . $description['DESCRIPTION'];
}
$description_select .= '</SELECT';
}
}
$calendar_RET = DBGet(DBQuery("SELECT DATE_FORMAT(SCHOOL_DATE,'%d-%b-%y') as SCHOOL_DATE FROM ATTENDANCE_CALENDAR WHERE SCHOOL_DATE BETWEEN '" . date('d-M-y', $time) . "' AND '" . date('d-M-y', $time_last) . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND CALENDAR_ID='{$calendar_id}' AND MINUTES>0 ORDER BY SCHOOL_DATE"), array(), array('SCHOOL_DATE'));
$events_RET = DBGet(DBQuery("SELECT ID,TITLE,DESCRIPTION,DATE_FORMAT(SCHOOL_DATE,'%d-%b-%y') AS SCHOOL_DATE FROM CALENDAR_EVENTS WHERE SCHOOL_DATE BETWEEN '" . date('d-M-y', $time) . "' AND '" . date('d-M-y', $time_last) . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND TITLE='" . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . "' ORDER BY SCHOOL_DATE"), array('DESCRIPTION' => 'makeDescriptionInput', 'SCHOOL_DATE' => 'ProperDate'));
$events_RET[0] = array();
// make sure indexing from 1
foreach ($calendar_RET as $school_date => $value) {
$events_RET[] = array('ID' => 'new', 'SCHOOL_DATE' => ProperDate($school_date), 'DESCRIPTION' => TextInput('', 'food_service[' . $school_date . '][text]', '', 'size=35') . ($description_select ? '<SELECT name=food_service[' . $school_date . '][select]>' . $description_select : ''));
}
unset($events_RET[0]);
$LO_columns = array('ID' => '#', 'SCHOOL_DATE' => 'Date', 'DESCRIPTION' => 'Description');
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&menu_id={$_REQUEST['menu_id']}&month={$_REQUEST['month']}&year={$_REQUEST['year']} METHOD=POST>";
DrawHeader(PrepareDate(strtoupper(date("d-M-y", $time)), '', false, array('M' => 1, 'Y' => 1, 'submit' => true)), SubmitButton('Save', 'submit[save]') . '<INPUT type=submit value=\'Generate Menu\' name=submit[print]>');
echo '<BR>';
$tabs = array();
foreach ($menus_RET as $id => $meal) {
$tabs[] = array('title' => $meal[1]['TITLE'], 'link' => "Modules.php?modname={$_REQUEST['modname']}&menu_id={$id}&month={$_REQUEST['month']}&year={$_REQUEST['year']}");
}
$extra = array('save' => false, 'search' => false, 'header' => WrapTabs($tabs, "Modules.php?modname={$_REQUEST['modname']}&menu_id={$_REQUEST['menu_id']}&month={$_REQUEST['month']}&year={$_REQUEST['year']}"));
$singular = $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . ' Day';
$plural = $singular . 's';
ListOutput($events_RET, $LO_columns, $singular, $plural, array(), array(), $extra);
echo '<CENTER>' . SubmitButton('Save', 'submit[save]') . '</CENTER>';
echo "</FORM>";
}
function makeDescriptionInput($value, $name)
{
global $THIS_RET, $calendar_RET;
示例13: GetStaffList_Miss_Atn
$_REQUEST['next_modname'] = 'Users/User.php';
}
$ERR = "";
if ($_REQUEST['day_From'] == '' && $_REQUEST['day_to']) {
$ERR = "please select from date";
} else {
if ($_REQUEST['day_From'] && $_REQUEST['day_to'] || $From && $to) {
$staff_RET = GetStaffList_Miss_Atn($extra);
}
}
#if(!isset($_openSIS['DrawHeader'])) DrawHeaderHome('Please select a user');
echo '<div><STRONG><FONT color=red>' . $ERR . '</font></strong></DIV>';
echo "<FORM name=missingatten id=missingatten action=Modules.php?modname={$_REQUEST['modname']}&func=save method=POST>";
$header = '<table width=100%><TR>';
$header .= '<TD style="width:30px; vertical-align:top; text-align:left; padding-top:8px;">From</TD><td valign="top" style="width:230px;">' . PrepareDate($From, '_From', true, array('short' => true)) . '</TD>';
$header .= '<TD style="width:20px; vertical-align:top; text-align:left; padding-top:8px;">To</TD><td valign="top" style="width:230px;">' . PrepareDate($to, '_to', true, array('short' => true)) . '</TD>';
$header .= '<td align=left><INPUT type=submit class=btn_medium name=go value=Go ></td>';
$header .= '</tr></table>';
DrawHeaderHome($header);
echo '</form>';
if ($extra['profile']) {
$options = array('admin' => 'Administrator', 'teacher' => 'Teacher', 'parent' => 'Parent', 'none' => 'No Access');
$singular = $options[$extra['profile']];
$plural = $singular . ($options[$extra['profile']] == 'none' ? 'es' : 's');
$columns = array('FULL_NAME' => $singular, 'STAFF_ID' => 'Staff ID');
} else {
$singular = 'User';
$plural = 'Users';
$columns = array('FULL_NAME' => 'Staff Member', 'PROFILE' => 'Profile', 'STAFF_ID' => 'Staff ID');
}
if (is_array($extra['columns_before'])) {
示例14: DBGet
//$periods_RET = DBGet(DBQuery("SELECT sp.PERIOD_ID,sp.TITLE FROM SCHOOL_PERIODS sp,COURSE_PERIODS cp WHERE position(',0,' IN cp.DOES_ATTENDANCE)>0 AND sp.PERIOD_ID=cp.PERIOD_ID AND cp.COURSE_PERIOD_ID='".UserCoursePeriod()."'"));
$periods_RET = DBGet(DBQuery("SELECT sp.PERIOD_ID,sp.TITLE FROM SCHOOL_PERIODS sp,COURSE_PERIODS cp, COURSE_PERIOD_SCHOOL_PERIODS cpsp WHERE cp.COURSE_PERIOD_ID=cpsp.COURSE_PERIOD_ID AND position(',0,' IN cp.DOES_ATTENDANCE)>0 AND sp.PERIOD_ID=cpsp.PERIOD_ID AND cpsp.COURSE_PERIOD_SCHOOL_PERIODS_ID='" . UserCoursePeriodSchoolPeriod() . "'"));
if ($periods_RET) {
//$period_select .= '<OPTION value="'.$periods_RET[1]['PERIOD_ID'].'"'.(($_REQUEST['period_id']==$periods_RET[1]['PERIOD_ID'] || !isset($_REQUEST['period_id']))?' SELECTED="SELECTED"':'').">".$periods_RET[1]['TITLE'].'</OPTION>';
$period_select .= '<OPTION value="' . $periods_RET[1]['PERIOD_ID'] . '"' . ($_REQUEST['period_id'] == $periods_RET[1]['PERIOD_ID'] ? ' SELECTED="SELECTED"' : '') . ">" . $periods_RET[1]['TITLE'] . '</OPTION>';
if (!isset($_REQUEST['period_id'])) {
$_REQUEST['period_id'] = $periods_RET['PERIOD_ID'];
}
}
}
} else {
$period_select .= '<OPTION value="PERIOD"' . ($_REQUEST['period_id'] ? ' SELECTED="SELECTED"' : '') . '>' . _('By Period') . '</OPTION>';
}
$period_select .= '</SELECT>';
echo '<FORM action="' . $PHP_tmp_SELF . '" method="POST">';
DrawHeader(_('Timeframe') . ':' . PrepareDate($start_date, '_start') . ' ' . _('to') . ' ' . PrepareDate($end_date, '_end') . ' : ' . $period_select . ' : <INPUT type="submit" value="' . _('Go') . '" />');
}
$cal_RET = DBGet(DBQuery("SELECT DISTINCT SCHOOL_DATE,'_'||to_char(SCHOOL_DATE,'yyyymmdd') AS SHORT_DATE FROM ATTENDANCE_CALENDAR WHERE SCHOOL_ID='" . UserSchool() . "' AND SCHOOL_DATE BETWEEN '{$start_date}' AND '{$end_date}' ORDER BY SCHOOL_DATE"));
//modif Francois: bugfix bug when Back to Student Search
//if(UserStudentID() || $_REQUEST['student_id'] || User('PROFILE')=='parent')
if ($_REQUEST['student_id'] || User('PROFILE') == 'parent') {
// JUST TO SET USERSTUDENTID()
Search('student_id');
if ($_REQUEST['period_id']) {
//modif Francois: multiple school periods for a course period
/*$sql = "SELECT
cp.TITLE as COURSE_PERIOD,sp.TITLE as PERIOD,cp.PERIOD_ID
FROM
SCHEDULE s,COURSES c,COURSE_PERIODS cp,SCHOOL_PERIODS sp
WHERE
s.COURSE_ID = c.COURSE_ID AND s.COURSE_ID = cp.COURSE_ID
示例15: Widgets
Widgets('absences');
Widgets('gpa');
Widgets('class_rank');
Widgets('letter_grade');
Widgets('eligibility');
$extra['search'] .= '<TR><TD align=right width=120>Include courses active as of </TD><TD>' . PrepareDate('', '_include_active_date') . '</TD></TR>';
$extra['new'] = true;
/* if($_REQUEST['modfunc']=='call')
include('modules/misc/Export.php');
else
*/
Search('student_id', $extra);
if ($_SESSION['count_stu'] != '0') {
unset($_SESSION['count_stu']);
echo '<BR><CENTER><INPUT type=submit value=\'Create Report for Selected Students\' class=btn_xxlarge></CENTER>';
}
echo "</FORM>";
} else {
Widgets('course');
Widgets('request');
Widgets('activity');
Widgets('absences');
Widgets('gpa');
Widgets('class_rank');
Widgets('letter_grade');
Widgets('eligibility');
$extra['search'] .= '<TR><TD align=right width=120>Include courses active as of </TD><TD>' . PrepareDate('', '_include_active_date') . '</TD></TR>';
$extra['new'] = true;
Search('student_id', $extra);
}
}