<td colspan="5">Please enter your MySQL database server details below...</td>
</tr>
<tr>
- <td width="120" style="color: #666666;">Host Name:</td>
+ <td width="150" style="color: #666666;">Host Name:</td>
<td width="230">
<input type="text" tabindex="7" name="database_host" style="width: 98%;" value="<?php if(isset($_SESSION['database_host'])) { echo $_SESSION['database_host']; } else { echo 'localhost'; } ?>" />
</td>
</td>
<td> </td>
<td colspan="2">
- <input type="checkbox" tabindex="12" name="install_tables" id="install_tables" value="true"<?php if(!isset($_SESSION['install_tables'])) { echo ' checked'; } elseif($_SESSION['install_tables'] == 'true') { echo ' checked'; } ?> />
+ <input type="checkbox" tabindex="12" name="install_tables" id="install_tables" value="true" onclick="document.getElementById('db_options').style.display = this.checked? 'block':'none';"<?php if(!isset($_SESSION['install_tables'])) { echo ' checked'; } elseif($_SESSION['install_tables'] == 'true') { echo ' checked'; } ?> />
<label for="install_tables" style="color: #666666;">Install Tables</label>
<br />
<span style="font-size: 10px; color: #666666;">(Please note: May remove existing tables and data)</span></td>
</td>
</tr>
+ <tr id="db_options">
+ <td style="color: #666666;">Fill database with demo data:</td>
+ <td>
+ <input type="checkbox" tabindex="6" name="demo_data" id="demo_data" value="true" <?php if(!isset($_SESSION['demo_data']) OR $_SESSION['demo_data'] == true) { echo 'checked'; } ?> />
+ <br />
+ </td>
+ <td colspan="2"> </td>
+ </tr>
<tr>
<td colspan="5"><h1>Step 5</h1>Please enter the training company name below (you can create your own company later)...</td>
</tr>
if(isset($_POST['company_name']))
{
$_SESSION['ba_url'] = $_POST['ba_url'];
- if(!isset($_POST['operating_system']))
- {
- $_SESSION['operating_system'] = 'linux';
- }
- else
- {
- $_SESSION['operating_system'] = $_POST['operating_system'];
- }
- if(!isset($_POST['world_writeable']))
- {
- $_SESSION['world_writeable'] = false;
- }
- else
- {
- $_SESSION['world_writeable'] = true;
- }
+ $_SESSION['operating_system'] = isset($_POST['operating_system']);
+ $_SESSION['world_writeable'] = isset($_POST['world_writeable']);
$_SESSION['database_host'] = $_POST['database_host'];
$_SESSION['database_username'] = $_POST['database_username'];
$_SESSION['database_password'] = $_POST['database_password'];
$_SESSION['database_name'] = $_POST['database_name'];
- if(!isset($_POST['table_prefix']))
- {
- $_SESSION['table_prefix'] = false;
- }
- else
- {
- $_SESSION['table_prefix'] = true;
- }
- if(!isset($_POST['install_tables']))
- {
- $_SESSION['install_tables'] = false;
- }
- else
- {
- $_SESSION['install_tables'] = true;
- }
+ $_SESSION['demo_data'] = isset($_POST['demo_data']);
+ $_SESSION['table_prefix'] = isset($_POST['table_prefix']);
+ $_SESSION['install_tables'] = isset($_POST['install_tables']);
$_SESSION['company_name'] = $_POST['company_name'];
$_SESSION['admin_email'] = $_POST['admin_email'];
$_SESSION['admin_password'] = $_POST['admin_password'];
// End website company name
// Check if the user has entered a correct path
-if (!file_exists($path_to_root.'/sql/en_US-demo.sql'))
+if (!file_exists($path_to_root.'/sql/en_US-'.(isset($_POST['demo_data']) ? 'demo':'new').'.sql'))
{
display_error('It appears the Absolute path that you entered is incorrect');
}
$result = mysql_select_db($database_name, $db);
}
if($result) {
- $import_filename = $path_to_root."/sql/en_US-demo.sql";
+ $import_filename = $path_to_root.'/sql/en_US-'.(isset($_POST['demo_data']) ? 'demo':'new').'.sql';
db_import($import_filename, $db_connections[$id]);
}
}