Runs is now viewing title if no runs were done yet

This commit is contained in:
Jeroen De Meerleer 2017-04-15 11:49:43 +02:00
parent 54ddda70cd
commit aa2d95a6a1
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 11 additions and 3 deletions

View File

@ -26,6 +26,15 @@
require_once "include/initialize.inc.php";
$jobnameqry = $db->prepare("SELECT name, user FROM jobs WHERE jobID = ?");
$jobnameqry->execute(array($_GET['jobID']));
$jobnameResult = $jobnameqry->fetchAll(PDO::FETCH_ASSOC);
if ($jobnameResult[0]["user"] != $_SESSION["userID"]) {
header("location:/overview.php");
exit;
}
$jobName = $jobnameResult[0]['name'];
$runsForJob = $db->prepare("SELECT runs.*, jobs.name FROM runs, jobs WHERE runs.job = jobs.jobID AND runs.job = ?");
$runsForJob->execute(array($_GET['jobID']));
$runsForJobResult = $runsForJob->fetchAll(PDO::FETCH_ASSOC);
@ -36,7 +45,6 @@ $twig = new Twig_Environment($loader, array('cache' => 'cache', "debug" => true)
//var_dump($alljobsResult);
//exit;
$jobName = $runsForJobResult[0]['name'];
$runsForJobRendered = array();$count = 0;
foreach($runsForJobResult as $key=>$value) {
$runsForJobRendered[$count]["runID"] = $value["runID"];

View File

@ -1,6 +1,6 @@
{% extends "base.html.twig" %}
{% block content %}
<h2>Overview of runs of {{ title }}</h2>
<h2>Overview of runs for {{ title }}</h2>
<div id="accordion" class="panel-group">
{% for run in runs %}
<div class="panel panel-default">
@ -16,5 +16,5 @@
</div>
</div>
{% endfor %}
</table>
</div>
{% endblock %}