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

include "template/headertop.php";

?>

        
          <!-- START Search -->
            <style type="text/css">
    body{
        font-family: Arail, sans-serif;
    }
    /* Formatting search box */
    .search-box{
        width: 300px;
        position: relative;
        display: inline-block;
        font-size: 14px;
    }
    .search-box input[type="text"]{
        height: 32px;
        padding: 5px 10px;
        border: 1px solid #CCCCCC;
        font-size: 14px;
    }
    .result{
        position: absolute;        
        z-index: 999;
        top: 100%;
        left: 0;
    }
    .search-box input[type="text"], .result{
        width: 100%;
        box-sizing: border-box;
    }
    /* Formatting result items */
    .result p{
        margin: 0;
        padding: 7px 10px;
        border: 1px solid #CCCCCC;
        border-top: none;
        cursor: pointer;
        background-color: white;
    }
    .result p:hover{
        background: #f2f2f2;
    }
</style>
<script type="text/javascript">
$(document).ready(function(){
    $('.search-box input[type="text"]').on("keyup input", function(){
        /* Get input value on change */
        var inputVal = $(this).val();
        var resultDropdown = $(this).siblings(".result");
        if(inputVal.length){
            $.get("backend-search.php", {term: inputVal}).done(function(data){
                // Display the returned data in browser
                resultDropdown.html(data);
            });
        } else{
            resultDropdown.empty();
        }
    });
    
    // Set search input value on click of result item
    $(document).on("click", ".result p", function(){
        $(this).parents(".search-box").find('input[type="text"]').val($(this).text());
        $(this).parent(".result").empty();
    });
});
</script>

    <div class="search-box">
        <input  class="form-control dddd" type="text" autocomplete="off" placeholder="Search Shed Name..." />
        <div style="background-color: solid white !important;" class="result"></div>
    </div>


    <script type="text/javascript">
 $('#search').click(function(e){
    alert($(".dddd"));
  })
</script>
              <!-- <input type="text" placeholder="Search"/> -->
              <button id="search" class="btn btn-success">Search</button>
              <button style="background-color: red;" id="clear" class="btn btn-success">Clear</button>
              <!-- END Search -->
              <?php 

                if($uid==2 or $uid==52){
                ?>
                <div style="margin-bottom: -20px; margin-top: -10px;" class="row">
            <label>Quick Access</label>
                  
                </div>

          <div style="border: 1px solid gray; border-radius: 5px;" class="row">
        <button id="u1" style="margin: 2px;" class="btn btn-success">Mirha Protein</button>
        <button id="u2" style="margin: 2px; background-color: red;" class="btn btn-success">Ahmed Protein</button>
        <button id="u3" style="margin: 2px; background-color: blue;" class="btn btn-success">Amna Protein</button>
        <button id="u4" style="margin: 2px; background-color: red;" class="btn btn-success">Michael Protein</button>

        
    </div>

<?php
}



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

    

 ?>

<div id="tabless">

  <table class="table  table-stripped col-md-12">
            <h2 id="detailsect" style="display: none;" class="title text-center">FEED DETAIL</h2>

         <select style="display: none;"  id="dateddd" class="" data-live-search="true">

                                  <option value="1">JANUARY</option>
                                  <option value="2">FEBRUARY</option>
                                  <option value="3">MARCH</option>
                                  <option value="4">APRIL</option>
                                  <option value="5">MAY</option>
                                  <option value="6">JUNE</option>
                                  <option value="7">JULLY</option>
                                  <option value="8">AUGUST</option>
                                  <option value="9">SEPTEMBER</option>
                                  <option value="10">OCTOBER</option>
                                  <option value="11">NOVEMBER</option>
                                  <option value="12">DECEMBER</option>
                                </select>
                                    
                                    <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">
						<!-- <h2 class="title text-center">TOTAL FINAL FLOCK DETAIL</h2> -->
					
					<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">
 $('#um').click(function(e){
    var aname = 211;
             $.ajax({
        url: 'plssumary.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();

  

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

<script type="text/javascript">
 $('#adn').click(function(e){
    var aname = 0;
             $.ajax({
        url: 'plssumary.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();

             $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

        }
      })

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

<script type="text/javascript">
 $('#has').click(function(e){
    var aname = 211;
             $.ajax({
        url: 'plssumary.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();

             $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

        }
      })

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




<!-- ********************************** -->

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

             $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

        }
      })

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

<script type="text/javascript">
 $('#u2').click(function(e){
    var aname = 15;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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


<script type="text/javascript">
 $('#u3').click(function(e){
    var aname = 18;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

<script type="text/javascript">
 $('#u4').click(function(e){
    var aname = 17;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

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

<script type="text/javascript">
 $('#u6').click(function(e){
    var aname = 82;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

<script type="text/javascript">
 $('#u7').click(function(e){
    var aname = 85;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

<script type="text/javascript">
 $('#u8').click(function(e){
    var aname = 100;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

<script type="text/javascript">
 $('#u9').click(function(e){
    var aname = 104;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

<script type="text/javascript">
 $('#u10').click(function(e){
    var aname = 106;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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



<script type="text/javascript">
 $('#u11').click(function(e){
    var aname = 108;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

        }
      })
        }
      })
       
  })
  $('#clear').click(function(e){
  $(".dddd").val("");
  })
</script>
<!-- ********************************** -->
<script type="text/javascript">
 $('#u12').click(function(e){
    var aname = 117;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

<!-- ************************** -->
<script type="text/javascript">
 $('#ash1').click(function(e){
    var aname = 40;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

<script type="text/javascript">
 $('#ash2').click(function(e){
    var aname = 87;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

<script type="text/javascript">
 $('#waa1').click(function(e){
    var aname = 60;
             $.ajax({
        url: 'dtlflk.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#itemdetail').html(data);
        document.getElementById('tabless').scrollIntoView();
     $.ajax({
        url: 'preflkdtl.php',
        method: 'POST',
       data: {aname: aname},
        success: function(data){
                $('#predlt').html(data);
        // document.getElementById('tabless').scrollIntoView();

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

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

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

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



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

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

<script type="text/javascript">
 $('#ffdtl').click(function(e){
    var ffid=1;
             $.ajax({
        url: 'ffdtls.php',
        method: 'POST',
       data: {ffid: ffid},
        success: function(data){
                $('#itemdetail').html(data);
                $('#dateddd').show();
                $('#detailsect').show();
         document.getElementById('tabless').scrollIntoView();

        }
      })
             
  })
</script>

<script type="text/javascript">
  $('#dateddd').change(function(e){
 
 var dateddd= $('#dateddd').val();

      // event.preventDefault();

            $.ajax({
        url: 'ffdtls.php',
        method: 'POST',
       data: {dateddd: dateddd},
        success: function(data){
            // $('#prate').val(data);
             // alert(data);
                 $('#itemdetail').html(data);
        }
      })

  })
</script>

<?php 
}
else{
   header('location: ../usermps/index.php');
}
}
else{
   header('location: ../usermps/index.php');
}
?>