<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{


?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
   <?php include("includes/header.php") ?>
</head>

<body>


    <!-- Left Panel -->

   <!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        
        <!-- Header-->

        

        <div class="content mt-3">
            <div class="animated fadeIn">
                <div class="row">

                    <div class="col-md-14">
                        <div class="card">
						<div class="page-title">
                        <h2><center><? echo "" . $_SESSION["userid"]; ?></center></h2>
                    </div>
                            <div class="card-header">
							
                                <strong class="card-title"><center>Daily Cash Receipt Details Report</center> </strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$from_date=$_POST["from_date"];
$to_date=$_POST["to_date"];
$today=date("Y-m-d");
$username=$_SESSION["username"];


?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
									  
echo "<th > R.No </th>";
echo "<th > Customer Name </th>";
echo "<th > City </th>";
echo "<th > Cheque No </th>";
echo "<th > Bank Name </th>";
echo "<th > Receipt Amount </th>";
echo "<th > Status </th>";



echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
									$sql = "SELECT * FROM cashrec where  date between '$from_date' and '$to_date' and user_id='$userid' order by id desc";
$result=$conn->query($sql);
                                       while($row = $result->fetch_assoc())
 
  {
 $id = $row['id'];
  echo "<tr>";
echo "<td>" .$row['id'] . "</td>";
echo "<td>" .$row['cname'] . "</td>";
echo "<td>" .$row['city'] . "</td>";
echo "<td>" .$row['netamount'] . "</td>";
echo "<td>" .$row['chequeno'] . "</td>";
echo "<td>" .$row['bankname'] . "</td>";

echo "<td>" .$row['remarks'] . "</td>";
  echo "</tr>";

$trecord=$trecord + 1;
$tfeerec=$tfeerec + $row['netamount'];


  }
  
   echo "<tr>";
	echo "<td colspan=3 align=right><b>" ."Total Records::". $trecord ."</b></td>";
		echo "<td><b>" .$tfeerec . "</b></td>";
	
	
		
		
	  echo "</tr>";
	   
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>

<div class="col-md-14">
                        <div class="card">
						<div class="page-title">
                        <h2><center><? echo "" . $_SESSION["userid"]; ?></center></h2>
                    </div>
                            <div class="card-header">
							
                                <strong class="card-title"><center>Daily Sale Tax Invoice Details Report</center> </strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$from_date=$_POST["from_date"];
$to_date=$_POST["to_date"];
$today=date("Y-m-d");
$username=$_SESSION["username"];


?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       echo "<tr>";
									  echo "<th > Date </th>";
echo "<th > I.No </th>";
echo "<th > Name </th>";
echo "<th > Cell </th>";
echo "<th > Amount </th>";
echo "<th > Sale Tax </th>";
echo "<th > Sale Tax Amount </th>";
echo "<th > Gross Amount </th>";
echo "<th > Dis Amount </th>";
echo "<th > Net Amount </th>";


echo "</tr>";
?>
                                    </thead>
									
                                    <tbody>
									<?php
									$sqlst = "SELECT * FROM invoice_st where  date between '$from_date' and '$to_date' and user_id='$userid' order by id desc";
$resultst=$conn->query($sqlst);
                                       while($rowst = $resultst->fetch_assoc())
 
  {
 $id = $rowst['id'];
  echo "<tr>";
  echo "<td>" .$rowst['date'] . "</td>";
echo "<td>" .$rowst['id'] . "</td>";
echo "<td>" .$rowst['cname'] . "</td>";
echo "<td>" .$rowst['cell'] . "</td>";
echo "<td>" .$rowst['netamount'] . "</td>";
echo "<td>" .$rowst['st'] . "</td>";
echo "<td>" .$rowst['stamount'] . "</td>";
echo "<td>" .$rowst['tnetamount'] . "</td>";
echo "<td>" .$rowst['discount'] . "</td>";
echo "<td>" .$rowst['gamount'] . "</td>";
echo"<th> <a href ='Print_Invoice_st.php?id=$id'>"?><button type="button" class="btn btn-primary"> Print Sale Tax</button><?php "</a>";


  echo "</tr>";

$trecordst=$trecordst + 1;
$tfeerecst=$tfeerecst + $rowst['netamount'];

$tst=$tst + $rowst['stamount'];
$tstamount=$tstamount + $rowst['tnetamount'];
$tdiscount=$tdiscount + $rowst['discount'];
$tgamount=$tgamount + $rowst['gamount'];


  }
  
   echo "<tr>";
	echo "<td colspan=4 align=right><b>" ."Total Records::". $trecordst ."</b></td>";
		echo "<td><b>" .$tfeerecst . "</b></td>";
		echo "<td><b>" .$tst . "</b></td>";
		echo "<td><b>" .$tstamount . "</b></td>";
	echo "<td><b>" .$tdiscount . "</b></td>";
		echo "<td><b>" .$tgamount . "</b></td>";
	
		
		
	  echo "</tr>";
	   
  ?>
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div><!-- .animated -->
        </div> <!-- .content -->
    </div><!-- /#right-panel -->

    <!-- Right Panel -->

   <?php include("includes/footermenu.php") ?>

</body>

</html>
<?php
}
?>