Your IP : 216.73.216.26


Current Path : /home2/wtmwscom/public_html/member/
Upload File :
Current File : /home2/wtmwscom/public_html/member/report_invest_growth.php

<?php
$title= "Invest Report";
include 'header.php';
include_once('lib/ps_pagination.php');
$uid = $_SESSION['userid'];
$product_sale_id = $_GET['id'];
$total = 0;
?>
    <h1>My Invest Growth</h1>
    <?php echo getMessage();?>
    <section>
        <table style="width: 100%;">
          <thead>
            <tr>
              <th>S. No.</th>
              <th>Invest Amount</th>
              <th>Growth Amount</th>
              <th>Date</th>
            </tr>
          </thead>
          <?php
          $query = "SELECT t2.pv_amount AS pv_amount , t1.amount AS amount, t1.datetime AS datetime FROM invest_growth AS t1 LEFT JOIN product_sale AS t2 ON t1.product_sale_id = t2.rec_id WHERE t2.`rec_id`='".$product_sale_id."' ORDER BY t1.`datetime` DESC";
            $invest_row = mysqli_fetch_object(mysqli_query($connection, $query));
            
            //$query = "SELECT id, uid, amount, datetime, status FROM invest_growth WHERE `product_sale_id`='".$product_sale_id."' ORDER BY `datetime` ASC";
            $pager = new PS_Pagination($link, $query, 200, 5 );
            $pager->setDebug(true);
            $result = $pager->paginate();
            if($result){
          ?>
          <tbody>
            <?php
                if(!isset($_GET['page'])){ $i=1; }else{ $i=(($_GET['page']-1)*200)+1; }
                while ($row = mysqli_fetch_object($result)){
                    $total = $total+$row->amount;
            ?>
            <tr <?php if($i%2){echo "class='light'";}else{echo "class='dark'";}?>>
              <td><?php echo $i;?></td>
              <td><?php echo $row->pv_amount;?></td>
              <td><?php echo $row->amount;?></td>
              <td><?php echo date("d M, Y", strtotime($row->datetime));?></td>
            </tr>
            <?php $i++;}?>
          </tbody>
          <thead>
            <tr>
                <th colspan="2" style="text-align: right;">Total Amount:</th>
              <th colspan="2" style="text-align: left;"><?php echo $total?></th>
            </tr>
          </thead>
          <?php }?>
        </table>
            <?php echo $pager->renderFullNav();?>
      </section>
<?php include 'footer.php';?>