<?php

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// HamLogWeb
//
// Par F5AGL - GRIP 2007-2008
//
// Email : f5agl@zapgillou.fr
//
// Cette création est mise à disposition selon le Contrat Paternité-Pas d'Utilisation Commerciale-Pas de Modification 2.0 France 
// disponible en ligne http://creativecommons.org/licenses/by-nc-nd/2.0/fr/ 
// ou par courrier postal à Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.
// 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Fichier : index.php 
//
// Description : Gestionnaire d'installation de HamLogWeb
//
// Paramètres : 
//	
//	- aucun
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

$mode=$_GET['mode'];

$url = $_SERVER['SERVER_NAME'];
$path = $_SERVER['PHP_SELF'];

$site_www='http://'.$url.$path;  

$site_www=substr($site_www,0,strlen($site_www)-19); // les 19 caractères correspondent à hlwtemp/install.php
$path=substr($path,0,strlen($path)-20); // les 20 caractères correspondent à /hlwtemp/install.php

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <title>HamLogWeb - Installation</title>
</head>

<body>
<div style="text-align: center;"><b><span
 style="font-family: Comic Sans MS; color: rgb(153, 0, 0);"></span></b><big
 style="font-family: Comic Sans MS; font-weight: bold; color: rgb(0, 0, 153);"><big><big><big>HamLog</big></big></big></big><big
 style="font-family: Comic Sans MS; color: rgb(102, 102, 102); font-weight: bold;"><big><big><big>Web</big></big></big></big><span
 style="font-family: Comic Sans MS; font-weight: bold;"><span
 style="color: rgb(153, 0, 0);"><br></span></span>
<div style="text-align: left;"><span
 style="font-family: Comic Sans MS; font-weight: bold;"><span
 style="color: rgb(153, 0, 0);"><br>
</span></span>
<div style="text-align: center;"><span
 style="font-family: Comic Sans MS; font-weight: bold;"><span
 style="color: rgb(153, 0, 0);"><?php 
if ($mode=="complet") { echo "INSTALLATION COMPLETE / FULL INSTALL"; }
if ($mode=="maj")     { echo "MISE A JOUR D'UN SITE EXISTANT / UPDATING AN EXISTING WEB SITE"; }
?></span></span><span
 style="font-family: Comic Sans MS; font-weight: bold;"><span
 style="color: rgb(153, 0, 0);"><br>
Renseignez les informations ci-dessous. / Fill the following table<br>
ATTENTION, il est recommand&eacute; de lire la documentation. / WARNING, please read documentation.<br>
PATIENTEZ apr&egrave;s avoir cliqu&eacute; sur le bouton "GO !" / BE PATIENT after you click on "GO !" button
<BR>
<span style="color: rgb(0, 0, 0);"></span></span></span><span
 style="font-family: Comic Sans MS; font-weight: bold;"><span
 style="color: rgb(153, 0, 0);"></span></span><span
 style="font-family: Comic Sans MS; font-weight: bold;"><span
 style="color: rgb(153, 0, 0);"></span></span></div>
<form method="post" action="./testmysql.php?mode=<?php echo $mode; ?>&site_www=<?php echo $site_www; ?>&url=<?php echo $url; ?>&path=<?php echo $path; ?>"
 name="DATA">
    <table
 style="background-color: rgb(153, 153, 153); width: 90%; text-align: left; margin-left: auto; margin-right: auto;"
 border="1" cellpadding="3" cellspacing="0">
    <tbody>
    <tr>
      <td
 style="font-family: Helvetica,Arial,sans-serif; font-weight: bold;"><font
 size="-1">Adresse du site HamLogWeb - HamLogWeb web site address</font></td>
      <td style="font-family: Helvetica,Arial,sans-serif;"><font
 size="-1"><?php echo $site_www; ?><br>
      </font></td>
      <td
 style="font-family: Helvetica,Arial,sans-serif; font-style: italic;">
      <div style="margin-left: 40px;"><font size="-1">Si
l'adresse est incorrecte, reportez-vous &agrave; la documentation. / If not correct, please read documentation.</font></div>
      </td>
    </tr>

