<table cellspacing="0" cellpadding="5" border="0" align="center">
<tr>
<th colspan="2">
    <?php print_string("server_settings", "enrol_database") ?>
</td>
</tr>
<tr valign="top">
    <td align="right">enrol_dbtype:</td>
    <td>
    <?php  
       $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mysql", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
       foreach ($dbtypes as $dbtype) {
           $dboptions[$dbtype] = $dbtype;
       }
       if (!isset($frm->enrol_dbtype)) {
           $frm->enrol_dbtype = 'mysql';
       }
       choose_from_menu($dboptions, "enrol_dbtype", $frm->enrol_dbtype, '', '', '');
    ?>
      
    </td>
    <td>
    <?php  print_string("dbtype","enrol_database") ?>
    </td>
</tr>

<tr valign="top">
    <td align="right">enrol_dbhost:</td>
    <td>
    <?php 
        if (!isset($frm->enrol_dbhost)) {
            $frm->enrol_dbhost = '';
        } 
    ?>
        <input size="15" type="text" name="enrol_dbhost" value="<?php p($frm->enrol_dbhost) ?>" />
    </td>
    <td>
    <?php  print_string("dbhost","enrol_database") ?>
    </td>
</tr>

<tr valign="top">
    <td align="right">enrol_dbuser:</td>
    <td>
        <input size="15" type="text" name="enrol_dbuser" value="<?php echo $frm->enrol_dbuser ?>" />
    </td>
    <td>
    <?php  print_string("dbuser","enrol_database") ?>
    </td>
</tr>

<tr valign="top">
    <td align="right">enrol_dbpass:</td>
    <td>
        <input size="15" type="text" name="enrol_dbpass" value="<?php echo $frm->enrol_dbpass ?>" />
    </td>
    <td>
    <?php  print_string("dbpass","enrol_database") ?>
    </td>
</tr>

<tr valign="top">
    <td align="right">enrol_dbname:</td>
    <td>
        <input size="15" type="text" name="enrol_dbname" value="<?php echo $frm->enrol_dbname ?>" />
    </td>
    <td>
    <?php  print_string("dbname","enrol_database") ?>
    </td>
</tr>

<tr valign="top">
    <td align="right">enrol_dbtable:</td>
    <td>
        <input size="15" type="text" name="enrol_dbtable" value="<?php echo $frm->enrol_dbtable ?>" />
    </td>
    <td>
    <?php  print_string("dbtable","enrol_database") ?>
    </td>
</tr>
<th colspan="2">
    <?php print_string("field_mapping", "enrol_database") ?>
</td>
<tr valign="top">
    <td align="right">enrol_localcoursefield:</td>
    <td>
        <input size="15" type="text" name="enrol_localcoursefield" value="<?php echo $frm->enrol_localcoursefield ?>" />
    </td>
    <td>
    <?php  print_string("localcoursefield","enrol_database") ?>
    </td>
</tr>

<tr valign="top">
    <td align="right">enrol_localuserfield:</td>
    <td>
        <input size="15" type="text" name="enrol_localuserfield" value="<?php echo $frm->enrol_localuserfield ?>" />
    </td>
    <td>
    <?php  print_string("localuserfield","enrol_database") ?>
    </td>
</tr>

<tr valign="top">
    <td align="right">enrol_remotecoursefield:</td>
    <td>
        <input size="15" type="text" name="enrol_remotecoursefield" value="<?php echo $frm->enrol_remotecoursefield ?>" />
    </td>
    <td>
    <?php  print_string("remotecoursefield","enrol_database") ?>
    </td>
</tr>

<tr valign="top">
    <td align="right">enrol_remoteuserfield:</td>
    <td>
        <input size="15" type="text" name="enrol_remoteuserfield" value="<?php echo $frm->enrol_remoteuserfield ?>" />
    </td>
    <td>
    <?php  print_string("remoteuserfield","enrol_database") ?>
    </td>
</tr>

<tr>
   <th colspan="2">
        <?php print_string("enrol_ldap_autocreation_settings", "enrol_ldap") ?>
   </td>
</tr>
<tr valign="top">
    <td align="right">enrol_db_autocreate:</td>
    <td>
    <?php
       choose_from_menu(array('0'=>'no','1'=>'yes'), "enrol_db_autocreate", $frm->enrol_db_autocreate, "");
           if (isset($err["enrol_db_autocreate"])) formerr($err["enrol_db_autocreate"]); 
    ?>
    </td>
    <td>
    <?php  print_string("autocreate","enrol_database") ?>
    </td>
</tr>
<tr valign="top">
        <td align="right">enrol_db_category:</td>
        <td>
    <?php
           $displaylist = array();
           $parentlist = array();
           make_categories_list($displaylist, $parentlist);
           choose_from_menu($displaylist, "enrol_db_category", $frm->enrol_db_category, "");
           
    ?>
    <?php  if (isset($err["enrol_db_category"])) formerr($err["enrol_db_category"]); ?>
    </td><td>
    <?php  print_string("category","enrol_database") ?>
    </td>
</tr>

<tr valign="top">
        <td align="right">enrol_db_template:</td>
        <td>
    <input name="enrol_db_template" type="text" size="30" value="<?php echo $frm->enrol_db_template?>">
    <?php  if (isset($err["enrol_db_template"])) formerr($err["enrol_db_template"]); ?>
    </td><td>
    <?php  print_string("template","enrol_database") ?>
    </td>
</tr>

<th colspan="2">
    <?php print_string("general_options", "enrol_database") ?>
</td>

</table>
