public function viewbids() { if ($this->post->action == 'deletebid') { $ret = SchedulesData::RemoveBid($this->post->id); $params = array(); if ($ret == true) { $params['status'] = 'ok'; } else { $params['status'] = 'There was an error'; $params['message'] = DB::error(); } echo json_encode($params); return; } $this->set('allbids', SchedulesData::getAllBids()); $this->render('pilots_viewallbids.tpl'); }