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

</div>
<div class="col-md-8" style="margin-top: 2%;">

    <?php if(isset($editar)){ echo form_open('Pacientes/savePaciente'); }else{ echo form_open('Pacientes/addPaciente'); } ?>
    <div class="panel panel-info">
        <div class="panel-heading">
            <center>
                <li class="fa fa-user-plus"></li> <?php if(isset($editar)){ echo "Editar ".$editar->Nombre; }else{ echo "Agregar"; } ?>
            </center>
        </div>
        <div class="panel-body">
            <div class="row" style="margin-top: 1%">
                <div class="col-md-8">
                    <div class="form-group">
                        <?php if(isset($editar)){ echo "<input name='id' type='hidden' value='".$editar->idPacientes."' >"; } ?>
                        <label><li class="fa fa-edit"></li> Nombre</label>
                        <input autofocus type="text" name="nombre" class="form-control" placeholder="Nombre Completo" required value="<?php if(isset($editar)){ echo $editar->Nombre;}?>" >
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="from-group"> 
                        <label><li class="fa fa-calendar"></li> Fecha</label>
                        <input type="date" name="fecha" class="form-control" value="<?php if(isset($editar)){ echo $editar->Registro;}else{ echo date("Y-m-d");} ?>" required>
                    </div>
                </div>
            </div>
            <div class="row" style="margin-top: 1%;">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label"><li class="fa fa-home"></li> Domicilio</label>
                        <input class="form-control" type="text" name="domicilio" required placeholder="Calle y  Numero" value="<?php if(isset($editar)){ echo $editar->Domicilio;}?>">
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label"><li class="fa fa-check"></li> Ocupacion</label>
                        <input class="form-control" type="text" name="ocupacion" required placeholder="Ocupacion..." value="<?php if(isset($editar)){ echo $editar->Ocupacion;}?>">
                    </div>
                </div>
            </div>
            <div class="row" style="margin-top: 1%;">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label"><li class="fa fa-phone"></li> Telefono</label>
                        <input class="form-control" type="tel" name="telefono" required placeholder="Telefono" value="<?php if(isset($editar)){ echo $editar->Tel;}?>">
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label"><li class="fa fa-question"></li> Referencias</label>
                        <input class="form-control" type="text" name="referencia" placeholder="Referencias..." value="<?php if(isset($editar)){ echo $editar->Referencia;}?>">
                    </div>
                </div>
            </div>
            <div class="row" style="margin-top: 1%;">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label"><li class="fa fa-venus-mars"></li> Sexo</label>
                        <select class="form-control" name="sexo" required>
                            <option></option>
                            <option value="0" <?php if(isset($editar) && $editar->Sexo == 0){ echo 'selected';}?> >Hombre</option>
                            <option value="1" <?php if(isset($editar) && $editar->Sexo == 1){ echo 'selected';}?> >Mujer</option>
                        </select>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label"><li class="fa fa-clock-o"></li> Edad</label>
                        <input class="form-control" type="number" name="edad" placeholder="Edad" required min="1" value="<?php if(isset($editar)){ echo $editar->Edad;}?>">
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                
            </div>
            <div class="col-md-4">
                <button class="btn btn-success btn-block" type="submit"><li class="fa fa-check-circle"></li> <?php if(isset($editar)){ echo "Guardar";}else{ echo "Agregar";}?></button>
            </div>
            <div class="col-md-4">
                
            </div>
        </div>
    </div>
</form>
</div>

</div>
<div class="col-md-2">

</div>