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">功效 »</a>'; echo ' '; echo '<a class="btn btn-link" href="#" role="button">化学成分 »</a>'; echo ' '; echo '<a class="btn btn-link" href="#" role="button">药理作用 »</a>'; echo ' '; echo '<a class="btn btn-link" href="#" role="button">化学实验 »</a>'; echo ' '; echo '<a class="btn btn-link" href="#" role="button">来源处方 »</a>'; */ echo "<hr>"; }
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 .= ' <em><small>(' . $def . ')' . '</small></em>'; } } } else { $result = $name; } } else { $result = $name; } if ($with_def) { $result .= ' (来源:<a href="db_profile.php?db_name=' . $db_name . '">' . $db_label . '</a>)'; } return $result; }
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) . ': ' . $pre_label, $db_name); if ($with_def && $def != '') { $result .= ' <em><small>(' . tcmks_substr($def) . ')' . '</small></em>'; } } else { $result = $name; } } else { $result = $name; } return $result; }
</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">