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


PHP appendSQL函数代码示例

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


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

示例1: Buttons

    if (User('PROFILE') == 'admin') {
        echo '<CENTER><INPUT type=checkbox name=_search_all_schools value=Y' . (Preferences('DEFAULT_ALL_SCHOOLS') == 'Y' ? ' CHECKED' : '') . '><font color=black>Search All Schools</font></CENTER><BR>';
    }
    echo '<CENTER>' . Buttons('Submit') . '</CENTER>';
    echo '</FORM>';
    PopTable('footer');
}
if (!$_REQUEST['modfunc']) {
    if (!isset($extra)) {
        $extra = array();
    }
    Widgets('user');
    if ($_REQUEST['advanced'] == 'Y') {
        Widgets('all');
    }
    $extra['WHERE'] .= appendSQL('');
    $extra['WHERE'] .= CustomFields('where');
    echo "<FORM  name=ada_from id=ada_from onSubmit='return formcheck_ada_dates();' action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&list_by_day=" . strip_tags(trim($_REQUEST[list_by_day])) . " method=POST>";
    $advanced_link = " <A HREF=Modules.php?modname={$_REQUEST['modname']}&modfunc=search&list_by_day={$_REQUEST['list_by_day']}&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']}>Advanced</A>";
    DrawHeaderHome('<table><tr><td>' . DateInputAY($start_date, 'start', 1) . '</td><td>&nbsp;&nbsp;-&nbsp;&nbsp;</td><td>' . DateInputAY($end_date, 'end', 2) . '</td><td> - </td><td>' . $advanced_link, ' : <INPUT type=submit value=Go  class=btn_medium></td></tr></table>');
    echo '</FORM>';
    if ($_REQUEST['list_by_day'] == 'true') {
        $cal_days = 1;
        $search_stu = 0;
        if ($_REQUEST['last'] != '' || $_REQUEST['first'] != '' || $_REQUEST['stuid'] != '' || $_REQUEST['altid'] != '') {
            $stu_q = 'SELECT GROUP_CONCAT(STUDENT_ID) as STUDENT_ID FROM students WHERE ';
            $stu_q .= $_REQUEST['last'] != '' ? ' LAST_NAME=\'' . $_REQUEST['last'] . '\' OR ' : '';
            $stu_q .= $_REQUEST['first'] != '' ? ' FIRST_NAME=\'' . $_REQUEST['first'] . '\' OR ' : '';
            $stu_q .= $_REQUEST['stuid'] != '' ? ' STUDENT_ID=\'' . $_REQUEST['stuid'] . '\' OR ' : '';
            $stu_q .= $_REQUEST['altid'] != '' ? ' ALT_ID=\'' . $_REQUEST['altid'] . '\' OR ' : '';
            $stu_q = preg_replace('/ OR $/', '', $stu_q);
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:Percent.php

示例2: ListOutput

    }
    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');
        }
    }
    Widgets('course');
    Widgets('absences');
    $extra['new'] = true;
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:DailySummary_old.php

