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