MOON
Server: Apache
System: Linux smtp.modiva.org 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64
User: rtbrisc (1005)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/rtbrisc/public_html/admin/main/payment/history.php
<?php include("../general/header.php");  ?>
  <body class="">
    <?php include("../general/navbar.php"); ?>
    <!-- BEGIN CONTENT -->
    <div class="page-container row-fluid">
      <?php include("../general/sidebar.php"); ?>
      <!-- BEGIN PAGE CONTAINER-->
      <div class="page-content">
        <div class="content">
          <!-- BEGIN PAGE TITLE -->
          <?php include("../general/customer_name.php"); ?>
          <!-- END PAGE TITLE -->
          <ul class="breadcrumb">
            <li>
              <p>MY PAYMENT HISTORY</p>
            </li>
            <li><a href="../payment" class="active">PAYMENT</a> </li>
            <li><a href="../dashboard" class="active">DASHBOARD</a> </li>
          </ul>
          <!-- BEGIN PlACE PAGE CONTENT HERE -->
          <div class="row">
            <div class="col-md-12 col-vlg-12 col-sm-12">
              <div class="tiles m-b-10">
                <div class="tiles-body">

                  <input type="text" class="form-control" id="mySearch" onkeyup="mySearch()" placeholder="Search Report">
                  <table class="table table-striped table-advance table-hover" id="myTable">
                      <thead>
                          <tr>
                              <th>Payment ID</th>
                              <th>Amount (&#x20A6;)</th>
                              <th>Status</th>
                              <th>Action</th>
                          </tr>
                      </thead>
                      <tbody>
                          <?php
                              require_once("../worker/workers/server/customer.php");
                              require_once("../worker/workers/server/issues.php");
                              require_once("../worker/workers/server/utilities.php");
                              // 
                          $history = mysqli_query($cus, "SELECT * FROM tblpaydata WHERE CustomerID = '$customerID' && PaymentStatus = 'success' ORDER BY DateCreated DESC");
                              while($his_row = mysqli_fetch_assoc($history)){
                          ?>
                                  <tr>
                                      <td><?php echo $his_row['PaymentID']; ?></td>
                                      <td><?php echo $his_row['Amount']; ?></td>
                                      <td><?php echo $his_row['PaymentStatus']; ?></td>
                                      <td>
                                          <a href="#" data-toggle="modal" data-target="#<?php echo $his_row['PaymentID']; ?>" class="btn btn-success">View Details</a>
                                      </td>
                                  </tr>

                                  <!-- Modal -->
                                  <div class="modal fade" id="<?php echo $his_row['PaymentID']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                    <div class="modal-dialog" role="document">
                                      <div class="modal-content">
                                        <div class="modal-header">
                                          <h4 class="modal-title" id="myModalLabel">Payment ID: <?php echo $his_row['PaymentID']; ?></h4>
                                        </div>
                                        <div class="modal-body text-black">
                                          <?php
                                            $paymentID = $his_row['PaymentID'];
                                            $payment_ticket = mysqli_query($iss, "SELECT * FROM tblpaymentticket WHERE TransactionID = '$paymentID'");
                                            $payment_ticket_row = mysqli_fetch_assoc($payment_ticket);
                                            if ($payment_ticket_row) {
                                          ?>
                                              <div class="row">
                                                <div class="col-md-6">
                                                  <h3>Item</h3>
                                                </div>
                                                <div class="col-md-6">
                                                  <h3>Item Price</h3>
                                                </div>
                                              </div>
                                          <?php
                                              $ticket = $payment_ticket_row['TicketID'];
                                              $payment_info = mysqli_query($iss, "SELECT * FROM tblpaymentinfo WHERE TicketID = '$ticket'");
                                              while ($payment_info_row = mysqli_fetch_assoc($payment_info)) {
                                          ?>
                                                <div class="row">
                                                  <div class="col-md-6"><?php echo $payment_info_row['Item']; ?></div>
                                                  <div class="col-md-6"><?php echo $payment_info_row['ItemPrice']; ?></div>
                                                </div>
                                          <?php
                                              }
                                          ?>
                                                <div class="row">
                                                  <div class="col-md-6">Service Charge</div>
                                                  <div class="col-md-6"><?php echo $payment_ticket_row['ServiceCharge']; ?></div>
                                                </div>
                                          <?php
                                                  $total = $payment_ticket_row['ServiceCharge'] + $payment_ticket_row['TotalAmount'];
                                          ?>
                                                  <div class="row">
                                                    <div class="col-md-6">Total</div>
                                                    <div class="col-md-6"><?php echo $total; ?></div>
                                                  </div>
                                          <?php
                                            }else{
                                              echo "This payment is made for Premium Support Plan Subscription";
                                            }
                                          ?>
                                        </div>
                                        <div class="modal-footer">
                                          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                          <button type="button" class="btn btn-primary" onclick="PrintThis('<?php echo $his_row['PaymentID']; ?>')">Print Ticket</button>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                          <?php      
                              }
                          ?>
                      </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
          <!-- END DASHBOARD TILES -->
          <!-- END PLACE PAGE CONTENT HERE -->
        </div>
      </div>
      <!-- END PAGE CONTAINER -->
      <?php include("../general/chat_bar.php"); ?>
    </div>
    <!-- END CONTENT -->
    <?php include("../general/footer.php"); ?>
  <script>
      function mySearch() {
        // Declare variables 
        var input, filter, table, tr, td, i;
        input = document.getElementById("mySearch");
        filter = input.value.toUpperCase();
        table = document.getElementById("myTable");
        tr = table.getElementsByTagName("tr");

        // Loop through all table rows, and hide those who don't match the search query
        for (i = 0; i < tr.length; i++) {
          td = tr[i].getElementsByTagName("td")[0];
          if (td) {
            if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
              tr[i].style.display = "";
            } else {
              tr[i].style.display = "none";
            }
          } 
        }
      }
  </script>
  </body>
</html>