$d = explode('-', $data['date']);
return array('status' => $ok, 'year' => $d[0]);
+ }
+
+ public function ajaxSuggestCity(Array $data)
+ {
+ $data['query'] .= '%';
+ $sql = sprintf("SELECT DISTINCT city FROM sprit_log WHERE lower(city) LIKE %s ORDER BY city",
+ $this->quote(strtolower($data['query'])));
+ $list = array();
+ foreach ($this->fetchObjectList($sql) as $row)
+ $list[] = array('value' => $row->city, 'data' => $row->city);
+ return array('suggestions' => $list);
+ }
+ public function ajaxSuggestTankstelle(Array $data)
+ {
+ $data['query'] .= '%';
+ $sql = sprintf("SELECT DISTINCT tankstelle FROM sprit_log WHERE city = %s AND lower(tankstelle) LIKE %s ORDER BY tankstelle",
+ $this->quote($data['city']),
+ $this->quote(strtolower($data['query'])));
+ $list = array();
+ foreach ($this->fetchObjectList($sql) as $row)
+ $list[] = array('value' => $row->tankstelle, 'data' => $row->tankstelle);
+ return array('suggestions' => $list);
}
+
}