<?php

include_once 'includes/functions.php';

//include authenticator
//include_once 'includes/auth.php';


// get application no if he she has
if(isset($_GET['appnNSec']))
{
	$appno = $_GET['appnNSec'];
}



?>

<!DOCTYPE html>
<html>
  <head>
    <title>.::NIGER STATE COLLEGE OF EDUCATION, MINNA Portal (DUAP) APPLICATION PORTAL::.</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="images/favicon.png" type="image/x-icon" />
    <!-- Bootstrap -->

    <!-- call bootstap styles -->
    <link href="bootstrap-3.3.4/css/bootstrap.min.css" rel="stylesheet">

    <!-- call custom admin styles -->
	<link href="login/css/signin.css" rel="stylesheet">
	<link href="login/css/docs.css" rel="stylesheet" >

     <!-- call the fontawesome cdn file -->
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">





     <!-- call jquery file for ajax login -->
    <script src="login/js/jquery.js" type="text/javascript" language="javascript"></script>

     <!-- for full slider index -->
	<script type="text/javascript" src="full-slider/js/jquery-1.10.2.js"></script>




	<script language="javascript">


	//login javascript starts here
	  $(function()
	  {


		//hide all the loaders
		$("#error_alert").hide();


        $("#login_form").submit(function(e)
		{



			//remove all the class add the messagebox classes and start fading
			$("#msgbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000);


			//check the username exists or not from ajax
			$.post("login/php/ajax_login.php",{ username:$('#username').val(),password:$('#password').val(),rand:Math.random() } ,function(data)
			{
			  if(data== 1) //if correct login detail
			  {
				$("#msgbox").fadeTo(200,0.1,function()//start fading the messagebox
				{
				  //add message and change the class of the box and start fading
				  $(this).html('Login successful. Please wait.....').addClass('messageboxok').fadeTo(900,1,function()
				  {
					 //redirect to secure page
					 window.location='dashboard.php';
				  });

				});
			  }
			  else
			  {
			  	if (data == 0) {

					$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
					{
					  //add message and change the class of the box and start fading
					  $(this).html('Oops! Passed credentials does not match with the one on system...').addClass('messageboxerror').fadeTo(900,1);


					  //$("#error_alert").fadeIn(900,1);

					});
			  	}else{
			  		$("#msgbox").addClass('hidden');
			  		$("#swap_msgbox").html(data).addClass('alert-info');
			  	}

			  }

			});
			return false; //not to post the  form physically

		e.preventDefault();
		});
		//now call the ajax also focus move from
		$("#password").blur(function()
		{
			$("#login_form").trigger('submit');
		});


    });
    </script>


    <style type="text/css">

	.messagebox{
		position:absolute;
		width:100px;
		margin-left:30px;
		border:1px solid #c93;
		background:#ffc;
		padding:3px;
	}
	.messageboxok{
		position:absolute;
		width:auto;
		margin-left:30px;
		border:1px solid #349534;
		background:#C9FFCA;
		padding:3px;
		font-weight:bold;
		color:#008000;

	}
	.messageboxerror{
		position:absolute;
		width:auto;
		margin-left:30px;
		border:1px solid #CC0000;
		background:#F7CBCA;
		padding:3px;
		font-weight:bold;
		color:#CC0000;
	}

	</style>


    <!-- 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 style="background-image:url(images/IBBUMainGate_0%20opt.jpg); background-repeat:no-repeat; height:100%;width:100%;">
	<header class="navbar" role="banner">

            <!-- call the header -->
            <?php //include 'includes/header.php'; ?>


    </header>




	<div class="container">
			<div class="row">

            <div style="height:5px; display: block;"> .</div>

            <div class="clearfix"></div>


            <div class="col-lg-4"></div>

            <div class="col-lg-4"><!-- feedback message on different kinds of logout -->

            	<?php  if(isset($_REQUEST['msg'])){$msg = $_REQUEST['msg'];} ?>

                <?php
					if($msg == 'ce')
					{
				?> <div class="alert alert-danger notification">
			 			<button class="close" data-dismiss="alert" type="button">
			 				X

    		 			</button>
						<i class="fa fa-info-circle fa-2x"></i>  Oops! Cookie has expired....
                    </div>

                 <?php
					}//end of if cookie expired
				 ?>

                 <?php
					if($msg == 'se')
					{
				 ?> <div class="alert alert-danger notification">
			 			<button class="close" data-dismiss="alert" type="button">
			 				X

    		 			</button>
						<i class="fa fa-info-circle fa-2x"></i>  Oops! Your browser Session has expired, Please login again.....
                    </div>

                 <?php
					}//end of if session expired
				 ?>

                 <?php
					if($msg == 'lgt')
					{
				 ?> <div class="alert alert-info notification">
			 			<button class="close" data-dismiss="alert" type="button">
			 				X

    		 			</button>
						<i class="fa fa-info-circle fa-2x"></i> You have been successfully logged out......
                    </div>

                 <?php
					}//end of if log out
				 ?>


                  <?php
					if(isset($_REQUEST['is']))
					{
				 ?> <div class="alert alert-info notification">
			 			<button class="close" data-dismiss="alert" type="button">
			 				X

    		 			</button>
						<i class="fa fa-info-circle fa-2x"></i> <?php echo $_REQUEST['is'];  ?>
                    </div>

                 <?php
					}//end of if log out
				 ?>





            </div><!-- /col lg 4 -->

            <div class="col-lg-4"></div>


            <div class="col-lg-12">


                <div class="col-lg-4">


                		<?php

						if($appno != '')
						{
						?>
                		<div class="alert alert-info text-center"> <i class="fa fa-2x fa-info-circle" ></i> <br/>
                            <strong><span style="font-size:13px;">  YOUR APPLICATION NO IS:</span></strong><br/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size:30px;font-weight:bold;" class="text-info "><?php echo $appno ?></span></button><br/>

                            <strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please copy this no. for reference purpose.</strong>

                       </div>

                        <?php
						}

						?>


                </div>

                <div class="col-lg-4 well alert-success">
                <!-- <div class="col-lg-12"><img src="images/login logo nce app opt.png" class="img-responsive" width="auto"  /></div> -->
								<div class="col-lg-12"><h2>DUAP APPLICATION PORTAL</h2></div>


               	<!--  <div id="msgbox" style="display:none;"></div>-->
                    <div class="clearfix"></div>
                	<br/><br/>
                 <!-- Notification -->
                    <span id="msgbox" style="display:none"></span>
                    <div id="swap_msgbox" ></div>

	               <!-- <div class="alert alert-danger notification" id="error_alert">
			 			<button class="close" data-dismiss="alert" type="button">
			 				X

    		 			</button>
						<img src="login/img/error_icon.png" />  Oops! Invalid credentials..
                    </div>-->



                  <form id="login_form" name="log_in" class="form-signin form-horizontal" role="form"  method="post">
