private function handleLexicon(&$data, $curie) { require_once 'Config.php'; //include 'Globals.php'; //include 'JsonClientUtil.php'; //$curie = "NIFCELL:sao2128417084"; $data['curie'] = $curie; $treeObj = getTreeObj($curie); $data['treeObj'] = $treeObj; $parentID = getParentID($treeObj, $curie); $data['parentID'] = $parentID; $node = getNode($treeObj, $parentID); $data['node'] = $node; $mainNode = getNode($treeObj, $curie); $data['mainNode'] = $mainNode; $list = getChildrenIDs($treeObj, $curie); $data['list'] = $list; $leafHTML = ""; $list->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); for ($list->rewind(); $list->valid(); $list->next()) { $item = $list->current(); $leaf = getNode($treeObj, $item); $leafLinkName = str_replace(" ", "_", $leaf->lbl); $leafLinkName = str_replace("(", "_", $leafLinkName); $leafLinkName = str_replace(")", "_", $leafLinkName); //$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName; $leafLink = "/" . Config::$localContextName . "/index.php/pages/view/" . $leaf->id; //$leafHTML = $leafHTML . "<ul><li><span><i class=\"icon-leaf\"></i><a href=\"".$leafLink."\">" . $leaf->lbl . "</a></span> <a href=\"\"></a></li></ul>\n"; $leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n"; } $data['leafHTML'] = $leafHTML; require_once 'ServiceUtil.php'; require_once 'PropertyConfig.php'; $util = new ServiceUtil(); $list2 = $util->getOtherChildrenIDs($treeObj, $curie, PropertyConfig::$has_proper_part); $partOfParentID = $util->getOtherParentID($treeObj, $curie, PropertyConfig::$has_proper_part); $partOfParenttNode = getNode($treeObj, $partOfParentID); $data['node2'] = $partOfParenttNode; $leafHTML = null; $list2->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); for ($list2->rewind(); $list2->valid(); $list2->next()) { $item = $list2->current(); $leaf = getNode($treeObj, $item); $leafLinkName = str_replace(" ", "_", $leaf->lbl); $leafLinkName = str_replace("(", "_", $leafLinkName); $leafLinkName = str_replace(")", "_", $leafLinkName); //$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName; $leafLink = "/" . Config::$localContextName . "/index.php/pages/view/" . $leaf->id; //$leafHTML = $leafHTML . "<ul><li><span><i class=\"icon-leaf\"></i><a href=\"".$leafLink."\">" . $leaf->lbl . "</a></span> <a href=\"\"></a></li></ul>\n"; $leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n"; } $data['leafHTML2'] = $leafHTML; $list3 = $util->getChildrenIDsIncoming($treeObj, $curie, PropertyConfig::$part_of); $partOfParentID3 = $util->getParentIDIncoming($treeObj, $curie, PropertyConfig::$part_of); $partOfParenttNode3 = getNode($treeObj, $partOfParentID3); $data['node3'] = $partOfParenttNode3; $leafHTML = null; $list3->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); for ($list3->rewind(); $list3->valid(); $list3->next()) { $item = $list3->current(); $leaf = getNode($treeObj, $item); $leafLinkName = str_replace(" ", "_", $leaf->lbl); $leafLinkName = str_replace("(", "_", $leafLinkName); $leafLinkName = str_replace(")", "_", $leafLinkName); //$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName; $leafLink = "/" . Config::$localContextName . "/index.php/pages/view/" . $leaf->id; //$leafHTML = $leafHTML . "<ul><li><span><i class=\"icon-leaf\"></i><a href=\"".$leafLink."\">" . $leaf->lbl . "</a></span> <a href=\"\"></a></li></ul>\n"; $leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n"; } $data['leafHTML3'] = $leafHTML; }
function getTypeList($t_pid) { global $db, $tempnum, $arrtype; $sql = "SELECT id as t_id, name as t_name, disp_order as t_sort,parent_id as t_pid, t_hide as t_hide,type_key as t_key,type_desc as t_des FROM apk_category WHERE parent_id = " . $t_pid . " ORDER BY disp_order,id ASC"; $rs = $db->query($sql); $tempnum = $tempnum + 3; $parent_id = getParentID($t_pid); while ($row = $db->fetch_array($rs)) { $tcount = getTypeCount($row["t_id"]); $subTypeCount = getSubTypeCount($row["t_id"]); ?> <tr> <td align="left" > <div style="float:left;"> <?php for ($i = 0; $i < $tempnum - 3; $i++) { echo " "; } ?> <?php if ($t_pid == 0) { echo " "; } else { echo "├"; } ?> <input type="checkbox" name="t_id[]" value="<?php echo $row["t_id"]; ?> " class="checkbox" /> <a href="admin_art.php?{pre}art_type=<?php echo $row["t_id"]; ?> "><?php echo $row["t_name"]; ?> </a> <input type="button" value="父" onClick="ShowPDIV(<?php echo $row["t_id"]; ?> ,<?php echo $row["t_pid"]; ?> );" name="Input" class="btn" /> </div> (<font color="red"><?php echo $tcount; ?> </font>) <div id="type_P_DIV_<?php echo $row["t_id"]; ?> " style=" float:left;display:none;"> <select id="type_P_CID_<?php echo $row["t_id"]; ?> " name="type_P_CID_<?php echo $row["t_id"]; ?> " onChange="SelectPid(this.value,<?php echo $row["t_id"]; ?> );"> </select> </div> </td> <td align="center"><?php echo $row["t_id"]; ?> </td> <td><input size="20" type="text" name="t_name<?php echo $row["t_id"]; ?> " value="<?php echo $row["t_name"]; ?> "></td> <td><input size="30" type="text" name="t_key<?php echo $row["t_id"]; ?> " value="<?php echo $row["t_key"]; ?> "></td> <td><input size="40" type="text" name="t_des<?php echo $row["t_id"]; ?> " value="<?php echo $row["t_des"]; ?> "></td> <td><input size="3" type="text" name="t_sort<?php echo $row["t_id"]; ?> " value="<?php echo $row["t_sort"]; ?> "></td> <td> <?php if ($tcount == 0) { ?> <a href="admin_ajax.php?action=del&tab=apk_category&t_id=<?php echo $row["t_id"]; ?> " onClick="return confirm('确定要删除吗?');">删除</a><?php } ?> <?php if ($row["t_hide"] == 1) { ?> <a href="admin_apk_category.php?action=nohide&t_id=<?php echo $row["t_id"]; ?> &type=<?php echo $t_pid; ?> ">显示</a> <?php } else { if ($row["t_hide"] == 0) { ?> <a href="admin_apk_category.php?action=hide&t_id=<?php echo $row["t_id"]; ?> &type=<?php echo $t_pid; ?> ">隐藏</a> <?php } } ?> <?php if ($subTypeCount > 0) { ?> |<a href="admin_apk_category.php?type=<?php echo $row["t_id"]; ?> ">下级目录</a> <?php } ?> <?php if (!isN($parent_id)) { ?> | <a href="admin_apk_category.php?type=<?php echo $parent_id; ?> ">上级目录</a><?php } ?> | <a href="admin_apk.php?category_id=<?php echo $row["t_id"]; ?> ">应用列表</a> </td> </tr> <?php if ($t_pid == 0) { $arrtype = $arrtype . "@|@" . $row["t_id"] . "|=|" . $row["t_name"]; } // getTypeList( $row["t_id"]); } $tempnum = $tempnum - 3; unset($rs); }
$total = 0; $rank = array(); $docparent = array(); while ($row = mysql_fetch_array($result)) { $parentid = getParentID($row["id"]); $docparent[$row["id"]] = $parentid; $rank[$parentid] += 10; $searchresult[$total] = $row["id"]; $total++; } // find match doc if ($_POST["keyWord"]) { $relatedsql = "select DISTINCT docid from doc_index where token like '%" . $_POST["keyWord"] . "%' or 1=2"; $relatedresult = mysql_query($relatedsql) or die("Invalid query"); while ($row = mysql_fetch_array($relatedresult)) { $parentid = getParentID($row["docid"]); $docparent[$row["docid"]] = $parentid; $rank[$parentid] += getDocScore($row["docid"], $_POST["keyWord"]); $searchresult[$total] = $row["docid"]; $total++; } } if ($total == 0) { echo "There is no result."; } else { echo "There are " . $total . " results.<br>"; echo "<a href='#' onClick='lastTen(\"" . $_POST["startIndex"] . "\")'>pre</a> "; echo "<a href='#' onClick='nextTen(\"" . $_POST["startIndex"] . "\")'>next</a><br>"; } echo '<table width="800" border="1"> <tr>