示例3: ceil

            $mins[$o] = ceil($diff / $diff_max) * ($o - 1);
            $index = 0;
            for ($i = $start; $i <= $end; $i++) {
                $index++;
                $chart['chart_data'][$index][$o] = 0;
            }
        }
        $chart['chart_data'][0][$o - 1] = $diff_max > $diff ? ceil($diff / $diff_max) * ($o - 1) : ceil($diff / $diff_max) * ($o - 2) . '+';
        $mins[$o] = ceil($diff / $diff_max) * ($o - 1);
        $extra['SELECT_ONLY'] = "CATEGORY_" . intval($_REQUEST['category_id']) . " AS TITLE," . $timeframe . " AS TIMEFRAME";
        $extra['FROM'] = ",DISCIPLINE_REFERRALS dr";
        $extra['WHERE'] = " AND dr.STUDENT_ID=ssm.STUDENT_ID AND dr.SCHOOL_ID=ssm.SCHOOL_ID AND dr.ENTRY_DATE BETWEEN '{$start_date}' AND '{$end_date}' AND CATEGORY_" . intval($_REQUEST['category_id']) . " IS NOT NULL ";
        $extra['functions'] = array('TITLE' => '_makeNumeric');
        //Widgets('all');
        //modif Francois: fix Advanced Search
        $extra['WHERE'] .= appendSQL('', $extra);
        $extra['WHERE'] .= CustomFields('where');
        $referrals_RET = GetStuList($extra);
        ksort($chart['chart_data']);
    }
    if ($_ROSARIO['SearchTerms']) {
        $chart['draw_text'][] = array('x' => 0, 'y' => 35, 'width' => $width + 200, 'height' => 100, 'h_align' => 'center', 'v_align' => 'top', 'rotation' => 0, 'text' => strip_tags(str_replace('<BR />', "\n", $_ROSARIO['SearchTerms'])), 'font' => 'Arial', 'color' => '000000', 'alpha' => 25, 'size' => 20);
    }
    if ($_REQUEST['chart_type'] != 'list') {
        //modif Francois: jqplot charts
        ?>
		<script type="text/javascript">
<?php 
        $datacolumns = 0;
        $series_labels = array();
        foreach ($chart['chart_data'] as $chart_data) {
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:31,代码来源:CategoryBreakdownTime.php

示例4: GetStuListAttn


//.........这里部分代码省略.........
                    $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 {
                $sql .= ' AND (ssm.START_DATE IS NOT NULL  AND \'' . $extra['DATE'] . '\'>=ssm.START_DATE AND (\'' . $extra['DATE'] . '\'<=ssm.END_DATE OR ssm.END_DATE IS NULL))';
                $sql .= ' AND (\'' . $extra['DATE'] . '\'>=ss.START_DATE AND (\'' . $extra['DATE'] . '\'<=ss.END_DATE OR ss.END_DATE IS NULL))';
            }
            if (!$extra['SELECT_ONLY'] && $_REQUEST['include_inactive'] == 'Y') {
                $extra['columns_after']['ACTIVE'] = 'School Status';
                $extra['columns_after']['ACTIVE_SCHEDULE'] = 'Course Status';
            }
            break;
        case 'parent':
        case 'student':
            $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'];
            }
            $sql .= ' FROM students s,student_enrollment ssm ' . $extra['FROM'] . '
					WHERE ssm.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR=\'' . UserSyear() . '\' AND ssm.SCHOOL_ID=\'' . UserSchool() . '\' AND (\'' . DBDate() . '\' BETWEEN ssm.START_DATE AND ssm.END_DATE OR (ssm.END_DATE IS NULL AND \'' . DBDate() . '\'>ssm.START_DATE)) AND ssm.STUDENT_ID' . ($extra['ASSOCIATED'] ? ' IN (SELECT STUDENT_ID FROM students_join_users WHERE STAFF_ID=\'' . $extra['ASSOCIATED'] . '\')' : '=\'' . UserStudentID() . '\'');
            break;
        default:
            exit('Error');
    }
    $sql = appendSQL($sql, $extra);
    $sql .= $extra['WHERE'] . ' ';
    $sql .= CustomFields('where');
    if ($extra['GROUP']) {
        $sql .= ' GROUP BY ' . $extra['GROUP'];
    }
    if (!$extra['ORDER_BY'] && !$extra['SELECT_ONLY']) {
        if (Preferences('SORT') == 'Grade') {
            $sql .= ' ORDER BY (SELECT SORT_ORDER FROM school_gradelevels WHERE ID=ssm.GRADE_ID),FULL_NAME';
        } else {
            $sql .= ' ORDER BY FULL_NAME';
        }
        $sql .= $extra['ORDER'];
    } elseif ($extra['ORDER_BY']) {
        $sql .= ' ORDER BY ' . $extra['ORDER_BY'];
    }
    if ($extra['DEBUG'] === true) {
        echo '<!--' . $sql . '-->';
    }
    return DBGet(DBQuery($sql), $functions, $extra['group']);
}
开发者ID:jicheng17,项目名称:fenghua,代码行数:101,代码来源:CustomFunctionsFnc.php

