HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/demo-telemedicina.teky.com.co/resources/views/app/main.blade.php
@extends('layouts.head') @section('content')

{{-- Table --}}
<div class="box">
  <div class="box-tools" style="width: 90%; margin-top: 10px;margin-left: 10px;">
    <div class="row">
      <form role="form" method="post" action=" {{ url('/external_app/filter') }}">
        <div class="col-xs-3" style="display: flex; align-items: center; ">
          <div class="form-group" style="display: flex;align-items: center; ">
            <label style="margin-right:2%;">{{ __("messages.request_table.since") }}:</label>
            <div class="input-group date">
              <div class="input-group-addon">
                <i class="fa fa-calendar"></i>
              </div>
              <input type="text" name="fecha_desde" value="{{ $desde }}" id="fecha_desde"
                class="form-control pull-right" autocomplete="off" required />
            </div>
          </div>
        </div>
        <div class="col-xs-3" style="display: flex;  ">
          <div class="form-group" style="display: flex; align-items: center;">
            <label style="margin-right:2%;">{{ __("messages.request_table.until") }}:</label>
            <div class="input-group date">
              <div class="input-group-addon">
                <i class="fa fa-calendar"></i>
              </div>
              <input type="text" name="fecha_hasta" value="{{ $hasta }}" id="fecha_hasta"
                class="form-control pull-right" autocomplete="off" required />
            </div>
          </div>
        </div>
        <div class="col-xs-2">
          <div class="input-group-btn">
            <button type="submit" class="btn btn-default">
              <i class="fa fa-search" style="margin-right:4px;"></i>{{ __("messages.request_table.search") }}
            </button>
          </div>
        </div>
        {{ csrf_field() }}
      </form>
    </div>
  </div>
  <div class="box-body table-responsive no-padding" style="padding: 10px !important;">
    <table id="example2" class="table table-bordered table-hover dataTable" role="grid"
      aria-describedby="example2_info">
      <thead>
        <tr role="row">
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_4') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_1') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_2') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_7') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_8') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_19') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_23') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_20') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_22') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_11') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_21') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_23') }}
          </th>
          <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1"
            aria-label="Engine version: activate to sort column ascending">
            {{ __('messages.app_main.tag_12') }}
          </th>
        </tr>
      </thead>
      <tbody>
        @foreach($data as $s)
        <tr>
          <td>{{$s->user->document }}</td>
          <td>{{$s->user->name}}</td>
          <td>{{$s->user->last_name}}</td>
          @if($s->user->sex == '1')
          <td>{{ __('messages.app_main.tag_13') }}</td>
          @else
          <td>{{ __('messages.app_main.tag_14') }}</td>
          @endif
          <td>{{$s->user->phone }}</td>
          </td>
          <td>{{$s->form->specialty->name }}</td>
          <td>{{$s->medic->medic_code}}</td>
          <td>{{$s->medic->name}} {{$s->medic->last_name}}</td>
          <td>{{$s->agenda_types->description }}</td>
          <td>{{$s->created_at }}</td>
          <td>{{$s->date }}</td>
          @if($s->state == 6)
          <td>{{$s->cancel_text }}</td>
          @else
          <td>NA</td>
          @endif
          <td style="font-size: 16px;">
            @if($s->state == 2)
            <p>{{ __('messages.app_main.tag_24') }}</p>
            @elseif($s->clinic_document_id == null && $s->state != 6)
            {{-- <a href="/request/proposal/{{ $s->id }}" id="request_button">
              <i class="fa fa-file iconMini a-icon" style="cursor:pointer;" title="Crear solicitud"></i>
            </a> --}}

            <a href="#" onclick="confirmMovilRequest({{$s->id}},'{{$s->user->name}}','{{$s->user->document}}','{{$s->date}}')" id="schedule_button">
              <i class="fa fa-book iconMini a-icon" style="cursor:pointer;" title="Agendar"></i>
            </a>
            <a href="#" onclick="makeCancelDocument({{$s->id}})" id="cancel_button">
              <i class="fa fa-ban iconMini a-icon" style="cursor:pointer;" title="Cancelar"></i>
            </a>
            @elseif($s->state == 6)
            <p>{{ __('messages.app_main.tag_25') }}</p>
            @else
            <a href="/request/view/document/{{ $s->clinic_document_id }}">
              {{ __('messages.app_main.tag_18') }}
            </a>
            @endif
          </td>
        </tr>
        @endforeach
      </tbody>
    </table>
  </div>
  <!-- /.box-body -->
</div>

@include('request_table.modal-cancel')
@include('requests_old.covid19.modal_loading')

