当前位置: 首页>>代码示例>>PHP>>正文


PHP UserSyear函数代码示例

本文整理汇总了PHP中UserSyear函数的典型用法代码示例。如果您正苦于以下问题:PHP UserSyear函数的具体用法?PHP UserSyear怎么用?PHP UserSyear使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UserSyear函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetCurrentMP

function GetCurrentMP($mp, $date, $error = true)
{
    global $_openSIS;
    switch ($mp) {
        case 'FY':
            $table = 'school_years';
            break;
        case 'SEM':
            $table = 'school_semesters';
            break;
        case 'QTR':
            $table = 'school_quarters';
            break;
        case 'PRO':
            $table = 'school_progress_periods';
            break;
    }
    if (!$_openSIS['GetCurrentMP'][$date][$mp]) {
        $_openSIS['GetCurrentMP'][$date][$mp] = DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM ' . $table . ' WHERE \'' . $date . '\' BETWEEN START_DATE AND END_DATE AND SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
    }
    if ($_openSIS['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID']) {
        return $_openSIS['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID'];
    } elseif (strpos($_SERVER['PHP_SELF'], 'Side.php') === false && $error == true) {
        ErrorMessage(array('' . _("You are not currently in a marking period") . ''));
    }
    //ShowErr("You are not currently in a marking period");
}
开发者ID:SysBind,项目名称:opensis-ml,代码行数:27,代码来源:GetMP.fnc.php

示例2: GetCurrentMP

function GetCurrentMP($mp, $date, $error = true)
{
    global $_openSIS;
    switch ($mp) {
        case 'FY':
            $table = 'SCHOOL_YEARS';
            break;
        case 'SEM':
            $table = 'SCHOOL_SEMESTERS';
            break;
        case 'QTR':
            $table = 'SCHOOL_QUARTERS';
            break;
        case 'PRO':
            $table = 'SCHOOL_PROGRESS_PERIODS';
            break;
    }
    if (!$_openSIS['GetCurrentMP'][$date][$mp]) {
        $_openSIS['GetCurrentMP'][$date][$mp] = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM {$table} WHERE '{$date}' BETWEEN START_DATE AND END_DATE AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
    }
    if ($_openSIS['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID']) {
        return $_openSIS['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID'];
    } elseif (strpos($_SERVER['PHP_SELF'], 'Side.php') === false && $error == true) {
        ErrorMessage(array("You are not currently in a marking period"));
    }
    //ShowErr("You are not currently in a marking period");
}
开发者ID:26746647,项目名称:Belize-openSIS,代码行数:27,代码来源:GetMP.fnc.php

示例3: UpdateAttendanceDaily

