<?php
switch($_REQUEST[mode]) {
    case "hapus":
        $ssql = RetRstField("SELECT SUM(fnid) AS fnid FROM
                                ( SELECT fnid FROM tlmachine_group WHERE ftparent_code = '{$_REQUEST['ftmachine_group_code']}'
                                    UNION ALL
                                    SELECT fnid FROM tlmachine WHERE ftmachine_group_code = '{$_REQUEST['ftmachine_group_code']}'
                                 ) X ");

        if($ssql) {
            echo "<script>
                    alert('data tidak dapat di delete karena masih digunakan dalam transaksi ...');
                    window.history.back();
                   </script>";
            die("");
        }
    break;
}

?>
