<?php

error_reporting(E_ALL);
ini_set('display_errors','on');
 
require_once 'core_factory.php';
Logaholic_sessionStart();

$lang = Logaholic_setLang();

include_once "languages/$lang.php";
include "includes/version.php"; 

if (@$_POST['license']) {
    if (isset($_COOKIE['update_license'])) {
        $isupgrade="1";
        setcookie("update_license", "", time() - 86400);
    }
}

$regip=$_SERVER['HTTP_HOST'];
if (!$regip) {
  if ($HTTP_SERVER_VARS["SERVER_NAME"] !="") {
      $regip=$HTTP_SERVER_VARS["SERVER_NAME"];
  } else {
      $regip=$_SERVER['SERVER_ADDR'];
  }
}

if(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on"){
	$protocol = "https";
} else {
	$protocol = "http";
}
$fullp="{$protocol}://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
?> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta charset="UTF-8">
        <title>Logaholic 7 | <?php echo _LOGAHOLIC_LICENSE; ?></title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <link rel="icon" href="favicon.ico" type="image/x-icon">
        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">

        <link href="components/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" href="templates/logaholic_6/font-awesome-4.3.0/css/font-awesome.min.css">
        <!-- Ionicons -->
        <link href="templates/logaholic_6/css/ionicons.min.css" rel="stylesheet" type="text/css" />

        <!-- Theme style -->
        <link href="templates/logaholic_6/css/AdminLTE.css" rel="stylesheet" type="text/css" />
        <link href="templates/css/install.css" rel="stylesheet" type="text/css" >        

        <!-- Logaholic 6 CSS -->        
        <link href="templates/logaholic_6/css/ui.css" rel="stylesheet" type="text/css" />
        <link href="templates/logaholic_6/css/ui.responsive.css" rel="stylesheet" type="text/css" />

        <style type="text/css">
        	.navbar-right, .header .nav.navbar-nav, .left-side, .right-side > .content-header .pagename{ display: none; }
			.right-side{ margin-left: 0; }
        </style>

        <!-- JS resources -->        
        <script src="components/jquery/js/jquery-1.11.3.min.js"></script>
        
        <script src="components/jquery/js/jquery-ui.min.js" type="text/javascript"></script>
        <script src="components/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>

        <script src="app/functions.js" type="text/javascript"></script>
        <script src="app/controller/index.js" type="text/javascript"></script>
        <script src="app/controller/GetLicense.js" type="text/javascript"></script>
		
		<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
    </head>
    <body class="skin-logaholic">        
       
        <header class="header">

            <a href="index.php" class="logaholiclogo hidden-xs" title="Logaholic Control Panel"><i></i><span>Logaholic</span></a>
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-static-top" role="navigation">
              
            </nav>
        </header>
        <div class="wrapper row-offcanvas row-offcanvas-left">
            <!-- Right side column. Contains the navbar and content of the page -->
            <aside class="right-side strech">
                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                        <span class="confname"></span>
                        <small class="pagename"><?php echo _WELCOME_LOGAHOLIC_SOFTWARE; ?></small>
                    </h1>
                </section>         
                <!-- Main content -->
                <section class="content">
                	<div class="response">
						<div class="callout-danger-template callout callout-danger" style="display:none;">								
							<h4></h4>								
						</div>

						<div class="callout-success-template callout callout-success" style="display:none;">								
							<h4></h4>								
						</div>
					</div>
					<div id="the_grid">                        
		                <!-- Main row -->
		                <div class="row">
		                    <section class="col-sm-7">

								
		                    	<div class="box box-solid box-primary getlicense" rel="_GET_LICENSE">
		                            <div class="box-header">
		                                <h3 class="box-title"><?php echo _GET_LOGAHOLIC_LICENSE; ?></h3>
		                                
		                            </div><!-- /.box-header -->

		                            <div class="box-body">

										<form id="getlicenseform">

										<!-- <div class="form-group">
											<label><?php echo _FIRST_NAME;?></label>
											<input type="text" name="licname" class="form-control">
										</div> -->

										<div class="form-group">
											<label><?php echo _EMAIL_ADDRESS;?></label>
											<input type="text" name="e" class="form-control">
										</div>

										<div class="form-group">
											<label><?php echo _PASSWORD;?></label>
											<input type="password" name="pwrd" class="form-control">
										</div>								

										<input type=hidden name="regip" value="<?php echo $regip; ?>">
										<input type=hidden name="fullp" value="<?php echo $fullp; ?>">
										<input type=hidden name="version" value="<?php echo LOGAHOLIC_VERSION_NUMBER .",". LOGAHOLIC_BASE_EDITION; ?>">
																		
										<button class="btn btn-success getlicensebutton"><?php echo _GET_LICENSE;?></button> &nbsp; 
										<a class="btn btn-default" target="_blank" href="<?php echo $protocol; ?>://www.logaholic.com/order/password_forgotten.php"><?php echo _FORGOT_PASSWORD; ?>?</a>

										</form>
										<br><br>
										
		 								<div style="clear:both">
		                                    &nbsp;<br />&nbsp;
		                                </div>

		                            </div><!-- /.box-body -->
		                        </div><!-- /.box -->   	
		                 	</section>

							<!-- right side box -->
		                    <section class="col-sm-5">
								
								<div class="box box-solid box-warning licenseinfo" rel="_GET_LICENSE">
		                            <div class="box-header">
		                                <h3 class="box-title"><?php echo _CURRENT_LICENSE; ?></h3>
		                                
		                            </div><!-- /.box-header -->

		                            <div class="box-body">

										<?php require_once 'markup.php'; echo $lo->PrintInfo(); ?>
										

		 								<div style="clear:both">
		                                    &nbsp;<br />&nbsp;
		                                </div>

		                            </div><!-- /.box-body -->
		                        </div><!-- /.box -->

		                    </section>
		                </div>
                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->            
    </body>
</html>