예제 #1
0
function render_item($dbc, $row, $db_name)
{
    $id = $row[id];
    $name = $row[name];
    $def = $row[def];
    echo '<p class="lead">' . get_entity_link($id, $name, $db_name) . '</p>';
    if ($def != '') {
        echo $def;
    } else {
        echo get_summary($dbc, $db_name, PREFIX . $id);
    }
    echo '<br>';
    /*
     echo '<a class="btn btn-link" href="#" role="button">功效&nbsp; &raquo;</a>';
     echo '&nbsp;';
     echo '<a class="btn btn-link" href="#" role="button">化学成分&nbsp; &raquo;</a>';
     echo '&nbsp;';
     echo '<a class="btn btn-link" href="#" role="button">药理作用&nbsp; &raquo;</a>';
     echo '&nbsp;';
     echo '<a class="btn btn-link" href="#" role="button">化学实验&nbsp; &raquo;</a>';
     echo '&nbsp;';
     echo '<a class="btn btn-link" href="#" role="button">来源处方&nbsp; &raquo;</a>';
    */
    echo "<hr>";
}
예제 #2
0
function render_value($dbc, $db_name, $db_label, $name, $with_def = true)
{
    if (strpos($name, $db_name . ':o') === 0) {
        $id = str_replace($db_name . ':o', "", $name);
        $query = "select * from def where id ='{$id}'";
        $result = mysqli_query($dbc, $query) or die('Error querying database:' . $query);
        if ($row = mysqli_fetch_array($result)) {
            $name = $row[name];
            $def = $row[def];
            $result = get_entity_link($id, $name);
            if ($with_def) {
                if ($def == '') {
                    $def = get_summary($dbc, $db_name, $db_label, $db_name . ':o' . $id);
                }
                if ($def != '') {
                    $result .= '&nbsp;<em><small>(' . $def . ')' . '</small></em>';
                }
            }
        } else {
            $result = $name;
        }
    } else {
        $result = $name;
    }
    if ($with_def) {
        $result .= '&nbsp;(来源:<a href="db_profile.php?db_name=' . $db_name . '">' . $db_label . '</a>)';
    }
    return $result;
}
예제 #3
0
function render_value($dbc, $db_name, $name, $with_def = false)
{
    if (strpos($name, $db_name . ':o') === 0) {
        $id = str_replace($db_name . ':o', "", $name);
        $query = "select * from def where id ='{$id}'";
        $result = mysqli_query($dbc, $query) or die('Error querying database:' . $query);
        if ($row = mysqli_fetch_array($result)) {
            $pre_label = $row[name];
            $def = $row[def];
            $result = get_entity_link($id, get_type($dbc, $name) . ':&nbsp;' . $pre_label, $db_name);
            if ($with_def && $def != '') {
                $result .= '&nbsp;<em><small>(' . tcmks_substr($def) . ')' . '</small></em>';
            }
        } else {
            $result = $name;
        }
    } else {
        $result = $name;
    }
    return $result;
}
예제 #4
0
            </div>

        </div>

        <div class="col-lg-6">



            <?php 
$found = array();
$id_array = array();
$unfound = array();
foreach ($keyword_array as $keyword) {
    $ids = identify($dbc, $keyword);
    foreach ($ids as $id) {
        $found[] = get_entity_link($id, $keyword, $db_name);
        $id_array[] = $id;
    }
    if (count($ids) == 0) {
        $unfound[] = $keyword;
    }
}
?>

            <div class="container">


                <div class="btn-group pull-right">

                    <form role="form" action="export_ontology.php" method="post" 
                          enctype="multipart/form-data">