<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Tekun | Reset Password</title>
        <!-- Tell the browser to be responsive to screen width -->
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <link rel="shortcut icon" href="<?php echo base_url(); ?>dist/img/smalltekun_logo1.png?ver=1">
        <!-- Bootstrap 3.3.5 -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>bootstrap/css/bootstrap.min.css">
        <!-- Font Awesome -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
        <!-- Ionicons -->
        <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
        <!-- Theme style -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/AdminLTE.css">
        <!-- iCheck -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/iCheck/square/blue.css">

        <!-- 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/html5shiv/3.7.3/html5shiv.min.js"></script>
            <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body class="hold-transition skin-red-light login-page">
        <div class="login-box " >
            <div class="login-wrap col-lg-12 col-md-12 col-xs-12">
                <div class="login-box-body">
                    <div class="login-logo">
                        <a href="<?php echo base_url(); ?>home"><img src="<?php echo base_url(); ?>dist/img/logo.png" style="width:100px;" />TEKUN</a>
                    </div><!-- /.login-logo -->

                    <p class="login-box-msg">Reset password</p>
                    <?php
                    echo form_open('forgetPassword/submit_reset_pwd', 'id="loginForm"  class="form-horizontal"');
                    ?>
                    <div class="form-group has-feedback">
                        <input id="reset_pwd_code" name="reset_pwd_code" type="hidden" value="<?php echo $code; ?>">
                        <input id="password" name="password" type="password" required email class="form-control" placeholder="New password">
                        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                    </div>
                    
                    <div class="form-group has-feedback">
                        <input id="confir_password" name="confir_password" type="password" required email class="form-control" placeholder="Confirm new password">
                        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                    </div>

                    <div class="row">
                        <div class="col-xs-8">

                        </div><!-- /.col -->
                        <div class="col-xs-4">
                            <input type="submit" id="signIn" class="btn btn-primary btn-block btn-flat" name="submit" value="Send">
                        </div><!-- /.col -->
                    </div>

                    </form>

                </div><!-- /.login-box-body -->
                <div class="additional-info col-xs-12 text-center">
                    <a href="<?php echo base_url() ?>login">Login</a>
                </div>
            </div>
        </div><!-- /.login-box -->

        <!-- jQuery 2.1.4 -->
        <script src="<?php echo base_url(); ?>plugins/jQuery/jQuery-2.1.4.min.js"></script>
        <!-- Bootstrap 3.3.5 -->
        <script src="<?php echo base_url(); ?>bootstrap/js/bootstrap.min.js"></script>
        <!-- iCheck -->
        <script src="<?php echo base_url(); ?>plugins/iCheck/icheck.min.js"></script>
        <script>
            $(function () {
                $('input').iCheck({
                    checkboxClass: 'icheckbox_square-blue',
                    radioClass: 'iradio_square-blue',
                    increaseArea: '20%' // optional
                });
            });

            $(document).ready(function () {
                /*$('#loginForm').submit(function(e){  
                 if($('#compID').val() == 'false'){                  
                 console.log('testing');
                 getCompany();
                 e.preventDefault();
                 }
                 });*/
            });
            function getCompany() {
                $.ajax({
                    url: "<?php echo base_url() ?>login/slctCompany",
                    type: "POST",
                    data: {userID: $("#userID").val(), pass: $("#password").val()},
                    dataType: "json",
                    success: function (data) {
                        if (data.status.trim() == 'success') {
                            $('#compID').val(data.compList[0].ID);
                            console.log('testing');
                            $('#loginForm').submit();
                        } else {
                            alert(data.data);
                        }
                    }
                });
            }
        </script>

    </body>
</html>
