<?php

    include 'loader.php';

    $json = array();

    switch ($func->get('type')){
        case 'customer_delete':
            if($func->get('id')){
                $db->query("DELETE FROM ".DBPREFIX."customers WHERE customer_id='".$func->get('id')."'");
                $json['success'] = true;
            }
            break;
        case 'order_delete':
            if($func->get('id')){
                $db->query("DELETE FROM ".DBPREFIX."reservations WHERE reservation_id='".$func->get('id')."'");
                $db->query("DELETE FROM ".DBPREFIX."reservation_supports WHERE reservation_id='".$func->get('id')."'");
                $json['success'] = true;
            }
            break;
        case 'ticket_delete':
            if($func->get('ticket_id')){
                $db->query("DELETE FROM ".DBPREFIX."order_ticket WHERE ticket_id='".$func->get('id')."'");
                $json['success'] = true;
            }
            break;

    }

    echo json_encode($json);