<?php
    switch($_REQUEST[mode]) {
    case "hapus":
        if(RetRstField("SELECT SUM(fnid) AS fnid FROM (
                SELECT fnid FROM tlstock_group_bahan_baku WHERE ftparent_code = '{$_REQUEST['ftstock_group_code']}'
                UNION ALL SELECT fnid FROM tlstock_hdr_bahan_baku WHERE ftstock_group_code = '{$_REQUEST['ftstock_group_code']}'
                ) X ")) {

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

    break;
    }

?>
