コード例 #1
0
ファイル: functionLib.php プロジェクト: knichel/AIT
function getSMSStudentAttendanceDetail($sid, $yid, $ecid)
{
    global $db;
    global $_CONF;
    $schoolYearInfo = get_school_year_info($yid, $ecid);
    $start = $schoolYearInfo['startOfYear'];
    $end = $schoolYearInfo['endOfYear'];
    $result = get_user_info($sid);
    $row = $result->fetch_assoc();
    $STGUID = $row['STGUID'];
    $minutes = 0;
    $sql = "SELECT LOWER(cast(AbsTransactions.STGUID as nvarchar(36))) as STGUID,\r\n                AbsTransactions.AbsType as status,\r\n                convert(VARCHAR(19), AbsDate, 120) as date,\r\n                AbsTransactions.Comment as note,\r\n                AbsTransactions.ExtraHours as minutes,\r\n                ClassbyTeacher.tsn as courseName\r\n            FROM AbsTransactions, ClassByTeacher\r\n            WHERE AbsTransactions.STGUID = '" . $STGUID . "'\r\n                AND AbsTransactions.AbsDate between '" . $start . "' and '" . $end . "'\r\n                AND ClassByTeacher.SectionID=AbsTransactions.SectionID\r\n            ORDER by date asc";
    $result = queryMSsql($sql);
    $retArray = array();
    while ($date = mssql_fetch_assoc($result)) {
        $minutes = $date['minutes'];
        //$addEntry = false;
        list($d, $t) = preg_split("/ /", $date['date']);
        list($y, $m, $d) = preg_split("/-/", $d);
        $ab = date("M j, Y", mktime(0, 0, 0, $m, $d, $y));
        $note = $code = "";
        if ($date['status'] == 'Present') {
            //continue;
            $addEntry = true;
            $code .= 'P';
        }
        if ($date['status'] == 'Unexcused-Abs') {
            $addEntry = true;
        }
        if ($date['status'] == 'Tardy') {
            $addEntry = true;
            $code .= 'T';
        }
        if ($date['status'] == 'Excused-Abs' || $date['status'] == 'Home School Closed/Delayed' || $date['status'] == 'Questar Closed/Delayed' || $date['status'] == 'Community Service') {
            $addEntry = true;
            $code .= "EX";
        }
        if ($date['status'] == 'Suspended') {
            $addEntry = true;
            $code .= "S";
        }
        if ($date['status'] == 'WBL-Absent') {
            $addEntry = true;
            $code .= "WBL";
        }
        if ($date['note'] != '') {
            $addEntry = true;
            $note = " " . $date['note'];
        }
        if ($addEntry) {
            $abDate = array($ab => array('code' => $code, 'note' => $note, 'minutes' => $minutes, 'type' => $date['status'], 'class' => $date['courseName']));
            $retArray[$date['date']] = $abDate;
        }
    }
    //$retArray['minutes'] = $minutes;
    return $retArray;
}
コード例 #2
0
ファイル: teach_wbl.php プロジェクト: knichel/AIT
**/
include '../_includeSessionConfig.php';
$error = false;
$msg = "Messages:<br />";
$newWBL = "";
if ($_SESSION[$_CONF['sess_name'] . '_isTeacher']) {
    $classID = -1;
    /** default value ie none selected **/
    $term_start = "";
    $term_end = "";
    $sy = $sm = $sd = $ey = $em = $ed = '';
    if (isset($_SESSION[$_CONF['sess_name'] . '_selected_course'])) {
        $courseID = $_SESSION[$_CONF['sess_name'] . '_selected_course'];
    }
    $schoolYearID = $_SESSION[$_CONF['sess_name'] . '_current_school_year'];
    $schoolYearInfo = get_school_year_info($schoolYearID, $_SESSION[$_CONF['sess_name'] . '_myCenter']);
    $start = $schoolYearInfo['startOfYear'];
    $end = $schoolYearInfo['endOfYear'];
    list($sy, $sm, $sd) = preg_split("/-/", $start);
    list($ey, $em, $ed) = preg_split("/-/", $end);
    if (isset($_POST['addNewWBL'])) {
        $newWBL .= "\n\t\t<script type='text/javascript'>";
        if (isset($_POST['numWBL'])) {
            $numWBL = $_POST['numWBL'];
        }
        $newWBL .= "\n\t\t\t\$(document).ready(\n\t\t\t  function() {";
        for ($i = 1; $i <= $numWBL; $i++) {
            $newWBL .= "\n\t\t\t\t  \$('input#wbl_" . $i . "_date').datepick({\n                    dateFormat: 'yyyy-mm-dd',\n                    minDate: new Date(" . $sy . ", " . ($sm - 1) . ", " . $sd . "),\n                    maxDate: new Date(" . $ey . ", " . ($em - 1) . ", " . $ed . "),\n                    monthsToShow: 3,monthsToStep: 3, monthsOffset: 1,\n                    multiSelect:25,\n                    onDate: \$.datepick.noWeekends,\n                    showTrigger: '#callImg'\n\t\t\t\t  }),\n\t\t\t  ";
        }
        $newWBL .= "\n\t\t\t  \$('#newWBLForm').validationEngine()\n\t\t\t});\n\t\t</script>\n\t\t";
        $msg .= "Adding Jobs";