<?php
require 'browser_detect.php';
function getBrowser()
{
    $u_agent = $_SERVER['HTTP_USER_AGENT'];
    $bname = 'Unknown';
    $platform = 'Unknown';
    $version= "";

    //First get the platform?
    if (preg_match('/linux/i', $u_agent)) {
        $platform = 'linux';
    }
    elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {
        $platform = 'mac';
    }
    elseif (preg_match('/windows|win32/i', $u_agent)) {
        $platform = 'windows';
    }
   
    // Next get the name of the useragent yes seperately and for good reason
    if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent))
    {
        $bname = 'Internet Explorer';
        $ub = "MSIE";
    }
    elseif(preg_match('/Firefox/i',$u_agent))
    {
        $bname = 'Mozilla Firefox';
        $ub = "Firefox";
    }
    elseif(preg_match('/Chrome/i',$u_agent))
    {
        $bname = 'Google Chrome';
        $ub = "Chrome";
    }
    elseif(preg_match('/Safari/i',$u_agent))
    {
        $bname = 'Apple Safari';
        $ub = "Safari";
    }
    elseif(preg_match('/Opera/i',$u_agent))
    {
        $bname = 'Opera';
        $ub = "Opera";
    }
    elseif(preg_match('/Netscape/i',$u_agent))
    {
        $bname = 'Netscape';
        $ub = "Netscape";
    }
   
    // finally get the correct version number
    $known = array('Version', $ub, 'other');
    $pattern = '#(?<browser>' . join('|', $known) .
    ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
    if (!preg_match_all($pattern, $u_agent, $matches)) {
        // we have no matching number just continue
    }
   
    // see how many we have
    $i = count($matches['browser']);
    if ($i != 1) {
        //we will have two since we are not using 'other' argument yet
        //see if version is before or after the name
        if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){
            $version= $matches['version'][0];
        }
        else {
            $version= $matches['version'][1];
        }
    }
    else {
        $version= $matches['version'][0];
    }
   
    // check if we have a number
    if ($version==null || $version=="") {$version="?";}
   
    return array(
        'userAgent' => $u_agent,
        'name'      => $bname,
        'type'      => $ub,
        'version'   => $version,
        'platform'  => $platform,
        'pattern'    => $pattern
    );
}
$_browser=getBrowser();
$yourbrowser= "Your browser: " . $_browser['type'] . " " . $_browser['version'] . " on " .$_browser['platform'] . " reports: <br >" . $_browser['userAgent'];
//print_r($yourbrowser);
$yourbrowser_p= "Your browser: " . $_browser['type'] . " " . $_browser['version'] . " on " .$_browser['platform'];


$msg = "<h2>Please use following browser</h2><hr /><br><ul><li>Internet Explorer 8 or above</li><li>Firefox 4 or above</li><li>Safari 4 or above</li><li>Opera 10 or above</li></ul>";
	if($_browser['type'] == "MSIE")
	{
		if(intval($_browser['version']) < 8 )
		{
			echo $yourbrowser_p;
			die($msg);
		}
	}
	else if($_browser['type'] == "Firefox")
	{
		if(intval($_browser['version']) < 8 )
		{
			echo $yourbrowser_p;
			die($msg);
		}
	}else if($_browser['type'] == "Safari")
	{
		if(intval($_browser['version']) < 4 )
		{
			echo $yourbrowser_p;
			die($msg);
		}
	}else if($_browser['type'] == "Opera")
	{
		if(intval($_browser['version']) < 10 )
		{
			echo $yourbrowser_p;
			die($msg);
		}
	}
//print_r($yourbrowser);
/*
$_SESSION["mobile"]	= browser_detect();
if($_SESSION["mobile"] === true){
	header("Location: ./mobile/");
	exit();
}
*/
?>

<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><?php echo $this->lang->line('Radixinfoways'); ?></title>


<meta name="ref" content="<?php echo $this->session->userdata('site_referer'); ?>" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" 
type="text/css" />
<link href="<?php echo base_url(); ?>assets/css_login/login_style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url(); ?>assets/css_login/icon.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic&subset=latin,cyrillic-ext,latin-ext' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/components/tipsy/tipsy.css" media="all"/>
 
<!--<link rel="shortcut icon" href="<?php echo base_url(); ?>assets/dashboard/images/cgs.png" />-->

<!--[if lt IE 9]>
              <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--<link href="<?php echo base_url(); ?>assets/style/css/style_login_min.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="shortcut icon" href="<?php echo base_url(); ?>assets/dashboard/images/nk.ico">-->
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>assets/style/css/ie6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>assets/style/css/ie7.css" /><![endif]-->
<style type="text/css">
html {
	background-image: none;
}
#versionBar {
	background-color: #212121;
	position: fixed;
	width: 100%;
	height: 35px;
	bottom: 0;
	left: 0;
	text-align: center;
	line-height: 35px;
	z-index: 1;
}
.copyright {
	text-align: center;
	font-size: 12px;
	color: #FFFFFF;
}
.copyright a {
	color: #A31F1A;
	text-decoration: none
}
</style>
</head>
<body>

