<?php

// -----------------------------------------------------------------------
// This file is part of AROUNDMe
//
// Copyright (C) 2003 - 2007 Barnraiser
// http://www.barnraiser.org/
// info@barnraiser.org
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with program; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
// 02110-1301, USA.
// -----------------------------------------------------------------------

?>

		<?php if (isset($_POST['frm_send']) || isset($_POST['frm_send_2'])) { ?>
		
			<div class="message">
				<p><b><?php echo $lang['txt_system_message'];?></b></p>
				<?php if (createDatabase($_POST)) {$v = isset($_POST['frm_send']) ? 4 : "3a"; header("location: install.php?step=".$v); exit; } ?>
			</div>
			
		<?php } ?>
		
		<form method="post" action="install.php" name="frm">
			<input type="hidden" name="step" value="3" />
			<p><?php echo $lang['txt_step_3']; ?></p>
			<table width="100%">
			<tr>
				<td><label><?php echo $lang['txt_step_3_database_database']; ?></label></td>
				<td>
					<select name="frm_database_database">
					<?php selDatabases(); ?>
					</select>
				</td>
			</tr>
			<tr>
				<td><label><?php echo $lang['txt_step_3_database_newdatabase']; ?></label></td>
				<td><input type="text" name="frm_database_database_new" value="<?php echo isset($_REQUEST['frm_database_database_new']) ? $_REQUEST['frm_database_database_new'] : ''; ?>"/></td>
			</tr>
					
			<tr>
				<td><label><?php echo $lang['txt_step_3_database_tableprefix']; ?></label></td>
				<td><input type="text" name="frm_database_table_prefix" value="<?php echo isset($_REQUEST['frm_database_table_prefix']) ? $_REQUEST['frm_database_table_prefix'] : ''; ?>"/></td>
			</tr>
			<tr align="right">
				<td></td>		
				<td><input type="submit" value="<?php echo $lang['frm_step_3_next_step_auto']; ?>" name="frm_send"/></td>
			</tr>
			
			<tr align="right">
				<td></td>		
				<td><input type="submit" value="<?php echo $lang['frm_step_3_next_step_manual']; ?>" name="frm_send_2"/></td>
			</tr>
			
			</table>
		</form>