<script type="text/javascript">
  $(document).ready(function() {
    $.fn.datepicker.dates["en"] = {
      days: ["{{ __('messages.dias.domingo') }}", "{{ __('messages.dias.lunes') }}", "{{ __('messages.dias.martes') }}", "{{ __('messages.dias.miercoles') }}", "{{ __('messages.dias.jueves') }}", "{{ __('messages.dias.viernes') }}", "{{ __('messages.dias.sabado') }}"],
      daysShort: ["{{ __('messages.days_short.domingo') }}", "{{ __('messages.days_short.lunes') }}", "{{ __('messages.days_short.martes') }}", "{{ __('messages.days_short.miercoles') }}", "{{ __('messages.days_short.jueves') }}", "{{ __('messages.days_short.viernes') }}", "{{ __('messages.days_short.sabado') }}"],
      daysMin: ["{{ __('messages.days_mini.domingo') }}", "{{ __('messages.days_mini.lunes') }}", "{{ __('messages.days_mini.martes') }}", "{{ __('messages.days_mini.miercoles') }}", "{{ __('messages.days_mini.jueves') }}", "{{ __('messages.days_mini.viernes') }}", "{{ __('messages.days_mini.sabado') }}"],
      months: [
        "{{ __('messages.meses.enero') }}",
        "{{ __('messages.meses.febrero') }}",
        "{{ __('messages.meses.marzo') }}",
        "{{ __('messages.meses.abril') }}",
        "{{ __('messages.meses.mayo') }}",
        "{{ __('messages.meses.junio') }}",
        "{{ __('messages.meses.julio') }}",
        "{{ __('messages.meses.agosto') }}",
        "{{ __('messages.meses.septiembre') }}",
        "{{ __('messages.meses.octubre') }}",
        "{{ __('messages.meses.noviembre') }}",
        "{{ __('messages.meses.diciembre') }}"
      ],
      monthsShort: [
        "{{ __('messages.meses_short.enero') }}",
        "{{ __('messages.meses_short.febrero') }}",
        "{{ __('messages.meses_short.marzo') }}",
        "{{ __('messages.meses_short.abril') }}",
        "{{ __('messages.meses_short.mayo') }}",
        "{{ __('messages.meses_short.junio') }}",
        "{{ __('messages.meses_short.julio') }}",
        "{{ __('messages.meses_short.agosto') }}",
        "{{ __('messages.meses_short.septiembre') }}",
        "{{ __('messages.meses_short.octubre') }}",
        "{{ __('messages.meses_short.noviembre') }}",
        "{{ __('messages.meses_short.diciembre') }}"
      ],
      today: "{{ __('messages.hoy') }}",
      clear: "{{ __('messages.clear') }}",
      format: "dd/mm/yyyy",
      titleFormat: "MM yyyy" /* Leverages same syntax as 'format' */,
      weekStart: 0
    };
    $("#fecha_desde").datepicker();
    $("#fecha_hasta").datepicker();

    $("#example2").DataTable({
      paging: true,
      lengthChange: true,
      searching: true,
      ordering: false,
      info: true,
      autoWidth: true,
      language: {
        url: Lang.get('messages.datatable.url_language')
      },
      buttons: ["copyHtml5", "excelHtml5", "csvHtml5", "pdfHtml5"]
    });
  });

  function makeCancelDocument(id) {
    $("#template_response_id").val("");
    $("#text_cancel").val(" ");
    $("#modal-cancel").modal("show");
    $("#btn-modal-cancel").attr("data-id", id);
  }

  function commitCancel(){
    id = $("#btn-modal-cancel").attr("data-id");
    event_id = $("#btn-modal-cancel").attr("event-id");

    if (!$("#template_response_id").val() || !$("#text_cancel").val()) {
      swal("Error", "{{ __('messages.request_table.error_required') }}", "error");
      return;
    }

    swal({
      title: "{{ __('messages.request_table.title_cancel') }}",
      text: "{{ __('messages.request_table.text_cancel') }}",
      icon: "warning",
      buttons: true,
      dangerMode: false
    }).then(function(gofn) {
      if (gofn) {
        var data = {
          template_response_id: $("#template_response_id").val(),
          text_cancel: $("#text_cancel").val()
        };
        $.ajax({
          url: "/external_app/cancel/" + id,
          type: "PUT",
          contentType: "application/json",
          headers: {
            "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
            "Content-Type": "application/json"
          },
          data: JSON.stringify(data),
          success: function(res) {
            console.log(res);
            swal(res.message, "", "success").then(function() {
              window.location.href = "/external_app";
            });
            $("#modal-cancel").modal("hide");
          },
          error: function(err) {
            swal("Error", err.responseJSON.message, "error");
          }
        });
      }
    });
  }

  function confirmMovilRequest(id,name,document,date){
    swal({
      title: "{{ __('messages.app_main.movil_request') }}",
      text: "¿Esta seguro que desea agendar la teleconsulta " + date +  " al paciente " + name + " - " + document + "?",
      icon: "warning",
      buttons: true,
      dangerMode: false
    }).then(function(gofn) {
      if (gofn) {
        $("#modalLoader").modal("show");
        $.ajax({
          url: "/agenda/movil_request/" + id,
          type: "GET",
          contentType: "application/json",
          headers: {
            "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
            "Content-Type": "application/json"
          },
          success: function(res) {
            console.log(res);
            if(res.r){
              $("#modalLoader").modal("hide");
              swal(res.data, "", "success").then(function() {
                window.location.href = "/agenda/" + id;
              });
            }else{
              $("#modalLoader").modal("hide");
              swal(res.data, "", "warning").then(function() {
              // window.location.reload();
              });
            }
          },
          error: function(err) {
            $("#modalLoader").modal("hide");
            swal("Error", err.responseJSON.message, "error");
          }
        });
      }
    });

  }

</script>

@endsection