<th><?php echo lang('duration'); ?> </th> <td><?php echo $experiment->duration; ?> </td> </tr> <tr> <th><?php echo lang('location'); ?> </th> <td><?php echo location_name($experiment->location_id); ?> </td> </tr> <tr> <th><?php echo lang('age_range'); ?> </th> <td><?php echo age_range($experiment); ?> </td> </tr> <tr> <th><?php
/** Generates an array of closings (JSON encoded) for the calender */ public function closings() { $events = array(); $closings = $this->closingModel->get_all_closings($this->input->post('start'), $this->input->post('end')); foreach ($closings as $closing) { $lockdown = !isset($closing->location_id); if ($lockdown) { $title = lang('lockdown'); } else { $location = location_name($closing->location_id); $title = lang('closing') . ' ' . $location; } $from = new DateTime($closing->from); $to = new DateTime($closing->to); $event = array('title' => $title, 'allDay' => $from->diff($to)->format('%a') > 1, 'start' => $from->format(DateTime::ISO8601), 'end' => $to->format(DateTime::ISO8601), 'tooltip' => $closing->comment, 'color' => $lockdown ? "#ff0000" : ""); // Add array to events array_push($events, $event); } // Returns a json array echo json_encode($events); }
/** Checks whether the given date is within bounds of an existing closing for this location */ public function check_closings($date, $location_id) { if ($this->closingModel->within_bounds(input_datetime($date), $location_id)) { $this->form_validation->set_message('check_closings', sprintf(lang('location_closed'), location_name($location_id))); return FALSE; } return TRUE; }