<tr class="table-color2">
	<td class="text"><b>Database Server Type<span class="error">*</span>:</b></td>
  	<td align="left">
    	<select name="DBType">
    	<?php
    		$options = Array ('mysqli' => 'MySQL', /*'mssql' => 'MS-SQL Server', 'pgsql' => 'pgSQL'*/);
    		$option_tpl = '<option value="%1$s"%2$s>%3$s</option>'."\n";

    		foreach ($options as $option_key => $option_title) {
    			$selected = $option_key == $this->toolkit->systemConfig->get('DBType', 'Database') ? ' selected' : '';
    			echo sprintf($option_tpl, $option_key, $selected, $option_title);
    		}
    	?>
		</select>
	</td>
</tr>

<tr class="table-color2">
	<td class="text"><b>Database Hostname <span class="error">*</span>:</b></td>
	<td align="left">
		<input type="text" name="DBHost" class="text" value="<?php echo $this->toolkit->systemConfig->get('DBHost', 'Database'); ?>" />
	</td>
</tr>

<tr class="table-color2">
	<td class="text"><b>Database Name <span class="error">*</span>:</b></td>
	<td align="left">
		<input type="text" name="DBName" class="text" value="<?php echo $this->toolkit->systemConfig->get('DBName', 'Database'); ?>" />
	</td>
</tr>

<tr class="table-color2">
	<td class="text"><b>Database User Name <span class="error">*</span>:</b></td>
	<td align="left">
		<input type="text" name="DBUser" class="text" value="<?php echo $this->toolkit->systemConfig->get('DBUser', 'Database'); ?>" />
	</td>
</tr>

<tr class="table-color2">
	<td class="text"><b>Database User Password:</b></td>
	<td align="left">
		<input type="password" name="DBUserPassword" class="text" value="<?php echo $this->toolkit->systemConfig->get('DBUserPassword', 'Database'); ?>" />
	</td>
</tr>

<tr class="table-color2">
	<td class="text"><b>Database Collation <span class="error">*</span>:</b></td>
	<td align="left">
		<select name="DBCollation" class="text">
			<?php
				$option_tpl = '<option value="%1$s"%2$s>%1$s</option>'."\n";
				$collations = Array ('utf8_general_ci', 'latin1_swedish_ci');
				foreach ($collations as $collation) {
					$selected = ($collation == $this->toolkit->systemConfig->get('DBCollation', 'Database')) ? ' selected="selected"' : '';
					echo sprintf($option_tpl, $collation, $selected);
				}
			?>
		</select>
	</td>
</tr>

<tr class="table-color2">
	<td class="text"><b>Prefix for Table Names:</b></td>
	<td align="left">
		<input type="text" name="TablePrefix" class="text" maxlength="7" value="<?php echo $this->toolkit->systemConfig->get('TablePrefix', 'Database'); ?>" />
	</td>
</tr>

<?php if ($this->GetVar('preset') != 'already_installed') { ?>
<!--show this option ONLY when config.php is empty or cant connect to In-Portal installation using current DB settings -->
<tr class="table-color2">
	<td class="text" width="55%"><b>Use existing In-Portal installation in this Database:</b></td>
	<td align="left">
		<input type="radio" name="UseExistingSetup" id="UseExistingSetup_1" value="1"/> <label for="UseExistingSetup_1">Yes</label> <input type="radio" name="UseExistingSetup" id="UseExistingSetup_0" value="0" checked/> <label for="UseExistingSetup_0">No</label>
	</td>
</tr>
<?php } ?>