%PDF- %PDF-
Direktori : /home/silvzytp/crm-dub-code/resources/views/backend/modules/emirate/ |
Current File : /home/silvzytp/crm-dub-code/resources/views/backend/modules/emirate/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().'.emirates.store') }}" method="POST"> @csrf <table id="emirate_table" class="table table-borderless mt-3"> <tbody> <tr> <td class="px-0"> <input type="text" name="emirate[1][name]" id="emirate_1_name" class="form-control" placeholder="Enter emirate..." required> </td> <td class="px-0 text-right"> <button type="button" class="btn btn-primary add_emirate" id="add_emirate"><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="emirate[`+row+`][name]" id="emirate_`+row+`_name" class="form-control" placeholder="Enter emirate..." required> </td> <td class="px-0 text-right"> <button type="button" class="btn btn-danger remove_emirate remove_status"><i class="fas fa-minus"></i></button> </td> </tr>`; $('#emirate_table tbody').append(html); } $(document).on('click', '#add_emirate', function () { count++; dynamicAppendField(count); }); $(document).on('click', '.remove_emirate', function () { count--; $(this).closest('tr').remove(); }); </script> @endpush