D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
probwael
/
www
/
Filename :
order_list.php
back
Copy
<?php $page_name="dashboard"; $start=$_GET['start'];// if(!($start > 0)) { $start = 0; } $eu = ($start - 0); $limit = 25; // No of records to be shown per page. $thi = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; $dstatus=$conn->real_escape_string(htmlentities($_GET['dstatus'],ENT_QUOTES)); $query= "SELECT * FROM _dcart WHERE cmail='$em' and status like '%$dstatus%' group by transid ORDER BY id DESC limit $eu, $limit"; $result = mysqli_query($conn,$query); echo '<div class="table-responsive">'; echo '<table class="table table-responsive table-striped table-bordered table-hover no-margin" width=100%>'; if ($result->num_rows != 0) { echo' <thead> <tr> <th width="10%">--</th> <th width="25%">Date Ordered</th> <th width="25%">Transaction ID</th> <th width="20%">Total Bill</th> <th width="20%">Status</th> </tr> </thead>'; echo'<tbody>'; while($row = $result->fetch_assoc()){ ///get total bill $qid=$row['id']; $tid=$row['transid']; $jcart = mysqli_query($conn, "SELECT tprice FROM _dcart where transid='$tid'") or die(mysqli_error($conn)); while($jrow = $jcart->fetch_assoc()) { $jprice=$jrow['tprice']; $jtprice=$jtprice+$jprice; } //-------- echo '<script language="javascript"> function myFunction'.$qid.'() { document.getElementById("myDropdown'.$qid.'").classList.toggle("show"); } // Close the dropdown menu if the user clicks outside of it window.onclick = function(event) { if (!event.target.matches(".dropbtn")) { var dropdowns = document.getElementsByClassName("dropdown-content"); var i; for (i = 0; i < dropdowns.length; i++) { var openDropdown = dropdowns[i]; if (openDropdown.classList.contains("show")) { openDropdown.classList.remove("show"); } } } } </script>'; echo' <tr>'; echo'<td width="10%" align="center">'; echo '<a href=view_shopping_details?transid=' . $row["transid"] . '>'.'[Details]'.'</a>'; echo'</td>'; echo'<td width="25%">'.$row['dtime'].'</td> '; echo'<td width="25%">'.$row['transid'].'</td> '; echo'<td width="20%">'.$currency.number_format($jtprice, 2,'.',',').'</td>'; echo'<td width="20%">'.$row['status'].'</td>'; echo'</tr>'; //re-initialize total price $jtprice=0; } } else{ echo '<hr><span style="font-size: 1.2em; font-weight: 600; color: #3782b9">No '.$dstatus.' transaction history to display!</span>'; } echo'</tbody> </table> <!-- /.table-responsive -->'; echo '</div>'; ?> <div class="box-footer no-padding"> <div class="mailbox-controls"> <div align="center"> <div class="btn-group" style="margin-bottom:4px;"> <hr> <b> <?php echo "<a href='$page_name?start=$back&dstatus=$dstatus' title='Previous' class='btn'> « </a>"; ?> <?php echo "<a href='$page_name?start=$next&dstatus=$dstatus' title='Next' class='btn'> » </a>"; ?> </b> </div><!-- /.btn-group --> </div><!-- /.pull-right --> </div> </div>