<!--					<h6 class="form-signin-heading alert alert-info"><i class="fa fa-info"></i> Login with Application No. or Phone Number  and one of your Names.</h6> <hr/>
-->
                    <div class="form-group">
                      <label for="exampleInputEmail1">APPLICATION NO..</label>
                      <input name="txtusername" type="text" class="form-control" placeholder="Enter Application NO." id="username">
                    </div>

					<div class="form-group">
                      <label for="exampleInputPassword1">ONE OF YOUR NAMES </label>
                      <input name="txtpassword" type="password" class="form-control" placeholder="Enter one of your Names" id="password">
                    </div>

                   <!--
                    <input class="form-control" type="text" name="username" id="username" autofocus required placeholder="Username" value="">
					<input class="form-control" type="password" name="password" id="password" required placeholder="Password" value="">

                  -->



                   <div class="form-group">
                    <div class="form-actions">

                         <div><button class="btn btn-success"  name="act" value="Log-in" type="submit" style="width:100%;"> Login </button></div> <br/>



                         <div> <button type="button" class="btn btn-success" style="width:100%;" data-toggle="modal" data-target="#myModalForgetPassword">I can't login? <span class="caret"></span></button></div><br />

                        <a href="../a_/index.php?token=<?php echo md5(rand(1,50000)); ?>" class="btn btn-success" style="width:100%;"  >I am a new applicant? </a>


                        <input id="token" type="hidden" value="6567" name="token">

                    </div><!-- /.form actions -->

          		 </div><!-- form group -->
				</form>

                  <span style="text-align:center;"><h5>JD School Portal (JSP) - V2.0</h5></span>


                </div><!-- /.col lg 4 -->



                <div class="col-lg-4"></div>

                </div><!-- /.col lg 12 -->
			</div><!-- /.row -->
		</div><!-- container -->
<!-- continer for the copied templates ends ---->





    <!-- JS boostrap -->
    <!-- Include all compiled plugins (below), or include individual files as needed -->
   <!-- <script src="bootstrap-3.3.4/js/bootstrap.min.js"></script>

    <script src="bootstrap-3.3.4/js/bootstrap.js"></script>
    -->


      <?php include 'includes/js_plugins.php';?>



      <!-- Modal for forgot password / not login in-->
<div class="modal fade" id="myModalForgetPassword" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true text-danger">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Follow these steps if you can't login with your credentials</h4>
      </div>
      <div class="modal-body">

			<p class="bg-info">



				<table class="table table-hover">

					<tr><td class="info">Send SMS to this number (08142411717) according to the format below</td>	</tr>
					 <tr>	<td class="info">Sms your <b>full name</b>, [space]  <b>phone number</b>,[space] <b>email</b> you used during sign up. </td></tr>
                      <tr>  <td class="success">E.g <b>Abdulkadir Abubakar, 08142411717, youremail@gmail.com</b> </td></tr>

                      <tr>  <td class="danger">Note: This is for applicants that have gotten their application number.</td></tr>





				</table>
			</p>



      </div>
      <div class="modal-footer">
        <button type="button" class="close btn-danger" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">Close</span></button>
      </div>
    </div>
  </div>
</div>

<!--- *********************************** not login ***************************************** -->



    <?php include 'includes/hide_notification.php'; ?>

  </body>
</html>
