Code: Select all
<div id="#uppy_div#"></div>
<script>
nuInitUppy();
function nuInitUppy() {
const $objId= $('#' + '#this_object_id#');
const target = '#' + '#uppy_div#';
let uppy = new Uppy.Core();
uppy.use(Uppy.Dashboard, {
inline: true
, bundle: true
, height: $objId.cssNumber('height')
, width: $objId.cssNumber('width')
, target: target
, showProgressDetails: true
, replaceTargetContent: true
, method: 'post'
})
.use(Uppy.XHRUpload, {
endpoint: 'core/nuapi.php'
})
uppy.setMeta({ procedure: 'php_UploadFuelTransactions', cprid: document.getElementById('cpr_id').value, session_id: window.nuSESSION })
uppy.on('complete', (result) => {
if (window.nuOnFileUploadComplete) {
nuOnFileUploadComplete('FS', $objId.attr('id'), result);
}
})
}
</script>
Code: Select all
$cprid = isset($_POST["cprid"]) ? $_POST["cprid"] : '';