示例#1
0
    //echo  $_POST['term'];
    //echo  $_POST['results'];
    // Minimal form validation.
    if (isset($_POST['term']) && isset($_POST['results'])) {
        $searchTerm = $_POST['term'];
        $fieldsSelected = array("pid", "title", "creator", "type", "date", "state");
        $mresult = $_POST['results'];
    } else {
        // Invalid submitted values.
        echo '<h1 id="mainhead">Error!</h1>
		<p class="error">Please enter a valid search term.</p><p><br /></p>';
    }
}
// End of main isset() IF.
$agent = new Agent();
$xml_output = $agent->search($fieldsSelected, $mresult, $searchTerm);
//print_r($xml_output);
if ($xml_output) {
    $id = $_GET['id'];
    if ($id == "activate") {
        $html_output .= $agent->transform("./stylesheets/resultA.xslt", $xml_output);
    } else {
        if ($id == "deactivate") {
            $html_output .= $agent->transform("./stylesheets/resultD.xslt", $xml_output);
        } else {
            if ($id == "edit") {
                $html_output .= $agent->transform("./stylesheets/resultE.xslt", $xml_output);
            }
        }
    }
}