<?require('../conectar.php');?>
<html>
<head>
<title>Datos convenio</title>
</head>
<body>
<?
$folio=$_GET['folio'];
$confol="select * from contactoconv where folio='$folio'";
$ejefol=mysql_query($confol);
$numfolio=mysql_fetch_array($ejefol);
	 $apatcontacto=$numfolio['apatc'];
	 $amatcontacto=$numfolio['amatc'];
	 $nombrecontacto=$numfolio['nomc'];
	 $dircontacto=$numfolio['dirc'];
	 $telcontacto=$numfolio['telc'];
	 $correocontacto=$numfolio['correoc'];
     $id=$numfolio['idconv'];
     $fol=$numfolio['folio'];	 
?>	
                                <form name="f1" action="contactoconvmod.php" method="post">
									<table>
									  <tr>
									     <td colspan="2">Datos Contacto convenio</td>
									  </tr>
									  <tr>
										 <td>A. Paterno</td><td><input type="text" name="apatcontacto" value="<?echo $apatcontacto;?>" onChange="javascript:this.value=this.value.toUpperCase();"></td>
									  </tr>
									  <tr>
										 <td>A. Materno</td><td><input type="text" value="<?echo $amatcontacto;?>" name="amatcontacto" onChange="javascript:this.value=this.value.toUpperCase();"></td>
									  </tr>
									  <tr>
										 <td>Nombre</td><td><input type="text" value="<?echo $nombrecontacto;?>" name="nombrecontacto" onChange="javascript:this.value=this.value.toUpperCase();"></td>
									  </tr>
									  <tr>
										 <td>Direccion</td><td><input type="text" value="<?echo $dircontacto;?>" name="dircontacto" onChange="javascript:this.value=this.value.toUpperCase();"></td>
									  </tr>
									  <tr>
										 <td>Tel.</td><td><input type="text" name="telcontacto" value="<?echo $telcontacto;?>" onChange="javascript:this.value=this.value.toUpperCase();"></td>
									  </tr>
									  <tr>
										 <td>E-mail</td><td><input type="text" name="correocontacto" value="<?echo $correocontacto;?>">
										 <input type="hidden" name="folio" value="<?echo $fol;?>">
										 <input type="hidden" name="id" value="<?echo $id;?>">
										 </td>
									  </tr>
									  <tr>
										 <td><input type="submit" value="Guardar" name="reg"></td>
									  </tr>
									</table>
								</form>
	<?if(isset($_POST['reg'])){
	 $apatcontacto=$_POST['apatcontacto'];
	 $amatcontacto=$_POST['amatcontacto'];
	 $nombrecontacto=$_POST['nombrecontacto'];
	 $dircontacto=$_POST['dircontacto'];
	 $telcontacto=$_POST['telcontacto'];
	 $correocontacto=$_POST['correocontacto'];
	 $folio=$_POST['folio'];
	 $id=$_POST['id'];
	 $sql="UPDATE contactoconv set apatc='$apatcontacto',amatc='$amatcontacto',nomc='$nombrecontacto',dirc='$dircontacto',telc='$telcontacto',correoc='$correocontacto' WHERE idconv='$id' and folio='$folio'";
	 mysql_query($sql);
	?>		
	<script>
	 alert("Los datos del contacto se han registrado correctamente");
	 window.close();
	</script>
	<?}?>
</body>
</html>