!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.4.18 (Ubuntu). PHP/7.0.33-0ubuntu0.16.04.16 

uname -a: Linux digifus 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/almazenServer/application/views/   drwxr-xr-x
Free 10.11 GB of 29.4 GB (34.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     remito_generacion_view.php (12.93 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<div>
    <h1 ><?= $titulo ?><?php  echo ($datos->nombre)?></h1>
    
    <form action="<?php echo base_url()?>remito/remito/" method="post"  name="gestionRemito" >

    <ul class="nav nav-tabs" role="tablist" id="myTab">
          <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab"><strong> Seleccion de Productos para Remito</strong></a></li>
          <li role="presentation" ><a href="#comercial" aria-controls="comercial" role="tab" data-toggle="tab"><strong> GENERACION DE REMITO</strong></a></li>
          <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab"><strong>Datos del Cliente</strong></a></li>
      </ul>
      
    <div class="tab-content">
     <div role="tabpanel" class="tab-pane active estiloForm" id="home">
          <div class="estiloForm" >    
        <div class="form-group form-group-lg">
                <br>
                  Numero Remito: <input type="text" name="NumeroRemito" id="NumeroRemito" value="<?php  echo ($nroRemito); ?>" readonly> 
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                Forma de Pago:<input class="form-control" type="text" name="formaPago" id="formaPago" value="<?php  echo ($datos->formaDePago); ?>" readonly> 
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <?php 
                                 $grabaIva
='';
                                 if((
$datos->iva == "RESP. INSCRIPTO") ||($datos->iva == "Resp Inscripto")){
                                     
$grabaIva="checked='checked'";
                                 }
                                 
$iva='0';
                             
?>

                <input type="checkbox"  <?php echo $grabaIva?> disabled> RESP INSCRIPTO
            </div>
            
                <?php  $saldo=$this->consultas_model->getSaldo($datos->id); ?>

        <strong>Saldo: </strong><input class="form-control input-sm" type="text" name="Saldo" id="Saldo" value="<?php if($saldo !=null)  echo ($saldo->valor_saldo);?>" readonly>
    
</div>
   <br>
    <div>
         <div id="buscador">
        <form method="post">
                <input type="text" name="buscando" id="buscando" />&nbsp;&nbsp;&nbsp;
                   <input type="button" class="btn btn-primary btn-lg" value="Buscar"  onclick="busquedaProductos()"/>
        </form>
        </div>
        <br>
        <div id="div_noticias">

        </div>
    </div>
    </div>
    
         <div role="tabpanel" class="tab-pane estiloForm" id="comercial">
        <h1>Productos Agregados al Remito</h1>
        <div id="tablaPrincipal" width="60%">
            
            <?php
            $array
=array();
            
$cantidadProdTabla=0;
            
$total=0;
            
$totalAlternativo=0;
            
$this->table->set_heading('Producto''Descripcion''Cantidad','Precio','Descuento','Accion'); //crea la primera fila de la tabla con el encabezado
            
$tmp = array ( 'table_open'  => '<table class="table table-bordered table-striped" border="0" cellpadding="2" cellspacing="1" id="detalleTabla" width="60%">' );
            
$this->table->set_template($tmp);

            if(
$nroRemito !=NULL){
            
$detallesRemito=$this->consultas_model->getDetallesRemitoById($nroRemito,$datos->id);
            if(
$detallesRemito !=null){
                  foreach(
$detallesRemito as $file):
                      
$cantidadProdTabla=$cantidadProdTabla+1;
                    
$this->table->add_row($file->nombre,$file->descripcion,$file->cantidad,$file->precio,$file->descuento,'<input  class="btn btn-danger" type="button" name="eliminar" id="eliminar" value="Eliminar" onclick="elinminarRegistro('$file->idProducto.')">'); //agregamos la celda a la tabla por cada iteracion
                    
if ($file->descuento !=null){
                        
$subtotal=($file->cantidad*$file->precio);
                        
$desc=($file->cantidad*$file->precio*($file->descuento/100));
                        
$totalAlternativo=$totalAlternativo+($subtotal-$desc);
                    }
                    else{
                        
$totalAlternativo=$totalAlternativo+($file->cantidad*$file->precio);
                    }
                    

                  endforeach;

              }
              echo 
$this->table->generate();
            }
            
?>
           </div>
              
          <div class="col-md-12 form-inline" align="right">
            
             <label><b> SubTotal:    </b></label>      <input type="text" name="totalAlternativo" id="totalAlternativo" value="<?php echo ($totalAlternativo);?>"> 
            </div>
            
            <br>
            <div class="col-md-12 form-inline" align="right">
                <label><b>Descuento:</b></label>
                <select name="comboDescuentos" id="comboDescuentos"  class="form-control">
                <option></option>
               <?php $respuestaCombo=$this->consultas_model->getDescuentos(); foreach($respuestaCombo as $file):?>
                     <option><?= $file ?>%</option>
                <?php endforeach;?>
                </select>
                <input class="btn" type="button" name="descuentoBoton" id="descuentoBoton" value="Aplicar Descuento" onclick="aplicarDescuento(document.getElementById('comboDescuentos').value);">
            </div>
           <br>
           <div class="col-md-12 form-inline" align="right">
             <label><b> Total:    </b></label><input type="text" name="totalDefinitivo" id="totalDefinitivo" value="<?php echo ($totalAlternativo);?>"> 
          </div>
               <br>
           <div class="col-md-12" align="center">
                   <input class="btn btn-primary btn-large" type="button" name="newRemito" id="newRemito" value="Crear Remito" onclick="enviarPDF();">
           </div>

           <input type="hidden" name="primerIngreso" id="primerIngreso" value="1">
           <input type="hidden" name="cantidadRegistros" id="cantidadRegistros" value="<?php echo ($cantidadProdTabla);?>"> 
    </div>
    
          <div role="tabpanel" class="tab-pane estiloForm" id="profile">
    <div class="estiloForm col-sm-12" align="left">    
        <b>Nombre:</b>&nbsp;<input class="form-control input-sm" type="text" name="NombreCliente" id="NombreCliente" value="<?php  echo ($datos->nombre)?>" readonly>
        &nbsp;&nbsp;&nbsp;&nbsp;
        <b>Razon Social:</b>&nbsp;<input class="form-control input-sm" type="text" name="razon_social" id="razon_social" value="<?php  echo ($datos->razon_social)?>" readonly>
        &nbsp;&nbsp;&nbsp;&nbsp;

         <b>Mail:</b>&nbsp;<input class="form-control input-sm" type="text" name="mail" id="mail" value="<?php  echo ($datos->mail)?>"readonly>
        &nbsp;&nbsp;&nbsp;&nbsp;
        <b>Telefono:</b>&nbsp;<input class="form-control input-sm" type="text" name="telefonoCliente" id="telefonoCliente" value="<?php  echo ($datos->telefono)?>"readonly>

                      <br><br>
        <b>Direccion:</b>&nbsp;<input class="form-control input-sm" type="text" name="DireccionCliente" id="DireccionCliente" value="<?php  echo ($datos->direccion)?>" readonly>
        &nbsp;&nbsp;&nbsp;&nbsp;
        <b>Localidad:</b>&nbsp;<input class="form-control input-sm" type="text" name="LocalidadCliente" id="LocalidadCliente" value="<?php  echo ($datos->localidad)?>"readonly>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <b>IVA:</b>&nbsp;<input class="form-control input-sm" type="text" name="ResponsableCliente" id="ResponsableCliente" value="<?php  echo ($datos->iva)?>"readonly>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <b>Cuit:</b>&nbsp;<input class="form-control input-sm" type="text" name="CuitCliente" id="CuitCliente" value="<?php  echo ($datos->cuit)?>"readonly>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input class="form-control" type="hidden" name="idCliente" id="idCliente" value="<?php  echo ($datos->id)?>" readonly>
    </div>
              </div>
    </form>
</div>

<script type="text/javascript">
            
$().ready(function(){
    $.ajax({
       type: 'POST',
       url: '<?= base_url("remito/paginacionProductos")?>',
       success: function(data){
            $("#div_noticias").html(data);
       }
    });
})


    function busquedaProductos(){
        buscando=document.getElementById("buscando").value;
        $.ajax({
           type: 'POST',
           url: '<?= base_url("remito/paginacionProductos")?>',
           data: {buscando:buscando},
           success: function(data){
                $("#div_noticias").html(data);
           }
        });
    
     }

function enviarPDF(){
    var r=confirm("Desea crear Remito con los productos seleccionados");
    if (r == true) {
        numeroFactura=document.getElementById('NumeroRemito').value;
        total=document.getElementById('totalDefinitivo').value;
        if(numeroFactura != ""){
            location.href='<?php echo base_url()?>remito/remitoPDF?nroRemito='+numeroFactura+'&cliente='+document.getElementById('idCliente').value+'&monto='+total+'&descuento='+document.getElementById('comboDescuentos').value;
        }
        else{
            alert("Debe ingresarse un numero de Remito");
        }
    }
}
     

      function llenarPrecio(){
          var nombre =document.getElementById('comboProductos').value;
          $.ajax({
                 type: 'POST',
                 url: '<?php echo site_url("remito/consultaPrecios");?>',
                 data: {variable:nombre},
                 success:function(data){
                     respuesta=data.split(';');
                     $('#descripcionProducto').val(respuesta[0]); 
                     $('#precioProductoSeleccionado').val(respuesta[1]);
                 }
           });
      }
      function elinminarRegistro(id) {
          nroRemito=document.getElementById('NumeroRemito').value;
        
          //tengo que averiguar el registro que estoy borrando de la tabla y de la base de datos
          
            $.ajax({
                 type: 'POST',
                 url: '<?php echo site_url("remito/eliminar");?>',
                 data: {nroRemito:nroRemito, id:id},
                 success:function(data){
                    
                 }
                 });
             window.location.reload();
            
        }


      function aplicarDescuento(descuento){
             descuento1=descuento.split('%');
             valor=document.getElementById("totalDefinitivo").value;
             descuentoFinal=parseInt(descuento1);
             descuentoF=descuentoFinal*valor*0.01;
             valorFinal=(valor-descuentoF);
             $('#totalDefinitivo').val(valorFinal);
             $('#precios').hide();
         }

    function ingresarCarrito(producto,i,precio){
              cant="cantidadProd_"+i;
              cantidad=document.getElementById(cant).value;
              cantidadProductos=document.getElementById("cantidadRegistros").value;

              cantDesc="comboDescuentos_"+i;
              descuentoProducto=document.getElementById(cantDesc).value;
              if(descuentoProducto !=null){
                    descuentoProd=descuentoProducto.split('%');
        
              }
              cantProd=parseInt(cantidadProductos,10);

              if ((cantidad>0) && (cantProd< 20) ){
                 
                 numeroRemito=document.getElementById("NumeroRemito").value;
                 cliente=document.getElementById("idCliente").value;
                 document.getElementById("cantidadRegistros").value=(cantProd+1);
                 if(descuentoProd!=null){
                     subtotal=precio *cantidad;
                     descuento=(precio *cantidad * (descuentoProd[0]/100) );
                     suma=subtotal-descuento;

                 }else{
                     suma=(precio *cantidad);
                 }
                 descuentoProd=descuentoProd[0];
                 total=document.getElementById("totalAlternativo").value;
                 $.ajax({
                         type: 'POST',
                         url: '<?php echo site_url("remito/registrarDetalleRto");?>',
                         data: {numeroRemito:numeroRemito, producto:producto, cantidad:cantidad, suma:suma, cliente:cliente,descuentoProd:descuentoProd,total:total},
                         success:function(data){
                             respuesta=data.split(';');
                             valor=parseFloat(suma);
                              $('#totalAlternativo').val((parseFloat(document.getElementById("totalAlternativo").value)+parseFloat(suma)).toFixed(2));
                              $('#totalDefinitivo').val((parseFloat(document.getElementById("totalDefinitivo").value)+parseFloat(suma)).toFixed(2));
                              $("#detalleTabla").append("<tr><td>" + respuesta[0] + "</td><td>" + respuesta[1] + "</td><td>" + cantidad + "</td><td>" +  precio+ "</td><td>" + descuentoProducto + "</td><td><input class='btn btn-danger' type='button' name='eliminar' id='eliminar' value='Eliminar' onclick='elinminarRegistro('. producto.')'></td></tr>");
                         }
                 });
                 noHayRegistrosTabla=true;
              }
              else{
                  if(cantProd >= 10){
                      alert("No pueden ingresarse mas de 20 items al Remito");
                  }else{
                      alert("Debe ingresar un valor mayor a 0 para poder ingresar al carrito");
                   }
                 
                }
           }
       document.onkeydown = function(){ 
            if (window.event && (window.event.keyCode == 8)) 
            { 
            valor = document.activeElement.value; 
            if (valor==undefined) { return false; } //Evita Back en página. 
            else 
            { 
            if (document.activeElement.getAttribute('type')=='sel ect-one') 
            { return false; } //Evita Back en select. 
            if (document.activeElement.getAttribute('type')=='but ton') 
            { return false; } //Evita Back en button. 
            if (document.activeElement.getAttribute('type')=='rad io') 
            { return false; } //Evita Back en radio. 
            if (document.activeElement.getAttribute('type')=='che ckbox') 
            { return false; } //Evita Back en checkbox. 
            if (document.activeElement.getAttribute('type')=='fil e') 
            { return false; } //Evita Back en file. 
            if (document.activeElement.getAttribute('type')=='res et') 
            { return false; } //Evita Back en reset. 
            if (document.activeElement.getAttribute('type')=='sub mit') 
            { return false; } //Evita Back en submit. 
            else //Text, textarea o password 
            { 
            if (document.activeElement.value.length==0) 
            { return false; } //No realiza el backspace(largo igual a 0). 
            else 
            { document.activeElement.value.keyCode = 8; } //Realiza el backspace. 
            } 
            } 
            
            }
        if(window.event && window.event.keyCode == 505){ 
             window.event.keyCode = 505; 
        } 
       }
   
</script>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0086 ]--