Guest User

Untitled

a guest
Mar 28th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1.  
  2. class.user.php - where all my public functions are.
  3.  
  4. public function getOrderList() {
  5.  
  6. if ( ! empty( $_SESSION['userSession'] ) ) {
  7.  
  8. $values = array( ":uid" => $_SESSION['userSession'] );
  9. $stmt = $this->conn->prepare("SELECT * FROM tbl_orderlist WHERE CustomerID = :uid");
  10. $stmt->execute($values);
  11. $row = $stmt->fetchAll();
  12.  
  13. // Uncomment this to debug
  14. // echo "<pre>";
  15. // print_r( $row );
  16.  
  17. return $row;
  18. }
  19.  
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. transactionlog.php
  29.  
  30. <div class="container">
  31.  
  32.  
  33.  
  34. <div class="panel panel-default">
  35. <!-- Default panel contents -->
  36. <div class="panel-heading">User Transaction List</div>
  37.  
  38. <!-- Table -->
  39. <table class="table bg-dark">
  40. <thead>
  41. <tr>
  42. <th>Order ID</th>
  43. <th>Type of Service</th>
  44. <th>Template Select</th>
  45. <th>Order Details</th>
  46. <th>Customer Name</th>
  47. <th>Customer Address</th>
  48. <th>Price</th>
  49. <th>Mode of Payment</th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53.  
  54.  
  55.  
  56. <?php
  57. $stmt = $user_home->getOrderList();
  58.  
  59. if($stmt->rowCount()>0){
  60.  
  61. foreach ( $stmt as $row ){
  62.  
  63. ?>
  64. <th scope="row"><?echo $row->orderID ?></th>
  65. <td><?echo $row->TypeofService ?></td>
  66. <td><?echo $row->TemplateSelect ?></td>
  67. <td><?echo $row->OrderDetails ?></td>
  68. <td><?echo $row->CustomerName ?></td>
  69. <td><?echo $row->CustomerAddress ?></td>
  70. <td><?echo $row->Price ?></td>
  71. <td><?echo $row->Delivery ?></td>
  72.  
  73.  
  74. <form method="POST" class="userTransdoConfirm">
  75. <input type="hidden" value="<?echo $row->CustomerName?>" name="id">
  76. </form>
  77. </td> </tr>
  78. <?
  79. }
  80. } ?>
  81.  
  82.  
  83.  
  84.  
  85.  
  86. </div>
Advertisement
Add Comment
Please, Sign In to add comment