global $db_connections, $def_coy, $tb_pref_counter, $db;
$new = false;
global $db_connections, $def_coy, $tb_pref_counter, $db;
$new = false;
if ((bool)$_POST['def'] == true)
$def_coy = $id;
$error = write_config_db($new);
if ($error == -1)
display_error(_("Cannot open the configuration file - ") . $path_to_root . "/config_db.php");
if ((bool)$_POST['def'] == true)
$def_coy = $id;
$error = write_config_db($new);
if ($error == -1)
display_error(_("Cannot open the configuration file - ") . $path_to_root . "/config_db.php");
display_error(_("Cannot write to the configuration file - ") . $path_to_root . "/config_db.php");
else if ($error == -3)
display_error(_("The configuration file ") . $path_to_root . "/config_db.php" . _(" is not writable. Change its permissions so it is, then re-run the operation."));
display_error(_("Cannot write to the configuration file - ") . $path_to_root . "/config_db.php");
else if ($error == -3)
display_error(_("The configuration file ") . $path_to_root . "/config_db.php" . _(" is not writable. Change its permissions so it is, then re-run the operation."));
{
db_import($filename, $conn, $id);
if (isset($_POST['admpassword']) && $_POST['admpassword'] != "")
db_query("UPDATE ".$conn['tbpref']."users set password = '".md5($_POST['admpassword']). "' WHERE user_id = 'admin'");
{
db_import($filename, $conn, $id);
if (isset($_POST['admpassword']) && $_POST['admpassword'] != "")
db_query("UPDATE ".$conn['tbpref']."users set password = '".md5($_POST['admpassword']). "' WHERE user_id = 'admin'");
$error = write_config_db();
if ($error == -1)
display_error(_("Cannot open the configuration file - ") . $path_to_root . "/config_db.php");
$error = write_config_db();
if ($error == -1)
display_error(_("Cannot open the configuration file - ") . $path_to_root . "/config_db.php");
display_error(_("Cannot write to the configuration file - ") . $path_to_root . "/config_db.php");
else if ($error == -3)
display_error(_("The configuration file ") . $path_to_root . "/config_db.php" . _(" is not writable. Change its permissions so it is, then re-run the operation."));
display_error(_("Cannot write to the configuration file - ") . $path_to_root . "/config_db.php");
else if ($error == -3)
display_error(_("The configuration file ") . $path_to_root . "/config_db.php" . _(" is not writable. Change its permissions so it is, then re-run the operation."));
global $table_style, $def_coy, $db_connections;
$coyno = $_SESSION["wa_current_user"]->company;
global $table_style, $def_coy, $db_connections;
$coyno = $_SESSION["wa_current_user"]->company;
-
- $th = array(_("Company"), _("Database Host"), _("Database User"),
+
+ $th = array(_("Company"), _("Database Host"), _("Database User"),
_("Database Name"), _("Table Pref"), _("Default"), "", "");
_("Database Name"), _("Table Pref"), _("Default"), "", "");
document.forms[0].action='create_coy.php?c=u&ul=1&id=" . $n . "&fn=' + document.forms[0].uploadfile.value
}
else {
document.forms[0].action='create_coy.php?c=u&id=" . $n . "&fn=' + document.forms[0].uploadfile.value
document.forms[0].action='create_coy.php?c=u&ul=1&id=" . $n . "&fn=' + document.forms[0].uploadfile.value
}
else {
document.forms[0].action='create_coy.php?c=u&id=" . $n . "&fn=' + document.forms[0].uploadfile.value
$_POST['dbname'] = $conn['dbname'];
$_POST['tbpref'] = $conn['tbpref'];
if ($selected_id == $def_coy)
$_POST['dbname'] = $conn['dbname'];
$_POST['tbpref'] = $conn['tbpref'];
if ($selected_id == $def_coy)
$_POST['dbcreate'] = false;
hidden('selected_id', $selected_id);
hidden('tbpref', $_POST['tbpref']);
$_POST['dbcreate'] = false;
hidden('selected_id', $selected_id);
hidden('tbpref', $_POST['tbpref']);
- text_row_ex(_("Company"), 'name', 20);
- text_row_ex(_("Host"), 'host', 20);
- text_row_ex(_("Database User"), 'dbuser', 20);
- if ($selected_id == -1)
- text_row_ex(_("Database Password"), 'dbpassword', 20);
- text_row_ex(_("Database Name"), 'dbname', 20);
+ text_row_ex(_("Company"), 'name', 30);
+ text_row_ex(_("Host"), 'host', 30);
+ text_row_ex(_("Database User"), 'dbuser', 30);
+ if ($selected_id == -1)
+ text_row_ex(_("Database Password"), 'dbpassword', 30);
+ text_row_ex(_("Database Name"), 'dbname', 30);
if ($selected_id == -1)
yesno_list_row(_("Table Pref"), 'tbpref', 1, $_POST['tbpref'], _("None"), false);
else
label_row(_("Table Pref"), $_POST['tbpref']);
yesno_list_row(_("Default"), 'def', null, "", "", false);
if ($selected_id == -1)
yesno_list_row(_("Table Pref"), 'tbpref', 1, $_POST['tbpref'], _("None"), false);
else
label_row(_("Table Pref"), $_POST['tbpref']);
yesno_list_row(_("Default"), 'def', null, "", "", false);