Tema: Combo Box
Ver Mensaje Individual
  #5 (permalink)  
Antiguo 05/09/2006, 16:15
vilagutv7
 
Fecha de Ingreso: julio-2006
Mensajes: 150
Antigüedad: 17 años, 9 meses
Puntos: 0
Código PHP:
///pasar pa la derecha ord alquiler
function pasar_der_alq() {
    obj=document.getElementById('todas_ordenes');
    if (obj.selectedIndex==-1) return;
    valor=obj.value;
    document.form1.alquiler.value = document.form1.alquiler.value+valor+"*";
    txt=obj.options[obj.selectedIndex].text;
    obj.options[obj.selectedIndex]=null;
    obj2=document.getElementById('seleccion_ordenes');
    opc = new Option(txt,valor);
    eval(obj2.options[obj2.options.length]=opc);
}

//remover las alquiler
function eliminar_alquiler(texto,codigo){
    var foo = texto;
    var arreglo1 = foo.split("*");
    var resultado = "";
    for(var i = 0;i<arreglo1.length-1;i++){
          var cadena = arreglo1[i]; 
          if(cadena != codigo){
            resultado = resultado+cadena+"*";
        }
    }
    document.form1.alquiler.value = resultado;
}

//pasar izquierda ord alquiler
function pasar_izq_alq() {
    obj=document.getElementById('seleccion_ordenes');
    if (obj.selectedIndex==-1) return;
    valor=obj.value;
    eliminar_alquiler(document.form1.alquiler.value,valor);
    txt=obj.options[obj.selectedIndex].text;
    obj.options[obj.selectedIndex]=null;
    obj2=document.getElementById('todas_ordenes');
    opc = new Option(txt,valor);
    eval(obj2.options[obj2.options.length]=opc);
}
<div id="cuerpo" style="position:absolute; left:109px; top:94px; width:692px; height:580px; z-index:3">
<form name="form1" method="post" action="">
  <?php    
    conexion_alc
('root','114622');
      if (
$_POST["opcion"]!= "ingreso"){
          
$rif_cliente $_POST["cliente"];
          
$factura $_POST["factura"];
        
$status $_POST["status"];
        
$razon $_POST["razon"];
  
?>        
  <p align="center">Seleccione las Ordenes de Alquiler a Facturar     </p>
  <table width="685" border="1" align="center">
    <tr>
      <td width="52"># Orden </td>
      <td width="144">Fecha Inicio (A-M-D) </td>
      <td width="79">Monto Total </td>
      <td width="89">&nbsp;</td>
      <td width="53"># Orden </td>
      <td width="144">Fecha Inicio (A-M-D) </td>
      <td width="78">Monto Total </td>
    </tr>
    <tr>
      <td colspan="3" rowspan="2"><?php combo_ordalq_factura($rif_cliente); ?></td>
      <td height="50"><div align="center">
        <input name="der_alq" type="button" id="der_alq" value="&gt;&gt;" onClick="pasar_der_alq()">
      </div></td>
      <td colspan="3" rowspan="2"><select name="seleccion_ordenes" size="7" id="seleccion_ordenes">
      </select>
      </td>
    </tr>
    <tr>
      <td><div align="center">
        <input name="izq_alq" type="button" id="izq_alq" value="&lt;&lt;" onClick="pasar_izq_alq()">
      </div></td>
    </tr>
  </table>
  <p align="center">Seleccione las Ordenes de Reparacion a Facturar </p>
  <table width="690" border="1" align="center">
    <tr>
      <td width="52"># Orden </td>
      <td width="149">Fecha  Reparacion </td>
      <td width="79">Monto Total </td>
      <td width="88">&nbsp;</td>
      <td width="52"># Orden </td>
      <td width="145">Fecha Reparacion </td>
      <td width="79">Monto Total </td>
    </tr>
    <tr>
      <td colspan="3" rowspan="2"><?php combo_ordrep_factura($rif_cliente); ?></td>
      <td height="56"><div align="center">
        <input name="der_rep" type="button" id="der_rep" value="&gt;&gt;" onClick="pasar_der_rep()">
      </div></td>
      <td colspan="3" rowspan="2"><select name="seleccion_rep" size="7" id="seleccion_rep">
                  </select></td>
    </tr>
    <tr>
      <td><div align="center">
        <input name="izq_rep" type="button" id="izq_rep" value="&lt;&lt;" onClick="pasar_izq_rep()">
      </div></td>
    </tr>
  </table>
  <p align="center">Seleccione los Productos que quiere Facturar </p>
  <table width="691" border="1">
    <tr>
      <td width="53">Codigo</td>
      <td width="145">Nombre</td>
      <td width="81">Precio Venta </td>
      <td width="88">Cant
        <input name="cantidad" type="text" id="cantidad" size="1"></td>
      <td width="45">Codigo</td>
      <td width="146">Nombre</td>
      <td width="87">Precio Venta </td>
    </tr>
    <tr>
      <td colspan="3" rowspan="2"><?php combo_prod_factura(); ?></td>
      <td height="61"><div align="center">
        <input name="der_prod" type="button" id="der_prod" value="&gt;&gt;" onClick="pasar_der_prod()">
      </div></td>
      <td colspan="3" rowspan="2"><select name="seleccion_productos" size="7" id="seleccion_productos">
      </select>
      </td>
    </tr>
    <tr>
      <td><div align="center">
        <input name="izq_prod" type="button" id="izq_prod" value="&lt;&lt;" onClick="pasar_izq_prod()">
      </div></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <table width="200" border="0" align="center">
    <tr>
      <td width="89"><div align="center">
        <input name="Ingresar" type="submit" id="Ingresar" value="Ingresar" onClick="ingresar()">
      </div></td>
      <td width="101">&nbsp;</td>
    </tr>
  </table>
  <p align="center"><input name="opcion" type="hidden" id="opcion">
      <input name="productos" type="hidden" id="productos">
      <input name="alquiler" type="hidden" id="alquiler">
      <input name="reparacion" type="hidden" id="reparacion">
      <input name="cliente" type="hidden" id="cliente" value= "<?php if ($_POST){echo $rif_cliente;}?>">
      <input name="factura" type="hidden" id="factura" value= "<?php if ($_POST){echo $factura;}?>">
      <input name="status" type="hidden" id="status" value= "<?php if ($_POST){echo $status;}?>">
      <input name="razon" type="hidden" id="razon" value= "<?php if ($_POST){echo $razon;}?>">
  </p>
  </form>
    <div id="boton cancelar" style="position:absolute; left:357px; top:676px; width:67px; height:26px; z-index:4">
  <form name="cancelar" method="post" action="Home.php" >
  <input type="submit" name="cancelar" value="Cancelar" >
  </form>
  </div>

Última edición por Cluster; 05/09/2006 a las 19:13