Ejemplo n.º 1
0
 }
 // Add to our list of nodes any intermediate nodes in the paths
 // For example, if we have a node for a mouse and for a human, make sure we have a node for
 // mammals
 $x = array();
 foreach ($paths as $label => $path) {
     $nodes = explode("/", $path);
     $n = count($nodes);
     $p = '';
     for ($i = 1; $i < $n; $i++) {
         $p .= '/' . $nodes[$i];
         array_push($x, $p);
     }
 }
 $x = array_unique($x);
 $paths = array_merge($paths, get_names($x));
 if ($debug) {
     echo '<pre>';
     echo "Paths for all tags and intermediate nodes:\n";
     print_r($paths);
     echo '</pre>';
 }
 // Construct tree from paths
 $t = new Tree();
 $t->PathsToTree($paths);
 echo '<div>';
 echo $t->WriteTree($tags, $ids, $url);
 // Tags not found in classification
 if (count($not_found) != 0) {
     echo '<p><b>Tags not found</b></p>';
     echo '<ul>';
Ejemplo n.º 2
0
    ?>
">Edit</a> | </span>
					<span class="delete"><a href="<?php 
    echo $delete_url;
    ?>
"
					                        class="submitdelete">Delete</a></span>
				</div>
			</td>
			<td><?php 
    echo $value->wp_role;
    ?>
</td>
			<td><?php 
    echo get_names($value->current_rule, $MembershipStatus);
    ?>
</td>
			<td><?php 
    echo get_names($value->expiry_rule, $MembershipStatus);
    ?>
</td>
			<td><?php 
    echo $value->expire_wp_role;
    ?>
</td>
		</tr>
	<?php 
}
?>
	</tbody>
</table>  
Ejemplo n.º 3
0
            $formulas[$value] = 1;
        }
    }
    arsort($formulas);
    //$formulas = array_slice(array_keys($formulas), 0, 5);
    $formulas = array_keys($formulas);
    echo '<ol>';
    foreach ($formulas as $value) {
        //echo '<li class="list-group-item">';
        echo '<li>';
        echo render_value($dbc, $db_name, $value, true);
        echo '<p/></li>';
    }
    echo '</ol>';
}
$names = get_names($keywords);
$ids = array();
foreach ($names as $name) {
    $id = get_entity_of_type($dbc, $name, $question_type);
    if ($id != '') {
        array_push($ids, $id);
    }
}
if (!empty($ids)) {
    echo '<p>您输入的疾病为:';
    foreach ($ids as $id) {
        echo '&nbsp;' . render_value($dbc, $db_name, PREFIX . $id, false);
    }
    echo '</p>';
    foreach ($ids as $id) {
        ?>
Ejemplo n.º 4
0
function replace_Indet_sp($xml_string)
{
    if (!is_numeric(stripos($xml_string, "Indet"))) {
        return $xml_string;
    }
    echo "\n\n this resource has 'Indet.' taxa \n";
    $xml = simplexml_load_string($xml_string);
    $i = 0;
    foreach ($xml->taxon as $taxon) {
        $i++;
        $dc = $taxon->children("http://purl.org/dc/elements/1.1/");
        $dwc = $taxon->children("http://rs.tdwg.org/dwc/dwcore/");
        $dcterms = $taxon->children("http://purl.org/dc/terms/");
        echo "\n " . $dc->identifier . " -- sciname: [" . $dwc->ScientificName . "]";
        if (is_numeric(stripos($dwc->ScientificName, "Indet")) || is_numeric(stripos($dwc->Kingdom, "Indet")) || is_numeric(stripos($dwc->Phylum, "Indet")) || is_numeric(stripos($dwc->Class, "Indet")) || is_numeric(stripos($dwc->Order, "Indet")) || is_numeric(stripos($dwc->Family, "Indet")) || is_numeric(stripos($dwc->Genus, "Indet"))) {
            if (isset($dwc->Genus)) {
                $ancestry['Genus'] = (string) $dwc->Genus;
            }
            if (isset($dwc->Family)) {
                $ancestry['Family'] = (string) $dwc->Family;
            }
            if (isset($dwc->Order)) {
                $ancestry['Order'] = (string) $dwc->Order;
            }
            if (isset($dwc->Class)) {
                $ancestry['Class'] = (string) $dwc->Class;
            }
            if (isset($dwc->Phylum)) {
                $ancestry['Phylum'] = (string) $dwc->Phylum;
            }
            if (isset($dwc->Kingdom)) {
                $ancestry['Kingdom'] = (string) $dwc->Kingdom;
            }
            $ancestry['ScientificName'] = (string) $dwc->ScientificName;
            $ancestry = get_names($ancestry);
            echo "\n final sciname: [" . $ancestry['ScientificName'] . "]";
            $dwc->ScientificName = $ancestry['ScientificName'];
            if (isset($dwc->Genus)) {
                $dwc->Genus = $ancestry['Genus'];
            }
            if (isset($dwc->Family)) {
                $dwc->Family = $ancestry['Family'];
            }
            if (isset($dwc->Order)) {
                $dwc->Order = $ancestry['Order'];
            }
            if (isset($dwc->Class)) {
                $dwc->Class = $ancestry['Class'];
            }
            if (isset($dwc->Phylum)) {
                $dwc->Phylum = $ancestry['Phylum'];
            }
            if (isset($dwc->Kingdom)) {
                $dwc->Kingdom = $ancestry['Kingdom'];
            }
            if (!$ancestry['ScientificName']) {
                echo "\n deleted identifier: [" . $dc->identifier . "] \n";
                unset($dc->identifier);
                unset($dc->source);
                unset($dwc->Kingdom);
                unset($dwc->Phylum);
                unset($dwc->Class);
                unset($dwc->Order);
                unset($dwc->Family);
                unset($dwc->Genus);
                unset($dwc->ScientificName);
                unset($xml->taxon[$i - 1]->commonName);
                unset($xml->taxon[$i - 1]->synonym);
                unset($dcterms->created);
                unset($dcterms->modified);
                unset($xml->taxon[$i - 1]->reference);
                unset($xml->taxon[$i - 1]->dataObject);
            }
        }
    }
    return $xml->asXML();
}