<?php

    require_once('../../../server/api-adodb/config.php');
     require_once(LIB_PATH.DS.'loggedin.php');
    if(!empty($_POST['table'])){
        $tableName = $_POST['table'];
    }else{
        die("Please select a table!");
    }
    $table = new Table($tableName);
    //Delete IDs
    if(!empty($_POST['ids'])){
        try {
            $table->deleteRows($_POST['ids']);
            echo 'Deleted!';
        } catch (Exception $e){
            echo $e->getMessage();
        }

    } else {
        echo 'Please select at least 1 item.';
    }

?>