function UpdateAttendanceDaily($student_id, $date = '', $comment = false)
{
    $daysWeek = _('SuMoTuWeThFrSa');
    /// Days of the week
    if (!$date) {
        $date = DBDate();
    }
    $sql = "SELECT\n\t\t\t\tsum(sp.LENGTH) AS TOTAL\n\t\t\tFROM SCHEDULE s,COURSE_PERIODS cp,SCHOOL_PERIODS sp,ATTENDANCE_CALENDAR ac\n\t\t\tWHERE\n\t\t\t\ts.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND position(',0,' IN cp.DOES_ATTENDANCE)>0\n\t\t\t\tAND ac.SCHOOL_DATE='{$date}' AND (ac.BLOCK=sp.BLOCK OR sp.BLOCK IS NULL)\n\t\t\t\tAND ac.CALENDAR_ID=cp.CALENDAR_ID AND ac.SCHOOL_ID=s.SCHOOL_ID AND ac.SYEAR=s.SYEAR\n\t\t\t\tAND s.SYEAR = cp.SYEAR AND sp.PERIOD_ID = cp.PERIOD_ID\n\t\t\t\tAND position(substring('{$daysWeek}' FROM cast(extract(DOW FROM cast('{$date}' AS DATE)) AS INT)*2+1 FOR 2) IN cp.DAYS)>0\n\t\t\t\tAND s.STUDENT_ID='{$student_id}'\n\t\t\t\tAND s.SYEAR='" . UserSyear() . "'\n\t\t\t\tAND ('{$date}' BETWEEN s.START_DATE AND s.END_DATE OR (s.END_DATE IS NULL AND '{$date}'>=s.START_DATE))\n\t\t\t\tAND s.MARKING_PERIOD_ID IN (" . GetAllMP('QTR', GetCurrentMP('QTR', $date)) . ")\n\t\t\t";
    $RET = DBGet(DBQuery($sql));
    $total = $RET[1]['TOTAL'];
    if ($total == 0) {
        return;
    }
    $sql = "SELECT sum(sp.LENGTH) AS TOTAL\n\t\t\tFROM ATTENDANCE_PERIOD ap,SCHOOL_PERIODS sp,ATTENDANCE_CODES ac\n\t\t\tWHERE ap.STUDENT_ID='{$student_id}' AND ap.SCHOOL_DATE='{$date}' AND ap.PERIOD_ID=sp.PERIOD_ID AND ac.ID = ap.ATTENDANCE_CODE AND ac.STATE_CODE='A'\n\t\t\tAND sp.SYEAR='" . UserSyear() . "'";
    $RET = DBGet(DBQuery($sql));
    $total -= $RET[1]['TOTAL'];
    $sql = "SELECT sum(sp.LENGTH) AS TOTAL\n\t\t\tFROM ATTENDANCE_PERIOD ap,SCHOOL_PERIODS sp,ATTENDANCE_CODES ac\n\t\t\tWHERE ap.STUDENT_ID='{$student_id}' AND ap.SCHOOL_DATE='{$date}' AND ap.PERIOD_ID=sp.PERIOD_ID AND ac.ID = ap.ATTENDANCE_CODE AND ac.STATE_CODE='H'\n\t\t\tAND sp.SYEAR='" . UserSyear() . "'";
    $RET = DBGet(DBQuery($sql));
    $total -= $RET[1]['TOTAL'] * 0.5;
    if ($total >= 300) {
        $length = '1.0';
    } elseif ($total >= 150) {
        $length = '.5';
    } else {
        $length = '0.0';
    }
    $current_RET = DBGet(DBQuery("SELECT MINUTES_PRESENT,STATE_VALUE,COMMENT FROM ATTENDANCE_DAY WHERE STUDENT_ID='{$student_id}' AND SCHOOL_DATE='{$date}'"));
    if (count($current_RET) && $current_RET[1]['MINUTES_PRESENT'] != $total) {
        DBQuery("UPDATE ATTENDANCE_DAY SET MINUTES_PRESENT='{$total}',STATE_VALUE='{$length}'" . ($comment !== false ? ",COMMENT='" . str_replace("\\'", "''", $comment) . "'" : '') . " WHERE STUDENT_ID='{$student_id}' AND SCHOOL_DATE='{$date}'");
    } elseif (count($current_RET) && $comment !== false && $current_RET[1]['COMMENT'] != $comment) {
        DBQuery("UPDATE ATTENDANCE_DAY SET COMMENT='" . str_replace("\\'", "''", $comment) . "' WHERE STUDENT_ID='{$student_id}' AND SCHOOL_DATE='{$date}'");
    } elseif (count($current_RET) == 0) {
        DBQuery("INSERT INTO ATTENDANCE_DAY (SYEAR,STUDENT_ID,SCHOOL_DATE,MINUTES_PRESENT,STATE_VALUE,MARKING_PERIOD_ID,COMMENT) values('" . UserSyear() . "','{$student_id}','{$date}','{$total}','{$length}','" . GetCurrentMP('QTR', $date) . "','" . str_replace("\\'", "''", $comment) . "')");
    }
}
开发者ID:linil,项目名称:centreSIS,代码行数:35,代码来源:Attendance.php

示例4: GetStaffList

