
<!-- PAGE-INDEX-STARTS -->

<div class="breadcrumbs">
    <div class="breadcrumbs-inner">
        <?php
        if($this->session->flashdata('message')) {
        $message = $this->session->flashdata('message');
        ?>
            <div class="alert alert-<?php echo $message['class']; ?>">
                <button class="close" data-dismiss="alert" type="button">×</button>
                <?php echo $message['message']; ?>
            </div>
        <?php } ?>
        <div class="row m-0">
            <div class="col-sm-4">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><?= $pTitle ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-8">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li><a href="<?= base_url() ?>">Dashboard</a></li>
                            <li><a ><?= $menu ?></a></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- PAGE-INDEX-ENDS -->

<!-- PAGE-CONTENT-STARTS -->

<div class="content">
    <div class="animated fadeIn">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header">
                        <strong class="card-title"><?= $pDescription ?></strong>
                    </div>
                    <div class="card-body">
                        <table id="" class="table table-striped table-bordered dataTable-custom" data-ajax="Service_request/get_all_Service_request">
                            <thead>
                                <tr>
                                    <th>No</th> 
                                    <th>Request code</th>                                   
                                    <th>Customer Name</th>
                                    <th>Vehicle Details</th>
                                    <th>Services</th>
                                    <th>Booking Date</th>
                                    <th>Status</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                            <tbody>
                              
                            </tbody>
                            <tfoot>
                               <tr>
                                    <th>No</th> 
                                    <th>Request code</th>                                   
                                    <th>Customer Name</th>
                                    <th>Vehicle Details</th>
                                    <th>Services</th>
                                    <th>Booking Date</th>
                                    <th>Status</th>
                                    <th>Action</th>
                               </tr>
                     </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- .model -->

            <div id="myModal23" class="modal fade" role="dialog" data-backdrop="static" data-keyboard="false">
      <div class="modal-dialog modal-lg">

        <!-- Modal content-->
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h4 class="modal-title">Request Details</h4>
          </div>
          <div class="modal-body" id="details" >
             
   
          </div>
          <div class="modal-footer">

            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          </div>
        </div>

      </div>
    </div>

        
                            </div>
                        </div>

                    </div>
                </div>
                <!-- .card -->

            </div>
<!-- PAGE-CONTENT-ENDS -->
        
    <script type="text/javascript">        
        function doconfirm(){
        action = confirm("Are you sure to delete permanently?");
        if(action != true) return false;
        }
    </script>
      <script type="text/javascript">
  
     
