imaxstockavelonemptyingmodule_ajax.php 581 Bytes
<?php

include(__DIR__.'/../../config/config.inc.php');
include(__DIR__.'/imaxstockavelonemptyingmodule.php');


$imax = new imaxstockavelonemptyingmodule();
$accion = Tools::getValue('accion');
$id_entidad = Tools::getValue('id_tramo');
$resultado = ['ok' => false, 'datos' => []];

switch ($accion) {
    case 'delete':
        $sql = 'delete from '._DB_PREFIX_.$imax::prefijo."tramo where idTramo = ".$id_entidad;
        if (Db::getInstance()->execute($sql)) {
            $resultado['ok'] = true;
        }
}

echo Tools::getValue('callback').'('.json_encode($resultado).')';