<?php
session_start();
include('includes/config.php');
include('defs.php');

if(strlen($_SESSION['aid'])==0)
  { header('location:index.php');
}

$usr=$_SESSION['uname'];



 ?>

 <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
     <img src="includes/mlogo.jpg" width="1349" height="100" title="" />

  <title>B-TEVTA  | Edit Head</title>

  <!-- Google Font: Source Sans Pro -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../dist/css/adminlte.min.css">
  <!--Function Email Availabilty---->

</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
  <!-- Navbar -->
<?php include_once("includes/navbar.php");?>
  <!-- /.navbar -->

  <!-- Main Sidebar Container -->
 <?php include_once("includes/sidebar.php");?>

 
  <div class="content-wrapper">

<style>
#suggestions1 {
            border: 2px solid #ccc;
            display: none;
            position: absolute;
            background-color: white;
            width: 300px;
            max-height: 250px;
            overflow-y: auto;
            z-index: 1000;
        }
        #suggestions1 div {
            padding: 3px;
            cursor: pointer;
        }
        #suggestions1 div:hover,
        #suggestions1 .selected {
            background-color: #f0f0f0;
        }

        .input-box {
            width: 100%;
            padding: 4px;
            margin-top: 2px;
            margin-bottom: 2px;
            border: 2px solid gainsboro;
            border-radius: 4px;
            font-size: 16px;

        }
#customers {
  font-family: Times-Roman;
  border-collapse: collapse;
  width: 98%;
}

#customers td, #customers th {
  border: 1px solid #4444;
  padding: 4px;
}

#customers tr:nth-child(even){background-color:gainsboro ;}


#customers th {
  padding-top: 5px;
  padding-bottom: 5px;
  text-align: center;
  background-color:royalblue;
  color: white;
}
</style>   
<link rel="stylesheet" href="css/style.css">
<script language="javascript">

 window.onload= function show()
                        {
                                if(document.voucher.ext.value =="")
                                        {

                                                document.voucher.ext.focus()
                                        }
                                        }



function openAndPrintPDF() 
{
var pdfWindow = window.open('rep_payments.php?usr=<?php echo $usr ?>', '_blank');
}
///////////////////////////////////////////











                
</script>





<form name="voucher" action="" method="POST" onSubmit = "return  validateForm();">




<form method="post">

<table align="center" id="customers">
<br>       
<tr>
    <th colspan="8"><font size="4">TRANSACTION DETAILS</th>

  </tr>


<?
$result = mysqli_query($link, "select * from acc_heads order by A_Id");
echo "        <td align=center>";
echo "                <b><font size=3 color=darkblue>S.No.</b>";
echo "        </td>";
echo "        <td align=center>";
echo "                <b><font size=3 color=darkblue>Cost Center</b>";
echo "        </td>";
echo "        <td align=center>";
echo "                <b><font size=3 color=darkblue>Accounts Code</b>";
echo "        </td>";
echo "        <td align=center>";
echo "                <b><font size=3 color=darkblue>Accounts Head</b>";
echo "        </td>";
echo "        <td align=center>";
echo "                <b><font size=3 color=darkblue>Details</b>";
echo "        </td>";
echo "        <td align=center>";
echo "                <b><font size=3 color=darkblue>Contact Person</b>";
echo "        </td>";
echo "        <td align=center>";
        echo "                <b><font size=3 color=darkblue>Contact No.</b>";
        echo "        </td>";
        
      echo"  </td>";
  echo "        <td align=center>";
        echo "                <b><font size=3 color=darkblue>Action</b>";

      echo"  </td>";

        echo "</tr>";
                                         $count=0;
                                         $one=1;
                                         
                                        while($row = mysqli_fetch_object($result))
                                        {
$count=$one+$count;
$t_dr=$row->Debit+$t_dr;
$t_cr=$row->Credit+$t_cr;
$t_dif=$t_dr-$t_cr;
echo "<td align=center><font size=2 color=black>$count</td>";
echo "<td align=center><font size=2 color=black>$row->M_Head</td>";
echo "<td align=center><font size=2 color=black>$row->A_Id</td>";
echo "<td align=center><font size=2 color=black>$row->Name</td>";
echo "<td align=center><font size=2 color=black>$row->Details</td>";
echo "<td align=center><font size=2 color=black>$row->C_Person</td>";
echo "<td align=center><font size=2 color=black>$row->Contact_No</td>";
?>

<td align=center><input type="submit" name="del" value="Del-<?php echo $row->Id ?> "  ></td>
<?
echo "</tr>";
}
echo "<td align=center colspan=5>";
echo "<b><font size=3 color=darkblue>Grand Totals / Difference</b>";
echo "<td align=center><font size=3 color=black><b>$t_dr</b></td>";

echo "<td align=center><font size=3 color=black><b>$t_cr</b></td>";
echo "<td align=center><font size=3 color=black><b>$t_dif</b></td>";
                

?>

</form>
</table>             


<?

        include "footer.php";
?>
</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script src="../plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- bs-custom-file-input -->
<script src="../plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>
<!-- AdminLTE App -->
<script src="../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../dist/js/demo.js"></script>
<!-- Page specific script -->
<script>
$(function () {
  bsCustomFileInput.init();
});
</script>
</body>
</html>
<?php  ?>