<?php
    require '../../data.php';

    $kodehid = mysqli_real_escape_string($data, $_POST['kodehid']);
    $userhid = mysqli_real_escape_string($data, $_POST['userhid']);
    $inbox = mysqli_real_escape_string($data, $_POST['inboxkeluhan']); 
    
    $isms = "INSERT into keluhan_member(kode_keluhan, sender_keluhan, msg_keluhan, tgl_keluhan) VALUES('$kodehid', '$userhid', '$inbox', '$today')";
    $qsms = mysqli_query($data, $isms);

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