<?php 
    if(isset($_GET['id']) && !empty($_GET['id'])) {
        $db->query("DELETE FROM {$db->prefix}sms_templates WHERE id=:id", array(":id"=>$_GET['id']));
        $session->data['messageType'] = "success"; 
        $session->data['messageTitle'] = "Başarılı!"; 
        $session->data['message'] = "SMS başarıyla silindi."; 

        if(isset($_GET['redirect']) && !empty($_GET['redirect'])) {
            header('Location: ' . $_GET['redirect']);
            exit();
        }else{
            header('Location: /admin/sms/list');
            exit();
        }
    }else{
        $session->data['messageType'] = "error"; 
        $session->data['messageTitle'] = "Hata!"; 
        $session->data['message'] = "Bir hata oluştu ve SMS silinemedi."; 

        header('Location: /admin/sms/list');
        exit();
    }