<?php require_once "../config/Autoload.php"; require_once "../libs/datafilter.php"; if (isset($_POST['text_c_c'])) { $_POST = trimAll($_POST); $_POST = htmlAll($_POST); $c_comments = CommentsComments::addComment($_POST['message_id'], $_POST['message_comment_id'], $_POST['date_c_c'], $_POST['text_c_c'], $_POST['user_comment_c_id']); if ($c_comments == true) { echo 'Added successfully'; } else { echo 'Please try again'; } } if (isset($_POST['text_edit_c_c'])) { $_POST = trimAll($_POST); $_POST = htmlAll($_POST); $update_c_comments = CommentsComments::editComment($_POST['edit_message_id'], $_POST['edit_message_comment_id'], $_POST['edit_comments_comments_id'], $_POST['text_edit_c_c']); if ($update_c_comments == true) { echo 'Added successfully'; } else { echo 'Please try again'; } }
echo $res_c['id_c']; ?> ,'<?php echo $user_name; ?> ')" id="comment_c-<?php echo $res_c['id_c']; ?> " class="add_comment_c">Add comment</button> <?php } ?> </div> </div> <?php $all_comments_c = CommentsComments::showComment($res_c['li_message_id_m'], $res_c['id_c']); while ($res_c_c = mysqli_fetch_assoc($all_comments_c)) { ?> <div class="m_comment_c"> <div class="c_date_c"> <p><?php echo $res_c_c['date_cc']; ?> </p> </div> <div class="c_text_c"> <p id="show_edit_comment_c-<?php echo $res_c_c['li_message_id_m']; ?> -<?php echo $res_c_c['li_message_comment_id_c'];