示例#1
0
    <p><input type="submit" name="view_list" value="search"></p>
</form>
<?php 
if (isset($view_list) && $view_list) {
    $query_lang_pos = "SELECT lang_pos.id as id, page_title, relation_type_id, wiki_text.text as wiki_text FROM lang_pos, page, relation, meaning, wiki_text " . "WHERE lang_pos.page_id=page.id AND relation.meaning_id=meaning.id AND meaning.lang_pos_id=lang_pos.id AND relation.wiki_text_id=wiki_text.id AND wiki_text.text is not null";
    if ($relation_type_id) {
        $query_lang_pos .= " and relation_type_id=" . (int) $relation_type_id;
    }
    if ($lang_id) {
        $query_lang_pos .= " and lang_id=" . (int) $lang_id;
    }
    if ($pos_id) {
        $query_lang_pos .= " and pos_id=" . (int) $pos_id;
    }
    if ($page_title) {
        $query_lang_pos .= " and page_title like '%{$page_title}%'";
    }
    $query_lang_pos .= " order by page_title, id";
    //print $query_lang_pos;
    $result_lang_pos = $link_db->query_e($query_lang_pos, "Query failed in file <b>" . __FILE__ . "</b>, string <b>" . __LINE__ . "</b>");
    $numAll = $link_db->query_count($result_lang_pos);
    print "{$numAll} semantic relations (with these parameters) are found";
    $result_lang_pos = $link_db->query_e($query_lang_pos . " LIMIT {$start_rec},{$limit}", "Query failed in file <b>" . __FILE__ . "</b>, string <b>" . __LINE__ . "</b>");
    print "<table border=1>\n";
    $counter = $start_rec;
    while ($row = $result_lang_pos->fetch_object()) {
        print "<tr><td>" . ++$counter . ".</td><td>" . TPage::getURL($row->page_title) . "</td><td>" . TRelationType::getNameByID($row->relation_type_id) . "</td><td>" . $row->wiki_text . "</td></tr>\n";
    }
    print "</table><br />\n" . WForm::goNextStep($numAll, $limit, $php_self . "?lang_id={$lang_id}&pos_id={$pos_id}&relation_type_id={$relation_type_id}&page_title={$page_title}&view_list=1", 2, "Go to", $step_s);
}
include LIB_DIR . "footer.php";
示例#2
0
 public static function getDropDownList($selected_id, $select_name, $first_option)
 {
     $s = WForm::getDropDownList($selected_id, $select_name, $first_option, 'relation_type', 'name', 'id');
     return $s;
 }
示例#3
0
 public static function getDropDownList($selected_id, $select_name, $first_option)
 {
     $s = WForm::getDropDownList($selected_id, $select_name, $first_option, 'part_of_speech', 'name', 'id');
     return $s;
 }