|
|
|
@@ -75,7 +75,7 @@ class UserJob{ |
|
|
|
if ($this->db->last_error == ""){ |
|
|
|
$response['status'] = 'success'; |
|
|
|
foreach( $jobs as $s){ |
|
|
|
$response['jobs'][] = array( |
|
|
|
$el = array( |
|
|
|
'id' => $s->id, |
|
|
|
'tos' => $s->tos, |
|
|
|
'start'=> $s->start, |
|
|
|
@@ -89,7 +89,16 @@ class UserJob{ |
|
|
|
'rate_str'=> $this->get_rate_str($s->rate), |
|
|
|
'tos_str'=> $this->get_tos_str($s->tos), |
|
|
|
'staff_name' => $this->get_display_name($s->staff), |
|
|
|
//extra field for GUI |
|
|
|
'hl_start_date' => $this->get_date_month($s->start), |
|
|
|
'hl_start' => $this->get_hh_mm($s->start), |
|
|
|
'hl_finish' => $this->get_hh_mm($s->finish), |
|
|
|
'rated' => ($s->rating >=1 && $s->rating<=5)? 'rated': '', |
|
|
|
'start_day' => $this->get_weekday_name($s->start), |
|
|
|
'finish_day' => $this->get_weekday_name($s->finish), |
|
|
|
); |
|
|
|
$el['checked_' . $s->rating] = 'checked'; |
|
|
|
$response['jobs'][]=$el; |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
@@ -98,6 +107,20 @@ class UserJob{ |
|
|
|
} |
|
|
|
return $response; |
|
|
|
} |
|
|
|
private function get_date_month($strdate){ |
|
|
|
$d = new \DateTime($strdate); |
|
|
|
return $d->format('d/n'); |
|
|
|
} |
|
|
|
|
|
|
|
private function get_hh_mm($strdate){ |
|
|
|
$d = new \DateTime($strdate); |
|
|
|
return $d->format('H:i'); |
|
|
|
} |
|
|
|
|
|
|
|
private function get_weekday_name($strdate){ |
|
|
|
$d = new \DateTime($strdate); |
|
|
|
return $d->format("D"); |
|
|
|
} |
|
|
|
|
|
|
|
private function get_rate_str($earnings_rate_id) |
|
|
|
{ |