/home/kueuepay/public_html/resources/views/admin/sections/contact-request/index.blade.php
@extends('admin.layouts.master')

@push('css')
@endpush

@section('page-title')
    @include('admin.components.page-title', ['title' => __($page_title)])
@endsection

@section('breadcrumb')
    @include('admin.components.breadcrumb', [
        'breadcrumbs' => [
            [
                'name' => __('Dashboard'),
                'url' => setRoute('admin.dashboard'),
            ],
        ],
        'active' => __('Contact Messages'),
    ])
@endsection
@section('content')
    <div class="table-area">
        <div class="table-wrapper">
            <form method="POST" action="{{ setRoute('admin.contact.messages.delete.all') }}">
                @csrf
                <div class="table-header">
                    <h5 class="title">{{ __($page_title) }}  <span class="badge badge--success">{{ $contact_requests->total() }}</span> </h5>
                    <div class="d-flex gap-2">
                        <button type="submit" class="btn--base bg--danger mark-delete-btn">{{ __("Mark Delete") }}</button>
                        <a href="{{ setRoute('admin.contact.messages.export') }}" class="btn--base bg--success">{{ __("Export (Excel)") }}</a>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="custom-table">
                        <thead>
                            <tr>
                                <th>
                                    <input type="checkbox" class="form--control mark-all-checkbox" data-parent=".mark-all-parent" data-child=".mark-all-child">
                                </th>
                                <th></th>
                                <th>{{ __("Name") }}</th>
                                <th>{{ __("Email") }}</th>
                                <th>{{ __("Reply") }}</th>
                                <th>{{ __("Created At") }}</th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody class="mark-all-parent">
                            @forelse ($contact_requests ?? [] as $key => $item)
                                <tr data-item="{{ json_encode($item->only(['id','message','name','email','created_at'])) }}">
                                    <td>
                                        <input type="checkbox" value="{{ $item->id }}" name="mark[]" class="form--control mark-all-child">
                                    </td>
                                    <td>{{ $key + $contact_requests->firstItem() }}</td>
                                    <td>{{ $item->name ?? '' }}</td>
                                    <td>{{ $item->email ?? '' }}</td>
                                    <td>
                                        @if ($item->reply == true)
                                            <span class="badge badge--success">{{ __("Replyed") }}</span>
                                        @else
                                            <span class="badge badge--warning">{{ __("Not Replyed") }}</span>
                                        @endif
                                    </td>
                                    <td>{{ $item->created_at->format("d-m-Y H:i:s") }}</td>
                                    <td>
                                        @include('admin.components.link.custom',[
                                            'href'          => "#send-reply",
                                            'class'         => "btn btn--base reply-button modal-btn",
                                            'icon'          => "las la-envelope-open-text",
                                            'permission'    => "admin.contact.messages.reply",
                                        ])
                                        @include('admin.components.link.custom',[
                                            'href'          => "#details",
                                            'class'         => "btn btn--base details-button modal-btn",
                                            'icon'          => "las la-info-circle",
                                            'permission'    => "admin.contact.messages.index",
                                        ])
                                        @include('admin.components.link.custom',[
                                            'href'          => "javascript:void(0)",
                                            'class'         => "btn btn--base bg--danger delete-button",
                                            'icon'          => "las la-trash",
                                            'permission'    => "admin.contact.messages.delete",
                                        ])
                                    </td>
                                </tr>
                            @empty
                                @include('admin.components.alerts.empty',['colspan' => 7])
                            @endforelse
                        </tbody>
                    </table>

                </div>
            </form>
        </div>
        {{ get_paginate($contact_requests) }}
    </div>

    {{-- Send Mail Modal --}}
    @if (admin_permission_by_name("admin.contact.messages.reply"))
        <div id="send-reply" class="mfp-hide large">
            <div class="modal-data">
                <div class="modal-header px-0">
                    <h5 class="modal-title">{{ __("Send Reply") }}</h5>
                </div>
                <div class="modal-form-data">
                    <form class="modal-form" action="{{ setRoute('admin.contact.messages.reply') }}" method="POST">
                        @csrf
                        <input type="hidden" name="target" value="{{ old('target') }}">
                        <div class="row mb-10-none">
                            <div class="col-xl-12 col-lg-12 form-group">
                                @include('admin.components.form.input',[
                                    'label'         => __("Subject"),
                                    'label_after'   => "*",
                                    'name'          => "subject",
                                    'data_limit'    => 150,
                                    'placeholder'   => __("Write Here").'...',
                                    'value'         => old('subject'),
                                ])
                            </div>
                            <div class="col-xl-12 col-lg-12 form-group">
                                @include('admin.components.form.input-text-rich',[
                                    'label'         => __("Details"),
                                    'label_after'   => "*",
                                    'name'          => "message",
                                    'value'         => old('message'),
                                ])
                            </div>
                            <div class="col-xl-12 col-lg-12 form-group">
                                @include('admin.components.button.form-btn',[
                                    'class'         => "w-100 btn-loading",
                                    'type'          => "submit",
                                    'text'          => __("Send Email"),
                                ])
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    @endif


     {{-- Message Detials Modal --}}
     @if (admin_permission_by_name("admin.contact.messages.index"))
     <div id="details" class="mfp-hide large">
         <div class="modal-data">
             <div class="modal-header px-0">
                 <h5 class="modal-title">{{ __("Contact Message") }}</h5>
             </div>
             <div class="modal-body">

                 {{-- data will be place from javascript --}}

             </div>
         </div>
     </div>
 @endif

