<?php

include ("header.php");



 

            if (!empty($_GET))

            {

                $id = $_GET['id'];

                $fechaagenda = $_GET['fecha'];

                $sql="SELECT * FROM `pacientes` WHERE pac_id = $id";

                $result = $mysqli->query($sql); 

                $row = $result->fetch_assoc();

                $nombre=$row['pac_nombre'];

                $telefono=$row['pac_telefono'];

                $celular=$row['pac_celular'];

                $email=$row['pac_email'];

                $direccion=$row['pac_domicilio'];

                $referido=$row['pac_refiere'];

                $nacimiento=$row['pac_nacimiento'];

                $sexo=$row['pac_sexo'];

                

                

            }

 

?>



        <div class="content-wrapper">

            <!-- START PAGE CONTENT-->

            <div class="page-heading">

                <h1 class="page-title">Pacientes</h1>

            </div>

            <div class="page-content fade-in-up">

                    <div class="ibox-body">

                    <div class="page-content fade-in-up">

                <div class="row">

                    <div class="col-md-12">

                        <div class="ibox">

                        <?php

                            if ($guardado == 1){?>

                        <div class="alert alert-success " role="alert">

                            Paciente <?php echo $textguardar;?> con exito...

                            

                        </div>

                        <?php

                        }

                        if ($error == 1){?>

                            <div class="alert alert-danger " role="alert">

                                Error al guardar, verifique los datos...

                                

                            

                            <?php

                            }

                        ?>

                            <div class="ibox-head">

                                <div class="ibox-title"><?php echo $titulo;?></div>

                                <div class="ibox-tools">

                                    <a class="ibox-collapse"><i class="fa fa-minus"></i></a>

                                    <a class="fullscreen-link"><i class="fa fa-expand"></i></a>

                                </div>

                            </div>

                            <div class="ibox-body">

                            <form id="signupform" class="form-horizontal" role="form" action="<?php $_SERVER['PHP_SELF'] ?>" method="POST" autocomplete="off">

                                    <div class="row">

                                    <div class="col-sm-6 form-group">

                                            <label>Nombre</label>

                                            <input name="nombre" class="form-control" type="text" placeholder="Nombre Completo" value="<?php echo $nombre; ?>" readonly>

                                        </div>

                                    <div class="col-sm-6 form-group">

                                           <label>Sexo: </label><br>

                                            <select name="sexo">

                                                <option value="<?php echo $sexo; ?>" selected><?php echo $sexo; ?></option>

                                                <option value="Femenimo">Femenimo</option>

                                                <option value="Masculino" >Masculino</option>

                                            </select>

                                        </div>

                                    <div class="col-sm-6 form-group">

                                        <label>Fecha de nacimiento:</label><br>

                                        <input type="date" name="nacimiento" step="1" min="1921-01-01" max="2050-12-31" value="<?php echo $nacimiento;?>" readonly>

                                    </div>

                                        <div class="col-sm-6 form-group">

                                            <label>Telefono</label>

                                            <input name="telefono" class="form-control" type="number" placeholder="Telefono" value="<?php echo $telefono; ?>" minlength="4" maxlength="10" size="10" readonly>

                                        </div>

                                    <div class="col-sm-6 form-group">

                                            <label>Celular</label>

                                            <input name="celular" class="form-control" type="number" placeholder="Celular" value="<?php echo $celular; ?>"minlength="4" maxlength="10" size="10" readonly>

                                        </div>

                                        <div class="col-sm-6 form-group">

                                            <label>Correo Electronico</label>

                                            <input name="email" class="form-control" type="text" placeholder="E-mail" value="<?php echo $email; ?>" readonly>

                                        </div>

                                    

                                    <div class="col-sm-12 form-group">

                                        <label>Direccion</label>

                                        <input name="direccion" class="form-control" type="text" placeholder="Direccion" value="<?php echo $direccion; ?>" readonly>

                                    </div>

                                    <div class="col-sm-12 form-group">

                                        <label>Referido por</label>

                                        <input name="referido" class="form-control" type="text" placeholder="Medico que lo refiere" value="<?php echo $referido; ?>" readonly>

                                    </div>

                                    <input id="opc" name="opc" type="hidden" value="<?php echo $opc;?>">

                                    <div class="col-sm-12 form-group">

                                    <a href="agenda.php?fecha=<?echo $fechaagenda;?>" class="btn btn-primary" role="button" data-bs-toggle="button">Regresar</a>

                                    </div>

                                </form>

                            </div>

                        </div>

                    </div>

            </div>                    

        </div>     

<?php 

    include ('footer.php');

?>