<?
 require ("open_db_prod.php" );

 $camposDisp[Procesador]=;
 $camposDisp[PlacaBase]=;
 $camposDisp[Memoria]=;
 $camposDisp[DiscoDuro]=;
 $camposDisp[CD]=;
 $camposDisp[Grabadora]=;
 $camposDisp[Grafica]=;
 $camposDisp[Sonido]=;
 $camposDisp[Altavoces]=;
 $camposDisp[TecladoRaton]=;
 $camposDisp[Monitor]=;
 $camposDisp[Modem]=;
 $camposDisp[Red]=;
 $camposDisp[SO]=;
 $camposDisp[Impresora]=;
 $camposDisp[Scanner]=;


 function rSelect( $campoSel )
 {
    
 }
?>

<p><!--webbot bot="HTMLMarkup" startspan --><style  TYPE="TEXT/CSS">.g_si { BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px
solid; } .g_sc { BORDER-TOP: black 1px solid; } .g_sd { BORDER-TOP:
black 1px solid; BORDER-RIGHT: black 1px solid; } .g_ci { BORDER-LEFT:
black 1px solid; } .g_dc { BORDER-RIGHT: black 1px solid; } .g_ii
{ BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; }
.g_ic { BORDER-BOTTOM: black 1px solid; } .g_id { BORDER-BOTTOM:
black 1px solid; BORDER-RIGHT: black 1px solid; } .g_sel { color: #FFDF00; width:150px; } .g_tot {text-align:right;}
.g_opt {text-align:right;}
</style> <!--webbot
bot="HTMLMarkup" endspan --><script language="JavaScript"><!--
var camposDisp = new Array("Procesador", "PlacaBase", "Memoria", "DiscoDuro", "CD", "Grabadora", "Grafica", "Sonido", "Altavoces", "TecladoRaton", "Monitor", "Modem", "Red", "SO", "Impresora", "Scanner");

function acota( N )
{
 return Math.round(eval(N)*100) / 100;
}

function fijaCambios( campo )
{
 eval( "generador.i"+campo+".value=generador.s"+campo+".options[generador.s"+campo+".selectedIndex].value");

 var sumaBaseImp = 0.0;
 for ( i=0; i<camposDisp.length; i++)
   sumaBaseImp = eval(sumaBaseImp) + eval( eval( "generador.i"+camposDisp[i]+".value" ));

 generador.baseImp.value = acota( sumaBaseImp );
 generador.iva.value = acota( eval(sumaBaseImp)*0.16 );
 generador.total.value = acota( eval(sumaBaseImp)*1.16 );
}

function componerURL()
{

 var ParamURL = "";
 for ( i=0; i<camposDisp.length; i++)
   ParamURL +="&s"+camposDisp[i]+"="+eval("generador.s"+camposDisp[i]+".options[generador.s"+camposDisp[i]+".selectedIndex].text")
				+ "&i"+camposDisp[i]+"="+eval("generador.s"+camposDisp[i]+".options[generador.s"+camposDisp[i]+".selectedIndex].value")

 alert( "Esta será la cadena pasada:\n\n"+ParamURL );

}

// --></script></p>

<form method="POST" name="generador">
    <table border="0" cellpadding="5" cellspacing="0">
        <tr>
            <td valign="top" width="240"><div align="center"><center><table
            border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td><img src="prod/images/move66.gif" width="150"
                    height="150"></td>
                </tr>
                <tr>
                    <td><div align="center"><center><table
                    border="0" cellspacing="0"
                    style="border-left: black 1px solid;border-right: black 1px solid;border-bottom: black 1px solid;">
                        <tr>
                            <td align="center" colspan="2"
                            bgcolor="#000000"
                            style="text-align:center;">Equipo
                            Actual</td>
                        </tr>
                        <tr>
                            <td>Base Imp.:</td>
                            <td><input type="text" size="10"
                            name="baseImp" class="g_tot" readonly></td>
                        </tr>
                        <tr>
                            <td>i.v.a. 16%:</td>
                            <td><input type="text" size="10"
                            name="iva" class="g_tot" readonly></td>
                        </tr>
                        <tr>
                            <td
                            style="border-top:black 1px solid;">Total:</td>
                            <td
                            style="border-top:black 1px solid;"><input
                            type="text" size="10" name="total"
                            class="g_tot" readonly></td>
                        </tr>
                    </table>
                    </center></div></td>
                </tr>
            </table>
            </center></div><p>Elige los componentes de tu
            ordenador y no se te olvide <u>combinar</u>
            correctamente el tipo de <u>Procesador</u>, <u>PlacaBase</u>
            y <u>Memoria</u>.</p>
            <p>Cuando acabes, puedes pulsar &quot;<a
            href="javascript:componerURL();">Generar Presupuesto</a>&quot;,
            para obtener un resumen de tu selección.</p>
            <p>Además si pinchas en la &quot;bombilla&quot;,
            obtendras información sobre ese componente y su
            función dentro del equipo.</p>
            </td>
            <td><div align="center"><center><table border="0"
            cellspacing="0">
                <tr>
                    <td class="g_si">Procesador:</td>
                    <td class="g_sc"><select name="sProcesador"
                    size="1" onchange="fijaCambios('Procesador')"
                    class="g_sel">
                        <option selected value="300.50">AMD K7 XP 1800 Mhz</option>
                        <option value="400.50">AMD K7 XP 2000 Mhz</option>
                    </select></td>
                    <td class="g_sd"><input type="text" size="6"
                    name="iProcesador" class="g_opt" readonly></td>
                    <td><a
                    href="javascript:help(%22procesador%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td class="g_ci">Placa Base:</td>
                    <td><select name="sPlacaBase" size="1"
                    onchange="fijaCambios('PlacaBase')"
                    class="g_sel">
<? rSelect( 'PlacaBase' ); ?>
                    </select></td>
                    <td class="g_cd"><input type="text" size="6"
                    name="iPlacaBase" class="g_opt" readonly></td>
                    <td><a
                    href="javascript:help(%22placabase%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td class="g_ii">Memoria:</td>
                    <td class="g_ic"><select name="sMemoria"
                    size="1" onchange="fijaCambios('Memoria')"
                    class="g_sel">
<? rSelect( 'Memoria' ); ?>
                    </select></td>
                    <td class="g_id"><input type="text" size="6"
                    name="iMemoria" class="g_opt" readonly></td>
                    <td><a href="javascript:help(%22memoria%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td class="g_si">Disco Duro:</td>
                    <td><select name="sDiscoDuro" size="1"
                    onchange="fijaCambios('DiscoDuro')"
                    class="g_sel">
<? rSelect( 'DiscoDuro' ); ?>
                    </select></td>
                    <td><input type="text" size="6"
                    name="iDiscoDuro" class="g_opt" readonly></td>
                    <td><a
                    href="javascript:help(%22discoduro%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td class="g_ci">CD / DVD:</td>
                    <td><select name="sCD" size="1"
                    onchange="fijaCambios('CD')" class="g_sel">
<? rSelect( 'CD' ); ?>
                    </select></td>
                    <td><input type="text" size="6" name="iCD"
                    class="g_opt" readonly></td>
                    <td><a href="javascript:help(%22opticos%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td class="g_ii">ReGrabadora:</td>
                    <td><select name="sGrabadora" size="1"
                    onchange="fijaCambios('Grabadora')"
                    class="g_sel">
<? rSelect( 'Grabadora' ); ?>
                    </select></td>
                    <td><input type="text" size="6"
                    name="iGrabadora" class="g_opt" readonly></td>
                    <td><a
                    href="javascript:help(%22grabadora%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td class="g_si">Gráfica:</td>
                    <td><select name="sGrafica" size="1"
                    onchange="fijaCambios('Grafica')"
                    class="g_sel">
                        <option selected value="0">standard</option>
<? rSelect( 'Grafica' ); ?>
                    </select></td>
                    <td><input type="text" size="6"
                    name="iGrafica" class="g_opt" readonly></td>
                    <td><a href="javascript:help(%22grafica%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td class="g_ci">Sonido:</td>
                    <td><select name="sSonido" size="1"
                    onchange="fijaCambios('Sonido')" class="g_sel">
                        <option selected value="0">standard</option>
                        <option value="50.1">SB 5.1</option>
                    </select></td>
                    <td><input type="text" size="6"
                    name="iSonido" class="g_opt" readonly></td>
                    <td><a href="javascript:help(%22sonido%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td class="g_ii">Altavoces:</td>
                    <td><select name="sAltavoces" size="1"
                    onchange="fijaCambios('Altavoces')"
                    class="g_sel">
                        <option selected value="0">ninguno</option>
<? rSelect( 'Altavoces' ); ?>
                    </select></td>
                    <td><input type="text" size="6"
                    name="iAltavoces" class="g_opt" readonly></td>
                    <td><a
                    href="javascript:help(%22altavoces%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td class="g_si">Teclado y Raton:</td>
                    <td><select name="sTecladoRaton" size="1"
                    onchange="fijaCambios('TecladoRaton')"
                    class="g_sel">
                        <option selected value="0">standard</option>
<? rSelect( 'TecladoRaton' ); ?>
                    </select></td>
                    <td><input type="text" size="6"
                    name="iTecladoRaton" class="g_opt" readonly></td>
                    <td><a
                    href="javascript:help(%22tecladoraton%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td class="g_ii">Monitor:</td>
                    <td><select name="sMonitor" size="1"
                    onchange="fijaCambios('Monitor')"
                    class="g_sel">
                        <option selected value="0">ninguno</option>
<? rSelect( 'Monitor' ); ?>
                    </select></td>
                    <td><input type="text" size="6"
                    name="iMonitor" class="g_opt" readonly></td>
                    <td><a href="javascript:help(%22monitor%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td class="g_si">Modem:</td>
                    <td><select name="sModem" size="1"
                    onchange="fijaCambios('Modem')" class="g_sel">
                        <option selected value="0">ninguno</option>
<? rSelect( 'Modem' ); ?>
                    </select></td>
                    <td><input type="text" size="6" name="iModem"
                    class="g_opt" readonly></td>
                    <td><a href="javascript:help(%22modem%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td class="g_ii">Tarjeta de Red:</td>
                    <td><select name="sRed" size="1"
                    onchange="fijaCambios('Red')" class="g_sel">
                        <option selected value="0">ninguno</option>
<? rSelect( 'Red' ); ?>
                    </select></td>
                    <td><input type="text" size="6" name="iRed"
                    class="g_opt" readonly></td>
                    <td><a href="javascript:help(%22red%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>Sistema Operativo:</td>
                    <td><select name="sSO" size="1"
                    onchange="fijaCambios('SO')" class="g_sel">
                        <option selected value="0">ninguno</option>
<? rSelect( 'SO' ); ?>
                    </select></td>
                    <td><input type="text" size="6" name="iSO"
                    class="g_opt" readonly></td>
                    <td><a href="javascript:help(%22so%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td class="g_si">Impresora:</td>
                    <td><select name="sImpresora" size="1"
                    onchange="fijaCambios('Impresora')"
                    class="g_sel">
                        <option selected value="0">ninguno</option>
<? rSelect( 'Impresora' ); ?>
                    </select></td>
                    <td><input type="text" size="6"
                    name="iImpresora" class="g_opt" readonly></td>
                    <td><a
                    href="javascript:help(%22impresora%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
                <tr>
                    <td class="g_ii">Scanner:</td>
                    <td><select name="sScanner" size="1"
                    onchange="fijaCambios('Scanner')"
                    class="g_sel">
                        <option selected value="0">ninguno</option>
<? rSelect( 'Scanner' ); ?>
                    </select></td>
                    <td><input type="text" size="6"
                    name="iScanner" class="g_opt" readonly></td>
                    <td><a href="javascript:help(%22scanner%22);"><img
                    src="prod/images/idea.gif" border="0" width="16"
                    height="16"></a></td>
                </tr>
            </table>
            </center></div></td>
        </tr>
    </table>
</form>

<p><script language="JavaScript"><!--
for ( i=0; i<camposDisp.length; i++)
 eval( "generador.i"+camposDisp[i]+".value=generador.s"+camposDisp[i]+".options[generador.s"+camposDisp[i]+".selectedIndex].value");

 var sumaBaseImp = 0.0;
 for ( i=0; i<camposDisp.length; i++)
   sumaBaseImp = eval(sumaBaseImp) + eval( eval( "generador.i"+camposDisp[i]+".value" ));
 generador.baseImp.value = acota( sumaBaseImp );
 generador.iva.value = acota( eval(sumaBaseImp)*0.16 );
 generador.total.value = acota( eval(sumaBaseImp)*1.16 );
// --></script></p>




<?
 mysql_free_result($res);
 mysql_close($conexion_prod);
?>