<?php
//Created by ARDORA www.webardora.net
//COMENTARIOS-index.php
   session_cache_limiter("nocache,private");
include("php/cfg.php");
   error_reporting(E_ALL^E_NOTICE);
   require "php/ardoraAjaxJson.php";
$file = simplexml_load_file(xmlFile);
   $comments=array();
   $js_history='';
   foreach ($file->entrada as $entrada) {
      $valor = array(
      "id" => $entrada -> id,
      "parent" => $entrada -> father,
      "usr" => $entrada -> usr,
      "comment" => $entrada ->comment,
      "dt" => $entrada -> dt,
   );
   if($valor["parent"]==0){
      $comments[$valor["id"]-1] = $valor;
   } else
   {
      if(!$comments[$valor["parent"]-1]) continue;
         $comments[$valor["parent"]-1]["replies"][] = $valor;
      }
         $js_history.='addHistory({id:"'.$valor["id"].'"});'.PHP_EOL;
   }
   $js_history='<script type="text/javascript">'.$js_history.'</script>';
?>

<!DOCTYPE html>
<html lang="es">
<head><meta charset="utf-8"/><title></title>
<link rel="stylesheet" type="text/css" href="css/ardoraComentarios.css" />
<!--CSS--><link type="text/css" href="ardoraFiles/ui-themes/ardoraBasico03_ver/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="ardoraFiles/js/jquery.js"></script>
<script type="text/javascript" src="ardoraFiles/js/jquery-ui.min.js"></script>
<script src="ardoraFiles/js/jquery.ui.touch-punch.min.js"></script>
<script type="text/javascript" src="js/ardoraComentarios.js"></script>
<?php echo $js_history; ?>
</head><body>
<div id="cabeceira">
	<h1>Damos argumentos.</h1>
       <p><SPAN style="font-size:16px;color:#000000">Recuerda que dar argumentos no es lo mismo que manifestar tu opinión. En este caso debes de introducir, como mínimo, un argumento, a favor o en contra, sobre la pregunta:</SPAN><SPAN style="font-size:16px;color:#000000"><b> ¿ deben los padres y madres tener acceso total a los móviles de sus hijos e hijas?</b></SPAN></p>
</div>

<div class="ui-widget-header ui-corner-all ui-helper-clearfix"> </div>
<div id="divFull">
<div id="main">
     <div id="wave">
         <div id="commentArea">
            <?php foreach($comments as $c){ showComment($c,"");}?>
         </div>
     </div>
<div class="fg-toolbar ui-widget-header ui-corner-all ui-helper-clearfix">
   <div class="fg-buttonset ui-helper-clearfix">
   <a href="php/introDatos.php" class="fg-button ui-state-default fg-button-icon-solo ui-corner-all" title="Escribir"><span class="ui-icon ui-icon-pencil"></span>Escribir</a>
   <a href="index.php" class="fg-button ui-state-default fg-button-icon-solo ui-corner-all" title="Recargar"><span class="ui-icon ui-icon-refresh"></span>Recargar</a>
<a id="ButFull" class="fg-button ui-state-default fg-button-icon-solo  ui-corner-all" title="Pantalla completa"><span class="ui-icon ui-icon-extlink"></span>Pantalla completa</a>
    </div>
</div>
</div>
</div>
</body></html>