<!--new login vts-->
<div id="alertMessage" class="error"></div>
<div id="successLogin"></div>
<!--<div class="text_success"><img src="<?php echo base_url(); ?>assets/images_login/loadder/loader_green.gif"  alt="CGS" /><span>Please wait</span></div>-->
<div class="container">
        <div class="" id="login-wrapper">
            <div class="row">
                <div class="col-md-4 col-md-offset-4">
                             <!--   <div id="logo-login">
            <h1><div class="logo"><img src="<?php echo base_url(); ?>assets/images_login/logo-trans.png" alt="HorezontelGroup" /><span>v1.3</span></div></h1>
						<div class="userbox"></div>
                    </div>-->
                </div>
            </div>

            <div class="row">
                <div class="col-md-4 col-md-offset-4">
                    <div class="account-box">
                        <form method="post" action="<?php echo site_url($this->uri->uri_string()); ?>"  name="formLogin"  id="formLogin">
                            <div class="form-group">
                                <label for="inputUsernameEmail">Username</label>
								<input name="username" type="text"  id="username_id"  title="Username" class="form-control" />
                            </div>
                            <div class="form-group">
                                <label for="inputPassword">Password</label>
								<input name="password" type="password" id="password"   title="Password" class="form-control" />
                            </div>
                            <!--
							<label><?php //echo $this->lang->line('language'); ?>:  </label>
							<select id="language" name="language"><?php //echo $langopt; ?></select>   -->
                          
							 <?php echo $this->load->view('dashboard/system_messages');   // display all error messages
                                                                    $messages = $this->messages->get(); 
                                                                    if (is_array($messages)){
                                                                             foreach ($messages as $type => $msgs){
                                                                             if (count($msgs > 0)){
                                                                                     foreach ($msgs as $message){
                                                                         echo "<div class=".$type.">" . $message . "</div>";
                                                                           }
                                                                      }
                                                                 }
                                                             }
                                                        ?>
							<hr>
							<input type="submit" value="Login" name="btn_submit" class="btn btn-primary btn-block" />
                        </form>
						<div class="clear"></div>
						<div class="shadow"></div>
                        <!--
						<div class="or-box">
                          
                            <center><span class="text-center login-with">Login or <b>Sign Up</b></span></center>
                            <div class="row">
                                <div class="col-md-6 row-block">
                                    <a href="index.html" class="btn btn-facebook btn-block">
                                        <span class="entypo-facebook space-icon"></span>Facebook</a>
                                </div>
                                <div class="col-md-6 row-block">
                                    <a href="index.html" class="btn btn-twitter btn-block">
                                        <span class="entypo-twitter space-icon"></span>Twitter</a>
                                        
                                </div>

                            </div>
                            <div style="margin-top:25px" class="row">
                                <div class="col-md-6 row-block">
                                    <a href="index.html" class="btn btn-google btn-block"><span class="entypo-gplus space-icon"></span>Google +</a>
                                </div>
                                <div class="col-md-6 row-block">
                                    <a href="index.html" class="btn btn-instagram btn-block"><span class="entypo-instagrem space-icon"></span>Instagram</a>
                                </div>

                            </div>
                        </div>
						
                        <hr>
						-->
                    </div>
                </div>
            </div>
        </div>
</div>


<!--Login div-->
<div class="clear"></div>
<div id="versionBar" >

  <!--<div class="copyright" > &copy; Copyright <?php //echo date("Y"); ?>  All Rights Reserved 
  <span class="tip"><a  href="#" title="VTS" target="_blank">track.radixinfoways.in</a></span>
  </div>-->

  <!-- // copyright--> 
</div>
<div id="test1" class="gmap3"></div>
<!-- Link JScript--> 
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/components/effect/jquery-jrumble.js"></script> 
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> 
<script type="text/javascript" src="<?php echo base_url(); ?>assets/components/tipsy/jquery.tipsy.js"></script> 
<script type="text/javascript" src="<?php echo base_url(); ?>assets/components/checkboxes/iphone.check.js"></script> 
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/login.js"></script>
<?php /* <script type="text/javascript" src="<?php echo base_url(); ?>jquery-1.3.2.min.js"></script> */ ?>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/gmap3.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
        $("#test1").gmap3({
            marker: {
                latLng: [36.753935, 3.042005],
                options: {
                    draggable: true
                },
                events: {
                    dragend: function(marker) {
                        $(this).gmap3({
                            getaddress: {
                                latLng: marker.getPosition(),
                                callback: function(results) {
                                    var map = $(this).gmap3("get"),
                                        infowindow = $(this).gmap3({
                                            get: "infowindow"
                                        }),
                                        content = results && results[1] ? results && results[1].formatted_address : "no address";
                                    if (infowindow) {
                                        infowindow.open(map, marker);
                                        infowindow.setContent(content);
                                    } else {
                                        $(this).gmap3({
                                            infowindow: {
                                                anchor: marker,
                                                options: {
                                                    content: content
                                                }
                                            }
                                        });
                                    }
                                }
                            }
                        });
                    }
                }
            },
            map: {
                options: {
                    zoom: 15
                }
            }
        });		
	});
</script>
<script type="text/javascript">
document.getElementById("username").focus();function checkEntr(e){ var key = e.charCode || e.keyCode || 0;
if(key==13){ document.getElementById("password").focus(); return false;}
return key; }
</script>

</body>
</html>
