<?php include "layouts/menu.php"; ?> <div class="right_col" role="main">
            <div class="row">
                 <!-- page header -->
                <div class="col-lg-12">
                    <h1 class="page-header  alert alert-info">Tally</h1>
                </div>
                <!--end page header -->
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Details
                        </div>
                        <div class="panel-body">
                            <div class="row">

  <div id="mydiv">
  <input type="button" value="Print" onclick="PrintElem('#mydiv')"  style="margin:20px;">
  <div class="alert alert-info">Tally For Paid Dues</div>			
<form class="form-horizontal" method="post" action="" enctype="multipart/form-data">
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Enter Month</label>
    <div class="col-sm-4">
    <input type="text" class="form-control" id="datepicker" name="fdate" value="" onfocus="insertDate(this,'MM')">
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Enter Year</label>
    <div class="col-sm-4">
    <input type="text" class="form-control" id="datepicker" name="tdate" value="" onfocus="insertDate(this,'YYYY')">
    </div>
  </div>
<div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default" name="s15">Total</button>
    </div>
  </div>
  
    <div class="alert alert-success">
  <b><p style="color:red;margin:10px;"><?php
								if(isset($_POST['s15']))
								{
									extract($_POST);
                                   	echo '----------------------------------------------------------------------------------------------------------------------------------';
									echo '<br>';
									echo 'Credit';
									echo '<br>';
									echo '----------------------------------------------------------------------------------------------------------------------------------';
									
									echo '<br>';
									
									$sql = "SELECT SUM(bal) FROM dc where mfin='$mfin' &&  date between '$fdate' and '$tdate'";
                                    $q = mysqli_query($conn, $sql);
                                    $row3 = mysqli_fetch_array($q);

                                    echo 'Total Document Charge Balance: ' . $row3[0];	
									echo '<br>';
									echo '<br>';
																										
                					$sql = "SELECT SUM(urname) FROM user2 where mfin='$mfin' &&  paydate between '$fdate' and '$tdate'";
                                    $q = mysqli_query($conn, $sql);
                                    $row7 = mysqli_fetch_array($q);

                                    echo 'Total Monthly Due Interest: ' . $row7[0];	
									echo '<br>';
									echo '<br>';
									$sql = "SELECT SUM(amt) FROM net2 where mfin='$mfin' &&  bmnt between '$fdate' and '$tdate'";
                                    $q = mysqli_query($conn, $sql);
                                    $row71 = mysqli_fetch_array($q);

                                    echo 'Settle Monthly Due Interest: ' . $row71[0];	
									echo '<br>';
								
									$credit = $row3[0]+$row7[0]+$row71[0];
									echo  '<br>';
									echo  '<br>';
									echo 'Total Amount=' .$credit;
									echo '<br>';
									echo '<br>';
									echo '----------------------------------------------------------------------------------------------------------------------------------';?></p>
									<p style="color:
rgb(20, 167, 20);margin:10px;"><?php
	}?></p></b>
			</form>
			</div>
  </div>	
</div>
</div></div>
</div></div></div> <?php include "layouts/footer.php"; ?></body></html>
