<?php
    require '../assets/config-data.php';
    $kodehid = mysqli_real_escape_string($data, $_POST['kodeak']);
    $inbox = mysqli_real_escape_string($data, $_POST['chatbox']); 
    
    $isms = "INSERT into keluhan_member(kode_keluhan, receiver_keluhan, msg_keluhan, tgl_keluhan) VALUES('$kodehid', 'admin', '$inbox', '$today')";
    $qsms = mysqli_query($data, $isms);

    $ubaca = "UPDATE keluhan_member SET baca_keluhan = '1' WHERE kode_keluhan = '$kodehid' AND sender_keluhan != '' AND DATE(tgl_keluhan) < '$today'";
    $qbaca = mysqli_query($data, $ubaca);
?>