function GetStaffList(&$extra)
{
    global $profiles_RET;
    $functions = array('PROFILE' => 'makeProfile');
    switch (User('PROFILE')) {
        case 'admin':
            $profiles_RET = DBGet(DBQuery("SELECT * FROM USER_PROFILES"), array(), array('ID'));
            $sql = "SELECT CONCAT(\n\t\t\t\t\tCOALESCE(s.LAST_NAME,' '),', ',COALESCE(s.FIRST_NAME,' '),' ',COALESCE(s.MIDDLE_NAME,' ')) AS FULL_NAME,\n\t\t\t\t\ts.PROFILE,s.PROFILE_ID,s.STAFF_ID,s.SCHOOLS " . $extra['SELECT'] . "\n\t\t\t\tFROM\n\t\t\t\t\tSTAFF s " . $extra['FROM'] . "\n\t\t\t\tWHERE\n\t\t\t\t\ts.SYEAR='" . UserSyear() . "'";
            if ($_REQUEST['_search_all_schools'] != 'Y') {
                $sql .= " AND (s.SCHOOLS LIKE '%," . UserSchool() . ",%' OR s.SCHOOLS IS NULL OR s.SCHOOLS='') ";
            }
            if ($_REQUEST['username']) {
                $sql .= "AND UPPER(s.USERNAME) LIKE '" . strtoupper($_REQUEST['username']) . "%' ";
            }
            if ($_REQUEST['last']) {
                $sql .= "AND UPPER(s.LAST_NAME) LIKE '" . strtoupper($_REQUEST['last']) . "%' ";
            }
            if ($_REQUEST['first']) {
                $sql .= "AND UPPER(s.FIRST_NAME) LIKE '" . strtoupper($_REQUEST['first']) . "%' ";
            }
            if ($_REQUEST['profile']) {
                $sql .= "AND s.PROFILE='" . $_REQUEST['profile'] . "' ";
            }
            $sql .= $extra['WHERE'] . ' ';
            $sql .= "ORDER BY FULL_NAME";
            if ($extra['functions']) {
                $functions += $extra['functions'];
            }
            return DBGet(DBQuery($sql), $functions);
            break;
    }
}
开发者ID:SoftScape,项目名称:opensis,代码行数:32,代码来源:GetStaffList.fnc.php

示例5: _makeCalendar

function _makeCalendar($value, $column)
{
    global $THIS_RET, $_CENTRE, $calendars_RET;
    if (!$calendars_RET) {
        $calendars_RET = DBGet(DBQuery("SELECT CALENDAR_ID,DEFAULT_CALENDAR,TITLE FROM ATTENDANCE_CALENDARS WHERE SYEAR='" . UserSyear() . "'"), array(), array('CALENDAR_ID'));
    }
    return $calendars_RET[$value][1]['TITLE'];
}
开发者ID:linil,项目名称:centreSIS,代码行数:8,代码来源:miscExport.fnc.php

示例6: _makeCalendar

function _makeCalendar($value, $column)
{
    global $THIS_RET, $_openSIS, $calendars_RET;
    if (!$calendars_RET) {
        $calendars_RET = DBGet(DBQuery('SELECT CALENDAR_ID,DEFAULT_CALENDAR,TITLE FROM school_calendars WHERE SYEAR=\'' . UserSyear() . '\''), array(), array('CALENDAR_ID'));
    }
    return $calendars_RET[$value][1]['TITLE'];
}
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:8,代码来源:MiscExportFnc.php

示例7: GetTeacher

function GetTeacher($teacher_id, $title = '', $column = 'FULL_NAME', $schools = true)
{
    global $_openSIS;
    if (!$_openSIS['GetTeacher']) {
        $QI = DBQuery("SELECT STAFF_ID,CONCAT(LAST_NAME,', ',FIRST_NAME) AS FULL_NAME,USERNAME,PROFILE FROM STAFF WHERE SYEAR='" . UserSyear() . "'" . ($schools ? " AND SCHOOLS LIKE '%," . UserSchool() . ",%'" : ''));
        $_openSIS['GetTeacher'] = DBGet($QI, array(), array('STAFF_ID'));
    }
    return $_openSIS['GetTeacher'][$teacher_id][1][$column];
}
开发者ID:26746647,项目名称:Belize-openSIS,代码行数:9,代码来源:GetTeacher.fnc.php