<?php if ($mode=="complet") { ?>
      
      <tr>
        <td
 style="width: 30%; font-family: Helvetica,Arial,sans-serif; font-weight: bold;"><font
 size="-1">MySQL - Nom du serveur / Server name</font></td>
        <td
 style="width: 30%; font-family: Helvetica,Arial,sans-serif;"><font
 size="-1"><input size="40" name="db_host"></font></td>
        <td colspan="1" rowspan="4"
 style="text-align: left; font-family: Helvetica,Arial,sans-serif; font-style: italic;">
        <div style="text-align: left; margin-left: 40px;"><font
 size="-1"><span style="font-weight: bold;"></span>Informations
fournies par votre h&eacute;bergeur / Informations giving by your web provider</font></div>
        </td>
      </tr>
      <tr>
        <td
 style="font-family: Helvetica,Arial,sans-serif; font-weight: bold;"><font
 size="-1">MySQL - Nom d'utilisateur / User name</font></td>
        <td style="font-family: Helvetica,Arial,sans-serif;"><font
 size="-1"><input size="40" name="db_login"></font></td>
      </tr>
      <tr>
        <td
 style="font-family: Helvetica,Arial,sans-serif; font-weight: bold;"><font
 size="-1">MySQL - Mot de passe / Password</font></td>
        <td style="font-family: Helvetica,Arial,sans-serif;"><font
 size="-1"><input size="40" name="db_psw"></font></td>
      </tr>
      <tr>
        <td
 style="font-family: Helvetica,Arial,sans-serif; font-weight: bold;"><font
 size="-1">MySQL - Nom de la base de donn&eacute;es / Database name</font></td>
        <td style="font-family: Helvetica,Arial,sans-serif;"><font
 size="-1"><input size="40" name="db_base"></font></td>
      </tr>
      <tr>
        <td
 style="font-family: Helvetica,Arial,sans-serif; font-weight: bold;"><font
 size="-1">MySQL - Pr&eacute;fixe des tables HamLogWeb / HamLogWeb table prefix</font></td>
        <td style="font-family: Helvetica,Arial,sans-serif;"><font
 size="-1"><input size="40" name="db_table"></font></td>
        <td
 style="font-family: Helvetica,Arial,sans-serif; font-style: italic;">
        <div style="margin-left: 40px;"><font size="-1">Choisissez
le pr&eacute;fixe des tables HLW dans votre base MyQSL / Choose prefix for HamLogWeb tables in your MySQL database</font></div>
        </td>
      </tr>
<?php } ?>
    </tbody>
  </table>

  <span style="font-family: Comic Sans MS; font-weight: bold;"><span
 style="color: rgb(153, 0, 0);"></span></span><span
 style="font-family: Comic Sans MS;"><span
 style="color: rgb(153, 0, 0);"></span></span><span
 style="font-family: Comic Sans MS;"><span
 style="color: rgb(153, 0, 0);"></span></span><br>
  <span style="font-family: Comic Sans MS;"><span
 style="color: rgb(153, 0, 0);"></span></span>
  <span style="font-family: Comic Sans MS;"><span
 style="color: rgb(153, 0, 0);"></span></span>
  <div style="text-align: center;"><input
 value="GO !" type="submit"></div>
</form>

<hr style="width: 100%; height: 2px;">
<div style="text-align: center;"><small><span
 style="font-family: Comic Sans MS; font-weight: bold;"><span
 style="color: rgb(0, 0, 153);">HamLog</span><span
 style="color: rgb(102, 102, 102);">Web</span></span>&nbsp;-
par <a href="mailto:hamweb@zapgillou.fr">F5AGL</a><br>
Distribu&eacute; sous&nbsp;<a
 href="http://creativecommons.org/licenses/by-nc-nd/2.0/fr/deed.en">Creative
Commons Licence</a><br>
<small><small><small><small><small><small>&nbsp;</small></small></small></small></small></small></small></div>
<div style="text-align: center;">
<a href="http://www.php.net/"><img src="./img/php.png"
 style="border: 0pt none ;"></a> <a
 href="http://www.nvu.com/"><img src="./img/nvu.gif"
 style="border: 0pt none ;"></a> <a
 href="http://www.getfirefox.com/"><img
 src="./img/firefox.gif" style="border: 0pt none ;"></a>
<a rel="license"
 href="http://creativecommons.org/licenses/by-nc-nd/2.0/fr/"><img
 alt="Creative Commons License" style="border-width: 0pt;"
 src="http://i.creativecommons.org/l/by-nc-nd/2.0/fr/80x15.png"></a></div>
</body>
</html>

		