Your IP : 216.73.216.26


Current Path : /home2/wtmwscom/public_html/admin/
Upload File :
Current File : /home2/wtmwscom/public_html/admin/invest_income_report.php

<?php
$title= "Invest Income Report";
include 'header.php';
include_once('lib/ps_pagination.php');
$param = '';
$param .= !empty($_GET['uid']) ? "&amp;uid=".$_GET['uid'] : '';

?>
<h1>Invest Income Report</h1>
<section id="comments">
        <form action="" method="get">
          <p>
              <input style="float: left;" type="text" value="<?php if(isset($_GET['uid'])){ echo $_GET['uid'];}?>" name="uid" placeholder="Search by User Id" />
              <input type="submit" name="submit" id="submit" value="submit">
          </p>
        </form>
    </section>
<table>
    <thead>
<tr >
<th>S.No.</th>
<th>User ID</th>
<th>User name</th>
<th>Gross Amount</th>
<th>TDS (10%)</th>
<th>Service Tax  (8.33 %)</th>
<th>Net Amount</th>
<th>Date</th>
<th>Status</th>   

</tr>
</thead>
<tbody>
<?php

$today=date("Y-m-d");
$sqlCondition = !empty($_GET['uid']) ? " WHERE a.uid= '".$_GET['uid']."' " : '';
$query="select b.uid as uid, b.name as name, a.amount as amount, a.date as date, a.status as status from
    invest_commission a inner join user b on a.uid = b.uid $sqlCondition order by a.date desc";
$pager = new PS_Pagination($connection, $query, 20, 5, $param);
            $pager->setDebug(true);
            $result = $pager->paginate();
            if($result){
                if(!isset($_GET['page'])){ $i=1; }else{ $i=(($_GET['page']-1)*20)+1; }
                while ($row = mysqli_fetch_object($result)){
                    $amount = $row->amount;
                    $tds = $amount * 0.1;
                    $service_tax = $amount * 0.0833;
                    $net_amount = $amount - ($tds+$service_tax);
            ?>
            <tr <?php if($i%2){echo "class='light'";}else{echo "class='dark'";}?> >
              
            
             
    <td><?=$i?></td>
    <td><?=$row->uid?></td>
    <td><?=$row->name?></td>
    <td><?=$amount?></td>
    <td><?=$tds?></td>
    <td><?=$service_tax?></td>
    <td><?=$net_amount?></td>

    <td><?=$row->date?></td>
      <td><?=$row->status? 'Closed':'Not closed'?></td>
</tr>
<?php }
         $i++;   }


?>
    </tbody>
</table>
 <?php echo $pager->renderFullNav();?>
<?php include 'footer.php';?>