$stitle = ""; $req = "php/home.php"; break; } if (isset($_GET['id'])) { $id = $_GET['id']; } else { $id = ""; } if (strlen($stitle)) { $stitle .= ":" . $id; } $x = "style_" . $_GET['action']; ${$x} = "color:#BAFF04 "; require 'php/header.php'; if ($authstatus && dbversion() != $fordbversion) { echo "<body>"; require "php/itdbupdate.php"; echo "</body>\n</html>\n"; exit; } if ($dlg && $authstatus) { echo "<body>"; require $req; echo "</body>\n</html>\n"; exit; } ?> <body onload='BodyLoad()' class='mainbody'>
} else { $updtdir = "updates/db/"; $startversion = dbversion(); echo "Starting update process\n<ul>\n"; for ($v = $startversion + 1; $v <= $fordbversion; $v++) { echo "<li>Updating to version {$v}:</li>"; $updtfile = $updtdir . ($v - 1) . "_{$v}.sql"; $sql = file_get_contents($updtfile); $b = strlen($sql); echo "<li>Reading update file: {$updtfile} ({$b} bytes)</li>\n"; if (!$b) { exit; } //$dbh->beginTransaction(); //not here , some statements auto-commit echo "<li>Applying updates</li>\n"; db_exec($dbh, $sql); } echo "</ul>\n"; if (dbversion() == $fordbversion) { $s = "Success!"; $c = "#dfd"; } else { $s = "Version Mismatch"; $c = "#fdd"; } echo "<div style='background-color:{$c};margin-top:10px;border:1px solid #aaa;padding:5px;' >"; echo "{$s}<br>Database version=" . dbversion() . "<br>"; echo "Installation version={$fordbversion}"; echo "</div>"; echo "<a href=''>Proceed to ITDB</a>"; }