Current path: home/webdevt/cryptoimpot.fr/module/Application/view/application/importation/
?? Go up: /home/webdevt/cryptoimpot.fr/module/Application/view/application
<?php
$this->HeadLink()
->appendStylesheet('https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/css/bootstrap-select.css')
->appendStylesheet($this->basePath() . '/dist/css/style.css')
->appendStylesheet($this->basePath() . '/dist/css/blueimp.css')
// ->appendStylesheet('https://blueimp.github.io/Gallery/css/blueimp-gallery.min.css')
->appendStylesheet($this->basePath() . '/dist/css/jquery.fileupload.css')
->appendStylesheet($this->basePath() . '/dist/css/jquery.fileupload-ui.css')
;
$this->headScript()
->appendFile('https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/js/bootstrap-select.min.js')
->appendFile('https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.bundle.min.js')
->appendFile('https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js')
->appendFile($this->basePath() . '/dist/js/vendor/jquery.ui.widget.js')
->appendFile('https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js')
->appendFile('https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js')
->appendFile('https://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js')
->appendFile($this->basePath() . '/dist/js/jquery.iframe-transport.js')
->appendFile($this->basePath() . '/dist/js/jquery.fileupload.js')
->appendFile($this->basePath() . '/dist/js/jquery.fileupload-process.js')
->appendFile($this->basePath() . '/dist/js/jquery.fileupload-image.js')
->appendFile($this->basePath() . '/dist/js/jquery.fileupload-audio.js')
->appendFile($this->basePath() . '/dist/js/jquery.fileupload-video.js')
->appendFile($this->basePath() . '/dist/js/jquery.fileupload-validate.js')
->appendFile($this->basePath() . '/dist/js/jquery.fileupload-ui.js')
// <!-- Bootstrap CSS -->
// <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
// <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
/*
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
<!-- CSS adjustments for browsers with JavaScript disabled -->
<noscript><link rel="stylesheet" href="dist/css/jquery.fileupload-noscript.css"></noscript>
<noscript><link rel="stylesheet" href="dist/css/jquery.fileupload-ui-noscript.css"></noscript>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css">
*/
//<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
//<link rel="stylesheet" href="" />
//<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
?>
<style>
#dropzone {
/*background: palegreen;*/
width: 150px;
height: 50px;
line-height: 50px;
text-align: center;
font-weight: bold;
}
#dropzone.in {
width: 600px;
height: 200px;
line-height: 200px;
font-size: larger;
}
#dropzone.hover {
/*background: lawngreen;*/
}
#dropzone.fade {
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
opacity: 1;
}
</style>
<div class="container" style="background-color: #FFFFFF; padding: 15px;">
<section class="jumbotron text-center">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div id="etape1">
<!--<h2>Etape 1 : uploader vos fichiers de trade</h2>-->
<!-- The file upload form used as target for the file upload widget -->
<form id="fileupload" action="https://jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data">
<!-- Redirect browsers with JavaScript disabled to the origin page -->
<noscript><input type="hidden" name="redirect" value="https://blueimp.github.io/jQuery-File-Upload/"></noscript>
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div id="dropzone" class="dropzone-file fade well">Ajouter vos fichiers de trade</div>
<div class="row fileupload-buttonbar">
<div class="col-lg-9">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="fas fa-folder-plus"></i>
<span>Ajouter vos fichiers de trade</span>
<input type="file" name="files[]" multiple>
</span>
<!-- <button type="submit" class="btn btn-primary start">
<i class="fas fa-upload"></i>
<span>Uploader</span>
</button>-->
<!-- <button type="reset" class="btn btn-warning cancel">
<i class="fas fa-ban"></i>
<span>Annuler</span>
</button>-->
<!-- <button type="button" class="btn btn-danger delete">
<i class="fas fa-trash-alt"></i>
<span>Effacer</span>
</button>-->
<!--<input type="checkbox" class="toggle">-->
<!-- The global file processing state -->
<span class="fileupload-process"></span>
</div>
<!-- The global progress state -->
<div class="col-lg-2 fileupload-progress fade">
<!-- The global progress bar -->
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-success" style="width:0%;"></div>
</div>
<!-- The extended global progress state -->
<div class="progress-extended"> </div>
</div>
</div>
<!-- The table listing the files available for upload/download -->
<table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
</form>
<br>
<button id="uploadfile-finish" type="button" class="btn btn-sm btn-outline-secondary">Générer le rapport fiscal</button>
<!--<button disabled="disabled" id="calcul-button" type="button" class="btn btn-sm btn-outline-secondary">Calculer la plus value</button>-->
</div>
</div>
</div>
</div>
</section>
</div>
<!-- The blueimp Gallery widget -->
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
<div class="slides"></div>
<h3 class="title"></h3>
<a class="prev">‹</a>
<a class="next">›</a>
<a class="close">×</a>
<a class="play-pause"></a>
<ol class="indicator"></ol>
</div>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade show">
<td>
<span class="preview"></span>
</td>
<td>
<p class="name">{%=file.name%}</p>
<strong class="error text-danger"></strong>
</td>
<td>
<p class="size">Processing...</p>
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
</td>
<td>
{% if (!i && !o.options.autoUpload) { %}
<button class="btn btn-primary start" disabled>
<i class="glyphicon glyphicon-upload"></i>
<span>Start</span>
</button>
{% } %}
{% if (!i) { %}
<button class="btn btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download fade show">
<td>
<span class="preview">
{% if (file.thumbnailUrl) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
{% } %}
</span>
</td>
<td>
<p class="name">
{% if (file.url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
{% } else { %}
<span>{%=file.name%}</span>
{% } %}
</p>
{% if (file.error) { %}
<div><span class="label label-danger">Error</span> {%=file.error%}</div>
{% } %}
</td>
<td>
<span class="size">{%=o.formatFileSize(file.size)%}</span>
</td>
<td>
{% if (file.deleteUrl) { %}
<button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
<i class="fas fa-trash-alt"></i>
<span>Supprimer</span>
</button>
<!--<input type="checkbox" name="delete" value="1" class="toggle">-->
{% } else { %}
<button class="btn btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src=""></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src=""></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src=""></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
<!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
<!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>-->
<!-- blueimp Gallery script -->
<script src=""></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<!-- The main application script -->
<!--<script src="dist/js/main.js"></script>-->
<script>
$(function () {
'use strict';
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: '<?= $this->basePath() ?>/ledgio/importation/upload'
});
// Enable iframe cross-domain access via redirect option:
$('#fileupload').fileupload(
'option',
'redirect',
window.location.href.replace(
/\/[^\/]*$/,
'/cors/result.html?%s'
)
);
if (window.location.hostname === 'blueimp.github.io') {
// Demo settings:
$('#fileupload').fileupload('option', {
url: '//jquery-file-upload.appspot.com/',
dropZone: $('.dropzone-file'),
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: /Android(?!.*Chrome)|Opera/
.test(window.navigator.userAgent),
maxFileSize: 999000,
acceptFileTypes: /(\.|\/)(doc|csv)$/i
});
// Upload server status check for browsers with CORS support:
if ($.support.cors) {
$.ajax({
url: '//jquery-file-upload.appspot.com/',
type: 'HEAD'
}).fail(function () {
$('<div class="alert alert-danger"/>')
.text('Upload server currently unavailable - ' +
new Date())
.appendTo('#fileupload');
});
}
} else {
// Load existing files:
$('#fileupload').addClass('fileupload-processing');
$.ajax({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: $('#fileupload').fileupload('option', 'url'),
dataType: 'json',
context: $('#fileupload')[0]
}).always(function () {
$(this).removeClass('fileupload-processing');
}).done(function (result) {
$(this).fileupload('option', 'done')
.call(this, $.Event('done'), {result: result});
});
}
$('#uploadfile-finish').click(function () {
var data = {}
data["id"] = 1;
data["domain"] = 2;
data["name"] = 3;
$.ajax({
type: "POST",
contentType: "application/json",
url: '<?= $this->basePath() ?>/ledgio/importation',
data: JSON.stringify(data),
dataType: 'json',
timeout: 600000,
success: function (data) {
console.log("SUCCESS: ", data);
console.log('data.plusValue');
console.log(data.plusValue);
console.log(data.CryptosComplementaryInfos);
console.log(data.CryptosComplementaryInfos !== undefined);
if (data && data.CryptosComplementaryInfos !== '' && data.CryptosComplementaryInfos !== undefined) {
console.log(data.plusValue);
Object.keys(data['CryptosComplementaryInfos']).forEach(function (key) {
console.table('Key : ' + key + ', Value : ' + data['CryptosComplementaryInfos'][key]);
});
$(data['CryptosComplementaryInfosHtml']).insertAfter("#etape1");
// for (i=0; i++, i data.CryptosComplementaryInfos.length) {
// console.log();
//}
}
if (data && data.plusValue !== '' && data.plusValue !== undefined) {
console.log('data.plusValue lok');
console.log(data.plusValue);
$(data['plusValue']).insertAfter("#etape1");
}
},
error: function (e) {
console.log("ERROR: ", e);
}
});
});
// var timerCalcStatus = setInterval(function () {
// $.ajax({
// url: '<?= $this->basePath() ?>/getcalculationstatus.php',
// success: function (data) {
// console.log(data);
// console.log(data == 1);
// console.log(data == '1');
//
// if (data == 1) {
// $('#calcul-button').show();
// $('#calcul-button').attr('disabled', false);
// clearInterval(timerCalcStatus);
// }
// },
// error: function (xhr) {
// console.log("Error: " + xhr.statusText);
// }
// });
//
// }, 2000);
$(document).bind('dragover', function (e) {
var dropZones = $('.dropzone-file'),
timeout = window.dropZoneTimeout;
if (timeout) {
clearTimeout(timeout);
} else {
dropZones.addClass('in');
}
var hoveredDropZone = $(e.target).closest(dropZones);
dropZones.not(hoveredDropZone).removeClass('hover');
hoveredDropZone.addClass('hover');
window.dropZoneTimeout = setTimeout(function () {
window.dropZoneTimeout = null;
dropZones.removeClass('in hover');
}, 100);
});
});
</script>