</div> </form> </div> <div class="modal-footer"><div id="loading"><img src="img/loading.gif"></img></div> <button type="submit" class="btn btn-primary" id = "submitSRespone">Send</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> '; echo $modal_sr; // Showing love for the post and making a love button $res = check_vote_on_post($id, $mysqli); if ($res) { $vote = '<a href="#" onclick="post_vote_up_dn(\'' . $id . '\');" ><span class="fa fa-arrow-down"></span></a>'; } else { $vote = '<a href="#" onclick="post_vote_up_dn(\'' . $id . '\');" ><span class="fa fa-arrow-up"></span></a>'; } $love = '<div class="panel panel-default"> <div class="panel-body"> <i class="fa fa-star"></i> ' . get_votes_on_post($id, $mysqli) . ' ' . $vote . ' <a href="#" class="btn-default" data-id="' . $id . '" data-toggle="modal" data-target="#sendResponseModal" title="Send Response" onclick="add_id(' . $id . ');">Send Response</a> </div> </div>'; } else { $love = '<div class="alert alert-warning alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> To like or respond, login. </div>';
header('Location:write.php?done=1'); break; case 'delBlog': if ($_POST['bid'] != "" && $_SESSION['id'] != '') { // deleting a blog $send = ''; $where['blog_id'] = $_POST['bid']; $where['blog_by'] = $_SESSION['id']; do_sql('blog', $send, 'delete', $mysqli, $where); } break; case 'voteBlog': if ($_POST['bid'] != "" && $_SESSION['id'] != '') { // deleting a blog $send = ''; $res = check_vote_on_post($_POST['bid'], $mysqli); $where['votes_blog_id'] = $_POST['bid']; $where['votes_people_id'] = $_SESSION['id']; if ($res) { do_sql('votes', $send, 'delete', $mysqli, $where); } else { do_sql('votes', $where, 'insert', $mysqli, $where['votes_blog_id'] . ' AND ' . $where['votes_people_id']); } } break; case 'send_response': if ($_POST['bid'] != "" && $_SESSION['id'] != '' && $_POST['sendResponse'] != "") { // deleting a blog $send['response_blog_id'] = $_POST['bid']; $send['response_people_id'] = $_SESSION['id']; $send['response_text'] = htmlentities($_POST['sendResponse']);