Exemplo n.º 1
0
 public function GuardarMedico()
 {
     $var = medico::TraerUnMedico($this->correo);
     if (empty($var)) {
         $this->InsertarMedico();
     } else {
         $this->ModificarMedico();
     }
 }
Exemplo n.º 2
0
     }
     if ($error == 0) {
         $var->GuardarMedico();
     }
     echo $error;
     break;
 case 'GrabarTurno':
     //$turno=turno::TraerUnTurno($_POST['id']);
     $error = 0;
     if ($_POST['estado'] != "guardar" || $_POST['estado'] != "modificar") {
         $error = 1;
     } else {
         if ($_POST['estado'] == "guardar") {
             $var = new turno();
         }
         $doc = medico::TraerUnMedico($_POST['nomDoctor']);
         $var->uCorreo = $_POST['uCorreo'];
         $var->nomDoctor = $doc->nomDoctor;
         $var->especialidad = $doc->especialidad;
         $var->fecha = $_POST['fecha'];
         $var->horario = "ahora";
         $var->estado = "liberado";
     }
     if ($error == 0) {
         $var->GuardarTurno();
     }
     echo $error;
     break;
 case 'GrabarUsuario':
     $var = usuario::TraerUnUsuario($_POST['email']);
     $error = 0;
    require_once "class/persona.php";
    require_once "class/hora.php";
    $arrayReserva = reservar::TraerTodasLasReservas();
    echo "<h2> Bienvenido: " . $_SESSION['registrado'] . "</h2>";
    ?>
<table class="table"  style=" background-color: beige;">
	<thead>
		<tr>
			<th>Editar</th><th>Borrar</th><th>Paciente</th><th>Dni</th><th>Medico</th>
		</tr>
	</thead>
	<tbody>

		<?php 
    foreach ($arrayReserva as $cd) {
        $persona = persona::TraerUnaPersonaPorID($cd->persona);
        $turno = turno::TraerUnTurno($cd->turno);
        $medico = medico::TraerUnMedico($turno->idMedico);
        $datosMedico = persona::TraerUnaPersonaPorID($medico->idPersona);
        $fecha = date::TraerFecha($turno->idDate);
        $hora = hora::TraerUnaHoraPorID($turno->idHora);
        echo "<tr>\n\t\t\t<td><a onclick='BorrarReserva({$cd->id})' class='btn btn-danger'>   <span class='glyphicon glyphicon-trash'>&nbsp;</span>  Borrar</a></td>\n\t\t\t<td>{$persona->nombre} </br> {$persona->apellido}</td>\n\t\t\t<td>{$persona->dni}</td>\n\t\t\t<td>{$datosMedico->nombre} </br> {$datosMedico->apellido}</td>\n\t\t\t<td>fecha:{$fecha->fecha} </br> {$hora->descripcion}</td>\n\t\t</tr>   ";
    }
    ?>
	</tbody>
</table>

<?php 
} else {
    echo "<h4 class='widgettitle'>No estas registrado</h4>";
}
Exemplo n.º 4
0

<link href="css/ingreso.css" rel="stylesheet">

 
<?php 
require_once '../clases/medico.php';
session_start();
if (isset($_SESSION['registrado']) && $_SESSION['registrado'] == "*****@*****.**") {
    //$var= new medico();
    if ($_POST['id'] != "null") {
        $var = medico::TraerUnMedico($_POST['id']);
    }
    ?>

<div style="position: relative;">

  <div style="position: absolute; left: 30px; top: 50px;"> 

  <form id="formRegistro" class="form-ingreso" action ="javascript:GrabarMedico()" method="POST"  accept-charset="utf-8" enctype="multipart/form-data">

         <input type="hidden"  id="email" name="email" value="<?php 
    echo isset($var) ? $var->correo : "";
    ?>
"/>

        <div class="form-group">
          <label class="sr-only" for="ejemplo_email_1" >Email</label>
          <input type="email" class="form-control" id="email" name="email"
                 placeholder="Introduce tu email" value="<?php 
    echo isset($var) ? $var->correo : "";