Файловый менеджер - Редактировать - /home2/cocinasdalloway/lotes.cocinasdalloway.com/Administrador/Home/uploadFile.php
Назад
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Dropzone.js File Upload</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.2/min/dropzone.min.css"> </head> <body> <?php $idUsuario=$_SESSION["lt_id"]; ?> <form id="my-dropzone" class="dropzone" action="upload.php?IdAdministrador=<?php echo $idUsuario?>" method="post" enctype="multipart/form-data"> <div class="fallback"> <input name="file" type="file" /> </div> </form> <div id="file-list"></div> <div class="col-md-12 col-sm-12 "> <div class="x_panel"> <div class="x_title"> <h2>Variables <small><b><u>(Copia y pega en tu archivo de word el valor de la columna [Variable] donde quieres que se muestre el valor en el archivo de Word)</u></b></small></h2> <ul class="nav navbar-right panel_toolbox"> <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a> </li> <li><a class="close-link"><i class="fa fa-close"></i></a> </li> </ul> <div class="clearfix"></div> </div> <div class="x_content"> <table class="table table-striped"> <thead> <tr> <th>#</th> <th>Valor</th> <th>Variable</th> </tr> </thead> <tbody> <tr> <th scope="row">1</th> <td>Nombre del cliente</td> <td>${Value1}</td> </tr> <tr> <th scope="row">2</th> <td>Email del cliente</td> <td>${Value2}</td> </tr> <tr> <th scope="row">3</th> <td>Telefono</td> <td>${Value3}</td> </tr> <tr> <th scope="row">4</th> <td>Direccion</td> <td>${Value4}</td> </tr> <tr> <th scope="row">5</th> <td>Ciudad</td> <td>${Value5}</td> </tr> <tr> <th scope="row">6</th> <td>Estado</td> <td>${Value6}</td> </tr> <tr> <th scope="row">7</th> <td>Pais</td> <td>${Value7}</td> </tr> <tr> <th scope="row">8</th> <td>Nombre del fraccionamiento</td> <td>${Value8}</td> </tr> <tr> <th scope="row">9</th> <td>Nombre del lote</td> <td>${Value9}</td> </tr> <tr> <th scope="row">10</th> <td>Costo del lote</td> <td>${Value10}</td> </tr> <tr> <th scope="row">11</th> <td>Coordenada 1 (Lat y Lon)</td> <td>${Value11}</td> </tr> <tr> <th scope="row">12</th> <td>Coordenada 2 (Lat y Lon)</td> <td>${Value12}</td> </tr> <tr> <th scope="row">13</th> <td>Coordenada 3 (Lat y Lon)</td> <td>${Value13}</td> </tr> <tr> <th scope="row">14</th> <td>Coordenada 4 (Lat y Lon)</td> <td>${Value14}</td> </tr> </tbody> </table> </div> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.2/min/dropzone.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> </body> </html> <script> Dropzone.options.myDropzone = { paramName: "file", // The name that will be used to transfer the file maxFilesize: 5, // MB maxFiles:1, acceptedFiles: ".doc, .docx", dictDefaultMessage: "Drop .doc or .docx files here or click to upload", dictRemoveFile: "Eliminar", addRemoveLinks: true, init: function() { var dropzoneInstance = this; console.log('entro1') $.ajax({ url: "load_existing_files.php", type: "POST", dataType: "json", data: { idAdministrador : <?php echo $idUsuario?> }, success: function(data) { console.log(dropzoneInstance) console.log(data) // Loop through the existing files and add them to Dropzone for (var i = 0; i < data.length; i++) { var mockFile = { name: data[i].filename, size: data[i].filesize }; dropzoneInstance.emit("addedfile", mockFile); dropzoneInstance.emit("thumbnail", mockFile, "../uploads/"+<?php echo $idUsuario?>+"/" + data[i].filename); dropzoneInstance.emit("complete", mockFile); } } }); console.log('entro2') this.on("removedfile", function(file) { // Manejar la logica de eliminacion en el servidor $.ajax({ type: "POST", url: "delete.php", data: { filename: file.name, idAdministrador : <?php echo $idUsuario?> }, success: function(data) { console.log(data); } }); }); this.on("thumbnail", function(file, dataUrl) { // Check if the file is a Word document (.doc or .docx) if (file.name.endsWith(".doc") || file.name.endsWith(".docx")) { // Add a Word icon to the thumbnail $(file.previewElement).find(".dz-image img").attr("src", "../images/path-to-word-icon.png"); } var thumbnailElement = file.previewElement.querySelector(".dz-image img"); console.log(thumbnailElement) // Add a click event listener to the thumbnail thumbnailElement.addEventListener("click", function() { // Open a new window or tab with the URL of the thumbnail window.open(dataUrl, "_blank"); }); console.log(thumbnailElement) }); this.on("success", function(file, response) { // Reload the page after successful upload to update UI location.reload(); }); } }; </script>
| ver. 1.4 |
Github
|
.
| PHP 8.2.22 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка