{*
 * CubeCart v6
 * ========================================
 * CubeCart is a registered trade mark of CubeCart Limited
 * Copyright CubeCart Limited 2026. All rights reserved.
 * UK Private Limited Company No. 5323904
 * ========================================
 * Web:   https://www.cubecart.com
 * Email:  hello@cubecart.com
 * License:  GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
 *}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>CubeCart&reg; {$VERSION} Installer</title>
  <meta charset="utf-8" />
  <link href='//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" type="text/css" href="styles/style.css" media="screen" />
  {if isset($REFRESH)}<meta http-equiv="refresh" content="5" />{/if}
</head>
<body>
<div id="frame">
  <div id="header">
  </div>
  {if isset($PROGRESS)}
  <div id="progress">
	<div class="container">
	  <div class="indicator" style="width: {$PROGRESS.percent}% !important;">&nbsp;</div>
	</div>
	<div class="text">{$PROGRESS.message}</div>
  </div>
  {/if}

  

  {if isset($GUI_MESSAGE)}
	{if isset($GUI_MESSAGE.errors)}
  <div id="error">
	<h3 class="first">{$LANG.gui_message.errors_detected}</h3>
	<ul>
	  {foreach from=$GUI_MESSAGE.errors item=error}<li>{$error}</li>{/foreach}
	</ul>
  </div>
	{/if}
	{if isset($GUI_MESSAGE.notices)}
	{foreach from=$GUI_MESSAGE.notices item=notice}
  <div id="notice">
	<h3 class="first">{$notice}</h3>
  </div>
	{/foreach}
	{/if}
  {/if}

  <form action="index.php" method="post" enctype="multipart/form-data">
	<div id="content">
  {if isset($MODE_LANGUAGE)}
	  <h3 class="first">{$LANG.setup.title_select_language}</h3>
	  <p>{$LANG.setup.select_language_note}</p>
	  {if isset($API_LANGUAGES)}
	  <fieldset>
		<div>
		  <label for="select_language">{$LANG.common.language}</label>
		  <span>
			<select name="select_language" id="select_language" class="textbox">
			  {foreach from=$API_LANGUAGES item=lang}<option value="{$lang.code}"{$lang.selected}>{$lang.name} ({$lang.code})</option>{/foreach}
			</select>
		  </span>
		</div>
	  </fieldset>
	  {/if}
  {/if}

  {if isset($MODE_COMPAT)}
	  <h3 class="first">{$LANG.setup.title_compat_check}</h3>
	  {foreach from=$CHECKS item=check}
	  <div>
		<span class="result">{if $check.status}<span class="pass">{$check.pass}</span>{else}<span class="fail">{$check.fail}</span>{/if}</span>
	  {$check.title}
	  </div>
	  {/foreach}
  {/if}

  {if isset($MODE_METHOD)}
	{if isset($SHOW_UPGRADE)}
	  <div id="method-upgrade" class="click-select">
	  <input type="radio" name="method" value="upgrade" />
	  <span class="icon"><img src="images/upgrade.gif" alt="" /></span>
	  <h3 class="first">{$LANG_UPGRADE_CUBECART_TITLE}</h3>
	  <p>{$LANG.setup.upgrade_existing}</p>
	</div>
	{/if}
	<div id="method-install" class="click-select{if isset($SHOW_UPGRADE)} faded{/if}">
	  <input type="radio" name="method" value="install" />
	  <span class="icon"><img src="images/install.gif" alt="" /></span>
	  <h3 class="first">{$LANG_INSTALL_CUBECART_TITLE}</h3>
	  <p>{$LANG.setup.install_fresh}</p>
	</div>
  {/if}

  {if isset($MODE_LICENCE)}
	<h3 class="first">{$LANG.setup.title_licence}</h3>
	<div><textarea class="license" readonly>{$SOFTWARE_LICENCE}</textarea></div>
	<div><input type="checkbox" id="licence_agree" name="licence" value="1" /> <label for="licence_agree">{$LANG.setup.licence_agree}</label></div>
  {/if}

  {if isset($MODE_PERMS)}
	<h3 class="first">{$LANG.setup.title_file_permissions}</h3>
	{foreach from=$PERMISSIONS item=file}
	  <div>
		<span class="result">{if $file.status}<span class="pass">{$LANG.common.writable}</span>{else}<span class="fail">{$LANG.common.read_only}</span>{/if}</span>
		{$file.name}
	  </div>
	{/foreach}
	{if isset($PERMS_PASS)}<input type="hidden" name="permissions" value="1" />{/if}
  {/if}

  {if isset($MODE_INSTALL)}
	{if isset($PRESET_DB)}
	<input type="hidden" name="global[dbhost]" value="{$PRESET_DB.dbhost}" />
	<input type="hidden" name="global[dbdatabase]" value="{$PRESET_DB.dbdatabase}" />
	<input type="hidden" name="global[dbusername]" value="{$PRESET_DB.dbusername}" />
	<input type="hidden" name="global[dbpassword]" value="{$PRESET_DB.dbpassword}" />
	<input type="hidden" name="global[dbpassconf]" value="{$PRESET_DB.dbpassword}" />
	<input type="hidden" name="global[dbprefix]" value="{if isset($PRESET_DB.dbprefix)}{$PRESET_DB.dbprefix}{/if}" />
	<input type="hidden" name="global[dbport]" value="{if isset($PRESET_DB.dbport)}{$PRESET_DB.dbport}{/if}" />
	<input type="hidden" name="global[dbsocket]" value="{if isset($PRESET_DB.dbsocket)}{$PRESET_DB.dbsocket}{/if}" />
	{else}
	<h3>{$LANG.setup.title_database_settings}</h3>
	<fieldset>
	  <div><label for="form-dbhost" class="help" title="{$LANG.setup.help_dbhostname}">{$LANG.setup.db_host}</label><span><input type="text" name="global[dbhost]" id="form-dbhost"{if isset($FORM.global.dbhost)} value="{$FORM.global.dbhost}"{/if} class="textbox required" /></span></div>
	  <div><label for="form-dbdatabase" class="help" title="{$LANG.setup.help_dbname}">{$LANG.setup.db_name}</label><span><input type="text" name="global[dbdatabase]" id="form-dbdatabase"{if isset($FORM.global.dbdatabase)} value="{$FORM.global.dbdatabase}"{/if} class="textbox required" /></span></div>
	  <div><label for="form-dbusername" class="help" title="{$LANG.setup.help_dbusername}">{$LANG.account.username}</label><span><input type="text" name="global[dbusername]" id="form-dbusername"{if isset($FORM.global.dbusername)} value="{$FORM.global.dbusername}"{/if} class="textbox required" /></span></div>
	  <div><label for="form-dbpassword" class="help" title="{$LANG.setup.help_dbuserpass}">{$LANG.account.password}</label><span><input type="password" autocomplete="off" name="global[dbpassword]" id="form-dbpassword"{if isset($FORM.global.dbpassword)} value="{$FORM.global.dbpassword}"{/if} class="textbox" /></span></div>
	  <div><label for="form-dbpassconf" class="help" title="{$LANG.setup.help_dbconfirmpass}">{$LANG.account.password_confirm}</label><span><input type="password" autocomplete="off" name="global[dbpassconf]" rel="form-dbpassword" id="form-dbpassconf"{if isset($FORM.global.dbpassconf)} value="{$FORM.global.dbpassconf}"{/if} class="textbox confirm" /></span></div>
	  <div><label for="form-dbprefix" class="help" title="{$LANG.setup.help_dbprefix}">{$LANG.setup.db_prefix}</label><span><input type="text" name="global[dbprefix]" id="form-dbprefix"{if isset($FORM.global.dbprefix)} value="{$FORM.global.dbprefix}"{/if} class="textbox" /></span></div>
	  <div><label for="form-dbport" class="help" title="{$LANG.setup.help_dbport}">{$LANG.setup.db_port} {$LANG.common.optional}</label><span><input type="text" name="global[dbport]" id="form-dbport"{if isset($FORM.global.dbport)} value="{$FORM.global.dbport}"{/if} class="textbox" /></span></div>
	  <div><label for="form-dbsocket" class="help" title="{$LANG.setup.help_dbsocket}">{$LANG.setup.db_socket} {$LANG.common.optional}</label><span><input type="text" name="global[dbsocket]" id="form-dbsocket"{if isset($FORM.global.dbsocket)} value="{$FORM.global.dbsocket}"{/if} class="textbox" /></span></div>
	</fieldset>
	{/if}
	<h3>{$LANG.setup.title_store_settings}</h3>
	<fieldset>
	  <div><label for="form-store_name">{$LANG.settings.store_name}</label><span><input type="text" name="config[store_name]" id="form-store_name"{if isset($FORM.config.store_name)} value="{$FORM.config.store_name}"{/if} class="textbox required" /></span></div>
	  <input type="hidden" name="config[default_language]" value="{$SESSION_LANGUAGE}" />
	  <div>
		<label for="form-currency" class="help" title="{$LANG.setup.help_defaultcurrency}">{$LANG.settings.default_currency}</label>
		<span>
		  <select name="config[default_currency]" id="form-currency" class="textbox required">
			<option value="">{$LANG.form.please_select}</option>
			{foreach from=$CURRENCIES item=currency}<option value="{$currency.code}"{$currency.selected}>{$currency.code} - {$currency.name}</option>{/foreach}
		  </select>
		</span>
	  </div>
	</fieldset>
	<h3>{$LANG.setup.title_admin_profile}</h3>
	<fieldset>
	  <div><label for="form-username">{$LANG.account.username}</label><span><input type="text" name="admin[username]" id="form-username"{if isset($FORM.admin.username)} value="{$FORM.admin.username}"{/if} class="textbox required" /></span></div>
	  <div><label for="form-password">{$LANG.account.password}</label><span><input type="password" name="admin[password]" id="form-password"{if isset($FORM.admin.password)} value="{$FORM.admin.password}"{/if} class="textbox required" /></span></div>
	  <div><label for="form-passconf">{$LANG.account.password_confirm}</label><span><input type="password" name="admin[passconf]" id="form-passconf" rel="form-password"{if isset($FORM.admin.passconf)} value="{$FORM.admin.passconf}"{/if} class="textbox required confirm" /></span></div>
	  <div><label for="form-realname">{$LANG.user.name_full}</label><span><input type="text" name="admin[name]" id="form-realname"{if isset($FORM.admin.name)} value="{$FORM.admin.name}"{/if} class="textbox required" /></span></div>
	  <div><label for="form-email">{$LANG.common.email}</label><span><input type="text" name="admin[email]" id="form-email"{if isset($FORM.admin.email)} value="{$FORM.admin.email}"{elseif isset($PRESET_EMAIL)} value="{$PRESET_EMAIL}"{/if} class="textbox required" /></span></div>
	</fieldset>
	<h3>{$LANG.setup.title_advanced_settings}</h3>
	<fieldset>
	  {if !isset($PRESET_DB)}
	  <div><label for="form-drop" class="help" title="{$LANG.setup.install_drop_tables_explained}">{$LANG.setup.install_drop_tables}</label><span><input type="checkbox" name="drop" id="form-drop" value="1" /> {$LANG.setup.install_drop_tables_explained}</span></div>
	  {/if}
	  <div><label for="form-telemetry">{$LANG.setup.telemetry_title}</label><span><input type="checkbox" name="config[allow_telemetry]" id="form-telemetry" value="1" checked="checked" /> {$LANG.setup.telemetry_note}</span></div>
	</fieldset>
	<input type="hidden" name="progress" value="0" />
  {/if}

  {if isset($MODE_UPGRADE)}
	{if isset($MODE_UPGRADE_CONFIRM)}
	<div>{$LANG_UPGRADE_FROM_TO}<br />
	{$LANG.setup.upgrade_will_reload}<br />
	<br />{$LANG.setup.upgrade_click_continue}</div>
	<input type="hidden" name="progress" value="0" />
	{/if}

	{if isset($MODE_UPGRADE_PROGRESS)}
	  <div>
	  <p>{$LANG_UPGRADE_IN_PROGRESS}</p>
	  {if isset($GUI_MESSAGE)}
	  <p>{$LANG.setup.upgrade_click_continue_error}</p>
	  {else}
	  <img src="images/loading.gif" align="middle" />
	  {/if}
	  </div>
	{/if}
  {/if}


  {if isset($MODE_COMPLETE)}
	{if isset($MODE_COMPLETE_INSTALL)}
	  <h3 class="first">{$LANG.setup.install_complete}</h3>
	  <div>{$LANG.setup.install_complete_note}</div>
	{/if}
	{if isset($MODE_COMPLETE_UPGRADE)}
	  <h3 class="first">{$LANG.setup.upgrade_complete}</h3>
	  <div>{$LANG.setup.upgrade_complete_note}</div>
	{/if}
  {/if}
  	{if isset($MODE_COMPLETE_UPGRADE) && isset($SHOW_LINKS)}
  	<p class="url_change">{$LANG.setup.urls_changed}</p>
  	{/if}
  	{if isset($SHOW_LINKS)}
	  <div>
		<h4>{$LANG.setup.link_admin_panel}</h4>
		<a href="{$ADMIN_URL}" target="_blank">{$ADMIN_URL}</a><br>
		{$LANG.setup.link_admin_panel_note}
		<h4>{$LANG.setup.link_store_front}</h4>
		<a href="{$STORE_URL}" target="_blank">{$STORE_URL}</a>
	  </div>
	{/if}
	  <div id="toolbar">
		{if isset($CONTROLLER.continue)}<span class="continue"><input type="submit" name="proceed" value="{$LANG.common.continue} &raquo;" /></span>{/if}
		{if isset($CONTROLLER.retry)}<span class="continue"><input type="submit" name="retry" value="{$LANG.setup.button_retry}" /></span>{/if}
		{if isset($CONTROLLER.restart)}<span class="cancel"><input type="submit" name="cancel" value="{$LANG.setup.button_restart}" class="cancel" /></span>{/if}
	  </div>
	</div>
  </form>
</div>
<div id="footer">{$LANG.setup.ecommerce_by} <a href="https://www.cubecart.com">CubeCart</a></div>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script type="text/javascript" src="../js/plugins/jquery.pstrength.js"></script>
<script type="text/javascript" src="js/install.js"></script>
</body>
</html>