<?php
/* 
	osCommerce, Open Source E-Commerce Solutions 
	http://www.oscommerce.com 
	
	Copyright (c) 2003 osCommerce 
	
	 
	
	Freeway eCommerce 
	http://www.openfreeway.org
	Copyright (c) 2007 ZacWare
	
	osConcert, Online Seat Booking 
  	http://www.osconcert.com

  	Copyright (c) 2009-2013 osConcert 
	
	Released under the GNU General Public License 
*/ 

$current_step="config";
?>
<div class="container" style="width:800px">
<div class="row">
		<div class="col-md-12">
		<ul class="list-group list-group-horizontal justify-content-center">
					  <li class="list-group-item"><strong>Server Configuration</strong></li>
					  <li class="list-group-item"><strong>Secure Server Configuration</strong></li>
					  <li class="list-group-item"><strong>Database Configuration</strong></li>
					  <li class="list-group-item">Configuration Done</li>
					</ul> <br>
		</div>
</div>
<div class="row">
		<div class="col-md-12">
		<div class="progress progress-bar progress-bar-striped progress-bar-animated bg-info" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%">75%</div>
		</div>
</div>
<div class="row">
		<div class="col-md-12">
		<form name="install" action="install.php?step=7" method="post">
			<h3>Please enter the database information:</h3>  		
            <div style="width: 100%; float: left; padding-right:15px; margin: 10px 0px;">                        
                <div style="width: 30%; vertical-align: text-top; float: left;" >Database Server:</div>
                <div style="width: 70%; float: left;">
					<?php echo osc_draw_input_field('DB_SERVER'); ?>
					<?php $tooltip_server = "The database server can be in the form of a hostname, such as db1.myserver.com, or as an IP-address, such as 192.168.0.1" ?>
					<br><i class="fa fa-question-circle" style="color:#117a8b" data-toggle="tooltip" data-placement="bottom" title="<?php echo $tooltip_server;?>">
						Hostame or IP-address of the database server
					</i>    
                 </div>    
            </div>
             
             <div style="width: 100%; float: left; padding-right:15px; margin: 10px 0px;">
                <div style="width: 30%; vertical-align: text-top; float: left;" >Username:</div>
                <div style="width: 70%; float: left;">
					<?php echo osc_draw_input_field('DB_SERVER_USERNAME'); ?>
					<?php $tooltip_name = "The username used to connect to the database server. An example username is 'mysql_10'.\n \n Note: Create and Drop permissions <b>are not required</b> for the general use of osConcert." ?>
					<br><i class="fa fa-question-circle" style="color:#117a8b" data-toggle="tooltip" data-placement="bottom" title="<?php echo $tooltip_name;?>">
						Database username
					</i>
                </div>
            </div>
             
            <div style="width: 100%; float: left; padding-right:15px; margin: 10px 0px;">                        
                <div style="width: 30%; vertical-align: text-top; float: left;" >Password:</div>
                <div style="width: 70%; float: left;">
					<?php echo osc_draw_password_field('DB_SERVER_PASSWORD'); ?>
					<?php $tooltip_pass = "The password is used together with the username, which forms the database user account." ?>
					<br><i class="fa fa-question-circle" style="color:#117a8b" data-toggle="tooltip" data-placement="bottom" title="<?php echo $tooltip_pass;?>">
						Database password
					</i>
				</div>    
            </div>                            
             
            <div style="width: 100%; float: left; padding-right:15px; margin: 10px 0px;">                        
				<div style="width: 30%; vertical-align: text-top; float: left;" >Database Name:</div>
				<div style="width: 70%; float: left;">
					<?php echo osc_draw_input_field('DB_DATABASE'); ?>
					<?php $tooltip_db_name = "The database used to hold the data. An example database name is 'osConcert'." ?>
					<br><i class="fa fa-question-circle" style="color:#117a8b" data-toggle="tooltip" data-placement="bottom" title="<?php echo $tooltip_db_name;?>">
						Database Name
					</i>
                </div>    
            </div> 
             
            <div style="width: 100%; float: left; padding-right:15px; margin: 10px 0px;">                        
                <div style="width: 30%; vertical-align: text-top; float: left;" >Session Storage:</div>
                <div style="width: 70%; float: left;">
					<div class="form-check-inline">
						<?php echo osc_draw_radio_field('STORE_SESSIONS', 'files'); ?>Files
					</div>
					<div class="form-check-inline">
						<?php echo osc_draw_radio_field('STORE_SESSIONS', 'mysql','true'); ?>Database
					</div>				
					<?php $tooltip_stor = "Store user session data as files on the server, or in the database.\n\nNote: Due to security related issues, database session storage is recommended for shared servers." ?>
					<i class="fa fa-question-circle" style="color:#117a8b" data-toggle="tooltip" data-placement="bottom" title="<?php echo $tooltip_stor;?>"></i>					
                 </div>    
            </div> 
			<a class="btn btn-info" style="float: left; margin-top: 10px;" href="index.php" role="button"><i class='fas fa-arrow-alt-circle-left' style='color:white'></i> Cancel</a>
			<button type="button" class="btn btn-info" style="float: right; margin-top: 10px;" onClick="this.form.submit();">Continue <i class='fas fa-arrow-alt-circle-right' style='color:white'></i></button>
		<?php
			reset($HTTP_POST_VARS);
			while (list($key, $value) = each($HTTP_POST_VARS)) {
				if (($key != 'x') && ($key != 'y') && ($key != 'DB_SERVER') && ($key != 'DB_SERVER_USERNAME') && ($key != 'DB_SERVER_PASSWORD') && ($key != 'DB_DATABASE') && ($key != 'STORE_SESSIONS')) {
					if (is_array($value)) {
						for ($i=0; $i<sizeof($value); $i++) {
							echo osc_draw_hidden_field($key . '[]', $value[$i]);
						}
					} else {
						echo osc_draw_hidden_field($key, $value);
					}
				}
			}
		?>
		</form>
		</div>
</div>
</div>
<br>
