Beispiel #1
0
        }
    }
}
if ($_REQUEST['modfunc'] != 'remove') {
    #$sql = "SELECT PERIOD_ID,TITLE,SHORT_NAME,SORT_ORDER,LENGTH,START_TIME,END_TIME,BLOCK,ATTENDANCE FROM school_periods WHERE SYEAR='".UserSyear()."' AND SCHOOL_ID='".UserSchool()."' ORDER BY SORT_ORDER";
    $sql = 'SELECT PERIOD_ID,TITLE,SHORT_NAME,SORT_ORDER,LENGTH,START_TIME,END_TIME,ATTENDANCE,IGNORE_SCHEDULING FROM school_periods WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY SORT_ORDER';
    $QI = DBQuery($sql);
    #$periods_RET = DBGet($QI,array('TITLE'=>'_makeTextInput','SHORT_NAME'=>'_makeTextInput','SORT_ORDER'=>'_makeTextInputMod','BLOCK'=>'_makeTextInput','LENGTH'=>'_makeTextInputMod','START_TIME'=>'_makeTimeInput','END_TIME'=>'_makeTimeInputEnd','ATTENDANCE'=>'_makeCheckboxInput'));
    #$periods_RET = DBGet($QI,array('TITLE'=>'_makeTextInput','SHORT_NAME'=>'_makeTextInput','SORT_ORDER'=>'_makeTextInputMod','BLOCK'=>'_makeTextInput','LENGTH'=>'LENGTH','START_TIME'=>'_makeTimeInput','END_TIME'=>'_makeTimeInputEnd','ATTENDANCE'=>'_makeCheckboxInput'));
    $periods_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'SHORT_NAME' => '_makeTextInput', 'SORT_ORDER' => '_makeTextInputMod', 'LENGTH' => 'LENGTH', 'START_TIME' => '_makeTimeInput', 'END_TIME' => '_makeTimeInputEnd', 'ATTENDANCE' => '_makeCheckboxInput', 'IGNORE_SCHEDULING' => '_makeCheckboxInput'));
    #$columns = array('TITLE'=>'Title','SHORT_NAME'=>'Short Name','SORT_ORDER'=>'Sort Order','START_TIME'=>'Start Time','END_TIME'=>'End Time','LENGTH'=>'Length (minutes)','IGNORE_SCHEDULING'=>'Block','ATTENDANCE'=>'Used for Attendance');
    $columns = array('TITLE' => '' . _('Title') . '', 'SHORT_NAME' => '' . _('Short Name') . '', 'SORT_ORDER' => '' . _('Sort Order') . '', 'START_TIME' => '' . _('Start Time') . '', 'END_TIME' => '' . _('End Time') . '', 'LENGTH' => '' . _('Length') . ' <div></div>(' . _('minutes') . ')', 'ATTENDANCE' => '' . _('Used for') . ' <div></div>' . _('Attendance') . '', 'IGNORE_SCHEDULING' => '' . _('Ignore for') . '<div></div>' . _('Scheduling') . '');
    //,'START_TIME'=>'Start Time','END_TIME'=>'End Time'
    #$link['add']['html'] = array('TITLE'=>_makeTextInput('','TITLE'),'SHORT_NAME'=>_makeTextInput('','SHORT_NAME'),'LENGTH'=>_makeTextInputMod2('','LENGTH'),'SORT_ORDER'=>_makeTextInputMod2('','SORT_ORDER'),'BLOCK'=>_makeTextInput('','BLOCK'),'START_TIME'=>_makeTimeInput('','START_TIME'),'END_TIME'=>_makeTimeInputEnd('','END_TIME'),'ATTENDANCE'=>_makeCheckboxInput('','ATTENDANCE'));
    #$link['add']['html'] = array('TITLE'=>_makeTextInput('','TITLE'),'SHORT_NAME'=>_makeTextInput('','SHORT_NAME'),'SORT_ORDER'=>_makeTextInputMod2('','SORT_ORDER'),'BLOCK'=>_makeTextInput('','BLOCK'),'START_TIME'=>_makeTimeInput('','START_TIME'),'END_TIME'=>_makeTimeInputEnd('','END_TIME'),'ATTENDANCE'=>_makeCheckboxInput('','ATTENDANCE'));
    $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => _makeTextInputMod2('', 'SORT_ORDER'), 'START_TIME' => _makeTimeInput('', 'START_TIME'), 'END_TIME' => _makeTimeInputEnd('', 'END_TIME'), 'ATTENDANCE' => _makeCheckboxInput('', 'ATTENDANCE'), 'IGNORE_SCHEDULING' => _makeCheckboxInput('', 'IGNORE_SCHEDULING'));
    $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove";
    $link['remove']['variables'] = array('id' => 'PERIOD_ID');
    if ($err_msg) {
        echo "<b style='color:red'>" . $err_msg . "</b>";
        unset($err_msg);
    }
    echo "<FORM name=F1 id=F1 action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update method=POST>";
    #DrawHeader('',SubmitButton('Save'));
    ListOutput($periods_RET, $columns, _('Period'), _('Periods'), $link);
    echo '<br><CENTER>' . SubmitButton(_('Save'), '', 'class=btn_medium onclick="formcheck_school_setup_periods();"') . '</CENTER>';
    echo '</FORM>';
}
function _makeTextInput($value, $name)
{
    global $THIS_RET;
Beispiel #2
0
    }
}
DrawBC("School Setup > " . ProgramTitle());
if ($_REQUEST['modfunc'] == 'remove' && AllowEdit()) {
    if (DeletePrompt('period')) {
        DBQuery("DELETE FROM SCHOOL_PERIODS WHERE PERIOD_ID='{$_REQUEST['id']}'");
        unset($_REQUEST['modfunc']);
    }
}
if ($_REQUEST['modfunc'] != 'remove') {
    $sql = "SELECT PERIOD_ID,TITLE,SHORT_NAME,SORT_ORDER,LENGTH,START_TIME,END_TIME,BLOCK,ATTENDANCE FROM SCHOOL_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY SORT_ORDER";
    $QI = DBQuery($sql);
    $periods_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'SHORT_NAME' => '_makeTextInput', 'SORT_ORDER' => '_makeTextInputMod', 'BLOCK' => '_makeTextInput', 'LENGTH' => '_makeTextInputMod', 'START_TIME' => '_makeTimeInput', 'END_TIME' => '_makeTimeInput', 'ATTENDANCE' => '_makeCheckboxInput'));
    $columns = array('TITLE' => 'Title', 'SHORT_NAME' => 'Short Name', 'SORT_ORDER' => 'Sort Order', 'LENGTH' => 'Length (minutes)', 'BLOCK' => 'Block', 'ATTENDANCE' => 'Used for Attendance');
    //,'START_TIME'=>'Start Time','END_TIME'=>'End Time'
    $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'LENGTH' => _makeTextInputMod2('', 'LENGTH'), 'SORT_ORDER' => _makeTextInputMod2('', 'SORT_ORDER'), 'BLOCK' => _makeTextInput('', 'BLOCK'), 'START_TIME' => _makeTimeInput('', 'START_TIME'), 'END_TIME' => _makeTimeInput('', 'END_TIME'), 'ATTENDANCE' => _makeCheckboxInput('', 'ATTENDANCE'));
    $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove";
    $link['remove']['variables'] = array('id' => 'PERIOD_ID');
    echo "<FORM name=F1 id=F1 action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update method=POST>";
    #DrawHeader('',SubmitButton('Save'));
    ListOutput($periods_RET, $columns, 'Period', 'Periods', $link);
    echo '<br><CENTER>' . SubmitButton('Save', '', 'class=btn_medium onclick="formcheck_school_setup_periods();"') . '</CENTER>';
    echo '</FORM>';
}
function _makeTextInput($value, $name)
{
    global $THIS_RET;
    if ($THIS_RET['PERIOD_ID']) {
        $id = $THIS_RET['PERIOD_ID'];
    } else {
        $id = 'new';