<?
session_start();
$id=$_REQUEST['id'];

 $brcode=$_SESSION['brcode'];
    $user=$_SESSION['user'];
    if(strlen($brcode)>0)
    {
        print "<script> alert('You are already logged in as $user'); </script>";
        print "<center>[<a href='logout.php'>Logout</a>] ";
        print "<br><font color=red><blink><b>Warning </b></font></blink><br>Logout properly in future <br> Multiple login is not allowed";
        return;
    }
?>
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!--[if IE]>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <![endif]-->
    <title>AMPL EICHER</title>
	<link rel="stylesheet" href="cal/jquery-ui.css" />
<script src="cal/jquery-1.9.1.js"></script>
<script src="cal/jquery-ui1.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
    <!--REQUIRED STYLE SHEETS-->
    <!-- BOOTSTRAP CORE STYLE CSS -->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FONTAWESOME STYLE CSS -->
    <link href="assets/css/font-awesome.min.css" rel="stylesheet" />
    <!-- CUSTOM STYLE CSS -->
    <link href="assets/css/style.css" rel="stylesheet" />
    <!-- GOOGLE FONT -->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[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>
<?
include("opendb.php");
$re=mysqli_query($db,"select acfrom,acto from acperiod")or die(mysqli_error($db));
$row=mysqli_fetch_array($re);
?>
<script>
$(function() {
    //alert(document.f1.yrvl.value);
     $( "#datepicker" ).datepicker("destroy");
     var fyr=document.getElementById('fin_yr').value;
     var splv=fyr.explode("-");
     var syr=splv[0];
     var eyr='20'.concat(splv[1]);
     var syr1='-04-01';
     var eyr1='-03-31';
     var stfnyr=syr.concat(syr1);
     var efnyr=eyr.concat(eyr1);
     $("#datepicker").datepicker({minDate: stfnyr, maxDate: efnyr});
    $("#fin_yr").change(function () {
        $( "#datepicker" ).datepicker("destroy");
        var end = this.value;

        var res = end.explode("-");
        var styr=res[0];
        var endyr='20'.concat(res[1]);
        var str1='-04-01';
        var str2='-03-31';
        var strtdt=styr.concat(str1);
        var enddt=endyr.concat(str2);
        $("#datepicker").datepicker({minDate: strtdt, maxDate: enddt});
    });

    });

</script>
<?
if($id>=2)
{
    session_start();
   
    $re1=mysqli_query($db,"select brcode,brname from branch where active = 'Y' order by brcode asc")or die(mysqli_error($db));
    $rw=mysqli_fetch_array($re1);
    $brcd=$rw[0];
    $query="select username from bruser where brcode='$brcd' and username='admin'";
    $rs=mysqli_query($db,$query);
    $num=mysqli_num_rows($rs);
    if($num<=0)
        {
            $sql="insert into bruser(brcode,username,level,utype,pswd,active,passdate) values ('$brcd','admin','11','Normal User','admin@123','Y','2020-03-31')";
           mysqli_query($db,$sql);
        }
}  
     
?>
<body>
    <!-- Navigation -->
     <header>
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                
                <a class="navbar-brand" href="htttp://www.psnauto.in/amplcnew">2018 - 2019</a>
            </div>
            <!-- Collect the nav links for toggling -->
            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="#home">HOME</a>
                    </li>
                    <li><a href="#services">ABOUT</a>
                    </li>

                    

                    <li><a href="#contact-sec">CONTACT</a>
                    </li>
                   
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>
          </header>
    <!--End Navigation -->

    

  
    <!--Header section  -->
    <div id="home">
    <div class="container" >
	
	<table width='100%' border=0 >
<tr><td align="center"><CENTER>
<span class=x>
    <br>
    <br>
    <br>
<A HREF="#" onClick="window.open('index0.php', 'popup', 'width=1500,height=900,toolbar=no,status=yes,location=yes, menubar=no,directories=yes,scrollbars=no,resizable=yes')">
<img src='img/truck.jpg' border=0> </A><br><font color=black size=6>  * AMPL *</font>

</CENTER></td></tr>
<?
session_start();
include ("opendb.php");
?>
<tr><td bgcolor='0000'colspan=1 valign=center><CENTER>
<br>
<FONT COLOR='IVORY' FACE='ARIAL BLACK' size=4><A HREF="#" onClick="window.open('index0.php', 'popup', 'width=1500,height=900,toolbar=no,status=yes,location=yes, menubar=no,directories=yes,scrollbars=no,resizable=yes,oncontextmenu=no')">

CLICK HERE TO USER LOGIN </A></font><br> <img src='img/key.gif'></td></tr>
<tr><td colspan=1 align=center bgcolor='5fa9bc'>
    
    </table>
                   </div>
   
            </div>

        </div>
    </div>
          </div>
    <!--End Header section  -->
    <!--Services Section-->
    
     <!--End Services Section-->
    <!--parallax one-->
     
    <!--./parallax one-->
        <!-- Pricing Section -->
    
    <!--End Pricing Section -->
    <!--parallax two-->
    
    <!--./parallax two-->
    

    <!-- Contact Section -->
   

    <!--End Contact Section -->
    <!--footer Section -->
    <div class="for-full-back " id="footer">
        2017 www.psninfotech.com | All Right Reserved
         
    </div>
    <!--End footer Section -->
    <!-- JAVASCRIPT FILES PLACED AT THE BOTTOM TO REDUCE THE LOADING TIME  -->
    <!-- CORE JQUERY  -->
    
</body>
</html>






























