Beispiel #1
0
        <!-- tools box -->
        <div class="pull-right box-tools">
            <?php 
if (puede("CREAR_CLIENTE")) {
    ?>
            <a href="<?php 
    echo base_url("clientes/agregar/" . $genid);
    ?>
" class="btn btn-info" style="margin-right: 20px;">
            <i class="fa fa-plus"></i> Crear
            </a>
            <?php 
}
?>
            <?php 
if (puede("EXPORTAR_CLIENTES")) {
    ?>
            <a href="#" id="btn_exportar" class="btn" style="margin-right: 20px;background: green;color:white;">
               <i class="glyphicon glyphicon-export"></i> Exportar
            </a>
            <?php 
}
?>
            <button class="btn btn-primary btn-sm pull-right" data-widget='collapse' data-toggle="tooltip" title="Collapse" style="margin-right: 5px;"><i class="fa fa-minus"></i></button>
        </div><!-- /. tools -->

        <i class="glyphicon glyphicon-briefcase"></i>
        <h3 class="box-title" style="margin-left: 10px;">
            Clientes
        </h3>
        
Beispiel #2
0
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//Creo el objeto
$responce = new stdClass();
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$i = 0;
if (isset($archivos)) {
    foreach ($archivos as $archivo) {
        $archivo->accion = '';
        if (puede("DESCARGAR_ARCHIVOS")) {
            $archivo->accion .= '<a href="' . base_url("index.php/inspecciones/descargar_archivo/" . $archivo->nombre_sistema) . '" target="_blank" title="Descargar Archivo" class="btn btn-danger"><span class="glyphicon glyphicon-download"></span></a>';
        }
        if (puede("VER_ARCHIVO")) {
            $archivo->accion .= '<a href="' . base_url("index.php/inspecciones/ver_archivo/" . $archivo->id) . '" title="Ver Archivo" class="btn btn-danger"><span class="glyphicon glyphicon-eye-open"></span></a>';
        }
        $archivo->seleccion = '' . '<input type="checkbox" name="seleccion[]" value="' . $archivo->id . '">';
        $responce->rows[$i]['id'] = $archivo->id;
        $responce->rows[$i]['cell'] = array($archivo->seleccion, $archivo->tipo->nombre, $archivo->fecha_documento, $archivo->fecha_carga, $archivo->nombre_documento, $archivo->usuario->nombre . " " . $archivo->usuario->apellido, $archivo->accion);
        $i++;
    }
}
echo json_encode($responce);
Beispiel #3
0
                            <?php 
    }
    ?>
                        <?php 
} else {
    ?>
                            <?php 
    if (puede("EDITAR_REPORTE_FINAL_GUARDAR")) {
        ?>
                            <input type="submit" class="btn btn-default" id="guardar" name="guardar" value="Guardar" style="display: none;">
                            <?php 
    }
    ?>

                            <?php 
    if (puede("EDITAR_REPORTE_FINAL_GUARDAR_FINAL")) {
        ?>
                            <input type="submit" class="btn btn-default" id="guardar_final" name="guardar_final" value="Guardar Final" style="margin-left: 10px;display: none;" disabled="">
                            <?php 
    }
    ?>
                            <a href="<?php 
    echo base_url("index.php/reclamos/reporte_final_to_word/" . $this->uri->segment(3, 0));
    ?>
" target="_blank" class="btn btn-info" style="margin-left: 10px;">Exportar</a>
                        <?php 
}
?>
                    </div>
                </div>
            </div>
Beispiel #4
0
                <i class="fa fa-plus"></i> Nuevo
            </a>
            <?php 
}
?>
            <?php 
if (puede("DESCARGAR_ARCHIVOS")) {
    ?>
            <a href="#" class="btn btn-success" id="btn_descargar_zip">
                <i class="glyphicon glyphicon-download"></i> Descargar
            </a>
            <?php 
}
?>
            <?php 
