<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$base_url = base_url();

$title = 'Output Books';
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title><?php echo $title; ?></title>
		<base href="<?php echo site_url(); ?>">
		<link rel="icon" type="image/x-icon" href="favicon.ico">
		<meta name="robots" content="noindex">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
		<meta content="utf-8" http-equiv="encoding">

		<link href="<?php echo $base_url; ?>assets/semantic/semantic.min.css" rel="stylesheet" />
		<link href="<?php echo $base_url; ?>assets/css/setup.css" rel="stylesheet" />
		<script src="<?php echo $base_url; ?>assets/js/jquery/jquery-1.9.1.min.js"></script>
		<script src="<?php echo $base_url; ?>assets/semantic/semantic.min.js"></script>
		<script type="text/javascript">
			window.OBooks = window.OBooks || {};
			(function(_OBooks){
				_OBooks.base_url = "<?php echo base_url(); ?>";
				_OBooks.site_url = "<?php echo site_url(); ?>";
				_OBooks.time = <?php echo time(); ?>;
				_OBooks.isWindows = "<?php echo $is_windows; ?>";
				_OBooks.isDependent = <?php echo $isDependent ? 1 : 0; ?>;
				_OBooks.is_exe = <?php echo $is_exe? 1 : 0;?>;
<?php
					if (!empty($dbconfig))
					{
						echo "_OBooks.db_config = " . json_encode($dbconfig) . ";";
					}

					if (!empty($countries))
					{
						echo "_OBooks.countries = " . json_encode($countries) . ";";
					}

					if (!empty($step))
					{
						echo "_OBooks.step = " . $step . ";";
					}

					if (!empty($companies))
					{
						echo "_OBooks.companies = " . json_encode($companies) . ";";
					}

					if (!empty($licFile))
					{
						echo "_OBooks.licFile = " . json_encode($licFile) . ";";
					}
?>
			})(window.OBooks);
		</script>
		<script src="<?php echo $base_url; ?>assets/js/setup.js"></script>
	</head>
	<body>
		<div id="setup-container" class="">
			<div class="ui modal">
				<div class="header">
					<img class="ui avatar image logos" src="<?php echo base_url() . 'assets/img/outputbooks-256.png'?>" />
					<span><?php echo $title; ?> Installation Wizard</span><?php
					if (!$installed)
					{
					?><div style="display:inline-block;margin-left:25px;">
						<!-- label class="ui violet tag label" id="cursteps">1/6</label -->
						<label id="cursteps">1/6</label>
						<span class="loader" id="loader">
							<span class="spinner-icon"></span>
						</span>
					</div><?php
					}
				?></div>
				<div class="content"><?php
					if (!$installed)
					{
						?><div class="fix-it" id="alert_message"></div><?php
						$this->load->view('setup/terms');
						if (empty($is_exe)) {
							$this->load->view('setup/requirements');
							$this->load->view('setup/db');
						}
						$this->load->view('setup/license');
						$this->load->view('setup/final');
						$this->load->view('setup/installed');
					}
					else
					{
						$this->load->view('setup/installed');
					}
				?></div>
				<div class="actions">
					<button type="button" class="ui red button" id="previous">Previous</button>
					<button type="button" class="ui green button" id="next">Next</button>
				</div>
			</div>
		</div>
	</body>
</html>

