<?php
// Created by Ardora www.webardora.net
//TIMELINE-introdatos
session_cache_limiter('nocache,private');
session_start();$slogin_noauthpage=0;$slogin_pagetitle = "";include_once("para.php");include_once("cfg.php");
include_once(profUname."../".uName."/".uName."_lib.php");include_once("ardoraAjaxJson.php");
?>
<html lang="gl">
<head><meta charset="utf-8"/><title></title>
<link rel="stylesheet" type="text/css" href="../ardoraFiles/js/jquery-ui.min.css" />
<!--CSS--><link type="text/css" href="../ardoraFiles/ui-themes/ardoraBasico03_ver2/ui.all.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../css/ardoraTimeLine.css" />
<script type="text/javascript" src="../ardoraFiles/js/jquery.js"></script>
<script type="text/javascript" src="../ardoraFiles/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="../js/ardoraIntroDatos.js"></script>
</head>
<body>
     <div id="gravar" title="Gardar  ">
         <span class="ui-icon ui-icon-check" style="float:left; margin:0 7px 20px 0;"></span><p>Gardar a anotación?  </p>
     </div>
     <div id="borrar" title="Borrar palabra  ">
         <span class="ui-icon ui-icon-check" style="float:left; margin:0 7px 20px 0;"></span><p>Realmente desexa borrar a anotación?  </p>
     </div>

     <div id="profe" title="Alumnos e alumnas:  ">
     </div>

<div id="contenedor">
     <div id="cabeza">
           <div id="texto_form">
           <h1>A Idade Media</h1>
           <p><SPAN style="font-size:12px;color:#000000">Introduce aquí os datos referentes a esta época.</SPAN></p>
     </div>
     <div id="cabe_form" class="ui-widget-content ui-corner-all">
           <p class="ui-widget-header"><?php
           echo $slogin_Username; 
           ?> </p>
           <p><?php
           echo dameValor($slogin_Username, "NOM");
           ?> </p>
           <?php
           echo dameValor($slogin_Username, "CUR");
           echo dameValor($slogin_Username, "GRU")
           ?>
    </div>
</div>
<div id="clear"></div>
<?php
   $ele=$_GET['ele'];
   $ele=(int)$ele;
?>

   <form id="entraDatos" class="formLogin" name="entraDatos" method="post" action="<?php echo ('ardoraAjaxJson.php?action=saveItem&indi='.$ele)?>" enctype="multipart/form-data">
   <div id="traballos" class="ui-widget-header ui-corner-all">
   <p>Introduce os datos</p>
   <?php
   $path = "../ardoraWorkFiles/".xmlName."/";
   $dir = opendir($path);
   $adiante=false;
   $total=0;
   while ($elemento = readdir($dir)){
       $extensiones = explode(".",$elemento) ;
       $nombre = $extensiones[0] ;
       $nombre2  = $extensiones[1] ;
       if (strpos($nombre,$slogin_Username)>-1){
          $adiante=true;
       }
   $total++;
   }
   $total=$total-3;
   closedir($dir);
   if ($adiante){
       echo ('<select name="speedA" id="speedA" onchange="window.location=\'introDatos.php?ele=\'+this.value">');
       if ($ele==0){
           echo ('<option value="0" selected="selected">----------------</option>'); 
       }
       else{
           echo ('<option value="0">----------------</option>');
       }

       $dir2 = opendir($path);
       while ($arquivo = readdir($dir2)){
            $extensiones = explode(".",$arquivo) ;
            $nome = $extensiones[0] ;
            if (strpos($nome,$slogin_Username)>-1){
                $datos_arquivo = file($path.$arquivo);
                $indiceV=str_replace(trim($datos_arquivo[0]).'_','',$nome)+1;
                if ($ele==$indiceV){
                    echo( '<option value="'.$indiceV.'" selected="selected">'.$datos_arquivo[1].'</option>');
                }
                else{ echo( '<option value="'.$indiceV.'">'.$datos_arquivo[1].'</option>');} 
            }
       }
       closedir($dir2);
       echo ('</select>');
       echo ('<label for="speedA" style="margin-right:10px;">Anotacións feitas  </label>');
   }
  ?>
