%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/requisiciones/
Upload File :
Create Path :
Current File : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/requisiciones/mostrar_carrito.php

<div class="page-content">


					<div id="resultados" class='col-md-12'></div><!-- Carga los datos ajax -->
                        <div class="col-md-2">

                            <div class="row mbm center">

                           <a href="page_add_carrito.php?app=1" class="btn btn-pink">Regresar&nbsp;<i class="fa fa-mail-reply-all"></i></a>

                            </div>

                        </div> 

				<script>
                            
                            
        function eliminar(id)
		{  
		
         	var id2 = id;
		    
		
			    $.ajax({
                type: "POST",
                url: "carrito.php",
                data: "id="+id2+"&btnAccion=Eliminar",
		        beforeSend: function(objeto){
			    $("#resultados").html("Mensaje: Cargando...");
		    },
                success: function(datos){
		        $("#resultados").html(datos);
		    }
			});
		}
		 function updateCantidad(id,contador)
		{  
		
         	var id2 = id;
		    var cantidad = document.getElementsByName('cantidad_requerida[]')[contador].value;
		    
			    $.ajax({
                type: "POST",
                url: "carrito.php",
                data: "id="+id2+"&cantidad="+cantidad+"&btnAccion=updateCantidad",
		        beforeSend: function(objeto){
			    $("#resultados").html("Mensaje: Cargando...");
		    },
                success: function(datos){
		        $("#resultados").html(datos);
		    }
			}); 
		}
		
    </script>

<br>
<h3> Lista de articulos a solicitar</h3>
<?php if(!empty($_SESSION['CARRITO'])) { ?>
<table class="table table-light table-bordered">
	<tbody>
		<tr>
			
			
			<th width="20%" class="text-center">Codigo</th>
			<th width="40%" class="text-center">Articulo</th>
		    <th width="20%" class="text-center">Foto</th>
		    <th width="15%" class="text-center">Cantidad</th>
			<th width="5%">-----</th>
		</tr>
<form data-toggle="validator" action="page_firma_requisicion.php" method="post" name="Registrar" onsubmit="return checkForm(this)" class="btn btn-success">
    		
            		<?php $contador = 0; foreach($_SESSION['CARRITO'] as $indice=>$producto){
            		    
            		    $existenciaReal = $producto['EXISTENCIAS'];
            			       
            		 if($producto['CODIGO'] == 'TJAM235'){
            			     
            			     if($existenciaReal <= $_SESSION['cafe_limit'])
            			        $max = $existenciaReal;
            			      else
            			         $max = $_SESSION['cafe_limit'];
            			 
            			 }
            			 else
            			   {
            			            $max = $producto['EXISTENCIAS'];
            			   }
            		?>
            		<tr>
            		    
            			   <?php $id_producto =  $producto['ID'];?>
            		    <input type="hidden" checked name ="id_articulo[]" class="form-control" value="<?php echo $producto['ID']?>">
            		    <td width="20%" class="text-center"><?php echo $producto['CODIGO']?></td>
            			<td width="40%"><?php echo $producto['ARTICULO']?></td>
            			 <td width="20%" class="text-center"><?php echo '<img src="../compras/docs/'.$producto['IMAGEN'].'" title="foto" height="150" width="150" />';?></td>
            			 <td width="15%" class="text-center"><input type="number" name ="cantidad_requerida[]" onchange="updateCantidad('<?php echo $id_producto ?>','<?php echo $contador ?>');"  class="form-control" min="1" value="<?php echo $producto['CANTIDAD']; ?>" max="<?php echo $max; ?>"></td>
            			<td width="5%"> 
            			
            				
            				<span class="pull-right"> <a  class="btn btn-danger"  href="javascript:location.reload()"  onclick="eliminar('<?php echo $id_producto ?>');"> Eliminar <i class="glyphicon glyphicon-remove"></i></a></span>         			
            			</td>
            		</tr>
            		
            		<?php $contador++;} ?>
            		<tr>

            		</tr>
            	<!--	
                    <div class="row">

                        <div class="col-md-12">
                            <div class="form-group"><label for="inputName" class="control-label"><dt>Nombre de quién Elaborá la Solicitud</dt></label><span class='require'> *</span>
                                <div class="input-icon left"><i class="fa fa-user"></i><input id="cliente" type="text" name="nombre"  class="form-control" required /></div>
                            </div>
                        </div>
              </div>    
                       
                <div class="row">

                        <div class="col-md-12">
                            <div class="form-group"><label for="inputName" class="control-label"><dt>Puesto</dt></label><span class='require'> *</span>
                                <div class="input-icon left"><i class="fa fa-user"></i><input id="cliente" type="text" name="puesto"  class="form-control" required /></div>
                            </div>
                        </div>
              </div>   -->
              
                	<tr>
                	    
                	    <td width="50%" class="text-center"></td>
                	    <td width="50%" class="text-center">	
                	    <button type="submit" name="Registrar" class="btn btn-success" >
    					Solicitar la Requisición >>>
    					</button></td>
                	    
    				
    				
    					
    					
    					
</form>
    			
    		        </tr>
    		        <tr>
                		<td colspan="5">
                		<form action="controller/limpiar_carrito.php" method="post">
    				 <div class="col-md-2">

    					<button class="btn btn-danger btn-lg btn-block" type="submit"
    					name="btnAccion"
    					value="proceder">
    					Limpiar Carrito
    					</button>
    					</div>
    			        </form>
    			
    			        </td>
    		        </tr>
		
	</tbody>
</table	

<?php }else{ ?>

<div class="alert alert-success">
	No hay productos en el carrito....
</div>

<?php }?>



Zerion Mini Shell 1.0