Updated sorting of jobs

This commit is contained in:
Jeroen De Meerleer 2018-09-07 15:39:19 +02:00
parent 8dceacd495
commit d00462d490
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 2 additions and 5 deletions

View File

@ -3,7 +3,7 @@
/* /*
* The MIT License * The MIT License
* *
* Copyright 2017 Jeroen De Meerleer <me@jeroened.be>. * Copyright 2017-2018 Jeroen De Meerleer <me@jeroened.be>.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -46,7 +46,7 @@ if ($_GET["message"]) {
} }
} }
$allJobs = $db->prepare("SELECT * FROM jobs WHERE user = ?"); $allJobs = $db->prepare("SELECT * FROM jobs WHERE user = ? ORDER BY name ASC");
$allJobs->execute(array($_SESSION["userID"])); $allJobs->execute(array($_SESSION["userID"]));
$allJobsResult = $allJobs->fetchAll(PDO::FETCH_ASSOC); $allJobsResult = $allJobs->fetchAll(PDO::FETCH_ASSOC);
@ -68,7 +68,6 @@ foreach($allJobsResult as $key=>$value) {
$twig_vars = array('jobs' => $allJobsRendered, 'message' => $message); $twig_vars = array('jobs' => $allJobsRendered, 'message' => $message);
//echo $twig->render('overview.html.twig', array('the' => 'variables', 'go' => 'here'));
echo $twig->render('overview.html.twig', $twig_vars); echo $twig->render('overview.html.twig', $twig_vars);

View File

@ -10,7 +10,6 @@
{% endif %} {% endif %}
<table class="table"> <table class="table">
<tr> <tr>
<th>ID</th>
<th>Name</th> <th>Name</th>
<th>Delay</th> <th>Delay</th>
<th>Next run</th> <th>Next run</th>
@ -18,7 +17,6 @@
</tr> </tr>
{% for job in jobs %} {% for job in jobs %}
<tr> <tr>
<td>{{ job.jobID }}</td>
<td>{{ job.name }}</td> <td>{{ job.name }}</td>
<td>{{ job.delay }}</td> <td>{{ job.delay }}</td>
<td>{{ job.nextrun }}</td> <td>{{ job.nextrun }}</td>