<?php
$conn = new mysqli('localhost','root','patata''password','radiohumorfm');
$comentarios = "SELECT * FROM comentarios ORDER BY id ASC";
if($listacomentarios = $conn->query($comentarios)){
while($filas = $listacomentarios->fetch_row()){
echo ("<div class='col-md-8 col-md-offset-2'>");
echo ("<div class='separador'></div>");
echo("<div class='panel panel-info'>");
echo("<div class='panel-heading'>");
echo ("<strong>".$filas[1]."</strong>");
echo("<span style='right:35px; position:absolute;'>");
if(isset($_SESSION['usuario'])) {
echo("<i style='color:dodgerblue ; cursor:pointer'class='fa fa-thumbs-up fa-2x' aria-hidden='true' onclick='like(id=".$filas[0].")'></i>
<i style='color:red; cursor:pointer'class='fa fa-thumbs-down fa-2x' aria-hidden='true' onclick='dislike(id=".$filas[0].")'></i>");
}
echo ("<strong>");
echo $filas[4];
echo ("</strong>");
if ($_SESSION['usuario']=="admin"){
echo("<i style='color:gray; cursor:pointer'class='fa fa-trash-o fa-2x' aria-hidden='true' onclick='deletecom(id=".$filas[0].")'></i>");
}
echo("</span>");
echo ("</div>");
echo ("<div class='panel-body'>");
echo $filas[2];
echo("<div class='fecha' align='right'>");
echo $filas[3];
echo ("</div>");
echo ("</div>");
echo ("</div>");
echo ("</div>");
}
}
$conn->close();