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


PHP UserID函数代码示例

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


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

示例1: foreach

 }
 echo "<SELECT name=course onChange='this.form.submit();'>";
 if (count($RET) > 0) {
     foreach ($RET as $course) {
         echo "<OPTION id={$course['COURSE_ID']} value={$course['COURSE_ID']}" . (UserCourse() == $course['COURSE_ID'] ? ' SELECTED' : '') . ">" . $course['COURSE_TITLE'] . "</OPTION>";
     }
 } else {
     echo '<OPTION value="">n/a</OPTION>';
 }
 echo "</SELECT>";
 //===================================================================================================
 echo "</FORM></td><td></td>";
 echo "<td><FORM name=head_frm id=head_frm action=Side.php?modfunc=update&btnn={$btn}&nsc={$ns}&act=period method=POST><INPUT type=hidden name=modcat value='' id=modcat_input>";
 $QI = DBQuery("SELECT cpv.ID,cp.COURSE_PERIOD_ID,cp.MARKING_PERIOD_ID,cp.COURSE_ID,cp.TITLE,cp.SCHOOL_ID,cpv.PERIOD_ID FROM course_periods cp,course_period_var cpv WHERE cp.SYEAR='" . UserSyear() . "' AND cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID AND cp.SCHOOL_ID='" . UserSchool() . "' AND cp.COURSE_ID='" . UserCourse() . "' AND (TEACHER_ID='" . User('STAFF_ID') . "' OR SECONDARY_TEACHER_ID='" . User('STAFF_ID') . "') AND (MARKING_PERIOD_ID IN (" . GetAllMP($allMP, UserMP()) . ") OR (MARKING_PERIOD_ID IS NULL)) group by (cp.COURSE_PERIOD_ID)");
 $RET = DBGet($QI);
 $user_profile_ret = DBGet(DBQuery(" SELECT PROFILE FROM staff WHERE STAFF_ID=" . UserID()));
 if (!CpvId()) {
     $_SESSION['CpvId'] = $RET[1]['ID'];
 }
 $fy_id = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM school_years WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
 $fy_id = $fy_id[1]['MARKING_PERIOD_ID'];
 if (!UserCoursePeriod()) {
     $_SESSION['UserCoursePeriod'] = $RET[1]['COURSE_PERIOD_ID'];
 }
 echo "<SELECT name=period onChange='this.form.submit();'>";
 if (count($RET) > 0) {
     $flag = 0;
     foreach ($RET as $period) {
         $x_sel = "";
         $period_det = DBGet(DBQuery('SELECT sp.TITLE as PERIOD_NAME,cpv.DAYS,cpv.COURSE_PERIOD_DATE FROM course_period_var cpv,school_periods sp WHERE cpv.ID=' . $period['ID'] . ' AND cpv.PERIOD_ID=sp.PERIOD_ID'));
         $period_det = $period_det[1];
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:Modules.php

示例2: array

    $period_select .= "<OPTION value='na' selected>N/A</OPTION>";
    $fi = array();
    foreach ($RET as $period) {
        $date1 = ucfirst(date("l", strtotime($redate)));
        $fi = str_split($period['DAYS']);
        $days_arr = array("Monday" => 'M', "Tuesday" => 'T', "Wednesday" => 'W', "Thursday" => 'H', "Friday" => 'F', "Saturday" => 'S', "Sunday" => 'U');
        $d = $days_arr[$date1];
        $period_select .= "<OPTION value={$period['ID']}" . (in_array($d, $fi) ? ' SELECTED' : '') . ">" . $period['SHORT_NAME'] . ($period['MARKING_PERIOD_ID'] != $fy_id ? ' ' . GetMP($period['MARKING_PERIOD_ID'], 'SHORT_NAME') : '') . (strlen($period['DAYS']) < 5 ? ' ' . $period['DAYS'] : '') . ' - ' . $period['COURSE_TITLE'] . "</OPTION>";
        if (CpvId() == $period['ID']) {
            $_SESSION['UserPeriod'] = $period['PERIOD_ID'];
        }
    }
    $period_select .= "</SELECT>";
    DrawHeader($period_select);
}
$profile_check = DBGet(DBQuery("SELECT PROFILE FROM staff WHERE STAFF_ID=" . UserID()));
$profile_check = $profile_check[1]['PROFILE'];
if ($profile_check == 'admin') {
    if (count($stu_RET) != 0 && count($course_RET) != 0) {
        DrawHeader(DateInputAY($date, 'date', 1) . $date_note, SubmitButton('Save', '', 'class=btn_medium'));
    } else {
        echo '<div style="float:left;">';
        DrawHeader(DateInputAY($date, 'date', 2) . $date_note);
        echo '</div>';
    }
} else {
    if (count($stu_RET) != 0 && count($course_RET) != 0) {
        DrawHeader(DateInputAY($date, 'date', 3) . $date_note, SubmitButton('Save', '', 'class=btn_medium'));
    } else {
        echo '<div style="float:left;">';
        DrawHeader(DateInputAY($date, 'date', 4) . $date_note);
开发者ID:jicheng17,项目名称:fh,代码行数:31,代码来源:TakeAttendance.php

示例3: foreach

             if ($flag == 0 && $seats_availabe[$cpd['COURSE_PERIOD_ID']] > 0) {
                 $schedule[$rd[1]['STUDENT_ID']]['COURSE_PERIOD_ID'] = $cpd['COURSE_PERIOD_ID'];
                 $schedule[$rd[1]['STUDENT_ID']]['COURSE_ID'] = $cpd['COURSE_ID'];
                 $schedule[$rd[1]['STUDENT_ID']]['MP'] = $cpd['MP'];
                 $schedule[$rd[1]['STUDENT_ID']]['MARKING_PERIOD_ID'] = $cpd['MARKING_PERIOD_ID'];
                 $schedule[$rd[1]['STUDENT_ID']]['CALENDAR_ID'] = $cpd['CALENDAR_ID'];
                 $schedule[$rd[1]['STUDENT_ID']]['TEACHER_ID'] = $cpd['TEACHER_ID'];
                 $schedule[$rd[1]['STUDENT_ID']]['REQUEST_ID'] = $rd[1]['REQUEST_ID'];
                 $seats_availabe[$cpd['COURSE_PERIOD_ID']] = $cpd['TOTAL_SEATS'] - ($cpd['FILLED_SEATS'] + 1);
                 break 1;
             }
         }
     }
 }
 foreach ($schedule as $stu_id => $cp_id) {
     DBQuery('INSERT INTO schedule (SYEAR,SCHOOL_ID,STUDENT_ID,START_DATE,MODIFIED_BY,COURSE_ID,COURSE_PERIOD_ID,MP,MARKING_PERIOD_ID,DROPPED) VALUES (' . UserSyear() . ',' . UserSchool() . ',' . $stu_id . ',\'' . $s_date . '\',' . UserID() . ',\'' . $cp_id['COURSE_ID'] . '\',\'' . $cp_id['COURSE_PERIOD_ID'] . '\',\'' . ($cp_id['MARKING_PERIOD_ID'] != '' ? $cp_id['MP'] : 'FY') . '\',\'' . ($cp_id['MARKING_PERIOD_ID'] != '' ? $cp_id['MARKING_PERIOD_ID'] : GetMPId('FY')) . '\',\'N\')');
     DBQuery('DELETE FROM schedule_requests WHERE REQUEST_ID=' . $cp_id['REQUEST_ID']);
     if (strtotime($s_date) <= strtotime(date('Y-m-d'))) {
         $check_d_att = DBGet(DBQuery('SELECT * FROM course_period_var WHERE COURSE_PERIOD_ID=' . $cp_id['COURSE_PERIOD_ID'] . ' AND DOES_ATTENDANCE=\'Y\''));
         if (count($check_d_att) > 0) {
             for ($j = strtotime($s_date); $j < strtotime(date('Y-m-d')); $j = $j + 86400) {
                 $chk_date = DBGet(DBQuery('SELECT COUNT(*) as REC_EX FROM attendance_calendar WHERE SCHOOL_ID=' . UserSchool() . ' AND SYEAR=' . UserSyear() . ' AND SCHOOL_DATE=\'' . date('Y-m-d', $j) . '\' AND CALENDAR_ID=' . $cp_id['CALENDAR_ID']));
                 if ($chk_date[1]['REC_EX'] != 0) {
                     foreach ($check_d_att as $catt) {
                         DBQuery('INSERT INTO missing_attendance (SCHOOL_ID,SYEAR,SCHOOL_DATE,COURSE_PERIOD_ID,PERIOD_ID,TEACHER_ID) VALUES (' . UserSchool() . ',' . UserSyear() . ',' . date('Y-m-d', $j) . ',' . $cp_id['COURSE_PERIOD_ID'] . ',' . $catt['PERIOD_ID'] . ',' . $cp_id['TEACHER_ID'] . ')');
                     }
                 }
             }
         }
     }
 }
