<!-- Edit -->
<div class="modal fade" id="edit_<?php echo $row['id']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <center><h4 class="modal-title" id="myModalLabel">Edit Comment</h4></center>
            </div>
            <div class="modal-body">
			<div class="container-fluid">
			<form method="POST" action="edit/index.php" enctype="multipart/form-data">

				<input type="hidden" class="form-control" name="id" value="<?php echo $row['id']; ?>">


				<div class="row form-group" align="center">
					
					<div class="edit-img">
						<h4>Tap image to update</h4>
						<?php 
						if ($row['image']) { echo "<a href=\"edit_image/index.php?id=$row[id]\"><img src='images/".$row['image']."'></a>";} 
						elseif ($row['image']=="") { echo "<a href=\"edit_image/index.php?id=$row[id]\"><img src='images/default.png'></a>";}
						?>
						
						<input type="hidden" class="form-control" name="image" value="<?php echo $row['image']; ?>">
					</div>
				</div>

				<div class="row form-group">
					<div class="col-sm-2">
						<label class="control-label modal-label">Names:</label>
					</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="name" value="<?php echo $row['name']; ?>">
					</div>
				</div>

				<div class="row form-group">
					<div class="col-sm-2">
						<label class="control-label modal-label">Email:</label>
					</div>
					<div class="col-sm-10">
						<input type="email" class="form-control" name="email" value="<?php echo $row['email']; ?>">
					</div>
				</div>

				<div class="row form-group">
					<div class="col-sm-2">
						<label class="control-label modal-label">Comment:</label>
					</div>
					<div class="col-sm-10">
						<textarea type="text" class="form-control" name="role" value="<?php echo $row['comments']; ?>"><?php echo $row['comments']; ?></textarea>
					</div>
				</div>

				<div class="row form-group">
					<div class="col-sm-2">
						<label class="control-label modal-label">Rating:</label>
					</div>
					<div class="rating-form col-sm-10">

					<ul>

						<?php
				if ($row['rating']=="") { echo "<label for='super-happy'><input type='radio' name='rating' class='super-happy' id='super-happy' value='1'><li><a><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='happy'><input type='radio' name='rating' class='happy' id='happy' value='2'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='neutral'><input type='radio' name='rating' class='neutral' id='neutral' value='3'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='sad'><input type='radio' name='rating' class='sad' id='sad' value='4'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='super-sad'><input type='radio' name='rating' class='super-sad' id='super-sad' value='5'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; }

				elseif ($row['rating']==1) { echo "<label for='super-happy'><input type='radio' name='rating' class='super-happy' id='super-happy' value='1' checked='checked'><li><a><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='happy'><input type='radio' name='rating' class='happy' id='happy' value='2'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='neutral'><input type='radio' name='rating' class='neutral' id='neutral' value='3'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='sad'><input type='radio' name='rating' class='sad' id='sad' value='4'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='super-sad'><input type='radio' name='rating' class='super-sad' id='super-sad' value='5'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; }

				elseif ($row['rating']==2) { echo "<label for='super-happy'><input type='radio' name='rating' class='super-happy' id='super-happy' value='1'><li><a><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='happy'><input type='radio' name='rating' class='happy' id='happy' value='2' checked='checked'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='neutral'><input type='radio' name='rating' class='neutral' id='neutral' value='3'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='sad'><input type='radio' name='rating' class='sad' id='sad' value='4'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='super-sad'><input type='radio' name='rating' class='super-sad' id='super-sad' value='5'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; }

				elseif ($row['rating']==3) { echo "<label for='super-happy'><input type='radio' name='rating' class='super-happy' id='super-happy' value='1'><li><a><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='happy'><input type='radio' name='rating' class='happy' id='happy' value='2'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='neutral'><input type='radio' name='rating' class='neutral' id='neutral' value='3' checked='checked'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='sad'><input type='radio' name='rating' class='sad' id='sad' value='4'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='super-sad'><input type='radio' name='rating' class='super-sad' id='super-sad' value='5'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; }

				elseif ($row['rating']==4) { echo "<label for='super-happy'><input type='radio' name='rating' class='super-happy' id='super-happy' value='1'><li><a><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='happy'><input type='radio' name='rating' class='happy' id='happy' value='2'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='neutral'><input type='radio' name='rating' class='neutral' id='neutral' value='3'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='sad'><input type='radio' name='rating' class='sad' id='sad' value='4' checked='checked'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='super-sad'><input type='radio' name='rating' class='super-sad' id='super-sad' value='5'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; }

				elseif ($row['rating']==5) { echo "<label for='super-happy'><input type='radio' name='rating' class='super-happy' id='super-happy' value='1'><li><a><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='happy'><input type='radio' name='rating' class='happy' id='happy' value='2'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='neutral'><input type='radio' name='rating' class='neutral' id='neutral' value='3'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='sad'><input type='radio' name='rating' class='sad' id='sad' value='4'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; echo "<label for='super-sad'><input type='radio' name='rating' class='super-sad' id='super-sad' value='5' checked='checked'><li><a><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i><i class='bx bxs-star'></i></a></li></label> |"; }
				?>

				</ul>

					</div>
				</div>
				

            </div> 
			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cancel</button>
                <button type="submit" name="edit" class="btn btn-success" style="background: red;border: 1px solid red;"><span class="glyphicon glyphicon-check"></span> Update</a>
			</form>
            </div>

        </div>
    </div>
</div>

<!-- Delete -->
<div class="modal fade" id="delete_<?php echo $row['id']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <center><h4 class="modal-title" id="myModalLabel">Delete Comment</h4></center>
            </div>
            <div class="modal-body">	
            	<p class="text-center">Are you sure you want to Delete</p>
				<h2 class="text-center" style="color: red;"><?php echo $row['name']; ?>'s comment</h2>
				<div align="center" class="edit-img"> <?php if ($row['image']) { echo "<img src='images/".$row['image']."' width='20%'>";} 
			elseif ($row['image']=="") { echo "<img src='images/default.png' width='20%'>";} ?> </div>
			</div>

			<?php 

			echo "<div class='review-box' align='center'>";

         echo "<ul>";

                          if ($row['rating']=="") {  echo "<li>No Rating</li>"; }

                          if ($row['rating']=="1") {  echo "<li><i class='bx bxs-star'></i></li>"; }

                          if ($row['rating']=="2") {  echo "<li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li>"; }

                          if ($row['rating']=="3") {  echo "<li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li>"; }

                          if ($row['rating']=="4") {  echo "<li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li>"; }

                          if ($row['rating']=="5") {  echo "<li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li><li><i class='bx bxs-star'></i></li>"; }
         
         echo "</ul>";
         
         echo "</div>";

			?>

			<p class="text-center"><?php echo $row['comments']; ?></p>

            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cancel</button>
                <a href="delete.php?id=<?php echo $row['id']; ?>" class="btn btn-danger" style="background: red;border: 1px solid red;"><span class="glyphicon glyphicon-trash"></span> Yes</a>
            </div>

        </div>
    </div>
</div>