<?
//include('nou-conecta.php');
include('includes/funciones.php');
$email="";
if(isset($HTTP_POST_VARS["email"])) $email=$HTTP_POST_VARS["email"];

if (!empty($email)){

    $cuerpo  = "Formulari de Contacte enviat pel Web\n\n\n"; 
	$cuerpo .= "Nom del Remitent:     " . $HTTP_POST_VARS["nombre"] . "\n\n"; 
	$cuerpo .= "Es Col-legiat?:     " . $HTTP_POST_VARS["colegiat"] . "\n\n";
	$cuerpo .= "Tipus de Col-legiat: " . $HTTP_POST_VARS["tipus"] . "\n\n"; 
    $cuerpo .= "C&#224;rrec: " . $HTTP_POST_VARS["carrec"] . "\n\n"; 
    $cuerpo .= "Adre&#231;a:      " . $HTTP_POST_VARS["adresa:"] . "\n\n"; 
    $cuerpo .= "CP i Poblaci&#243;:      " . $HTTP_POST_VARS["cp"] . "\n\n"; 
	$cuerpo .= "Fax:      " . $HTTP_POST_VARS["fax"] . "\n\n";
	$cuerpo .= "Tel&#232;fon:      " . $HTTP_POST_VARS["telefon"] . "\n\n";
	$cuerpo .= "E-Mail:      " . $HTTP_POST_VARS["email"] . "\n\n";
	$cuerpo .= "Tipus de Consulta:      " . $HTTP_POST_VARS["consulta"] . "\n\n";

	$cuerpo .= "Observacions:  " . $HTTP_POST_VARS["observacions"] . "\n\n";


	
	$subject = "Formulari de Contacte enviat pel Web";

	$body ="<html>
<html>
<body>

<table border='1' bordercolor=gray width='600'>
	<tr><td>
	<table border='0' width='100%'>
	<tr><td height='20' colspan='2' bgcolor=gray><font color=white><b>&#160;Formulari de Contate de la Web</b></td></tr>	
<tr><td height='20' colspan='2'>&#160;</td></tr>	
<tr><td>Nom del Remitent:</td><td width='300'>" . $HTTP_POST_VARS["nombre"] . "</td></tr>
<tr><td>Es Col-legiat?:</td><td width='300'>" . $HTTP_POST_VARS["colegiat"] . "</td></tr>
<tr><td>Tipus de Col-legiat:</td><td>" . $HTTP_POST_VARS["tipus"] . "</td></tr>
<tr><td>C&#224;rrec:</td><td>" . $HTTP_POST_VARS["carrec"] . "</td></tr>
<tr><td>Adre&#231;a:</td><td>" . $HTTP_POST_VARS["adresa"] . "</td></tr>
<tr><td>CP i Poblaci&#243;:</td><td width='300'>" . $HTTP_POST_VARS["cp"] . "</td></tr>
<tr><td>Fax:</td><td width='300'>" . $HTTP_POST_VARS["fax"] . "</td></tr>
<tr><td>Tel&#232;fon:</td><td>" . $HTTP_POST_VARS["telefon"] . "</td></tr>
<tr><td>E-Mail:</td><td width='300'>" . $HTTP_POST_VARS["email"] . "</td></tr>
<tr><td>Tipus de Consulta:</td><td width='300'>" . $HTTP_POST_VARS["consulta"] . "</td></tr>
<tr><td>Observacions:</td><td width='300'>" . $HTTP_POST_VARS["observacions"] . "</td></tr>
</table>
	</body>
</html>";

								 
	fn_send_mail($subject, $body,"montse.ferrer@elcol-legi.org","Email_Contacte@elcol-legi.org");

	//mail($correu,"Formulari de Contate de la Web",$cuerpo); 	




echo <<<HTML
<html>
<head>
<script type="text/javascript" src="utils.js"></script>
<link type="text/css" media="screen" rel="stylesheet" href="estilos.css" />
</head>
<body><center>

<table border="0" width="430">
<tr><td height="15"></td></tr>
<tr><td><b><center><font size=1 face='Verdana, Arial, Helvetica, sans-serif'><b>El seu Correu s´ha enviat correctament: 
<br><center>En breu ens possarem en contacte amb vostè.
<br><br><center>Gràcies per contactar amb nosaltres.</td>
</tr></table></body>
</html>
HTML;

}else{

?>


<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<script language="javascript">
	function validar(){
	var error='true';
	var radio = false;

		if (this.document.f.nombre.value==''){
			alert("Si us plau, indiqui el seu Nom de Contacte.");
			this.document.f.nombre.focus();
			return false;
					
        }		  		
for (i=0;i<document.f.colegiat.length;i++){
if (document.f.colegiat[i].checked){ 				
radio = true			   
break;			
}		
} 		 
if (radio==false){
alert("Si us Plau, indiqui si és Col-legiat.");			
return false;         
}			
if (this.document.f.colegiat.value==''){			
alert("Si us Plau, indiqui si és Col-legiat.");			
this.document.f.colegiat.focus();
return false;			         

}		
radio = false;
for (i=0;i<document.f.tipus.length;i++){
if (document.f.tipus[i].checked){
radio = true			   
break;			
}		
} 		 
if (radio==false){			
alert("Si us Plau, indiqui qui tipus de Col-legiat és.");			
return false;         
}

		 if (this.document.f.carrec.value==''){
			alert("Si us Plau, indiqui el seu Càrrec.");
			this.document.f.carrec.focus();
			return false;
					
         }
		 if (this.document.f.adresa.value==''){
			alert("Si us Plau, indiqui las seva Adreça.");
			this.document.f.adresa.focus();
			return false;
					
         }
		  if (this.document.f.cp.value==''){
			alert("Si us Plau, indiqui el seu CP i Població.");
			this.document.f.cp.focus();
			return false;
					
         }
		  if (this.document.f.fax.value==''){
			alert("Si us Plau, indiqui el seu Fax.");
			this.document.f.fax.focus();
			return false;
					
         }
		 if (this.document.f.telefon.value==''){
			alert("Si us Plau, indiqui el seu Telèfon.");
			this.document.f.telefon.focus();
			return false;
					
         }
		 if (this.document.f.email.value==''){
			alert("Si us Plau, indiqui el seu E-Mail:.");
			this.document.f.email.focus();
			return false;
					
         }
		  if (this.document.f.consulta.value==''){
			alert("Si us Plau, indiqui Tipus de Consulta.");
			this.document.f.consulta.focus();
			return false;
					
         }
		 if (this.document.f.observacions.value==''){
			alert("Si us Plau, indiqui les seves Observacions.");
			this.document.f.observacions.focus();
			return false;
					
                  }
	
		if (this.document.f.condiciones.checked != 1 ){
			alert("Si us Plau, ha d'acceptar les Condicions Legals");
			return false;
		}else{
			return true;
		 }
	 
	return error;
	
	}
function controlNumerico(){ 
	//funcion en la que controlamos que solo se escriban numeros
	var key=window.event.keyCode; 
	if (key < 48 || key > 57){  
		window.event.keyCode=0; 
	}
}
</script>
</head>

<body>
<link type="text/css" media="screen" rel="stylesheet" href="forniture/css.css" />
<center>

<table border="0" bordercolor="#FFC097" bgcolor="" width="100%" height="5" bgcolor="" cellspacing="0" 
cellpadding="0"><tr 
valign="top">
<td>

<table border="0" bordercolor="#FFC097" bgcolor="" width="100%" height="5" bgcolor="" cellspacing="0" 
cellpadding="0"><tr 
valign="top">
<td>

<table border="0" bordercolor="green" width="100%" height="" bgcolor="" cellspacing="0" cellpadding="0">
<form action="<?PHP_SELF?>" method="post" name="f" onsubmit="return validar()">
  <tr>
    <td align="left" valign="top" colspan="2">
<table width="100%" border="0" align="center" cellspacing="0" cellpadding="0" height="15">
<tr><td colspan="4" bgcolor="#990000" height="15"><img src="img/icon5.gif" width="12" height="8" border="0"><span 
class="Estilo1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" font color="white"> <b>Formulari de Contacte 
</span></td></td></tr>
<tr><td colspan="4" height="5"></td></tr>
<tr><td>
<table border="0" bordercolor="green" width="100%" height="" bgcolor="" cellspacing="0" cellpadding="0">
<tr><td bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;Nom i Cognoms:</td>
<td height="0">&nbsp;</td>
<td width="" bgcolor="#EEEFF1"><input name="nombre" type="text" value="" size="25"></td></tr>
<tr><td colspan="4" height="5"></td></tr>
<tr><td bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;Col.legiat:</td>
<td height="0">&nbsp;</td>
<td bgcolor="#EEEFF1"><input name="colegiat" type="radio" value="si"><font size="1"><font color="#797676"><font size="1" 
face="Verdana, Arial, Helvetica, sans-serif">Si
<input name="colegiat" type="radio" value="no"><font size="1"><font color="#797676"><font size="1" face="Verdana, Arial, 
Helvetica, sans-serif">No</td>
</tr><tr><td colspan="4" height="5"></td></tr>
<tr><td bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;</td>
<td height="0">&nbsp;</td>
<td bgcolor="#EEEFF1"><input name="tipus" type="radio" value="Corredor"><font size="1"><font color="#797676"><font 
size="1" face="Verdana, Arial, Helvetica, sans-serif">Corredor
<input name="tipus" type="radio" value="Agent"><font size="1"><font color="#797676"><font size="1" face="Verdana, Arial, 
Helvetica, sans-serif">Agent<input name="tipus" type="radio" value="Altres"><font size="1"><font color="#797676"><font 
size="1" face="Verdana, Arial, Helvetica, sans-serif">Altres</td>
</tr>
<tr><td colspan="4" height="5"></td></tr>
<tr><td bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;Càrrec:</td>
<td height="0">&nbsp;</td>
<td bgcolor="#EEEFF1"><input name="carrec" type="text" value="" size="25"></td></tr>
<tr><td colspan="4" height="5"></td></tr>
<tr><td bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;Adreça:</td>
<td height="0">&nbsp;</td>
<td bgcolor="#EEEFF1"><input name="adresa" type="text" value="" size="25"></td>
</tr><tr>
<tr><td colspan="4" height="5"></td></tr>
<td bgcolor="#EEEFF1"><div align="left"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;CP i 
Població:</td>
<td height="0">&nbsp;</td>
<td bgcolor="#EEEFF1"><input name="cp" type="text" value="" size="25"></td></tr>
<tr><td colspan="4" height="5"></td></tr>
<tr><td bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;Fax:</td>
<td height="0">&nbsp;</td>
<td bgcolor="#EEEFF1"><input name="fax" type="text" value="" size="25"></td>
</tr><tr>
<tr><td colspan="4" height="5"></td></tr>
<td bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;Telèfon:</td>
<td height="0">&nbsp;</td>
<td bgcolor="#EEEFF1"><input name="telefon" type="text" value="" size="25"></td></tr>
<tr><td colspan="4" height="5"></td></tr>
<tr><td bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;E-Mail:</td>
<td height="0">&nbsp;</td>
<td bgcolor="#EEEFF1"><input name="email" type="text" value="" size="25"></td></tr>
<tr><td colspan="4" height="25"></td></tr>
<tr valign="top"><td bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>&nbsp;Tipus de 
Consulta:</font></td>
<td height="0">&nbsp;</td>
<td colspan="3" bgcolor="#EEEFF1">
<select name="consulta" style="font-size:8pt">

											<option value=""><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">[Seleccionar]</option>
											<option value="Jurídica"><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">Jurídica</option>
											<option value="Tècnica"><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">Tècnica</option>
											<option value="Formació"><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">Formació</option>
											<option value="Comptable"><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">Comptable</option>
											<option value="Laboral"><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">Laboral</option>
											<option value="Fiscal"><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">Fiscal</option>
											<option value="Mercantil"><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">Mercantil</option>
                      <option value="Marketing"><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">Marketing</option>
											<option value="Altres"><font size="1"><font color="#797676"><font size="1" 
											face="Verdana, Arial, Helvetica, sans-serif">Altres</option>
								  </select>
</td></tr>
<tr><td colspan="4" height="25"></td></tr>
<tr><td colspan="4" bgcolor="#EEEFF1"><font size="1" face="Verdana, Arial, Helvetica, 
sans-serif"><center><b>Observacions:</td>
<tr><td colspan="4" height="5"></td></tr>
</tr><tr>
<td colspan="4" bgcolor="#EEEFF1"><center><textarea name="observacions" cols="30" rows="4" 
wrap="VIRTUAL"></textarea></td>
</tr>

</table>
</tr></tr>



<tr><td bgcolor="#EEEFF1"><table border="0" bordercolor="green" width="100%" height="" bgcolor="" cellspacing="0" 
cellpadding="0">
<tr><td colspan="4" bgcolor=""><center><input name="condiciones" type="checkbox" id="condiciones" value="1">&#160;
<font color="#797676"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Accepto (llei de protecció de dades) 
</a></b></td></tr>
<tr><td colspan="4" height="5">&#160;</td></tr>

<tr><td colspan="4" height="5"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><center>Amb l'enviament de la 
seva conformitat, ens autoritza a: Tractar la informació facilitada per vosté, segons la "Ley de Servicios de la Sociedad 
de la información y de Comercio Electrónico (LSSI-CE)" Lley orgánica 15 13/12/1999 de protecció de dades. <a 
href="http://www.lssi.es/">(veure lley)</a></td></tr> 
<tr><td colspan="4" height="5"></td></tr>
<tr><td colspan="4" bgcolor=""><center><input type="submit" class="verddeu" name="Submit2" 
value="Enviar">&nbsp;<input name="Submit22" type="reset" class="verddeu" value="Restablecer"></form></td></tr></table>
</td></tr>
</form>
</table></td></tr>







</form></table>
</td></tr>
</table>
</td></tr>
</table>
 <br>
</body>
</html>
<?}?>

