
<?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==57 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">Al-Ghani U-1</button>
        <button id="u2" style="margin: 2px; background-color: red;" class="btn btn-success">Al-Ghani U-2</button>
        <button id="u3" style="margin: 2px; background-color: blue;" class="btn btn-success">Marium Protein</button>
        <button id="u4" style="margin: 2px; background-color: red;" class="btn btn-success">Al-Ghani U-4</button>
        <button id="u5" style="margin: 2px; background-color: orange;" class="btn btn-success">Al-Ghani U-5</button>
        <button id="u6" style="margin: 2px; background-color: red;" class="btn btn-success">Al-Ghani U-6</button>
        <button id="u7" style="margin: 2px; background-color: gray;" class="btn btn-success">Al-Ghani U-7</button>
        <button id="u8" style="margin: 2px; background-color: rgb(50, 40, 60);" class="btn btn-success">Al-Ghani U-8</button>
        <button id="u9" style="margin: 2px; background-color: rgb(76, 0, 153);" class="btn btn-success">Al-Ghani U-9</button>
        <button id="u10" style="margin: 2px; background-color: rgb(51, 0, 22);" class="btn btn-success">Al-Ghani U-10</button>
        <button id="u11" style="margin: 2px; background-color: gray;" class="btn btn-success">Al-Ghani U-11</button>
  <button id="u12" style="margin: 2px; background-color: rgb(76, 0, 153);" class="btn btn-success">Al-Ghani U-12</button>
  <button id="u13" style="margin: 2px; background-color: rgb(50, 40, 60);" class="btn btn-success">Al-Ghani U-13</button>
        
    </div>
     <div style="border: 1px solid gray; border-radius: 5px;" class="row">
        <button id="adn" style="margin: 2px;" class="btn btn-success">Adnan Profit / Loss</button>
        <button id="um" style="margin: 2px; background-color: red;" class="btn btn-success">Umer Profit / Loss</button>
        <button id="has" style="margin: 2px; background-color: blue;" class="btn btn-success">Hassan Profit / Loss</button>
    </div>


<?php
}
// ASHIR PROTEIN UNIT-1    7618310 (Profit)
// AL-WAASE PROTEIN    2476144 (Profit)
// AL-MAIDAH PROTEIN   -122794 (Loss)
// UMER PROTEIN    -2458291 (Loss)
// BISMILLAH PROTEIN   17436813 (Profit)
             if($uid==59 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="ash1" style="margin: 2px;" class="btn btn-success">ASHIR UNIT-1</button>
        <button id="ash2" style="margin: 2px; background-color: red;" class="btn btn-success">ASHIR UNIT-2</button>
        <button id="waa1" style="margin: 2px; background-color: blue;" class="btn btn-success">AL-WAASE U-1</button>
        <button id="waa2" style="margin: 2px; background-color: indigo;" class="btn btn-success">AL-WAASE UNIT-2</button>
        <button id="waa3" style="margin: 2px; background-color: red;" class="btn btn-success">AL-WAASE UNIT-3</button>
        <button id="bis1" style="margin: 2px; background-color: darkcyan;" class="btn btn-success">BISMILLAH PROTEIN</button>
       
             <div style="border: 1px solid gray; border-radius: 5px;" class="row">
   
        <button id="um" style="margin: 2px; background-color: red;" class="btn btn-success">Umer Farms Profit / Loss Summary</button>
  
    </div>
    </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 = 55;
             $.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 = 66;
             $.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 = 94;
             $.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 = 72;
             $.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: 'preflkdtlnew.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: 'preflkdtlnew.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: ../wb2/index.php');
}
}
else{
   header('location: ../wb2/index.php');
}
?>