home/skymarketplace/public_html/models/LocationModel.php000064400000002463150037002010017533 0ustar00db = $db; } public function insert(array $data): bool { $stmt = $this->db->prepare("INSERT INTO locations (country, town, delivery_price) VALUES (:country, :town, :price)"); return $stmt->execute([ 'country' => $data['country'], 'town' => $data['town'], 'price' => $data['delivery_price'] ]); } public function update(array $data): bool { $stmt = $this->db->prepare("UPDATE locations SET country = :country, town = :town, delivery_price = :price WHERE id = :id"); return $stmt->execute([ 'country' => $data['country'], 'town' => $data['town'], 'price' => $data['delivery_price'], 'id' => $data['id'] ]); } public function delete(int $id): bool { $stmt = $this->db->prepare("DELETE FROM locations WHERE id = :id"); return $stmt->execute(['id' => $id]); } public function deleteFooter(int $id): bool { $stmt = $this->db->prepare("DELETE FROM footer_locations WHERE id = :id"); return $stmt->execute(['id' => $id]); } }