<?php
// Created by Ardora www.webardora.net
//TIMELINE-introdatos
session_start();
$slogin_noauthpage = 0;
$slogin_pagetitle = "";
include_once ("../stu1A/stu1A_lib.php");
include_once ("dameDatos.php");

session_cache_limiter('nocache,private');
?>
<html lang="es">
<head><meta charset="utf-8"/><title>Timeline</title>
<!--CSS--><link type="text/css" href="../ardoraFiles/ui-themes/vegas_azu/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="Word  ">
         <span class="ui-icon ui-icon-check" style="float:left; margin:0 7px 20px 0;"></span><p>Save word?  </p>
     </div>
     <div id="borrar" title="Delete  ">
         <span class="ui-icon ui-icon-check" style="float:left; margin:0 7px 20px 0;"></span><p>Delete word?  </p>
     </div>

     <div id="profe" title="Students  ">
     </div>

<div id="contenedor">
     <div id="cabeza">
           <div id="texto_form">
           <h1>Timeline of Computer History</h1>
           <p><b><SPAN style="font-size:12px; color:#000000">A brief timeline of the key events in the history of computers</b></SPAN><br>
</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 ('gravaDatos.php?indi='.$ele)?>" enctype="multipart/form-data">
   <div id="traballos" class="ui-widget-header ui-corner-all">
   <p>Insert data</p>
   <?php
   $path = "../ardoraWorkFiles/computertime/";
   $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;">Jobs added  </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">Word</label>
     <input type="text" name="titulo" id="titulo" class="formLogin" placeholder="Insert your text"
      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">Remark</label>
   <textarea id="comenta" name="comenta" placeholder="Insert a remark" 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>Start</strong></div>
   <div id="startDiv">
   <label>Year</label> 
   <input type="number" min="1822"max="2035" name="anoI" id="anoI" value="<?php echo $gAnoI ?>" style="width:80px"/>
   <label>Month</label>
   <input type="number" min="1" max="12" name="mesI" id="mesI" value="<?php echo $gMesI ?>" style="width:50px"/>
   <label for="diaI">Day</label>
   <input type="number" min="1" max="31" name="diaI" id="diaI" value="<?php echo $gDiaI ?>" style="width:50px"/>

   <div id="clear"></div>
   <label>Hour</label>
   <input type="number" min="0" max="23" name="horaI" id="horaI" value="<?php echo $gHoraI ?>" style="width:50px"/>
   <label>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">Sec.</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>End</strong></div>
<div id="endDiv">
<label>Year</label>
<input type="number" min="1822"max="2035" name="anoF" id="anoF" value="<?php echo $gAnoF ?>" style="float:left; margin-bottom:5px; width:80px"/>
<label>Month</label>
<input type="number" min="1" max="12" name="mesF" id="mesF" value="<?php echo $gMesF ?>" style="width:50px"/>
<label>Day</label>
<input type="number" min="1" max="31" name="diaF" id="diaF" value="<?php echo $gDiaF ?>" style="width:50px"/>
<div id="clear"></div>
<label>Hour</label>
<input type="number" min="0" max="23" name="horaF" id="horaF" value="<?php echo $gHoraF ?>" style="width:50px"/>
<label>Min.</label>
<input type="number" min="0" max="59" name="minutoF" id="minutoF" value="<?php echo $gMinutoF ?>" style="width:50px"/>
<label>Sec.</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/computertime/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="Recharge ">
          <span class="ui-icon ui-icon-refresh" style="float:left"></span>Recharge  </a>
     <?php
          if ($total<120){
          echo '<a href="#" class="fg-button ui-state-default fg-button-icon-solo  ui-corner-all" title="Word  " style="float:right" onclick="return showDialog()">';
          echo '<span class="ui-icon ui-icon-check"></span>Word </a>';
          }
     ?>
          <a id="b_borra" href="#" class="fg-button ui-state-default fg-button-icon-solo  ui-corner-all" title="Delete  " style="float:right" onclick="return showDialogBorrar()" margin-right:"30px">
          <span class="ui-icon ui-icon-trash"></span>Delete  </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="Students"  onclick="window.open(\'taboaAlumnado.php\',\'_blank\')" margin-right:"30px">';
             echo '<span class="ui-icon ui-icon-person"></span>Students</a>';
          }
     ?>

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