Example #1
0
            header("Location: site-servicos?lang=" . $_POST['lang']);
            exit;
        } else {
            die("ERRO");
        }
    } else {
        // upload icone
        if (!empty($_FILES['file-icone']['name'])) {
            $str = ImagemHelper::upload($_POST['dir'], "servico-icone", $_POST['item'], $_FILES['file-icone']);
            $str = explode("*;*", $str);
            $_POST['icone'] = $str[1];
        } elseif ($_POST['delete-icone'] == 1) {
            ImagemHelper::delete("img/" . $_POST['dir'] . "/" . $_POST['icone']);
            $_POST['icone'] = "";
        }
        //
        $res = ConfiguracaoController::updateServico($_POST);
        if ($res) {
            header("Location: site-servicos?lang=" . $_POST['lang']);
            exit;
        } else {
            die("ERRO");
        }
    }
} elseif ($_POST['action'] == "del") {
    if (ConfiguracaoController::delete($_POST)) {
        die("OK");
    } else {
        die("ERRO");
    }
}