<script type="text/javascript">    $(document).ready(function () {
        $('#form').validate({
            rules: {
                opcion: {required: true},
                idLocalidad: {required: true},
                idPaciente: {required: true},
                idProfesional: {required: true}
            }, focusCleanup: false, highlight: function (label) {
                $(label).closest('.control-group').removeClass('success').addClass('error');
            }, success: function (label) {
                label.text('OK!').addClass('valid').closest('.control-group').addClass('success');
            }, errorPlacement: function (error, element) {
                error.appendTo(element.parents('.controls'));
            }
        });        <?php $this->load->view('partials/script_edit.php'); ?>        $("#profesionales").click(function () {
            $("#seleccion").load("<?php echo base_url('admin/reporte/select_profesionales')?>").show();
        });
        $("#pacientes").click(function () {
            $("#seleccion").load("<?php echo base_url('admin/reporte/select_pacientes')?>").show();
        });
        $("#localidades").click(function () {
            $("#seleccion").load("<?php echo base_url('admin/reporte/select_localidades')?>").show();
        });
        $("#exportar").click(function () {
            $("#seleccion").html('').hide();
        });
    }); // end document.ready</script>
<form action="<?php echo $action; ?>" id="form" method="POST" enctype="multipart/form-data" class="form-horizontal"
      novalidate="novalidate"><input type="hidden" id="id" name="id"
                                     value="<?php echo (isset($row->id)) ? $row->id : "0"; ?>"/>
    <div id="page-title" class="clearfix"><span
            style="font-size:24px;font-weight:bold;float:left;margin-top:5px;"><?php echo (isset($row->id)) ? $dir2 : $dir1; ?></span>
        <div class="item-content" style="float:right;">
            <button type="submit" class="btn btn-inverse">Consultar</button>
        </div>
    </div> <!-- /.page-title -->
    <div class="row">
        <div class="span12">
            <div id="validation" class="widget highlight widget-form">
                <div class="widget-content">
                    <fieldset>                        <?php //echo (isset($message))?$message:'';?>
                        <div class="control-group"><label class="control-label">Opci&oacute;n</label>
                            <div class="controls"><label class="radio"> <input type="radio" name="opcion"
                                                                               id="profesionales" value="1">
                                    Profesionales </label> <label class="radio"> <input type="radio" name="opcion"
                                                                                        id="pacientes" value="2">
                                    Pacientes </label> <label class="radio"> <input type="radio" name="opcion"
                                                                                    id="localidades" value="3">
                                    Localidades </label> <label class="radio"> <input type="radio" name="opcion"
                                                                                      id="exportar" value="4"> Liquidar prestaciones </label></div>
                        </div>
                        <div style="display: none;" id="seleccion" class="control-group"></div>
                        <div class="control-group"><label class="control-label" for="fecha_desde">Fecha
                                desde</label> <?php $mes = date('m');
                            $anio = date('Y');
                            $desde = date('Y-m-d', mktime(0, 0, 0, $mes, 1, $anio)); ?>
                            <div class="controls"><input type="date" class="input-large" name="fecha_desde"
                                                         id="fecha_desde" value="<?php echo $desde; ?>"></div>
                        </div>
                        <div class="control-group"><label class="control-label" for="fecha_hasta">Fecha
                                hasta</label> <?php $hasta = date('Y-m-d'); ?>
                            <div class="controls"><input type="date" class="input-large" name="fecha_hasta"
                                                         id="fecha_hasta" value="<?php echo $hasta; ?>"></div>
                        </div>
                        <div class="form-actions">
                            <button type="submit" class="btn btn-inverse">Consultar</button>
                        </div>
                    </fieldset>
                </div>
            </div>
        </div>
    </div>
</form>