<style>
    .border-bottom {
        border-bottom: 1px solid #eee;
    }

    .noUi-connect {
        background: #064f86 !important;
        cursor: grab;
    }

    .noUi-horizontal {
        height: 8px !important;
    }

    .noUi-horizontal .noUi-handle {
        width: 14px !important;
        height: 14px !important;
        right: -10px !important;
        top: -4px !important;
        border-radius: 50%;
        cursor: grab;
    }

    .noUi-horizontal .noUi-handle::after,
    .noUi-horizontal .noUi-handle::before {
        display: none !important;
    }

    .loader-container {
        background: rgba(0, 0, 0, 0.7);
        z-index: 9999;
        display: flex;
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        justify-content: center;
        align-items: center;
    }

    .loader {
        border: 16px solid #f3f3f3;
        border-radius: 50%;
        border-top: 16px solid #3498db;
        width: 120px;
        height: 120px;
        -webkit-animation: spin 2s linear infinite;
        /* Safari */
        animation: spin 2s linear infinite;
    }

    .d-none {
        display: none;
    }

    /* Safari */
    @-webkit-keyframes spin {
        0% {
            -webkit-transform: rotate(0deg);
        }

        100% {
            -webkit-transform: rotate(360deg);
        }
    }

    @keyframes spin {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }
