<?php

    include 'loader.php';

    $json = array();

    switch ($func->get('type')){
        case 'customer_delete':
            if($func->get('id')){
                $db->query("DELETE FROM ".DBPREFIX."customer WHERE id='".$func->get('id')."'");
                $json['success'] = true;
            }
            break;
        case 'form_delete':
            if($func->get('id')){
                $db->query("DELETE FROM ".DBPREFIX."forms WHERE id='".$func->get('id')."'");
                $json['success'] = true;
            }
            break;
        case 'crm_delete':
            if($func->get('id')){
                $db->query("DELETE FROM ".DBPREFIX."crm WHERE id='".$func->get('id')."'");
                $json['success'] = true;
            }
            break;
        case 'danisman_delete':
            if($func->get('id')){
                $db->query("DELETE FROM ".DBPREFIX."danisman WHERE id='".$func->get('id')."'");
                $json['success'] = true;
            }
            break;
        case 'room_delete':
            if($func->get('id')){
                $db->query("DELETE FROM ".DBPREFIX."items WHERE id='".$func->get('id')."'");
                $json['success'] = true;
            }
            break;
        case 'project_delete':
            if($func->get('id')){
                $db->query("DELETE FROM ".DBPREFIX."projeler WHERE id='".$func->get('id')."'");
                $json['success'] = true;
            }
            break;

    }

    echo json_encode($json);