<?php

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

$theme = $settings["theme"];

if(isset($_POST["deleteslider"])){
	$delproduct = $_POST["deleteslider"];
	foreach($delproduct as $deleteslider){
		$sor = $db->prepare("SELECT * FROM programci WHERE id=:id");
		$sor->execute(array(
			'id' => $deleteslider
		));
		$cek=$sor->fetch(PDO::FETCH_ASSOC);
		$image=PATH . "/public/{$theme}/{$cek['image']}";
		$delete = $db->prepare("DELETE FROM programci WHERE id = ?");
		$delete->execute(array($deleteslider));
		if($delete){
			@unlink("$image");
			$success = 'İşlem başarıyla gerçekleşti.';
		}else{
			$error = 'Bir hata oluştu.';
		}
	}
}

require admin_view('programci-listele');