<?php

$query=$db->prepare("SELECT * FROM sayfalar order by id DESC");
$query->execute();

// Toplu Sil //

if(isset($_POST["deletepage"])){
	$delcategory = $_POST["deletepage"];
	foreach($delcategory as $deletepage){
		$delete = $db->prepare("DELETE FROM sayfalar WHERE id = ?");
		$delete->execute(array($deletepage));
		if ($delete) {
			$success = 'İşlem başarıyla gerçekleşti.';
		} else {
			$error = 'Bir hata oluştu.';
		}
	}
}

require admin_view('sayfa-listele');