</div>

<div id="datos_esquerda">
<div id="clear" style="border-bottom-width:1px; border-bottom-style:solid; margin-top:10px; margin-bottom:10px;"><strong>Data</strong></div>
      <div>
      <label for="titulo">Palabra</label>
     <input type="text" name="titulo" id="titulo" class="formLogin" placeholder="Escribe unha frase que resuma o feito."
      value="<?php echo dameTitulo($ele,$slogin_Username);?>" maxlength="50" required/>
   </div>
   <div id="clear"></div>
   <label for="url1">URL</label>
   <input class="formLogin" type="url" name="url1" id="url1" placeholder="" class="text ui-widget-content ui-corner-all" value="<?php echo $url ?>"/>
   <div id="clear"></div>
<div id="procesador">
   <label for="comenta">comentario</label>
   <textarea id="comenta" name="comenta" placeholder="Explica aquí con máis detalle ese feito." class="formLogin" cols="70" rows="10" style="height:100px; width:400px;"><?php echo $textoCom ?></textarea>
</div>
</div>
<div id="datos_dereita">
   <div id="clear" style="border-bottom-width:1px; border-bottom-style:solid; margin-top:10px; margin-bottom:10px;"><strong>Inicio</strong></div>
   <div id="startDiv">
   <label>Ano</label> 
   <input type="number" min="475"max="1500" name="anoI" id="anoI" value="<?php echo $gAnoI ?>" style="width:80px"/>
   <label>Mes</label>
   <input type="number" min="1" max="12" name="mesI" id="mesI" value="<?php echo $gMesI ?>" style="width:50px"/>
   <label for="diaI">Día</label>
   <input type="number" min="1" max="31" name="diaI" id="diaI" value="<?php echo $gDiaI ?>" style="width:50px"/>

   <div id="clear"></div>
   <label for="horaI">Hora</label>
   <input type="number" min="0" max="23" name="horaI" id="horaI" value="<?php echo $gHoraI ?>" style="width:50px"/>
   <label for="minutoI">Min.</label>
   <input type="number" min="0" max="59" name="minutoI" id="minutoI" class="formLogin" value="<?php echo $gMinutoI ?>" style="width:50px"/>
   <label for="segundoI">Seg.</label>
   <input type="number" min="0" max="59" name="segundoI" id="segundoI" class="formLogin" value="<?php echo $gSegundoI ?>" style="width:50px"/>
   </div>
   <div id="clear"></div><div id="colorDiv">
   <p>
   <label>
   <?php
   if ($corBoton=="red"){
   echo ('<input name="bc" class="buttonsC" type="radio" value="red" checked="checked" />');
   } else{ echo ('<input name="bc" class="buttonsC" type="radio" value="red"/>');}
   ?>
   <img src="../timeline/timeline_js/images/red-circle.png" alt="Red" width="10" height="10" longdesc="Red button" /></label>
   <?php
   if ($corBoton=="green"){
   echo ('<input name="bc" class="buttonsC" type="radio" value="green" checked="checked" />');
   } else{ echo ('<input name="bc" class="buttonsC" type="radio" value="green"/>');}
   ?>
   <label><img src="../timeline/timeline_js/images/green-circle.png" alt="Green" width="10" height="10" longdesc="Green button" /></label>
   <?php
   if ($corBoton=="blue"){
   echo ('<input name="bc" class="buttonsC" type="radio" value="blue" checked="checked" />');
   } else{ echo ('<input name="bc" class="buttonsC" type="radio" value="blue"/>');}
   ?>
   <label><img src="../timeline/timeline_js/images/blue-circle.png" alt="Blue" width="10" height="10" longdesc="Blue button" /></label>
   <?php
   if ($corBoton=="none"){
   echo ('<input name="bc" class="buttonsC" type="radio" value="none" checked="checked" />');
   } else{ echo ('<input name="bc" class="buttonsC" type="radio" value="none"/>');}
   ?>
   <label></label>
   </p>
   </div>
   <div id="clear"></div>

