<?php
    require '../../data.php';
    $kodekeluhan = mysqli_real_escape_string($data, $_POST['tampilkode']);
    $saktif = "SELECT * FROM kasus_keluhan WHERE kode_kasus = '$kodekeluhan' AND status_kasus = '1'";
    $qaktif = mysqli_query($data, $saktif);

    if(mysqli_num_rows($qaktif) > 0) {
        echo '<script>
        $(document).ready(function() {
            var inputMsg = $("#inboxmsgs");
            var btnSend = $("#sendbtn");
            var textDisable = $("#textdisable");
            inputMsg.hide();
            btnSend.hide();
            textDisable.show();
            textDisable.text("Mohon maaf laporan keluhan telah ditutup");
        });
        </script>';
    } else {
        echo '<script>
        $(document).ready(function() {
            var inputMsg = $("#inboxmsgs");
            var btnSend = $("#sendbtn");
            var textDisable = $("#textdisable");
            inputMsg.show();
            btnSend.show();
            textDisable.hide();
        });
        </script>';
    }
?>