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/rating/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>SERVICE HISTORY</p>
            </li>
            <li><a href="../helpdesk" class="active">HELPDESK</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>Ticket ID</th>
                              <th>Service Type</th>
                              <th>Status</th>
                              <th>Action</th>
                          </tr>
                      </thead>
                      <tbody>
                          <?php
                              require_once("../worker/workers/server/issues.php");
                              require_once("../worker/workers/server/utilities.php");
                              // 
                          $history = mysqli_query($iss, "SELECT * FROM tblhelpdeskrequest WHERE CustomerID = '$customerID' ORDER BY StatusFlag ASC");
                              while($his_row = mysqli_fetch_assoc($history)){
                          ?>
                                  <tr>
                                      <td><a href="#" data-toggle="modal" data-target="#<?php echo $his_row['TicketID']; ?>"><?php echo $his_row['TicketID']; ?></a></td>
                                      <td>
                                          <?php 
                                              $request = $his_row['RequestID']; 
                                              $req = mysqli_query($utl, "SELECT * FROM tblrequest WHERE RequestID = $request");
                                              $request_row = mysqli_fetch_assoc($req);
                                              echo $request_row['RequestText'];

                                          ?>
                                          </td>
                                      <td>
                                        <?php 
                                          $status = $his_row['StatusFlag']; 
                                          if($status == 0){
                                            echo "Ongoing";
                                          }elseif($status == 1){
                                            echo "Done";
                                          }elseif($status == 2){
                                            echo "Cancelled";
                                          }else{
                                            echo "Unknown";
                                          }
                                        ?>    
                                      </td>
                                      <td>
                                        <?php if($his_row['StatusFlag'] == 0 || $his_row['StatusFlag'] == 1){ ?>
                                          <a href="update.php?tid=<?php echo $his_row['TicketID']; ?>" class="btn btn-warning">View Status</a>
                                        <?php }else{ ?>
                                          <a href="details.php?tid=<?php echo $his_row['TicketID']; ?>" class="btn btn-primary">View Details</a>
                                        <?php } ?>
                                      </td>
                                  </tr>

                                  <!-- Modal -->
                                  <div class="modal fade" id="<?php echo $his_row['TicketID']; ?>" 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">Ticket ID: <?php echo $his_row['TicketID']; ?></h4>
                                        </div>
                                        <div class="modal-body text-black">
                                              <!-- <b>Customer ID:</b> <?php echo $his_row['CustomerID']; ?><br> -->
                                              <h3>Request Information</h3>
                                              <b>Support Plan:</b> 
                                              <?php 
                                              $supportID = $his_row['SupportPlanID'];
                                              $support = mysqli_query($utl, "SELECT * FROM tblsupportplan WHERE SupportPlanID = $supportID");
                                              $support_row = mysqli_fetch_assoc($support);
                                              echo $support_row['SupportPlanText']; 
                                              ?><br>
                                              <b>Request:</b> 
                                              <?php
                                               $requestID = $his_row['RequestID'];
                                               $request = mysqli_query($utl, "SELECT * FROM tblrequest WHERE RequestID = $requestID "); 
                                               $request_row = mysqli_fetch_assoc($request);
                                               echo $request_row['RequestText'];
                                              ?><br>
                                              <b>Request Type:</b> 
                                              <?php
                                               $requestTypeID = $his_row['RequestTypeID'];
                                               $request_type = mysqli_query($utl, "SELECT * FROM tblrequesttype WHERE RequestID = $requestID && RequestTypeID = $requestTypeID"); 
                                               $request_type_row = mysqli_fetch_assoc($request_type);
                                               echo $request_type_row['RequestTypeText'];
                                              ?><br>
                                              <b>Device Type:</b> 
                                              <?php
                                               $deviceType = $his_row['DeviceTypeID'];
                                               $device = mysqli_query($utl, "SELECT * FROM tbldevice WHERE DeviceID = $deviceType "); 
                                               $devicetype_row = mysqli_fetch_assoc($device);
                                               echo $devicetype_row['DeviceText'] . " -" . $his_row['DeviceTypeInfo'];
                                              ?><br>
                                              <b>Device Brand:</b> 
                                              <?php
                                               $deviceBrand = $his_row['DeviceBrandID'];
                                              $device_brand = mysqli_query($utl, "SELECT * FROM tbldevicebrand WHERE DeviceBrandID = $deviceBrand ");
                                               $device_brand_row = mysqli_fetch_assoc($device_brand);
                                               echo $device_brand_row['DeviceBrandText'] . " -" . $his_row['DeviceBrandInfo'];
                                              ?><br>
                                              <b>Device Model:</b> <?php echo $his_row['DeviceModel']; ?><br>
                                              <b>Description:</b> <?php echo $his_row['Description']; ?><br>
                                              <b>Support Time Type:</b> 
                                              <?php 
                                              $supporttimetype = $his_row['SupportTimeType']; 
                                              $time_his = mysqli_query($utl, "SELECT * FROM tblsupporttime WHERE SupportTimeID = '$supporttimetype'");
                                              $time_his_row = mysqli_fetch_assoc($time_his);
                                              echo $time_his_row['SupportTimeType'];
                                              ?><br>
                                              <b>Support Time:</b> <?php echo $his_row['SupportTime']; ?><br>

                                              <h3>Contact Information</h3>
                                              <?php
                                              $tick = $his_row['TicketID'];
                                              $contact = mysqli_query($iss, "SELECT * FROM tblsupportinfo WHERE TicketID = '$tick'");
                                              $contact_row = mysqli_fetch_assoc($contact);
                                              echo "Contact Name: " . $contact_row['SupportName'] . "<br>";
                                              echo "Contact Number: " . $contact_row['SupportNumber'] . "<br>";
                                              echo "Contact Email: " . $contact_row['SupportEmail'] . "<br>";
                                              echo "Contact Location: " . $contact_row['SupportLocation'] . "<br>";
                                              ?>
                                        </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['TicketID']; ?>')">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>