
@extends('layout.master')

@section('content')



<div class="main-mobile-header doc-mobile-header">
      <a id="menuLink" href="#" class="menu-link"><i class="ri-menu-line"></i></a>
    </div>

   

    



     <div class="main main-app p-3 p-lg-4">
      
        <div class="mb-4">
          <ol class="breadcrumb fs-sm mb-1">
            <li class="breadcrumb-item"><a href="#">Dashboard</a></li>
            <li class="breadcrumb-item active" aria-current="page">Ticket</li>
          </ol>
        </div>

      

      <div class="">
        
        <div class="row">

          <div class="col-lg-8">
            <h2 class="main-title">Ticket Details</h2>
            
          </div>
          <div style="text-align: right;" class="col-lg-4 text-right">
           <!--  <button type="button" class="btn btn-primary">Add Taxmaster</button> -->
            <!-- <a href="/form" class="btn btn-primary">Add Taxmaster</a> -->
            <a class="btn btn-primary" href="javascript:void();" class="addUser" data-bs-toggle="modal" data-bs-target="#addUser" >Update Status</a>
          </div>

        </div>

        <hr class="main-separator">        
    
            
<div class="card card-shadow-apply">
    <div class="card-body">
    <form action="/ticket/update" method="POST" enctype="multipart/form-data">
    @csrf
    <div class="row">
        <div class="col-sm-4">
            <div class="mb-3">
                <label class="form-label">Issue Type</label>
                <span class="required-field">*</span>
                <select class="form-select" name="issue_type">
                    <option value="Bug" {{ $ticket->issue_type === "Bug" ? 'selected' : '' }}>Bug</option>
                    <option value="Feature Request" {{ $ticket->issue_type === "Feature Request" ? 'selected' : '' }}>Feature Request</option>
                    <option value="Other" {{ $ticket->issue_type === "Other" ? 'selected' : '' }}>Other</option>
                </select>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="mb-3">
                <label class="form-label">Module</label>
                <span class="required-field">*</span>
                <select class="form-select" name="module">
                    <option value="Inventory" {{ $ticket->module === "Inventory" ? 'selected' : '' }}>Inventory</option>
                    <option value="Vehicle" {{ $ticket->module === "Vehicle" ? 'selected' : '' }}>Vehicle</option>
                    <!-- Add other options similarly -->
                </select>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="mb-3">
                <label class="form-label">Page Url</label>
                <span class="required-field">*</span>
                <input type="text" name="page_url" class="form-control" value="{{ $ticket->page_url }}" />
            </div>
        </div>
        <div class="col-sm-4">
            <div class="mb-3">
                <label class="form-label">Audio/Video/Screenshot Url</label>
                <input type="text" name="audio_video_url" class="form-control" value="{{ $ticket->audio_video_url }}" />
            </div>
        </div>
        <div class="col-sm-4">
            <div class="mb-3">
                <label class "form-label">Priority</label>
                <span class="required-field">*</span>
                <select class="form-select" name="priority">
                    <option value="High" {{ $ticket->priority === "High" ? 'selected' : '' }}>High</option>
                    <option value="Medium" {{ $ticket->priority === "Medium" ? 'selected' : '' }}>Medium</option>
                    <option value="Low" {{ $ticket->priority === "Low" ? 'selected' : '' }}>Low</option>
                </select>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="mb-3">
                <label class="form-label">Screenshots</label>
                <input type="file" name="screenshots[]" class="form-control" multiple />
            </div>
        </div>
        <div class="col-sm-12">
            <div class="mb-3">
                <label class="form-label">Comments</label>
                <span class="required-field">*</span>
                <textarea name="comment" class="form-control" rows="3">{{ $ticket->comment }}</textarea>
            </div>
        </div>
    </div>
    <!-- <div class="buttons-alignment mt-4">
        <div>
            <button type="submit" class="btn btn-primary submit-button-alignment">Submit</button>
        </div>
    </div> -->
</form>

    </div>
</div>
    



<div class="modal fade" id="addUser" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-md" style="padding: 3rem;">
        <div class="modal-content">
            <div class="modal-header">
                <h1 class="modal-title fs-5" id="exampleModalLabel">
                    Update Status
                </h1>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <form action="{{ route('ticket.status_update') }}" method="POST" enctype="multipart/form-data" id="orm">
                            @csrf
                            <input type="hidden" name="ticket_id" id="ticket_id" value="{{ $ticket->id }}">
                            
                            <div>
                                <div class="row">
                                                                                                            
                                    <div class="col-sm-12">
                                        <div class="mb-3">
                                            <label class="form-label">Status</label>
                                            <select id="status" name="status" class="form-select" data-width="100%">
                                                <option value="Open">Open</option>
                                                <option value="Working">Working</option>
                                                <option value="Closed">Closed</option>
                                            </select>
                                        </div>
                                    </div>
                                    
                                </div>
                                <br />
                                <div class="row" style="margin: 0px 0px;">
                                    <div class="col-sm-7"></div>
                                    <div class="col-sm-5">
                                        <div class="row justify-content-end">
                                            <button type="submit" value="submit" class="btn btn-primary mr-2" style="width: 100px;">Update</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <br />
            </div>
        </div>
    </div>
</div>


        <br><br><br>

        

      </div><!-- container -->

     
    <style>
    tbody tr:hover {background-color: #F5F5F5;}
    .card-example>.card-body::before {
    content: ""
    }
    </style>


<script>
$(document).ready(function() {
   $('#myformm').click(function() {
  
  alert(kk)
      
  });

});

</script>







@endsection

