
<?php
  
  echo @$_GET['msg'];
  session_start();
  if(isset($_SESSION['userId'])){ 
  require 'connection.php';

include "template/headertop.php";

?>

<style type="text/css">
  .btn2 {
  border: 2px solid black;
  background-color: white;
  color: black;
  cursor: pointer;
  width: 100px;
}
.info2 {
  border-color: #2196F3;
  color: dodgerblue;
}

  /* Green */
.info2:hover {
  background: #2196F3;
  color: white;
}
.danger2 {
  border-color: #f44336;
  color: red;
}

.danger2:hover {
  background: #f44336;
  color: white;
}


</style>
<br>
          <!-- <input  disabled style="width: 100px; display: none;" class="" id="myInput2" type="text" placeholder="Ref#"> -->

  <!-- <input class="form-control" id="myInput" type="text" placeholder="Search.."> -->
  

  <ul class="list-group instore" id="myList" style="display: none;">
          <?php
                    require 'connection.php';

                        $qry = "SELECT  * FROM groupreg where groupid2=2";

             $run = mysqli_query($connect, $qry) or die(mysqli_error($connect));
    while($row = mysqli_fetch_array($run)){
      $id=$row['groupid']*253*253;
?>
                             
    <li value="<?php echo $id;?>" class="list-group-item"><?php echo $row['groupname'];?></li>
      <?php } ?>
   
  </ul> 
  <div class="col-sm-12" style="display: inline-block;">
  <div class="col-6"  style="display: inline-block;">
  <label>By Vaccine</label>
  <select style="width: auto;" id="vacid" class="form-control">
    <option value="4">ND + IB</option>
    <option value="5">Injection</option>
    <option value="10">Gumboro</option>
    <option value="14">Lasota</option>

  </select> 
  </div>
  <div class="col-6" style="display: inline-block;">
  <button id="filtr" class="btn info2">Filter</button style="display: inline-block;">

  </div>
  <img src="images/ajaxload.gif" id="load" style="width: 30px; height: 30px; display: none;">
  <button id="vacal" class="btn danger2">View All</button style="display: inline-block;">


      <!-- <button id="clear" class="btn danger">Clear</button style="display: inline-block;"> -->
</div>
  <br>
  <div class="col-sm-12" style="display: inline-block;">
  <div class="col-6"  style="display: inline-block;">

  </div>
  <div class="col-6" style="display: inline-block;">
   <label>By Day</label>
  <select style="width: auto; min-width: 120px;" id="dayid" class="form-control">
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="10">10</option>
    <option value="14">14</option>
  </select>
  </div>
  <img src="images/ajaxload.gif" id="load" style="width: 30px; height: 30px; display: none;">
  <button id="filtr2" class="btn info2">Filter</button style="display: inline-block;">
    <br>
      <!-- <button id="clear" class="btn danger">Clear</button style="display: inline-block;"> -->

</div>
<br>

<script>
$(document).ready(function(){
  $("#myInput").on("keyup", function() {
    if($("#myInput").val()==""){
      $('#myList').hide();
    }
    else{
      $('#myList').show();

    }
    var value = $(this).val().toLowerCase();
    $("#myList li").filter(function() {
      $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
    });
  });
});
</script>
<script type="text/javascript">
$("ul.instore li").click( function() {
    var txt = $(this).text();
    var val = $(this).val();
    $('#myInput').val(txt);
    $('#myInput2').val(val);
    $(this).addClass("active").siblings().removeClass("active");
      $('#myList').hide();

});
      </script>

      <script type="text/javascript">
$("#clear").click( function() {
 
    $('#myInput').val("");
    $('#myInput2').val("");

});

      </script>

 
        
<?php
$uid = $_SESSION['userId'];
  if( $uid==61){
    
include "template/headerbottom3.php";
}
else{
include "template/headerbottom.php";

}
include "template/sidebar2.php";
    // This is for calculate total feed bag of this month

    

 ?>
 
<div id="tabless">
            <h2 class="title text-center">Detail Section</h2>
  
   <table class="table  table-stripped col-md-12">
   
                                    
                                    <tbody id="itemdetail">
                              
                              </tbody>
                            </table> 
                            </div> 
<!-- <div id="" style="color: red; font-size: 72px;"></div> -->


	 <!-- *****************TABLE START************************ -->
				  
			
						<!-- ************************************************* -->
	<section>
		<div class="container">
			<div class="row">
				
		
				<div class="col-sm-9 padding-right">
				
					<div id="predlt" class="features_items"><!--features_items-->
						<!-- START FLOCK DETAIL -->
				
						<!-- END FLOCK DETAIL -->

						
						
					</div><!--features_items-->
						<h2 class="title text-center">End Detail Section</h2>
					
				</div>
			</div>
		</div>
	</section>
	
	<?php 
include "template/footer.php";

 ?>

<script type="text/javascript">
 $('#search').click(function(e){
  	// alert($(".dddd").val());
  	  	if($('.dddd').val()!==""){
  	var aname = $(".dddd").val();
  	         $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
            // $('#prate').val(data);
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();

        }
      })
  	     }
  })
  $('#clear').click(function(e){
  $(".dddd").val("");
  })
</script>


<script type="text/javascript">
 $('#filtr').click(function(e){
  	// alert($(".dddd").val());
// if($('#myInput2').val()!==""){


    var vacid = $("#vacid").val();
    $('#load').show();
  	         $.ajax({
        url: 'loadvacdtl.php',
        method: 'POST',
       data: {vacid: vacid},
        success: function(data){
    $('#load').hide();
      $('#itemdetail').html(data);
         document.getElementById('itemdetail').scrollIntoView();


        }
      })
  	    // }    
  })
 
</script>

<script type="text/javascript">
 $('#filtr2').click(function(e){
    // alert($(".dddd").val());
// if($('#myInput2').val()!==""){


    var vacid = $("#dayid").val();
    $('#load').show();
             $.ajax({
        url: 'loadvacdtl.php',
        method: 'POST',
       data: {vacid: vacid},
        success: function(data){
    $('#load').hide();
      $('#itemdetail').html(data);
         document.getElementById('itemdetail').scrollIntoView();


        }
      })
        // }    
  })
 
</script>


<script type="text/javascript">
 $('#vacal').click(function(e){
    // alert($(".dddd").val());
// if($('#myInput2').val()!==""){
    var vacid = 0;
    $('#load').show();
             $.ajax({
        url: 'loadvacdtl.php',
        method: 'POST',
       data: {vacid: vacid},
        success: function(data){
    $('#load').hide();
      $('#itemdetail').html(data);
         document.getElementById('itemdetail').scrollIntoView();


        }
      })
        // }    
  })
 
</script>

<?php }
?>
