Implement detail page for experiments

This commit is contained in:
Eike Foken
2011-09-14 05:44:20 +02:00
parent 92e45e8033
commit a4f41fd392
6 changed files with 473 additions and 133 deletions

View File

@@ -66,6 +66,22 @@ class Job extends CI_Model {
return $this->db->where('id', $job_id)->update('jobs', $data);
}
/**
* Gets a specific job.
*
* @param string $experimentId
* @return array The job data
*/
public function getByExperimentId($experimentId) {
$this->db->select('jobs.*, users.username, users.firstname, users.lastname');
$this->db->join('users', 'jobs.started_by = users.id', 'left');
$this->db->where('experiment_id', $experimentId);
$query = $this->db->get('jobs');
return $query->row_array();
}
/**
* Gets a list of recent jobs.
*