| Current Path : /home2/wtmwscom/www/admin/ |
| Current File : /home2/wtmwscom/www/admin/product_sale_report.php |
<?php
$title= "Invest Report";
include 'header.php';
include_once('lib/ps_pagination.php');
$param = '';
$param .= !empty($_GET['uid']) ? "&uid=".$_GET['uid'] : '';
?>
<h1>Invest 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>Amount</th>
<th>Date</th>
<th>Status</th>
<th>Bill Print</th>
</tr>
</thead>
<tbody>
<?php
$today=date("Y-m-d");
$sqlCondition = !empty($_GET['uid']) ? " WHERE b.login_id= '".$_GET['uid']."' " : '';
$query="select b.uid as uid, b.login_id as login_id, b.name as name, a.rec_id as rec_id, a.pv_amount as pv_amount, a.date as date, a.status as status from
product_sale 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)){
?>
<tr <?php if($i%2){echo "class='light'";}else{echo "class='dark'";}?> >
<td><?=$i?></td>
<td><?=$row->login_id?></td>
<td><?=$row->name?></td>
<td><?=$row->pv_amount?></td>
<td><?=$row->date?></td>
<td><?=$row->status? 'Closed':'Not closed'?></td>
<td><button onclick='window.open("product_sale_done_print.php?id=<?php echo $row->rec_id?>","", "height=800, width=600, location=no, menubar=no, toolbar=no")'>Print</button></td>
</tr>
<?php }
$i++; }
?>
</tbody>
</table>
<?php echo $pager->renderFullNav();?>
<?php include 'footer.php';?>