<?php
/* 
	osCommerce, Open Source E-Commerce Solutions 
	http://www.oscommerce.com 
	
	Copyright (c) 2003 osCommerce 
	
	osCommRes, Services Oline 
	http://www.oscommres.com 
	Copyright (c) 2005 osCommRes 
	
	Freeway eCommerce 
	http://www.zac-ware.com/freeway 
	Copyright (c) 2007 ZacWare 
	
	Released under the GNU General Public License 
*/ 

$current_step="config";
?>
<table width="100%" cellpadding="0" cellspacing="0">
<form name="install" action="install.php?step=7" method="post">
	<tr>
		<td>
		<?php echo osc_draw_box_start(300);?>
		<table width="100%" border="0" cellpadding="5">
			<tr>
				<td>
				<?php echo osc_title_bar('Please enter the database information:');?>
				</td>
			</tr>
			<tr>
				<td>
				<table width="100%" border="0" cellpadding="2" class="formPage">
				  <tr>
					<td width="30%" valign="top">Database Server:</td>
					<td width="70%" class="smallDesc">
					  <?php echo osc_draw_input_field('DB_SERVER'); ?>
					  <img src="images/layout/help_icon.gif" onClick="toggleBox('dbHost');" align="absmiddle"><br>
					  <div id="dbHostSD">Hostame or IP-address of the database server</div>
					  <div id="dbHost" class="longDescription">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</div>
					</td>
				  </tr>
				  <tr>
					<td width="30%" valign="top">Username:</td>
					<td width="70%" class="smallDesc">
					  <?php echo osc_draw_input_field('DB_SERVER_USERNAME'); ?>
					  <img src="images/layout/help_icon.gif"  onClick="toggleBox('dbUser');" align="absmiddle"><br>
					  <div id="dbUserSD">Database username</div>
					  <div id="dbUser" class="longDescription">The username used to connect to the database server. An example username is 'mysql_10'.<br><br>
						  Note: Create and Drop permissions <b>are not required</b> for the general 
						  use of osCommRes.</div>
					</td>
				  </tr>
				  <tr>
					<td width="30%" valign="top">Password:</td>
					<td width="70%" class="smallDesc">
					  <?php echo osc_draw_password_field('DB_SERVER_PASSWORD'); ?>
					  <img src="images/layout/help_icon.gif" onClick="toggleBox('dbPass');" align="absmiddle"><br>
					  <div id="dbPassSD">Database password</div>
					  <div id="dbPass" class="longDescription">The password is used together with the username, which forms the database user account.</div>
					</td>
				  </tr>
				  <tr>
					<td width="30%" valign="top">Database Name:</td>
					<td width="70%" class="smallDesc">
					  <?php echo osc_draw_input_field('DB_DATABASE'); ?>
					  <img src="images/layout/help_icon.gif" onClick="toggleBox('dbName');" align="absmiddle"><br>
					  <div id="dbNameSD">Database Name</div>
						<div id="dbName" class="longDescription">The database used to hold the 
						  data. An example database name is 'osCommRes'.</div>
					</td>
				  </tr>
				  <!--<tr>
					<td width="30%" valign="top">Persistent Connections:</td>
					<td width="70%" class="smallDesc">
					  <?php echo osc_draw_checkbox_field('USE_PCONNECT', 'true'); ?>
					  <img src="images/layout/help_icon.gif" onClick="toggleBox('dbConn');" align="absmiddle"><br>
					  <div id="dbConnSD"></div>
					  <div id="dbConn" class="longDescription">Enable persistent database connections.<br><br>Note: Persistent connections should be disabled for shared servers.</div>
					</td>
				  </tr>-->
				  <tr>
					<td width="30%" valign="top">Session Storage:</td>
					<td width="70%" class="smallDesc">
					  <?php echo osc_draw_radio_field('STORE_SESSIONS', 'files', (isset($HTTP_POST_VARS['STORE_SESSIONS']) ? '' : true)); ?>&nbsp;Files&nbsp;&nbsp;<?php echo osc_draw_radio_field('STORE_SESSIONS', 'mysql'); ?>&nbsp;Database&nbsp;&nbsp;
					  <img src="images/layout/help_icon.gif" onClick="toggleBox('dbSess');" align="absmiddle"><br>
					  <div id="dbSessSD"></div>
					  <div id="dbSess" class="longDescription">Store user session data as files on the server, or in the database.<br><br>Note: Due to security related issues, database session storage is recommended for shared servers.</td></div>
					</td>
				  </tr>
				</table>
				</td>
			</tr>
			</table>
			<?php echo osc_draw_box_end();?>
			</td>
		</tr>
		<tr>
			<td>
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
			  <tr>
				<td><a href="index.php"><img src="images/button_cancel.gif" border="0" alt="Cancel"></a></td>
				<td align="right"><input type="image" src="images/button_continue.gif" border="0" alt="Continue" class="imageButton"></td>
			  </tr>
			</table>
			</td>
		</tr>
		<?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')) {// && ($key != 'USE_PCONNECT')
			  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>
</table>
