		

<?php 
if(isset($_POST['aname'])){

extract($_POST);


require 'connection.php';
$qry2 = "SELECT * FROM groupreg where groupname='$aname' or groupid='$aname'";
   $run2 = mysqli_query($connect, $qry2) or die(mysqli_error($connect));
  $row2 = mysqli_fetch_array($run2);
$groupid=$row2['groupid'];

    $qry21 = "SELECT * from monthlyreport where accid = '$groupid' and trid<=449";

        $run_qry21 = mysqli_query($connect, $qry21);
?>
						<h2 class="title text-center">TOTAL FINAL FLOCK DETAIL</h2>
						<?php
        while ($row21=mysqli_fetch_array($run_qry21)) {
			$amtlbl=$row21['debit']+$row21['credit'];

?>
		<div class="col-sm-4">
		<div class="product-image-wrapper">
		<div class="single-products">
		<div class="productinfo text-center">
		<img src="<?php echo $row21['picname']; ?>" alt="" />
	<h2 style="font-size: 18px; color red;"><?php echo $amtlbl; ?> </h2>

		<h2>FLOCK# <?php echo $row21['flockno']; ?></h2>
	<p><?php echo $row21['shedname']; ?>  FLOCK DETAIL</p>
		<!-- <a href="#" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a> -->
		</div>

<!-- ********************************OVERLAY START*************************************** -->
	<!-- 	<div class="product-overlay">
		<div class="overlay-content">
			<h2>FLOCK# <?php echo $row21['flockno']; ?></h2>
		<p><?php echo $row21['shedname']; ?>  FLOCK DETAIL</p>
		<p>Dated as : <?php echo $row21['dated']; ?></p>
		<a href="gallery.php" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Show detail</a>
		</div>
		</div> -->

<!-- ******************************OVERLAY END********************************** -->
		</div>
		<div class="choose">
		<ul class="nav nav-pills nav-justified">
		<!-- <li><a href="#"><i class="fa fa-plus-square"></i>Add to wishlist</a></li> -->
		<!-- <li><a href="#"><i class="fa fa-plus-square"></i>Add to compare</a></li> -->
			</ul>
			</div>
		</div>
		</div>

<?php
}
// *******************************************


    $qry21 = "SELECT * from monthlyreport where accid = '$groupid' and trid>449";

        $run_qry21 = mysqli_query($connect, $qry21);
?>
	<div class="col-sm-4">
		<div class="product-image-wrapper">
		<div class="single-products">
		<div class="productinfo text-center">
			 <table class="table  table-stripped col-md-12">

			 	<tr>
 <td colspan="2" style=" font-weight: bold;"> <img src="../wb3/upload/al-ghaniTitle.png" alt="" /></td>

</tr>
						<!-- <h2 class="title text-center">TOTAL FINAL FLOCK DETAIL</h2> -->
						<?php
        while ($row21=mysqli_fetch_array($run_qry21)) {
			$amtlbl=$row21['debit']+$row21['credit'];

?>
		<div class="col-sm-6">
		<div class="product-image-wrapper">
		<div class="single-products">
		<div class="productinfo text-center">
<!-- ***********************INNER WHILE START********************** -->
<?php
	$DTLFLOCKNO=$row21['flockno'];
    $qry212 = "SELECT * from PreFlkDtl where accid = '$groupid' and FlockNo='$DTLFLOCKNO'";

        $run_qry212 = mysqli_query($connect, $qry212);
?>
						<!-- <h2 class="title text-center">TOTAL FINAL FLOCK DETAIL</h2> -->
						<?php
        while ($row212=mysqli_fetch_array($run_qry212)) {
			
if($row212['ExpenseID']=='1'){


?>
	

<tr>
 <td style=" font-weight: bold;  font-size: 18px;"> <?php echo $row212['Debit'] ?> </td>

 <!-- <td style=" font-weight: bold;"> <img src="../wb3/upload/chicksLbl.png" alt="" /> 457854</td> -->
 <td style=" font-weight: bold;  font-size: 18px; color: darkred;"> چوزہ</td>
</tr>	
<?php
} 
else{
	?>
	<tr style="height: 10px important;">
 <td style="  font-weight: bold;  font-size: 16px;"> <?php echo $row212['Debit'] ?> </td>

 <td style="  font-weight: bold;  font-size: 16px; color: darkred;"> فیڈ</td>
</tr>
<?php
}
 ?>

<?php


}
?>
<!-- ************************INNER WHILE END***************************** -->

		<!-- <a href="#" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a> -->
		</div>

<!-- ********************************OVERLAY START*************************************** -->
	<!-- 	<div class="product-overlay">
		<div class="overlay-content">
			<h2>FLOCK# <?php echo $row21['flockno']; ?></h2>
		<p><?php echo $row21['shedname']; ?>  FLOCK DETAIL</p>
		<p>Dated as : <?php echo $row21['dated']; ?></p>
		<a href="gallery.php" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Show detail</a>
		</div>
		</div> -->

<!-- ******************************OVERLAY END********************************** -->
		</div>
		<div class="choose">
		<ul class="nav nav-pills nav-justified">
		<!-- <li><a href="#"><i class="fa fa-plus-square"></i>Add to wishlist</a></li> -->
		<!-- <li><a href="#"><i class="fa fa-plus-square"></i>Add to compare</a></li> -->
			</ul>
			</div>
		</div>
		</div>

			</table>



		<!-- <img src="<?php echo $row21['picname']; ?>" alt="" /> -->
	<h2 style="font-size: 18px; color red;"><?php echo $amtlbl; ?> </h2>

		<h2>FLOCK# <?php echo $row21['flockno']; ?></h2>
	<p><?php echo $row21['shedname']; ?>  FLOCK DETAIL</p>
		<!-- <a href="#" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a> -->
		</div>

<!-- ********************************OVERLAY START*************************************** -->
	<!-- 	<div class="product-overlay">
		<div class="overlay-content">
			<h2>FLOCK# <?php echo $row21['flockno']; ?></h2>
		<p><?php echo $row21['shedname']; ?>  FLOCK DETAIL</p>
		<p>Dated as : <?php echo $row21['dated']; ?></p>
		<a href="gallery.php" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Show detail</a>
		</div>
		</div> -->

<!-- ******************************OVERLAY END********************************** -->
		</div>
		<div class="choose">
		<ul class="nav nav-pills nav-justified">
		<!-- <li><a href="#"><i class="fa fa-plus-square"></i>Add to wishlist</a></li> -->
		<!-- <li><a href="#"><i class="fa fa-plus-square"></i>Add to compare</a></li> -->
			</ul>
			</div>
		</div>
		</div>

<?php
}


// **********************************************




?>
						<h2 class="title text-center">END DETAIL SECTION</h2>
<?php
}
 ?>