示例8: GetTeacher

function GetTeacher($teacher_id, $title = '', $column = 'FULL_NAME', $schools = true)
{
    global $_CENTRE;
    if (!$_CENTRE['GetTeacher']) {
        $QI = DBQuery("SELECT STAFF_ID,LAST_NAME||', '||FIRST_NAME AS FULL_NAME,USERNAME,PROFILE FROM STAFF WHERE SYEAR='" . UserSyear() . "'" . ($schools ? " AND (SCHOOLS IS NULL OR SCHOOLS LIKE '%," . UserSchool() . ",%')" : ''));
        $_CENTRE['GetTeacher'] = DBGet($QI, array(), array('STAFF_ID'));
    }
    return $_CENTRE['GetTeacher'][$teacher_id][1][$column];
}
开发者ID:linil,项目名称:centreSIS,代码行数:9,代码来源:GetTeacher.fnc.php

示例9: GetPeriod

function GetPeriod($period_id, $title = '')
{
    global $_CENTRE;
    if (!$_CENTRE['GetPeriod']) {
        $sql = "SELECT TITLE, PERIOD_ID FROM SCHOOL_PERIODS WHERE SYEAR='" . UserSyear() . "'";
        $_CENTRE['GetPeriod'] = DBGet(DBQuery($sql), array(), array('PERIOD_ID'));
    }
    return $_CENTRE['GetPeriod'][$period_id][1]['TITLE'];
}
开发者ID:SoftScape,项目名称:opensis,代码行数:9,代码来源:GetPeriod.fnc.php

示例10: UpdateSchoolArray

function UpdateSchoolArray($school_id = null)
{
    if (!$school_id) {
        $school_id = UserSyear();
    }
    $_SESSION['SchoolData'] = DBGet(DBQuery("SELECT * FROM SCHOOLS WHERE ID = '" . $school_id . "' AND SYEAR = '" . UserSyear() . "'"));
    $_SESSION['SchoolData'] = $_SESSION['SchoolData'][1];
    $_SESSION['SchoolData'];
}
开发者ID:linil,项目名称:centreSIS,代码行数:9,代码来源:School.fnc.php

示例11: GetPeriod

function GetPeriod($period_id, $title = '')
{
    global $_openSIS;
    if (!$_openSIS['GetPeriod']) {
        $sql = 'SELECT TITLE, PERIOD_ID FROM school_periods WHERE SYEAR=\'' . UserSyear() . '\'';
        $_openSIS['GetPeriod'] = DBGet(DBQuery($sql), array(), array('PERIOD_ID'));
    }
    return $_openSIS['GetPeriod'][$period_id][1]['TITLE'];
}
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:9,代码来源:GetPeriodFnc.php

示例12: GetTeacher

function GetTeacher($teacher_id, $title = '', $column = 'FULL_NAME', $schools = true)
{
    global $_openSIS;
    if (!$_openSIS['GetTeacher']) {
        $QI = DBQuery('SELECT STAFF_ID,CONCAT(LAST_NAME,\', \',FIRST_NAME) AS FULL_NAME,USERNAME,PROFILE FROM staff s INNER JOIN staff_school_relationship USING(staff_id),login_authentication la WHERE s.STAFF_ID=la.USER_ID AND s.PROFILE=\'teacher\' AND syear=' . UserSyear());
        $_openSIS['GetTeacher'] = DBGet($QI, array(), array('STAFF_ID'));
    }
    return $_openSIS['GetTeacher'][$teacher_id][1][$column];
}
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:9,代码来源:GetTeacherFnc.php

示例13: UpdateSchoolArray

