<!DOCTYPE html>
<html lang="en">
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title><?php echo school_full_name; ?></title>
        <link rel="icon" type="image/png" href="<?php echo favicon; ?>"/>
    
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqvmap/1.5.1/jqvmap.min.css" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
        <style type="text/css">

        <?php
        if(school_bg_image !=''){
        ?>
        .login-container{background-image:url(<?php echo base_url();?><?php echo school_bg_image; ?>);min-height:750px;background-repeat:no-repeat;background-size:cover;}
        <?php
        }else{
        ?>
        .login-container{background-color:#EAEDED;}
        <?php
        }
        ?>




        tbody tr td{color: red !important;}
        .thumb img{height: 300px;width: 100%!important;}
        .w50{width: 50%;float: left;padding: 30px;}     

        form p{width: 100%;margin-top: 10px;float: left;text-align: center;}   
        input[type=text]{width:100%;padding:8px;box-shadow: 0 0 2px #ccc !important;}
        input[type=password]{width:100%;padding:8px;border:0.2px  silver;box-shadow: 0 0 2px #ccc !important;opacity:1;}
        .fa-pencil{color: white;}

        .footer{background:#fff;opacity:0.9;text-align:center; margin-top:250px; }
        .footer p{padding:10px;}

        .login-form{background:#fff;padding:20px;margin-top:100px;border-radius:20px;opacity:0.8;}

        .login-heading{text-align:center;}

        .login-heading img {width:150px;}

        .login-form  p{padding:15px;margin-top:10px;}
        @media only screen and (max-width:767px){
            .login-form{background:#fff;padding:20px;margin-top:100px;border-radius:20px;opacity:0.8;} 
            .login-heading img {width:150px;}

        }
        </style>


    </head>
    <body>





    <div class="container-fluid login-container">
        <div class="row">
            <div class="col-sm-4 "></div>
            <div class="col-sm-4 ">
                <div class="login-form">
                    <h4>
                        <?php if($success){ ?>
                        <p style='color:green;font-weight:bolder;'> <?php echo $success; ?></p>
                        <?php } ?>
                        <?php if($error){ ?>
                        <p style='color:red;font-weight:bolder;'> <?php echo $error; ?></p>
                        <?php } ?>
                    </h4> 
                    <h4 class="login-heading"><img src="<?php echo base_url().school_logo;?>" /></h4>        
                    <form class="forms-sample" method="post">
                        <div class="form-group">
                            <input type="hidden" name="latd" id="latd" value="">
                            <input type="hidden" name="lotd" id="lotd" value="">
    
                            <label for="exampleInputName1">User Name</label>
                            <input type="tel" class="form-control" name="username" placeholder="User Name" value="<?php echo $this->input->cookie('username',true); ?>" required>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputName1">Password</label>
                            <input type="password" class="form-control" name="password" placeholder="Password" value="<?php echo $this->input->cookie('password',true); ?>" required>
                        </div>
         
                        <button type="submit" class="btn btn-success mr-2" name="login">Submit</button>
                    </form>
                    <!--<p><a href="<?php echo base_url();?>login/forgot_password">Forgot Password</a></p>-->
                    <p></p>
                </div>
            </div>
            <div class="col-sm-4 ">	</div>
        </div>


        <div class="row footer">
            <div class="col-sm-12">
                <p>School ERP managed by <a href="https://schoolassistant.in/" target="_blank">School Assistant.</a> </p>
            </div>    
        </div>
    </div>

        <script>

            $(document).ready(function(){
                if(navigator.geolocation){
                    var x = document.getElementById("demo");        
                    navigator.geolocation.getCurrentPosition(showPosition);
                }else{ 
                    x.innerHTML = "Geolocation is not supported by this browser.";
                }

                function showPosition(position){
                    var latdd;
                    var lotd;
                    latdd=position.coords.latitude;
                    lotd=position.coords.longitude;
                    // alert(lotd);
                    var ipaddress='<?php echo $host; ?>';

                    $("#latd").val(latdd);
                    $("#lotd").val(lotd);   

                    // $.ajax({
                        // url: '
                        <?php  ?>
                        // Home/markin',
                        // type: 'POST',
                        // data: {latdd:latdd,lotd:lotd,ipaddress:ipaddress},
                        // success: function(data){
                        // // alert(data);
                        // $("#demo").html(data); 
                        // }
                    // });
                }


            });
        </script>


    </body>
</html>