USER = ".$_GET['USER']);
//echo("
LIB_NAME = ".$_GET['LIB_NAME']);
//echo("
branch = ".$_GET['branch']);
//die("
die");
/*
header("Content-Type: image/svg+xml");
*/
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // ast time
/*
function errorSVG($_name) {
echo('');
exit();
}
*/
include_once("connect.php");
@include_once("connect_server.php");
$COVERAGE_bdd = mysqli_connect($sqlServer, $sqlLogin, $sqlPass, $sqlBDD);
// Check connection
if (mysqli_connect_errno()) {
die ("connection n the server error");
}
// check if all is here ...
$branch = "master";
$tag = "Linux";
if (isset($_GET['USER']) == FALSE) {
die ("You must specify a user ...");
}
$listLibrary = []
if (isset($_GET['LIB_NAME']) == FALSE) {
$listLibrary.append($_GET['LIB_NAME']);
} else {
// Get all library names with all branches:
$sql = "SELECT * "
." FROM `CI_group`"
." WHERE `CI_group`.`user-name` = '".$_GET['USER']."'"
." LIMIT 1";
echo("sql : ".$sql);
$result = $COVERAGE_bdd->query($sql);
echo("result = ".$result);
}
/*
errorSVG("LIB_NAME??");
}
if (isset($_GET['branch']) == TRUE) {
$branch = $_GET['branch'];
}
if (isset($_GET['tag']) == TRUE) {
$tag = $_GET['tag'];
}
*/
//echo "register ".$_POST['JSON_FILE'];
$sql = "SELECT `BUILD_snapshot`.`".$tag."` "
." FROM `BUILD_snapshot`"
." , `CI_group`"
." WHERE `CI_group`.`user-name` = '".$_GET['USER']."'"
." AND `CI_group`.`lib-name` = '".$_GET['LIB_NAME']."'"
." AND `CI_group`.`lib-branch` = '".$branch."'"
." AND `CI_group`.`id` = `BUILD_snapshot`.`id-group`"
." LIMIT 1";
//echo("sql : ".$sql);
$result = $COVERAGE_bdd->query($sql);
//
if ($result == NULL) {
errorSVG("UNKNOW");
}
//echo("find result : ".$result);
if ($result->num_rows > 0) {
if ($result->num_rows > 1) {
errorSVG("To much value");
}
$row = $result->fetch_assoc();
$status = $row[$tag];
} else {
$status = "---";
//errorSVG("No Value");
}
//some coverage value :
if ($status == "UNKNOW") {
$color = "333";
} else if ($status == "START") {
$color = "11F";
} else if ($status == "ERROR") {
$color = "c11";
} else if ($status == "OK") {
$color = "4c1";
} else {
$color = "FF0";
}
echo('');
// simply close link with the DB...
$COVERAGE_bdd->close();
?>