Exemplo n.º 1
0
<?php

require "connection.php";
// Get the query/function that needs to be performed
$query = $_REQUEST['query'];
$flag = true;
switch ((string) $query) {
    // Record the score an dother game details for a single tweety game in the DB
    case "getAspects":
        $flag = false;
        echo getAspects();
        break;
    case "getSources":
        echo getSources();
        break;
    default:
        break;
}
/**
* This method gets all the Aspects uploaded in the service with all their information
* in a JSON list.
* 
* @return Aspects :: JSON containing all the information about all the aspects
*/
function getAspects()
{
    // Get connection to the DB
    $link = getConnection();
    $query = "SELECT * FROM Uploads;";
    $res = mysqli_query($link, $query);
    // Associative Array to store the top players info
Exemplo n.º 2
0
                // ajout de la source à la liste des pages à analyser
                $listeRetour[$codeSrc] = $paramsSrcArray;
            }
        }
    }
    return $listeRetour;
}
if (isset($_GET["debug"])) {
    header("Content-type: text/html; charset=utf-8");
} else {
    // permet le téléchargement du fichier
    header("Content-type: text/calendar; charset=utf-8");
}
$listeEvt = array();
// récupération des sources et des paramètres associés
$listeSourcesAAnalyser = getSources($SOURCES);
// récupération des paramètres en fonction des sources trouvées
foreach ($listeSourcesAAnalyser as $source => $paramSource) {
    foreach ($paramSource as $param) {
        switch ($source) {
            case "vgOrg":
                $parser = new VideTiretGreniersPointOrgParser($param);
                break;
            case "sbdCom":
                $parser = new SabradouPointComParser($param);
                break;
        }
        $evmtsTmp = $parser->parse();
        $listeEvt = array_merge($listeEvt, $evmtsTmp);
    }
}
Exemplo n.º 3
0
    $url = '';
    if (isset($parts['host'])) {
        $url .= $parts['host'];
    }
    $url .= $parts['path'];
    $hit = $url;
    if (isset($parts['query'])) {
        $url .= '?' . $parts['query'];
    }
    $encoded = urlencode($url);
    $data = curl($url);
    if (strlen($name) < 1) {
        $name = generateName();
    }
    mkdir(ARCHIVES . $name);
    $data = getSources($data, $hit, $name);
    $timesPath = TIMES . $encoded;
    $times = [];
    if (file_exists($timesPath)) {
        $times = unserialize(file_get_contents($timesPath));
    }
    array_push($times, ['name' => $name, 'time' => time()]);
    file_put_contents(ARCHIVES . $name . '/0', $data);
    file_put_contents($timesPath, serialize($times));
    return $app->redirect('/' . $name);
});
$app->get('{name}/{path}', function ($name, $path) use($app) {
    $search = archive($name, $path);
    if (!file_exists($search)) {
        return 'File not found for: ' . $name;
    }
Exemplo n.º 4
0
	}
	}
?>
</div>
<?php
}
?>
	</fieldset>
</div>
</ul>

<?php
		break;
		
	case 'search':
		$sources = getSources();
		print '<ul class="panel" title="Search">';
?>
		<form title="Search" class="panel" action="search.php?cmd=search_results" method="POST" selected="true">
		<fieldset>
		<div class="row">
			<fieldset class="forceleft" style="border:none">
			<label>Select Source:</label>
				<select name='source'>
<?php
if(count($sources)) {
	foreach($sources as $src) {
		$selected = ($src['value'] == trim($_REQUEST['source'])) ? " selected='selected' " : '';
		print "<option value='" . $src['value'] . "' $selected>" . $src['name'] . "</option>";
	}
}