示例5: Widgets

         Widgets('all', $extra);
     }
 }
 if (!$extra['NoSearchTerms']) {
     if ($_REQUEST['_search_all_schools'] == 'Y') {
         $_ROSARIO['SearchTerms'] .= '<span style="color:gray"><b>' . _('Search All Schools') . '</b></span><BR />';
     }
     if ($_REQUEST['include_inactive'] == 'Y') {
         $_ROSARIO['SearchTerms'] .= '<span style="color:gray"><b>' . _('Include Inactive Students') . '</b></span><BR />';
     }
 }
 if ($_REQUEST['address_group']) {
     $extra['SELECT'] .= ",coalesce((SELECT ADDRESS_ID FROM STUDENTS_JOIN_ADDRESS WHERE STUDENT_ID=ssm.STUDENT_ID AND RESIDENCE='Y' LIMIT 1),-ssm.STUDENT_ID) AS FAMILY_ID";
     $extra['group'] = $extra['LO_group'] = array('FAMILY_ID');
 }
 $extra['WHERE'] .= appendSQL('', array('NoSearchTerms' => $extra['NoSearchTerms']));
 $extra['WHERE'] .= CustomFields('where', 'student', array('NoSearchTerms' => $extra['NoSearchTerms']));
 $students_RET = GetStuList($extra);
 if ($extra['array_function'] && function_exists($extra['array_function'])) {
     if ($_REQUEST['address_group']) {
         foreach ($students_RET as $id => $student_RET) {
             $students_RET[$id] = $extra['array_function']($student_RET);
         }
     } else {
         $students_RET = $extra['array_function']($students_RET);
     }
 }
 $name_link['FULL_NAME']['link'] = 'Modules.php?modname=' . $_REQUEST['next_modname'];
 $name_link['FULL_NAME']['variables'] = array('student_id' => 'STUDENT_ID');
 if ($_REQUEST['_search_all_schools']) {
     $name_link['FULL_NAME']['variables']['school_id'] = 'SCHOOL_ID';
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:31,代码来源:Search.inc.php

示例6: _getResults

function _getResults($type, $number, $index = '')
{
    global $num, $remote_type;
    $type = trim($type);
    $start_REQUEST = $_REQUEST;
    if (isset($_REQUEST['screen'][$num])) {
        $_REQUEST = $_REQUEST['screen'][$num];
    }
    foreach ((array) $_REQUEST as $key => $value) {
        // Is array
        // for example: ['cust[CUSTOM_XXX]'] or ['month_cust_begin[CUSTOM_XXX]']
        // => ['cust']['CUSTOM_XXX']
        if (mb_strpos($key, 'cust') !== false && mb_strpos($key, '[') !== false) {
            $_REQUEST[mb_substr($key, 0, mb_strpos($key, '['))][mb_substr($key, mb_strpos($key, '[') + 1)] = $value;
            unset($_REQUEST[$key]);
        }
    }
    $min_max_date = DBGet(DBQuery("SELECT to_char(min(SCHOOL_DATE),'dd-MON-yy') AS MIN_DATE,\n\t\tto_char(max(SCHOOL_DATE),'dd-MON-yy') AS MAX_DATE\n\t\tFROM ATTENDANCE_CALENDAR\n\t\tWHERE SYEAR='" . UserSyear() . "'"));
    if (isset($_REQUEST['day_start']) && isset($_REQUEST['month_start']) && isset($_REQUEST['year_start'])) {
        $start_date = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['year_start'];
    } else {
        $start_date = $min_max_date[1]['MIN_DATE'];
    }
    if (isset($_REQUEST['day_end']) && isset($_REQUEST['month_end']) && isset($_REQUEST['year_end'])) {
        $end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'];
    } else {
        $end_date = $min_max_date[1]['MAX_DATE'];
    }
    $extra = appendSQL('');
    if (isset($_REQUEST['school'])) {
        $extra .= " AND ssm.SCHOOL_ID = '" . $_REQUEST['school'] . "' ";
    }
    $extra .= CustomFields('where');
    if (isset($_REQUEST['age'])) {
        // We could have used AGE() function since PostgreSQL 8.4.
        $extra .= " AND (DATE_PART('day', CURRENT_TIMESTAMP - s.CUSTOM_200000004::timestamp) / 365.25)::int = " . $_REQUEST['age'] . ' ';
    }
    $schools = mb_substr(str_replace(",", "','", User('SCHOOLS')), 2, -2);
    if (isset($_REQUEST['school'])) {
        $extra_schools = '';
    } elseif (!isset($_REQUEST['_search_all_schools']) || $_REQUEST['_search_all_schools'] != 'Y') {
        $extra_schools = "SCHOOL_ID='" . UserSchool() . "' AND ";
    } elseif ($schools) {
        $extra_schools = "SCHOOL_ID IN (" . $schools . ") AND ";
    }
    $array = array();
    /*if(mb_substr($type,0,7)=='orchard')
    	{
    		$test_title = mb_substr($type,9,-6);
    		$type = 'orchard_test';
    	}*/
    switch ($type) {
        case 'present':
            if (!mb_strpos($extra, 'GROUP')) {
                $extra .= " GROUP BY ad.SCHOOL_DATE";
            }
            $present_RET = DBGet(DBQuery("SELECT ad.SCHOOL_DATE,COALESCE(sum(ad.STATE_VALUE),0) AS STATE_VALUE\n\t\t\t\tFROM ATTENDANCE_DAY ad,STUDENT_ENROLLMENT ssm,STUDENTS s\n\t\t\t\tWHERE s.STUDENT_ID=ssm.STUDENT_ID\n\t\t\t\tAND " . str_replace('SCHOOL_ID', 'ssm.SCHOOL_ID', $extra_schools) . " ad.STUDENT_ID=ssm.STUDENT_ID\n\t\t\t\tAND ssm.SYEAR='" . UserSyear() . "'\n\t\t\t\tAND ad.SYEAR=ssm.SYEAR\n\t\t\t\tAND ad.SCHOOL_DATE BETWEEN '" . $start_date . "' AND '" . $end_date . "'\n\t\t\t\tAND (ad.SCHOOL_DATE BETWEEN ssm.START_DATE AND ssm.END_DATE\n\t\t\t\t\tOR (ssm.END_DATE IS NULL AND ssm.START_DATE <= ad.SCHOOL_DATE)) " . $extra));
            foreach ((array) $present_RET as $present) {
                if ($index) {
                    $array[$present[$index]] = $present['STATE_VALUE'];
                } else {
                    $array[] = $present['STATE_VALUE'];
                }
            }
            break;
        case 'absent':
            if (!mb_strpos($extra, 'GROUP')) {
                $extra .= " GROUP BY ad.SCHOOL_DATE";
            }
            $absent_RET = DBGet(DBQuery("SELECT ad.SCHOOL_DATE,COALESCE(sum(ad.STATE_VALUE-1)*-1,0) AS STATE_VALUE\n\t\t\t\tFROM ATTENDANCE_DAY ad,STUDENT_ENROLLMENT ssm,STUDENTS s\n\t\t\t\tWHERE s.STUDENT_ID=ssm.STUDENT_ID\n\t\t\t\tAND " . str_replace('SCHOOL_ID', 'ssm.SCHOOL_ID', $extra_schools) . " ad.STUDENT_ID=ssm.STUDENT_ID\n\t\t\t\tAND ssm.SYEAR='" . UserSyear() . "'\n\t\t\t\tAND ad.SYEAR=ssm.SYEAR\n\t\t\t\tAND ad.SCHOOL_DATE BETWEEN '" . $start_date . "' AND '" . $end_date . "'\n\t\t\t\tAND (ad.SCHOOL_DATE BETWEEN ssm.START_DATE AND ssm.END_DATE\n\t\t\t\t\tOR (ssm.END_DATE IS NULL AND ssm.START_DATE <= ad.SCHOOL_DATE)) " . $extra));
            foreach ((array) $absent_RET as $absent) {
                if ($index) {
                    $array[$absent[$index]] = $absent['STATE_VALUE'];
                } else {
                    $array[] = $absent['STATE_VALUE'];
                }
            }
            break;
        case 'enrolled':
            if (!mb_strpos($extra, 'GROUP')) {
                $extra .= " GROUP BY ac.SCHOOL_DATE";
            }
            $enrolled_RET = DBGet(DBQuery("SELECT ac.SCHOOL_DATE,count(*) AS STUDENTS\n\t\t\t\tFROM STUDENT_ENROLLMENT ssm,ATTENDANCE_CALENDAR ac,STUDENTS s\n\t\t\t\tWHERE s.STUDENT_ID=ssm.STUDENT_ID\n\t\t\t\tAND ssm.SYEAR='" . UserSyear() . "'\n\t\t\t\tAND ac.SYEAR=ssm.SYEAR\n\t\t\t\tAND ac.CALENDAR_ID=ssm.CALENDAR_ID\n\t\t\t\tAND " . str_replace('SCHOOL_ID', 'ssm.SCHOOL_ID', $extra_schools) . " ssm.SCHOOL_ID=ac.SCHOOL_ID\n\t\t\t\tAND (ac.SCHOOL_DATE BETWEEN ssm.START_DATE AND ssm.END_DATE OR\n\t\t\t\t\t(ssm.END_DATE IS NULL AND ssm.START_DATE <= ac.SCHOOL_DATE))\n\t\t\t\tAND ac.SCHOOL_DATE BETWEEN '" . $start_date . "' AND '" . $end_date . "' " . $extra));
            foreach ((array) $enrolled_RET as $enrolled) {
                if ($index) {
                    $array[$enrolled[$index]] = $enrolled['STUDENTS'];
                } else {
                    $array[] = $enrolled['STUDENTS'];
                }
            }
            break;
        case 'student id':
            $student_id_RET = DBGet(DBQuery("SELECT ssm.STUDENT_ID\n\t\t\t\tFROM STUDENT_ENROLLMENT ssm,STUDENTS s\n\t\t\t\tWHERE s.STUDENT_ID=ssm.STUDENT_ID\n\t\t\t\tAND " . str_replace('SCHOOL_ID', 'ssm.SCHOOL_ID', $extra_schools) . " ssm.SYEAR='" . UserSyear() . "'\n\t\t\t\tAND ('" . DBDate() . "' BETWEEN ssm.START_DATE AND ssm.END_DATE OR ssm.END_DATE IS NULL) " . $extra));
            foreach ((array) $student_id_RET as $student_id) {
                if ($index) {
                    $array[$student_id[$index]] = $student_id['STUDENT_ID'];
                } else {
                    $array[] = $student_id['STUDENT_ID'];
                }
            }
//.........这里部分代码省略.........
开发者ID:francoisjacquet,项目名称:Reports,代码行数:101,代码来源:ReportsCalculations.fnc.php

示例7: GetStuList


//.........这里部分代码省略.........
                $sql .= ',student_medical_alerts sma ';
            }
            if ($_REQUEST['reason'] || $_REQUEST['result'] || $_REQUEST['med_vist_comments'] || $_REQUEST['nv_day'] || $_REQUEST['nv_month'] || $_REQUEST['nv_year']) {
                $sql .= ',student_medical_visits smv ';
            }
            $sql .= ' ,student_enrollment ssm ';
            $sql .= $extra['FROM'] . ' WHERE ssm.STUDENT_ID=s.STUDENT_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 (ss.MARKING_PERIOD_ID IN (' . GetAllMP('', $queryMP) . ')   OR (ss.START_DATE<=\'' . date('Y-m-d') . '\'  AND (ss.END_DATE>=\'' . date('Y-m-d') . '\'  OR ss.END_DATE IS NULL)))
					AND (cp.TEACHER_ID=\'' . User('STAFF_ID') . '\' OR cp.SECONDARY_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 ($_REQUEST['include_inactive'] == 'Y') {
                $sql .= ' AND ssm.ID=(SELECT ID FROM student_enrollment WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR=ssm.SYEAR AND SCHOOL_ID=\'' . UserSchool() . '\' 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 {
                $sql .= $_SESSION['inactive_stu_filter'] = ' AND (ssm.START_DATE IS NOT NULL AND (\'' . $extra['DATE'] . '\'<=ssm.END_DATE OR ssm.END_DATE IS NULL))';
                $sql .= $_SESSION['inactive_stu_filter'] = ' AND (ssm.START_DATE IS NOT NULL AND (\'' . $extra['DATE'] . '\'<=ss.END_DATE OR ss.END_DATE IS NULL))';
                // $sql .= " AND ('".$extra['DATE']."'>=ssm.START_DATE AND ('".$extra['DATE']."'<=ssm.END_DATE OR ssm.END_DATE IS NULL))";
                //$sql .= " AND ('".$extra['DATE']."'>=ss.START_DATE AND ('".$extra['DATE']."'<=ss.END_DATE OR ss.END_DATE IS NULL))";
            }
            if (!$extra['SELECT_ONLY'] && $_REQUEST['include_inactive'] == 'Y') {
                $extra['columns_after']['ACTIVE'] = 'School Status';
                $extra['columns_after']['ACTIVE_SCHEDULE'] = 'Course Status';
            }
            break;
        case 'parent':
        case 'student':
            $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,s.ALT_ID,ssm.SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
            }
            $sql .= ' FROM students s,student_enrollment ssm ' . $extra['FROM'] . '
					WHERE ssm.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR=\'' . UserSyear() . '\' AND ssm.SCHOOL_ID=\'' . UserSchool() . '\' AND (\'' . DBDate() . '\' BETWEEN ssm.START_DATE AND ssm.END_DATE OR (ssm.END_DATE IS NULL AND \'' . DBDate() . '\'>ssm.START_DATE)) AND ssm.STUDENT_ID' . ($extra['ASSOCIATED'] ? ' IN (SELECT STUDENT_ID FROM students_join_people WHERE PERSON_ID=\'' . $extra['ASSOCIATED'] . '\')' : '=\'' . UserStudentID() . '\'');
            break;
        default:
            exit('Error');
    }
    if ($expanded_view == true) {
        $custom_str = CustomFields('where', '', 1);
        if ($custom_str != '') {
            $_SESSION['custom_count_sql'] = $custom_str;
        }
        $sql .= $custom_str;
    } elseif ($expanded_view == false) {
        $custom_str = CustomFields('where', '', 2);
        if ($custom_str != '') {
            $_SESSION['custom_count_sql'] = $custom_str;
        }
        $sql .= $custom_str;
    } else {
        $custom_str = CustomFields('where');
        if ($custom_str != '') {
            $_SESSION['custom_count_sql'] = $custom_str;
        }
        $sql .= $custom_str;
    }
    $sql .= $extra['WHERE'] . ' ';
    $sql = appendSQL($sql, $extra);
    //        TODO               Modification Required
    //        if($_SESSION['stu_search']['sql'] && $_REQUEST['return_session'] && $extra['SELECT']!='' && strpos($sql,'address a')==0)
    //        {
    //            $sql = str_replace("FROM", $extra['SELECT']." FROM",$sql);
    //        }
    //
    //        if($_SESSION['stu_search']['sql'] && $_REQUEST['return_session'] && $extra['FROM']!='' && strpos($sql,'address a')==0)
    //        {
    //            $sql = str_replace("WHERE",$extra['FROM']." WHERE",$sql);
    //
    //        }
    //        --------------------------------------------------
    if ($extra['GROUP']) {
        $sql .= ' GROUP BY ' . $extra['GROUP'];
    }
    if (!$extra['ORDER_BY'] && !$extra['SELECT_ONLY']) {
        if (Preferences('SORT') == 'Grade') {
            $sql .= ' ORDER BY (SELECT SORT_ORDER FROM school_gradelevels WHERE ID=ssm.GRADE_ID),FULL_NAME';
        } else {
            $sql .= ' ORDER BY FULL_NAME';
        }
        $sql .= $extra['ORDER'];
    } elseif ($extra['ORDER_BY'] && !($_SESSION['stu_search']['sql'] && $_REQUEST['return_session'])) {
        $sql .= ' ORDER BY ' . $extra['ORDER_BY'];
    }
    if ($extra['DEBUG'] === true) {
        echo '<!--' . $sql . '-->';
    }
    $return = DBGet(DBQuery($sql), $functions, $extra['group']);
    $_SESSION['count_stu'] = count($return);
    if ($_REQUEST['modname'] == 'Students/Student.php' && $_REQUEST['search_modfunc'] == 'list') {
        $_SESSION['total_stu'] = $_SESSION['count_stu'];
    }
    return $return;
}
开发者ID:26746647,项目名称:openSIS,代码行数:101,代码来源:GetStuList.fnc.php