开发者ID:jicheng17,项目名称:fh,代码行数:31,代码来源:Scheduler.php

示例4: foreach

     $_REQUEST['modfunc'] = '';
 } else {
     $fields = $values = '';
     foreach ($_REQUEST['values'] as $column => $value) {
         if ($column != 'ID' && $value) {
             $value = paramlib_validation($column, trim($value));
             $fields .= ',' . $column;
             $values .= ",\"" . str_replace("'", "''", str_replace("\\'", "''", trim($value))) . " \"";
         }
     }
     if ($fields && $values) {
         $id = DBGet(DBQuery('SHOW TABLE STATUS LIKE \'schools\''));
         $id = $id[1]['AUTO_INCREMENT'];
         $sql = 'INSERT INTO schools (SYEAR' . $fields . ') values(' . UserSyear() . '' . $values . ')';
         DBQuery($sql);
         DBQuery('INSERT INTO  staff_school_relationship(staff_id,school_id,syear) VALUES (' . UserID() . ',' . $id . ',' . UserSyear() . ')');
         if (User('PROFILE_ID') != 0) {
             $super_id = DBGet(DBQuery('SELECT STAFF_ID FROM staff WHERE PROFILE_ID=0 AND PROFILE=\'admin\''));
             DBQuery('INSERT INTO  staff_school_relationship(staff_id,school_id,syear) VALUES (' . $super_id[1]['STAFF_ID'] . ',' . $id . ',' . UserSyear() . ')');
         }
         DBQuery('INSERT INTO school_years (MARKING_PERIOD_ID,SYEAR,SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,ROLLOVER_ID) SELECT fn_marking_period_seq(),SYEAR,\'' . $id . '\' AS SCHOOL_ID,TITLE,SHORT_NAME,SORT_ORDER,START_DATE,END_DATE,POST_START_DATE,POST_END_DATE,DOES_GRADES,DOES_EXAM,DOES_COMMENTS,MARKING_PERIOD_ID FROM school_years WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY MARKING_PERIOD_ID');
         DBQuery('INSERT INTO system_preference(school_id, full_day_minute, half_day_minute) VALUES (' . $id . ', NULL, NULL)');
         DBQuery('INSERT INTO program_config (SCHOOL_ID,SYEAR,PROGRAM,TITLE,VALUE) VALUES(\'' . $id . '\',\'' . UserSyear() . '\',\'MissingAttendance\',\'LAST_UPDATE\',\'' . date('Y-m-d') . '\')');
         $_SESSION['UserSchool'] = $id;
         unset($_REQUEST['new_school']);
     }
     echo '<FORM action=Modules.php?modname=' . strip_tags(trim($_REQUEST['modname'])) . ' method=POST>';
     echo '<script language=JavaScript>parent.side.location="' . $_SESSION['Side_PHP_SELF'] . '?modcat="+parent.side.document.forms[0].modcat.value;</script>';
     echo "<br><br>";
     DrawHeaderHome('<IMG SRC=assets/check.gif> &nbsp; A new school called <strong>' . GetSchool(UserSchool()) . '</strong> has been created. To finish the operation, click OK button.', '<INPUT  type=submit value=OK class="btn_medium">');
     echo '<input type="hidden" name="copy" value="done"/>';
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:Schools.php

示例5: GetStuListAttn


//.........这里部分代码省略.........
            }
        }
        $extra['SELECT'] .= $select;
    } elseif ($_REQUEST['addr'] || $extra['addr']) {
        $extra['FROM'] = ' LEFT OUTER JOIN student_address a ON (ssm.STUDENT_ID=a.STUDENT_ID) ' . $extra['FROM'];
        $distinct = 'DISTINCT ';
    }
    switch (User('PROFILE')) {
        case 'admin':
            $sql = 'SELECT ';
            if ($extra['SELECT_ONLY']) {
                $sql .= $extra['SELECT_ONLY'];
            } else {
                if (Preferences('NAME') == 'Common') {
                    $sql .= 'CONCAT(s.LAST_NAME,\', \',coalesce(s.COMMON_NAME,s.FIRST_NAME)) AS FULL_NAME,';
                } else {
                    $sql .= 'CONCAT(s.LAST_NAME,\', \',s.FIRST_NAME,\' \',COALESCE(s.MIDDLE_NAME,\' \')) AS FULL_NAME,';
                }
                $sql .= 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID AS LIST_SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
                if ($_REQUEST['include_inactive'] == 'Y') {
                    $sql .= ',' . db_case(array('(ssm.SYEAR=\'' . UserSyear() . '\' AND (ssm.START_DATE IS NOT NULL AND (\'' . date('Y-m-d', strtotime($extra['DATE'])) . '\'<=ssm.END_DATE OR ssm.END_DATE IS NULL)))', 'true', "'<FONT color=green>Active</FONT>'", "'<FONT color=red>Inactive</FONT>'")) . ' AS ACTIVE ';
                }
            }
            $sql .= ' FROM students s,student_enrollment ssm ' . $extra['FROM'] . ' WHERE ssm.STUDENT_ID=s.STUDENT_ID ';
            if ($_REQUEST['include_inactive'] == 'Y') {
                $sql .= ' AND ssm.ID=(SELECT ID FROM student_enrollment WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR<=\'' . UserSyear() . '\' ORDER BY START_DATE DESC LIMIT 1)';
            } else {
                $sql .= ' AND ssm.SYEAR=\'' . UserSyear() . '\' AND (ssm.START_DATE IS NOT NULL AND (\'' . date('Y-m-d', strtotime($extra['DATE'])) . '\'<=ssm.END_DATE OR ssm.END_DATE IS NULL)) ';
            }
            if (UserSchool() && $_REQUEST['_search_all_schools'] != 'Y') {
                $sql .= ' AND ssm.SCHOOL_ID=\'' . UserSchool() . '\'';
            } else {
                //
                $sql .= ' AND ssm.SCHOOL_ID IN (' . GetUserSchools(UserID(), true) . ') ';
                $extra['columns_after']['LIST_SCHOOL_ID'] = 'School';
                $functions['LIST_SCHOOL_ID'] = 'GetSchool';
            }
            if (!$extra['SELECT_ONLY'] && $_REQUEST['include_inactive'] == 'Y') {
                $extra['columns_after']['ACTIVE'] = 'Status';
            }
            break;
        case 'teacher':
            $sql = 'SELECT ';
            if ($extra['SELECT_ONLY']) {
                $sql .= $extra['SELECT_ONLY'];
            } else {
                if (Preferences('NAME') == 'Common') {
                    $sql .= 'CONCAT(s.LAST_NAME,\', \',coalesce(s.COMMON_NAME,s.FIRST_NAME)) AS FULL_NAME,';
                } else {
                    $sql .= 'CONCAT(s.LAST_NAME,\', \',s.FIRST_NAME,\' \',COALESCE(s.MIDDLE_NAME,\' \')) AS FULL_NAME,';
                }
                $sql .= 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
                if ($_REQUEST['include_inactive'] == 'Y') {
                    $sql .= ',' . db_case(array('(ssm.START_DATE IS NOT NULL AND  (\'' . $extra['DATE'] . '\'<=ssm.END_DATE OR ssm.END_DATE IS NULL))', 'true', "'<FONT color=green>Active</FONT>'", "'<FONT color=red>Inactive</FONT>'")) . ' AS ACTIVE';
                    $sql .= ',' . db_case(array('(\'' . $extra['DATE'] . '\'>=ss.START_DATE AND (\'' . $extra['DATE'] . '\'<=ss.END_DATE OR ss.END_DATE IS NULL))', 'true', "'<FONT color=green>Active</FONT>'", "'<FONT color=red>Inactive</FONT>'")) . ' AS ACTIVE_SCHEDULE';
                }
            }
            //
            $sql .= ' FROM students s,course_periods cp,schedule ss,student_enrollment ssm,course_period_var cpv ' . $extra['FROM'] . ' WHERE ssm.STUDENT_ID=s.STUDENT_ID AND cpv.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND cpv.ID="' . $extra['ID'] . '" AND ssm.STUDENT_ID=ss.STUDENT_ID AND ssm.SCHOOL_ID=\'' . UserSchool() . '\' AND ssm.SYEAR=\'' . UserSyear() . '\' AND ssm.SYEAR=cp.SYEAR AND ssm.SYEAR=ss.SYEAR AND ' . db_case(array(User('STAFF_ID'), 'cp.teacher_id', ' cp.teacher_id=' . User('STAFF_ID'), 'cp.secondary_teacher_id', ' cp.secondary_teacher_id=' . User('STAFF_ID'), 'cp.course_period_id IN(SELECT course_period_id from teacher_reassignment tra WHERE cp.course_period_id=tra.course_period_id AND tra.pre_teacher_id=' . User('STAFF_ID') . ')')) . ' AND cp.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\' AND cp.COURSE_ID=ss.COURSE_ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID';
            if ($extra['cpvdate'] != '') {
                $sql .= $extra['cpvdate'];
            }
            if ($_REQUEST['include_inactive'] == 'Y') {
                $sql .= ' AND ssm.ID=(SELECT ID FROM student_enrollment WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR=ssm.SYEAR ORDER BY START_DATE DESC LIMIT 1)';
                $sql .= ' AND ss.START_DATE=(SELECT START_DATE FROM schedule WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR=ssm.SYEAR AND MARKING_PERIOD_ID IN (' . GetAllMP('', $queryMP) . ') AND COURSE_ID=cp.COURSE_ID AND COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID ORDER BY START_DATE DESC LIMIT 1)';
            } else {
开发者ID:jicheng17,项目名称:fenghua,代码行数:67,代码来源:CustomFunctionsFnc.php

示例6: TRIM

     $user1 = "SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,staff WHERE login_authentication.user_id=staff.staff_id AND TRIM( IFNULL( USERNAME, '' ) ) <> '' AND TRIM( IFNULL( PASSWORD, '' ) ) <> '' and login_authentication.profile_id not in(3,4)";
     $user2 = "SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,students WHERE login_authentication.user_id=students.student_id AND login_authentication.profile_id=3 AND TRIM( IFNULL( USERNAME, '' ) ) <> '' AND TRIM( IFNULL( PASSWORD, '' ) ) <> '' and login_authentication.profile_id=3";
     $user3 = "SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,people WHERE login_authentication.user_id=people.staff_id AND TRIM( IFNULL( USERNAME, '' ) ) <> '' AND TRIM( IFNULL( PASSWORD, '' ) ) <> '' AND login_authentication.profile_id=4";
 }
 if (User('PROFILE') == 'teacher') {
     $user1 = "SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,staff WHERE login_authentication.user_id=staff.staff_id AND TRIM( IFNULL( USERNAME, '' ) ) <> '' AND TRIM( IFNULL( PASSWORD, '' ) ) <> '' and login_authentication.profile_id in(0,1,5)";
     //all types of admin
     $user2 = "SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM students,login_authentication WHERE profile_id=3 and login_authentication.user_id=students.student_id and  TRIM( IFNULL( USERNAME, '' ) ) <> '' AND  TRIM( IFNULL( PASSWORD, '' ) ) <> ''  AND student_id IN (SELECT DISTINCT student_id FROM course_periods INNER JOIN schedule USING ( course_period_id ) WHERE course_periods.teacher_id = " . UserID() . ")";
     //scheduled students
     $user3 = 'SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,people WHERE login_authentication.user_id=people.staff_id and login_authentication.profile_id=4 AND TRIM( IFNULL( USERNAME, \'\' ) ) <> \'\' AND user_id IN (SELECT DISTINCT person_id FROM students_join_people WHERE student_id IN (SELECT student_id FROM students WHERE student_id IN (SELECT DISTINCT student_id FROM course_periods INNER JOIN schedule USING (course_period_id ) WHERE course_periods.teacher_id = \'' . UserID() . '\')))';
     //parents
 }
 if (User('PROFILE') == 'parent') {
     $user1 = "SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,staff WHERE login_authentication.user_id=staff.staff_id AND TRIM( IFNULL( USERNAME, '' ) ) <> '' AND TRIM( IFNULL( PASSWORD, '' ) ) <> '' and login_authentication.profile_id in(0,1,5)";
     //all types of admin
     $user2 = "SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,staff WHERE login_authentication.user_id=staff.staff_id and login_authentication.profile_id=2 and staff.PROFILE_ID={$profile} AND  TRIM( IFNULL( USERNAME, '' ) ) <> '' AND  TRIM( IFNULL( PASSWORD, '' ) ) <> '' AND staff_id NOT IN (Select distinct person_id from students_join_people where person_id<>" . UserID() . ")";
     //parents
     //                   $user2="SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,staff WHERE login_authentication.user_id=staff.staff_id and login_authentication.profile_id=2 and staff.PROFILE_ID=$profile AND  TRIM( IFNULL( USERNAME, '' ) ) <> '' AND  TRIM( IFNULL( PASSWORD, '' ) ) <> '' AND staff_id IN(Select distinct student_id from students_join_users where staff_id=".UserID().")";//parents
 }
 if (User('PROFILE') == 'student') {
     $user1 = "SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,staff WHERE login_authentication.user_id=staff.staff_id AND TRIM( IFNULL( USERNAME, '' ) ) <> '' AND TRIM( IFNULL( PASSWORD, '' ) ) <> '' and login_authentication.profile_id in(0,1,5)";
     //all types of admin
     $user2 = "SELECT username,LAST_NAME,first_name,login_authentication.profile_id,is_disable,login_authentication.user_id FROM login_authentication,staff WHERE login_authentication.user_id=staff.staff_id and login_authentication.profile_id=2 and staff.PROFILE_ID={$profile} AND  TRIM( IFNULL( USERNAME, '' ) ) <> '' AND  TRIM( IFNULL( PASSWORD, '' ) ) <> '' AND staff_id IN(Select distinct teacher_id from course_periods INNER JOIN schedule using(course_period_id) where schedule.student_id=" . UserStudentID() . ")";
     //teachers
 }
 if ($lastName != "") {
     $user1 = $user1 . " AND LAST_NAME LIKE '{$lastName}%' ";
     $user2 = $user2 . " AND LAST_NAME LIKE '{$lastName}%' ";
     if (User('PROFILE') == 'admin' || User('PROFILE') == 'teacher') {
         $user3 = $user3 . " AND LAST_NAME LIKE '{$lastName}%' ";
     }
开发者ID:26746647,项目名称:openSIS,代码行数:31,代码来源:Group.php

示例7: IN

         $admin_COMMON_WHERE .= " AND sma.STUDENT_ID=s.STUDENT_ID ";
         $_SESSION['sma'] = '1';
     }
     if ($_REQUEST['nv_day'] || $_REQUEST['nv_month'] || $_REQUEST['nv_year'] || $_REQUEST['reason'] || $_REQUEST['result'] || $_REQUEST['med_vist_comments'] || $_SESSION['smv']) {
         $admin_COMMON_FROM .= " ,student_medical_visits smv   ";
         $admin_COMMON_WHERE .= " AND smv.STUDENT_ID=s.STUDENT_ID ";
         $_SESSION['smv'] = '1';
     }
     $admin_COMMON = $admin_COMMON_FROM . $admin_COMMON_WHERE;
 }
 /////////////////////////////////// Teacher section ///////////////////////////////////
 if (User('PROFILE') == 'teacher') {
     $teacher_COMMON_FROM = " FROM students s, student_enrollment ssm, course_periods cp,\r\n\tschedule ss,student_address a ";
     $teacher_COMMON_WHERE = " WHERE a.STUDENT_ID=s.STUDENT_ID AND a.TYPE='Home Address' AND s.STUDENT_ID=ssm.STUDENT_ID AND ssm.STUDENT_ID=ss.STUDENT_ID AND ssm.SYEAR=cp.SYEAR AND ssm.SYEAR=ss.SYEAR AND cp.COURSE_ID=ss.COURSE_ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.MARKING_PERIOD_ID IN (" . GetAllMP('', $queryMP) . ")\r\n\t\t\t\t\t\tAND (cp.TEACHER_ID='" . User('STAFF_ID') . "' OR cp.SECONDARY_TEACHER_ID='" . User('STAFF_ID') . "') AND cp.COURSE_PERIOD_ID='" . UserCoursePeriod() . "' AND ssm.SYEAR=" . UserSyear() . " AND ssm.SCHOOL_ID=" . UserSchool() . " ";
     if ($_REQUEST['_search_all_schools'] == 'Y' || $_SESSION['_search_all'] == 1) {
         $teacher_COMMON_WHERE = " WHERE a.STUDENT_ID=s.STUDENT_ID AND a.TYPE='Home Address'  AND s.STUDENT_ID=ssm.STUDENT_ID AND ssm.STUDENT_ID=ss.STUDENT_ID AND ssm.SYEAR=cp.SYEAR AND ssm.SYEAR=ss.SYEAR AND cp.COURSE_ID=ss.COURSE_ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.MARKING_PERIOD_ID IN (" . GetAllMP('', $queryMP) . ")\r\n\t\t\t\t\t\tAND (cp.TEACHER_ID='" . User('STAFF_ID') . "' OR cp.SECONDARY_TEACHER_ID='" . User('STAFF_ID') . "') AND cp.COURSE_PERIOD_ID='" . UserCoursePeriod() . "' AND ssm.SYEAR=" . UserSyear() . " AND ssm.SCHOOL_ID IN (" . GetUserSchools(UserID(), true) . ") ";
         $_SESSION['_search_all'] = 1;
     } else {
         $teacher_COMMON_WHERE = " WHERE a.STUDENT_ID=s.STUDENT_ID AND a.TYPE='Home Address' AND s.STUDENT_ID=ssm.STUDENT_ID AND ssm.STUDENT_ID=ss.STUDENT_ID AND ssm.SYEAR=cp.SYEAR AND ssm.SYEAR=ss.SYEAR AND cp.COURSE_ID=ss.COURSE_ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.MARKING_PERIOD_ID IN (" . GetAllMP('', $queryMP) . ")\r\n\t\t\t\t\t\tAND (cp.TEACHER_ID='" . User('STAFF_ID') . "' OR cp.SECONDARY_TEACHER_ID='" . User('STAFF_ID') . "') AND cp.COURSE_PERIOD_ID='" . UserCoursePeriod() . "' AND ssm.SYEAR=" . UserSyear() . " AND ssm.SCHOOL_ID=" . UserSchool() . " ";
     }
     if ($_REQUEST['mp_comment'] || $_SESSION['smc']) {
         $teacher_COMMON_FROM .= " ,student_mp_comments smc";
         $teacher_COMMON_WHERE .= " AND smc.STUDENT_ID=s.STUDENT_ID ";
         $_SESSION['smc'] = '1';
     }
     if ($_REQUEST['goal_description'] || $_REQUEST['goal_title'] || $_SESSION['g']) {
         $teacher_COMMON_FROM .= " ,student_goal g ";
         $teacher_COMMON_WHERE .= " AND g.STUDENT_ID=s.STUDENT_ID ";
         $_SESSION['g'] = '1';
     }
     if ($_REQUEST['progress_name'] || $_REQUEST['progress_description'] || $_SESSION['p']) {
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:Student.php

示例8: array_push

         $_arr['USER_ID'] = $profile[$k]['STUDENT_ID'];
         $_arr['FIRST_NAME'] = $userlist[$key]['LAST_NAME'] . ' ' . $userlist[$key]['FIRST_NAME'];
         $_arr['PROFILE_ID'] = $profile[$k]['PROFILE'];
         $_arr['IS_DISABLE'] = $userlist[$key]['IS_DISABLE'];
         array_push($final_arr, $_arr);
     }
 } else {
     if ($userlist[$key]['PROFILE_ID'] == 4) {
         //                        $sql = "select student_id from  students_join_people where person_id=".$userlist[$key]['USER_ID'];
         //                        $fetch = DBGet(DBQuery($sql));
         //                        foreach($fetch as $k1=>$v1){
         if (User('PROFILE') == 'student') {
             $select = "SELECT se.*,up.* FROM student_enrollment se,user_profiles up WHERE up.ID=" . $userlist[$key]['PROFILE_ID'] . " and se.school_id=" . UserSchool() . " AND se.student_id=" . UserStudentID() . "";
         }
         if (User('PROFILE') == 'teacher') {
             $select = "SELECT se.*,up.* FROM student_enrollment se,user_profiles up WHERE up.ID=" . $userlist[$key]['PROFILE_ID'] . " and se.school_id=" . UserSchool() . " AND se.student_id in (select schedule.student_id from  schedule,course_periods,students_join_people where course_periods.course_period_id=schedule.course_period_id  and  schedule.student_id=students_join_people.student_id and students_join_people.person_id=" . $userlist[$key]['USER_ID'] . " and teacher_id=" . UserID() . ")";
         } else {
             $select = "SELECT se.*,up.* FROM student_enrollment se,user_profiles up WHERE up.ID=" . $userlist[$key]['PROFILE_ID'] . " and se.school_id=" . UserSchool() . " AND se.student_id in (select student_id from  students_join_people where person_id=" . $userlist[$key]['USER_ID'] . ")";
         }
         $profile = DBGet(DBQuery($select));
         foreach ($profile as $k => $v) {
             $_arr['USERNAME'] = $userlist[$key]['USERNAME'];
             $_arr['LAST_NAME'] = $userlist[$key]['LAST_NAME'];
             $_arr['USER_ID'] = $userlist[$key]['USER_ID'];
             $_arr['FIRST_NAME'] = $userlist[$key]['LAST_NAME'] . ' ' . $userlist[$key]['FIRST_NAME'];
             $_arr['PROFILE_ID'] = $profile[$k]['PROFILE'];
             $_arr['IS_DISABLE'] = $userlist[$key]['IS_DISABLE'];
             array_push($final_arr, $_arr);
         }
         //                    }
     } else {
开发者ID:jicheng17,项目名称:fh,代码行数:31,代码来源:Group.php

示例9: switch

} else {
    if ($id) {
        $f->find_values($id);
        $TicketNo = $id;
        echo "&nbsp<a href=\"" . $sess->url("/SupportComments.php") . $sess->add_query(array("cmd" => "Add", "TicketNo" => $TicketNo)) . "\">Add Comment</a>&nbsp\n";
        echo "&nbsp;<a href=SupportTickets.php>Back to Support Tickets List</a>";
        $SrchLocation = $Location;
    }
}
include 'phplib/locations.inc';
$id = $TicketNo;
echo "<h2>{$cmd} Support Ticket {$id} </h2> ";
$origcmd = $cmd;
switch ($cmd) {
    case "View":
        if ($UID = UserID($UserName)) {
            echo "<h3>User Information</h3>\n";
            $mf = new my_userinfoform();
            $mf->find_values($UID);
            $mf->freeze();
            $mf->display();
        }
        echo "</td><td valign=top>";
        echo "<h3>Ticket Details</h3>\n";
        $cmd = $origcmd;
    case "Delete":
    case "Close":
        $f->freeze();
    case "Add":
    case "Edit":
        if (!isset($Location) and isset($SrchLocation)) {
开发者ID:TaylorMonacelli,项目名称:phplib,代码行数:31,代码来源:SupportTickets.php

示例10: array

 $columns = array('GRADE_COURSE' => 'Course');
 $link = array();
 $link['GRADE_COURSE']['link'] = "ForWindow.php?modname={$_REQUEST['modname']}&subject_id={$_REQUEST['subject_id']}";
 $link['GRADE_COURSE']['variables'] = array('course_id' => 'COURSE_ID');
 if ($_REQUEST['modfunc'] != 'choose_course') {
     $link['add']['link'] = "ForWindow.php?modname={$_REQUEST['modname']}&subject_id={$_REQUEST['subject_id']}&course_id=new";
 } else {
     $link['GRADE_COURSE']['link'] .= "&modfunc={$_REQUEST['modfunc']}";
 }
 ListOutput($courses_RET, $columns, 'Course', 'Courses', $link, array(), $LO_options, 'ForWindow');
 echo '</TD>';
 if ($_REQUEST['course_id'] && $_REQUEST['course_id'] != 'new') {
     if ($message_my_class != 'yes') {
         $sql = "SELECT COURSE_PERIOD_ID,TITLE,COALESCE(TOTAL_SEATS-FILLED_SEATS,0) AS AVAILABLE_SEATS FROM course_periods WHERE COURSE_ID='{$_REQUEST['course_id']}' AND (marking_period_id IN(" . GetAllMP(GetMPTable(GetMP(UserMP(), 'TABLE')), UserMP()) . ") OR (CURDATE() <= end_date AND marking_period_id IS NULL)) ORDER BY TITLE";
     } else {
         $sql = "SELECT COURSE_PERIOD_ID,TITLE,COALESCE(TOTAL_SEATS-FILLED_SEATS,0) AS AVAILABLE_SEATS FROM course_periods WHERE COURSE_ID='{$_REQUEST['course_id']}' AND (marking_period_id IN(" . GetAllMP(GetMPTable(GetMP(UserMP(), 'TABLE')), UserMP()) . ") OR (CURDATE() <= end_date AND marking_period_id IS NULL)) AND (TEACHER_ID='" . UserID() . "' OR SECONDARY_TEACHER_ID='" . UserID() . "') ORDER BY TITLE";
     }
     $QI = DBQuery($sql);
     $periods_RET = DBGet($QI);
     if (count($periods_RET)) {
         if ($_REQUEST['course_period_id']) {
             foreach ($periods_RET as $key => $value) {
                 if ($value['COURSE_PERIOD_ID'] == $_REQUEST['course_period_id']) {
                     $periods_RET[$key]['row_color'] = Preferences('HIGHLIGHT');
                 }
             }
         }
     }
     echo '<TD valign=top>';
     $columns = array('TITLE' => 'Course Period');
     if ($_REQUEST['modname'] == 'scheduling/Schedule.php') {
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:CoursesforWindow.php

示例11: my_SupportTicketsform

}
$st = new my_SupportTicketsform();
$st->find_values($TicketNo);
echo "<font class=bigTextBold>Support Ticket {$TicketNo}</font> ";
$origcmd = $cmd;
switch ($cmd) {
    case "View":
    case "Delete":
        $f->freeze();
    case "Send":
    case "Add":
        $db->query("select id from userinfo where UserName='" . $auth->auth["uname"] . "'");
        $db->next_record();
        $ContID = $db->f(0);
        /* logged in user */
        $ContactID = UserID($UserName);
        /* looked up user */
        if (!$perm->have_perm("admin") and !$perm->have_perm("support")) {
            if ($ContID != $ContactID and $EnteredBy != $auth->auth["uname"]) {
                $str1 = "SupportComments: Access Denied ";
                $str2 = "{$auth->auth}[uname] {$EnteredBy} {$UserName}";
                Eventlog($str1, $str2, "Warning");
                echo $str1 . $str2;
                break;
            }
        }
    case "Edit":
        echo "<font class=bigTextBold>{$cmd} Support Comments <a href=SupportTickets.php>Back to Support Tickets List</a></font>\n";
        echo "<table cellspacing=10><tr><td valign=top>";
        $cmd = "View";
        if ($ContactID) {
开发者ID:TaylorMonacelli,项目名称:phplib,代码行数:31,代码来源:SupportComments.php

示例12: SelfStaffProfile

function SelfStaffProfile($option)
{
    $prof = DBGet(DBQuery('SELECT ' . $option . ' FROM staff WHERE STAFF_ID=' . UserID()));
    return $prof[1][$option];
}
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:5,代码来源:UserFnc.php

示例13: SupportEmail

function SupportEmail($TicketNo, $OldStatus = "")
{
    global $UserName, $Name, $Company, $StreetAddress, $Town, $State, $PostCode, $CO, $OtherDetail;
    global $Quantity, $ProductCode, $PartNo, $Description, $Price, $Duration, $Rate, $Details, $Email, $Comment, $ByContact;
    global $HomePhone, $WorkPhone, $Mobile, $Status, $ShortDesc, $EngineerEmail, $Created, $EnteredBy, $SequenceNo;
    global $AssignedTo, $ByUser;
    if ($TicketNo < 1) {
        return false;
    }
    $Level = 0;
    $db = new DB_hotspot();
    $stf = new SupportTicketsform();
    $stf->find_values($TicketNo);
    $mf = new userinfoform();
    $mf->find_values(UserID($UserName));
    $EngineerEmail = get_email($AssignedTo);
    if ($OldStatus) {
        $Status = $OldStatus . "->" . $Status;
    }
    $subj = "Ticket: {$TicketNo}, {$Status}, {$ShortDesc}";
    $Msg = "Job for: <b>{$UserName}, {$Name}</b><br>\n";
    if ($StreetAddress . $Town . $State . $PostCode) {
        $Msg .= "at: <b>";
        if ($StreetAddress) {
            $Msg .= "{$StreetAddress}, ";
        }
        if ($Town) {
            $Msg .= "{$Town}, ";
        }
        if ($State) {
            $Msg .= "{$State}, ";
        }
        if ($PostCode) {
            $Msg .= "{$PostCode}";
        }
        $Msg .= "</b><br>\n";
    }
    if (isset($HomePhone)) {
        $Msg .= "HomePhone: <b>{$HomePhone}</b><br>\n";
    }
    if (isset($WorkPhone)) {
        $Msg .= "WorkPhone: <b>{$WorkPhone}</b><br>\n";
    }
    if (isset($Mobile)) {
        $Msg .= "Mob: <b>{$Mobile}</b><br>\n";
    }
    if (isset($Mail)) {
        $Msg .= "Email: <b>{$Mail}</b><br>\n";
    }
    $Msg .= "------------------------------------------------------------<br>\n";
    $Msg .= "Entered By: <b>{$EnteredBy}</b><br>\n";
    $Msg .= "Date: <b>{$Created}</b><br>\n";
    if (isset($Location)) {
        $Msg .= "Location: <b>{$Location}</b><br>\n";
    }
    if (isset($RoomNo)) {
        $Msg .= "Room No: <b>{$RoomNo}</b><br>\n";
    }
    if (isset($Severity)) {
        $Msg .= "Severity: <b>{$Severity}</b><br>\n";
    }
    if ($Level > 0) {
        $Msg .= "Level: <b>{$Level}</b><br>\n";
    }
    $Msg .= "Description: <b>{$ShortDesc}</b> {$OtherDetail}<br>\n";
    $Msg .= "------------------------------------------------------------<br>\n";
    /*
    	$db->query("select id from SupportParts where TicketNo='".$TicketNo."'");
    	$sp = new SupportPartsform;
    	while ($db->next_record()) {
    		$sp->find_values($db->f(0));
    		$Msg .= "Part: <b>$Quantity x $ProductCode, $PartNo, $Description @ $Price</b><br>\n";
    	}
    	$db->query("select id from SupportDetails where TicketNo='".$TicketNo."'");
    	$sd = new SupportDetailsform;
    	while ($db->next_record()) {
    		$sd->find_values($db->f(0));
    		$Msg .= "Work: <b>$Duration minutes @ $Rate /hour, $Details</b><br>\n";
    	}
    */
    $db->query("select distinct FileName from SupportFiles where TicketNo='" . $TicketNo . "'");
    while ($db->next_record()) {
        $Msg .= "Attachment: http://os.{$CO}.com.au/files/{$TicketNo}/" . $db->f(0) . "<br>\n";
    }
    $db->query("select id from SupportComments where TicketNo='" . $TicketNo . "'");
    $sc = new SupportCommentsform();
    while ($db->next_record()) {
        $sc->find_values($db->f(0));
        $mf->find_values($ByContact);
        $Msg .= "Comment by <b>{$ByUser}:</b> ";
        $Msg .= str_replace('" src="/candy/', '" src="http://os.' . $CO . '.com.au/candy/', $Comment);
        $Msg .= "<br>\n";
    }
    $url = "https://os.{$CO}.com.au/SupportTickets.php?cmd=View&id=" . $TicketNo;
    $Msg .= "<a href='{$url}'>{$url}</a><br>\n";
    $hdrs = "From: ticket+{$TicketNo}@{$CO}.net.au";
    if ($EngineerEmail) {
        $hdrs .= "\r\nTo: {$EngineerEmail}";
    }
    htmlMail("info@{$CO}.com.au", $subj, $Msg, $hdrs);
//.........这里部分代码省略.........
开发者ID:TaylorMonacelli,项目名称:phplib,代码行数:101,代码来源:SupportEmail.php

示例14: error_reporting

#  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/>.
#
#***************************************************************************************
error_reporting(0);
include "Data.php";
include "Warehouse.php";
$keyword = $_REQUEST['str'];
$block_id = $_REQUEST['block_id'];
if (User('PROFILE') == 'student') {
    $user_id = UserStudentID();
} else {
    $user_id = UserID();
}
$username_user = DBGet(DBQuery('SELECT USERNAME FROM login_authentication WHERE USER_ID=' . $user_id . ' AND PROFILE_ID=' . User('PROFILE_ID')));
$username_user = $username_user[1]['USERNAME'];
if (User('PROFILE_ID') == 0) {
    $tmp_q = '';
    $tmp_a = array();
    $tmp_stu_arr = array();
    $tmp_stf_arr = array();
    $tmp_p_arr = array();
    $tmp_q = DBGet(DBQuery('SELECT STUDENT_ID FROM students'));
    foreach ($tmp_q as $tmp_a) {
        $tmp_stu_arr[] = $tmp_a['STUDENT_ID'];
    }
    $tmp_q = '';
    $tmp_a = array();
开发者ID:jicheng17,项目名称:fh,代码行数:31,代码来源:NamesList.php

示例15: UserSyear

     FROM portal_notes pn
     WHERE pn.SYEAR=\'' . UserSyear() . '\' 
         AND pn.START_DATE<=CURRENT_DATE AND (pn.END_DATE>=CURRENT_DATE OR pn.END_DATE IS NULL) 
         AND (pn.school_id IS NULL OR pn.school_id IN(' . GetUserSchools(UserID(), true) . '))
         AND (' . (User('PROFILE_ID') == '' ? ' FIND_IN_SET(\'parent\', pn.PUBLISHED_PROFILES)>0' : ' FIND_IN_SET(' . User('PROFILE_ID') . ',pn.PUBLISHED_PROFILES)>0)') . '
         ORDER BY pn.SORT_ORDER,pn.PUBLISHED_DATE DESC'), array('PUBLISHED_DATE' => 'ProperDate', 'CONTENT' => '_nl2br'));
 if (count($notes_RET)) {
     echo '<p>';
     ListOutput($notes_RET, array('PUBLISHED_DATE' => 'Date Posted', 'TITLE' => 'Title', 'CONTENT' => 'Note', 'SCHOOL' => 'School'), 'Note', 'Notes', array(), array(), array('save' => false, 'search' => false));
     echo '</p>';
 }
 $events_RET = DBGet(DBQuery('SELECT ce.TITLE,ce.DESCRIPTION,ce.SCHOOL_DATE,s.TITLE AS SCHOOL 
         FROM calendar_events ce,calendar_events_visibility cev,schools s
         WHERE ce.SCHOOL_DATE BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 30 DAY 
             AND ce.SYEAR=\'' . UserSyear() . '\'
             AND ce.school_id IN(' . GetUserSchools(UserID(), true) . ')
             AND s.ID=ce.SCHOOL_ID AND ce.CALENDAR_ID=cev.CALENDAR_ID 
             AND ' . (User('PROFILE_ID') == '' ? 'cev.PROFILE=\'parent\'' : 'cev.PROFILE_ID=' . User('PROFILE_ID')) . ' 
             ORDER BY ce.SCHOOL_DATE,s.TITLE'), array('SCHOOL_DATE' => 'ProperDate'));
 $events_RET1 = DBGet(DBQuery('SELECT ce.TITLE,ce.DESCRIPTION,ce.SCHOOL_DATE,s.TITLE AS SCHOOL 
         FROM calendar_events ce,schools s
         WHERE ce.SCHOOL_DATE BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 30 DAY 
             AND ce.SYEAR=\'' . UserSyear() . '\'
             AND s.ID=ce.SCHOOL_ID AND ce.CALENDAR_ID=0 ORDER BY ce.SCHOOL_DATE,s.TITLE'), array('SCHOOL_DATE' => 'ProperDate'));
 $event_count = count($events_RET) + 1;
 foreach ($events_RET1 as $events_RET_key => $events_RET_value) {
     $events_RET[$event_count] = $events_RET_value;
     $event_count++;
 }
 if (count($events_RET)) {
     echo '<p>';
开发者ID:26746647,项目名称:openSIS,代码行数:31,代码来源:Portal.php


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