Advertisement
mogaj

json

Jun 12th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. private function jsonFromSearchResults($rows, $from)
  2. {
  3. $objects = array();
  4. foreach ($rows as $row) {
  5. $images = array();
  6. for ($i=1;$i<=3;++$i) {
  7. $image = 'image' . $i;
  8. if ($row->$image) {
  9. $images[] = '<a href="' . $row->imageUrl($i) . '" rel="lightbox" style="color:#99f;">Id Proof '. $i . '</a>';
  10. }
  11. }
  12. $objects[$row->guest_id]
  13. = array('details' => $row->detailsForBooking(),
  14. 'images' => $images,
  15. 'show' => $this->view->Paths->guest_show($row->guest_id),
  16. 'stays' => $this->view->Paths->guest_stays($row->guest_id)
  17. );
  18. }
  19.  
  20. return array('status' => 'ok', 'from' => $from, 'results' => $objects);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement