Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/04/2016, 09:26
neocalichin
 
Fecha de Ingreso: enero-2012
Mensajes: 158
Antigüedad: 12 años, 10 meses
Puntos: 1
Información combobox sin perder seleccion

Estimados una consulta muy urgente, pues vengo bastante tiempo buscando esto y no encuentro..

Tengo dos formularios
PRIMER FOMULARIO BUSCA

el catalogo en un combo y el articulo en una caja de texto y el boton buscar...
mas abajo el boton "AÑADIR"

lo que hace es que cuando lo encuentra al darle click en el boton añadir
lo lleva a mi grilla que se encuentra en el siguiente FORMULARIO GRILLA

me funciona correctamente....

LO QUE QUIERO ES QUE CUANDO DEAN CLICK EN EL BOTON AÑADIR AL CARGAR LA PAGINA NO SE BORRE LA SELECCION DEL COMBOBOX
Código PHP:
<form method="post" action="insertar/GrabarBorradorDetPedido.php">        
            
                <?php
                 
                 $catalogos
=isset($_POST["catalogo"])? $_POST["catalogo"]: ''
                 
$buscando=isset($_POST["articulos"])? $_POST["articulos"]: ''
                 
$buscar="";
                
               
                
                
$tabla "TGE_ARTICULOS";

                
//$sql="select top 10 * from TGE_ARTICULOS where art_codigo like '%$buscar%' or art_descrip like '%$buscar%'";                    
                //$rs=sqlsrv_query($conn,$sql) or die ("No ejecuto la TABLA : $tabla");
                
$cia="00001";
                
$sucursal="01";
                
$almacen="02";
                
                if (
$buscando=="") {
                
                        
$sql="exec sp_busca_articulo_6_web '$cia','$sucursal','$almacen','$buscar','','','T','$catalogos'";
                                              
                                }
                else
                                             {
                        
$sql="exec sp_busca_articulo_6_web '$cia','$sucursal','$almacen','$buscando','','','T','$catalogos'";
                                }
                                                                        
                
$rs=sqlsrv_prepare($conn,$sql);
                
sqlsrv_execute($rs);

                
MostrarTabla($tabla$rs$conn$sql);
                
                
                
?>
                
        
        
                  <?php
                            
