<?
session_start();
$id=$_REQUEST['id'];
?>
<!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 25-26</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" />
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <link href="assets/css/font-awesome.min.css" rel="stylesheet" />
    
    <link href="assets/css/style21.css" rel="stylesheet" />
    <!-- GOOGLE FONT -->
    
   
	 
</head>
<?
include("opendb.php");
$re=mysqli_query($db,"select * from acperiod");
$row=mysqli_fetch_array($re);
?>
<script>
$(function() {
     $( "#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();
    $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;
    }
    $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);
        }
}  
     
?>

<script type="text/javascript">
//Right click disable
function md(e) 
{ 
  try { if (event.button==2||event.button==3) return false; }  
  catch (e) { if (e.which == 3) return false; } 
}
document.oncontextmenu = function() { return false; }
document.ondragstart   = function() { return false; }
document.onmousedown   = md;

</script>
<body oncontextmenu="return false;">
    <!-- 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.psnautos.in/ampleicher">AMPL - 2025 - 2026</a>
            </div>
            <!-- Collect the nav links for toggling -->
            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <a href="#"><img src="images/logo_05.png" width="120px" height="50px"></a>
                    
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>
          </header>
    <!--End Navigation -->

    

  
    <!--Header section  -->
    <div id="home">
    <div class="container" >
	<!--<form name='f1' action='login.php' method='post' onSubmit="return valid()">-->
	
        <div class="row ">
            <div class="col-md-9 col-sm-9">
                <h1 class="head-main"></h1>
                <span class="head-sub-main"></span>
                <div class="head-last">

                    
                </div>

            </div>
               <div class="col-md-3 col-sm-3">
                   <div class="div-trans text-center">
                      
                        <form name='f1' action='login.php' method='post' onSubmit="return valid()">
                       

						<div class="col-md-12 col-sm-12">
                                <div class="form-group">
Financial Year <select name='fin_yr' id="fin_yr" class="form-control" style="color: #fff;">
    
<option value="2025-26" style='color: black;'>2025-26</option>

<?
/*
$mstart = "2015";
$ctr=0;
$myear = date('Y',time());

$mmonth = date('m',time());
if($mmonth >= 1 && $mmonth <= 3)
    {
        $myear = $myear - 1;
        print $myear."sssss";
    }
  //print "<script> alert($mstart);</script>";
//for ($ctr=$mstart+1;$ctr<=$myear;$ctr++)
    for ($ctr=$mstart;$ctr<$myear+1;$ctr++)
        {
            $mend_year = substr($ctr,-2)+1;
            if($ctr=='2015')
                {
                    //$mdb = 'khadipay005';
                    $mdb = 'psn_amplcnewdb';
                }
            else
                {
                    //$mdb = 'khadidb'.substr($ctr,-2).$mend_year;
                   $mdb = 'psn_psnfidb';
                }
	

        if($db=mysqli_select_db("$mdb"))
	{
    ?>
    <option value="<? echo $ctr.'-'.$mend_year ?>"<? if($myear==$ctr) echo 'selected="selected"';?>><? echo $ctr.'-'.$mend_year ?></option>

  <?
}
    }
*/
?>
</select>
                                </div>
                            </div>


<div class="col-md-12 col-sm-12">
                                <div class="form-group">

                                    Login Date<input type="text" id="datepicker" name="login_date" class="form-control" value="<?echo date('Y-m-d');?>" readonly />
                                </div>
                            </div>


<div class="col-md-12 col-sm-12">
                                <div class="form-group">

                                    Branch<select name='branchcde' class="form-control" style="color: #fff;">
<?
$re=mysqli_query($db,"select brcode,brname from branch where active = 'Y' order by brname asc")or die(mysqli_error($db));
while($row=mysqli_fetch_array($re))
{
  print "<option value='$row[brcode]' style='color: grey;'>$row[brname]</option>";
}
?>
</select>
                                </div>
                            </div>





                            <div class="col-md-12 col-sm-12">
                                <div class="form-group">

                                    Username<input type="text" class="form-control" name="uname" required="required" placeholder="Name">
                                </div>
                            </div>
                            <div class="col-md-12 col-sm-12">
                                <div class="form-group">
Password<input type="password" class="form-control" required="required" name='pswd' placeholder="Password">
                                </div>
                            </div>
                        
                        
                            <div class="col-md-12 col-sm-12">
                                
                                <div class="form-group">
                                    <button type="submit" class="btn btn-success">Login</button>
                                </div>
                            </div>
                       
                    </form>
                   </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">
        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>






