@endsection

@push('script')
    <script>
        openModalWhenError("send-reply","#send-reply");

        $(".reply-button").click(function(){
            var oldData = JSON.parse($(this).parents("tr").attr("data-item"));
            $("#send-reply").find("input[name=target]").val(oldData.id);
        });

        $(".details-button").click(function(){
            let message = JSON.parse($(this).parents("tr").attr("data-item"));

            let htmlMarkup = `
            <div class = "user-info">
                <ul class = "border-bottom pb-3">
                    <li>
                        <strong>Name: </strong> <span>${message.name}</span>
                    </li>
                    <li>
                        <strong>Email: </strong> <span>${message.email}</span>
                    </li>
                    <li>
                        <strong>Send At: </strong> <span>${message.created_at}</span>
                    </li>
                </ul>
            </div>

            <div class="message">

                <h4 class="mt-3">Message</h4>

                <p>
                    ${message.message}
                </p>
            </div>

            `;
            $("#details").find(".modal-body").html(htmlMarkup);
        });

        $(".delete-button").click(function() {
            var oldData = JSON.parse($(this).parents("tr").attr("data-item"));

            var actionRoute =  "{{ setRoute('admin.contact.messages.delete') }}";
            var target      = oldData.id;
            var message     = `{{ __("Are you sure to delete this message?") }}`;

            openDeleteModal(actionRoute,target,message);
        });
        function openDeleteModal(URL,target,message,actionBtnText = "{{ __('Remove') }}",method = "DELETE"){
            if(URL == "" || target == "") {
                return false;
            }

            if(message == "") {
                message = "{{ __('Are you sure to delete ?') }}";
            }
            var method = `<input type="hidden" name="_method" value="${method}">`;
            openModalByContent(
                {
                    content: `<div class="card modal-alert border-0">
                                <div class="card-body">
                                    <form method="POST" action="${URL}">
                                        <input type="hidden" name="_token" value="${laravelCsrf()}">
                                        ${method}
                                        <div class="head mb-3">
                                            ${message}
                                            <input type="hidden" name="target" value="${target}">
                                        </div>
                                        <div class="foot d-flex align-items-center justify-content-between">
                                            <button type="button" class="modal-close btn btn--info">{{ __("Close") }}</button>
                                            <button type="submit" class="alert-submit-btn btn btn--danger btn-loading">${actionBtnText}</button>
                                        </div>
                                    </form>
                                </div>
                            </div>`,
                },

            );
            }
        $(".mark-all-checkbox").change(function() {

            let parentEl = $($(this).attr("data-parent"));
            let childEl = $(parentEl).find($(this).attr("data-child"));

            if($(this).is(":checked")) {
                $.each(childEl, function(index, item) {
                    $(item).prop("checked", true);
                });
            }else {
                $.each(childEl, function(index, item) {
                    $(item).prop("checked", false);
                });
            }
        });
    </script>
@endpush
FAQ

FAQ

1. What is the Kueue Pay Payment Gateway?

The Kueue Pay Payment Gateway is an innovative technology that facilitates seamless and secure transactions between merchants and their customers. It enables businesses to accept debit and credit card payments both online and in physical stores.

2. How does the Kueue Pay Payment Gateway work?

The Kueue Pay Payment Gateway acts as a bridge between a merchant’s website or point-of-sale system and the payment processing network. It securely transmits payment information, authorizes transactions, and provides real-time status updates.

3. What is the advantage of using Kueue Pay’s Developer API?

The Kueue Pay Developer API empowers developers and entrepreneurs to integrate the Kueue Pay Payment Gateway directly into their websites or applications. This streamlines the payment process for customers and provides businesses with a customizable and efficient payment solution.

4. How can I access the Kueue Pay Developer API?

To access the Kueue Pay Developer API, you need to sign up for a developer account on our platform. Once registered, you’ll receive an API key that you can use to authenticate your API requests.

5. What types of transactions can I handle with the Kueue Pay Developer API?

The Kueue Pay Developer API allows you to initiate payments, check the status of payments, and process refunds. You can create a seamless payment experience for your customers while maintaining control over transaction management.

6. Is the Kueue Pay Developer API suitable for my business size and industry?

Yes, the Kueue Pay Developer API is designed to accommodate businesses of varying sizes and industries. Whether you’re a small online store or a large enterprise, our API can be tailored to fit your specific payment needs.

7. How user-friendly is the Kueue Pay Developer API integration process?

The Kueue Pay Developer API is designed with simplicity and ease of use in mind. Our comprehensive documentation, code samples, and developer support resources ensure a smooth integration process for any web platform.

8. Are there any fees associated with using the Kueue Pay Payment Gateway and API?

We offer competitive pricing plans for using the Kueue Pay Payment Gateway and Developer API. Details about fees and pricing tiers can be found on our developer portal.

9. Can I customize the payment experience for my customers using the Kueue Pay API?

Absolutely, the Kueue Pay Developer API offers customization options that allow you to tailor the payment experience to match your brand and user interface. You can create a seamless and cohesive payment journey for your customers.

10. What kind of support is available if I encounter issues during API integration?

We provide dedicated developer support to assist you with any issues or questions you may have during the API integration process. Reach out to our support team at developersupport@NFCPay.com for prompt assistance.

Remember, our goal is to empower your business with a robust and efficient payment solution. If you have any additional questions or concerns, feel free to explore our developer portal or contact our support team.