Example #1
0
function main()
{
    require_once "../../config.php";
    $q = isset($_GET["q"]) ? $_GET["q"] : '';
    $site = isset($_GET["site"]) ? $_GET["site"] : '';
    $column2 = "class=\"header filesize\"><a href=#>Size ";
    $column3 = "Category";
    if ($site == 1) {
        $results = nzbsu($q, $saburl, $sabapikey, $nzbsuapi, $nzbsudl);
    } elseif ($site == 2) {
        $results = nzbmatrix($q, $nzbusername, $nzbapi, $saburl, $sabapikey);
    } elseif ($site == 3) {
        $column2 = "><a href=#>Rating ";
        $column3 = "Year";
        $results = tmdb($q, $cp_url);
    } elseif (!empty($_GET['id'])) {
        if (intval($_GET['id']) != 0) {
            getInfo($_GET['id'], $cp_url);
            return false;
        } else {
            getCP($id, $cp_url);
            return false;
        }
    } else {
        $_GET['type'] = $preferredCategories;
        switch ($preferredSearch) {
            case '0':
                //$_GET['type'] = '';
                //$results = nzbmatrix($q, $nzbusername, $nzbapi,$saburl,$sabapikey);
                //$results .= nzbsu($q, $saburl,$sabapikey, $nzbsuapi, $nzbsudl);
                $results = "<h1>Need to choose default Site and Category</h1>";
                break;
            case '1':
                $results = nzbmatrix($q, $nzbusername, $nzbapi, $saburl, $sabapikey);
                break;
            case '2':
                $results = nzbsu($q, $saburl, $sabapikey, $nzbsuapi, $nzbsudl);
                break;
            case '3':
                $column2 = "><a href=#>Rating ";
                $column3 = "Year";
                $results = tmdb($q, $cp_url);
                break;
        }
    }
    $tablebody = "<div id='wSearch'>\n\t\t\t\t\t<table id='search-Table' class='tablesorter' width='100%' style='table-layout:fixed;' cellspacing='0'>\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th style='width:5%;'></th>\n\t\t\t\t\t\t\t\t<th style='width:60%;' onclick=\"setTimeout('updateRows()',10);\"><a href=#>Name <img src=\"./media/arrow.png\"/></a></th>\n\t\t\t\t\t\t\t\t<th style='width:15%;'onclick=\"setTimeout('updateRows()',10);\"{$column2}<img src=\"./media/arrow.png\"/></a></th>\n\t\t\t\t\t\t\t\t<th style='width:20%;' onclick=\"setTimeout('updateRows()',10);\"><a href=#>{$column3} <img src=\"./media/arrow.png\"/></a></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>";
    echo !empty($results) ? $tablebody . $results . "</tbody></table></div>" : "<h1>Nothing found!</h1>";
}
Example #2
0
	$logData="IRISPORGAM\n$program\n\nEVALUTATIONMETHOD $method\n\n############\n";
	foreach ($_SERVER as $k => $v) {
	   $logData.="$k \t $v.\n";
	}
	$logFile="$logFilePath/".date("o-m-d_H-i-s-U").".txt";

	$fh = fopen($logFile, 'w') or die("error can't open file");
	fwrite($fh, $logData);
	fclose($fh);

	//do queryA
	$libcp = getCP("$PATH/lib/*.jar");
	if($_REQUEST['version']=="snapshot"){
		$cp = "$libcp:".getCP("$PATH/../snapshot/iris*.jar");
	} else {
		$cp = "$libcp:".getCP($PATH);
	}
	if($method==1)
		$exec_string = "java -cp ".escapeshellarg($cp). " org.deri.iris.demo.Demo program=". escapeshellarg ($program) ."  timeout=30000";
	else
		$exec_string = "java -cp ".escapeshellarg($cp). " org.deri.iris.demo.Demo program=". escapeshellarg ($program) ."  timeout=30000 unsafe-rules well-founded";
	#echo $exec_string;
	$result = exec($exec_string,$output);
	echo "<pre style=\"background-color:#eee;\">";
	#echo $exec_string;
	foreach ($output as $line){
		echo "$line\n";
	}
	echo "</pre>";
	#echo "<small>$exec_string</small>";
}