示例8: GetStuListAttn


//.........这里部分代码省略.........
            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 ('" . date('Y-m-d', strtotime($extra['DATE'])) . "'>ssm.START_DATE 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 ('" . date('Y-m-d', strtotime($extra['DATE'])) . "'>=ssm.START_DATE 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 {
                if (User('SCHOOLS')) {
                    $sql .= " AND ssm.SCHOOL_ID IN (" . substr(str_replace(',', "','", User('SCHOOLS')), 2, -2) . ") ";
                }
                $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("('" . $extra['DATE'] . "'>=ssm.START_DATE 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 " . $extra['FROM'] . " WHERE ssm.STUDENT_ID=s.STUDENT_ID AND ssm.STUDENT_ID=ss.STUDENT_ID\r\n\t\t\t\t\tAND ssm.SCHOOL_ID='" . UserSchool() . "' AND ssm.SYEAR='" . UserSyear() . "' AND ssm.SYEAR=cp.SYEAR AND ssm.SYEAR=ss.SYEAR\r\n\t\t\t\t\tAND ss.MARKING_PERIOD_ID IN (" . GetAllMP('', $queryMP) . ")\r\n\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() . "'\r\n\t\t\t\t\tAND cp.COURSE_ID=ss.COURSE_ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID";
            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 {
                $sql .= " AND ('" . $extra['DATE'] . "'>=ssm.START_DATE AND ('" . $extra['DATE'] . "'<=ssm.END_DATE OR ssm.END_DATE IS NULL))";
                $sql .= " AND ('" . $extra['DATE'] . "'>=ss.START_DATE AND ('" . $extra['DATE'] . "'<=ss.END_DATE OR ss.END_DATE IS NULL))";
            }
            if (!$extra['SELECT_ONLY'] && $_REQUEST['include_inactive'] == 'Y') {
                $extra['columns_after']['ACTIVE'] = 'School Status';
                $extra['columns_after']['ACTIVE_SCHEDULE'] = 'Course Status';
            }
            break;
        case 'parent':
        case 'student':
            $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'];
            }
            $sql .= " FROM STUDENTS s,STUDENT_ENROLLMENT ssm " . $extra['FROM'] . "\r\n\t\t\t\t\tWHERE ssm.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR='" . UserSyear() . "' AND ssm.SCHOOL_ID='" . UserSchool() . "' AND ('" . DBDate() . "' BETWEEN ssm.START_DATE AND ssm.END_DATE OR (ssm.END_DATE IS NULL AND '" . DBDate() . "'>ssm.START_DATE)) AND ssm.STUDENT_ID" . ($extra['ASSOCIATED'] ? " IN (SELECT STUDENT_ID FROM STUDENTS_JOIN_USERS WHERE STAFF_ID='" . $extra['ASSOCIATED'] . "')" : "='" . UserStudentID() . "'");
            break;
        default:
            exit('Error');
    }
    $sql = appendSQL($sql, $extra);
    $sql .= $extra['WHERE'] . ' ';
    $sql .= CustomFields('where');
    if ($extra['GROUP']) {
        $sql .= ' GROUP BY ' . $extra['GROUP'];
    }
    if (!$extra['ORDER_BY'] && !$extra['SELECT_ONLY']) {
        if (Preferences('SORT') == 'Grade') {
            $sql .= " ORDER BY (SELECT SORT_ORDER FROM SCHOOL_GRADELEVELS WHERE ID=ssm.GRADE_ID),FULL_NAME";
        } else {
            $sql .= " ORDER BY FULL_NAME";
        }
        $sql .= $extra['ORDER'];
    } elseif ($extra['ORDER_BY']) {
        $sql .= ' ORDER BY ' . $extra['ORDER_BY'];
    }
    if ($extra['DEBUG'] === true) {
        echo '<!--' . $sql . '-->';
    }
    return DBGet(DBQuery($sql), $functions, $extra['group']);
}
开发者ID:26746647,项目名称:Belize-openSIS,代码行数:101,代码来源:custom_functions.fnc.php

示例9: appendSQL

        $pcompare = 'listing_price';
        $pricef = $price_from * 1000;
        $pricet = $price_to * 1000;
    }
    if ($pricef == 1000000) {
        $sqlend = appendSQL($sqlend, ' and ' . $pcompare . '>=1000000');
    } else {
        if ($pricet == 1000000) {
            $sqlend = appendSQL($sqlend, $pcompare . '>=' . $pricef);
        } else {
            $sqlend = appendSQL($sqlend, '(' . $pcompare . ' between ' . $pricef . ' and ' . $pricet . ')');
        }
    }
    $sqlend = appendSQL($sqlend, 'ts.municipalityid=' . $_SESSION['municipalityid']);
}
$sqlend = appendSQL($sqlend, 'subdivision=ts.id');
$sql .= $sqlend . ' order by listing_price desc';
$result = mysql_query($sql);
$xml = '<?xml version="1.0" encoding="ISO-8859-15"?>';
$xml .= '<search>';
if ($result and mysql_num_rows($result) > 0) {
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $img = '';
        $sql2 = 'select * from tb_listing_images where listingid=' . $row['lid'] . ' order by ordr asc';
        $res = mysql_query($sql2);
        if (mysql_num_rows($res) > 0) {
            $rw = mysql_fetch_array($res, MYSQL_ASSOC);
            $img = $rw['imagename'] . '_sm4.' . $rw['ext'];
        } else {
            $img = 'thumb.jpg';
        }
开发者ID:Emaren,项目名称:agentpage,代码行数:31,代码来源:getsearch.php


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