</style>
<div class="portlet box primary">
    <div class="portlet-title">
        <div class="caption">
            <i class="livicon" data-name="responsive" data-size="16" data-loop="true" data-c="#fff" data-hc="white"></i>
            Pending Request List
        </div>
    </div>

    <div class="portlet-body table-responsive">

        <form action="{{  URL::to('admin/ebm_verification/pending_list') }}" method="Get" enctype="multipart/form-data">
            @csrf
            <div class="form-group">
                <div class="input-group mb-5">
                    <input type="text" name="email" autocomplete="off" class="form-control" placeholder="Enter Email" value="{{$param['email']}}">
                    <span class="input-group-btn">
                        <button class="btn btn-info m-r-5" type="submit"><span class="glyphicon glyphicon-search"> Search</span></button>
                        <a href="{{  URL::to('admin/ebm_verification/pending_list') }}" class="btn btn-default">
                            <span class="glyphicon glyphicon-repeat"></span>&nbsp;Reset</a>
                    </span>
                </div>
            </div>
        </form>

        <table class="table table-striped table-bordered">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Verification Request Type</th>
                    <th>Changes in Editor / Comment</th>
                    <th>Editor Information</th>
                    <th>Editor Role List</th>
                    <th>Changes in Editor Role / Comment</th>
                    <th>Request Status</th>
                    <th>Added by</th>
                    <th>Date</th>
                    <th>Logs</th>
                    <th width="110">Action</th>
                </tr>
            </thead>
            <tbody>
                @if (count($pending_editors_list) > 0)
                @foreach ($pending_editors_list as $editor)
                <tr>
                    <td>@if(!empty($editor->full_name))
                        {{$editor->full_name}}
                        @else
                        {{$editor->fname.' '.$editor->mname.' '.$editor->lname}}
                        @endif
                    </td>
                    <td>@if(!empty($editor->editor_email))
                        {{$editor->editor_email}}
                        @else
                        {{$editor->email}}
                        @endif
                    </td>
                    <td>@if($editor->verification_comment == "Edit Editor" && $editor->verification_status == "pending")
                        {{"Request to"}} <b>CHANGE Editor Information</b>
                        @elseif($editor->verification_comment == "Delete Editor" && $editor->verification_status == "pending")
                        {{"Request to"}} <b>DELETE Editor</b>
                        @elseif($editor->verification_comment == "Editor Status Active" && $editor->verification_status == "pending")
                        {{"Change Editor Status"}} <b>(Currently BLOCK)</b>
                        @elseif($editor->verification_comment == "Editor Status Block" && $editor->verification_status == "pending")
                        {{"Change Editor Status"}} <b>(Currently ACTIVE)</b>
                        @elseif($editor->ebm_verification_comment == "Add Editor Role" && $editor->ebm_verification_status == "pending")
                        {{"Request to"}} <b>ADD New Editor Role</b>
                        @elseif($editor->ebm_verification_comment == "Delete Editor Role" && $editor->ebm_verification_status == "pending")
                        {{"Request to"}} <b>DELETE Editor Role</b>
                        @elseif($editor->ebm_verification_comment == "Edit Editor Role"&& $editor->ebm_verification_status == "pending")
                        {{"Request to"}} <b>CHANGE Editor Role Information</b>
                        @endif
                    </td>
                    <td class="text-center">
                        @if($editor->verification_comment == "Edit Editor" && $editor->verification_status == "pending")
                        <button class="btn btn-sm btn-info" id="changesButton" data-id="{{$editor->id}}" data-editor-id="{{$editor->editor_id}}" data-editorchanges="{{$editor->editor_changes}}">
                            <i class="fa-solid fa-chart-column hvr-icon"></i> View Changes
                        </button>
                        @elseif($editor->verification_comment == "Delete Editor" && $editor->verification_status == "pending")
                        {{$editor->editor_delete_comment}}
                        @elseif(($editor->verification_comment == "Editor Status Active" || $editor->verification_comment == "Editor Status Block") && $editor->verification_status == "pending")
                        {{$editor->status_change_comment}}
                        @endif
                    </td>
                    <td class="text-center">
                        <button type="button" class="btn btn-md btn-info" data-toggle="modal" data-target="#newRecord{{$editor->id}}">
                            View
                        </button>
                    </td>

                    <td class="text-center">
                        <button class="btn btn-md btn-warning ebmRoleButton" id="ebmRoleButton" data-ebm-id="{{$editor->ebm_verification_id}}" data-ebm-editor-id="{{$editor->ebm_editor_id}}">
                            <i class="fa-solid fa-chart-column hvr-icon"></i> View
                        </button>
                    </td>
                    <!-- Modal Editor Information -->
                    <div class="modal fade" id="newRecord{{$editor->id}}" tabindex="-1" aria-hidden="true">
                        <div class="modal-dialog modal-lg" role="document">
                            <div class="modal-content mb-0">
                                <div class="modal-header">
                                    <h3 class="modal-title fw-bolder" id="affModalTitle">Editor Information</h3>
                                </div>
                                <div class="modal-body py-0">
                                    <div class="row">
                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Profile Pic: </strong>
                                            @if(!empty($editor->editor_profile_pic))
                                            <img src="{{DisplayImage(config('constants.admin.ebm_root_path').'ebm_pic/'.$editor->editor_profile_pic)}}" class="img-responsive thumbnail" style="height: 150px;">
                                            @else
                                            <img src="http://placehold.it/200x200" alt="profile pic" style="height: 150px;">
                                            @endif
                                        </div>
                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>First Name: </strong>{{$editor->editor_fname}}
                                        </div>
                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Middle Name: </strong>{{$editor->editor_mname}}
                                        </div>
                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Last Name: </strong>{{$editor->editor_lname}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Title: </strong> {{$editor->editor_titles}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Salutation: </strong> {{$editor->editor_salutation}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Suffix: </strong> {{$editor->editor_suffix}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>H-Index: </strong> {{$editor->editor_h_index}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Orcid ID: </strong>{{$editor->editor_orcid_id}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Researcher ID: </strong>{{$editor->editor_researcher_id}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Research Gate: </strong>{{$editor->editor_research_gate}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Google Scholar: </strong> {{$editor->editor_google_scholar}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Scopus ID: </strong> {{$editor->editor_scopus_id}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Postal Code: </strong>{{$editor->editor_zip_code}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Phone No: </strong> {{$editor->editor_phone}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Mobile No: </strong> {{$editor->editor_mobile}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Country: </strong> {{$editor->editor_country}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>City: </strong> {{$editor->editor_city}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>State: </strong> {{$editor->editor_state}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Pharmaceutical: </strong>{{$editor->editor_pharmaceutical}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Company: </strong>{{$editor->editor_company}}
                                        </div>

                                        <div class="col-md-4 border-bottom p-t-10 p-b-10">
                                            <strong>Laboratory: </strong> {{$editor->editor_laboratory}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Email: </strong>{{$editor->editor_email}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Fax: </strong> {{$editor->editor_fax}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Alt Email: </strong>{{$editor->editor_alt_email}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Degree: </strong> {{$editor->editor_degree}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Institute: </strong> {{$editor->editor_institute}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>University: </strong>{{$editor->editor_university}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Department: </strong> {{$editor->editor_department}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Library: </strong> {{$editor->editor_library}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Expertise: </strong> {{$editor->editor_expertise}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Address: </strong> {{$editor->editor_address}}
                                        </div>

                                        <div class="col-md-12 border-bottom p-t-10 p-b-10">
                                            <strong>Web Format: </strong> <br> {!!$editor->editor_web_format!!}
                                        </div>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-light" data-dismiss="modal">
                                            Close
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- End Modal Editor Information -->

                    <td class="text-center">
                        @if($editor->ebm_verification_comment == "Edit Editor Role" && $editor->ebm_verification_status == "pending")
                        <button class="btn btn-md btn-warning" id="ebmchangesButton" data-ebm-verification-id="{{$editor->ebm_verification_id}}" data-ebm-id="{{$editor->ebm_id}}" data-ebm-changes="{{$editor->ebm_changes}}">
                            <i class="fa-solid fa-chart-column hvr-icon"></i> View Changes
                        </button>
                        @endif
                    </td>

                    <td>@if($editor->verification_status == "pending" || $editor->ebm_verification_status == "pending")
                        <span class="label label-info m-t-10 d-block m-r-15 m-l-15">{{"Pending"}}</span>
                        @endif
                    </td>
                    <td>
                        @if(($editor->ebm_verification_comment == "Add Editor Role" || $editor->ebm_verification_comment == "Delete Editor Role" || $editor->ebm_verification_comment == "Edit Editor Role") && ($editor->ebm_verification_status == "pending"))
                        {{$editor->ebm_add_user}}
                        @else
                        {{$editor->editor_add_user}}
                        @endif
                    </td>
                    <td>
                        @if(($editor->ebm_verification_comment == "Add Editor Role" || $editor->ebm_verification_comment == "Delete Editor Role" || $editor->ebm_verification_comment == "Edit Editor Role") && ($editor->ebm_verification_status == "pending"))
                        {{gmdate("d-m-Y", $editor->ebm_created_on)}}
                        @else
                        {{date('d-m-Y', strtotime($editor->created_on))}}
                        @endif
                    </td>
                    <td>
                        <form method="POST" action="{{ url('admin/editor_verification') }}" target="_blank">
							@csrf()
							<input type="hidden" name="editorId" value="{{$editor->editor_id}}" />
							<input type="hidden" name="dataType" value="view_logs" />
							<button class="btn btn-sm btn-info" type="submit" name="view_logs">
								View
							</button>
                        </form>
                    </td>
                    <td>
                        @if(($editor->verification_comment == "Edit Editor" || $editor->verification_comment == "Delete Editor" || $editor->verification_comment == "Editor Status Active" || $editor->verification_comment == "Editor Status Block") && ($editor->verification_status == "pending"))
                        <button data-toggle="modal" data-id="{{$editor->id}}" data-editor-id="{{$editor->editor_id}}" data-status="approve" data-type="{{$editor->verification_comment}}" data-editor-changes="{{$editor->editor_changes}}" class="open-verificationModal btn btn-sm btn-primary btn-air-primary text-white mr-2" href="#modalToggle"><i class="livicon" data-name="check" data-c="#fff" data-hc="#fff" data-size="18" data-loop="true" title="Approve"></i></button>
                        <button data-toggle="modal" data-id="{{$editor->id}}" data-editor-id="{{$editor->editor_id}}" data-status="reject" data-type="{{$editor->verification_comment}}" data-editor-changes="{{$editor->editor_changes}}" class="open-verificationModal btn btn-sm btn-danger btn-air-danger text-white" href="#modalToggle"><i class="livicon" data-name="remove" data-c="#fff" data-hc="#fff" data-size="18" data-loop="true" title="Reject"></i></button>
                        @else
                        <button data-toggle="modal" data-ebm-id="{{$editor->ebm_verification_id}}" data-ebm-editor-id="{{$editor->ebm_id}}" data-status="approve" data-ebm-type="{{$editor->ebm_verification_comment}}" data-ebm-changes="{{$editor->ebm_changes}}" class="open-ebmverificationModal btn btn-sm btn-primary btn-air-primary text-white mr-2" href="#ebmmodalToggle" title="Approve"><i class="livicon" data-name="check" data-c="#fff" data-hc="#fff" data-size="18" data-loop="true"></i></button>

                        <button data-toggle="modal" data-ebm-id="{{$editor->ebm_verification_id}}" data-ebm-editor-id="{{$editor->ebm_id}}" data-status="reject" data-ebm-type="{{$editor->ebm_verification_comment}}" data-ebm-changes="{{$editor->ebm_changes}}" class="open-ebmverificationModal btn btn-sm btn-danger btn-air-danger text-white" href="#ebmmodalToggle"><i class="livicon" data-name="remove" data-c="#fff" data-hc="#fff" data-size="18" data-loop="true" title="Reject"></i></button>
                        @endif
                    </td>
                </tr>
                @endforeach
                @else
                <tr>
                    <td colspan="12">
                        <center>Empty</center>
                    </td>
                </tr>
                @endif
            </tbody>
        </table>
        @if (count($pending_editors_list) > 0)
        <center>{{ $pending_editors_list->appends(request()->input())->links() }}</center>
        @endif
    </div>

    <!-- Approve / Reject Modal -->
    <div class="modal fade" id="modalToggle">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header border-bottom">
                    <h5 class="modal-title text-danger" id="modalToggleLabel">Confirmation!</h5>
                </div>
                <form method="POST" action="{{ url('admin/editor_verification') }}">
                @csrf()
					<div class="modal-body">
						<div class="form-group col-md-12">
							<label for="e1" class="control-label">Comment: </label>
							<textarea class="form-control resize_vertical" name="editorcomment" placeholder="" rows="3"></textarea>
							<input type="text" name="verificationId" id="verificationId" value="" hidden />
							<input type="text" name="editorId" id="editorId" value="" hidden />
							<input type="text" name="status" id="status" value="" hidden />
							<input type="text" name="dataType" id="dataType" value="" hidden />
							<input type="text" name="editorChanges" id="editorChanges" value="" hidden />
						</div>
					</div>
					<div class="modal-footer" style="border: 0;">
						<button type="submit" name="check" class="btn btn-primary btn-air-primary text-white" name="submit">YES</button>
						<button id='closeModal' type="button" class="btn btn-light" data-dismiss="modal">NO</button>
					</div>
                </form>
            </div>
        </div>
    </div>
    <!-- End Approve / Reject Modal -->

    <!-- EBM Approve / Reject Modal -->
    <div class="modal fade" id="ebmmodalToggle">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header border-bottom">
                    <h5 class="modal-title text-danger" id="ebmmodalToggleLabel">Confirmation!</h5>
                </div>
                <form method="POST" action="{{ url('admin/editor_verification') }}">
					@csrf()
					<div class="modal-body">
						<div class="form-group col-md-12">
							<label for="e1" class="control-label">Comment: </label>
							<textarea class="form-control resize_vertical" name="ebmcomment" placeholder="" rows="3"></textarea>
							<input type="text" name="ebmverificationId" id="ebmverificationId" value="" hidden />
							<input type="text" name="ebmeditorId" id="ebmeditorId" value="" hidden />
							<input type="text" name="status" id="status" value="" hidden />
							<input type="text" name="dataType" id="dataType" value="" hidden />
							<input type="text" name="ebmChanges" id="ebmChanges" value="" hidden />
						</div>
					</div>
					<div class="modal-footer" style="border: 0;">
						<button type="submit" name="check" class="btn btn-primary btn-air-primary text-white" name="submit">YES</button>
						<button id='closeModal' type="button" class="btn btn-light" data-dismiss="modal">NO</button>
					</div>
                </form>
            </div>
        </div>
    </div>
    <!-- End EBM Approve / Reject Modal -->

    <!-- Editor Changes Modal -->
    <div class="modal fade" id="changesModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content" id="changesBody">
                <!-- the result to be displayed here -->
            </div>
        </div>
    </div>
    <!-- End Editor Changes Modal -->

    <!-- Editor Role Modal -->
    <div class="modal fade" id="editorroleModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content" id="editorroleBody">
                <!-- the result to be displayed here -->
            </div>
        </div>
    </div>
    <!-- End Editor Role Modal -->

    <!-- EBM Changes Modal -->
    <div class="modal fade" id="ebmchangesModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content" id="ebmchangesBody">
                <!-- the result to be displayed here -->
            </div>
        </div>
    </div>
    <!-- End EBM Changes Modal -->

    <!-- Loader -->
    <div class="loader-container" id="loader" style="display: none;">
        <div class="loader">
        </div>
    </div>
    <!-- End Loader -->

    <!-- Approve / Reject Modal -->
    <script>
        $(document).on("click", ".open-verificationModal", function() {
            let verificationId = $(this).data('id');
            let editorId = $(this).data('editor-id');
            let mystatus = $(this).data('status');
            let dataType = $(this).data('type');
            let editorChanges = $(this).data('editor-changes');
            $(".modal-body #verificationId").val(verificationId);
            $(".modal-body #editorId").val(editorId);
            $(".modal-body #status").val(mystatus);
            $(".modal-body #dataType").val(dataType);
            $(".modal-body #editorChanges").val(editorChanges);
        });
    </script>
    <!-- End Approve / Reject Modal -->

    <!-- EBM Approve / Reject Modal -->
    <script>
        $(document).on("click", ".open-ebmverificationModal", function() {
            let ebmverificationId = $(this).data('ebm-id');
            let ebmeditorId = $(this).data('ebm-editor-id');
            let mystatus = $(this).data('status');
            let dataType = $(this).data('ebm-type');
            let ebmChanges = $(this).data('ebm-changes');
            $(".modal-body #ebmverificationId").val(ebmverificationId);
            $(".modal-body #ebmeditorId").val(ebmeditorId);
            $(".modal-body #status").val(mystatus);
            $(".modal-body #dataType").val(dataType);
            $(".modal-body #ebmChanges").val(ebmChanges);
        });
    </script>
    <!-- End EBM Approve / Reject Modal -->

    <!-- Editor Changes Modal -->
    <script>
        $(document).on('click', '#changesButton', function(event) {
            event.preventDefault();
            let verificationId = $(this).data('id');
            let editorId = $(this).data('editor-id');
            let editorChanges = $(this).data('editorchanges');
            let dataType = 'editor_changes_modal';
            let url = '/admin/editor_verification';
            console.log(verificationId, editorId, editorChanges, url);

            $.ajax({
                type: 'POST',
                url: url,
                data: {
                    dataType: dataType,
                    editorChanges: editorChanges,
                    verificationId: verificationId,
                    editorId: editorId
                },
                beforeSend: function() {
                    $("#loader").show();
                },
                success: function(result) {
                    // console.log(result);
                    $("#loader").hide();
                    $('#changesModal').modal("show");
                    $('#changesBody').html(result).show();
                },
            });
        });
    </script>
    <!-- End Editor Changes Modal -->

    <!-- EBM Role Modal -->
    <script>
        $(document).on("click", ".ebmRoleButton", function() {
            let ebmverificationId = $(this).data('ebm-id');
            let editorId = $(this).data('ebm-editor-id');
            let dataType = 'ebm_role_list';
            let url = '/admin/editor_verification';

            $.ajax({
                type: 'POST',
                url: url,
                data: {
                    dataType: dataType,
                    ebmverificationId: ebmverificationId,
                    editorId: editorId
                },
                beforeSend: function() {
                    $("#loader").show();
                },
                success: function(result) {
                    // console.log(result);
                    $("#loader").hide();
                    $('#editorroleModal').modal("show");
                    $('#editorroleBody').html(result).show();
                },
            });
        });
    </script>
    <!-- End EBM Role Modal -->

    <!-- EBM Changes Modal -->
    <script>
        $(document).on('click', '#ebmchangesButton', function(event) {
            event.preventDefault();
            let ebmverificationId = $(this).data('ebm-verification-id');
            let ebmeditorId = $(this).data('ebm-id');
            let ebmChanges = $(this).data('ebm-changes');
            let dataType = 'ebm_changes_modal';
            let url = '/admin/editor_verification';

            $.ajax({
                type: 'POST',
                url: url,
                data: {
                    dataType: dataType,
                    ebmChanges: ebmChanges,
                    ebmverificationId: ebmverificationId,
                    ebmeditorId: ebmeditorId
                },
                beforeSend: function() {
                    $("#loader").show();
                },
                success: function(result) {
                    // console.log(result);
                    $("#loader").hide();
                    $('#ebmchangesModal').modal("show");
                    $('#ebmchangesBody').html(result).show();
                },
            });
        });
    </script>
    <!-- End EBM Changes Modal -->