Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/04/2016, 16:19
deiher
 
Fecha de Ingreso: abril-2016
Mensajes: 3
Antigüedad: 8 años
Puntos: 0
Respuesta: como actualizar un registro por el id php y mysql poo mvc

//este es el otro archivo

Código PHP:
// vista frmActualizar
<?php

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Empresa Gestion Medica</title>
<link  rel="stylesheet" type="text/css" href="Vista/css/style.css"></link>

</head>

    <body>
<div id="divContenedor">
     <?php include "encabezado.php";?>
    <div id="divMenu">
      <table width="86%" height="254" border="0" align="center">
        <tr>
          <td align="center"><a href="index.php?pg=frmIngresarMedico1">Agregar Medico</a></td>
        </tr>
        <tr>
            <td align="center"><a href="index.php?pg=listarMedicos1">Listar Medicos</a></td>
        </tr>
        <tr>
            <td align="center"><a href="index.php">Salir</a></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
        <div id="contenido">
            <form id="form1" name="form1" method="post" action="index.php?pg=validarActualizarMedico1">
  <table width="42%" border="0" align="center">
    <tr>
      <td colspan="2" align="center" bgcolor="#FFCC00" padign="50px">ACTUALIZAR EMPLEADO</td>
    </tr>
    <tr>
      <td width="37%" align="right" bgcolor="#EAEAEA">Identificacion</td>
      <td width="63%"><label for="identificacion"></label>
      
      <input name="identificacion" type="text" id="identificacion" value="<?php echo $medico->medIdentificacion ?>" size="40" />
      
      </td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EAEAEA">Nombres</td>
      <td><label for="nombres"></label>
      <input name="nombres" type="text" id="nombres" value="<?php echo $medico->medNombres?>" size="40" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EAEAEA">Apellidos</td>
      <td><label for="apellidos"></label>
      <input name="apellidos" type="text" id="apellidos" style="width:270px" value="<?php echo $medico->medApellidos ?>" size="40" /></td>
    </tr>
      <tr>
      <td align="right" bgcolor="#EAEAEA">Telefono</td>
      <td><label for="telefono"></label>
      <input name="telefono" type="text" id="telefono" value="<?php echo $medico->medTelefono?>" size="40" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EAEAEA">Correo</td>
      <td><label for="correo"></label>
      <input name="correo" type="email" id="correo" value="<?php echo $medico->medCorreo?>" size="40" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EAEAEA">Genero</td>
      <td><label for="genero"></label>
        <select name="genero" id="genero" style="width:270px">
          <option value="0">Seleccione</option>
          
          <?php 
              
          
if ($medico->medGenero=="Femenino")
          {          
          
?>
              <option value="Femenino" selected="selected">Femenino</option>
              <option value="Masculino">Masculino</option>
          <?php
          
}
               else
                 {
          
?>
                  <option value="Femenino">Femenino</option>
                <option value="Masculino" selected="selected">Masculino</option>
           <?php
      
}
          
?>          
      </select>
      
      </td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EAEAEA">Especialidad</td>
      <td><label for="especialidad"></label>
        <select name="especialidad" id="especialidad" style="width:270px">
              <option value="0">Seleccione</option>     
              <?php         
              
while ($especialidad $result->fetch_object())
              {
               
?>             
                 <?php 
                 
if ($especialidad->idEspecialidad==$medico->medEspecialidad)
                 {
                 
?>              
                    <option value="<?php echo $especialidad->idEspecialidad?>" selected="selected"><?php echo $especialidad->espNombre?></option>              
                 <?php
                 
}
                 
                 
?>
                    <option value="<?php echo $especialidad->idEspecialidad?>"><?php echo $especialidad->espNombre?></option>                
            <?php 
                
              
}        //cierra el Mientras  
              
             
?>          
        </select>
      
      </td>
    </tr>
    <tr>
      <td colspan="2" align="center" bgcolor="#FFCC00"><input type="submit" name="button" id="button" value="Enviar" /></td>
    </tr>
  </table>
  <!--campo oculto que lleva el id para saber que medico se esta editando-->
  <input name="idMedico" type="hidden" value="<?php echo $_REQUEST['idMedico'?>" />
  
 
</form>
        </div>
    </div>
    <?php include "piePagina.php";?></div>    

</body>
</html>