Uppy.js
"use strict";
// Class definition
var KTUppy = function () {
const Tus = Uppy.Tus;
const ProgressBar = Uppy.ProgressBar;
const StatusBar = Uppy.StatusBar;
const FileInput = Uppy.FileInput;
const Informer = Uppy.Informer;
// to get uppy companions working, please refer to the official documentation here: https://uppy.io/docs/companion/
const Dashboard = Uppy.Dashboard;
const Dropbox = Uppy.Dropbox;
const GoogleDrive = Uppy.GoogleDrive;
const Instagram = Uppy.Instagram;
const Webcam = Uppy.Webcam;
// Private functions
var initUppy1 = function(){
var id = '#kt_uppy_1';
var options = {
proudlyDisplayPoweredByUppy: false,
target: id,
inline: true,
replaceTargetContent: true,
showProgressDetails: true,
note: 'No filetype restrictions.',
height: 470,
metaFields: [
{ id: 'name', name: 'Name', placeholder: 'file name' },
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
],
browserBackButtonClose: true
}
var uppyDashboard = Uppy.Core({
autoProceed: true,
restrictions: {
maxFileSize: 1000000, // 1mb
maxNumberOfFiles: 5,
minNumberOfFiles: 1
}
});
uppyDashboard.use(Dashboard, options);
uppyDashboard.use(Tus, { endpoint: 'https://master.tus.io/files/' });
uppyDashboard.use(GoogleDrive, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
uppyDashboard.use(Dropbox, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
uppyDashboard.use(Instagram, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
uppyDashboard.use(Webcam, { target: Dashboard });
}
var initUppy2 = function(){
var id = '#kt_uppy_2';
var options = {
proudlyDisplayPoweredByUppy: false,
target: id,
inline: true,
replaceTargetContent: true,
showProgressDetails: true,
note: 'Images and video only, 2–3 files, up to 1 MB',
height: 470,
metaFields: [
{ id: 'name', name: 'Name', placeholder: 'file name' },
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
],
browserBackButtonClose: true
}
var uppyDashboard = Uppy.Core({
autoProceed: true,
restrictions: {
maxFileSize: 1000000, // 1mb
maxNumberOfFiles: 5,
minNumberOfFiles: 1,
allowedFileTypes: ['image/*', 'video/*']
}
});
uppyDashboard.use(Dashboard, options);
uppyDashboard.use(Tus, { endpoint: 'https://master.tus.io/files/' });
}
var initUppy3 = function(){
var id = '#kt_uppy_3';
var uppyDrag = Uppy.Core({
autoProceed: true,
restrictions: {
maxFileSize: 1000000, // 1mb
maxNumberOfFiles: 5,
minNumberOfFiles: 1,
allowedFileTypes: ['image/*', 'video/*']
}
});
uppyDrag.use(Uppy.DragDrop, { target: id + ' .kt-uppy__drag' });
uppyDrag.use(ProgressBar, {
target: id + ' .kt-uppy__progress',
hideUploadButton: false,
hideAfterFinish: false
});
uppyDrag.use(Informer, { target: id + ' .kt-uppy__informer' });
uppyDrag.use(Tus, { endpoint: 'https://master.tus.io/files/' });
uppyDrag.on('complete', function(file) {
var imagePreview = "";
$.each(file.successful, function(index, value){
var imageType = /image/;
var thumbnail = "";
if (imageType.test(value.type)){
thumbnail = '';
}
var sizeLabel = "bytes";
var filesize = value.size;
if (filesize > 1024){
filesize = filesize / 1024;
sizeLabel = "kb";
if(filesize > 1024){
filesize = filesize / 1024;
sizeLabel = "MB";
}
}
imagePreview += ''+thumbnail+' '+value.name+' ('+ Math.round(filesize, 2) +' '+sizeLabel+')';
});
$(id + ' .kt-uppy__thumbnails').append(imagePreview);
});
$(document).on('click', id + ' .kt-uppy__thumbnails .kt-uppy__remove-thumbnail', function(){
var imageId = $(this).attr('data-id');
uppyDrag.removeFile(imageId);
$(id + ' .kt-uppy__thumbnail-container[data-id="'+imageId+'"').remove();
});
}
var initUppy4 = function(){
var id = '#kt_uppy_4';
var uppyDrag = Uppy.Core({
autoProceed: false,
restrictions: {
maxFileSize: 1000000, // 1mb
maxNumberOfFiles: 5,
minNumberOfFiles: 1
}
});
uppyDrag.use(Uppy.DragDrop, { target: id + ' .kt-uppy__drag' });
uppyDrag.use(ProgressBar, { target: id + ' .kt-uppy__progress' });
uppyDrag.use(Informer, { target: id + ' .kt-uppy__informer' });
uppyDrag.use(Tus, { endpoint: 'https://master.tus.io/files/' });
uppyDrag.on('complete', function(file) {
var imagePreview = "";
$.each(file.successful, function(index, value){
var imageType = /image/;
var thumbnail = "";
if (imageType.test(value.type)){
thumbnail = '';
}
var sizeLabel = "bytes";
var filesize = value.size;
if (filesize > 1024){
filesize = filesize / 1024;
sizeLabel = "kb";
if(filesize > 1024){
filesize = filesize / 1024;
sizeLabel = "MB";
}
}
imagePreview += ''+thumbnail+' '+value.name+' ('+ Math.round(filesize, 2) +' '+sizeLabel+')';
});
$(id + ' .kt-uppy__thumbnails').append(imagePreview);
});
var uploadBtn = $(id + ' .kt-uppy__btn');
uploadBtn.click(function () {
uppyDrag.upload();
});
$(document).on('click', id + ' .kt-uppy__thumbnails .kt-uppy__remove-thumbnail', function(){
var imageId = $(this).attr('data-id');
uppyDrag.removeFile(imageId);
$(id + ' .kt-uppy__thumbnail-container[data-id="'+imageId+'"').remove();
});
}
var initUppy5 = function(){
// Uppy variables
// For more info refer: https://uppy.io/
var elemId = 'kt_uppy_5';
var id = '#' + elemId;
var $statusBar = $(id + ' .kt-uppy__status');
var $uploadedList = $(id + ' .kt-uppy__list');
var timeout;
var uppyMin = Uppy.Core({
debug: true,
autoProceed: true,
showProgressDetails: true,
restrictions: {
maxFileSize: 1000000, // 1mb
maxNumberOfFiles: 5,
minNumberOfFiles: 1
}
});
uppyMin.use(FileInput, { target: id + ' .kt-uppy__wrapper', pretty: false });
uppyMin.use(Informer, { target: id + ' .kt-uppy__informer' });
// demo file upload server
uppyMin.use(Tus, { endpoint: 'https://master.tus.io/files/' });
uppyMin.use(StatusBar, {
target: id + ' .kt-uppy__status',
hideUploadButton: true,
hideAfterFinish: false
});
$(id + ' .uppy-FileInput-input').addClass('kt-uppy__input-control').attr('id', elemId + '_input_control');
$(id + ' .uppy-FileInput-container').append('');
var $fileLabel = $(id + ' .kt-uppy__input-label');
uppyMin.on('upload', function(data) {
$fileLabel.text("Uploading...");
$statusBar.addClass('kt-uppy__status--ongoing');
$statusBar.removeClass('kt-uppy__status--hidden');
clearTimeout( timeout );
});
uppyMin.on('complete', function(file) {
$.each(file.successful, function(index, value){
var sizeLabel = "bytes";
var filesize = value.size;
if (filesize > 1024){
filesize = filesize / 1024;
sizeLabel = "kb";
if(filesize > 1024){
filesize = filesize / 1024;
sizeLabel = "MB";
}
}
var uploadListHtml = ''+value.name+' ('+ Math.round(filesize, 2) +' '+sizeLabel+')';
$uploadedList.append(uploadListHtml);
});
$fileLabel.text("Add more files");
$statusBar.addClass('kt-uppy__status--hidden');
$statusBar.removeClass('kt-uppy__status--ongoing');
});
$(document).on('click', id + ' .kt-uppy__list .kt-uppy__list-remove', function(){
var itemId = $(this).attr('data-id');
uppyMin.removeFile(itemId);
$(id + ' .kt-uppy__list-item[data-id="'+itemId+'"').remove();
});
}
var initUppy6 = function(){
var id = '#kt_uppy_6';
var options = {
proudlyDisplayPoweredByUppy: false,
target: id + ' .kt-uppy__dashboard',
inline: false,
replaceTargetContent: true,
showProgressDetails: true,
note: 'No filetype restrictions.',
height: 470,
metaFields: [
{ id: 'name', name: 'Name', placeholder: 'file name' },
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
],
browserBackButtonClose: true,
trigger: id + ' .kt-uppy__btn'
}
var uppyDashboard = Uppy.Core({
autoProceed: true,
restrictions: {
maxFileSize: 1000000, // 1mb
maxNumberOfFiles: 5,
minNumberOfFiles: 1
}
});
uppyDashboard.use(Dashboard, options);
uppyDashboard.use(Tus, { endpoint: 'https://master.tus.io/files/' });
uppyDashboard.use(GoogleDrive, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
uppyDashboard.use(Dropbox, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
uppyDashboard.use(Instagram, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
uppyDashboard.use(Webcam, { target: Dashboard });
}
return {
// public functions
init: function() {
initUppy1();
initUppy2();
initUppy3();
initUppy4();
initUppy5();
initUppy6();
swal.fire({
"title": "Notice",
"html": "Uppy demos uses https://master.tus.io/files/ URL for resumable upload examples and your uploaded files will be temporarely stored in tus.io servers.",
"type": "info",
"buttonsStyling": false,
"confirmButtonClass": "btn btn-brand kt-btn kt-btn--wide",
"confirmButtonText": "Ok, I understand",
"onClose": function(e) {
console.log('on close event fired!');
}
});
}
};
}();
KTUtil.ready(function() {
KTUppy.init();
});
PHP sayfası
title = "Deliver Shipment"
url = "/dashboard/shipments/:id/deliver"
layout = "admin"
is_hidden = 0
role = 0
permission = 1
anonymous_only = 0
logged_only = 1
child_of = "dashboard/shipment"
hide_crumb = 0
remove_crumb_trail = 0
crumb_disabled = 0
[viewBag]
==
function onStart() {
if(!Auth::getUser()->hasUserPermission(["order"],'u')) {
\Flash::error($this['theme_lang']['not_allowed']);
return Redirect::to('dashboard/settings');
}
$this->page->stretch = true;
$this['order'] = $order = \Spot\Shipment\Models\Order::find($this->param('id'));
switch (Auth::getUser()->role_id) {
case 6:
if(!in_array($order->office_id, Auth::getUser()->manage->pluck('id')->toArray())){
\Flash::error($this['theme_lang']['not_allowed']);
return Redirect::to('dashboard/shipments/');
}
break;
case 5:
if($order->sender_id != Auth::getUser()->id && $order->receiver_id != Auth::getUser()->id){
\Flash::error($this['theme_lang']['not_allowed']);
return Redirect::to('dashboard/shipments/');
}
break;
case 4:
if(Auth::getUser()->is_superuser){
if($order->office_id != Auth::getUser()->office){
\Flash::error($this['theme_lang']['not_allowed']);
return Redirect::to('dashboard/shipments/');
}
}else{
if($order->assigned_id != Auth::getUser()->id){
if($order->manifest_id != null){
if($order->driver_id != Auth::getUser()->id && $order->employee_id != Auth::getUser()->id){
\Flash::error($this['theme_lang']['not_allowed']);
return Redirect::to('dashboard/shipments/');
}
}else{
\Flash::error($this['theme_lang']['not_allowed']);
return Redirect::to('dashboard/shipments/');
}
}
}
break;
case 3:
$employees = \RainLab\User\Models\User::whereHas('groups',function($q){$q->whereIn('user_group_id', Auth::getUser()->groups->pluck('id')->toArray());})->pluck('id')->toArray();
if(!in_array($order->assigned_id, $employees)){
if($order->manifest_id != null){
if(!in_array($order->driver_id, $employees) && !in_array($order->employee_id, $employees)){
\Flash::error($this['theme_lang']['not_allowed']);
return Redirect::to('dashboard/shipments/');
}
}else{
\Flash::error($this['theme_lang']['not_allowed']);
return Redirect::to('dashboard/shipments/');
}
}
break;
}
$this['employees'] = \RainLab\User\Models\User::whereNotIn('role_id',[1,5])->select('id','name')->get();
$this['statuses'] = \Spot\Shipment\Models\Status::select('id','name')->get();
}
function onSave()
{
if(!Auth::getUser()->hasUserPermission(["order"],'u')) {
throw new ApplicationException($this['theme_lang']['not_allowed']);
}
$data = post();
if(Auth::getUser()->role_id == 5){
throw new ApplicationException($this['theme_lang']['not_allowed']);
}
$item = \Spot\Shipment\Models\Order::find($this->param('id'));
$item->requested = 4;
$item->postponed = null;
$status = \Spot\Shipment\Models\Status::where('equal', 4)->first();
$type = 'delivered';
if($status){
$item->status = $status->id;
}
$employee_id = $item->assigned_id;
$employeeorder = \Spot\Shipment\Models\Employeeorder::where('order_id', $item->id)->first();
if($employeeorder){
$employee_id = $employeeorder->employee_id;
$employeeorder->delete();
}
if($item->payment_type == 2){
if( \Spot\Shipment\Models\Payment::where('item_id', $item->id)->where('for_id', $item->sender_id)->where('payment_method', 'online')->pluck('status')->first() == 3){
}else{
$total = $item->courier_fee+$item->customs_value;
$total = $total+($item->tax*$item->courier_fee/100);
$total = $total+($item->insurance*$item->courier_fee/100);
if($item->return_package_fee == 1){
$total += $item->return_courier_fee;
}
if($item->return_defray == 1){
$total += $item->package_fee;
}
if($item->customs_value != 0){
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->payment_type = 'customs';
$payment->item_id = $item->id;
$payment->for_id = $item->sender_id;
$payment->payment_with = $employee_id;
$payment->movement = 8; //Add to the balance of packages
$payment->amount = $item->customs_value;
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
}
if($item->tax != 0){
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->payment_type = 'tax';
$payment->item_id = $item->id;
$payment->for_id = $item->sender_id;
$payment->payment_with = $employee_id;
$payment->movement = 8; //Add to the balance of packages
$payment->amount = ($item->tax*$item->courier_fee/100);
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
}
if($item->insurance != 0){
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->payment_type = 'insurance';
$payment->item_id = $item->id;
$payment->for_id = $item->sender_id;
$payment->payment_with = $employee_id;
$payment->movement = 8; //Add to the balance of packages
$payment->amount = '-'.($item->insurance*$item->courier_fee/100);
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
}
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->item_id = $item->id;
$payment->payment_type = 'courier_fee';
$payment->for_id = $item->sender_id;
$payment->payment_with = $employee_id;
$payment->movement = 8; //Add to the balance of packages
$payment->amount = $item->courier_fee;
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
if($item->return_defray == 1){
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->item_id = $item->id;
$payment->payment_type = 'package_fee';
$payment->for_id = $item->sender_id;
$payment->payment_with = $employee_id;
$payment->movement = 8; //Add to the balance of packages
$payment->amount = $item->package_fee;
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
if($item->return_package_fee == 1){
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->item_id = $item->id;
$payment->payment_type = 'return_package_fee';
$payment->for_id = $item->sender_id;
$payment->payment_with = $employee_id;
$payment->movement = 8; //Add to the balance of packages
$payment->amount = $item->return_courier_fee;
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
}
}
}
}else{
if(\Spot\Shipment\Models\Payment::where('item_id', $item->id)->where('for_id', $item->receiver_id)->where('payment_method', 'online')->pluck('status')->first() == 3 ){
}else{
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->item_id = $item->id;
$payment->payment_type = 'courier_fee';
$payment->for_id = $item->sender_id;
$payment->payment_with = $employee_id;
$payment->movement = 8; //Add to the balance of packages
$payment->amount = $item->courier_fee;
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
if($item->return_defray == 1){
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->item_id = $item->id;
$payment->payment_type = 'package_fee';
$payment->for_id = $item->sender_id;
$payment->payment_with = $employee_id;
$payment->movement = 8; //Add to the balance of packages
$payment->amount = $item->package_fee;
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->item_id = $item->id;
$payment->payment_type = 'package_fee';
$payment->for_id = $item->sender_id;
$payment->movement = 4;
$payment->amount = $item->package_fee;
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
if($item->return_package_fee == 1){
$payment = new \Spot\Shipment\Models\Payment;
$payment->type = 1;
$payment->item_id = $item->id;
$payment->payment_type = 'return_package_fee';
$payment->for_id = $item->sender_id;
$payment->payment_with = $employee_id;
$payment->movement = 8; //Add to the balance of packages
$payment->amount = $item->return_courier_fee;
$payment->date = \Carbon\Carbon::now();
$payment->created_at = \Carbon\Carbon::now();
$payment->updated_at = \Carbon\Carbon::now();
$payment->save();
}
}
}
}
$item->esign = htmlspecialchars($data['signaturePadImg']);
$item->delivered_by = $employee_id;
$item->delivered_responsiable = Auth::getUser()->id;
$item->received_by = htmlspecialchars($data['receiver']);
$item->updated_at = \Carbon\Carbon::now();
$item->update();
if(isset($data['note']) && $data['note'] != ''){
$data = post();
$note = new \Spot\Shipment\Models\Notes;
$note->user_id = Auth::getUser()->id;
$note->item_id = $this->param('id');
$note->item_type = 1;
$note->content = $data['note'];
$note->created_at = \Carbon\Carbon::now();
$note->updated_at = \Carbon\Carbon::now();
$note->save();
}
$event_data = array(
'sender' => Auth::getUser(),
'shipping_sender' => $item->sender_id,
'shipping_receiver' => (($item->receiver_id) ? $item->receiver_id : null),
'shipping_responsible' => $employee_id,
'item' => $item,
'type' => $type,
'thumb' => 'icon',
'icon' => 'flaticon-gift',
'subject' => $this['theme_lang'][$type],
'message' => $this['theme_lang'][$type],
'url' => url('dashboard/shipments/'.$item->id.'/view'),
'badge' => 'success',
);
\Event::fire('spot.event', [$this['pusher'],$this['settings'],$event_data]);
$activity = new \Spot\Shipment\Models\Activity;
$activity->user_id = Auth::getUser()->id;
$activity->order_id = $item->id;
$activity->description = $type;
$activity->created_at = \Carbon\Carbon::now();
$activity->updated_at = \Carbon\Carbon::now();
$activity->save();
\Flash::success($this['theme_lang']['updated_successfully']);
return Redirect::to('dashboard');
}
?>
==
{{'Deliver Shipment'|__}}: {{settings.tracking.prefix_order}}{{order.number}}
{{'Complete the form to confirm the delivery of this shipment!'|__}}
{{ form_ajax('onSave', { success: 'created successfully!', flash: true, class: 'kt_form' }) }}
{% if user.id != order.assigned_id %}
{% else %}
{% endif %}
{{'Upload or capture the front of the Receiver ID copy for confirmation'|__}}
{{'You can use your mouse to draw it, or if you using your mobile then you can use the touch screen to write it by your finger'|__}}
{{ form_close() }}
{{'Reach The Sender By Mobile'|__}}
{{'For more quick decisions you can call the sender mobile number from here'|__}}
{{'Reach The Receiver By Mobile'|__}}
{{'For more quick decisions you can call the receiver mobile number from here'|__}}
{% put styles %}
{% if currentLang == 'ar'%}
{% else %}
{% endif %}
{% endput %}
{% put scripts %}
<script></script>
<script></script>
<script></script>
<script>
if ($('#signaturePadImg').length > 0){
var canvas = document.querySelector("canvas");
var signaturePad = new SignaturePad(canvas);
document.getElementById('clear').addEventListener('click', function () {
signaturePad.clear();
});
document.getElementById('undo').addEventListener('click', function () {
var data = signaturePad.toData();
if (data) {
data.pop(); // remove the last dot or line
signaturePad.fromData(data);
}
});
}
</script>
<script>
"use strict";
// Class definition
var KTUppy = function () {
const Tus = Uppy.Tus;
//const XHRUpload = require('@uppy/xhr-upload')
const XHRUpload = Uppy.XHRUpload;
const ProgressBar = Uppy.ProgressBar;
const StatusBar = Uppy.StatusBar;
const FileInput = Uppy.FileInput;
const Informer = Uppy.Informer;
// to get uppy companions working, please refer to the official documentation here: //uppy.io/docs/companion/
const Dashboard = Uppy.Dashboard;
const Webcam = Uppy.Webcam;
// Private functions
var initUppy1 = function(){
var id = '#kt_uppy_1';
var options = {
proudlyDisplayPoweredByUppy: false,
target: id,
inline: true,
replaceTargetContent: true,
showProgressDetails: true,
note: '{{"Press Upload after selecting or capture the copy"|__}}.',
height: 470,
metaFields: [
{ id: 'name', name: '{{"Name"|__}}', placeholder: '{{"file name"|__}}' },
{ id: 'caption', name: '{{"Caption"|__}}', placeholder: '{{"describe what the image is about"|__}}' }
],
browserBackButtonClose: true
}
var uppyDashboard = Uppy.Core({
autoProceed: true,
restrictions: {
maxFileSize: 10000000, // 1mb
maxNumberOfFiles: 1,
minNumberOfFiles: 1
}
});
uppyDashboard.use(Dashboard, options);
uppyDashboard.use(Webcam, { target: Dashboard });
uppyDashboard.use(XHRUpload, { endpoint: '{{url("api/uploadcopy")}}/{{order.id}}',fieldName: 'copy' })
.on('complete', (result) => {
console.log('Upload result:', result)
})
}
return {
// public functions
init: function() {
initUppy1();
}
};
}();
KTUtil.ready(function() {
KTUppy.init();
$( ".kt_form" ).validate({
ignore: ":hidden",
invalidHandler: function(event, validator) {
var alert = $('.kt_form_msg');
alert.removeClass('kt--hide').show();
KTUtil.scrollTop();
}
});
$('body').on('click', '#save', function(e, clickedIndex, newValue, oldValue){
e.preventDefault();
swal.fire({
buttonsStyling: false,
html: "{{'Are you sure?'|__}}
{{'This action will make the responsible for the delivery is you for administration review'|__}}",
type: "warning",
confirmButtonText: "{{'Yes, confirm!'|__}}",
confirmButtonClass: "btn btn-sm btn-bold btn-success",
showCancelButton: true,
cancelButtonText: '{{"No"|__}}',
cancelButtonClass: "btn btn-sm btn-bold btn-danger"
}).then(function (result) {
if (result.value) {
var dataURL = canvas.toDataURL();
var teet = signaturePad.toDataURL("data:image/png;base64,signature");
$('#signaturePadImg').val(dataURL);
$('.kt_form').submit();
} else {
swal.fire({
title: '{{"Cancelled"|__}}',
text: '{{"Nothing updated! :)"|__}}',
type: 'error',
buttonsStyling: false,
confirmButtonText: '{{"OK"|__}}',
confirmButtonClass: "btn btn-sm btn-bold btn-brand",
});
}
});
});
});
</script>
{% endput %}