<input type="submit" id="commentSub" value="Comment"> <?php } else { ?> <input type="submit" id="commentSub" value="Comment" disabled> <?php } ?> </form> <div id="add_comment_result" style="display:none;"></div> <?php //Edit comment echo "<br/><br/><br/><b>************************</b><br>"; echo "<br/>=======Edit commment and Delete=====<br/><br/> "; $comments = $commentManager->getAllComments(); $commentCount = count($comments); if ($commentCount > 0) { foreach ($comments as $coms) { $id = $coms->getId(); $text = $coms->getText(); $rating_id = $coms->getRatingId(); $created_by = $coms->getCreatedBy(); //get the username who created the comment $userManager = new UserManager(); $created_user = $userManager->getUserByUserId($created_by); $created_user_name = $created_user->getLogin(); //define ids for html tags in the loop $edit_icon_id = "editIcon_" . $id; $edit_area_id = "edit_area_" . $id; $edit_comment_text_id = "comment_text_id_" . $id;