<?php include "layouts/menu.php"; ?> 
    <?php $did=$_REQUEST['did'];?>
  <!--  page-wrapper -->
         <div class="right_col" role="main">
            <div class="row">
                 <!-- page header -->
                <div class="col-lg-12">
                    <h1 class="page-header  alert alert-info">Debit Updates</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">Debite Delete/Print</div>
  
                    <form name="form1" method="post" action="" enctype="multipart/form-data">
						<?php
						$qry=mysqli_query($conn, "select * from ball where mfin='$mfin' &&  did = '$did'");
						?>
					<?php 
					$row=mysqli_fetch_array($qry)
					?>
					<table class="table table-striped" >
					<col width="150px">
					<tbody style="color:#FF0080;background:white;">
					   	<tr>
						<td style="background-color:#FFAAAA;">Amount</td>
						<td style="background-color:#FFD4FF;"><?php echo $row['debit'];?></td>
						</tr>
						<tr>
						<td style="background-color:#FFAAAA;">Date</td>
						<td style="background-color:#FFD4FF;"><?php echo $row['date'];?></td>
						</tr>
						<tr>
						<td style="background-color:#FFAAAA;">Purpose</td>
						<td style="background-color:#FFD4FF;"><?php echo $row['details'];?></td>
						</tr>
						</div>
						<tr>
						<td style="background-color:#FFAAAA;">Delete</td>						
						<td style="background-color:#FFD4FF;"><button type="submit" class="btn btn-default" name="s1">Delete</button></td>
						</tr>			
							<div class="alert alert-warning">
							<?php
							if(isset($_POST['s1']))
							{
								extract($_POST);
								$qry=mysqli_query($conn, "select * from ball where mfin='$mfin' &&  did='$did'");
								$n=mysqli_num_rows($qry);
								if($n==0)
									{
										echo"Already Deleted";
									}
								else		
									{
										$delete=mysqli_query($conn, "delete from ball where mfin='$mfin' &&  did='$did'");
										if($delete)
										{
										echo"Deleted";
										}
										else
										{
										echo "Try Again";
										}
									}
							}			
							
						   
								
?>							</div>
													<div class="alert alert-warning">
							<?php
							if(isset($_POST['s2']))
							{
								extract($_POST);
								$qry=mysqli_query($conn, "select * from duedate where mfin='$mfin' &&  hpl='$hpl'");
								$n=mysqli_num_rows($qry);
								if($n==0)
									{
										echo"Already Deleted";
									}
								else		
									{
										$delete=mysqli_query($conn, "delete from duedate where mfin='$mfin' &&  hpl='$hpl'");
										if($delete)
										{
										echo"Deleted";
										}
										else
										{
										echo "Try Again";
										}
									}
							}			
							
						   
								
?>							</div>
						
																
					</tbody>
					<?php
					
				
			?>			
					</table>
					</form>
</div>
</div></div>
</div></div></div> <?php include "layouts/footer.php"; ?> </body></html>