<html>
<meta charset="utf-8">
<title>Survey</title>
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>

<head>
    <meta charset="UTF-8">
    <title>Survey</title>
    <link href="<?php echo base_url(); ?>fa/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/style.css" />

    <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>js/bootstrap.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.validate.js"></script>

    <script>
        $(document).ready(function() {
            // validate signup form
            $("#login_form").validate({
                rules: {
                    username: {
                        required: true,
                        email: true,
                        minlength: 1,
                        maxlength: 50
                    },
                    password: {
                        required: true,
                        minlength: 3,
                        maxlength: 50
                    },
                },
                messages: {

                    /*  username:"0-9, a-z, A-Z, -, _, @. are accepted with atleast one alphabet (min-3 to max-15).",
                      password:"a-z, A-Z, 0-9, - _ . @ ! $ are accepted with atleast one alphabet (min-3 to max-15).",*/
                    username: {
                        required: "Username Required",
                        minlength: "Username Required",
                        email: "Invalid Email id"
                    },
                    password: "Password Required.",
                }
            });
            //var tt=setInterval(function(){$("#no-log-error").html("")},5000);
        });
    </script>
</head>

<body id="logid">
    <div class="container">
        <div class="logindiv">
            <div class="forms text-center" style="background-color: #2d3e50;">
            	<img src="<?php base_url(); ?>images/icon.png" alt="Logo" style="text-align:center; width: 100%;">
                <h3 class="text-center" style="color: white;">Login</h3>
                <div>
                    <div id="no-log-error" align="center">

                        <?php if($this->session->flashdata('er')) { ?>
                            <div class="alert-info">
                                <label>
                                    <?php echo $this->session->flashdata('er');?>
                                </label>
                            </div>
                            <?php } ?>
                    </div>
                    <?php $attributes = array('id' => 'login_form', 'name' => 'login_form');
                  echo form_open('user/check_user', $attributes);  ?>
                        <div class="form-group">
                            <input type="text" name="username" id="username" placeholder="Username" value="" class="form-control">
                            <label class="error">
                                <?php echo form_error('username'); ?>
                            </label>
                        </div>
                        <span class="clearfix"></span>

                        <div class="form-group">
                            <input type="password" name="password" id="password" placeholder="Password" value="" class="form-control">
                            <p class="error">
                                <?php echo form_error('password'); ?>
                            </p>
                        </div>
                        <!-- <div class="form-group">
                            <a href="<?php echo site_url('user/forgot_password') ?>">Forgot password?</a>
                        </div> -->
                        <span class="clearfix"></span>
                        <div class="form-group text-center">
                            <input type="submit" name="submit" id="submit" value="Sign In" class="btn btn-primary">
                        </div>
                        </form>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
</body>

</html>