<?php
 
session_start();
$com = "M";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<?php

if ($_POST['bot']==""){
	echo '<h2>!!! SELECCIONA UN REGISTRO... ACTUALIZANDO !!!</h2>';
	echo '<meta content="1; url=DN21000_PR2.php"  HTTP-EQUIV="REFRESH">';
}else{
	include('DN21000_CL2.php');
	$varible_clase = new clase();
	$res=$varible_clase->lista_busqueda($_POST["bot"]);
	$row=mysqli_fetch_array($res);
?>
<body
<?php
 
if(isset($_POST['bot3'])){
	echo ' onLoad="deshab()"';
}
?>
>
<form  name="frm1" method="post" action="">
<input name="bot" type="hidden" value="<?php
 echo $_POST["bot"]?>">
<table width="400"  align="center">
    <tr>
      <th colspan="4" class=\"titulo\"><div align="center">DATOS FAMILIARES</div></th>
    </tr>
	  <tr>
      <td width="80">Parentesco</td>
      <td width="304"> 
	  <?php
 
	  $sql_p=mysqli_query($con ,"SELECT * FROM dntrab_b WHERE no_nom = '".$_SESSION['no_nom']."'");
	  $row_p=mysqli_fetch_array($sql_p);
	  if($row_p["sexo"]=="M"){
	  	$sexo="Esposa";
	  }elseif($row_p["sexo"]=="F"){
	  	$sexo="Esposo";
	  }	
	  ?>
        <select name="s1" id="s1" disabled="disabled">
		<?php

			if($row['parentesco']=="1"){
			  echo '<option value="1" selected>Padre</option>';
			}else{
			  echo '<option value="1">Padre</option>';
			}
			if($row['parentesco']=="2"){
			  echo '<option value="2" selected>Madre</option>';
			}else{
			  echo '<option value="2">Madre</option>';
			}
			if($row['parentesco']=="3"){
			  echo '<option value="3" selected>'.$sexo.'</option>';
			}else{
			  echo '<option value="3">'.$sexo.'</option>';
			}
			if($row['parentesco']=="4"){
			  echo '<option value="4" selected>Hijo /a</option>';
			}else{
			  echo '<option value="4">Hijo /a</option>';
			}
		?>
        </select>
      </td>
	  </tr>
	  <tr>
        <td width="80">Nombre</td>
        <td width="304"> 
        <input name="t1" type="text" id="t1" size="45"
		<?php
 
		echo 'value="'.$row['nom'].'"';
		?>
		>
        </td>
    </tr>
    <tr>
      <td width="80">Estado</td>
      <td width="304"> 
        <select name="s2" id="s2">
		<?php

			if($row['vive_finado']=="V"){
			  echo '<option value="V" selected>Vive</option>';
			}else{
			  echo '<option value="V">Vive</option>';
			}
			if($row['vive_finado']=="F"){
			  echo '<option value="F" selected>Finado</option>';
			}else{
			  echo '<option value="F">Finado</option>';
			}
		?>
        </select>
      </td>
    </tr>
	  <tr>
        <td width="80">Domicilio</td>
        <td width="304"> 
        <input name="t2" type="text" id="t2" size="45"
		<?php
 
		echo 'value="'.$row['dom'].'"';
		?>
		>
        </td>
    </tr>
	  <tr>
        <td width="80">rec_ocupacion</td>
        <td width="304"> 
        <input name="t3" type="text" id="t3" size="45"
		<?php
 
		echo 'value="'.$row['rec_ocupacion'].'"';
		?>
		>
        </td>
    </tr>
</table>
<table width="400"  align="center">
    <tr>
      <td colspan="2"><div align="center">
		  <input type="button" name="Submit2" value="Modificar" onClick="openpage('DN21000_MC2.php','_self')"/>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" name="Submit2" value="Regresar" onClick="openpage('DN21000_PR2.php','_self')"/>
      </div></td>
    </tr>
  </table>
</form>
     <?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center">
	<form id="form1" name="form1" action="DN21000_PR2.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
 </body>
<?php
 
mysqli_close($con);
}
?>
</html>