Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @extends('layout.master')
- @section('assets_css')
- <link rel="stylesheet" type="text/css" href="{{ URL::asset('template/adminLTE2/plugins/datatables1.10.15/media/css/dataTables.bootstrap.min.css') }}"/>
- <link rel="stylesheet" type="text/css" href="{{ URL::asset('template/adminLTE2/plugins/datatables1.10.15/extensions/RowReorder/css/rowReorder.dataTables.min.css') }}"/>
- <link rel="stylesheet" type="text/css" href="{{ URL::asset('template/adminLTE2/plugins/toogle/toogle.css') }}"/>
- @endsection
- @section('content')
- <div class="row">
- <div class="col-md-12">
- <div class="box box-default">
- <div class="overlay" id="loading" >
- <i class="fa fa-refresh fa-spin"></i>
- </div>
- <div class="box box-default">
- <div class="box-header">
- <!--<h3 class="box-title">Listado </h3>-->
- <div class="box-tools pull-right">
- <button class="btn-import btn-box-tool btn btn-sm btn-success" id="btnExcel" style="color: white"><i class="fa fa-file-excel-o"> EXPORTAR EXCEL</i></button>
- <!--select id="slcCredential" class="btn-box-tool">
- <option value="" selected="">SELECCIONAR CREDENCIALES</option>
- <option value="0">SIN CREDENCIAL</option>
- <option value="1">CON CREDENCIAL</option>
- </select>
- <select id="slcTipo" class="btn-box-tool">
- <option value="" selected="">SELECCIONE ESTADO</option>
- <option value="0">INACTIVO</option>
- <option value="1">ACTIVO</option>
- </select-->
- </div>
- </div><!-- /.box-header -->
- <div class="box-body">
- <table id="tblView" class="table table-bordered table-hover">
- <thead>
- <tr>
- <th>Fecha de registro</th>
- <th>RUC / Código de empresa</th>
- <th>Empresa</th>
- <th>Representante legal</th>
- <th>Email personal</th>
- <th>Email corporativo</th>
- <th>País</th>
- <th>Tipo de empresa</th>
- <!--th>Creación de credenciales</th>
- <th>Credenciales</th>
- <th>Estado</th>
- <th>Acciones</th-->
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- </div><!-- /.box-body -->
- </div><!-- /.box -->
- </div><!-- /.col -->
- </div><!-- /.col -->
- </div><!-- /.col -->
- <form id="frmImport">
- <input type="hidden" name="importType" value="excel" id="importType" >
- <input type="hidden" name="importSearch" value="" id="importSearch">
- <input type="hidden" name="importColum" value="" id="importColum">
- <input type="hidden" name="importOrder" value="" id="importOrder">
- <!--input type="hidden" name="importStatus" value="" id="importStatus"-->
- <!--input type="hidden" name="importCredential" value="" id="importCredential"-->
- </form>
- @endsection
- @section('assets_js')
- <script type="text/javascript" src="{{ URL::asset("template/adminLTE2/plugins/datatables1.10.15/media/js/dataTables.bootstrap.min.js") }}"></script>
- <script type="text/javascript" src="{{ URL::asset("template/adminLTE2/plugins/datatables1.10.15/media/js/jquery.dataTables.min.js") }}"></script>
- <script type="text/javascript" src="{{ URL::asset("template/adminLTE2/plugins/datatables1.10.15/extensions/RowReorder/js/dataTables.rowReorder.min.js") }}"></script>
- <script type="text/javascript" src="{{ URL::asset("template/adminLTE2/plugins/toogle/toogle.js") }}"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- $("#slcTipo").change(function () {
- dataTable.ajax.reload();
- })
- $("#slcCredential").change(function () {
- dataTable.ajax.reload();
- })
- var dataTable = $("#tblView").DataTable({
- "order": [[0, "desc"]],
- "language": configuracion.dataTable_Languaje,
- "serverSide": true,
- "ajax": {
- "url": "{{url(route('company_load'))}}",
- "type": "POST",
- "data": function (d) {
- return $.extend({}, d, {
- status: $("#slcTipo").val(),
- credential: $("#slcCredential").val(),
- });
- }
- },
- "columns":
- [
- {"data": "created"},
- {"data": "ruc"},
- {"data": "company_name"},
- {"data": "legal_represent"},
- {"data": "email"},
- {"data": "email_company"},
- {"data": "es"},
- {"data": "company_type"},
- {"data": "credential_date"},
- ],
- /* "aoColumnDefs": [
- {
- "aTargets": [9],
- "mData": null,
- "mRender": function (data, type, full) {
- var button = '<a class="btn btn-xs btn-success disabled" data-type="2" >Generar</a>';
- <?php if (isset($user->permissions[12]['children'][22]) && $user->permissions[12]['children'][22]['permission'] != "R") { ?>
- if (full.status == 1) {
- if (full.credential == '1') {
- button = '<a class="btn btn-xs btn-success btn-credential" data-type="1" data-codigo="' + full.id + '">Reenviar </a>';
- } else {
- button = '<a class="btn btn-xs btn-success btn-credential" data-type="2" data-codigo="' + full.id + '">Generar</a>';
- }
- } else {
- button = '<a class="btn btn-xs btn-success disabled" data-type="2" >Generar</a>';
- }
- <?php } ?>
- return button;
- }
- },
- {
- "aTargets": [10],
- "mData": null,
- "mRender": function (data, type, full) {
- var style = (full.status) ? 'green' : 'red';
- var txt = (full.status) ? 'Activo' : 'Inactivo';
- var button = '<small class="label bg-' + style + '">' + txt + '</small>';
- <?php if (isset($user->permissions[12]['children'][22]) && $user->permissions[12]['children'][22]['permission'] != "R") { ?>
- button = '<input class="toogle_acceso toogle_status" type="checkbox" data-id="' + full.id + '" ' + (full.status == 1 ? "checked" : "") + ' data-toggle="toggle" data-onstyle="success" data-on="ACTIVO" data-off="INACTIVO" data-size="mini"/>';
- <?php } ?>
- return button;
- }
- },
- {
- "aTargets": [11],
- "mData": null,
- "mRender": function (data, type, full) {
- var button = '';
- <?php if (isset($user->permissions[12]['children'][22]) && $user->permissions[12]['children'][22]['permission'] != "R") { ?>
- var url_editar = "{{url(route('company')) }}/detail/" + full.id;
- button = '<a href="' + url_editar + '" class="btn btn-xs btn-info " rel="2"><i class="fa fa-edit"></i> Editar</a> ';
- <?php } ?>
- return button;
- }
- },
- ],*/
- "preDrawCallback": function (settings) {
- $('#loading').show();
- },
- "drawCallback": function () {
- $(".overlay").hide();
- $('#loading').hide();
- /*<?php if (isset($user->permissions[12]['children'][22]) && $user->permissions[12]['children'][22]['permission'] != "R") { ?>
- $('input[type=checkbox][data-toggle^=toggle]').bootstrapToggle();
- $('.toogle_status').change(function () {
- var acceso = $(this).prop('checked') ? 1 : 0;
- var id = $(this).data("id");
- $(".overlay").show();
- $.ajax({
- type: "POST",
- url: "{{url(route('company_change_status'))}}",
- data: {id: id, status: acceso},
- success: function (data) {
- $(".overlay").hide();
- dataTable.ajax.reload();
- },
- error: function (xhr, ajaxOptions, thrownError) {
- $(".overlay").hide();
- }
- });
- });
- <?php } ?>*/
- }
- });
- /*<?php if (isset($user->permissions[12]['children'][22]) && $user->permissions[12]['children'][22]['permission'] != "R") { ?>
- $("#tblView").on("click", ".btn-credential", function () {
- var codigo = $(this).data('codigo');
- var type = $(this).data('type');
- $(".overlay").show();
- $.ajax({
- url: '{{url(route('company_credential'))}}',
- type: "POST",
- data: {
- codigo: codigo,
- type: type,
- },
- success: function (data, textStatus, jqXHR)
- {
- dataTable.ajax.reload();
- },
- error: function (jqXHR, textStatus, errorThrown)
- {
- dataTable.ajax.reload();
- }
- });
- });
- <?php } ?>*/
- $('#btnExcel').click(function () {
- $('#frmImport').attr('method', 'post');
- var order = dataTable.order()[0];
- $('#importColum').val(order[0]);
- $('#importOrder').val(order[1]);
- $('#importSearch').val(dataTable.search());
- /*$('#importStatus').val($('#slcTipo').val());*/
- /*$('#importCredential').val($('#slcCredential').val());*/
- $('#frmImport').submit();
- })
- });
- </script>
- @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement