<link rel="stylesheet" href="styles/default/css/installation.css" />
<form action="index.php?module=installation&event=dbselect&task=store2" method="post" name="setup_db">

    <table id="maintable">
        <tr>
            <td valign="top" class="mainleft">
                <ul>
                    <li><a href="index.php?module=installation">pre-installation check</a></li>
                    <li><a href="index.php?module=installation&event=db">Step 1</a></li>
                    <li class="active">Step 2</li>
                    <li>Step 3</li>
                    <li>Step 4</li>
                    <li>Step 5</li>
                </ul>
            </td>
            <td valign="top" class="mainright">


                <table class="settings">
                    <tr>
                        <td colspan="2">
                            <div style="float:right;">
                                <a href="#" onclick="document.setup_db.submit();
                                        return false;" class="button">next &gt;</a><br />
                            </div>
                            <h1>Step 2</h1>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">Database configuration (2):</th>
                    </tr>
                    <tr><td colspan="2" class="spacer"></td></tr>
                    <tr>
                        <td valign="top">
                            Select the database name of the server
                            <b>HEINZELM<span style="color:red;">A</span>NN</b> ist to be installed on.<br /><br />
                            If you want to use <b>HEINZELM<span style="color:red;">A</span>NN</b> with 
                            <b>Asset.Desk</b>, select your Asset.Desk database here.<br /><br />

                            Please verify your database connection settings.<br />


                        </td>

                        <td valign="top" class="boxed">
                            <table>                           
                                [% if $connection_failed %]
                                    <tr>
                                        <td colspan="2"><span class="error">Connection failed</span></td>
                                    </tr>
                                [% /if %]
                                <tr>
                                    [% if $Error %]
                                    <tr>
                                        <td colspan="2"><span class="error"> [% $Error %]</span></td>
                                    </tr>  
                                [% /if %]                          
                                <td>

                                    <input type="radio" name="NewOrExist" value="NewDB" [% if $database == '' %]checked="checked"[% /if %] onclick="this.form.database.disabled = true;
                                            this.form.enterDBName.disabled = false;"> Create a new database<br>
                                </td>
                                <td>
                                    <label for="enterDBName">New Database Name: </label>
                                    <input name="enterDBName" type="text" size="10" value="[% $enterDBName %]">

                                </td>
                    </tr>

                    <tr>
                        <td>
                            <input type="radio" name="NewOrExist" value="ExistDB" [% if $database != '' %]checked="checked"[% /if %] onclick="this.form.database.disabled = false; this.form.enterDBName.disabled = true;"> Choose an existing database
                        </td>
                        <td>
                            <label for="database">Database Name</label>
                            [% if $databases %]
                                <select size="1" name="database" [% if $database != '' %][% else %]disabled="true"[% /if %] >
                                    [% foreach from=$databases item=db %]
                                        <option value="[% $db %]" [% if $database == $db %]selected="selected"[% /if %]>[% $db %]</option>
                                    [% /foreach %]
                                </select>
                            [% else %]
                                <input type="text" name="database" value="[% $database %]" class="textbox" />
                            [% /if %]
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                    [% if $phptype == "oci8" %]
                        <tr>
                            <td>Password for HEINZELMANN DB
                            </td>
                            <td>
                                <label for="password">Password </label>
                                <input type="password" name="HMPW" value="[% $password %]" class="textbox" />
                            </td>
                        </tr>
                    [% /if %]

                    <tr><td colspan="2">&nbsp;</td></tr>
                    <tr>
                        <td>Database Type:</td>
                        <td>
                            [% if $phptype == "mssql" || $phptype == "sqlsrv" %]Microsoft SQL Server[% /if %]
                            [% if $phptype == "oci8" %]Oracle Server[% /if %]
                        </td>
                    </tr>
                    <tr>
                        <td>Host Name:</td>
                        <td>[% $hostspec %]</td>
                    </tr>
                    <tr>
                        <td>[% if $phptype == "oci8" %]Service name: [% else %]User Name: [% /if %]</td>
                        <td>[% $username %]</td>
                    </tr>
                    <tr>
                        <td>Password:</td>
                        <td>[% $password|regex_replace:"/\S/":"*" %]</td>
                    </tr>
                    <tr>
                        <td>Database Port (optional):</td>
                        <td>[% $port %]</td>
                    </tr>
                </table>

            </td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
    </table>

</td>
</tr>
</table>

</form>