echo HTML::start('form', array('method' => 'post', 'action' => $_SERVER['PHP_SELF'] . '?confirm=yes')); echo HTML::para(Form::button("continue", _("Continue")) . Form::generateToken()); echo HTML::end('form'); echo HTML::para(HTML::link(_("Cancel"), './index.php')); include_once "../layout/footer.php"; exit; } } $setQ->close(); unset($setQ); unset($set); /** * Creating each table listed in the $tables array */ $tables = getTables(); foreach ($tables as $tableName) { $result = parseSqlFile("./sql/" . $tableName . ".sql", $tableName, true); if ($result) { $text = sprintf(_("Table %s dropped."), $tableName) . PHP_EOL; $text .= sprintf(_("Table %s created."), $tableName) . PHP_EOL; $text .= str_repeat(".", 50); echo HTML::para(nl2br($text)); } else { echo Msg::error(_("Last instruction failed")); include_once "../layout/footer.php"; exit; } } echo Msg::info(_("OpenClinic tables have been created successfully!")); echo HTML::section(1, HTML::link(_("Start using OpenClinic"), '../home/index.php')); require_once "../layout/footer.php";
require_once "../layout/header.php"; require_once dirname(__FILE__) . "/parse_sql_file.php"; echo HTML::section(1, $title); echo HTML::para(sprintf(_("Finded version: %s"), $version)); foreach ($upgrades as $value) { $file = $value; // upgrade<initial_version>-<final_version>.sql $value = substr($value, strlen('upgrade')); // <initial_version>-<final_version>.sql $array = explode("-", $value); // 0 => <initial_version>, 1 => <final_version>.sql $initialVersion = $array[0]; // <number>.<number> if (version_compare($version, $initialVersion, '<=')) { echo HTML::para(sprintf(_("Aplying %s file..."), HTML::tag('strong', $file))); if (!parseSqlFile('./upgrades/' . $file)) { //Error::debug($file); // debug echo Msg::error(sprintf(_("Error processing file: %s"), $file)); include_once "../layout/footer.php"; exit; } } } $setQ->captureError(false); $setQ->select(); $set = $setQ->fetch(); echo HTML::para(sprintf(_("Upgraded to version: %s"), $set->getVersion())); $setQ->close(); unset($setQ); unset($set); echo Msg::info(_("Database upgrade finished correctly!"));