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


PHP DBDate函数代码示例

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


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

示例1: 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

示例2: UpdateAttendanceDaily

function UpdateAttendanceDaily($student_id, $date = '', $comment = false)
{
    if (!$date) {
        $date = DBDate();
    }
    $sql = "SELECT\r\n\t\t\t\tsum(sp.LENGTH) AS TOTAL\r\n\t\t\tFROM SCHEDULE s,COURSE_PERIODS cp,SCHOOL_PERIODS sp,ATTENDANCE_CALENDAR ac\r\n\t\t\tWHERE\r\n\t\t\t\ts.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND cp.DOES_ATTENDANCE='Y'\r\n\t\t\t\tAND ac.SCHOOL_DATE='{$date}' AND (ac.BLOCK=sp.BLOCK OR sp.BLOCK IS NULL)\r\n\t\t\t\tAND ac.CALENDAR_ID=cp.CALENDAR_ID AND ac.SCHOOL_ID=s.SCHOOL_ID AND ac.SYEAR=s.SYEAR\r\n\t\t\t\tAND s.SYEAR = cp.SYEAR AND sp.PERIOD_ID = cp.PERIOD_ID\r\n\t\t\t\tAND position(substring('UMTWHFS' FROM DAYOFWEEK('{$date}')  FOR 1) IN cp.DAYS)>0\r\n\t\t\t\tAND s.STUDENT_ID='{$student_id}'\r\n\t\t\t\tAND s.SYEAR='" . UserSyear() . "'\r\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))\r\n\t\t\t\tAND s.MARKING_PERIOD_ID IN (" . GetAllMP('QTR', GetCurrentMP('QTR', $date)) . ")\r\n\t\t\t";
    $RET = DBGet(DBQuery($sql));
    $total = $RET[1]['TOTAL'];
    if ($total == 0) {
        return;
    }
    $sql = "SELECT sum(sp.LENGTH) AS TOTAL\r\n\t\t\tFROM ATTENDANCE_PERIOD ap,SCHOOL_PERIODS sp,ATTENDANCE_CODES ac\r\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'\r\n\t\t\tAND sp.SYEAR='" . UserSyear() . "'";
    $RET = DBGet(DBQuery($sql));
    $total -= $RET[1]['TOTAL'];
    $sql = "SELECT sum(sp.LENGTH) AS TOTAL\r\n\t\t\tFROM ATTENDANCE_PERIOD ap,SCHOOL_PERIODS sp,ATTENDANCE_CODES ac\r\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'\r\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';
    */
    if (stripos($_SERVER['SERVER_SOFTWARE'], 'linux')) {
        $comment = str_replace("'", "\\'", $comment);
    }
    $sys_pref = DBGet(DBQuery("SELECT * FROM SYSTEM_PREFERENCE WHERE SCHOOL_ID=" . UserSchool()));
    $fdm = $sys_pref[1]['FULL_DAY_MINUTE'];
    $hdm = $sys_pref[1]['HALF_DAY_MINUTE'];
    if ($total >= $fdm) {
        $length = '1.0';
    } elseif ($total >= $hdm) {
        $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:26746647,项目名称:Belize-openSIS,代码行数:47,代码来源:Attendance.php

示例3: UpdateAttendanceDaily

function UpdateAttendanceDaily($student_id, $date = '', $comment = false)
{
    if (!$date) {
        $date = DBDate();
    }
    //modif Francois: days numbered
    //modif Francois: multiple school periods for a course period
    if (SchoolInfo('NUMBER_DAYS_ROTATION') !== null) {
        $sql = "SELECT\n\t\t\t\t\tsum(sp.LENGTH) AS TOTAL\n\t\t\t\tFROM SCHEDULE s,COURSE_PERIODS cp,SCHOOL_PERIODS sp,ATTENDANCE_CALENDAR ac, COURSE_PERIOD_SCHOOL_PERIODS cpsp \n\t\t\t\tWHERE \n\t\t\t\t\tcp.COURSE_PERIOD_ID=cpsp.COURSE_PERIOD_ID AND\n\t\t\t\t\ts.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND position(',0,' IN cp.DOES_ATTENDANCE)>0\n\t\t\t\t\tAND ac.SCHOOL_DATE='{$date}' AND (ac.BLOCK=sp.BLOCK OR sp.BLOCK IS NULL)\n\t\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\t\tAND s.SYEAR = cp.SYEAR AND sp.PERIOD_ID = cpsp.PERIOD_ID\n\t\t\t\t\tAND position(substring('MTWHFSU' FROM cast((SELECT CASE COUNT(school_date)% " . SchoolInfo('NUMBER_DAYS_ROTATION') . " WHEN 0 THEN " . SchoolInfo('NUMBER_DAYS_ROTATION') . " ELSE COUNT(school_date)% " . SchoolInfo('NUMBER_DAYS_ROTATION') . " END AS day_number FROM attendance_calendar WHERE school_date>=(SELECT start_date FROM school_marking_periods WHERE start_date<='{$date}' AND end_date>='{$date}' AND mp='QTR') AND school_date<='{$date}') AS INT) FOR 1) IN cpsp.DAYS)>0\n\t\t\t\t\tAND s.STUDENT_ID='{$student_id}'\n\t\t\t\t\tAND s.SYEAR='" . UserSyear() . "'\n\t\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\t\tAND s.MARKING_PERIOD_ID IN (" . GetAllMP('QTR', GetCurrentMP('QTR', $date)) . ")\n\t\t\t\t";
    } else {
        $sql = "SELECT\n\t\t\t\t\tsum(sp.LENGTH) AS TOTAL\n\t\t\t\tFROM SCHEDULE s,COURSE_PERIODS cp,SCHOOL_PERIODS sp,ATTENDANCE_CALENDAR ac, COURSE_PERIOD_SCHOOL_PERIODS cpsp \n\t\t\t\tWHERE \n\t\t\t\t\tcp.COURSE_PERIOD_ID=cpsp.COURSE_PERIOD_ID AND\n\t\t\t\t\ts.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND position(',0,' IN cp.DOES_ATTENDANCE)>0\n\t\t\t\t\tAND ac.SCHOOL_DATE='{$date}' AND (ac.BLOCK=sp.BLOCK OR sp.BLOCK IS NULL)\n\t\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\t\tAND s.SYEAR = cp.SYEAR AND sp.PERIOD_ID = cpsp.PERIOD_ID\n\t\t\t\t\tAND position(substring('UMTWHFS' FROM cast(extract(DOW FROM cast('{$date}' AS DATE)) AS INT)+1 FOR 1) IN cpsp.DAYS)>0\n\t\t\t\t\tAND s.STUDENT_ID='{$student_id}'\n\t\t\t\t\tAND s.SYEAR='" . UserSyear() . "'\n\t\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\t\tAND s.MARKING_PERIOD_ID IN (" . GetAllMP('QTR', GetCurrentMP('QTR', $date)) . ")\n\t\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 >= Config('ATTENDANCE_FULL_DAY_MINUTES')) {
        $length = '1.0';
    } elseif ($total >= Config('ATTENDANCE_FULL_DAY_MINUTES') / 2) {
        $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='" . $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='" . $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) . "','" . $comment . "')");
    }
}
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:39,代码来源:Attendance.php

示例4: UserCoursePeriod

     }
     if ($_REQUEST['room']) {
         $extra['SELECT'] .= ',(SELECT cp.ROOM FROM course_periods cp WHERE cp.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\') AS ROOM';
     }
 }
 $RET = GetStuList($extra);
 if (count($RET)) {
     $skipRET = array();
     for ($i = ($_REQUEST['start_row'] - 1) * $max_cols + $_REQUEST['start_col']; $i > 1; $i--) {
         $skipRET[-$i] = array('LAST_NAME' => ' ');
     }
     $handle = PDFstart();
     $cols = 0;
     $rows = 0;
     echo "<meta charset='UTF-8'><table width=100%  border=0 style=\" font-family:Arial; font-size:12px;\" >";
     echo "<meta charset='UTF-8'><tr><td width=105>" . DrawLogo() . "</td><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">" . _('Student Labels') . "</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br \\>" . _('Powered by openSIS') . "</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
     echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" style=font-family:Arial; font-size:12px;>';
     foreach ($skipRET + $RET as $i => $student) {
         if ($cols < 1) {
             echo '<tr>';
         }
         echo '<td width="33.3%" height="86" align="center" valign="middle">';
         echo '<table border=0 align=center>';
         echo '<tr>';
         echo '<td align=center>' . $student['NICK_NAME'] . ' ' . $student['LAST_NAME'] . '</td></tr>';
         if ($_REQUEST['teacher']) {
             echo '<tr><td align=center>' . _('Teacher') . ':';
             echo '' . $student['TEACHER'] . '</td></tr>';
         }
         if ($_REQUEST['room']) {
             echo '<tr><td align=center>' . _('Room No :') . '';
开发者ID:SysBind,项目名称:opensis-ml,代码行数:31,代码来源:StudentLabels.php

示例5: DBGet

        if (count($_SESSION['FSA_sale'])) {
            $items_RET = DBGet(DBQuery("SELECT DESCRIPTION,SHORT_NAME,PRICE_STAFF FROM FOOD_SERVICE_ITEMS WHERE SCHOOL_ID='" . UserSchool() . "'"), array(), array('SHORT_NAME'));
            // get next transaction id
            $id = DBGet(DBQuery('SELECT ' . db_seq_nextval('FOOD_SERVICE_STAFF_TRANSACTIONS_SEQ') . ' AS SEQ_ID ' . FROM_DUAL));
            $id = $id[1]['SEQ_ID'];
            $item_id = 0;
            foreach ($_SESSION['FSA_sale'] as $item_sn) {
                $price = $items_RET[$item_sn][1]['PRICE_STAFF'];
                $fields = 'ITEM_ID,TRANSACTION_ID,AMOUNT,SHORT_NAME,DESCRIPTION';
                $values = "'" . $item_id++ . "','" . $id . "','-" . $price . "','" . $items_RET[$item_sn][1]['SHORT_NAME'] . "','" . $items_RET[$item_sn][1]['DESCRIPTION'] . "'";
                $sql = "INSERT INTO FOOD_SERVICE_STAFF_TRANSACTION_ITEMS (" . $fields . ") values (" . $values . ")";
                DBQuery($sql);
            }
            $sql1 = "UPDATE FOOD_SERVICE_STAFF_ACCOUNTS SET TRANSACTION_ID='" . $id . "',BALANCE=BALANCE+(SELECT sum(AMOUNT) FROM FOOD_SERVICE_STAFF_TRANSACTION_ITEMS WHERE TRANSACTION_ID='" . $id . "') WHERE STAFF_ID='" . UserStaffID() . "'";
            $fields = 'TRANSACTION_ID,STAFF_ID,SYEAR,SCHOOL_ID,BALANCE,TIMESTAMP,SHORT_NAME,DESCRIPTION,SELLER_ID';
            $values = "'" . $id . "','" . UserStaffID() . "','" . UserSyear() . "','" . UserSchool() . "',(SELECT BALANCE FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID='" . UserStaffID() . "'),CURRENT_TIMESTAMP,'" . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . "','" . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . ' - ' . DBDate() . "','" . User('STAFF_ID') . "'";
            $sql2 = 'INSERT INTO FOOD_SERVICE_STAFF_TRANSACTIONS (' . $fields . ') values (' . $values . ')';
            DBQuery('BEGIN; ' . $sql1 . '; ' . $sql2 . '; COMMIT');
            unset($_SESSION['FSA_sale']);
        }
        unset($_REQUEST['modfunc']);
    } else {
        unset($_REQUEST['modfunc']);
    }
    unset($_REQUEST['submit']);
}
if (UserStaffID() && !$_REQUEST['modfunc']) {
    $staff = DBGet(DBQuery("SELECT s.STAFF_ID,s.FIRST_NAME||' '||s.LAST_NAME AS FULL_NAME,(SELECT STAFF_ID FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS ACCOUNT_ID,(SELECT BALANCE FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS BALANCE FROM STAFF s WHERE s.STAFF_ID='" . UserStaffID() . "'"));
    $staff = $staff[1];
    echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=submit&menu_id={$_REQUEST['menu_id']} method=POST>";
    DrawHeader('', SubmitButton(_('Cancel Sale'), 'submit[cancel]') . SubmitButton(_('Complete Sale'), 'submit[save]'));
开发者ID:linil,项目名称:centreSIS,代码行数:31,代码来源:ServeMenus.php

示例6: strtoupper

 }
 if ($_REQUEST[stuid]) {
     $sql .= "AND ssm.STUDENT_ID='{$_REQUEST['stuid']}' ";
 }
 if ($_REQUEST[first]) {
     $sql .= "AND s.FIRST_NAME LIKE '" . strtoupper($_REQUEST[first]) . "%' ";
 }
 if ($_REQUEST[last]) {
     $sql .= "AND s.LAST_NAME LIKE '" . strtoupper($_REQUEST[last]) . "%' ";
 }
 $sql .= "ORDER BY s.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME ";
 $QI = DBQuery($sql);
 $stubilling_RET = DBGet($QI, array('FIRST_NAME' => 'GetCapWords', 'LAST_NAME' => 'GetCapWords'));
 $debits_table = 'STU_BILLING_ACT_LUNCH';
 $credits_cond = " LUNCH_PAYMENT='Y' ";
 $lunch_title = '<B>Lunch Purchases and Payments</B><BR>School Year: ' . DispYear($_REQUEST[year]) . '<BR>as of ' . ProperDate(DBDate());
 $sql = "SELECT ssm.STUDENT_ID,ssm.SCHOOL,s.FIRST_NAME,s.LAST_NAME,s.MIDDLE_NAME ";
 if (($_REQUEST[balance_low] || $_REQUEST[balance_low] === '0') && ($_REQUEST[balance_high] || $_REQUEST[balance_high] === '0')) {
     $sql .= ",(SELECT COALESCE((SELECT sum(AMOUNT) FROM STU_BILLING_ACT WHERE STUDENT_ID=ssm.STUDENT_ID AND {$credits_cond}),0) -\n\t\t\t\tCOALESCE((SELECT sum(AMOUNT) FROM {$debits_table} WHERE STUDENT_ID=ssm.STUDENT_ID),0) " . FROM_DUAL . ") as BALANCE ";
 }
 $sql .= "FROM STU_SCHOOL_MEETS ssm,STUDENTS s\n\t\t\tWHERE ssm.SYEAR='{$_REQUEST['year']}' AND s.STUDENT_ID=ssm.STUDENT_ID ";
 if (($_REQUEST[balance_low] || $_REQUEST[balance_low] === '0') && ($_REQUEST[balance_high] || $_REQUEST[balance_high] === '0')) {
     $sql .= "AND (SELECT COALESCE((SELECT sum(AMOUNT) FROM STU_BILLING_ACT WHERE STUDENT_ID=ssm.STUDENT_ID AND {$credits_cond}),0) -\n\t\t\t\tCOALESCE((SELECT sum(AMOUNT) FROM {$debits_table} WHERE STUDENT_ID=ssm.STUDENT_ID),0) " . FROM_DUAL . ")\n\t\t\t\t BETWEEN '{$_REQUEST['balance_low']}' AND '{$_REQUEST['balance_high']}' ";
 }
 if ($_REQUEST[not_zero] == 'Y') {
     $sql .= "AND (SELECT COALESCE((SELECT sum(AMOUNT) FROM STU_BILLING_ACT WHERE STUDENT_ID=ssm.STUDENT_ID AND {$credits_cond}),0) -\n\t\t\t\tCOALESCE((SELECT sum(AMOUNT) FROM {$debits_table} WHERE STUDENT_ID=ssm.STUDENT_ID),0) " . FROM_DUAL . ")\n\t\t\t\t != '0' ";
 }
 if ($_REQUEST[sch]) {
     $sql .= "AND ssm.SCHOOL='{$_REQUEST['sch']}' ";
 }
 if ($_REQUEST[grade]) {
开发者ID:SoftScape,项目名称:opensis,代码行数:31,代码来源:Invoices.php

示例7: DBGet

    $RET = DBGet(DBQuery("SELECT sju.STUDENT_ID, CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME,se.SCHOOL_ID FROM students s,students_join_users sju, student_enrollment se WHERE s.STUDENT_ID=sju.STUDENT_ID AND sju.STAFF_ID='" . User('STAFF_ID') . "' AND se.SYEAR=" . UserSyear() . " AND se.STUDENT_ID=sju.STUDENT_ID AND (('" . DBDate() . "' BETWEEN se.START_DATE AND se.END_DATE OR se.END_DATE IS NULL) AND '" . DBDate() . "'>=se.START_DATE)"));
    if (!UserStudentID()) {
        $_SESSION['student_id'] = $RET[1]['STUDENT_ID'];
    }
    echo "<SELECT name=student_id onChange='document.forms[0].submit();'>";
    if (count($RET)) {
        foreach ($RET as $student) {
            echo "<OPTION value={$student['STUDENT_ID']}" . (UserStudentID() == $student['STUDENT_ID'] ? ' SELECTED' : '') . ">" . $student['FULL_NAME'] . "</OPTION>";
            if (UserStudentID() == $student['STUDENT_ID']) {
                $_SESSION['UserSchool'] = $student['SCHOOL_ID'];
            }
        }
    }
    echo "</SELECT><BR>";
    if (!UserMP()) {
        $_SESSION['UserMP'] = GetCurrentMP('QTR', DBDate());
    }
}
if (User('PROFILE') == 'teacher') {
    /*
    	//if(UserMP())
    	//	$QI = DBQuery("SELECT DISTINCT cp.PERIOD_ID,cp.COURSE_PERIOD_ID,sp.TITLE,sp.SHORT_NAME,cp.MARKING_PERIOD_ID,cp.DAYS,cp.SCHOOL_ID,sp.SORT_ORDER,c.TITLE AS COURSE_TITLE FROM course_periods cp, school_periods sp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR='".UserSyear()."' AND cp.TEACHER_ID='".User('STAFF_ID')."' AND cp.MARKING_PERIOD_ID IN (".GetAllMP('QTR',UserMP()).") ORDER BY sp.SORT_ORDER ");
    	//else
    	$QI = DBQuery("SELECT DISTINCT cp.PERIOD_ID,cp.COURSE_PERIOD_ID,sp.TITLE,sp.SHORT_NAME,cp.MARKING_PERIOD_ID,cp.DAYS,cp.SCHOOL_ID,sp.SORT_ORDER,c.TITLE AS COURSE_TITLE FROM course_periods cp, school_periods sp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR='".UserSyear()."' AND cp.TEACHER_ID='".User('STAFF_ID')."' ORDER BY sp.SORT_ORDER");
    	$RET = DBGet($QI);
    	// get the fy marking period id's, there should be exactly one fy marking period per school
    	$fy_RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,SCHOOL_ID FROM school_years WHERE SYEAR='".UserSyear()."'"),array(),array('SCHOOL_ID'));
    	// only need quarters and semesters since years are suppressed and progress_periods aren't used
    	$mp_RET  = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE,SHORT_NAME FROM school_quarters  WHERE SYEAR='".UserSyear()."'
    			UNION     SELECT MARKING_PERIOD_ID,TITLE,SHORT_NAME FROM school_semesters WHERE SYEAR='".UserSyear()."'"),array(),array('MARKING_PERIOD_ID'));
    
开发者ID:SysBind,项目名称:opensis-ml,代码行数:30,代码来源:Side.php

示例8: CONCAT

 				(select CONCAT(LAST_NAME,' ',FIRST_NAME,' ',MIDDLE_NAME,' ') from staff where staff_id=course_periods.teacher_id) as teacher, 
 				room as location,days,course_period_id,course_id
 				from course_periods where school_id='".UserSchool()."' and syear='".UserSyear()."' ".$where." order by subject,COURSE_TITLE";
 				
                                 
 
 			$ret = DBGet(DBQuery($sql));
                  * 
                  */
 $sql_subject = 'SELECT SUBJECT_ID,TITLE FROM  course_subjects WHERE
                                     SCHOOL_ID=' . UserSchool() . ' AND SYEAR= ' . UserSyear();
 $sql_subject_ret = DBGet(DBQuery($sql_subject));
 if (count($sql_subject_ret)) {
     foreach ($sql_subject_ret as $subject) {
         echo "<table width=100%  style=\" font-family:Arial; font-size:12px;\" >";
         echo "<tr><td width=105>" . DrawLogo() . "</td><td  style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">All Courses</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\">&nbsp;</td></tr></table>";
         echo '<table border="0" width="100%" align="center"><tr><td><font face=verdana size=-1><b>' . $subject['TITLE'] . '</b></font></td></tr><tr>';
         $sql_course = 'SELECT COURSE_ID,TITLE FROM  courses WHERE
                                     SCHOOL_ID=' . UserSchool() . ' AND SYEAR= ' . UserSyear() . ' AND SUBJECT_ID=' . $subject['SUBJECT_ID'];
         $sql_course_ret = DBGet(DBQuery($sql_course));
         foreach ($sql_course_ret as $course) {
             echo '<table border="0"><tr><td style=padding-left:40px;><font face=verdana size=-1><b>' . $course['TITLE'] . '</b></font></td></tr></table>';
             $sql_course_period = 'SELECT TITLE FROM  course_periods WHERE
                                     SCHOOL_ID=' . UserSchool() . ' AND SYEAR= ' . UserSyear() . ' AND COURSE_ID=' . $course['COURSE_ID'];
             $sql_course_period_ret = DBGet(DBQuery($sql_course_period));
             foreach ($sql_course_period_ret as $course_period) {
                 echo '<table border="0" width="100%"><tr><td style=padding-left:80px;><font face=verdana size=-1><b>' . $course_period['TITLE'] . '</b></font></td></tr></table>';
             }
         }
         echo '</tr><tr><td colspan="2" valign="top" align="right">';
         echo '</td></tr></table>';
开发者ID:26746647,项目名称:openSIS,代码行数:31,代码来源:PrintAllCourses.php

示例9: GetStuList

function GetStuList(&$extra = array())
{
    global $contacts_RET, $view_other_RET, $_ROSARIO;
    if ((empty($extra['SELECT_ONLY']) || mb_strpos($extra['SELECT_ONLY'], 'GRADE_ID') !== false) && !isset($extra['functions']['GRADE_ID'])) {
        $functions = array('GRADE_ID' => 'GetGrade');
    } else {
        $functions = array();
    }
    if (isset($extra['functions'])) {
        $functions += $extra['functions'];
    }
    if (!isset($extra['MP']) && !isset($extra['DATE'])) {
        $extra['MP'] = UserMP();
        $extra['DATE'] = DBDate();
    } elseif (!$extra['MP']) {
        $extra['MP'] = GetCurrentMP('QTR', $extra['DATE'], false);
    } elseif (!$extra['DATE']) {
        $extra['DATE'] = DBDate();
    }
    if (isset($_REQUEST['expanded_view']) && $_REQUEST['expanded_view'] == 'true') {
        if (!$extra['columns_after']) {
            $extra['columns_after'] = array();
        }
        $view_fields_RET = DBGet(DBQuery("SELECT cf.ID,cf.TYPE,cf.TITLE FROM CUSTOM_FIELDS cf WHERE ((SELECT VALUE FROM PROGRAM_USER_CONFIG WHERE TITLE=cast(cf.ID AS TEXT) AND PROGRAM='StudentFieldsView' AND USER_ID='" . User('STAFF_ID') . "')='Y'" . ($extra['student_fields']['view'] ? " OR cf.ID IN (" . $extra['student_fields']['view'] . ")" : '') . ") ORDER BY cf.SORT_ORDER,cf.TITLE"));
        $view_address_RET = DBGet(DBQuery("SELECT VALUE FROM PROGRAM_USER_CONFIG WHERE PROGRAM='StudentFieldsView' AND TITLE='ADDRESS' AND USER_ID='" . User('STAFF_ID') . "'"));
        $view_address_RET = $view_address_RET[1]['VALUE'];
        $view_other_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_USER_CONFIG WHERE PROGRAM='StudentFieldsView' AND TITLE IN ('CONTACT_INFO','HOME_PHONE','GUARDIANS','ALL_CONTACTS') AND USER_ID='" . User('STAFF_ID') . "'"), array(), array('TITLE'));
        if (!count($view_fields_RET) && !isset($view_address_RET) && !isset($view_other_RET['CONTACT_INFO'])) {
            //modif Francois: add translation
            $extra['columns_after'] = array('CONTACT_INFO' => '<IMG SRC="assets/down_phone_button.png" width="24">', 'CUSTOM_200000000' => _('Gender'), 'CUSTOM_200000001' => _('Ethnicity'), 'ADDRESS' => _('Mailing Address'), 'CITY' => _('City'), 'STATE' => _('State'), 'ZIPCODE' => _('Zipcode')) + $extra['columns_after'];
            $select = ',ssm.STUDENT_ID AS CONTACT_INFO,s.CUSTOM_200000000,s.CUSTOM_200000001,coalesce(a.MAIL_ADDRESS,a.ADDRESS) AS ADDRESS,coalesce(a.MAIL_CITY,a.CITY) AS CITY,coalesce(a.MAIL_STATE,a.STATE) AS STATE,coalesce(a.MAIL_ZIPCODE,a.ZIPCODE) AS ZIPCODE ';
            $extra['FROM'] = " LEFT OUTER JOIN STUDENTS_JOIN_ADDRESS sam ON (ssm.STUDENT_ID=sam.STUDENT_ID AND sam.RESIDENCE='Y') LEFT OUTER JOIN ADDRESS a ON (sam.ADDRESS_ID=a.ADDRESS_ID) " . $extra['FROM'];
            $functions['CONTACT_INFO'] = 'makeContactInfo';
            $RET = DBGet(DBQuery("SELECT ID,TYPE FROM CUSTOM_FIELDS WHERE ID IN ('200000000','200000001')"), array(), array('ID'));
            // if gender and ethnicity are converted to codeds or exports type
            if ($RET['200000000'][1]['TYPE'] == 'codeds' || $RET['200000000'][1]['TYPE'] == 'exports') {
                $functions['CUSTOM_200000000'] = 'DeCodeds';
            }
            if ($RET['200000001'][1]['TYPE'] == 'codeds' || $RET['200000001'][1]['TYPE'] == 'exports') {
                $functions['CUSTOM_200000001'] = 'DeCodeds';
            }
            $extra['singular'] = 'Student Address';
            $extra['plural'] = 'Student Addresses';
            $extra2['NoSearchTerms'] = true;
            $extra2['SELECT_ONLY'] = 'ssm.STUDENT_ID,p.PERSON_ID,p.FIRST_NAME,p.LAST_NAME,sjp.STUDENT_RELATION,pjc.TITLE,pjc.VALUE,a.PHONE,sjp.ADDRESS_ID ';
            $extra2['FROM'] .= ',ADDRESS a,STUDENTS_JOIN_ADDRESS sja LEFT OUTER JOIN STUDENTS_JOIN_PEOPLE sjp ON (sja.STUDENT_ID=sjp.STUDENT_ID AND sja.ADDRESS_ID=sjp.ADDRESS_ID AND (sjp.CUSTODY=\'Y\' OR sjp.EMERGENCY=\'Y\')) LEFT OUTER JOIN PEOPLE p ON (p.PERSON_ID=sjp.PERSON_ID) LEFT OUTER JOIN PEOPLE_JOIN_CONTACTS pjc ON (pjc.PERSON_ID=p.PERSON_ID) ';
            $extra2['WHERE'] .= ' AND a.ADDRESS_ID=sja.ADDRESS_ID AND sja.STUDENT_ID=ssm.STUDENT_ID ';
            $extra2['ORDER_BY'] .= 'sjp.CUSTODY';
            $extra2['group'] = array('STUDENT_ID', 'PERSON_ID');
            // EXPANDED VIEW AND ADDR BREAKS THIS QUERY ... SO, TURN 'EM OFF
            if (!isset($_REQUEST['_ROSARIO_PDF'])) {
                $expanded_view = $_REQUEST['expanded_view'];
                $_REQUEST['expanded_view'] = false;
                $addr = $_REQUEST['addr'];
                unset($_REQUEST['addr']);
                $contacts_RET = GetStuList($extra2);
                $_REQUEST['expanded_view'] = $expanded_view;
                $_REQUEST['addr'] = $addr;
            } else {
                unset($extra2['columns_after']['CONTACT_INFO']);
            }
        } else {
            if ($view_other_RET['CONTACT_INFO'][1]['VALUE'] == 'Y' && !isset($_REQUEST['_ROSARIO_PDF'])) {
                $select .= ',ssm.STUDENT_ID AS CONTACT_INFO ';
                $extra['columns_after']['CONTACT_INFO'] = '<IMG SRC="assets/down_phone_button.png" width="24">';
                $functions['CONTACT_INFO'] = 'makeContactInfo';
                $extra2 = $extra;
                $extra2['NoSearchTerms'] = true;
                $extra2['SELECT'] = '';
                $extra2['SELECT_ONLY'] = 'ssm.STUDENT_ID,p.PERSON_ID,p.FIRST_NAME,p.LAST_NAME,sjp.STUDENT_RELATION,pjc.TITLE,pjc.VALUE,a.PHONE,sjp.ADDRESS_ID ';
                $extra2['FROM'] .= ',ADDRESS a,STUDENTS_JOIN_ADDRESS sja LEFT OUTER JOIN STUDENTS_JOIN_PEOPLE sjp ON (sja.STUDENT_ID=sjp.STUDENT_ID AND sja.ADDRESS_ID=sjp.ADDRESS_ID AND (sjp.CUSTODY=\'Y\' OR sjp.EMERGENCY=\'Y\')) LEFT OUTER JOIN PEOPLE p ON (p.PERSON_ID=sjp.PERSON_ID) LEFT OUTER JOIN PEOPLE_JOIN_CONTACTS pjc ON (pjc.PERSON_ID=p.PERSON_ID) ';
                $extra2['WHERE'] .= ' AND a.ADDRESS_ID=sja.ADDRESS_ID AND sja.STUDENT_ID=ssm.STUDENT_ID ';
                $extra2['ORDER_BY'] .= 'sjp.CUSTODY';
                $extra2['group'] = array('STUDENT_ID', 'PERSON_ID');
                $extra2['functions'] = array();
                $extra2['link'] = array();
                // EXPANDED VIEW AND ADDR BREAKS THIS QUERY ... SO, TURN 'EM OFF
                $expanded_view = $_REQUEST['expanded_view'];
                $_REQUEST['expanded_view'] = false;
                $addr = $_REQUEST['addr'];
                unset($_REQUEST['addr']);
                $contacts_RET = GetStuList($extra2);
                $_REQUEST['expanded_view'] = $expanded_view;
                $_REQUEST['addr'] = $addr;
            }
            foreach ($view_fields_RET as $field) {
                $extra['columns_after']['CUSTOM_' . $field['ID']] = $field['TITLE'];
                if ($field['TYPE'] == 'date') {
                    $functions['CUSTOM_' . $field['ID']] = 'ProperDate';
                } elseif ($field['TYPE'] == 'numeric') {
                    $functions['CUSTOM_' . $field['ID']] = 'removeDot00';
                } elseif ($field['TYPE'] == 'codeds') {
                    $functions['CUSTOM_' . $field['ID']] = 'DeCodeds';
                } elseif ($field['TYPE'] == 'exports') {
                    $functions['CUSTOM_' . $field['ID']] = 'DeCodeds';
                }
                $select .= ',s.CUSTOM_' . $field['ID'];
            }
            if ($view_address_RET) {
                $extra['FROM'] = " LEFT OUTER JOIN STUDENTS_JOIN_ADDRESS sam ON (ssm.STUDENT_ID=sam.STUDENT_ID AND sam." . $view_address_RET . "='Y') LEFT OUTER JOIN ADDRESS a ON (sam.ADDRESS_ID=a.ADDRESS_ID) " . $extra['FROM'];
//.........这里部分代码省略.........
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:101,代码来源:GetStuList.fnc.php

示例10: array

    $columns = array('TITLE' => 'Course');
    if (count($cal_RET)) {
        foreach ($cal_RET as $value) {
            $columns[$value['SHORT_DATE']] = ShortDate($value['SCHOOL_DATE']);
        }
    }
    ListOutput($student_RET, $columns, 'Course', 'Courses');
    echo '</div>';
} else {
    if (!$_REQUEST['period_id']) {
        $sql = 'SELECT ad.STATE_VALUE,ad.STUDENT_ID,SCHOOL_DATE,CONCAT(\'_\',DATE_FORMAT(ad.SCHOOL_DATE,\'%y%b%d\')) AS SHORT_DATE FROM attendance_day ad,student_enrollment ssm WHERE ad.STUDENT_ID=ssm.STUDENT_ID AND ((\'' . DBDate() . '\' BETWEEN ssm.START_DATE AND ssm.END_DATE OR ssm.END_DATE IS NULL) AND \'' . DBDate() . '\'>=ssm.START_DATE) AND ssm.SCHOOL_ID=\'' . UserSchool() . '\' AND SCHOOL_DATE BETWEEN  \'' . date('Y-m-d', strtotime($start_date)) . '\' AND \'' . date('Y-m-d', strtotime($end_date)) . '\'';
        $RET = DBGet(DBQuery($sql), array(), array('STUDENT_ID', 'SHORT_DATE'));
    } else {
        $sql = 'SELECT ap.ATTENDANCE_CODE,ap.STUDENT_ID,ap.SCHOOL_DATE,CONCAT(\'_\',DATE_FORMAT(ap.SCHOOL_DATE,\'%y%b%d\')) AS SHORT_DATE FROM attendance_period ap,student_enrollment ssm,students s WHERE s.STUDENT_ID=ssm.STUDENT_ID AND ap.STUDENT_ID=ssm.STUDENT_ID AND ap.SCHOOL_DATE BETWEEN  \'' . date('Y-m-d', strtotime($start_date)) . '\' AND \'' . date('Y-m-d', strtotime($end_date)) . '\'';
        if ($_REQUEST['include_inactive'] != 'Y') {
            $sql .= ' AND ((\'' . DBDate() . '\' BETWEEN ssm.START_DATE AND ssm.END_DATE OR ssm.END_DATE IS NULL) AND \'' . DBDate() . '\'>=ssm.START_DATE) ';
        }
        if ($_REQUEST['_search_all_schools'] != 'Y') {
            $sql .= ' AND ssm.SCHOOL_ID=\'' . UserSchool() . '\' ';
        }
        $sql = appendSQL($sql, $tmp_extra = array('NoSearchTerms' => true));
        // extra must be lvalue
        $RET = DBGet(DBQuery($sql), array(), array('STUDENT_ID', 'SHORT_DATE'));
    }
    if (count($cal_RET)) {
        foreach ($cal_RET as $value) {
            $extra['SELECT'] .= ',\'\' as _' . str_replace('-', '', $value['SCHOOL_DATE']);
            $extra['columns_after']['_' . str_replace('-', '', $value['SCHOOL_DATE'])] = ShortDate($value['SCHOOL_DATE']);
            $extra['functions']['_' . str_replace('-', '', $value['SCHOOL_DATE'])] = '_makeColor';
            $extra['link']['FULL_NAME']['link'] = "Modules.php?modname={$_REQUEST['next_modname']}&day_start={$_REQUEST['day_start']}&day_end={$_REQUEST['day_end']}&month_start={$_REQUEST['month_start']}&month_end={$_REQUEST['month_end']}&year_start={$_REQUEST['year_start']}&year_end={$_REQUEST['year_end']}&period_id={$_REQUEST['period_id']}";
            $extra['link']['FULL_NAME']['variables'] = array('student_id' => 'STUDENT_ID');
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:DailySummary_old.php

示例11: DrawBC

#  This program is released under the terms of the GNU General Public License as
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  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';
DrawBC("" . _('Attendance') . " > " . ProgramTitle());
$message = '<TABLE><TR><TD colspan=7 align=center>' . _('From') . ' ' . PrepareDate(DBDate(), '_min') . ' ' . _('to') . ' ' . PrepareDate(DBDate(), '_max') . '</TD></TR></TABLE>';
if (Prompt_Home(_('Confirm'), _('When do you want to recalculate the daily attendance?'), $message)) {
    $current_RET = DBGet(DBQuery('SELECT DISTINCT DATE_FORMAT(SCHOOL_DATE,\'%d-%m-%Y\') as SCHOOL_DATE FROM attendance_calendar WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\''), array(), array('SCHOOL_DATE'));
    $students_RET = GetStuList();
    $begin = mktime(0, 0, 0, MonthNWSwitch($_REQUEST['month_min'], 'to_num'), $_REQUEST['day_min'] * 1, $_REQUEST['year_min']) + 43200;
    $end = mktime(0, 0, 0, MonthNWSwitch($_REQUEST['month_max'], 'to_num'), $_REQUEST['day_max'] * 1, $_REQUEST['year_max']) + 43200;
    for ($i = $begin; $i <= $end; $i += 86400) {
        if ($current_RET[strtoupper(date('d-M-y', $i))]) {
            foreach ($students_RET as $student) {
                UpdateAttendanceDaily($student['STUDENT_ID'], date('d-M-y', $i));
            }
        }
    }
    unset($_REQUEST['modfunc']);
    DrawHeader('<table><tr><td><IMG SRC=assets/check.gif></td><td>' . _('The Daily Attendance for that timeframe has been recalculated.') . '</td></tr></table>');
}
开发者ID:SysBind,项目名称:opensis-ml,代码行数:31,代码来源:FixDailyAttendance.php

示例12: GetStuListAttn

function GetStuListAttn(&$extra)
{
    global $contacts_RET, $view_other_RET, $_openSIS;
    if ((!$extra['SELECT_ONLY'] || strpos($extra['SELECT_ONLY'], 'GRADE_ID') !== false) && !$extra['functions']['GRADE_ID']) {
        $functions = array('GRADE_ID' => 'GetGrade');
    } else {
        $functions = array();
    }
    if ($extra['functions']) {
        $functions += $extra['functions'];
    }
    if (!$extra['DATE']) {
        $queryMP = UserMP();
        $extra['DATE'] = DBDate();
    } else {
        $queryMP = UserMP();
    }
    if ($_REQUEST['expanded_view'] == 'true') {
        if (!$extra['columns_after']) {
            $extra['columns_after'] = array();
        }
        #############################################################################################
        //Commented as it crashing for Linux due to  Blank Database tables
        #############################################################################################
        $view_address_RET = DBGet(DBQuery('SELECT VALUE FROM program_user_config WHERE PROGRAM=\'StudentFieldsView\' AND TITLE=\'ADDRESS\' AND USER_ID=\'' . User('STAFF_ID') . '\''));
        $view_address_RET = $view_address_RET[1]['VALUE'];
        $view_other_RET = DBGet(DBQuery('SELECT TITLE,VALUE FROM program_user_config WHERE PROGRAM=\'StudentFieldsView\' AND TITLE IN (\'CONTACT_INFO\',\'HOME_PHONE\',\'GUARDIANS\',\'ALL_CONTACTS\') AND USER_ID=\'' . User('STAFF_ID') . '\''), array(), array('TITLE'));
        if (!count($view_fields_RET) && !isset($view_address_RET) && !isset($view_other_RET['CONTACT_INFO'])) {
            $extra['columns_after'] = array('CONTACT_INFO' => '<IMG SRC=assets/down_phone_button.gif border=0>', 'gender' => 'Gender', 'ethnicity' => 'Ethnicity', 'ADDRESS' => 'Mailing Address', 'CITY' => 'City', 'STATE' => 'State', 'ZIPCODE' => 'Zipcode') + $extra['columns_after'];
            $select = ',s.STUDENT_ID AS CONTACT_INFO,s.GENDER,s.ETHNICITY,a.STREET_ADDRESS_1 as ADDRESS,a.CITY,a.STATE,a.ZIPCODE';
            $extra['FROM'] = ' LEFT OUTER JOIN student_address a ON (ssm.STUDENT_ID=a.STUDENT_ID AND a.TYPE=\'Mail\')  ' . $extra['FROM'];
            $functions['CONTACT_INFO'] = 'makeContactInfo';
            // if gender is converted to codeds type
            //$functions['CUSTOM_200000000'] = 'DeCodeds';
            $extra['singular'] = 'Student Address';
            $extra['plural'] = 'Student Addresses';
            $extra2['NoSearchTerms'] = true;
            $extra2['SELECT_ONLY'] = 'ssm.STUDENT_ID,p.STAFF_ID AS PERSON_ID,p.FIRST_NAME,p.LAST_NAME,sjp.RELATIONSHIP as STUDENT_RELATION,p.TITLE,s.PHONE,a.ID AS ADDRESS_ID ';
            $extra2['FROM'] .= ',student_address a LEFT OUTER JOIN students_join_people sjp ON (a.STUDENT_ID=sjp.STUDENT_ID AND (p.CUSTODY=\'Y\' OR sjp.IS_EMERGENCY=\'Y\')) LEFT OUTER JOIN people p ON (p.STAFF_ID=sjp.PERSON_ID) ';
            $extra2['WHERE'] .= ' AND a.STUDENT_ID=sjp.STUDENT_ID AND sjp.STUDENT_ID=ssm.STUDENT_ID ';
            $extra2['ORDER_BY'] .= 'COALESCE(p.CUSTODY,\'N\') DESC';
            $extra2['group'] = array('STUDENT_ID', 'PERSON_ID');
            // EXPANDED VIEW AND ADDR BREAKS THIS QUERY ... SO, TURN 'EM OFF
            if (!$_REQUEST['_openSIS_PDF']) {
                $expanded_view = $_REQUEST['expanded_view'];
                $_REQUEST['expanded_view'] = false;
                $addr = $_REQUEST['addr'];
                unset($_REQUEST['addr']);
                $contacts_RET = GetStuList($extra2);
                $_REQUEST['expanded_view'] = $expanded_view;
                $_REQUEST['addr'] = $addr;
            } else {
                unset($extra2['columns_after']['CONTACT_INFO']);
            }
        } else {
            if ($view_other_RET['CONTACT_INFO'][1]['VALUE'] == 'Y' && !$_REQUEST['_openSIS_PDF']) {
                $select .= ',NULL AS CONTACT_INFO ';
                $extra['columns_after']['CONTACT_INFO'] = '<IMG SRC=assets/down_phone_button.gif border=0>';
                $functions['CONTACT_INFO'] = 'makeContactInfo';
                $extra2 = $extra;
                $extra2['NoSearchTerms'] = true;
                $extra2['SELECT'] = '';
                $extra2['SELECT_ONLY'] = 'ssm.STUDENT_ID,p.STAFF_ID AS PERSON_ID,p.FIRST_NAME,p.LAST_NAME,sjp.RELATIONSHIP AS STUDENT_RELATION,p.TITLE,s.PHONE,a.ID AS ADDRESS_ID,COALESCE(p.CUSTODY,\'N\') ';
                $extra2['FROM'] .= ',student_address a LEFT OUTER JOIN students_join_people sjp ON (a.STUDENT_ID=sjp.STUDENT_ID AND (p.CUSTODY=\'Y\' OR sjp.IS_EMERGENCY=\'Y\')) LEFT OUTER JOIN people p ON (p.STAFF_ID=sjp.PERSON_ID)  ';
                $extra2['WHERE'] .= ' AND a.STUDENT_ID=sjp.STUDENT_ID AND sjp.STUDENT_ID=ssm.STUDENT_ID ';
                $extra2['ORDER_BY'] .= 'COALESCE(p.CUSTODY,\'N\') DESC';
                $extra2['group'] = array('STUDENT_ID', 'PERSON_ID');
                $extra2['functions'] = array();
                $extra2['link'] = array();
                // EXPANDED VIEW AND ADDR BREAKS THIS QUERY ... SO, TURN 'EM OFF
                $expanded_view = $_REQUEST['expanded_view'];
                $_REQUEST['expanded_view'] = false;
                $addr = $_REQUEST['addr'];
                unset($_REQUEST['addr']);
                $contacts_RET = GetStuList($extra2);
                $_REQUEST['expanded_view'] = $expanded_view;
                $_REQUEST['addr'] = $addr;
            }
            foreach ($view_fields_RET as $field) {
                $extra['columns_after']['CUSTOM_' . $field['ID']] = $field['TITLE'];
                if ($field['TYPE'] == 'date') {
                    $functions['CUSTOM_' . $field['ID']] = 'ProperDate';
                } elseif ($field['TYPE'] == 'numeric') {
                    $functions['CUSTOM_' . $field['ID']] = 'removeDot00';
                } elseif ($field['TYPE'] == 'codeds') {
                    $functions['CUSTOM_' . $field['ID']] = 'DeCodeds';
                }
                $select .= ',s.CUSTOM_' . $field['ID'];
            }
            if ($view_address_RET) {
                if ($view_address_RET == 'RESIDENCE') {
                    $extra['FROM'] = ' LEFT OUTER JOIN student_address a ON (ssm.STUDENT_ID=a.STUDENT_ID AND a.TYPE=\'Home Address\')  ' . $extra['FROM'];
                } elseif ($view_address_RET == 'MAILING') {
                    $extra['FROM'] = ' LEFT OUTER JOIN student_address a ON (ssm.STUDENT_ID=a.STUDENT_ID AND a.TYPE=\'Mail\') ' . $extra['FROM'];
                } elseif ($view_address_RET == 'BUS_PICKUP') {
                    $extra['FROM'] = ' LEFT OUTER JOIN student_address a ON (a.STUDENT_ID=a.STUDENT_ID AND a.BUS_PICKUP=\'Y\') ' . $extra['FROM'];
                } else {
                    $extra['FROM'] = ' LEFT OUTER JOIN student_address a ON (a.STUDENT_ID=a.STUDENT_ID AND a.BUS_DROPOFF=\'Y\') ' . $extra['FROM'];
                }
                $extra['columns_after'] += array('ADDRESS' => ucwords(strtolower(str_replace('_', ' ', $view_address_RET))) . ' Address', 'CITY' => 'City', 'STATE' => 'State', 'ZIPCODE' => 'Zipcode');
//.........这里部分代码省略.........
开发者ID:jicheng17,项目名称:fenghua,代码行数:101,代码来源:CustomFunctionsFnc.php

示例13: date

#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  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 '../../RedirectModulesInc.php';
if (!$_REQUEST['modfunc']) {
    $start_date = date('Y-m') . '-01';
    $end_date = DBDate('mysql');
    echo "<br><FORM name=log id=log action=Modules.php?modname={$_REQUEST['modname']}&modfunc=generate method=POST>";
    PopTable('header', 'Log Details');
    echo '<div align=center style="padding-top:20px; font-size:12px;"><strong>Please Select Date Range</strong></div><br />
	<TABLE border=0 width=100% align=center><tr><TD valign=middle>';
    echo '<strong>From :</strong> </TD><TD valign=middle>';
    DrawHeader(DateInputAY($start_date, 'start', 1));
    echo '</TD><TD valign=middle><strong>To :</strong> </TD><TD valign=middle>';
    DrawHeader(DateInputAY($end_date, 'end', 2));
    echo '</TD></TR></TABLE><div style=height:10px></div>';
    echo '<center><input type="submit" class=btn_medium value="Generate" name="generate"></center>';
    PopTable('footer');
    echo '</FORM>';
}
if ($_REQUEST['day_start'] && $_REQUEST['month_start'] && $_REQUEST['year_start']) {
    $start_date = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . substr($_REQUEST['year_start'], 2, 4);
开发者ID:jicheng17,项目名称:fh,代码行数:31,代码来源:LogDetails.php

示例14: DrawHeader

    //modif Francois: Moodle integrator
    echo $moodleError;
    if ($_REQUEST['search_modfunc'] == 'list') {
        echo '<FORM action="Modules.php?modname=' . $_REQUEST['modname'] . '&modfunc=save" method="POST">';
        DrawHeader('', SubmitButton(_('Drop Course for Selected Students')));
        //modif Francois: css WPadmin
        echo '<BR /><TABLE class="postbox cellpadding-0 cellspacing-0" style="margin:0 auto;"><TR><TH><H3>' . _('Course to Drop') . '</H3></TH></TR><TR><TD><TABLE style="border-collapse:separate; border-spacing:4px;"><TR><TD>&nbsp;</TD><TD><DIV id=course_div>';
        if ($_SESSION['MassDrops.php']) {
            $course_title = DBGet(DBQuery("SELECT TITLE FROM COURSES WHERE COURSE_ID='" . $_SESSION['MassDrops.php']['course_id'] . "'"));
            $course_title = $course_title[1]['TITLE'];
            $period_title = DBGet(DBQuery("SELECT TITLE FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $_SESSION['MassDrops.php']['course_period_id'] . "'"));
            $period_title = $period_title[1]['TITLE'];
            echo "{$course_title}<BR />{$period_title}";
        }
        echo '</DIV>' . '<A HREF="#" onclick=\'window.open("Modules.php?modname=' . $_REQUEST['modname'] . '&modfunc=choose_course","","scrollbars=yes,resizable=yes,width=800,height=400");\'>' . _('Choose a Course') . '</A></TD></TR>';
        echo '<TR><TD>' . _('Drop Date') . '</TD><TD>' . PrepareDate(DBDate(), '') . '</TD></TR>';
        echo '<TR><TD>' . _('Marking Period') . '</TD><TD>';
        echo '<SELECT name=marking_period_id>';
        $mp_RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE," . db_case(array('MP', "'FY'", "'0'", "'SEM'", "'1'", "'QTR'", "'2'")) . " AS TBL FROM SCHOOL_MARKING_PERIODS WHERE (MP='FY' OR MP='SEM' OR MP='QTR') AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY TBL,SORT_ORDER"));
        foreach ($mp_RET as $mp) {
            echo '<OPTION value="' . $mp['MARKING_PERIOD_ID'] . '">' . $mp['TITLE'] . '</OPTION>';
        }
        echo '</SELECT>';
        echo '</TD></TR>';
        echo '</TABLE></TD></TR></TABLE><BR />';
    }
}
if (empty($_REQUEST['modfunc'])) {
    if ($_REQUEST['search_modfunc'] != 'list') {
        unset($_SESSION['MassDrops.php']);
    }
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:31,代码来源:MassDrops.php

示例15: reminder

function reminder($staff, $school, $target, $last_deposit, $note)
{
    $payment = $target - $staff['BALANCE'];
    if ($payment < 0) {
        return;
    }
    $payment = number_format($payment, 2);
    echo '<TABLE width=100%>';
    echo '<TR><TD colspan=3 align=center><FONT size=+1><I><B>' . _('Payment Reminder') . '</B></I></FONT></TD></TR>';
    echo '<TR><TD colspan=3 align=center><B>' . $school . '</B></TD></TR>';
    echo '<TR><TD width=33%>';
    echo $staff['FIRST_NAME'] . ' ' . $staff['MIDDLE_NAME'] . ' ' . $staff['LAST_NAME'] . '<BR>';
    echo '<small>' . $staff['STAFF_ID'] . '</small>';
    echo '</TD><TD width=33%>';
    echo '&nbsp;<BR>';
    echo '<small>&nbsp;</small>';
    echo '</TD><TD width=33%>';
    echo '&nbsp;<BR>';
    echo '<small>&nbsp;</small>';
    echo '</TD></TR>';
    echo '<TR><TD width=33%>';
    echo ProperDate(DBDate()) . '<BR>';
    echo '<small>' . _('Today\'s Date') . '</small>';
    echo '</TD><TD width=34%>';
    echo ($last_deposit ? $last_deposit['DATE'] : _('None')) . '<BR>';
    echo '<small>' . _('Date of Last Deposit') . '</small>';
    echo '</TD><TD width=33%>';
    echo ($last_deposit ? $last_deposit['AMOUNT'] : _('None')) . '<BR>';
    echo '<small>' . _('Amount of Last Deposit') . '</small>';
    echo '</TD></TR>';
    echo '<TR><TD width=33%>';
    echo ($staff['BALANCE'] < 0 ? '<B>' . $staff['BALANCE'] . '</B>' : $staff['BALANCE']) . '<BR>';
    echo '<small>' . _('Balance') . '</small>';
    echo '</TD><TD width=33%>';
    echo '<B>' . $payment . '</B><BR>';
    echo '<small><B>' . _('Mimimum Payment') . '</B></small>';
    echo '</TD><TD width=33%>';
    echo ucfirst($staff['PROFILE']) . '<BR>';
    echo '<small>' . _('Profile') . '</small>';
    echo '</TD></TR>';
    $note = str_replace('%F', $staff['FIRST_NAME'], $note);
    $note = str_replace('%P', money_format('%i', $payment), $note);
    $note = str_replace('%T', $target, $note);
    echo '<TR><TD colspan=3>';
    echo '<BR>' . $note . '<BR>';
    echo '</TD></TR>';
    echo '<TR><TD colspan=3><BR><BR><HR><BR><BR></TD></TR></TABLE>';
}
开发者ID:linil,项目名称:centreSIS,代码行数:48,代码来源:Reminders.php


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