<div id="clear" style="border-bottom-width:1px; border-bottom-style:solid; margin-top:10px; margin-bottom:10px;"><strong>Fin</strong></div>
<div id="endDiv">
<label>Ano</label>
<input type="number" min="475"max="1500" name="anoF" id="anoF" value="<?php echo $gAnoF ?>" style="float:left; margin-bottom:5px; width:80px"/>
<label>Mes</label>
<input type="number" min="1" max="12" name="mesF" id="mesF" value="<?php echo $gMesF ?>" style="width:50px"/>
<label>Día</label>
<input type="number" min="1" max="31" name="diaF" id="diaF" value="<?php echo $gDiaF ?>" style="width:50px"/>
<div id="clear"></div>
<label for="horaF">Hora</label>
<input type="number" min="0" max="23" name="horaF" id="horaF" value="<?php echo $gHoraF ?>" style="width:50px"/>
<label for="minutoF">Min.</label>
<input type="number" min="0" max="59" name="minutoF" id="minutoF" value="<?php echo $gMinutoF ?>" style="width:50px"/>
<label for="segundoF">Seg.</label>
<input type="number" min="0" max="59" name="segundoF" id="segundoF" value="<?php echo $gSegundoF ?>" style="width:50px"/>
</div>
<div id="cSele">
<input type="color" name="cor" id="cor" value="<?php echo $corlinea ?>" style="width:25px"/>
</div>
<div id="clear"></div>
<div id="clear" style="border-bottom-width:1px; border-bottom-style:solid; margin-top:10px; margin-bottom:10px;"><strong>Arquivo imaxe</strong></div>
<input name="imaxen" type="file" id="imaxen" class="ui-corner-all" />
<div id="ima_form">
   <img src="../ardoraWorkFiles/".xmlName."/img/thumbs/<?php echo $nomeThumb ?>" />
</div>
<label for="ancho" style="float:left; margin-top:5px">Ancho</label>

<input type="number" min="20" max="1000" name="ancho" id="ancho" value="<?php echo $ancho ?>" style="width:80px" />
</div>
</form>
<div id="clear"></div>
<div class="fg-toolbar ui-widget-header ui-corner-all ui-helper-clearfix"> 
     <div class="fg-buttonset ui-helper-clearfix">
          <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" style="float:left"></span>Recargar  </a>
     <?php
          if ($total<100){
          echo '<a href="#" class="fg-button ui-state-default fg-button-icon-solo  ui-corner-all" title="Gardar  " style="float:right" onclick="return showDialog()">';
          echo '<span class="ui-icon ui-icon-check"></span>Gardar </a>';
          }
     ?>
          <a id="b_borra" href="#" class="fg-button ui-state-default fg-button-icon-solo  ui-corner-all" title="Borrar palabra  " style="float:right" onclick="return showDialogBorrar()" margin-right:"30px">
          <span class="ui-icon ui-icon-trash"></span>Borrar palabra  </a>

     <?php
          $tipo=dameValor($slogin_Username, "TIP");
          if (($tipo=="profe") || ($tipo=="admin")){
             echo '<a href="#" class="fright fg-button ui-state-default fg-button-icon-solo ui-corner-all" title="Alumnos e alumnas:"  onclick="window.open(\'taboaAlumnado.php\',\'_blank\')" margin-right:"30px">';
             echo '<span class="ui-icon ui-icon-person"></span>Alumnos e alumnas:</a>';
          }
     ?>

</div>
</div></div></div></body></html>
