<?php

use Mtc\Modules\BasketRecovery\Classes\BasketRecovery;

$path = '../../../';
require_once $path.'core/includes/header.inc.php';

$page_name = 'Follow-Up Email';
$page['title'] = "Manage {$page_name}s";
$section = 'shop';

if (filter_input(INPUT_GET, 'action') === 'delete') {
    BasketRecovery::destroy($_GET['id']);
    header('Location: ./');
    exit();
}

$data = BasketRecovery::query()
    ->orderBy('is_active', 'DESC')
    ->orderBy('interval_seconds', 'ASC')
    ->get();

require $path.'core/admin/templates/adminheader.html.php';
require __DIR__.'/templates/manage.tpl.php';
require $path.'core/admin/templates/adminfooter.html.php';
