%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/crm-dub-code/resources/views/backend/modules/location/
Upload File :
Create Path :
Current File : /home/silvzytp/crm-dub-code/resources/views/backend/modules/location/create.blade.php

@extends('layouts.backend')
@section('title', $siteTitle)

@push('styles')
@endpush

@section('content')

    <div class="row">
        <div class="col-12 col-sm-6 mx-auto">
            <div class="card">
                <div class="card-header">
                    <h4 class="mb-0 card-title">{{ $siteTitle }}</h4>
                </div>
                <div class="card-body">
                    <form action="{{ route(routeName().'.locations.store') }}" method="POST">
                        @csrf

                        <table id="location_table" class="table table-borderless mt-3">
                            <tbody>
                                <tr>
                                    <td class="px-0">
                                        <input type="text" name="location[1][name]" id="location_1_name" class="form-control" placeholder="Enter location..." required>
                                    </td>
                                    <td class="px-0 text-right">
                                        <button type="button" class="btn btn-primary add_location" id="add_location"><i class="fas fa-plus"></i></button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>

                        <x-form.selectbox name="status" labelName="Status" error="status" required="required">
                            @foreach (STATUS as $key=>$value)
                            <option value="{{ $key }}">{{ $value }}</option>
                            @endforeach
                        </x-form.selectbox>

                        <div class="text-right">
                            <button type="submit" class="btn btn-sm btn-success">Submit</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection

@push('scripts')
    <script>
        // Dynamic permission field add remove
        var count = 1;
        function dynamicAppendField(row){
            var html = `
                <tr>
                    <td class="px-0">
                        <input type="text" name="location[`+row+`][name]" id="location_`+row+`_name" class="form-control" placeholder="Enter location..." required>
                    </td>
                    <td class="px-0 text-right">
                        <button type="button" class="btn btn-danger remove_location remove_status"><i class="fas fa-minus"></i></button>
                    </td>
                </tr>`;

            $('#location_table tbody').append(html);
        }

        $(document).on('click', '#add_location', function () {
            count++;
            dynamicAppendField(count);
        });

        $(document).on('click', '.remove_location', function () {
            count--;
            $(this).closest('tr').remove();
        });
    </script>
@endpush

Zerion Mini Shell 1.0