ps('name'),'category'=>ps('category'),'description'=>ps('description'), 'address'=>ps('address'),'phone'=>ps('phone'),'website'=>ps('website'), 'hours'=>ps('hours'),'is_active'=>(int)p('is_active',1),'sort_order'=>(int)p('sort_order',0)]; if ($act === 'add') { if($f['name']) qrun("INSERT INTO attractions(name,category,description,address,phone,website,hours,is_active,sort_order)VALUES(?,?,?,?,?,?,?,?,?)",array_values($f)); flash('Attraction added!','success'); } if ($act === 'edit') { $id=(int)p('id'); if($f['name']) qrun("UPDATE attractions SET name=?,category=?,description=?,address=?,phone=?,website=?,hours=?,is_active=?,sort_order=? WHERE id=?",array_merge(array_values($f),[$id])); flash('Attraction updated!','success'); } if ($act === 'delete') { qrun("DELETE FROM attractions WHERE id=?",[(int)p('id')]); flash('Attraction deleted.','success'); } go('/admin/attractions.php'); } $editId = iget('edit'); $editing = $editId ? qone("SELECT * FROM attractions WHERE id=?",[$editId]) : null; $attrs = qall("SELECT * FROM attractions ORDER BY sort_order,name"); ?>
ALL ATTRACTIONS ()
NAMECATEGORYSTATUSORDERACTIONS
Active':'Hidden'?>
✏️ Edit