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


PHP get_field_select函数代码示例

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


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

示例1: wikibook_page_content

function wikibook_page_content($pagename)
{
    global $WS;
    $select = "dfwiki = {$WS->dfwiki->id} AND pagename = '{$pagename}' " . "AND groupid = {$WS->groupmember->groupid}";
    if ($WS->dfwiki->studentmode != '0' || $WS->cm->groupmode == '0') {
        $select .= " AND ownerid = {$WS->member->id}";
    }
    if ($version = get_field_select('wiki_pages', 'MAX(version)', $select)) {
        if ($record = get_record_select('wiki_pages', $select . " AND version = {$version}")) {
            return $record->content;
        }
    }
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:13,代码来源:wikibook.php

示例2: game_bottomtext_onupdate

function game_bottomtext_onupdate()
{
    global $CFG;
    $update = $_POST['update'];
    $sesskey = $_POST['sesskey'];
    $top = $_POST['top'];
    $field = $top ? 'toptext' : 'bottomtext';
    $gameid = get_field_select("course_modules", "instance", "id={$update}");
    $game->id = $gameid;
    $game->{$field} = $_POST[$field];
    if (!update_record('game', $game)) {
        error("game_bottomtext_onupdate: Can't update game id={$game->id}");
    }
    redirect("{$CFG->wwwroot}/course/mod.php?update={$update}&sesskey={$sesskey}&sr=1");
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:15,代码来源:bottomtext.php

示例3: process_form

 function process_form()
 {
     $tag = optional_param('tag', '', PARAM_TEXT);
     $delete = optional_param('delete', 0, PARAM_INT);
     if (!empty($tag)) {
         $record = new object();
         $record->gallery = $this->gallery->id;
         $record->image = $this->image;
         $record->metatype = 'tag';
         $record->description = strtolower($tag);
         insert_record('lightboxgallery_image_meta', $record);
     } else {
         if ($delete) {
             $select = "metatype = 'tag' AND id = {$delete} AND gallery = {$this->gallery->id} AND image = '{$this->image}'";
             if ($id = get_field_select('lightboxgallery_image_meta', 'id', $select)) {
                 delete_records('lightboxgallery_image_meta', 'id', $id);
             }
         }
     }
 }
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:20,代码来源:tag.class.php

示例4: game_sudoku_check_last

function game_sudoku_check_last($id, $game, $attempt, $sudoku, $finishattempt)
{
    global $CFG;
    $correct = get_field_select('game_queries', 'COUNT(*) AS c', "attemptid={$attempt->id} AND score > 0.9");
    $all = get_field_select('game_queries', 'COUNT(*) AS c', "attemptid={$attempt->id}");
    if ($all) {
        $grade = $correct / $all;
    } else {
        $grade = 0;
    }
    game_updateattempts($game, $attempt, $grade, $finishattempt);
    redirect("{$CFG->wwwroot}/mod/game/attempt.php?id={$id}", '', 0);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:13,代码来源:play.php

示例5: wiki_info_content


//.........这里部分代码省略.........
        $prop->header = "true";
        $prop->valign = "top";
        $prop->class = "nwikileftnow header c2";
        wiki_change_column($prop);
        echo get_string('lastmodified');
        if (wiki_grade_got_permission($WS)) {
            $prop = null;
            $prop->header = "true";
            $prop->valign = "top";
            $prop->class = "nwikileftnow header c3";
            wiki_change_column($prop);
            echo get_string('eval_editions_quality', 'wiki');
        }
        $prop = null;
        $prop->header = "true";
        //print content
        $i = 0;
        foreach ($vers as $ver) {
            if ($ver->highlight) {
                $class = "textcenter nwikihighlight";
            } else {
                $class = "textcenter nwikibargroundblanco";
            }
            if (isset($prop->header)) {
                $prop->class = $class;
                wiki_change_row($prop);
            } else {
                $prop = null;
                $prop->class = $class;
                wiki_change_row($prop);
            }
            // input types for history diff
            if ($countver > 1) {
                $style = 'style="visibility:hidden" ';
                $checked = 'checked="checked"';
                if ($i == 0) {
                    echo '<input type="radio" value="' . $ver->version . '" name="oldid" ' . $style . ' />';
                    echo '<input type="radio" value="' . $ver->version . '" name="diff" ' . $checked . ' />';
                } elseif ($i == 1) {
                    echo '<input type="radio" value="' . $ver->version . '" name="oldid" ' . $checked . ' />';
                    echo '<input type="radio" value="' . $ver->version . '" name="diff" ' . $style . ' />';
                } else {
                    echo '<input type="radio" value="' . $ver->version . '" name="oldid" />';
                    echo '<input type="radio" value="' . $ver->version . '" name="diff" ' . $style . ' />';
                }
                $prop = null;
                $prop->class = $class;
                wiki_change_column($prop);
            }
            if ($ver->version == $WS->pagedata->version) {
                echo $ver->version;
            } else {
                $prop = null;
                $prop->href = "javascript:document.forms['formu" . $i . "'].submit()";
                $out = wiki_a($ver->version, $prop, true);
                $prop = null;
                $prop->name = "dfcontent";
                $prop->value = "11";
                $out .= wiki_input_hidden($prop, true);
                $out2 = wiki_div($out, '', true);
                $prop = null;
                $prop->id = "formu{$i}";
                $prop->action = "view.php?id={$WS->linkid}&amp;page=" . urlencode("oldversion/{$ver->pagename}") . "&amp;ver={$ver->version}&amp;gid={$WS->groupmember->groupid}&amp;uid={$WS->member->id}";
                $prop->method = "post";
                wiki_form($out2, $prop);
            }
            $prop = null;
            $prop->class = $class;
            wiki_change_column($prop);
            $author = wiki_get_user_info($ver->author);
            echo $author;
            $prop = null;
            $prop->class = $class;
            wiki_change_column($prop);
            $modified = strftime('%A, %d %B %Y %H:%M', $ver->lastmodified);
            echo $modified;
            if (wiki_grade_got_permission($WS)) {
                $prop = null;
                $prop->class = $class;
                wiki_change_column($prop);
                $scale = array(1 => "+", 2 => "=", 3 => "-");
                $gradevalue = get_field_select('wiki_evaluation_edition', 'valoration', 'wiki_pageid=' . $ver->id);
                if ($gradevalue) {
                    echo wiki_grade_translate($gradevalue, $scale);
                } else {
                    echo get_string('eval_notset', 'wiki');
                }
            }
            $i++;
        }
        wiki_table_end();
        if ($countver > 1) {
            echo '<br/>';
            echo '<input type="submit" name="' . get_string('compareversions', 'wiki') . '" value="' . get_string('compareversions', 'wiki') . '"/>';
        }
        echo '</form>';
    } else {
        print_string('noversion', 'wiki');
    }
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:locallib.php

示例6: get_field_select

 function get_field_select($table, $return, $select)
 {
     global $CFG;
     $CFG->prefix = $this->prefix;
     $records = get_field_select($table, $return, $select);
     $CFG->prefix = $this->newmoodleprefix;
     return $records;
 }
开发者ID:remotelearner,项目名称:elis.cm,代码行数:8,代码来源:data.class.php

示例7: game_hiddenpicture_check_questions

function game_hiddenpicture_check_questions($id, $game, &$attempt, &$hiddenpicture, $finishattempt)
{
    global $QTYPES, $CFG;
    $responses = data_submitted();
    $offsetquestions = game_sudoku_compute_offsetquestions($game->sourcemodule, $attempt, $numbers, $correctquestions);
    $questionlist = game_sudoku_getquestionlist($offsetquestions);
    $questions = game_sudoku_getquestions($questionlist);
    $actions = question_extract_responses($questions, $responses, QUESTION_EVENTSUBMIT);
    $correct = $wrong = 0;
    foreach ($questions as $question) {
        if (!array_key_exists($question->id, $actions)) {
            //no answered
            continue;
        }
        unset($state);
        unset($cmoptions);
        $question->maxgrade = 100;
        $state->responses = $actions[$question->id]->responses;
        $state->event = QUESTION_EVENTGRADE;
        $cmoptions = array();
        $QTYPES[$question->qtype]->grade_responses($question, $state, $cmoptions);
        unset($query);
        $select = "attemptid={$attempt->id}";
        $select .= " AND questionid={$question->id}";
        if (($query->id = get_field_select('game_queries', 'id', $select)) == 0) {
            die("problem game_hiddenpicture_check_questions (select={$select})");
            continue;
        }
        $answertext = $state->responses[''];
        if ($answertext != '') {
            $grade = $state->raw_grade;
            if ($grade < 50) {
                //wrong answer
                game_update_queries($game, $attempt, $query, $grade / 100, $answertext);
                $wrong++;
            } else {
                //correct answer
                game_update_queries($game, $attempt, $query, 1, $answertext);
                $correct++;
            }
        }
    }
    $hiddenpicture->correct += $correct;
    $hiddenpicture->wrong += $wrong;
    if (!update_record('game_hiddenpicture', $hiddenpicture)) {
        error('game_hiddenpicture_check_questions: error updating in game_hiddenpicture');
    }
    $attempt->score = game_hidden_picture_computescore($game, $hiddenpicture);
    if (!update_record('game_attempts', $attempt)) {
        error('game_hiddenpicture_check_questions: error updating in game_attempt');
    }
    game_sudoku_check_last($id, $game, $attempt, $hiddenpicture, $finishattempt);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:53,代码来源:play.php

示例8: insert

 /**
  * In addition to perform parent::insert(), calls force_regrading() method too.
  * @param string $source from where was the object inserted (mod/forum, manual, etc.)
  * @return int PK ID if successful, false otherwise
  */
 function insert($source = null)
 {
     global $CFG;
     if (empty($this->courseid)) {
         error('Can not insert grade item without course id!');
     }
     // load scale if needed
     $this->load_scale();
     // add parent category if needed
     if (empty($this->categoryid) and !$this->is_course_item() and !$this->is_category_item()) {
         $course_category = grade_category::fetch_course_category($this->courseid);
         $this->categoryid = $course_category->id;
     }
     // always place the new items at the end, move them after insert if needed
     $last_sortorder = get_field_select('grade_items', 'MAX(sortorder)', "courseid = {$this->courseid}");
     if (!empty($last_sortorder)) {
         $this->sortorder = $last_sortorder + 1;
     } else {
         $this->sortorder = 1;
     }
     // add proper item numbers to manual items
     if ($this->itemtype == 'manual') {
         if (empty($this->itemnumber)) {
             $this->itemnumber = 0;
         }
     }
     // make sure there is not 0 in outcomeid
     if (empty($this->outcomeid)) {
         $this->outcomeid = null;
     }
     $this->timecreated = $this->timemodified = time();
     if (parent::insert($source)) {
         // force regrading of items if needed
         $this->force_regrading();
         return $this->id;
     } else {
         debugging("Could not insert this grade_item in the database!");
         return false;
     }
 }
开发者ID:r007,项目名称:PMoodle,代码行数:45,代码来源:grade_item.php

示例9: user_activity_task_process

/**
 * Process a chunk of the task
 *
 * @param array $state the task state
 */
function user_activity_task_process(&$state)
{
    global $CFG;
    $sessiontimeout = $state['sessiontimeout'];
    $sessiontail = $state['sessiontail'];
    $starttime = $state['starttime'];
    // find the record ID corresponding to our start time
    $startrec = get_field_select('log', 'MIN(id)', "time >= {$starttime}");
    $startrec = empty($startrec) ? 0 : $startrec;
    // find the last record that's close to our chunk size, without
    // splitting a second between runs
    $endtime = get_field_select('log', 'MIN(time)', 'id >= ' . ($startrec + USERACT_RECORD_CHUNK));
    if (!$endtime) {
        $endtime = time();
    }
    // Get the logs between the last time we ran, and the current time.  Sort
    // by userid (so all records for a given user are together), and then by
    // time (so that we process a user's logs sequentially).
    $recstarttime = max(0, $starttime - $state['sessiontimeout']);
    $rs = get_recordset_select('log', "time >= {$recstarttime} AND time < {$endtime} AND userid != 0", 'userid, time');
    if ($CFG->debug >= DEBUG_ALL) {
        mtrace("* processing records from time:{$starttime} to time:{$endtime}");
    }
    $curuser = -1;
    $session_start = 0;
    $last_course = -1;
    $module_session_start = 0;
    $last_module = -1;
    $last_time = 0;
    if ($rs) {
        while ($rec = rs_fetch_next_record($rs)) {
            if ($rec->userid != $curuser) {
                // end of user's record
                if ($curuser > 0 && $session_start > 0) {
                    // flush current session data
                    if ($last_time > $endtime - $sessiontimeout) {
                        /* Last record is within the session timeout of our end
                         * time for this run.  Just use our last logged time as
                         * the session end time, and the rest will be picked up
                         * by the next run of the sessionizer. */
                        $session_end = $last_time;
                    } else {
                        /* Last record is not within the session timeout of our
                         * end time for this run, so do our normal session
                         * ending. */
                        $session_end = $last_time + $sessiontail;
                    }
                    user_activity_add_session($curuser, $last_course, $session_start, $session_end);
                    if ($last_module > 0) {
                        user_module_activity_add_session($curuser, $last_course, $last_module, $module_session_start, $session_end);
                    }
                }
                $curuser = $rec->userid;
                $session_start = 0;
                $last_course = -1;
                $module_session_start = 0;
                $last_module = -1;
                $last_time = 0;
            }
            if ($rec->time < $starttime) {
                // Find the last log for the user before our start time, that's
                // within the session timeout, and start the session with that
                // record.
                $session_start = $rec->time;
                $last_time = $rec->time;
                $last_course = $rec->course;
                $module_session_start = $rec->time;
                $last_module = $rec->cmid;
            } elseif ($rec->time > $last_time + $sessiontimeout) {
                if ($last_course >= 0) {
                    // session timed out -- add record
                    if (defined('ETLUA_EXTRA_DEBUG') && $CFG->debug >= DEBUG_DEVELOPER) {
                        mtrace('** session timed out');
                    }
                    $session_end = $last_time + $sessiontail;
                    user_activity_add_session($curuser, $last_course, $session_start, $session_end);
                    if ($last_module > 0) {
                        user_module_activity_add_session($curuser, $last_course, $last_module, $module_session_start, $session_end);
                    }
                }
                // start a new session with the current record
                $session_start = $rec->time;
                $last_course = $rec->course;
                $module_session_start = $rec->time;
                $last_module = $rec->cmid;
            } elseif ($rec->action === 'logout') {
                // user logged out -- add record
                if (defined('ETLUA_EXTRA_DEBUG') && $CFG->debug >= DEBUG_DEVELOPER) {
                    mtrace('** user logged out');
                }
                $session_end = $rec->time;
                user_activity_add_session($curuser, $last_course, $session_start, $session_end);
                if ($last_module > 0) {
                    user_module_activity_add_session($curuser, $last_course, $last_module, $module_session_start, $session_end);
                }
//.........这里部分代码省略.........
开发者ID:remotelearner,项目名称:elis.cm,代码行数:101,代码来源:etl.php

示例10: test_get_field_select

 function test_get_field_select()
 {
     $this->assertEqual(get_field_select($this->table, 'numberfield', 'id = 1'), 101);
 }
开发者ID:r007,项目名称:PMoodle,代码行数:4,代码来源:testdmllib.php

示例11: tracker_submitanissue

/**
* submits an issue in the current tracker
* @uses $CFG
* @param int $trackerid the current tracker
*/
function tracker_submitanissue(&$tracker)
{
    global $CFG;
    $issue->datereported = required_param('datereported', PARAM_INT);
    $issue->summary = required_param('summary', PARAM_TEXT);
    $issue->description = addslashes(required_param('description', PARAM_CLEANHTML));
    $issue->format = addslashes(required_param('format', PARAM_CLEANHTML));
    $issue->assignedto = 0;
    $issue->bywhomid = 0;
    $issue->trackerid = $tracker->id;
    $issue->status = POSTED;
    $issue->reportedby = required_param('reportedby', PARAM_INT);
    // fetch max actual priority
    $maxpriority = get_field_select('tracker_issue', 'MAX(resolutionpriority)', " trackerid = {$tracker->id} GROUP BY trackerid ");
    $issue->resolutionpriority = $maxpriority + 1;
    $issue->id = insert_record('tracker_issue', $issue, true);
    if ($issue->id) {
        tracker_recordelements($issue);
        // if not CCed, the assignee should be
        tracker_register_cc($tracker, $issue, $issue->reportedby);
        return $issue;
    } else {
        error("Could not submit issue");
    }
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:30,代码来源:locallib.php

示例12: ouwiki_save_new_version


//.........这里部分代码省略.........
    if (!($versionid = insert_record('ouwiki_versions', $version))) {
        $tw->rollback();
        ouwiki_dberror();
    }
    // Update latest version
    if (!set_field('ouwiki_pages', 'currentversionid', $versionid, 'id', $pageversion->pageid)) {
        $tw->rollback();
        ouwiki_dberror();
    }
    // Analyse for links
    $wikilinks = array();
    $externallinks = array();
    // Wiki links: ordinary [[links]]
    $matches = array();
    preg_match_all(OUWIKI_LINKS_SQUAREBRACKETS, $content, $matches, PREG_PATTERN_ORDER);
    foreach ($matches[1] as $match) {
        // Convert to page name (this also removes HTML tags etc)
        $wikilinks[] = ouwiki_get_wiki_link_details($match)->page;
    }
    // Note that we used to support CamelCase links but have removed support because:
    // 1. Confusing: students type JavaScript or MySpace and don't expect it to become a link
    // 2. Not accessible: screenreaders cannot cope with run-together words, and
    //    dyslexic students can have difficulty reading them
    // External links
    preg_match_all('/<a [^>]*href=(?:(?:\'(.*?)\')|(?:"(.*?))")/', $content, $matches, PREG_PATTERN_ORDER);
    foreach ($matches[1] as $match) {
        if ($match) {
            $externallinks[] = html_entity_decode($match);
        }
    }
    foreach ($matches[2] as $match) {
        if ($match) {
            $externallinks[] = html_entity_decode($match);
        }
    }
    // Add link records
    $link = new StdClass();
    $link->fromversionid = $versionid;
    foreach ($wikilinks as $targetpage) {
        if (!empty($targetpage)) {
            $pagerecord = get_record_select('ouwiki_pages', "subwikiid='{$subwiki->id}' AND UPPER(title)=UPPER('" . addslashes($targetpage) . "')");
            if ($pagerecord) {
                $pageid = $pagerecord->id;
            } else {
                $pageid = false;
            }
        } else {
            $pageid = get_field_select('ouwiki_pages', 'id', "subwikiid={$subwiki->id} AND title IS NULL");
        }
        if ($pageid) {
            $link->topageid = $pageid;
            $link->tomissingpage = null;
        } else {
            $link->topageid = null;
            $link->tomissingpage = addslashes(strtoupper($targetpage));
        }
        if (!($link->id = insert_record('ouwiki_links', $link))) {
            $tw->rollback();
            ouwiki_dberror();
        }
    }
    $link->topageid = null;
    $link->tomissingpage = null;
    $tl = textlib_get_instance();
    foreach ($externallinks as $url) {
        // Restrict length of URL
        if ($tl->strlen($url) > 255) {
            $url = $tl->substr($url, 0, 255);
        }
        $link->tourl = addslashes($url);
        if (!($link->id = insert_record('ouwiki_links', $link))) {
            $tw->rollback();
            ouwiki_dberror();
        }
    }
    // Inform search, if installed
    if (ouwiki_search_installed()) {
        $doc = new ousearch_document();
        $doc->init_module_instance('ouwiki', $cm);
        if ($subwiki->groupid) {
            $doc->set_group_id($subwiki->groupid);
        }
        $doc->set_string_ref($pageversion->title === '' ? null : $pageversion->title);
        if ($subwiki->userid) {
            $doc->set_user_id($subwiki->userid);
        }
        $title = is_null($pageversion->title) ? '' : $pageversion->title;
        if (!$doc->update($title, $content)) {
            $tw->rollback();
            ouwiki_dberror();
        }
    }
    // Inform completion system, if available
    if (class_exists('ouflags')) {
        if (completion_is_enabled($course, $cm) && ($ouwiki->completionedits || $ouwiki->completionpages)) {
            completion_update_state($course, $cm, COMPLETION_COMPLETE);
        }
    }
    $tw->commit();
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:ouwiki.php

示例13: increment_page_hits

 /**
  * Increment the hits of a page.
  *
  * @param   int     $wikiid
  * @param   string  $pagename
  * @param   int     $version
  * @param   int     $groupid
  * @param   int     $ownerid
  */
 function increment_page_hits($wikiid, $pagename, $version, $groupid, $ownerid)
 {
     $select = "dfwiki={$wikiid} AND pagename='" . addslashes($pagename) . "' AND version={$version}";
     if (isset($groupid)) {
         $select .= " AND groupid={$groupid}";
     }
     if (isset($ownerid)) {
         $select .= " AND ownerid={$ownerid}";
     }
     // return set_field_select('wiki_pages', 'hits', 'hits+1', $select);
     $hits = get_field_select('wiki_pages', 'hits', $select);
     return set_field_select('wiki_pages', 'hits', $hits + 1, $select);
 }
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:22,代码来源:wiki_persistor.php

示例14: game_snakes_check_questions

function game_snakes_check_questions($id, $game, $attempt, $snakes)
{
    global $QTYPES, $CFG;
    $responses = data_submitted();
    if ($responses->queryid != $snakes->queryid) {
        game_snakes_play($id, $game, $attempt, $snakes);
        return;
    }
    $questionlist = get_field('game_queries', 'questionid', 'id', $responses->queryid);
    $questions = game_sudoku_getquestions($questionlist);
    $actions = question_extract_responses($questions, $responses, QUESTION_EVENTSUBMIT);
    $correct = false;
    $query = '';
    foreach ($questions as $question) {
        if (!array_key_exists($question->id, $actions)) {
            //no answered
            continue;
        }
        unset($state);
        unset($cmoptions);
        $question->maxgrade = 100;
        $state->responses = $actions[$question->id]->responses;
        $state->event = QUESTION_EVENTGRADE;
        $state->responses[''] = game_upper($state->responses['']);
        $cmoptions = array();
        $QTYPES[$question->qtype]->grade_responses($question, $state, $cmoptions);
        unset($query);
        $select = "attemptid={$attempt->id} ";
        $select .= " AND questionid={$question->id}";
        if (($query->id = get_field_select('game_queries', 'id', $select)) == 0) {
            die("problem game_sudoku_check_questions (select={$select})");
            continue;
        }
        $grade = $state->raw_grade;
        if ($grade < 50) {
            //wrong answer
            game_update_queries($game, $attempt, $query, 0, '');
            continue;
        }
        //correct answer
        $correct = true;
        game_update_queries($game, $attempt, $query, 1, '');
    }
    //set the grade of the whole game
    game_snakes_position($id, $game, $attempt, $snakes, $correct, $query);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:46,代码来源:play.php

示例15: scheduler_get_last_location

/**
* get the last considered location in this scheduler
* @param reference $scheduler
* @uses $USER
* @return the last known location for the current user (teacher)
*/
function scheduler_get_last_location(&$scheduler)
{
    global $USER;
    // we could have made an embedded query in Mysql 5.0
    $lastlocation = '';
    $maxtime = get_field_select('scheduler_slots', 'MAX(timemodified)', "schedulerid = {$scheduler->id} AND teacherid = {$USER->id} GROUP BY timemodified");
    if ($maxtime) {
        $maxid = get_field_select('scheduler_slots', 'MAX(timemodified)', "schedulerid = {$scheduler->id} AND timemodified = {$maxtime} AND teacherid = {$USER->id} GROUP BY timemodified");
        $lastlocation = get_field('scheduler_slots', 'appointmentlocation', 'id', $maxid);
    }
    return $lastlocation;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:18,代码来源:locallib.php


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