function MostrarTabla($tabla,$rs,$sw){
                            
$campossqlsrv_num_fields($rs);
                            
$numfilas=sqlsrv_num_rows($rs);
                            
$sw=1;
                    
?>
                    
    
                        <table class="uk-table">
                                    <thead>
                                        <tr bgcolor="#B6D1F2">
                                            <th><b></b></th>
                                            <th><b>ARTICULO</b></th>
                                            <th><b>IMAGEN</b></th>
                                            <th><b>DESCRIPCIÓN</b></th>
                                              <th><b>STOCK</b></th>
                                            <th><b>PRECIO</b></th>
                                            <th><b>CANTIDAD</b></th>
                                            <th><b></b></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                    
                    <?php while($filas=sqlsrv_fetch_array($rs)){
                        if(
$sw=="1")
                        {
                     
?>                
                                        <tr>
                                            <td style="visibility:hidden"><input type="checkbox"  value="<?=$filas[0]?>" name="art_codigo[]" checked="checked" ></td>
                                            <td class="uk-text-nowrap"><?=$filas[0]?>&nbsp;|&nbsp;<?=$filas[38]?></td>
                                        
                                            
                                             
                                          
                                           <td class="uk-text-nowrap">
                                           <a href=VerImagen.php?cod=<?=$filas[0]?> target="_blank" onClick="window.open(this.href,this.target,'width=250,height=250,top=100,left=200,toolbar=no,location=no,status=no,menubar=no');return false;">
                                           <img src="<?php
                                           $img
=$filas[35];
                                           
$fot=substr($img34,37); 
                                           echo 
$fot;
                                           
?>" border="0" width="30px" height="30px" class="zoom">                                           </a>                                           </td>
                                            
                                          
                                            <td class="uk-text-nowrap"><?=utf8_encode($filas[2])?></td>
                                            <td class="uk-text-nowrap"><?php 
                                                                        $numero
=$filas[27];
                                                                        
$resultado=number_format($numero,2'.''');
                                                                        if (
$resultado >=1)
                                                                                    {
                                                                                        echo 
"<font color='#444999'><b>$resultado</b></font>"
                                                                                 }
                                                                        else
                                                                                     {
                                                                                          echo 
"<font color='#FF0000'><b>$resultado</b></font>"
                                                                                }
                                                                         
                                                                        
?></td> 
                                            <td class="uk-text-nowrap"><input type="text" name="precio[]" style="width:40PX" value="<?=number_format($filas[19],2'.''')?>" readonly="" /></td>
                                            <td class="uk-text-nowrap"><input type="text" name="cantidad[]" style="width:40PX"  onKeyPress="return esInteger(event)"  /></td>
                                            <td class="uk-text-nowrap" style="visibility:hidden"><input type="text" name="stock[]" style="width:40PX" value="<?=utf8_encode($filas[27])?>" readonly=""  /></td>
                                        </tr>
                    <?php 
                        $sw
="0";
                        }elseif(
$sw=="0")
                        {
                       
?>                        
                                        <tr> 
                                            <td style="visibility:hidden" ><input type="checkbox"  value="<?=$filas[0]?>" name="art_codigo[]" checked="checked" ></td>  
                                             <td class="uk-text-nowrap"><?=$filas[0]?>&nbsp;|&nbsp;<?=$filas[38]?></td>
                                            
                                           <td class="uk-text-nowrap">
                                           <a href=VerImagen.php?cod=<?=$filas[0]?> target="_blank" onClick="window.open(this.href,this.target,'width=250,height=250,top=100,left=200,toolbar=no,location=no,status=no,menubar=no');return false;">
                                           <img src="<?php
                                           $img
=$filas[35];
                                           
$fot=substr($img34,37); 
                                           echo 
$fot;
                                           
?>" border="0" width="30px" height="30px" class="zoom">                                           </a>                                           </td>
                                            
                                            
                                            
                                            
                                           
                                            <td class="uk-text-nowrap"><?=utf8_encode($filas[2])?></td>
                                            <td class="uk-text-nowrap"><?php 
                                                                        $numero
=$filas[27];
                                                                        
$resultado=number_format($numero,2'.''');
                                                                        if (
$resultado >=1)
                                                                                    {
                                                                                        echo 
"<font color='#444999'><b>$resultado</b></font>"
                                                                                 }
                                                                        else
                                                                                     {
                                                                                          echo 
"<font color='#FF0000'><b>$resultado</b></font>"
                                                                                }
                                                                         
                                                                        
?></td> 
                                            <td class="uk-text-nowrap"><input type="text" name="precio[]" style="width:40PX" value="<?=number_format($filas[19],2'.''')?>" readonly="" /></td> 
                                            <td class="uk-text-nowrap"><input type="text" name="cantidad[]" style="width:40PX" onKeyPress="return esInteger(event)" /></td> 
                                            <td class="uk-text-nowrap" style="visibility:hidden"><input type="text" name="stock[]" style="width:40PX" value="<?=utf8_encode($filas[27])?>" readonly=""   /></td>
                                        </tr>
                                        
                <?php
                            $sw
="1";
                            }
                            } 
                
?>                     
                                    </tbody>
                          </table>
            <?php             
            

            
?>
    
            <div style="visibility:hidden"><input type="text" name="codinterval" value="<?php echo $referencia ?>" readonly=""></div>
            
            <!--<div align="center"><button type="submit" class="md-btn md-btn-primary uk-margin-small-top"><i class="fa fa-save"></i>Añadir</button></div> -->
            <?php
                            $opcion
="NO";
                            if (
$tipocliente <> $opcion)
                            {
                                echo 
"<div align='center'><button type='submit' class='md-btn md-btn-primary uk-margin-small-top'><i class='fa fa-save'></i>Añadir</button></div>";
                            }
                                else
                            {
                              echo 
"<div align='center'><button type='submit' class='md-btn md-btn-primary uk-margin-small-top' disabled='disabled'><i class='fa fa-save'></i>Añadir</button></div>";
                            }
            
?>
        
            </form>
por favor esto es urgente ayudenmeeeeee