/* select nearest pois */
sqlite3_prepare(db,
- "select p.lat, p.lon, p.label, c.label"
+ "select p.lat, p.lon, p.label, c.label, c.icon, c.color"
" from poi p, category c "
" where c.enabled = 1 and p.cat_id = c.cat_id "
" and p.lat between $LAT-0.15 and $LAT+0.15 "
"cat_id = ? where poi_id = ?",
-1, &_stmt_update_poi, NULL);
/* delete from poi */
- sqlite3_prepare(db,
- " delete from poi where poi_id = ?",
+ sqlite3_prepare(db, "delete from poi where poi_id = ?",
-1, &_stmt_delete_poi, NULL);
/* delete from poi by cat_id */
- sqlite3_prepare(db,
- "delete from poi where cat_id = ?",
+ sqlite3_prepare(db, "delete from poi where cat_id = ?",
-1, &_stmt_delete_poi_by_catid, NULL);
/* get next poilabel */
- sqlite3_prepare(db,
- "select ifnull(max(poi_id) + 1,1) from poi",
+ sqlite3_prepare(db, "select ifnull(max(poi_id) + 1,1) from poi",
-1, &_stmt_nextlabel_poi, NULL);
/* select from category */
" enabled = ? where poi_id = ?",
-1, &_stmt_update_cat, NULL);
/* delete from category */
- sqlite3_prepare(db,
- "delete from category where cat_id = ?",
+ sqlite3_prepare(db,"delete from category where cat_id = ?",
-1, &_stmt_delete_cat, NULL);
/* enable category */
sqlite3_prepare(db,
" where cat_id = ?", -1, &_stmt_toggle_cat, NULL);
/* select all category */
sqlite3_prepare(db,
- "select c.cat_id, c.label, c.desc, c.enabled,"
+ "select c.cat_id, c.label, c.desc, c.enabled, c.icon, c.color,"
" count(p.poi_id)"
" from category c"
" left outer join poi p on c.cat_id = p.cat_id"