<?php
require 'database.inc.php';
if (Test_User($lg_user, $lg_password) == TRUE) {
?>
  <html>

  <head>
    <meta http-equiv='content-type' content='text/html;charset=utf-8'>
    <SCRIPT language=JavaScript src='valideformulaire.js' type=text/javascript></SCRIPT>
    <meta http-equiv='content-type' content='text/html;charset=utf-8'>
    <title>WebBike V<?php echo VERSION; ?></title>
    <?php
    $size = 2;
    if ($ligne = Poste::getPostesByIP()) {
      $size = $ligne['Size'];
    }
    echo "<link href='css/style$size.css' rel='stylesheet' media='screen'>\n";

    echo "<link href='" . CSS_FOLDER . "style.css' rel='stylesheet' media='screen'>\n"
    ?>
  </head>

  <body>
    <?php
    if ((!empty($User)) && (!empty($Passwd))) {
      $lg_user = $User;
      $lg_password = $Passwd;
    }
    if (Test_User($lg_user, $lg_password) == TRUE) {
      echo "<form METHOD='GET' name='info' action='ok_note.php'>\n";
      echo "<input type='hidden' name='annee' value='$annee'>\n";
      echo "<input type='hidden' name='mois' value='$mois'>\n";
      echo "<input type='hidden' name='jour' value='$jour'>\n";
      echo "<input type='hidden' name='personne' value='$personne'>\n";
      $resultat = Note::getNoteByDateAndPersonne($annee . '-' . $mois . '-' . $jour, $personne);
      if ($ligne = $resultat[0]) {
        $str = $ligne["Texte"];
        //$str = str_replace(array("\)$str);
        echo "<input type='hidden' name='new' value='0'>\n";
        echo "<textarea name='text' cols='30' rows='10'>";
        echo $str;
        echo "</textarea>\n";
      } else {
        echo "<input type='hidden' name='new' value='1'>\n";
        echo "<textarea name='text' cols='30' rows='10'>";
        echo "</textarea>\n";
      }
      echo "<input type='submit' value='valider'>\n";
      echo "</form>\n";
    }
    ?>
  </body>

  </html>
<?php
}
?>