function UpdateSchoolArray($school_id = null)
{
    if (!$school_id) {
        $school_id = UserSchool();
    }
    $_SESSION['SchoolData'] = DBGet(DBQuery("SELECT * FROM SCHOOLS WHERE ID = '" . $school_id . "' AND SYEAR = '" . UserSyear() . "'"));
    $_SESSION['SchoolData'] = $_SESSION['SchoolData'][1];
    //modif Francois: if only one school, no Search All Schools option
    $schools_nb = DBGet(DBQuery("SELECT COUNT(*) AS SCHOOLS_NB FROM SCHOOLS WHERE SYEAR = '" . UserSyear() . "';"));
    $_SESSION['SchoolData']['SCHOOLS_NB'] = $schools_nb[1]['SCHOOLS_NB'];
    $_SESSION['SchoolData'];
}
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:12,代码来源:School.fnc.php

示例14: GetCurrentMP

function GetCurrentMP($mp, $date, $error = true)
{
    global $_ROSARIO;
    if (!$_ROSARIO['GetCurrentMP'][$date][$mp]) {
        $_ROSARIO['GetCurrentMP'][$date][$mp] = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM SCHOOL_MARKING_PERIODS WHERE MP='{$mp}' AND '{$date}' BETWEEN START_DATE AND END_DATE AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
    }
    if ($_ROSARIO['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID']) {
        return $_ROSARIO['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID'];
    } elseif ($error) {
        ErrorMessage(array(_('You are not currently in a marking period')), 'fatal');
    }
}
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:12,代码来源:GetMP.fnc.php

示例15: _makeLetterGrade

function _makeLetterGrade($percent, $course_period_id = 0, $staff_id = 0, $ret = 'TITLE')
{
    global $programconfig, $_ROSARIO;
    if (!$course_period_id) {
        $course_period_id = UserCoursePeriod();
    }
    if (!$staff_id) {
        $staff_id = User('STAFF_ID');
    }
    if (!$programconfig[$staff_id]) {
        $config_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_USER_CONFIG WHERE USER_ID='" . $staff_id . "' AND PROGRAM='Gradebook'"), array(), array('TITLE'));
        if (count($config_RET)) {
            foreach ($config_RET as $title => $value) {
                $programconfig[$staff_id][$title] = $value[1]['VALUE'];
            }
        } else {
            $programconfig[$staff_id] = true;
        }
    }
    if (!$_ROSARIO['_makeLetterGrade']['courses'][$course_period_id]) {
        $_ROSARIO['_makeLetterGrade']['courses'][$course_period_id] = DBGet(DBQuery("SELECT DOES_BREAKOFF,GRADE_SCALE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $course_period_id . "'"));
    }
    $does_breakoff = $_ROSARIO['_makeLetterGrade']['courses'][$course_period_id][1]['DOES_BREAKOFF'];
    $grade_scale_id = $_ROSARIO['_makeLetterGrade']['courses'][$course_period_id][1]['GRADE_SCALE_ID'];
    $percent *= 100;
    if ($does_breakoff == 'Y') {
        if ($programconfig[$staff_id]['ROUNDING'] == 'UP') {
            $percent = ceil($percent);
        } elseif ($programconfig[$staff_id]['ROUNDING'] == 'DOWN') {
            $percent = floor($percent);
        } elseif ($programconfig[$staff_id]['ROUNDING'] == 'NORMAL') {
            $percent = round($percent);
        }
    } else {
        $percent = round($percent);
    }
    // school default
    if ($ret == '%') {
        return $percent;
    }
    if (!$_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id]) {
        $_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id] = DBGet(DBQuery("SELECT TITLE,ID,BREAK_OFF,COMMENT FROM REPORT_CARD_GRADES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND GRADE_SCALE_ID='{$grade_scale_id}' ORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER"));
    }
    //$grades = array('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-','F');
    foreach ($_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id] as $grade) {
        if ($does_breakoff == 'Y' ? $percent >= $programconfig[$staff_id][$course_period_id . '-' . $grade['ID']] && is_numeric($programconfig[$staff_id][$course_period_id . '-' . $grade['ID']]) : $percent >= $grade['BREAK_OFF']) {
            //modif Francois: use Report Card Grades comments
            //return $ret=='ID' ? $grade['ID'] : $grade['TITLE'];
            return $grade[$ret];
        }
    }
}
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:52,代码来源:_makeLetterGrade.fnc.php


注:本文中的UserSyear函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。