if (puede("EXPORTAR_LISTA_ARCHIVOS")) {
    ?>
            <a href="<?php 
    echo base_url("index.php/reclamos/archivos_to_excel/" . $this->uri->segment(3, 0));
    ?>
" target="_blank" class="btn btn-success" style="margin-right: 20px;">
                <i class="glyphicon glyphicon-export"></i> Exportar
            </a>
            <?php 
}
?>
            <button class="btn btn-primary btn-sm pull-right" data-widget='collapse' data-toggle="tooltip" title="Collapse" style="margin-right: 5px;"><i class="fa fa-minus"></i></button>
        </div><!-- /. tools -->

        <i class="glyphicon glyphicon-file"></i>
        <h3 class="box-title" style="margin-left: 10px;">
        
        function list_contactos(){
            
            $("#list_detalles").jqGrid({
                url: "<?php 
echo base_url("index.php/facturas/json_listar_detalles/" . $this->uri->segment(3, 0));
?>
",
                datatype: "json",
                mtype: "GET",
                colNames: ["#", "Descripción", "Monto"],
                colModel: [
                    { name: "numero", width: "50px", sortable: false, align: "center" },
                    { name: "id_facturas_detalles_descripcion"},
                    { name: "cantidad", <?php 
if (!($totales->saldo_cobrar < 1 and $totales->total_detalles > 1) and puede("EDITAR_FACTURA") and !$factura->anulado) {
    ?>
editable: true,<?php 
}
?>
 summaryType: 'sum', width: "50px;", align:'right', formatter:'currency', formatoptions:{decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "$ "}}
                ],
                onSelectRow: function(id){
                    if(id && id!==lastsel2){
                        $("#list_detalles").restoreRow(lastsel2);
                        $("#list_detalles").editRow(id,true);
                        lastsel2=id;
                    }
                },
                editurl: "<?php 
echo base_url("index.php/facturas/ajax_editar_detalle");
Beispiel #6
0
                    <label style="color: transparent">...</label><br>
                    <div class="btn-group">
                        <a href="<?php 
        echo base_url("index.php/reclamos/carta_documentos_to_word/" . $this->uri->segment(3, 0));
        ?>
" target="_blank" class="btn btn-info" style="margin-left: 10px;margin-right: 10px;">Exportar</a>
                        <?php 
        if (puede("EDITAR_INFORMACION_INICIAL_GUARDAR")) {
            ?>
                        <input type="submit" class="btn btn-default" id="guardar" name="guardar" value="Guardar">
                        <?php 
        }
        ?>
                        
                        <?php 
        if (puede("EDITAR_INFORMACION_INICIAL_GUARDAR_FINAL")) {
            ?>
                        <input type="submit" class="btn btn-default" id="guardar_final2" name="guardar_final" value="Guardar Final" style="margin-left: 10px;" disabled="">
                        <?php 
        }
        ?>
                        
                    </div>
                </div>
                <?php 
    }
    ?>
 
                <input type="hidden" name="accion" value="1">
            
            
Beispiel #7
0
</div>
<!-- /.row -->



<!-- Main row -->
<div class="row">
<!-- right col (We are only adding the ID to make the widgets sortable)-->
<section class="col-lg-12 connectedSortable">
<!-- Map box -->
<div class="box box-primary">
    <div class="box-header">
        <!-- tools box -->
        <div class="pull-right box-tools">
            <?php 
if (puede("CREAR_FACTURA")) {
    ?>
           <!-- <a href="<?php 
    echo base_url("index.php/facturas/crear/" . $genid);
    ?>
" class="btn btn-info" style="margin-right: 20px;">
                <i class="fa fa-plus"></i> Nuevo
            </a> -->
            <?php 
}
?>
            <button class="btn btn-primary btn-sm pull-right" data-widget='collapse' data-toggle="tooltip" title="Collapse" style="margin-right: 5px;"><i class="fa fa-minus"></i></button>
        </div><!-- /. tools -->

        
        <h3 class="box-title">
Beispiel #8
0
                <?php 
} else {
    ?>
                <div class="form-group col-sm-6">
                    <label style="display: block; color:transparent">...</label>
                    <div class="btn-group">
                        <?php 
    if (puede("EDITAR_NOTIFICACION_SINIESTRO_GUARDAR")) {
        ?>
                        <input type="submit" class="btn btn-default" id="guardar" name="guardar" value="Guardar" style="display: none;">
                        <?php 
    }
    ?>
                        
                        <?php 
    if (puede("EDITAR_NOTIFICACION_SINIESTRO_GUARDAR_FINAL")) {
        ?>
                        <input type="submit" class="btn btn-default" id="guardar_final" name="guardar_final" value="Guardar Final" style="margin-left: 10px;display: none;" disabled="">
                        <?php 
    }
    ?>
                    </div>
                </div>
                <?php 
}
?>
                
            </div>
                        
            <input type="hidden" name="editar" value="1">
            
Beispiel #9
0
 function ver($id = 0)
 {
     if ($this->input->post("editar")) {
         $this->form_validation->set_rules('reclamos_departamento', 'Departamento', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_tipo', 'Tipo', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_sucursal', 'Sucursal', 'trim|required|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_grupo', 'Grupo', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_cliente', 'Cliente', 'trim|required|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_contacto', 'Contacto en Aseguradora', 'trim|max_length[90]|xss_clean');
         $this->form_validation->set_rules('reclamos_cargo_contacto', 'CARGO DEL CONTACTO', 'trim|max_length[150]|xss_clean');
         $this->form_validation->set_rules('reclamos_siniestro', 'Tipo de Siniestro', 'trim|required|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_asegurado', 'Asegurado', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_cedula', 'R.U.C./Cédula', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_email', 'E-mail', 'trim|max_length[90]|xss_clean');
         $this->form_validation->set_rules('reclamos_observacion', 'Observación', 'trim|max_length[400]|xss_clean');
         $this->form_validation->set_rules('reclamos_fecha_siniestro', 'Fecha del Siniestro', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_fecha_asignacion', 'Fecha de Asignación', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_ubicacion_siniestro', 'Ubicación del Siniestro', 'trim|max_length[400]|xss_clean');
         $this->form_validation->set_rules('reclamos_persona_notifica', 'Persona que Notifica', 'trim|max_length[90]|xss_clean');
         $this->form_validation->set_rules('reclamos_Cargo', 'Cargo', 'trim|max_length[160]|xss_clean');
         $this->form_validation->set_rules('reclamos_aac', 'Aseguradora/Asegurado/Corredor', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_telefono', 'TELÉFONO', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_celular', 'CELULAR', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_referencia_a', 'Referencia Aseguradora', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_corredor_s', 'Corredor de Seguros', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_numero_p', 'Número de Poliza', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_ajustador_a', 'Ajustador Asignado', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('reclamos_inspector', 'Inspector', 'trim|max_length[60]|xss_clean');
         if ($this->form_validation->run() == FALSE) {
             $data['mensaje'] = array("clase" => "danger", "cerrar" => 1, "titulo" => "Error!", "mensaje" => "Por favor verifique los datos ingresado en el formulario:<br><br>" . validation_errors());
         } else {
             //procedo a registrar el cliente
             $reclamo = $this->reclamos_model->get_reclamo_por_identificador($id);
             list($resp, $error) = $this->reclamos_model->editar($id);
             if (!$resp) {
                 if ($error != '') {
                     $data['mensaje'] = array("clase" => "danger", "cerrar" => 1, "titulo" => "Error Interno!", "mensaje" => $error);
                 } else {
                     $data['mensaje'] = array("clase" => "danger", "cerrar" => 1, "titulo" => "Error Interno!", "mensaje" => "No se ha logrado editar el reclamo, comuniquelo al administrador del sistema.");
                 }
             } else {
                 $reclamo_aux = $this->reclamos_model->get_reclamo_por_identificador($id);
                 $data_facturas = array("referencia_vieja" => $reclamo->referencia, "referencia_nueva" => $reclamo_aux->referencia);
                 $this->reclamos_model->referenciar_facturas($data_facturas);
                 $data['mensaje'] = array("clase" => "success", "cerrar" => 1, "titulo" => "Excelente!", "mensaje" => "Se han guardado los cambios");
                 //$this->session->set_flashdata('mensaje', $data['mensaje']);
                 //redirect('clientes/ver/'.$this->uri->segment(3, 0), 'refresh');
             }
         }
     }
     //----------------------------------------------------------------------------------------------------------------------------------------
     $data['reclamo'] = $this->reclamos_model->get_reclamo_por_identificador($id);
     $data['reclamo']->fecha_siniestro = $this->reclamos_model->convertir_fecha($data['reclamo']->fecha_siniestro, 2);
     $data['reclamo']->fcha_asignacion = $this->reclamos_model->convertir_fecha($data['reclamo']->fcha_asignacion, 2);
     $data["inspeccion_inicial"] = $this->reclamos_model->get_inspeccion_inicial_por_key($id);
     //carta de solicitud de documentos $this->reclamos_model->convertir_fecha($this->input->post("nuevofe".$check),1);
     $data['solicitud_documentos'] = $this->reclamos_model->get_solicitud_documentos($id);
     $data["documentos"] = $this->reclamos_model->get_documentos($id);
     $data["dsd"] = $this->reclamos_model->get_documentos_solicitud_documentos($data["solicitud_documentos"] ? $data["solicitud_documentos"]->id : 0);
     $data["tipos_documentos"] = $this->catalogos_model->get_tipo_documento_all_activos();
     $data["grupos"] = $this->reclamos_model->get_grupos();
     $data["aseguradoras"] = $this->reclamos_model->get_aseguradoras();
     $data["ramos"] = $this->reclamos_model->get_ramos();
     $data["asignar_a"] = $this->reclamos_model->get_asignar_a();
     $data["peritos_externos"] = $this->reclamos_model->get_peritos_externos();
     $data["departamentos"] = $this->catalogos_model->get_departamentos_all();
     $data["grupos"] = $this->clientes_model->get_grupos_activos();
     $data["sucursales"] = $this->catalogos_model->get_sucursales_all_acivos();
     $data["inspectores"] = $this->catalogos_model->get_inspectors_all_estado("1");
     $data["clientes"] = $this->clientes_model->get_clientes_all();
     $guardar_final = $data['reclamo']->guardar_final;
     $count = $this->reclamos_model->filas();
     $assets = array("cssFiles" => array(base_url('assets/css/start/jquery-ui-1.9.2.custom.min.css'), base_url('assets/js/plugins/jqGrid/css/ui.jqgrid.css'), base_url('assets/js/plugins/chosen/chosen.css'), base_url('assets/css/switchery/switchery.css'), base_url('assets/css/datepicker/datepicker.css')), "jsVars" => array("var base_url='" . base_url() . "';", "var idr='" . $this->uri->segment(3, 0) . "';", "var numRclamos='" . $count . "';", "var guardar_final_ntf_sin=" . $guardar_final . ";", "var tipo_siniestro=" . $data['reclamo']->id_tipos_siniestros . ";", "var puede_ntf_sinies_guardar=" . puede("EDITAR_NOTIFICACION_SINIESTRO_GUARDAR") . ";", "var puede_ntf_sinies_guardar_final=" . puede("EDITAR_NOTIFICACION_SINIESTRO_GUARDAR_FINAL") . ";"), "jsFiles" => array(base_url('assets/js/plugins/jqGrid/js/i18n/grid.locale-es.js'), base_url('assets/js/plugins/jqGrid/js/jquery.jqGrid.min.js'), base_url('assets/js/plugins/jqueryResizeend.js'), base_url('assets/js/plugins/jquerySticky.js'), base_url('assets/js/plugins/chosen/chosen.jquery.min.js'), base_url('assets/js/plugins/datepicker/bootstrap-datepicker.js'), base_url('assets/js/plugins/ckeditor/ckeditor.js'), base_url('assets/js/plugins/switchery/switchery.js'), base_url('assets/js/resize-edit-text.js'), base_url('assets/js/modules/reclamos/ver-editar.js')));
     $this->load->view('include/header');
     $this->load->view('include/menu');
     $this->load->view('reclamos/ver', $data);
     $this->load->view('include/footer', $assets);
 }
Beispiel #10
0
    if (puede("EDITAR_REPORTE_FINAL_GUARDAR")) {
        ?>
                            <input type="submit" class="btn btn-default" id="guardar" name="guardar" value="Guardar" style="display: none;">
                            <?php 
    }
    ?>

                            <?php 
    if (puede("EDITAR_REPORTE_FINAL_GUARDAR_FINAL")) {
        ?>
                            <input type="submit" class="btn btn-default" id="guardar_final" name="guardar_final" value="Guardar Final" style="margin-left: 10px;display: none;" disabled="">
                            <?php 
    }
    ?>
                            <?php 
    if (puede("EMITIR_REPORTE_FINAL_AJUSTE")) {
        ?>
                            <a href="<?php 
        echo base_url("index.php/reclamos/reporte_final_to_word/" . $this->uri->segment(3, 0));
        ?>
" target="_blank" class="btn btn-info" style="margin-left: 10px;">Exportar</a>
                            <?php 
    }
    ?>
                        <?php 
}
?>
                    </div>
                </div>
            </div>
           
Beispiel #11
0
        <!-- tools box -->
        <div class="pull-right box-tools">
            <?php 
if (puede("CREAR_RECLAMO")) {
    ?>
            <a href="<?php 
    echo base_url("index.php/reclamos/crear/" . $genid);
    ?>
" class="btn btn-info" style="margin-right: 20px;">
                <i class="fa fa-plus"></i> Nuevo
            </a>
            <?php 
}
?>
            <?php 
if (puede("EXPORTAR_RECLAMOS")) {
    ?>
            <a href="<?php 
    echo base_url("index.php/reclamos/listar_to_excel");
    ?>
" target="_blank" class="btn btn-success" style="margin-right: 20px;">
                <i class="glyphicon glyphicon-export"></i> Exportar
            </a>
            <?php 
}
?>
            <button class="btn btn-primary btn-sm pull-right" data-widget='collapse' data-toggle="tooltip" title="Collapse" style="margin-right: 5px;"><i class="fa fa-minus"></i></button>
        </div><!-- /. tools -->

        <i class="glyphicon glyphicon-list-alt"></i>
        <h3 class="box-title" style="margin-left: 10px;">
Beispiel #12
0
 function ver($id = 0, $crear_contacto = "no")
 {
     if ($this->input->post("editar")) {
         $this->form_validation->set_rules('nombre_cliente', 'Nombre', 'trim|required|min_length[3]|max_length[60]|xss_clean');
         $this->form_validation->set_rules('cedula_cliente', 'R.U.P/Cédula', 'trim|required|min_length[3]|max_length[60]|xss_clean');
         $this->form_validation->set_rules('grupo_cliente', 'Grupo', 'trim|required|max_length[60]|xss_clean');
         $this->form_validation->set_rules('telefono_cliente[]', 'Teléfonos', 'trim|max_length[60]|xss_clean');
         $this->form_validation->set_rules('fax_cliente', 'Fax', 'trim|min_length[3]|max_length[60]|xss_clean');
         $this->form_validation->set_rules('celular_cliente', 'Celular', 'trim|min_length[3]|max_length[60]|xss_clean');
         $this->form_validation->set_rules('correo_cliente', 'Correo', 'trim|min_length[3]|max_length[60]|xss_clean');
         $this->form_validation->set_rules('apartado_cliente', 'Apartado', 'trim|min_length[3]|max_length[60]|xss_clean');
         $this->form_validation->set_rules('direccion_cliente', 'Dirección', 'trim|min_length[3]|max_length[400]|xss_clean');
         if ($this->form_validation->run() === FALSE) {
             $data['mensaje'] = array("clase" => "danger", "titulo" => "Error!", "contenido" => "Por favor verifique los datos ingresado en el formulario:<br><br>" . validation_errors());
         } else {
             //procedo a registrar el cliente
             list($respuesta, $mensaje) = $this->clientes_model->editar($id);
             if (!$respuesta) {
                 $data['mensaje'] = array("clase" => "danger", "titulo" => "Error Interno!", "contenido" => $mensaje);
             } else {
                 $data['mensaje'] = array("clase" => "success", "titulo" => "Excelente!", "contenido" => "Se han guardado los cambios");
             }
         }
     }
     $header = array("subtitulo" => "Ver/Editar Cliente");
     $assets = array("cssFiles" => array(base_url('assets/css/start/jquery-ui-1.9.2.custom.min.css'), base_url('assets/js/plugins/jqGrid/css/ui.jqgrid.css'), base_url('assets/css/start/jquery-ui-1.9.2.custom.min.css')), "jsVars" => array("var base_url='" . base_url() . "';", "var puede_inactivar_cliente=" . puede("INACTIVAR_CLIENTE") . ";", "var puede_inactivar_contacto=" . puede("INACTIVAR_CONTACTO") . ";", "var puede_editar_cliente=" . puede("EDITAR_CLIENTE") . ";", "var puede_crear_contacto=" . puede("CREAR_CONTACTO") . ";", "var puede_editar_contacto=" . puede("EDITAR_CONTACTO") . ";", "var identificador_cliente='" . $id . "';", "var crear_contacto='" . $crear_contacto . "';"), "jsFiles" => array(base_url('assets/js/plugins/jqGrid/js/i18n/grid.locale-es.js'), base_url('assets/js/plugins/jqGrid/js/jquery.jqGrid.min.js'), base_url('assets/js/plugins/jqueryResizeend.js'), base_url('assets/js/plugins/jquerySticky.js'), base_url('assets/js/modules/clientes/ver.js')));
     $data['cliente'] = $this->clientes_model->get_cliente_por_indentificador($id);
     $data["grupos"] = $this->clientes_model->get_grupos();
     $data["estados"] = $this->clientes_model->get_estado_cliente();
     $this->load->view('include/header', $header);
     $this->load->view('include/menu');
     $this->load->view('clientes/ver', $data);
     $this->load->view('include/footer', $assets);
 }
Beispiel #13
0
            
            <div class="col-sm-12 box-footer">
                <h4>COMENTARIOS</h4>
            </div>
            
            <div class="col-sm-12">
                <div class="col-sm-12 box-body chat" id="div_comentarios">
                    
                    <?php 
echo $this->view("templates/comentarios");
?>
                                
                </div>
                
                <?php 
if (puede("COMENTAR")) {
    ?>
                <div class="box-footer">
                    <div class="input-group">
                        <input class="form-control" id="input_text_comentario" data-segmento2="<?php 
    echo $this->uri->segment(2, 0);
    ?>
" placeholder="ESCRIBA SU COMENTARIO">
                        <div class="input-group-btn">
                            <button class="btn btn-success" id="buttom_enviar_comentario"><i class="fa fa-plus"></i></button>
                        </div>
                    </div>
                </div>
                <?php 
}
?>
Beispiel #14
0
 public function json_listar_facturas()
 {
     $page = $this->input->get("page");
     $limit = $this->input->get("rows");
     $sidx = $this->input->get("sidx");
     $sord = $this->input->get("sord");
     if (!$sidx) {
         $sidx = 1;
     }
     $aux = $this->input->get("totalrows");
     $totalrows = isset($aux) ? $aux : false;
     if ($totalrows) {
         $limit = $totalrows;
     }
     $count = $this->facturas_model->filas();
     $count > 0 ? $total_pages = ceil($count / $limit) : ($total_pages = 0);
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     if ($limit < 0) {
         $limit = 0;
     }
     $start = $limit * $page - $limit;
     if ($start < 0) {
         $start = 0;
     }
     $facturas = $this->facturas_model->get_facturas($sidx, $sord, $start, $limit);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (isset($facturas)) {
         foreach ($facturas as $factura) {
             $modal = "<div class='text-align:center;'>";
             $modal_bottom = "";
             $modal_bottom .= '<a href="' . base_url("facturas/ver/" . $factura->id) . '" class="btn btn-block btn-primary" style="color:white;">Ver Factura</a>';
             $modal_bottom .= '<a href="' . base_url("facturas/agregar_gastos/" . $factura->id) . '" class="btn btn-block btn-primary" style="color:white;">Agregar Gastos</a>';
             $modal_bottom .= '<a href="' . base_url("reclamos/ver_archivos/" . $factura->key_reclamo) . '" class="btn btn-block btn-primary" style="color:white;">Agregar Archivos</a>';
             $modal_bottom .= '<a href="' . base_url("reclamos/ver/" . $factura->key_reclamo) . '" class="btn btn-block btn-primary" style="color:white;">Ver Reclamo</a>';
             $numero_factura = $factura->numero_factura;
             if ($factura->estado == 'ANULADO') {
                 $numero_factura = '<a href="' . base_url("index.php/facturas/ver/" . $factura->id) . '" style="color:black">' . $numero_factura . '</a>';
                 //$factura->saldo_cobrar = 0;
             } elseif ($factura->saldo_cobrar == 0) {
                 $numero_factura = '<a href="' . base_url("index.php/facturas/ver/" . $factura->id) . '" style="color:green">' . $numero_factura . '</a>';
             } else {
                 $numero_factura = '<a href="' . base_url("index.php/facturas/ver/" . $factura->id) . '" style="color:red">' . $numero_factura . '</a>';
             }
             if (!puede("VER_FACTURA")) {
                 $numero_factura = str_replace('href="' . base_url("index.php/facturas/ver/" . $factura->id) . '"', 'href="#"', $numero_factura);
             }
             if (puede("VER_CLIENTE")) {
                 $cliente = '<a href="' . base_url("index.php/clientes/ver/" . $factura->cliente_obj->identificador) . '" style="color:blue;">' . $factura->cliente . '</a>';
             } else {
                 $cliente = '<a href="#" style="color:blue;">' . $factura->cliente . '</a>';
             }
             if (strlen($modal_bottom) > 0) {
                 $modal .= '<a href="#" style="color:white;" data-toggle="modal" data-target="#myModal' . $factura->id . '" class="btn btn-block btn-outline btn-primary">Opciones</a>';
                 $modal .= ' <!-- Modal -->
                             <div class="modal fade" id="myModal' . $factura->id . '" tabindex="-1" role="dialog" aria-hidden="true">
                               <div class="modal-dialog" role="document" style="width:300px;">
                                 <div class="modal-content" >
                                   <div class="modal-header">
                                     <button type="button" style="font-size:21px;" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                     <h4 class="modal-title" id="myModalLabel' . $factura->id . '">Opciones: ' . $factura->referencia . '</h4>
                                   </div>
                                   <div class="modal-body" style="padding-left:30px;padding-right:30px;">
                                     ' . $modal_bottom . '
                                   </div>
                                 </div>
                               </div>
                             </div>';
             }
             $modal .= "</div>";
             $responce->rows[$i]['id'] = $factura->id;
             $responce->rows[$i]['cell'] = array($numero_factura, substr($factura->fecha_factura, 0, 10), $cliente, $factura->referencia, $factura->siniestro->nombre, $factura->ajustador->nombre, "\$ " . number_format($factura->total_factura, 2), $modal);
             $i++;
         }
     }
     echo json_encode($responce);
     exit;
 }
Beispiel #15
0
                    </div>

                    <div class="form-group col-sm-2">
                        <label style="color: transparent">...</label><br>
                        <a href="#" class="btn btn-warning" id="btn_agregar_documento">AGREGAR</a>
                    </div>

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

                    </div>
                </div>
                <?php 
    }
    ?>
            <?php 
} elseif (puede("CREAR_REQUISITO_FORMULARIO_INFORMACION_INICIAL")) {
    ?>
            <div class="form-group col-sm-12" id="div_form_nuevo_documento" style="margin-top: 20px;">
                <div class="form-group col-sm-7">
                    <label for="nombre_documento">NOMBRE DEL DOCUMENTO</label>
                    <input type="text" class="form-control" id="nombre_documento" name="nombre_documento" placeholder="NOMBRE DEL DOCUMENTO">
                </div>
                
                <div class="form-group col-sm-2">
                    <label style="color: transparent">...</label><br>
                    <a href="#" class="btn btn-warning" id="btn_agregar_documento">AGREGAR</a>
                </div>
                
                <div class="form-group col-sm-3">
                    
                </div>
Beispiel #16
0
                $("#input_text_comentario").val("");
                $("#div_comentarios").load("<?php 
echo base_url("index.php/" . $this->uri->segment(1, 0) . "/ajax_comentarios/" . $this->uri->segment(3, 0));
?>
",{
                    segmento2:$("#input_text_comentario").data("segmento2"),
                    comentario:comentario
                });
            }
        });
        
        $(".btn-estado").click(function(e){
            var aux = 0;
            
            <?php 
if (puede("EDITAR_ESTADO")) {
    ?>
            aux = 1;        
            <?php 
}
?>
            
            if($(this).prev().css("background-color") == "rgb(128, 128, 128)" || aux == 0)
            {
                e.preventDefault();
                alert("No puedes realizar esta acción");
                //console.log($(this).prev().css("background-color"));
            }//else if(aux == 0){
             //   e.preventDefault();
             //   alert("No puedes realizar esta acción");
             //}
Beispiel #17
0
   <?php endif;*/
?>
                
                <?php 
/* if(puede("LISTAR_FACTURAS")):?>
   <li <?php if($this->uri->segment(1) == 'financiera'): ?>style="background-color:#D2E4E8;"<?php endif; ?>>
       <a href="<?php echo base_url("index.php/facturas/") ?>">
           <i class="fa fa-usd"></i> <span>ADMIN. FINANCIERA</span>
       </a>
   </li>
   <?php endif; */
?>
                
                
                <?php 
if (puede("LISTAR_ADMINISTRACION")) {
    ?>
                <li class="treeview" >
                    <a href="#">
                        <i class="fa fa-gear"></i>
                        <span>ADMINISTRACION</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        
                        <li class="treeview" >
                            <a href="#">
                                <i class="fa fa-user"></i>
                                    <span>Usuarios</span>
                                <i class="fa fa-angle-left pull-right"></i>
                            </a>
Beispiel #18
0
    }
    ?>
><?php 
    echo $estado->descripcion;
    ?>
</option>
                        <?php 
}
?>
                    </select>
                </div>
            
            <input type="hidden" name="editar" value="1">
            
            <?php 
if (puede("EDITAR_CLIENTE")) {
    ?>
                <button type="submit" style="display: none;" class="editar_cliente">Enviar!</button>
            <?php 
}
?>
            
                    
                
            <?php 
echo form_close();
?>
        </div>
    </div><!-- /.box-body-->
   
    <div class="box-footer" style="clear: both;"></div>
Beispiel #19
0
            
            <div style="padding-top: 70px;">
                <div class="form-group col-sm-3">
                    <label for="fecha_factura">Fecha de la Factura</label>
                    <input readonly="readonly"  type="text" class="form-control" id="fecha_factura" name="fecha_factura" value="<?php 
echo $factura->fecha_factura;
?>
" placeholder="Fecha de la Factura" required="" data-date-format="yyyy-mm-dd">
                </div>
                
            </div>
            
            <input type="hidden" name="editar" value="0">
            
            <?php 
if (puede("EDITAR_FACTURA") and !$factura->anulado) {
    ?>
            <button type="submit" style="display: none;">Enviar!</button>
            <?php 
}
?>
            
                    
                
            <?php 
echo form_close();
?>
        </div>
    </div><!-- /.box-body-->
    
    <div class="box-footer" style="clear: both;">
Beispiel #20
0
            </a>
            <?php 
}
?>
            <?php 