function viewRequestDetails(request_id,garage_id){ 

    if(request_id=='' || request_id==undefined || request_id=='undefined' || request_id==null || request_id=='null'){
        return true;
    }
    // modalTrigger('Quote Details','');
    // addModalLoader();
    jQuery('[id="myModal23"]').modal('show');
    var resp = post_ajax(base_url+"Service_request/getServiceData",{'request_id':request_id,'view_all':'1'});
    if(resp == '' || resp == undefined || resp == 'undefined' || resp == null || resp == 'null'){
        remModalLoader();
        jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
        return false;
    }
    var quote_data = jQuery.parseJSON(resp).data;
    
console.log(quote_data);
    jQuery.each(quote_data, function (index, value) {
        if(value == '' || value == null || value == undefined || value == 'null' || value == 'undefined'){
            quote_data[index] = ' -- ';
        }
    });
    var html =    '<table id="DataTables_Table_0" class="table table-striped table-bordered dataTable-custom dataTable" data-ajax="Garage_request/get_all_Garage_request" role="grid" aria-describedby="DataTables_Table_0_info">'+
                           '<thead>'+
                            '<tr role="row">'+
                                  '<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Request Code: activate to sort column ascending">Request Code:'+ quote_data[0]['request_code']+'</th>'+
                                  '</tr>'+
                            '</thead>'+
                            '<tbody>'+
                          '<tr role="row" class="odd">'+ 
                             '<td>services</td>'+
                              '<td>'+ quote_data[0]['service_name']+'</td>'+
                              '</tr>'+
                            '</tbody>'+
                        '</table>'+
    '<table id="DataTables_Table_0" class="table table-striped table-bordered dataTable-custom dataTable" data-ajax="Garage_request/get_all_Garage_request" role="grid" aria-describedby="DataTables_Table_0_info">'+
                            '<thead>'+
                                '<tr role="row">'+
                                  '<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Request Code: activate to sort column ascending">Customer</th>'+
                                  // '<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Customer Name: activate to sort column ascending">Vehicle</th>'+
                                '</tr>'+
                            '</thead>'+
                            '<tbody>'+
                            '<tr role="row" class="odd">'+ 
                             '<td>Name</td>'+
                             '<td>'+ quote_data[0]['customer_name']+'</td>'+
                             '</tr>'+
                             '<tr role="row" class="odd">'+ 
                             '<td>Phone No</td>'+
                             '<td>'+ quote_data[0]['phone_no']+'</td>'+
                             '</tr>'+
                             // '<tr role="row" class="odd">'+ 
                             // '<td>Phone No</td>'+
                             // '<td>'+ quote_data[0]['phone_no']+'</td>'+
                             //  '<td>dfhghgfh</td>'+
                             //  '<td>fghgfhgfhgfh</td>'+
                             //  '</tr>'+
                            '</tbody>'+
                            '</table>'+
                             '<table id="DataTables_Table_0" class="table table-striped table-bordered dataTable-custom dataTable" data-ajax="Garage_request/get_all_Garage_request" role="grid" aria-describedby="DataTables_Table_0_info">'+
                           '<thead>'+
                                '<tr role="row">'+
                                  '<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Request Code: activate to sort column ascending">Vehicle</th>'+
                                '</tr>'+
                            '</thead>'+
                            '<tbody>'+
                            '<tr role="row" class="odd">'+ 
                             '<td>Vehicle Name</td>'+
                             '<td>'+ quote_data[0]['vehicle_name']+'</td>'+
                             '</tr>'+
                             '<tr role="row" class="odd">'+ 
                              '<td>Vehicle Modal</td>'+
                              '<td>'+ quote_data[0]['model']+'</td>'+
                             '</tr>'+
                               '<tr role="row" class="odd">'+ 
                              '<td>Vehicle Make</td>'+
                              '<td>'+ quote_data[0]['make']+'</td>'+
                             '</tr>'+
                              '<tr role="row" class="odd">'+ 
                              '<td>Vehicle Year</td>'+
                              '<td>'+ quote_data[0]['year']+'</td>'+
                             '</tr>'+
                              '<tr role="row" class="odd">'+ 
                              '<td>Vehicle Mileage</td>'+
                              '<td>'+ quote_data[0]['mileage']+'</td>'+
                             '</tr>'+
                            '</tbody>'+
                        '</table>'+
                             '<table id="DataTables_Table_0" class="table table-striped table-bordered dataTable-custom dataTable" data-ajax="Garage_request/get_all_Garage_request" role="grid" aria-describedby="DataTables_Table_0_info">'+
                           '<thead>'+
                                '<tr role="row">'+
                                  '<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Request Code: activate to sort column ascending">Other Details</th>'+
                                '</tr>'+
                            '</thead>'+
                            '<tbody>'+
                            '<tr role="row" class="odd">'+ 
                             '<td>Booking Date</td>'+
                             '<td>'+ quote_data[0]['booking_date']+'</td>'+
                             '</tr>'+
                             '<tr role="row" class="odd">'+ 
                              '<td>Requirement</td>'+
                              '<td>'+ quote_data[0]['requirement']+'</td>'+
                             '</tr>'+
                            '</tbody>'+
                        '</table>';


    remModalLoader();
    jQuery('[id="details"]').html(html);

    jQuery('[id="customerProfileImg"]').error(function() {
        jQuery('[id="customerProfileImg"]').attr('src',base_url+'assets/images/no_image.png');
    });
}




    </script>