<?php
/*******************************************************************************
 *   Install - GuppY PHP Script
 *******************************************************************************
 *   GuppY PHP Script - version 6.0
 *   CeCILL Copyright (C) 2004-2020 by Laurent Duveau
 *   Initiated by Laurent Duveau and Nicolas Alves
 *   Web site = https://www.freeguppy.org/
 *   e-mail   = guppy@freeguppy.org
 *   V6 developed by Lud Bienaimé
 *      with the participation of the GuppY Team
 *******************************************************************************
 *   Latest Changes :
 * v6.00.00 (December 15, 2020) : initial release
 ******************************************************************************/

header('Pragma: no-cache');
define('CHEMIN', '../');
$selskin = 'no_skin';
include CHEMIN.'inc/includes.inc';
include $lng.'-install.inc';
include 'func_install.php';

include CONFIGREP.'dbversion.php';
$version = $DBversion;

$form = import('form');

if (empty($form)) {
	DisplayHeader();
	echo '
<p style="text-align:center;">
  <a href="Javascript: window.location=\'install.php?lng='.$lang[0].'\';">
    <i class="flg-'.$lang[0].'" title="'.$lang[0].'"></i>
  </a>
  &nbsp;&nbsp;&nbsp;&nbsp;
  <a href="Javascript: window.location=\'install.php?lng='.$lang[1].'\';">
    <i class="flg-'.$lang[1].'" title="'.$lang[1].'"></i>
  </a>
</p>';
	DisplayTitre($clean[1], $clean[2].'<br /><br />'.$clean[3]);
	echo '
  <form name="instal0" action="install.php?lng='.$lng.'" method="post">
    <input type="hidden" name="form" value="1"/>
    <div style="text-align:center;">'.SubmitButton($clean[4]).'</div>
  </form>
</div>';
} elseif ($form == '1') {
	DisplayHeader();
	DisplayTitre($clean[1], sprintf($clean[5], MP_VERSION));
	echo '
<form name="instal1" action="install.php?lng='.$lng.'" method="post">
  <table class="quest" style="width:480px;margin:auto;">';
	echo '
	<tr><td><label><input type="radio" name="form" value="2"/>&nbsp;&nbsp;'.$clean[6].'</label></td></tr>
	<tr><td>&nbsp;</td>';
	echo '
	<tr><td><label><input type="radio" name="form" value="3"/>&nbsp;&nbsp;'.$clean[7].'</label></td></tr>
	<tr><td>&nbsp;</td>';
	echo '
	<tr><td><label><input type="radio" name="form" value="4"/>&nbsp;&nbsp;'.$clean[8].'</label></td></tr>
	<tr><td>&nbsp;</td>
	<tr><td><hr /><label><input type="radio" name="form" value="5"/>&nbsp;&nbsp;'.$clean[9].'</label></td></tr>
	<tr><td>&nbsp;</td>
  </table>
  <div style="text-align:center;"><br />'.SubmitButton($clean[4]).'</div>
</form>';
} elseif ($form == '2') {
	DisplayHeader('cleanup.php?lng='.$lng);
    exit();
} elseif ($form == '3') {
	DisplayHeader('migrate50.php?lng='.$lng);
	exit();
} elseif ($form == '4') {
	DisplayHeader('delete.php?lng='.$lng);
    exit();
} else {
	DisplayHeader(CHEMIN.'index.php?lng='.$lng);
    exit();
}

DisplayFooter();
?>