$query .= "FROM Job ";
$query .= "LEFT JOIN Pool ON Job.PoolId=Pool.PoolId ";
$query .= "LEFT JOIN Status ON Job.JobStatus = Status.JobStatus ";
+
+ // Filter by status
+ if( isset( $_POST['status'] ) ) {
+ switch( $_POST['status'] )
+ {
+ case 'completed':
+ $query .= "WHERE Job.JobStatus = 'T' ";
+ break;
+ case 'failed':
+ $query .= "WHERE Job.JobStatus = 'f' ";
+ break;
+ case 'canceled':
+ $query .= "WHERE Job.JobStatus = 'A' ";
+ break;
+ }
+ }
+
$query .= "ORDER BY Job.EndTime DESC ";
// Determine how many jobs to display
$jobsresult = $dbSql->db_link->query( $query );
+ //var_dump( $_POST );
+
if( PEAR::isError( $jobsresult ) ) {
echo "SQL query = $query <br />";
die("Unable to get last failed jobs from catalog" . $jobsresult->getMessage() );
.box table.list
{
border-collapse: collapse;
- /*width: 100%;*/
+ /width: 100%;
margin: 0px;
}
-.box table
-{
- border-collapse: separate;
- margin: 0px;
-}
-
-.box table th {
- font-size: 10pt;
- background-color: #CACACA;
-}
-
.box table tr td
{
padding: 5px;
<td width="50" class="{$job.Job_classe}">{$job.Level}</td>
<td width="80" class="{$job.Job_classe}">{$job.Pool_name}</td>
</tr>
- {/foreach}
+ {/foreach}
</table>
</div> <!-- end div class=listbox -->
+
<form action="jobs.php" method="post">
- <table>
+ <table class="list" border="0">
<tr>
- <td class="info" colspan="8">
- Limit to
+ <td class="info" colspan="5" style="text-align: right;">
+ Jobs / Page
<select name="limit">
<option value="20">20
<option value="40">40
<option value="60">60
+ <option value="80">80
+ <option value="100">100
+ </select>
+ </td>
+ <td class="info" width="200">
+ Job Status
+ <select name="status">
+ <option value="Any">Any
+ <option value="completed">Completed
+ <option value="failed">Failed
+ <option value="canceled">Canceled
</select>
+ </td>
+ <td class="info" width="120">
<input type="submit" value="Update" />
</td>
</tr>