if (puede("DESCARGAR_INSPECCIONES")) {
    ?>
            <a href="#" class="btn btn-warning" id="btn_descargar_zip">
                <i class="glyphicon glyphicon-download"></i> Descargar
            </a>
            <?php 
}
?>
            
            <?php 
if (puede("EXPORTAR_INSPECCIONES")) {
    ?>
            <a href="<?php 
    echo base_url("index.php/inspecciones/listar_to_excel/" . $this->uri->segment(2, 0));
    ?>
" target="_blank" class="btn btn-success" style="margin-right: 20px;">
                <i class="glyphicon glyphicon-export"></i> Exportar
            </a>
            <?php 
}
?>
            <button class="btn btn-primary btn-sm pull-right" data-widget='collapse' data-toggle="tooltip" title="Collapse" style="margin-right: 5px;"><i class="fa fa-minus"></i></button>
        </div><!-- /. tools -->

        <i class="fa fa-edit"></i>
        <h3 class="box-title">
                            <?php 
    }
    ?>
                        <?php 
} else {
    ?>
                            <?php 
    if (puede("EDITAR_INSPECCION_INICIAL_GUARDAR")) {
        ?>
                            <input type="submit" class="btn btn-default" id="guardar" name="guardar" value="Guardar">
                            <?php 
    }
    ?>

                            <?php 
    if (puede("EDITAR_INSPECCION_INICIAL_GUARDAR_FINAL")) {
        ?>
                            <input type="submit" class="btn btn-default" id="guardar_final" name="guardar_final" value="Guardar Final" style="margin-left: 10px;" disabled="">
                            <?php 
    }
    ?>
                        <?php 
}
?>
                    </div>
                </div>
            </div>
           
                        
            <input type="hidden" name="accion" value="1">
            
