<?php
function idmarca()
{
	include("config.php");
	$query = "SELECT idmarca, descripcion from marca order by descripcion";
	$result = mysql_query($query);

	echo "<select class='round' name='idmarca' id='idmarca' style='width: 155px'>";
	echo "<option value=''>Selecciona la marca</option>";
	while($registro=mysql_fetch_array($result))
	{
		echo "<option value='".$registro[0]."'>".$registro[1]."</option>";
	}
	echo "</select>";
}



function idmodelo()
{
	include("config.php");
	$query = "SELECT idmodelo, descripcion FROM modelo order by descripcion";
	$result = mysql_query($query);
	echo "<select class='round' name='idmodelo' id='idmodelo' style='width: 155px'>";
	echo "<option value=''>Selecciona el modelo</option>";
	echo "</select>";
}

function idfabricacion()
{
	echo "<select class='round' name='idfabricacion' id='idfabricacion' style='width: 155px'>";
		echo "<option value=''>A&ntilde;o de fabricaci&oacute;n</option>";
		$numero = date ("Y");
		while($numero>=1995)
			{
				echo "<option value='".$numero."'";
				echo ">".$numero."</option>";
				$numero--;
			} 
	echo "</select>";
}

function fecha()
{
	echo "<select class='round' name='dia' id='dia' style='width: 42px'>";
		$dia = 1;
		while($dia<=31)
			{
				echo "<option value='".$dia."'";
				echo ">".$dia."</option>";
				$dia++;
			} 
	echo "</select>";
	echo "<select class='round' name='mes' id='mes' style='width: 53px'>";
		echo "<option value='1'>Ene</option>";
		echo "<option value='2'>Feb</option>";
		echo "<option value='3'>Mar</option>";
		echo "<option value='4'>Abr</option>";
		echo "<option value='5'>May</option>";
		echo "<option value='6'>Jun</option>";
		echo "<option value='7'>Jul</option>";
		echo "<option value='8'>Ago</option>";
		echo "<option value='9'>Sep</option>";
		echo "<option value='10'>Oct</option>";
		echo "<option value='11'>Nov</option>";
		echo "<option value='12'>Dic</option>";
	echo "</select>";
	echo "<select class='round' name='anio' id='anio' style='width: 58px'>";
		$anio = 1998;
		while($anio>=1910)
			{
				echo "<option value='".$anio."'";
				echo ">".$anio."</option>";
				$anio--;
			} 




}


?>

<html>
	<head>
		<title>TuSeguroPeru.com</title>
		<link media=all href="estilos2.css" type=text/css rel=stylesheet>
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				/* COMBOBOX */
				$("#idmarca").change(function(event)
					{
						var idmarca = $(this).find(':selected').val();
						$("#pidmodelo").html("<img src='picture_library/loading2.gif'width='30px' />");
						$("#pidmodelo").load('combobox.php?buscar=modelos&idmarca='+idmarca);
					});

			});
		</script>
	</head>
<body>

	<form method="post" name="formulario" action="cotizar_seguro_vehicular.php">
		<table class="roundTable" style="padding-top: 15px; padding-bottom: 15px; margin: 0 auto; border: white 1px solid; color:#424E8A; font: 100% Arial; background-color:#BCA9F5; padding-left: 15px; padding-right: 15px">
			<tr>
				<td colspan="2" style="border: black 1px; text-align:center;">
					<p>Cotiza tu seguro vehicular</p>
				</td>
			</tr>
			
			<tr>
				<td>
					<label for="placa">Placa:</label>
				</td>
				<td>
					<input type="text" class="round" name="placa" maxlength="6" size="17" placeholder="Ingrese la placa" value="">
				</td>
			</tr>

			<tr>
				<td>
					<label for="marca">Marca:</label>
				</td>
				<td>
					<?php idmarca(); ?>
				</td>
			</tr>
			<tr>
				<td>
					<label for="modelo">Modelo:</label>
				</td>
				<td id="pidmodelo">
					<?php idmodelo(); ?>
				</td>
			</tr>
			<tr>
				<td>
					<label for="fabricacion">A&ntilde;o de fabricaci&oacute;n:</label>
				</td>
				<td>
					<?php idfabricacion(); ?>
				</td>
			</tr>

			<tr>
				<td>
					<label for="precio">Suma asegurada (US$):</label>
				</td>
				<td>
					<input type="text" class="round" name="precio" maxlength="6" size="17" placeholder="Suma asegurada" value="">
				</td>
			</tr>
			
			
			<tr>
				<td>
					<label for="nacimiento">Fecha de nacimiento:</label>
				</td>
				<td>
					<?php fecha(); ?>
				</td>
			</tr>

			<tr>
				<td>
					<label for="correo">Correo electr&oacute;nico:</label>
				</td>
				<td>
					<input type="text" class="round" name="correo" maxlength="80" size="17" placeholder="Correo electr&oacute;nico" value="">
				</td>
			</tr>
			<tr>
				<td>
					<label for="celular">N&uacute;mero de celular:</label>
				</td>
				<td>
					<input type="text" class="round" name="celular" maxlength="11" size="17" placeholder="N&uacute;mero celular" value="">
				</td>
			</tr>
			
			
			<tr>
				<td colspan="2" style="border: black 1px; text-align:center;">
					<p><input type="submit" name="submit" value="Cotizar mi seguro vehicular" /></p>
				</td>
			</tr>

		</table>
		<table>
			<tr>
				<td>
					<p id="rimac"></p>
					<p id="positiva"></p>
				</td>
			</tr>
		</table>
	</form>
	<script type="text/javascript">
	function popup(url,ancho,alto)
		{
			var posicion_x; 
			var posicion_y; 
			posicion_x=(screen.width/2)-(ancho/2); 
			posicion_y=(screen.height/2)-(alto/2); 
			window.open(url, "cotizar_seguro_vehicular.php", "width="+ancho+",height="+alto+",menubar=0,toolbar=0,directories=0,scrollbars=no,resizable=no,left="+posicion_x+",top="+posicion_y+"");
		}
	</script>
<div class="links" style="display:none;"> <a href="http://www.ohkick.com/">Chaussures Nike Jordan</a> <a href="http://www.xschuhe.com/">Adidas Schuhe Top-Marke im Online Shop kaufe</a> <a href="http://www.zscarpe.com/">Scarpe Nike Air Max</a> <a href="http://www.air90suk.info/">Cheap Nike Air Max 90 UK</a> <a href="http://www.jerseyfanstore.com/">New Nike NBA jersey</a> <a href="http://www.otshoes.com/">Vans</a> <a href="http://www.ucoats.com/">Moncler Jacket Outlet On Sale</a> <a href="http://www.fireshoestore.com/">Official Adidas NMD R1 Online</a></div></body>
</html>