clearCache();
if (!isset($_POST['step'])) {
$_POST['step'] = 1;
}
$db = new db();
## look for version history!
## see if history table exists
$checkTable = $db->getRows("SHOW TABLE STATUS LIKE '".$glob['dbprefix']."CubeCart_history';");
## table esists look for version history
if ($checkTable) {
$versionData = $db->select("SELECT version FROM `".$glob['dbprefix']."CubeCart_history` ORDER BY `id` DESC");
}
if (!isset($_GET['l'])) $_GET['l'] = "en";
$langFolder = preg_replace('/[^a-zA-Z0-9_\-\+]/', '',$_GET['l']);
define('LANG_FOLDER', $langFolder);
require("..".CC_DS."language".CC_DS.LANG_FOLDER.CC_DS."common.inc.php");
require("..".CC_DS."language".CC_DS.LANG_FOLDER.CC_DS."setup.inc.php");
if ($versionData) {
$oldVersion = $versionData[0]['version'];
} else {
## table doesn't exist use old ini.inc.php file
$oldIniPath = "..".CC_DS."includes".CC_DS."ini.inc.php";
if (!file_exists($oldIniPath)) die($lang['setup']['critical_upgrade_error']);
include($oldIniPath);
$oldVersion = $ini['ver'];
}
$stageName = $lang['setup']['stage1Name'];
$noInstallSteps = 3;
include("includes".CC_DS."header.inc.php");
?>
".sprintf($lang['setup']['alreadyUpgraded'],$thisVersion)."";
} else {
?>