File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/demo/Dynast/resources/views/Dashboard/Pages/manageActivity.blade.php
Back
@extends('layouts.dashboardLayout') @section('title', 'Activity') @section('content') <x-content-div heading="Manage Activity"> <x-card-element header="Add Activity Data "> <x-form-element method="POST" enctype="multipart/form-data" id="submitForm" action="javascript:"> <x-input type="hidden" name="id" id="id" value=""></x-input> <x-input type="hidden" name="action" id="action" value="insert"></x-input> <x-input-with-label-element id="image" label="Upload Activity Image" name="image" type="file" accept="image/*" required></x-input-with-label-element> <x-input-with-label-element id="title" label="Activity title" name="title" required></x-input-with-label-element> {{-- <x-select-with-label id="category" name="category" label="Select Category" required="true"> @if ($category) @foreach ($category as $item) <option value="{{$item->category_name}}">{{$item->category_name}}</option> @endforeach @endif </x-select-with-label> --}} <x-text-area-with-label id="content" label="Activity Description" name="description" required></x-text-area-with-label> <x-select-with-label id="blog_status" name="status" label="Select Status" required="true"> <option value="1">Live</option> <option value="0">Disabled</option> </x-select-with-label> <x-form-buttons></x-form-buttons> </x-form-element> </x-card-element> <x-card-element header="Activity Data"> <x-data-table> </x-data-table> </x-card-element> </x-content-div> @endsection @section('script') <script type="text/javascript"> $('#content').summernote({ placeholder: 'ElementText', tabsize: 2, height: 100 }); let site_url = '{{ url('/') }}'; let table = ""; $(function() { table = $('.data-table').DataTable({ processing: true, serverSide: true, "scrollX": true, ajax: { url: "{{ route('activityData') }}", type: 'POST', data: { '_token': '{{ csrf_token() }}' } }, columns: [{ data: "DT_RowIndex", orderable: false, searchable: false, title: "Sr.No." }, { data: 'action', name: 'action', orderable: false, searchable: false, title: 'Action' }, { data: 'image', render: function(data, type, row) { let image = ''; if (data) { image = '<img alt="Image Link" src="' + data + '" class="img-thumbnail">' } return image; }, orderable: false, searchable: false, title: "Activity Image" }, { data: 'title', name: 'title', title: 'Activity Title' }, { data: 'description', name: 'description', title: 'Activity Description' }, ], order: [ [2, "desc"] ] }); }); $(document).on("click", ".edit", function() { let row = $.parseJSON(atob($(this).data("row"))); if (row['id']) { $("#id").val(row['id']); $("#image").attr("required", false); $("#title").val(row['title']); $("#blog_status").val(row['status']); $("#action").val("update"); $("#content").val(row['description']); $('#content').summernote('destroy'); $('#content').summernote({ focus: true }); scrollToDiv(); } else { errorMessage("Something went wrong. Code 101"); } }); function Disable(id) { changeAction(id, "disable", "This item will be disabled!", "Yes, disable it!"); } function Enable(id) { changeAction(id, "enable", "This item will be enabled!", "Yes, enable it!"); } function changeAction(id, action, text, confirmButtonText) { if (id) { Swal.fire({ title: 'Are you sure?', text: text, icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: confirmButtonText }).then((result) => { if (result.isConfirmed) { $.ajax({ type: 'POST', url: '{{ route('saveActivity') }}', data: { id: id, action: action, '_token': '{{ csrf_token() }}' }, success: function(response) { if (response.status) { successMessage(response.message, true); table.ajax.reload(); } else { errorMessage(response.message); } }, failure: function(response) { errorMessage(response.message); } }); } }); } else { errorMessage("Something went wrong. Code 102"); } } $(document).ready(function() { $("#submitForm").on("submit", function() { var form = new FormData(this); $.ajax({ type: 'POST', url: '{{ route('saveActivity') }}', data: form, cache: false, contentType: false, processData: false, success: function(response) { if (response.status) { successMessage(response.message, "reload"); } else { errorMessage(response.message); } }, failure: function(response) { errorMessage(response.message); } }); }); }); </script> @include('Dashboard.include.dataTablesScript') @endsection
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings