����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 18.116.60.81 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/t/sae/appsae/core/app/view/ |
Upload File : |
<?php date_default_timezone_set("America/Mexico_City"); ?> <style> .loading { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: white; display: flex; justify-content: center; align-items: center; z-index: 9999; transition: 1s all; opacity: 0; } .loading.show { opacity: 1; } .loading .spin { border: 3px solid hsla(185, 100%, 62%, 0.2); border-top-color: #3cefff; border-radius: 50%; width: 3em; height: 3em; animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } </style> <div class="loading show"> <div class="spin"></div> </div> <section class="content"> <div class="row"> <div class="col-md-12"> <?php if(isset($_SESSION["client_id"])):?> <h1><i class='glyphicon glyphicon-shopping-cart'></i>Mis Ventas</h1> <?php else:?> <div class="btn-group pull-right"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-download"></i> Descargar <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="report/sells-word.php">Word 2007 (.docx)</a></li> <li><a href="report/sells-xlsx.php">Excel 2007 (.xlsx)</a></li> <li><a onclick="thePDF()" id="makepdf" class="">PDF (.pdf)</a></li> </ul> </div> <div class="clearfix"></div> <nav class = "navbar navbar-inverse"> <div class = "container-fluid"> <a href = "#" class = "navbar-brand"><i class='glyphicon glyphicon-shopping-cart'></i> Ventas </a> </div> </nav> <span>Procesando Informacion en tiempo real</span> <?php endif;?> <script> //====================================================================== // LOADING //====================================================================== var Loading = (loadingDelayHidden = 0) => { //----------------------------------------------------- // Variables //----------------------------------------------------- // HTML let loading = null; // Retardo para borrar const myLoadingDelayHidden = loadingDelayHidden; // Imágenes let imgs = []; let lenImgs = 0; let counterImgsLoading = 0; //----------------------------------------------------- // Funciones //----------------------------------------------------- /** * Método que aumenta el contador de las imágenes cargadas */ function incrementCounterImgs() { counterImgsLoading += 1; // Comprueba si todas las imágenes están cargadas if (counterImgsLoading === lenImgs) hideLoading(); } /** * Ocultar HTML */ function hideLoading() { // Comprueba que exista el HTML if(loading !== null) { // Oculta el HTML de "cargando..." quitando la clase .show loading.classList.remove('show'); // Borra el HTML setTimeout(function () { loading.remove(); }, myLoadingDelayHidden); } } /** * Método que inicia la lógica */ function init() { /* Comprobar que el HTML esté cargadas */ document.addEventListener('DOMContentLoaded', function () { loading = document.querySelector('.loading'); imgs = Array.from(document.images); lenImgs = imgs.length; /* Comprobar que todas las imágenes estén cargadas */ if(imgs.length === 0) { // No hay ninguna hideLoading(); } else { // Una o más imgs.forEach(function (img) { // A cada una le añade un evento que cuando se carge la imagen llame a la funcion incrementCounterImgs img.addEventListener('load', incrementCounterImgs, false); }); } }); } return { 'init': init } } // Para usarlo se declara e inicia. El número es el tiempo transcurrido para borra el HTML una vez cargado todos los elementos, en este caso 1 segundo: 1000 milisegundos, Loading(2000).init(); </script> <script type="text/javascript"> function getTimeAJAX() { //GUARDAMOS EN UNA VARIABLE EL RESULTADO DE LA CONSULTA AJAX var time = $.ajax({ url: './index.php?action=sell2', //indicamos la ruta donde se genera la hora dataType: 'text',//indicamos que es de tipo texto plano async: false //ponemos el parámetro asyn a falso }).responseText; //actualizamos el div que nos mostrará la hora actual document.getElementById("myWatch").innerHTML = " " + time; } //con esta funcion llamamos a la función getTimeAJAX cada segundo para actualizar el div que mostrará la hora setInterval(getTimeAJAX,500); </script> <div id="myWatch"></div> </div> </div> </section> <script type="text/javascript"> function thePDF() { var doc = new jsPDF('p', 'pt'); doc.setFontSize(26); doc.text("<?php echo ConfigurationData::getByPreffix("company_name")->val;?>", 40, 65); doc.setFontSize(18); doc.text("VENTAS", 40, 80); doc.setFontSize(12); doc.text("Usuario: <?php echo Core::$user->name." ".Core::$user->lastname; ?> - Fecha: <?php echo date("d-m-Y h:i:s");?> ", 40, 90); var columns = [ {title: "Id", dataKey: "id"}, {title: "Cliente", dataKey: "client"}, {title: "Total", dataKey: "total"}, {title: "Estado de pago", dataKey: "p"}, {title: "Estado de entrega", dataKey: "d"}, {title: "Almacen", dataKey: "stock"}, {title: "Fecha", dataKey: "created_at"}, ]; var rows = [ <?php foreach($products as $sell): ?> { "id": "<?php echo $sell->id; ?>", "client": "<?php if($sell->person_id!=null){$c= $sell->getPerson();echo $c->name." ".$c->lastname;} ?>", "total": "<?php $total= $sell->total-$sell->discount; echo "$ ".number_format($total,2,".",","); ?> ", "p": "<?php echo $sell->getP()->name; ?>", "d": "<?php echo $sell->getD()->name; ?>", "stock": "<?php echo $sell->getStockTo()->name; ?>", "created_at": "<?php echo $sell->created_at; ?>", }, <?php endforeach; ?> ]; doc.autoTable(columns, rows, { theme: 'grid', overflow:'linebreak', styles: { fillColor: <?php echo Core::$pdf_table_fillcolor;?> }, columnStyles: { id: {fillColor: <?php echo Core::$pdf_table_column_fillcolor;?>} }, margin: {top: 100}, afterPageContent: function(data) { } }); doc.setFontSize(12); doc.text("<?php echo Core::$pdf_footer;?>", 40, doc.autoTableEndPosY()+25); <?php $con = ConfigurationData::getByPreffix("report_image"); if($con!=null && $con->val!=""): ?> var img = new Image(); img.src= "storage/configuration/<?php echo $con->val;?>"; img.onload = function(){ doc.addImage(img, 'PNG', 495, 20, 60, 60,'mon'); doc.save('sells-<?php echo date("d-m-Y h:i:s",time()); ?>.pdf'); } <?php else:?> doc.save('sells-<?php echo date("d-m-Y h:i:s",time()); ?>.pdf'); <?php endif; ?> } </script>