//Creo el objeto
$responce = new stdClass();
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$i = 0;
if (isset($facturas)) {
    foreach ($facturas as $factura) {
        $numero_factura = $factura->numero_factura;
        if ($factura->estado == 'ANULADO') {
            $numero_factura = '<a href="' . base_url("index.php/facturas/ver/" . $factura->identificador) . '" style="color:black">' . $numero_factura . '</a>';
            //$factura->saldo_cobrar = 0;
        } elseif ($factura->saldo_cobrar == 0) {
            $numero_factura = '<a href="' . base_url("index.php/facturas/ver/" . $factura->identificador) . '" style="color:green">' . $numero_factura . '</a>';
        } else {
            $numero_factura = '<a href="' . base_url("index.php/facturas/ver/" . $factura->identificador) . '" style="color:red">' . $numero_factura . '</a>';
        }
        if (!puede("VER_FACTURA")) {
            $numero_factura = str_replace('href="' . base_url("index.php/facturas/ver/" . $factura->identificador) . '"', 'href="#"', $numero_factura);
        }
        if (puede("VER_CLIENTE")) {
            $cliente = '<a href="' . base_url("index.php/clientes/ver/" . $factura->cliente_obj->identificador) . '" style="color:blue;">' . $factura->cliente . '</a>';
        } else {
            $cliente = '<a href="#" style="color:blue;">' . $factura->cliente . '</a>';
        }
        $responce->rows[$i]['id'] = $factura->id;
        $responce->rows[$i]['cell'] = array($numero_factura, $factura->estado, substr($factura->fecha_factura, 0, 10), substr($factura->fecha_vencimiento, 0, 10), $factura->fecha_envio, substr($factura->fecha_pago, 0, 10), $cliente, $factura->contacto, $factura->grupo, "\$ " . number_format($factura->total_factura, 2), "\$ " . number_format($factura->saldo_cobrar, 2));
        $i++;
    }
}
echo json_encode($responce);