Пример #1
0
			dolibarr_install_syslog("etape1: Create database : ".$dolibarr_main_db_name, LOG_DEBUG);
			$db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port);

			if ($db->connected)
			{
				$result=$db->DDLCreateDb($dolibarr_main_db_name, $dolibarr_main_db_character_set, $dolibarr_main_db_collation, $dolibarr_main_db_user);

				if ($result)
				{
					print '<tr><td>';
					print $langs->trans("DatabaseCreation")." (".$langs->trans("User")." ".$userroot.") : ";
					print $dolibarr_main_db_name;
					print '</td>';
					print "<td>".$langs->trans("OK")."</td></tr>";

					$check1=$db->getDefaultCharacterSetDatabase();
					$check2=$db->getDefaultCollationDatabase();
					dolibarr_install_syslog('etape1: Note that default server was charset='.$check1.' collation='.$check2, LOG_DEBUG);

					// If values differs, we save conf file again
					//if ($check1 != $dolibarr_main_db_character_set) dolibarr_install_syslog('etape1: Value for character_set is not the one asked for database creation', LOG_WARNING);
					//if ($check2 != $dolibarr_main_db_collation)     dolibarr_install_syslog('etape1: Value for collation is not the one asked for database creation', LOG_WARNING);
				}
				else
				{
					// Affiche aide diagnostique
					print '<tr><td colspan="2"><br>';
					print $langs->trans("ErrorFailedToCreateDatabase",$dolibarr_main_db_name).'<br>';
					print $langs->trans("IfDatabaseExistsGoBackAndCheckCreate");
					print '<br>';
					print '</td></tr>';
Пример #2
0
	<tr>
		<td align="center" class="label" colspan="3">
		<h3><?php echo $langs->trans("CharsetChoice");?></h3>
		</td>
	</tr>

	<?php
	if (! empty($_POST["db_create_database"]))	// If we create database, we force default value
	{
		$defaultCharacterSet=$db->forcecharset;
		$defaultCollationConnection=$db->forcecollate;
	}
	else	// If already created, we take current value
	{
		$defaultCharacterSet=$db->getDefaultCharacterSetDatabase();
		$defaultCollationConnection=$db->getDefaultCollationDatabase();
	}

	$listOfCharacterSet=$db->getListOfCharacterSet();
	$listOfCollation=$db->getListOfCollation();

	// Choice of dolibarr_main_db_character_set
	?>
	<tr>
		<td valign="top" class="label"><?php echo $langs->trans("CharacterSetDatabase"); ?></td>
		<td valign="top" class="label"><?php
		$nbofchoice=0;
		if (sizeof($listOfCharacterSet))
		{
			print '<select name="dolibarr_main_db_character_set" '.$disabled.'>';