<?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>

<body
<?php
 
if(isset($_POST['bot3'])){
	echo ' onLoad="deshab()"';
}
?>
>
<?php

if ($_POST["bot"]==""){
	echo '<h2>!!! SELECCIONA UN REGISTRO... ACTUALIZANDO !!!</h2>';
	echo '<meta content="1; url=DX80000_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
$result = mysqli_query($con ,"SELECT * FROM dxcencos WHERE cve_cencos = '".$_POST['bot']."'");
if(!$result){
	echo "No Se Pudo";
}
$reg = mysqli_fetch_array ($result);
?>
<div id="Layer2"></div>
<form  name="frm1" method="post" action="">
<input name="bot" type="hidden" value="<?php
 echo $_POST["bot"] ?>">
	<table width="420"  align="center">
        <tr>
          <th colspan="2" class=\"titulo\"><div align="center">CENTRO COSTO </div></th>
        </tr>
        <tr>
          <td>Clave</td>
          <td> 
            <input name="t1" type="text" id="t1" size="15" onKeyPress="return soloNumeros(event)"
			<?php

				echo 'value="'.$reg['cve_cencos'].'"';
			?>
			>
          
          <?php

		/*while($dato = mysqli_fetch_array ($result) ){ 
		echo '<input type="hidden" name="tcp" value ="' . $dato['cve_cencos'] . '"/>';
		echo '<input name="ta2" type="text"  value="' . $dato['des_cencos'] . '"onBlur="may(this)"/>';
		}*/
		?></td>
        </tr>
        <tr>
          <td>Nombre</td>
          <td> 
            <input name="t2" type="text" id="t2" size="45"
			<?php

				echo 'value="'.$reg['des_cencos'].'"';
			?>
			>
          
          <?php

		/*while($dato = mysqli_fetch_array ($result) ){ 
		echo '<input type="hidden" name="tcp" value ="' . $dato['cve_cencos'] . '"/>';
		echo '<input name="ta2" type="text"  value="' . $dato['des_cencos'] . '"onBlur="may(this)"/>';
		}*/
		?></td>
        </tr>
        <tr>
          <td>Cuenta Contable </td>
          <td> 
            <input name="t3" type="text" id="t3" size="15" onKeyPress="return soloNumeros(event)"
			<?php

				echo 'value="'.$reg['cta_con'].'"';
			?>
			>
		  <input type="button" name="Submit22" value="Buscar" onClick="javascript:recibeid('DYCUENTA.php','ob=t3','','Layer2'); ">

          
          <?php

	    /*$result = mysqli_query($con ,"SELECT * FROM dxcencos WHERE cve_cencos = '".$_POST['bot']."'");
		while($dato = mysqli_fetch_array ($result) ){ 
		echo '<input name="ta" type="text"  value="' . $dato['cta_con'] . '"onBlur="may(this)"/>';
		}*/
		?></td>
        </tr>
        <tr>
          <td width="86">Afecta Centro Costos </td>
          <td width="318"><select name="s1" id="s1" tabindex="16">
		  <?php

  			if($reg['afe_cen']=="N"){
			  echo '<option value="N" selected>NO</option>';
			}else{
			  echo '<option value="N">NO</option>';
			}
			if($reg['afe_cen']=="S"){
			  echo '<option value="S" selected>SI</option>';
			}else{
			  echo '<option value="S">SI</option>';
			}
		  ?>
	   <?php

		/*if(isset($_POST['tm'])){
			if($dato['tm']==0){
					echo '<option'.$_POST['tm'].'>NO</option>';
				}else{
					echo '<option'.$_POST['tm'].'>SI</option>';
				}
		}else{
			$result = mysqli_query($con ,"SELECT * FROM dxcencos WHERE  cve_cencos= '".$_POST['bot']."'");
			while($dato = mysqli_fetch_array ($result)){ 
				if($dato['afe_cen']==0){
					echo '<option'.$dato['afe_cen'].'>NO</option>';
				}else{
					echo '<option'.$dato['afe_cen'].'>SI</option>';
				}
			}	
		}*/
		?>
      </select>		</td>
        </tr>
        <tr>
          <td colspan="2"><div align="center">
            <input type="button" name="Submit2" value="Modificar" onClick="openpage('DX80000_MC.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="Submit" value="Regresar" onClick="openpage('DX80000_PR.php','_self')"/>
          </div>
		  </td>
        </tr>
  </table>
</form> 
     <?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center">
	<form id="form1" name="form1" action="DX80000_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	}
}
?>

</body>
</html>