Runs is now viewing title if no runs were done yet
This commit is contained in:
parent
54ddda70cd
commit
aa2d95a6a1
10
runs.php
10
runs.php
@ -26,6 +26,15 @@
|
|||||||
|
|
||||||
require_once "include/initialize.inc.php";
|
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 = $db->prepare("SELECT runs.*, jobs.name FROM runs, jobs WHERE runs.job = jobs.jobID AND runs.job = ?");
|
||||||
$runsForJob->execute(array($_GET['jobID']));
|
$runsForJob->execute(array($_GET['jobID']));
|
||||||
$runsForJobResult = $runsForJob->fetchAll(PDO::FETCH_ASSOC);
|
$runsForJobResult = $runsForJob->fetchAll(PDO::FETCH_ASSOC);
|
||||||
@ -36,7 +45,6 @@ $twig = new Twig_Environment($loader, array('cache' => 'cache', "debug" => true)
|
|||||||
//var_dump($alljobsResult);
|
//var_dump($alljobsResult);
|
||||||
//exit;
|
//exit;
|
||||||
|
|
||||||
$jobName = $runsForJobResult[0]['name'];
|
|
||||||
$runsForJobRendered = array();$count = 0;
|
$runsForJobRendered = array();$count = 0;
|
||||||
foreach($runsForJobResult as $key=>$value) {
|
foreach($runsForJobResult as $key=>$value) {
|
||||||
$runsForJobRendered[$count]["runID"] = $value["runID"];
|
$runsForJobRendered[$count]["runID"] = $value["runID"];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends "base.html.twig" %}
|
{% extends "base.html.twig" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Overview of runs of {{ title }}</h2>
|
<h2>Overview of runs for {{ title }}</h2>
|
||||||
<div id="accordion" class="panel-group">
|
<div id="accordion" class="panel-group">
|
||||||
{% for run in runs %}
|
{% for run in runs %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
@ -16,5 +16,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user