Compare commits

...

1 Commits
main ... v.1.01

Author SHA1 Message Date
abdurahman
9250b863f7 added a way to add an image from a smartphone camera 2023-12-24 10:42:21 +05:00
6 changed files with 1318 additions and 596 deletions

View File

@ -115,6 +115,7 @@ return [
'file_size_limit_help' => 'Enter file size limit in MB', 'file_size_limit_help' => 'Enter file size limit in MB',
'allowed_file' => 'Allowed File Type', 'allowed_file' => 'Allowed File Type',
'specify_file_type' => 'Specify allowed types', 'specify_file_type' => 'Specify allowed types',
'image_file_type' => 'Camera + file',
'all_types' => 'All types', 'all_types' => 'All types',
'add_file_type' => 'Add file types', 'add_file_type' => 'Add file types',
'add_file_type_help_text' => 'Comma separated string of file types.Ex: .jpg, .png, .jpeg', 'add_file_type_help_text' => 'Comma separated string of file types.Ex: .jpg, .png, .jpeg',

View File

@ -115,6 +115,7 @@ return [
'file_size_limit_help' => 'Sisestage faili suuruse piirang megabaitides', 'file_size_limit_help' => 'Sisestage faili suuruse piirang megabaitides',
'allowed_file' => 'Lubatud failitüüp', 'allowed_file' => 'Lubatud failitüüp',
'specify_file_type' => 'Määrake lubatud tüübid', 'specify_file_type' => 'Määrake lubatud tüübid',
'image_file_type' => 'Camera + file',
'all_types' => 'Kõik tüübid', 'all_types' => 'Kõik tüübid',
'add_file_type' => 'Lisa failitüüpe', 'add_file_type' => 'Lisa failitüüpe',
'add_file_type_help_text' => 'Failitüüpide komaga eraldatud string. Näiteks: .jpg, .png, .jpeg', 'add_file_type_help_text' => 'Failitüüpide komaga eraldatud string. Näiteks: .jpg, .png, .jpeg',

View File

@ -115,6 +115,7 @@ return [
'file_size_limit_help' => 'Введите ограничение размера файла в МБ', 'file_size_limit_help' => 'Введите ограничение размера файла в МБ',
'allowed_file' => 'Допустимый тип файла', 'allowed_file' => 'Допустимый тип файла',
'specify_file_type' => 'Укажите разрешенные типы', 'specify_file_type' => 'Укажите разрешенные типы',
'image_file_type' => 'Camera + file',
'all_types' => 'Все типы', 'all_types' => 'Все типы',
'add_file_type' => 'Добавить типы файлов', 'add_file_type' => 'Добавить типы файлов',
'add_file_type_help_text' => 'Строка с разделенными запятыми типами файлов. Например, .jpg, .png, .jpeg', 'add_file_type_help_text' => 'Строка с разделенными запятыми типами файлов. Например, .jpg, .png, .jpeg',

2
package-lock.json generated
View File

@ -1,5 +1,5 @@
{ {
"name": "uniquesoft.es", "name": "Aknaproff1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {

File diff suppressed because it is too large Load Diff

View File

@ -3,52 +3,56 @@
$form = !empty($form) ? $form : ''; $form = !empty($form) ? $form : '';
@endphp @endphp
<!-- reCaptcha --> <!-- reCaptcha -->
<script src="//www.google.com/recaptcha/api.js?v={{$asset_version}}" async defer></script> <script src="//www.google.com/recaptcha/api.js?v={{ $asset_version }}" async defer></script>
<script type="text/javascript"> <script type="text/javascript">
if (typeof jQuery == 'undefined') { if (typeof jQuery == 'undefined') {
document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{$asset_version}}"></' + 'script>'); document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{ $asset_version }}"></' + 'script>');
} }
</script> </script>
<!-- Bootstrap Js --> <!-- Bootstrap Js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js?v={{$asset_version}}"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js?v={{ $asset_version }}"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js?v={{$asset_version}}"></script> <script src="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js?v={{ $asset_version }}"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js?v={{$asset_version}}"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js?v={{ $asset_version }}"></script>
<script src="//cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.js?v={{$asset_version}}"></script> <script src="//cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.js?v={{ $asset_version }}"></script>
<script src="//cdn.jsdelivr.net/npm/jquery-validation@1.17.0/dist/jquery.validate.min.js?v={{$asset_version}}"></script> <script src="//cdn.jsdelivr.net/npm/jquery-validation@1.17.0/dist/jquery.validate.min.js?v={{ $asset_version }}">
</script>
<script type="text/javascript" <script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.js?v={{$asset_version}}"></script> src="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.js?v={{ $asset_version }}"></script>
<script type="text/javascript" <script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/js/tempusdominus-bootstrap-4.min.js?v={{$asset_version}}"></script> src="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/js/tempusdominus-bootstrap-4.min.js?v={{ $asset_version }}">
</script>
<script type="text/javascript" <script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.js?v={{$asset_version}}"></script> src="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.js?v={{ $asset_version }}"></script>
<script type="text/javascript" <script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/js/bootstrap-select.min.js?v={{$asset_version}}"></script> src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/js/bootstrap-select.min.js?v={{ $asset_version }}">
</script>
<script type="text/javascript" <script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.min.js?v={{$asset_version}}"></script> src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.min.js?v={{ $asset_version }}"></script>
<!-- Boostrap star rating --> <!-- Boostrap star rating -->
<script <script
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/star-rating.min.js?v={{$asset_version}}" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/star-rating.min.js?v={{ $asset_version }}"
type="text/javascript"></script> type="text/javascript"></script>
<!-- if you need to use a theme, then include the theme Js file --> <!-- if you need to use a theme, then include the theme Js file -->
<script <script
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.js?v={{$asset_version}}"></script> src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.js?v={{ $asset_version }}">
</script>
<!-- optionally if you need translation for your language then include locale file as mentioned below --> <!-- optionally if you need translation for your language then include locale file as mentioned below -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/locales/<lang>.js"></script> --> <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/locales/<lang>.js"></script> -->
<!-- signature pad (https://github.com/szimek/signature_pad)--> <!-- signature pad (https://github.com/szimek/signature_pad)-->
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js?v={{$asset_version}}"></script> <script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js?v={{ $asset_version }}">
</script>
<script src="{{asset('/plugins/countdowntimer/countdowntimer.min.js').'?v='.$asset_version}}"></script> <script src="{{ asset('/plugins/countdowntimer/countdowntimer.min.js') . '?v=' . $asset_version }}"></script>
@if(!$is_download)
@if (!$is_download)
<!-- app js values --> <!-- app js values -->
<script type="application/javascript"> <script type="application/javascript">
var APP = {}; var APP = {};
@ -91,33 +95,35 @@
</script> </script>
<script <script
src="//cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@3.2.10/dist/jquery.validate.unobtrusive.min.js?v={{$asset_version}}"></script> src="//cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@3.2.10/dist/jquery.validate.unobtrusive.min.js?v={{ $asset_version }}">
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11?v={{$asset_version}}"></script> </script>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11?v={{ $asset_version }}"></script>
{{-- <script src="/js/sweetalert2.all.js"></script> --}}
<script type="text/javascript" <script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js?v={{$asset_version}}"></script> src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js?v={{ $asset_version }}"></script>
<script type="text/javascript" <script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js?v={{$asset_version}}"></script> src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js?v={{ $asset_version }}"></script>
<script type="text/javascript" <script type="text/javascript"
src="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.js?v={{$asset_version}}"></script> src="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.js?v={{ $asset_version }}">
</script>
<!-- ladda.js --> <!-- ladda.js -->
<script type="text/javascript" <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/spin.min.js?v={{ $asset_version }}">
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/spin.min.js?v={{$asset_version}}"></script> </script>
<script type="text/javascript" <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda.min.js?v={{ $asset_version }}">
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda.min.js?v={{$asset_version}}"></script> </script>
<!-- localization --> <!-- localization -->
<script src="{{ url('/js/lang.js') . '?v=' . $asset_version }}"></script> <script src="{{ url('/js/lang.js') . '?v=' . $asset_version }}"></script>
<script src="{{ asset(mix('js/app.js')) }}" defer></script> <script src="{{ asset(mix('js/app.js')) }}" defer></script>
<!-- intro.js --> <!-- intro.js -->
<script type="text/javascript" <script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/intro.min.js?v={{$asset_version}}"></script> src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/intro.min.js?v={{ $asset_version }}"></script>
<script src="{{ asset('js/iframeResizercontentWindow.js') }}"></script> <script src="{{ asset('js/iframeResizercontentWindow.js') }}"></script>
@endif @endif
<script type="text/javascript"> <script type="text/javascript">
jQuery.validator.setDefaults({ jQuery.validator.setDefaults({
errorPlacement: function (error, element) { errorPlacement: function(error, element) {
if (element.hasClass('select2') && element.parent().hasClass('input-group')) { if (element.hasClass('select2') && element.parent().hasClass('input-group')) {
error.insertAfter(element.parent()); error.insertAfter(element.parent());
} else if (element.hasClass('select2')) { } else if (element.hasClass('select2')) {
@ -140,57 +146,61 @@
error.insertAfter(element); error.insertAfter(element);
} }
}, },
invalidHandler: function () { invalidHandler: function() {
toastr.error("{{ __('messages.some_error_in_input_field') }}"); toastr.error("{{ __('messages.some_error_in_input_field') }}");
} }
}); });
$(document).ready(function () { $(document).ready(function() {
@if(!$is_download) @if (!$is_download)
jQuery.extend($.fn.dataTable.defaults, { jQuery.extend($.fn.dataTable.defaults, {
fixedHeader: false, fixedHeader: false,
aLengthMenu: [ aLengthMenu: [
[25, 50, 100, 200, 500, 1000, -1], [25, 50, 100, 200, 500, 1000, "{{__('messages.all')}}"] [25, 50, 100, 200, 500, 1000, -1],
], [25, 50, 100, 200, 500, 1000, "{{ __('messages.all') }}"]
iDisplayLength: 25, ],
dom: 'lfrtip', iDisplayLength: 25,
"language": { dom: 'lfrtip',
"emptyTable": "{{__('messages.emptyTable')}}", "language": {
"info": "{{__('messages.dt_info')}}", "emptyTable": "{{ __('messages.emptyTable') }}",
"infoEmpty": "{{__('messages.infoEmpty')}}", "info": "{{ __('messages.dt_info') }}",
"infoFiltered": "{{__('messages.infoFiltered')}}", "infoEmpty": "{{ __('messages.infoEmpty') }}",
"lengthMenu": "{{__('messages.lengthMenu')}}", "infoFiltered": "{{ __('messages.infoFiltered') }}",
"loadingRecords": "{{__('messages.loadingRecords')}}", "lengthMenu": "{{ __('messages.lengthMenu') }}",
"processing": "{{__('messages.processing')}}", "loadingRecords": "{{ __('messages.loadingRecords') }}",
"search": "{{__('messages.search')}}", "processing": "{{ __('messages.processing') }}",
"zeroRecords": "{{__('messages.zeroRecords')}}", "search": "{{ __('messages.search') }}",
"paginate": { "zeroRecords": "{{ __('messages.zeroRecords') }}",
"first": "{{__('messages.first')}}", "paginate": {
"last": "{{__('messages.last')}}", "first": "{{ __('messages.first') }}",
"next": "{{__('messages.next')}}", "last": "{{ __('messages.last') }}",
"previous": "{{__('messages.previous')}}" "next": "{{ __('messages.next') }}",
}, "previous": "{{ __('messages.previous') }}"
buttons: { },
copyTitle: "{{__('messages.copy_to_clipboard')}}", buttons: {
copySuccess: { copyTitle: "{{ __('messages.copy_to_clipboard') }}",
_: "{{__('messages.copied_n_rows_to_clipboard')}}" copySuccess: {
_: "{{ __('messages.copied_n_rows_to_clipboard') }}"
}
} }
} }
} });
});
$.ajaxSetup({ $.ajaxSetup({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')} headers: {
}); 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
@endif @endif
$('button[type=reset]').on('click', function () { $('button[type=reset]').on('click', function() {
$(this).parents('form').find('input').val(''); $(this).parents('form').find('input').val('');
window.location.href = $(this).parents('form').attr('action'); window.location.href = $(this).parents('form').attr('action');
}); });
}); });
function initialize_datetimepicker(element_name, element_date, start_date, end_date, date_format, time_format, disabled_days, enable_time_picker, time_picker_inline) { function initialize_datetimepicker(element_name, element_date, start_date, end_date, date_format, time_format,
disabled_days, enable_time_picker, time_picker_inline) {
var start = null; var start = null;
var end = null; var end = null;
var format = ''; var format = '';
@ -254,10 +264,9 @@
$('#' + element_name).rangeslider({ $('#' + element_name).rangeslider({
polyfill: false, polyfill: false,
//Callback function //Callback function
onInit: function () { onInit: function() {},
},
// Callback function // Callback function
onSlide: function (position, value) { onSlide: function(position, value) {
$('.' + element_name).text(value); $('.' + element_name).text(value);
}, },
}); });
@ -265,12 +274,13 @@
Dropzone.autoDiscover = false; Dropzone.autoDiscover = false;
function initialize_dropzone(element_name, file_upload_msg, no_of_files_can_be_uploaded, max_file_size, allowed_file_type, url = null) { function initialize_dropzone(element_name, file_upload_msg, no_of_files_can_be_uploaded, max_file_size,
allowed_file_type, url = null) {
var file_remove_url = "library/delete_file.php"; var file_remove_url = "library/delete_file.php";
if (url == null) { if (url == null) {
url = "{{ url('/file-upload')}}"; url = "{{ url('/file-upload') }}";
file_remove_url = "{{ url('/file-delete')}}"; file_remove_url = "{{ url('/file-delete') }}";
} }
var file_names = []; var file_names = [];
@ -286,27 +296,37 @@
maxFilesize: max_file_size, maxFilesize: max_file_size,
dictDefaultMessage: file_upload_msg, dictDefaultMessage: file_upload_msg,
maxFiles: no_of_files_can_be_uploaded, maxFiles: no_of_files_can_be_uploaded,
capture: allowed_file_type == 'image/*' ? 'image/*' : null,
headers: { headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}, },
acceptedFiles: allowed_file_type, acceptedFiles: allowed_file_type,
init: function () { init: function() {
//function to be use on editing a form, to display existing files //function to be use on editing a form, to display existing files
if ($('input#' + element_name).val().length > 0) { if ($('input#' + element_name).val().length > 0) {
window[`${element_name}_myDropzone`] = this; window[`${element_name}_myDropzone`] = this;
var file_obj = {files: $('input#' + element_name).val()}; var file_obj = {
files: $('input#' + element_name).val()
};
$.ajax({ $.ajax({
method: "GET", method: "GET",
url: '/existing-file-display', url: '/existing-file-display',
dataType: "json", dataType: "json",
data: file_obj, data: file_obj,
success: function (result) { success: function(result) {
if (result.success) { if (result.success) {
$.each(result.files, function (key, file) { $.each(result.files, function(key, file) {
var mockFile = {name: file.name, uploaded_as: file.uploaded_as, size: file.size}; var mockFile = {
window[`${element_name}_myDropzone`].emit("addedfile", mockFile); name: file.name,
window[`${element_name}_myDropzone`].emit("thumbnail", mockFile, file.path); uploaded_as: file.uploaded_as,
window[`${element_name}_myDropzone`].emit("complete", mockFile); size: file.size
};
window[`${element_name}_myDropzone`].emit(
"addedfile", mockFile);
window[`${element_name}_myDropzone`].emit(
"thumbnail", mockFile, file.path);
window[`${element_name}_myDropzone`].emit(
"complete", mockFile);
}); });
} }
} }
@ -314,13 +334,15 @@
} }
//function to be use on removeing a file //function to be use on removeing a file
this.on("removedfile", function (file) { this.on("removedfile", function(file) {
$.ajax({ $.ajax({
url: file_remove_url, url: file_remove_url,
data: {"file_name": file.uploaded_as}, data: {
"file_name": file.uploaded_as
},
type: "POST", type: "POST",
success: function (result) { success: function(result) {
if (typeof (result) == 'string') { if (typeof(result) == 'string') {
var result = JSON.parse(result); var result = JSON.parse(result);
} }
@ -350,8 +372,8 @@
}); });
}); });
}, },
success: function (file, response) { success: function(file, response) {
if (typeof (response) == 'string') { if (typeof(response) == 'string') {
var response = JSON.parse(response); var response = JSON.parse(response);
} }
if (response.success == true) { if (response.success == true) {
@ -409,7 +431,7 @@
var signaturePad = element; var signaturePad = element;
var canvas = document.getElementById(element); var canvas = document.getElementById(element);
signaturePad = new SignaturePad(canvas, { signaturePad = new SignaturePad(canvas, {
onEnd: function (event) { onEnd: function(event) {
var element = $(this)[0]._canvas.id var element = $(this)[0]._canvas.id
var signature = $(this)[0].toDataURL(); var signature = $(this)[0].toDataURL();
$('#output_' + element).val(signature); $('#output_' + element).val(signature);
@ -421,12 +443,12 @@
signaturePad.fromDataURL($('#output_' + element).val()); signaturePad.fromDataURL($('#output_' + element).val());
} }
$(document).on('click', '#clear_' + element, function () { $(document).on('click', '#clear_' + element, function() {
signaturePad.clear(); signaturePad.clear();
$('#output_' + $(this).data('name')).val(''); $('#output_' + $(this).data('name')).val('');
}); });
$(document).on('click', '#undo_' + element, function () { $(document).on('click', '#undo_' + element, function() {
var data = signaturePad.toData(); var data = signaturePad.toData();
if (data) { if (data) {
data.pop(); // remove the last dot or line data.pop(); // remove the last dot or line
@ -467,8 +489,8 @@
} }
</script> </script>
<!-- Application additional js --> <!-- Application additional js -->
@if(!$is_download && !isset($nav)) @if (!$is_download && !isset($nav))
@if(!empty($__additional_js)) @if (!empty($__additional_js))
{!!$__additional_js!!} {!! $__additional_js !!}
@endif @endif
@endif @endif