|
|
@@ -56,25 +56,26 @@ else { ?>
|
|
|
|
|
|
<script>
|
|
|
function dargAndDrop(){
|
|
|
- var fileInput = $("#compte-upload");
|
|
|
- var fileName = fileInput.val().split('\\').pop();
|
|
|
- var ext = fileName.split('.').pop().toLowerCase();
|
|
|
- var fileAttendu = "<?php echo banque::fileName($banque["compte"]) ?>";
|
|
|
-
|
|
|
- if(ext !== "csv"){
|
|
|
- $("#printToastErrorTxt").html("Seuls les fichiers CSV sont acceptés");
|
|
|
- $("#printToastError").toast('show');
|
|
|
- fileInput.val("");
|
|
|
- } else {
|
|
|
- if(fileName.includes(fileAttendu)){
|
|
|
- $(".file-message").text("Fichier prêt à être chargé : " + fileName);
|
|
|
- } else {
|
|
|
- $("#printToastErrorTxt").html("Le fichier "+ fileName +" ne semble pas être associé au bon compte.");
|
|
|
+ var fileInput = $("#compte-upload");
|
|
|
+ var fileName = fileInput.val().split('\\').pop();
|
|
|
+ var ext = fileName.split('.').pop().toLowerCase();
|
|
|
+ var fileAttendu = "<?php echo banque::fileName($banque["compte"]) ?>";
|
|
|
+ var fileAttenduTrimmed = fileAttendu.substring(5);
|
|
|
+
|
|
|
+ if(ext !== "csv"){
|
|
|
+ $("#printToastErrorTxt").html("Seuls les fichiers CSV sont acceptés");
|
|
|
$("#printToastError").toast('show');
|
|
|
fileInput.val("");
|
|
|
+ } else {
|
|
|
+ if(fileName.includes(fileAttenduTrimmed)){
|
|
|
+ $(".file-message").text("Fichier prêt à être chargé : " + fileName);
|
|
|
+ } else {
|
|
|
+ $("#printToastErrorTxt").html("Le fichier "+ fileName +" ne semble pas être associé au bon compte.");
|
|
|
+ $("#printToastError").toast('show');
|
|
|
+ fileInput.val("");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
</script>
|
|
|
<?php
|
|
|
}
|