

<?php $__env->startSection('cssDashboard'); ?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.6/cropper.css"/>
<style type="text/css">
  img {
  display: block;
  max-width: 100%;
  }
  .preview {
  overflow: hidden;
  width: 160px;
  height: 160px;
  margin: 10px;
  border: 1px solid red;
  }
  .modal-lg{
  max-width: 1000px !important;
  }
  </style>
<?php $__env->stopSection(); ?>
<!---->

<?php $__env->startSection('content'); ?>
<div class="card shadow mb-4">
  <div class="card-header py-3 text-align-center">
    <span class="m-0 font-weight-bold text-primary title-table">Solicitud de apoyo</span>
  </div>
  <div class="card-body">
    <form method="POST" id="formRequest" action="<?php echo e(Request::url()); ?>" class="needs-validation" novalidate>
      <?php echo csrf_field(); ?>
      <input type="hidden" name="action" id="action" value="<?php echo e($action); ?>"/>
      <input type="hidden" name="actionUpdateWork" id="actionUpdateWork" value=""/>
      <input type="hidden" name="session" id="session" value="<?php echo e($department_institute_id); ?>"/>
      <?php if(isset($requisition)): ?>
        <input type="hidden" name="id" id="id" value="<?php echo e($requisition->id); ?>">
      <?php else: ?>
        <input type="hidden" name="id" id="id" value="0">
      <?php endif; ?>
      <?php if(isset($requisition)): ?>
        <input type="hidden" name="status_Id" id="status_Id" value="<?php echo e($requisition->status_id); ?>">
      <?php else: ?>
        <input type="hidden" name="status_Id" id="status_Id" value="0">
      <?php endif; ?>
      <ul class="nav nav-tabs" id="myTab" role="tablist">
        <li class="nav-item">
          <a class="nav-link" id="requestGeneralData-tab" data-toggle="tab" href="#requestGeneralData" role="tab" aria-controls="requestGeneralData" aria-selected="true">Datos generales de solicitud</a>
        </li>
        <li class="nav-item">
          <a class="nav-link disabled"  id="beneficiaryGeneralData-tab" data-toggle="tab" href="#beneficiaryGeneralData" role="tab" aria-controls="beneficiaryGeneralData" aria-selected="true">Datos generales de beneficiario</a>
        </li>
        <?php if(session('department_institute_id') <> 4): ?>
          <li class="nav-item">
             <a class="nav-link disabled" id="familySituation-tab" data-toggle="tab" href="#familySituation" role="tab" aria-controls="familySituation" aria-selected="false">Situación familiar</a>
          </li>
        <?php else: ?>
          <li class="nav-item">
             <a class="nav-link disabled" id="familySituation-tab" data-toggle="tab" href="#familySituation" role="tab" aria-controls="familySituation" aria-selected="false">Situación familiar</a>
          </li>
        <?php endif; ?>  
        <?php if(session('department_institute_id') <> 4): ?>
          <li class="nav-item">
            <a class="nav-link disabled" id="lifeConditions-tab" data-toggle="tab" href="#lifeConditions" role="tab" aria-controls="lifeConditions" aria-selected="false">Condiciones de vida</a>
          </li>
        <?php else: ?>  
          <li class="nav-item">
            <a class="nav-link" id="lifeConditions-tab" data-toggle="tab" href="#lifeConditions" role="tab" aria-controls="lifeConditions" aria-selected="false">Condiciones de vida</a>
          </li>
        <?php endif; ?>     
        <li class="nav-item">
          <a class="nav-link" id="economicData-tab" data-toggle="tab" href="#economicData" role="tab" aria-controls="economicData" aria-selected="false">Ingresos económicos</a>
        </li>
      </ul>
      <div class="tab-content" id="myTabContent">
        
        <div class="tab-pane fade show active" id="requestGeneralData" role="tabpanel" aria-labelledby="requestGeneralData-tab">
          <br>
          <div class="form-row">
            <div class="form-group col-md-4 files-div">
              <?php if(isset($requisition)): ?>
                <span class="file petitionerImage">
                  <input type="file" name="petitionerImage" id="petitionerImage" accept="image/*" class="form-control imagePetitioner">
                </span>
                <label id="lblpetitionerImage" name="lblpetitionerImage"  value="<?php echo e($requisition->image); ?>" for="petitionerImage" class="label-img">
                  <span><?php echo e($requisition->image); ?></span>
                </label>
              <?php else: ?>
                <span class="file petitionerImage">
                  <input type="file" name="petitionerImage"  id="petitionerImage" accept="image/*" class="form-control imagePetitioner">
                  <div class="invalid-feedback">
                    Favor de ingresar la imagen del solicitante
                  </div>
                </span>
                <label for="petitionerImage" class="label-img">
                  <span>Subir la imagen del solicitante</span>
                </label>
              <?php endif; ?>
            </div>
            <div class="form-group col-md-6 files-div">
              <?php if(isset($requisition->imageSRC)): ?>
                <img id="imagenPrevisualizacion" src="<?php echo e($requisition['imageSRC']); ?>" class="file-img">
              <?php else: ?>
                <img id="imagenPrevisualizacion" class="file-img">
              <?php endif; ?>
            </div>
          </div>          
          <div class="form-row">
            <div class="form-group col-md-2">
              <label for="date">Fecha de solicitud</label>
              <?php if(isset($requisition->date)): ?>
                <input type="date" class="form-control" value="<?php echo e($requisition->date); ?>" id="date" name="date" required>
              <?php else: ?>
                <input type="date" class="form-control" value="<?php echo e(date("Y-m-d")); ?>" id="date" name="date" required>
              <?php endif; ?>
            </div>
            <div class="form-group col-md-4">
              <label for="petitioner">Solicitante</label>
              <?php if(isset($requisition->petitioner)): ?>
                <input type="text" class="form-control" id="petitioner" name="petitioner" placeholder="Ingrese el nombre del solicitante" required value="<?php echo e($requisition->petitioner); ?>">
              <?php else: ?>
                <input type="text" class="form-control" id="petitioner" name="petitioner" placeholder="Ingrese el nombre del solicitante" required value="">
              <?php endif; ?>
              <div class="invalid-feedback">
                  Favor de ingresar el nombre del solicitante
              </div>
            </div>
            <div class="form-group col-md-2">
              <label for="agePetitioner">Edad del solicitante</label> 
              <div class="input-group">
                <?php if(isset($requisition->agePetitioner)): ?>
                  <input type="text" class="form-control" id="agePetitioner" name="agePetitioner" data-mask="000" placeholder="Ingrese la edad solicitante" required value="<?php echo e($requisition->agePetitioner); ?>">
                <?php else: ?>
                  <input type="text" class="form-control" id="agePetitioner" name="agePetitioner" data-mask="000"   placeholder="Ingrese la edad del solicitante" required value="" >
                <?php endif; ?>
                <div class="invalid-feedback">
                  Favor de ingresar la EDAD del solicitante
                </div>
              </div>  
            </div>
            <div class="form-group col-md-4">
              <label for="curpPetitioner">Curp del solicitante</label>
              <div class="input-group">
                <?php if(isset($requisition->curpPetitioner)): ?>
                  <input type="text" class="form-control" id="curpPetitioner1" name="curpPetitioner1" data-mask="SSSS000000SSSSSSAA" placeholder="Ingrese la curp del solicitante" required value="<?php echo e($requisition->curpPetitioner); ?>">
                <?php else: ?>
                  <input type="text" class="form-control" id="curpPetitioner1" name="curpPetitioner1" data-mask="SSSS000000SSSSSSAA" placeholder="Ingrese la curp del solicitante" required value="" >
                <?php endif; ?>
                <div class="input-group-append">
                  <button class="btn btn-outline-secondary" type="button" onclick="verifyCurpPetitioner(this)" id="check-1">Verificar</button>
                </div>
                <div class="invalid-feedback">
                  Favor de ingresar la CURP del solicitante
                </div>
              </div>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-2">
              <label for="type">Tipo de documento</label>
              <select id="type" name="type" class="form-control" required>
              <?php if(session('department_institute_id') <> 4): ?>
                <?php if(isset($requisition->type)): ?>
                  <option value="" <?php echo e("" == $requisition->type ? 'selected' : ''); ?>>selecciona...</option>
                  <option value="solicitud" <?php echo e("solicitud" == $requisition->type ? 'selected' : ''); ?>>Solicitud</option>
                <?php else: ?>
                  <option value="">selecciona...</option>
                  <option value="solicitud">Solicitud</option>
                <?php endif; ?>
              <?php else: ?>  
                <?php if(isset($requisition->type)): ?>
                  <option value="" <?php echo e("" == $requisition->type ? 'selected' : ''); ?>>selecciona...</option>
                  <option value="ts1" <?php echo e("ts1" == $requisition->type ? 'selected' : ''); ?>>Trabajo Social</option>
                  <option value="responsiva" <?php echo e("responsiva" == $requisition->type ? 'selected' : ''); ?>>Responsiva</option>
                  <option value="foliado" <?php echo e("foliado" == $requisition->type ? 'selected' : ''); ?>>Foliado</option>
                <?php else: ?>
                  <option value="">selecciona...</option>
                  <!---->
                  <option value="ts1">Trabajo Social</option>
                  <option value="responsiva">Responsiva</option>
                  <option value="foliado">Foliado</option>
                <?php endif; ?>
               <?php endif; ?> 
              </select>
            </div>
            <div class="form-group col-md-2">
              <label for="supports_id">Categoría del apoyo</label>
                <?php if(isset($requisition->supports_id)): ?>
                    <select id="supports_id" name="supports_id" class="form-control" required>
                    <option value="">selecciona...</option>
                    <?php if(isset($supports)): ?>
                        <?php $__currentLoopData = $supports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                          <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->supports_id ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                    </select>
                <?php else: ?>
                    <select id="supports_id" disabled name="supports_id" class="form-control"  required> 
                    <option value="">selecciona...</option>
                    <?php if(isset($supports)): ?>
                        <?php $__currentLoopData = $supports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                          <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                    </select>
                <?php endif; ?>
            </div>
            <div class="form-group col-md-4">
                <label for="categories_id">Categoría de los productos</label>
                <?php if(isset($requisition)): ?>
                    <select id="categories_id"  name="categories_id" class="form-control" required>
                    <?php if(isset($categories)): ?>
                        <option value="">selecciona...</option>
                        <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->categories_id ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                <?php else: ?>
                    <select id="categories_id" disabled name="categories_id" class="form-control" required>
                    <option value="">selecciona...</option>
                <?php endif; ?>
              </select>
            </div>
            <div class="form-group col-md-4">
              <label for="reason">Caso</label>
              <?php if(isset($requisition->description)): ?>
                <input type="text" class="form-control" id="reason" name="reason" placeholder="Ingrese la razón de la solicitud" required value="<?php echo e($requisition->description); ?>">
              <?php else: ?>
                <input type="text" class="form-control" id="reason" name="reason" placeholder="Ingrese la razón de la solicitud" required>
              <?php endif; ?>
              <div class="invalid-feedback">
                Favor de ingresar el caso de la solicitud
              </div>
            </div>
          </div>
          <hr>
          <div>
            <!-- <span class="m-0 font-weight-bold text-primary title-table">Productos
               <button type="button" id="addProduct" class="btn btn-primary float-right">Agregar</button>
            </span>-->
            <?php if(isset($requisition)): ?>
             <!--<input type="hidden" name="countProduct" id="countProduct" value="<?php echo e($requisition->countProduct); ?>">-->
             <input type="hidden" name="countProduct" id="countProduct" value="<?php echo e($requisition->CountProduct == "0" || $requisition->CountProduct == null ? 1 : $requisition->CountProduct); ?>">
             <!--<input type="hidden" name="countTotalP" id="countTotalP" value="<?php echo e($requisition->countProduct); ?>">-->
             <input type="hidden" name="countTotalP" id="countTotalP" value="<?php echo e($requisition->CountProduct == "0" || $requisition->CountProduct == null ? 1 : $requisition->CountProduct); ?>">
             <!--<input type="hidden" name="fieldsProducts" id="fieldsProducts" value="<?php echo e($requisition->countProduct); ?>">-->
             <input type="hidden" name="fieldsProducts" id="fieldsProducts" value="<?php echo e($requisition->CountProduct == "0" || $requisition->CountProduct == null ? 1 : $requisition->CountProduct); ?>">
            <?php else: ?>
              <input type="hidden" name="countProduct" id="countProduct" value="1">
              <input type="hidden" name="countTotalP" id="countTotalP" value="1">
              <input type="hidden" name="fieldsProducts" id="fieldsProducts" value="1">
            <?php endif; ?>
          </div>
          <hr>
       <div class="headerAppend">Producto Principal</div> 
          <div class="form-row">
            <div class="form-group col-md-3">
                <label for="suppliers_id1">Proveedor</label>
                <?php if(isset($requisition)): ?>
                    <select id="suppliers_id1" name="suppliers_id1" class="form-control" required>
                        <option value="">Selecciona...</option>
                        <?php if(isset($suppliers)): ?>
                            <?php $__currentLoopData = $suppliers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->suppliers_id ? 'selected' : ''); ?>><?php echo e($element['companyname']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php else: ?>
                            <option value="0" <?php echo e("0" == $requisition->suppliers_id ? 'selected' : ''); ?>>Sin Proveedor</option>
                        <?php endif; ?>
                    </select>
                <?php else: ?>
                    <select id="suppliers_id1" name="suppliers_id1" disabled class="form-control" required>
                        <option value="">Selecciona...</option>
                    </select>
                <?php endif; ?>
            </div>
            <div class="form-group col-md-3">
                <label for="products_id1">Producto</label>
                <?php if(isset($requisition)): ?>
                    <select id="products_id1" name="products_id1" class="form-control" required>
                        <option value="">seleccione...</option>
                        <?php if(isset($products)): ?>
                            <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->products_id ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                    </select>
                <?php else: ?>
                    <select id="products_id1" name="products_id1" disabled class="form-control" required>
                        <option value="">seleccione...</option>
                        <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                <?php endif; ?>
            </div>
            <div class="form-group col-md-2">
              <label for="unitPrice1">Precio Unitario</label>
              <?php if(isset($requisition)): ?>
                <input type="text" class="form-control"  id="unitPrice1" readonly name="unitPrice1" placeholder="Ingresar el precio del producto" required value="<?php echo e($requisition->price); ?>">
              <?php else: ?>
                <input type="text" class="form-control" id="unitPrice1" disabled name="unitPrice1" placeholder="Ingresar el precio del producto" required value="0">
              <?php endif; ?>
              <div class="invalid-feedback">
                Favor de ingresar el precio del producto
              </div>
            </div>
            <div class="form-group col-md-2">
              <label for="qty1">Cantidad</label>
              <?php if(isset($requisition)): ?>
                <input type="text" class="form-control"  id="qty1" name="qty1" placeholder="Ingresar la cantidad de productos" required value="<?php echo e($requisition->qty); ?>">
              <?php else: ?>
                <input type="text" class="form-control" id="qty1" disabled name="qty1" placeholder="Ingresar la cantidad de productos" required value="0">
              <?php endif; ?>
              </div>
              <div class="form-group col-md-2">
              <label for="totalPrice1">Costo Total</label>
              <div class="input-group">
                <?php if(isset($requisition)): ?>
                  <input type="text" class="form-control" id="totalPrice1" name="totalPrice1" disabled required value="<?php echo e($requisition->total); ?>">
                <?php else: ?>
                  <input type="text" class="form-control" id="totalPrice1" name="totalPrice1" disabled required value="0">
                <?php endif; ?>
              </div>
            </div>
          </div> 
          <div>   <!-- otros productos --> 
            <?php if(session('department_institute_id') <> 4): ?>
              <span class="m-0 font-weight-bold text-primary title-table" hidden>Productos
                  <button type="button" id="addProduct" class="btn btn-primary float-right" hidden>Agregar</button>
              </span>
            <?php else: ?>  
              <span class="m-0 font-weight-bold text-primary title-table">Productos
                  <button type="button" id="addProduct" class="btn btn-primary float-right">Agregar</button>
              </span>
            <?php endif; ?>  
            <?php if(isset($requisition)): ?>
               <?php for($i = 2 ; $i <= $requisition->CountProduct;$i++): ?>
                <div id="<?php echo e('fDP-'.$i); ?>">
                  <hr>
                  <div class="headerAppend">Producto <?php echo e($i); ?>

                    <button type="button" id="<?php echo e('deleteProduct-'.$i); ?>" class="btn float-right" onclick="deleteProduct(this)">
                      <i class="fas fa-trash-alt fa-2x colorIcon"></i>
                    </button>
                  </div>
                  <div class="form-row">
                    <div class="form-group col-md-3">
                      <label for="<?php echo e('suppliers_id'.$i); ?>">Proveedor</label>
                      <select id="<?php echo e('suppliers_id'.$i); ?>" name="<?php echo e('suppliers_id'.$i); ?>" class="form-control" onchange="getProd(this)" required>
                        <option value="">Selecciona...</option>
                          <?php if(isset($suppliers)): ?>
                            <?php if(isset($requisition['suppliers_id'.$i])): ?>
                              <?php $__currentLoopData = $suppliers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition['suppliers_id'.$i] ? 'selected' : ''); ?>><?php echo e($element['companyname']); ?></option>
                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php else: ?>
                              <?php $__currentLoopData = $suppliers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($element['id']); ?>"><?php echo e($element['companyname']); ?></option>
                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endif; ?>
                          <?php endif; ?>  
                      </select>
                    </div>
                    <div class="form-group col-md-3">
                      <label for="<?php echo e('products_id'.$i); ?>">Producto</label>
                      <select id="<?php echo e('products_id'.$i); ?>"  name="<?php echo e('products_id'.$i); ?>" class="form-control"  onchange="getPrecio(this)" required>
                        <option value="">seleccione...</option>
                        <?php if(isset($products)): ?>
                          <?php if(isset($requisition['products_id'.$i])): ?>                    
                            <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition['products_id'.$i] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <?php else: ?>
                            <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <?php endif; ?>
                        <?php endif; ?>  
                      </select>
                    </div>
                    <div class="form-group col-md-2">
                      <label for="<?php echo e('unitPrice'.$i); ?>">Precio Unitario</label>
                      <?php if(isset($products)): ?>
                        <input type="text" class="form-control" id="<?php echo e('unitPrice'.$i); ?>" disabled name="<?php echo e('unitPrice'.$i); ?>" placeholder="Ingresar el precio del producto" onchange="enabledCantidad(this)" required value="<?php echo e($requisition['unitPrice'.$i]); ?>">
                      <?php else: ?>
                        <input type="text" class="form-control" id="<?php echo e('unitPrice'.$i); ?>" disabled name="<?php echo e('unitPrice'.$i); ?>" placeholder="Ingresar el precio del producto" required value="0">
                      <?php endif; ?>
                      <div class="invalid-feedback">
                        Favor de ingresar el precio del producto
                      </div>
                    </div>
                    <div class="form-group col-md-2">
                      <label for="<?php echo e('qty'.$i); ?>">Cantidad</label>
                      <?php if(isset($products)): ?>
                        <input type="text" class="form-control" id="<?php echo e('qty'.$i); ?>" name="<?php echo e('qty'.$i); ?>" placeholder="Ingresar la cantidad de productos" onchange="totalCantidad(this)" required value="<?php echo e($requisition['qty'.$i]); ?>">
                      <?php else: ?>
                        <input type="text" class="form-control" id="<?php echo e('qty'.$i); ?>" name="<?php echo e('qty'.$i); ?>" placeholder="Ingresar la cantidad de productos" required value="0">
                      <?php endif; ?>
                    </div>
                    <div class="form-group col-md-2">
                      <label for="<?php echo e('totalPrice'.$i); ?>">Costo Total</label>
                      <?php if(isset($products)): ?>
                         <input type="text" class="form-control" id="<?php echo e('totalPrice'.$i); ?>" name="<?php echo e('totalPrice'.$i); ?>" disabled required value="<?php echo e($requisition['totalPrice'.$i]); ?>">
                      <?php else: ?>
                        <input type="text" class="form-control" id="<?php echo e('totalPrice'.$i); ?>" name="<?php echo e('totalPrice'.$i); ?>" disabled required value="0">
                      <?php endif; ?>
                      <div class="invalid-feedback">
                        Favor de ingresar el total del costo
                      </div>
                    </div>
                  </div>
                </div>
              <?php endfor; ?>
            <?php endif; ?>
            <div id="products"></div> 
          </div>
         <hr>
          <a href="/solicitudes"  class="btn btn-primary float-right">Cancelar</a>
          <button type="button" id="requestGeneralData-1"  onclick="nextNavTab(this,event)" class="btn btn-primary float-right" style="margin-right: 3px;">Siguiente</button>
          <!-- <button type="button" id="requestGeneralData-1"  onclick="validarinputs()" class="btn btn-primary float-right" style="margin-right: 3px;">Siguiente</button> -->
         <hr> 
         <!-- -->
        </div>
        
        <div class="tab-pane fade" id="beneficiaryGeneralData" role="tabpanel" aria-labelledby="beneficiaryGeneralData-tab">
          <br>
          <div>
            <span class="m-0 font-weight-bold text-primary title-table">Beneficiarios
              <button type="button" id="addBeneficiary" class="btn btn-primary float-right">Agregar</button>
            </span>
            <?php if(isset($requisition)): ?>
              <input type="hidden" name="countBeneficiary" id="countBeneficiary" value="<?php echo e($requisition->countPersonalD == 0 || $requisition->countPersonalD == null ? 1 : $requisition->countPersonalD); ?>">
              <input type="hidden" name="countTotalB" id="countTotalB" value="<?php echo e($requisition->countPersonalD == 0 || $requisition->countPersonalD == null ? 1 : $requisition->countPersonalD); ?>">
            <?php else: ?>
              <input type="hidden" name="countBeneficiary" id="countBeneficiary" value="1">
              <input type="hidden" name="countTotalB" id="countTotalB" value="1">
            <?php endif; ?>            
          </div>
          <hr>
          <div class="headerAppend">Beneficiario Principal</div>
          <div class="form-row" style="display: none;">
            <div class="form-group col-md-12">
              <?php if(isset($requisition->beneficiary1)): ?>
                <input type="hidden" class="form-control" id="addressesid" name="address_id" value="<?php echo e($requisition->address['id']); ?>">
              <?php else: ?>                
                <input type="hidden" class="form-control" id="addressesid" name="address_id" value="">
              <?php endif; ?>
          	</div>
         </div>            
          <div class="form-row">
            <div class="form-group col-md-3">
              <label for="curpbeneficiary1">Curp del beneficiario</label>
              <div class="input-group">
                <?php if(isset($requisition->beneficiary1)): ?>
                  <input type="text" class="form-control" id="curpbeneficiary1" name="curpbeneficiary1" data-mask="SSSS000000SSSSSSAA" placeholder="Ingrese la curp del beneficiario" required value="<?php echo e($requisition->beneficiary1['curp']); ?>">
                <?php else: ?>
                  <input type="text" class="form-control" id="curpbeneficiary1" name="curpbeneficiary1" data-mask="SSSS000000SSSSSSAA" placeholder="Ingrese la curp del beneficiario" required>
                <?php endif; ?>
                <div class="input-group-append">
                  <button class="btn btn-outline-secondary" type="button" onclick="verifyCurp(this)" id="check-1">Verificar</button>
                </div>
                <div class="invalid-feedback">
                  Favor de ingresar la CURP del beneficiario
                </div>
              </div>
            </div>
            <div class="form-group col-md-3">
                <label for="agebeneficiary1">Edad</label>
                <?php if(isset($requisition->beneficiary1)): ?>
                  <input type="text" class="form-control" id="agebeneficiary1" data-mask="000" name="agebeneficiary1" placeholder="Ingrese la edad del beneficiario" required value="<?php echo e($requisition->beneficiary1['age']); ?>">
                <?php else: ?>
                  <input type="text" class="form-control" id="agebeneficiary1" data-mask="000" name="agebeneficiary1" placeholder="Ingrese la edad del beneficiario" required>
                <?php endif; ?>
            </div>
            <div class="form-group col-md-3">
                <label for="sermedico1">Servicio Médico</label>
                <?php if(isset($requisition->sermedico1)): ?>
                    <input type="text" class="form-control" id="sermedico1"  name="sermedico1" placeholder="Ingrese Servicio Médico" required value="<?php echo e($requisition->sermedico1); ?>">
                <?php else: ?>
                    <input type="text" class="form-control" id="sermedico1"  name="sermedico1" placeholder="Ingrese Servicio Médico" required>
                <?php endif; ?>
                <div class="invalid-feedback">
                     Favor de ingresar el Servicio Médico
                </div>
            </div>
            <div class="form-group col-md-3">
                <label for="phonenumber1">Número telefónico</label>
                <?php if(isset($requisition->beneficiary1)): ?>
                  <input type="text" class="form-control" id="phonenumber1" name="phonenumber1" placeholder="Ingresar número telefónico del beneficiario" data-mask="000-000-0000" value="<?php echo e($requisition->beneficiary1['ext']['number']); ?>" required>
                <?php else: ?>
                  <input type="text" class="form-control" id="phonenumber1" name="phonenumber1" placeholder="Ingresar número telefónico del beneficiario" data-mask="000-000-0000" required>
                <?php endif; ?>
                  <div class="invalid-feedback">
                      Favor de ingresar el número telefónico del beneficiario
                  </div>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-4">
              <label for="namebeneficiary1">Nombre(s)</label>
             count <?php if(isset($requisition->beneficiary1)): ?>
                <input type="text" class="form-control" id="namebeneficiary1" name="namebeneficiary1" value="<?php echo e($requisition->beneficiary1['name']); ?>" placeholder="Ingrese el nombre del beneficiario" required>
              <?php else: ?>
                <input type="text" class="form-control" id="namebeneficiary1" name="namebeneficiary1" placeholder="Ingrese el nombre del beneficiario" required>
              <?php endif; ?>
              <div class="invalid-feedback">
                Favor de ingresar el nombre del beneficiario
              </div>
            </div>
            <div class="form-group col-md-4">
              <label for="lastNamebeneficiary1">Apellido paterno</label>
              <?php if(isset($requisition->beneficiary1)): ?>
                <input type="text" class="form-control" id="lastNamebeneficiary1" name="lastNamebeneficiary1" value="<?php echo e($requisition->beneficiary1['lastName']); ?>" placeholder="Ingrese el apellido paterno del beneficiario" required>
              <?php else: ?>
                <input type="text" class="form-control" id="lastNamebeneficiary1" name="lastNamebeneficiary1" placeholder="Ingrese el apellido paterno del beneficiario" required>
              <?php endif; ?>
              <div class="invalid-feedback">
                Favor de ingresar el apellido paterno del beneficiario
              </div>
            </div>
            <div class="form-group col-md-4">
              <label for="secondLastNamebeneficiary1">Apellido materno</label>
              <?php if(isset($requisition->beneficiary1)): ?>
                <input type="text" class="form-control" id="secondLastNamebeneficiary1" name="secondLastNamebeneficiary1" placeholder="Ingrese el apellido Materno del beneficiario" value="<?php echo e($requisition->beneficiary1['secondLastName']); ?>" required>
              <?php else: ?>
                <input type="text" class="form-control" id="secondLastNamebeneficiary1" name="secondLastNamebeneficiary1" placeholder="Ingrese el apellido Materno del beneficiario" required>
              <?php endif; ?>
              <div class="invalid-feedback">
                Favor de ingresar el apellido materno del beneficiario
              </div>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-4">
              <label for="civilStatusbeneficiary1">Edo. Civil</label>
              <select id="civilStatusbeneficiary1" name="civilStatusbeneficiary1" class="form-control" required>
              <?php if(isset($requisition->beneficiary1)): ?>
                
                <option value="soltero(a)" <?php echo e($requisition->beneficiary1['ext']['civilStatus'] == "soltero(a)" ? 'selected' : ""); ?>>Soltero(a)</option>
                <option value="casado(a)" <?php echo e($requisition->beneficiary1['ext']['civilStatus'] == "casado(a)" ? 'selected' : ""); ?>>Casado(a)</option>
                <option value="divorciado(a)" <?php echo e($requisition->beneficiary1['ext']['civilStatus'] == "divorciado(a)" ? 'selected' : ""); ?>>Divorciado(a)</option>
                <option value="viudo(a)" <?php echo e($requisition->beneficiary1['ext']['civilStatus'] == "viudo(a)" ? 'selected' : ""); ?>>Viudo(a)</option>
                <option value="unionLibre" <?php echo e($requisition->beneficiary1['ext']['civilStatus'] == "unionLibre" ? 'selected' : ""); ?>>Unión libre</option>
              <?php else: ?>
                <option value="">Selecciona...</option>
                <option value="soltero(a)">Soltero(a)</option>
                <option value="casado(a)">Casado(a)</option>
                <option value="divorciado(a)">Divorciado(a)</option>
                <option value="viudo(a)">Viudo(a)</option>
                <option value="unionLibre">Unión libre</option>
              <?php endif; ?>
              </select>
            </div>
            <div class="form-group col-md-4">
              <label for="scholarShipbeneficiary1">Escolaridad</label>
              <select id="scholarShipbeneficiary1" name="scholarShipbeneficiary1" class="form-control" required>
              <?php if(isset($requisition->beneficiary1)): ?>
                
                <option value="primaria" <?php echo e($requisition->beneficiary1['ext']['scholarShip'] == "primaria" ? 'selected' : ""); ?>>Primaria</option>
                <option value="secundaria" <?php echo e($requisition->beneficiary1['ext']['scholarShip'] == "secundaria" ? 'selected' : ""); ?>>Secundaria</option>
                <option value="bachillerato/tecnico" <?php echo e($requisition->beneficiary1['ext']['scholarShip'] == "bachillerato/tecnico" ? 'selected' : ""); ?>>Bachillerato/Técnico</option>
                <option value="licenciatura/profesional" <?php echo e($requisition->beneficiary1['ext']['scholarShip'] == "licenciatura/profesional" ? 'selected' : ""); ?>>Licenciatura/Profesional</option>
                <option value="posgrado" <?php echo e($requisition->beneficiary1['ext']['scholarShip'] == "posgrado" ? 'selected' : ""); ?>>Posgrado</option>
              <?php else: ?>
                <option value="sinEstudios">Sin estudios</option>
                <option value="primaria">Primaria</option>
                <option value="secundaria">Secundaria</option>
                <option value="bachillerato/tecnico">Bachillerato/Técnico</option>
                <option value="licenciatura/profesional">Licenciatura/Profesional</option>
                <option value="posgrado">Posgrado</option>
              <?php endif; ?>
              </select>
            </div>
            <div class="form-group col-md-4">
              <label for="employments_idbeneficiary1">Ocupación</label>
              <select id="employments_idbeneficiary1" name="employments_idbeneficiary1" class="form-control" required>
              <?php if(isset($employments)): ?>
                <?php if(isset($requisition->beneficiary1)): ?>
                  <?php $__currentLoopData = $employments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->beneficiary1['ext']['employments_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php else: ?>
                  <?php $__currentLoopData = $employments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
              <?php endif; ?>
              </select>
            </div>
          </div>                    
          <span class="m-0 font-weight-bold text-primary headerAppend">Diagnostico de Beneficiario
             <!--  <button type="button" id="addDiagnosticBeneficiary1" class="btn btn-primary float-right">Agregar</button> -->
          </span>

          <?php if(isset($requisition)): ?>
            <input type="hidden" name="countDiagnosticBeneficiary1" id="countDiagnosticBeneficiary1" value="<?php echo e($requisition['countDiagnosticBeneficiary1'] == 0 || $requisition['countDiagnosticBeneficiary1'] == null ? 1 : $requisition['countDiagnosticBeneficiary1']); ?>">                                                                                                              
            <input type="hidden" name="countTotalDB1" id="countTotalDB1" value="<?php echo e($requisition['countDiagnosticBeneficiary1'] == 0 || $requisition['countDiagnosticBeneficiary1'] == null ? 1 : $requisition['countDiagnosticBeneficiary1']); ?>">
          <?php else: ?>
            <input type="hidden" name="countDiagnosticBeneficiary1" id="countDiagnosticBeneficiary1" value="1">
            <input type="hidden" name="countTotalDB1" id="countTotalDB1" value="1">
          <?php endif; ?>
          <div class="form-row" style="display: none;">
            <div class="form-group col-md-12">                    
              <?php if(isset($requisition['beneficiary1']['Disabilitiesid1'])): ?>
                <input type="hidden" class="form-control" id="<?php echo e('beneficiaryDisabilitiesid1_1'); ?>" name="<?php echo e('beneficiaryDisabilitiesid1_1'); ?>" value="<?php echo e($requisition['beneficiary'.$i.'Disabilitiesid'.$x] == 0 || $requisition['beneficiary'.$i.'Disabilitiesid'.$x] == null ? 1 : $requisition['beneficiary'.$i.'Disabilitiesid'.$x]); ?>">
              <?php else: ?>
                <input type="hidden" class="form-control" id="<?php echo e('beneficiaryDisabilitiesid1_1'); ?>" name="<?php echo e('beneficiaryDisabilitiesid1_1'); ?> value="">
              <?php endif; ?>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-6">
              <label for="disabilitycategories1_1">Categoria del Diagnostico</label>
              <?php if(session('department_institute_id') <> 4): ?>
                <select id="disabilitycategories1_1"  name="disabilitycategories1_1"  disabled class="form-control">
                  <option value="">selecciona...</option>
                  <?php if(isset($catDisabilities)): ?>
                    <?php if(isset($requisition['beneficiary1'])): ?>
                      <?php $__currentLoopData = $catDisabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->beneficiary1['catDisabilities_id1'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php else: ?>
                      <?php $__currentLoopData = $catDisabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                  <?php else: ?>
                    <?php $__currentLoopData = $categotydisability; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  <?php endif; ?>
                </select>
              <?php else: ?>
                <select id="disabilitycategories1_1"  name="disabilitycategories1_1"  class="form-control">                   
                  <option value="">selecciona...</option>
                  <?php if(isset($catDisabilities)): ?>
                    <?php if(isset($requisition['beneficiary1'])): ?>
                      <?php $__currentLoopData = $catDisabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->beneficiary1['catDisabilities_id1'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php else: ?>
                      <?php $__currentLoopData = $catDisabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                  <?php else: ?>
                    <?php $__currentLoopData = $categotydisability; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  <?php endif; ?>
                </select>
              <?php endif; ?>
            </div>
            <div class="form-group col-md-6">
              <label for="disability1_1">Diagnostico</label>
              <?php if(session('department_institute_id') <> 4): ?>
                <?php if(isset($requisition->beneficiary1)): ?>
                  <select id="disability1_1" name="disability1_1" disabled class="form-control">  
                    <option value="">Selecciona...</option>
                    <?php if(isset($requisition->beneficiary1Disabilities1)): ?>
                      <?php $__currentLoopData = $requisition->beneficiary1Disabilities1; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($element['id']); ?>" <?php echo e($element->id == $requisition->beneficiary1['disabilities_id1'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                  </select>
                <?php else: ?>
                  <select id="disability1_1" name="disability1_1" disabled class="form-control">
                    <option value="">Selecciona...</option>
                  </select>
                <?php endif; ?>
              <?php else: ?>
                <?php if(isset($requisition->beneficiary1)): ?>
                  <select id="disability1_1" name="disability1_1" class="form-control">
                    <option value="">Selecciona...</option>
                    <?php if(isset($requisition->beneficiary1Disabilities1)): ?>
                       <?php $__currentLoopData = $requisition->beneficiary1Disabilities1; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($element['id']); ?>" <?php echo e($element->id == $requisition->beneficiary1['disabilities_id1'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                  </select>
                <?php else: ?>
                  <select id="disability1_1" name="disability1_1" class="form-control">
                    <option value="">Selecciona...</option>
                  </select>
                <?php endif; ?>
              <?php endif; ?>
            </div>
          </div>
          <?php if(isset($requisition)): ?>
            <div id="<?php echo e('requestDiagnostic1'); ?>">
              <?php for($i = 2; $i <= $requisition->countDiagnosticBeneficiary1; $i++): ?>
                <div id="<?php echo e('fDDB1_'.$i); ?>">
                  <hr>
                  <div id="<?php echo e('requestHeader'.$i); ?>" class="headerAppend">Categoria de Diagnostico <?php echo e($i); ?>

                    <button type="button" id="<?php echo e('deleteDB1_'.$i); ?>" class="btn float-right" onclick="deleteBeneficiaryDiag(this)">
                      <i class="fas fa-trash-alt fa-2x colorIcon"></i>
                    </button>
                  </div>
                  <div class="form-row">
                    <div class="form-group col-md-6">
                      <label for="<?php echo e('disabilitycategories1_'.$i); ?>">Categoria del Diagnostico</label>
                      <select id="<?php echo e('disabilitycategories1_'.$i); ?>" name="<?php echo e('disabilitycategories1_'.$i); ?>"  onchange="getDisabilities(this)" class="form-control" required>
                        <option value="">selecciona...</option>
                        <?php if(isset($catDisabilities)): ?>
                          <?php if(isset($requisition['beneficiary1'])): ?>
                            <?php $__currentLoopData = $catDisabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->beneficiary1['catDisabilities_id'.$i] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <?php else: ?>
                            <?php $__currentLoopData = $catDisabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <?php endif; ?>
                        <?php endif; ?>
                      </select>
                    </div>
                    <div class="form-group col-md-6">
                      <label for="<?php echo e('disability1_'.$i); ?>">Diagnostico</label>
                      <?php if(isset($requisition->beneficiary1)): ?>
                        <select id="<?php echo e('disability1_'.$i); ?>" name="<?php echo e('disability1_'.$i); ?>"  class="form-control" required>
                          <option value="">Selecciona...</option>
                            <?php $__currentLoopData = $requisition['beneficiary1Disabilities'.$i]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <option value="<?php echo e($element['id']); ?>" <?php echo e($element->id == $requisition->beneficiary1['disabilities_id'.$i] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                      @elses
                        <select id="<?php echo e('disability1_'.$i); ?>" name="<?php echo e('disability1_'.$i); ?>" disabled class="form-control" required>
                          <option value="">Selecciona...</option>
                        </select>
                      <?php endif; ?>
                    </div>
                  </div>
                </div>
              <?php endfor; ?>
            </div>
          <?php endif; ?>
          
          <div id="requestDiagnostic1"></div>
          <?php if(isset($requisition)): ?>
            <?php for($i = 2 ; $i <= $requisition->countPersonalD;$i++): ?>
              <div id="<?php echo e('fDB-'.$i); ?>">
                <hr/>
                <div id="<?php echo e('requestHeader'.$i); ?>" class="headerAppend">Beneficiario <?php echo e($i); ?>

                  <button type="button" id="<?php echo e('deleteB-'.$i); ?>" class="btn float-right" onclick="deleteBeneficiary(this)">
                    <i class="fas fa-trash-alt fa-2x colorIcon"></i>
                  </button>
                </div>
                <div class="form-row">
                  <div class="form-group col-md-3">
                    <label for="<?php echo e('curpbeneficiary'.$i); ?>">Curp del beneficiario</label>
                    <div class="input-group">
                      <?php if(isset($requisition['beneficiary'.$i])): ?>
                        <input type="text" class="form-control" id="<?php echo e('curpbeneficiary'.$i); ?>" name="<?php echo e('curpbeneficiary'.$i); ?>" data-mask="SSSS000000SSSSSSAA" placeholder="Ingrese la curp del beneficiario" required value="<?php echo e($requisition['beneficiary'.$i]['curp']); ?>">
                      <?php else: ?>
                        <input type="text" class="form-control" id="<?php echo e('curpbeneficiary'.$i); ?>" name="<?php echo e('curpbeneficiary'.$i); ?>" data-mask="SSSS000000SSSSSSAA" placeholder="Ingrese la curp del beneficiario" required>
                      <?php endif; ?>
                      <div class="input-group-append">
                        <button class="btn btn-outline-secondary" type="button" onclick="verifyCurp(this)" id="<?php echo e('check-'.$i); ?>">Verificar</button>
                      </div>
                      <div class="invalid-feedback">
                        Favor de ingresar la CURP del beneficiario
                      </div>
                    </div>
                  </div>
                  <div class="form-group col-md-3">
                    <label for="<?php echo e('agebeneficiary'.$i); ?>">Edad</label>
                    <?php if(isset($requisition->beneficiary1)): ?>
                      <input type="text" class="form-control" id="<?php echo e('agebeneficiary'.$i); ?>" data-mask="000" name="<?php echo e('agebeneficiary'.$i); ?>" placeholder="Ingrese la edad del beneficiario" required value="<?php echo e($requisition['beneficiary'.$i]['age']); ?>">
                    <?php else: ?>
                      <input type="text" class="form-control" id="<?php echo e('agebeneficiary'.$i); ?>" data-mask="000" name="<?php echo e('agebeneficiary'.$i); ?>" placeholder="Ingrese la edad del beneficiario" required>
                    <?php endif; ?>
                  </div>
                  <div class="form-group col-md-3">
                    <label for="<?php echo e('sermedico'.$i); ?>">Servicio Médico</label>
                    <?php if(isset($requisition['beneficiary'.$i])): ?>
                      <input type="text" class="form-control" id="<?php echo e('sermedico'.$i); ?>"  name="<?php echo e('sermedico'.$i); ?>" placeholder="Ingrese el Servicio Médico" required value="<?php echo e($requisition['beneficiary'.$i]['sermedico']); ?>">
                    <?php else: ?>
                      <input type="text" class="form-control" id="<?php echo e('sermedico'.$i); ?>"  name="<?php echo e('sermedico'.$i); ?>" placeholder="Ingrese la Serrvicio Médico" required>
                    <?php endif; ?>
                  </div>
                  <div class="invalid-feedback">
                      Favor de ingresar el Servicio Médico
                  </div>
                  <div class="form-group col-md-3">
                    <label for="<?php echo e('phonenumber'.$i); ?>">Número telefónico</label>
                    <?php if(isset($requisition->beneficiary1)): ?>
                      <input type="text" class="form-control" id="<?php echo e('phonenumber'.$i); ?>" name="<?php echo e('phonenumber'.$i); ?>" placeholder="Ingresar número telefónico del beneficiario" data-mask="000-000-0000" value="<?php echo e($requisition['beneficiary'.$i]['ext']['number']); ?>" required>
                    <?php else: ?>
                      <input type="text" class="form-control" id="<?php echo e('phonenumber'.$i); ?>" name="<?php echo e('phonenumber'.$i); ?>" placeholder="Ingresar número telefónico del beneficiario" data-mask="000-000-0000" required>
                    <?php endif; ?>
                    <div class="invalid-feedback">
                      Favor de ingresar el número telefónico del beneficiario
                    </div>
                  </div>                          
                </div>
                <div class="form-row">
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('namebeneficiary'.$i); ?>">Nombre(s)</label>
                    <?php if(isset($requisition['beneficiary'.$i])): ?>
                      <input type="text" class="form-control" id="<?php echo e('namebeneficiary'.$i); ?>" name="<?php echo e('namebeneficiary'.$i); ?>" value="<?php echo e($requisition['beneficiary'.$i]['name']); ?>" placeholder="Ingrese el nombre del beneficiario" required>
                    <?php else: ?>
                      <input type="text" class="form-control" id="<?php echo e('namebeneficiary'.$i); ?>" name="<?php echo e('namebeneficiary'.$i); ?>" placeholder="Ingrese el nombre del beneficiario" required>
                    <?php endif; ?>
                    <div class="invalid-feedback">
                        Favor de ingresar el nombre del beneficiario
                    </div>
                  </div>
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('lastNamebeneficiary'.$i); ?>">Apellido paterno</label>
                    <?php if(isset($requisition['beneficiary'.$i])): ?>
                      <input type="text" class="form-control" id="<?php echo e('lastNamebeneficiary'.$i); ?>" name="<?php echo e('lastNamebeneficiary'.$i); ?>" value="<?php echo e($requisition['beneficiary'.$i]['lastName']); ?>" placeholder="Ingrese el apellido paterno del beneficiario" required>
                    <?php else: ?>
                      <input type="text" class="form-control" id="<?php echo e('lastNamebeneficiary'.$i); ?>" name="<?php echo e('lastNamebeneficiary'.$i); ?>" placeholder="Ingrese el apellido paterno del beneficiario" required>
                    <?php endif; ?>
                    <div class="invalid-feedback">
                        Favor de ingresar el apellido paterno del beneficiario
                    </div>
                  </div>
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('secondLastNamebeneficiary'.$i); ?>">Apellido materno</label>
                    <?php if(isset($requisition['beneficiary'.$i])): ?>
                      <input type="text" class="form-control" id="<?php echo e('secondLastNamebeneficiary'.$i); ?>" name="<?php echo e('secondLastNamebeneficiary'.$i); ?>" placeholder="Ingrese el apellido Materno del beneficiario" value="<?php echo e($requisition['beneficiary'.$i]['secondLastName']); ?>" required>
                    <?php else: ?>
                      <input type="text" class="form-control" id="<?php echo e('secondLastNamebeneficiary'.$i); ?>" name="<?php echo e('secondLastNamebeneficiary'.$i); ?>" placeholder="Ingrese el apellido Materno del beneficiario" required>
                    <?php endif; ?>
                    <div class="invalid-feedback">
                        Favor de ingresar el apellido materno del beneficiario
                    </div>
                  </div>
                </div>
                <div class="form-row">
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('civilStatusbeneficiary'.$i); ?>">Edo. Civil</label>
                    <select id="<?php echo e('civilStatusbeneficiary'.$i); ?>" name="<?php echo e('civilStatusbeneficiary'.$i); ?>" class="form-control" required>
                      <?php if(isset($requisition['beneficiary'.$i])): ?>
                        
                        <option value="soltero(a)" <?php echo e($requisition['beneficiary'.$i]['ext']['civilStatus'] == "soltero(a)" ? 'selected' : ""); ?>>Soltero(a)</option>
                        <option value="casado(a)" <?php echo e($requisition['beneficiary'.$i]['ext']['civilStatus'] == "casado(a)" ? 'selected' : ""); ?>>Casado(a)</option>
                        <option value="divorciado(a)" <?php echo e($requisition['beneficiary'.$i]['ext']['civilStatus'] == "divorciado(a)" ? 'selected' : ""); ?>>Divorciado(a)</option>
                        <option value="viudo(a)" <?php echo e($requisition['beneficiary'.$i]['ext']['civilStatus'] == "viudo(a)" ? 'selected' : ""); ?>>Viudo(a)</option>
                        <option value="unionLibre" <?php echo e($requisition['beneficiary'.$i]['ext']['civilStatus'] == "unionLibre" ? 'selected' : ""); ?>>Unión libre</option>
                      <?php else: ?>
                        <option value="">Selecciona...</option>
                        <option value="soltero(a)">Soltero(a)</option>
                        <option value="casado(a)">Casado(a)</option>
                        <option value="divorciado(a)">Divorciado(a)</option>
                        <option value="viudo(a)">Viudo(a)</option>
                        <option value="unionLibre">Unión libre</option>
                      <?php endif; ?>
                    </select>
                  </div>
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('scholarShipbeneficiary'.$i); ?>">Escolaridad</label>
                        <select id="<?php echo e('scholarShipbeneficiary'.$i); ?>" name="<?php echo e('scholarShipbeneficiary'.$i); ?>" class="form-control" required>
                          <?php if(isset($requisition['beneficiary'.$i])): ?>
                            
                            <option value="primaria" <?php echo e($requisition['beneficiary'.$i]['ext']['scholarShip'] == "primaria" ? 'selected' : ""); ?>>Primaria</option>
                            <option value="secundaria" <?php echo e($requisition['beneficiary'.$i]['ext']['scholarShip'] == "secundaria" ? 'selected' : ""); ?>>Secundaria</option>
                            <option value="bachillerato/tecnico" <?php echo e($requisition['beneficiary'.$i]['ext']['scholarShip'] == "bachillerato/tecnico" ? 'selected' : ""); ?>>Bachillerato/Técnico</option>
                            <option value="licenciatura/profesional" <?php echo e($requisition['beneficiary'.$i]['ext']['scholarShip'] == "licenciatura/profesional" ? 'selected' : ""); ?>>Licenciatura/Profesional</option>
                            <option value="posgrado" <?php echo e($requisition['beneficiary'.$i]['ext']['scholarShip'] == "posgrado" ? 'selected' : ""); ?>>Posgrado</option>
                          <?php else: ?>
                            <option value="sinEstudios">Sin estudios</option>
                            <option value="primaria">Primaria</option>
                            <option value="secundaria">Secundaria</option>
                            <option value="bachillerato/tecnico">Bachillerato/Técnico</option>
                            <option value="licenciatura/profesional">Licenciatura/Profesional</option>
                            <option value="posgrado">Posgrado</option>
                          <?php endif; ?>
                        </select>
                  </div>
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('employments_idbeneficiary'.$i); ?>">Ocupación</label>
                    <select id="<?php echo e('employments_idbeneficiary'.$i); ?>" name="<?php echo e('employments_idbeneficiary'.$i); ?>" class="form-control" required>
                        <?php if(isset($employments)): ?>
                            <?php if(isset($requisition->beneficiary1)): ?>
                                <?php $__currentLoopData = $employments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition['beneficiary'.$i]['ext']['employments_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php else: ?>
                                <?php $__currentLoopData = $employments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endif; ?>
                        <?php endif; ?>
                    </select>
                  </div>
                </div>
                <div>
                  <span class="m-0 font-weight-bold text-primary headerAppend">Diagnostico de Beneficiario <?php echo e($i); ?>

                    
                  </span>
                  <?php if(isset($requisition)): ?>
                    <input type="hidden" name="<?php echo e('countDiagnosticBeneficiary'.$i); ?>" id="<?php echo e('countDiagnosticBeneficiary'.$i); ?>" value="<?php echo e($requisition['countDiagnosticBeneficiary'.$i]); ?>">
                    <input type="hidden" name="<?php echo e('countTotalDB'.$i); ?>" id="<?php echo e('countTotalDB'.$i); ?>" value="<?php echo e($requisition['countDiagnosticBeneficiary'.$i]); ?>">
                  <?php else: ?>
                    s<input type="hidden" name="<?php echo e('countDiagnosticBeneficiary'.$i); ?>" id="<?php echo e('countDiagnosticBeneficiary'.$i); ?>" value="1">
                    <input type="hidden" name="<?php echo e('countTotalDB'.$i); ?>" id="<?php echo e('countTotalDB'.$i); ?>" value="1">
                  <?php endif; ?>
                </div>
                <?php if(isset($requisition)): ?>
                  <div id="<?php echo e('requestDiagnostic'.$i); ?>">
                  <?php for($x = 1; $x <= $requisition['countDiagnosticBeneficiary'.$i]; $x++): ?>
                    <div id="<?php echo e('fDDB'.$i.'_'.$x); ?>">                        
                      <hr>
                      <div id="<?php echo e('requestHeader'.$x); ?>" class="headerAppend">Categoria de Diagnostico <?php echo e($x+1); ?>

                        <!--<button type="button" id="<?php echo e('deleteDB'.$i.'_'.$x); ?>" class="btn float-right" onclick="deleteBeneficiaryDiag(this)">
                          <i class="fas fa-trash-alt fa-2x colorIcon"></i>
                        </button>-->
                      </div>
                      <div class="form-row" style="display: none;">
                        <div class="form-group col-md-12">                    
                          <?php if(isset($requisition['beneficiary'.$i]['Disabilitiesid'.$x])): ?>
                            <input type="hidden" class="form-control" id="<?php echo e('beneficiaryDisabilitiesid'.$i.'_'.$x); ?>" name="<?php echo e('beneficiaryDisabilitiesid'.$i.'_'.$x); ?>" value="<?php echo e($requisition['beneficiary'.$i.'Disabilitiesid'.$x]); ?>">
                          <?php else: ?>
                            <input type="hidden" class="form-control" id="<?php echo e('beneficiaryDisabilitiesid'.$i.'_'.$x); ?>" name="<?php echo e('beneficiaryDisabilitiesid'.$i.'_'.$x); ?>" value="">
                          <?php endif; ?>
                        </div>
                      </div>
                      <div class="form-row">
                        <div class="form-group col-md-6">
                          <label for="<?php echo e('disabilitycategories'.$i.'_'.$x); ?>">Categoria del Diagnostico</label>
                          <select id="<?php echo e('disabilitycategories'.$i.'_'.$x); ?>" name="<?php echo e('disabilitycategories'.$i.'_'.$x); ?>"  onchange="getDisabilities(this)" class="form-control" required>
                            <option value="">selecciona...</option>
                            <?php if(isset($catDisabilities)): ?>
                              <?php if(isset($requisition['beneficiary'.$i])): ?>
                                <?php $__currentLoopData = $catDisabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                  <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition['beneficiary'.$i]['catDisabilities_id'.$x] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                              <?php else: ?>
                                <?php $__currentLoopData = $catDisabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                  <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                              <?php endif; ?>
                            <?php endif; ?>
                          </select>
                        </div>
                        <div class="form-group col-md-6">
                          <label for="<?php echo e('disability'.$i.'_'.$x); ?>">Diagnostico</label>
                          <?php if(isset($requisition['beneficiary'.$i])): ?>
                            <select id="<?php echo e('disability'.$i.'_'.$x); ?>" name="<?php echo e('disability'.$i.'_'.$x); ?>"  class="form-control" required>
                              <option value="">Selecciona...</option>
                              <?php $__currentLoopData = $requisition['beneficiary'.$i.'Disabilities'.$x]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($element['id']); ?>" <?php echo e($element->id == $requisition['beneficiary'.$i]['disabilities_id'.$x] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                          <?php else: ?>
                            <select id="<?php echo e('disability'.$i.'_'.$x); ?>" name="<?php echo e('disability'.$i.'_'.$x); ?>" disabled class="form-control" required>
                              <option value="">Selecciona...</option>
                            </select>
                          <?php endif; ?>
                        </div>
                      </div>
                    </div>
                  <?php endfor; ?>
                  </div>
                <?php endif; ?>
              </div>                  
            <?php endfor; ?>
          <?php endif; ?>
       
          <div id="requests"></div>
          <hr/>
          <div class="headerAppend">
            Dirección
          </div>
          <div class="form-row">
            <div class="form-group col-md-3">
              <label for="street">Calle</label>
              <?php if(isset($requisition->address)): ?>
                <input type="text" class="form-control" id="street" name="street" placeholder="Ingresar la calle" value="<?php echo e($requisition->address['street']); ?>" required>
              <?php else: ?>
                <input type="text" class="form-control" id="street" name="street" placeholder="Ingresar la calle" required>
              <?php endif; ?>
              <div class="invalid-feedback">
                Favor de ingresar la calle de la dirección del beneficiario
              </div>
            </div>
            <div class="form-group col-md-3">
              <label for="externalNumber">Número externo</label>
              <?php if(isset($requisition->address)): ?>
                <input type="text" class="form-control" id="externalNumber" name="externalNumber" placeholder="Ingresar el número externo" value="<?php echo e($requisition->address['externalNumber']); ?>" required>
              <?php else: ?>
                <input type="text" class="form-control" id="externalNumber" name="externalNumber" placeholder="Ingresar el número externo" required>
              <?php endif; ?>
              <div class="invalid-feedback">
                Favor de ingresar el número externo de la dirección del beneficiario
              </div>
            </div>
            <div class="form-group col-md-3">
              <label for="internalNumber">Número interno</label>
              <?php if(isset($requisition->address)): ?>
                <input type="text" class="form-control" id="internalNumber" name="internalNumber" value="<?php echo e($requisition->address['internalNumber']); ?>" placeholder="Ingresar el número interno">
              <?php else: ?>
                <input type="text" class="form-control" id="internalNumber" name="internalNumber" placeholder="Ingresar el número interno">
              <?php endif; ?>
            </div>
            <div class="form-group col-md-3">
              <label for="postalCode1">Código Postal</label>
              <div class="input-group">
                <?php if(isset($requisition->address)): ?>
                  <input type="text" class="form-control" id="postalCode1" name="postalCode1" placeholder="Ingresa tú numero postal" required data-mask="00000" value="<?php echo e($requisition->address['community']['postalCode']); ?>">
                <?php else: ?>
                  <input type="text" class="form-control" id="postalCode1" name="postalCode1" placeholder="Ingresa tú numero postal" required data-mask="00000">
                <?php endif; ?>
                <div class="input-group-append">
                  <button class="btn btn-outline-secondary" type="button" onclick="filterCP(this)" id="filter-1">Filtrar</button>
                </div>
                <div class="invalid-feedback">
                  Favor de ingresar el código postal de la dirección del beneficiario
                </div>
              </div>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-3">
              <label for="communities_id1">Colonia</label>
              <?php if(isset($requisition->address)): ?>
                <select id="communities_id1" name="communities_id1" class="form-control" required>
                  <?php if(isset($communities)): ?>
                    <?php $__currentLoopData = $communities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->address['communities_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  <?php endif; ?>
                </select> 
              <?php else: ?>
                <select id="communities_id1" name="communities_id1" disabled class="form-control" required>
                    <option value="">Selecciona...</option>
                </select>
              <?php endif; ?>
            </div> 
            <div class="form-group col-md-3">
              <label for="municipalities_id1">Municipio</label>
              <select id="municipalities_id1" name="municipalities_id1" disabled class="form-control" required>
                <?php if(isset($requisition->address)): ?>
                  <option value="<?php echo e($requisition->address['municipalities']['id']); ?>"><?php echo e($requisition->address['municipalities']['name']); ?></option>
                <?php else: ?>
                  <option value="">seleccione...</option>
                <?php endif; ?>
              </select>
            </div>
            <div class="form-group col-md-3">
              <label for="states_id1">Estado</label>
              <select id="states_id1" name="states_id1" class="form-control" disabled required>
              <?php if(isset($requisition->address)): ?>
                <option value="<?php echo e($requisition->address['states']['id']); ?>"><?php echo e($requisition->address['states']['name']); ?></option>
              <?php else: ?>
                <option value="">seleccione...</option>
              <?php endif; ?>
              </select>
            </div>
            <div class="form-group col-md-3">
              <label for="area">Área</label>
              <?php if(isset($requisition)): ?>
                <input type="text" class="form-control" id="area" name="area" placeholder="Ingresar el número del área" value="<?php echo e($requisition->area); ?>" required>
              <?php else: ?>
                <input type="text" class="form-control" id="area" name="area" placeholder="Ingresar el número del área" required>
              <?php endif; ?>
              <div class="invalid-feedback">
                Favor de ingresar el número del área
              </div>
            </div>
          </div>
          <a href="solicitudes"  class="btn btn-primary float-right">Cancelar</a>
          <button type="button" id="beneficiaryGeneralData-1"  onclick="nextNavTab(this)" class="btn btn-primary float-right" style="margin-right: 3px;">Siguiente</button>
          <button type="button" id="beneficiaryGeneralData-2"  onclick="nextNavTab(this)" class="btn btn-primary float-right" style="margin-right: 3px;">Anterior</button>
          <!---->
        </div> 
        
        <div class="tab-pane fade" id="familySituation" role="tabpanel" aria-labelledby="familySituation-tab">
          <hr>
          <div>
            <span class="m-0 font-weight-bold text-primary title-table">No. de Miembros que viven en el Hogar
              <button type="button" id="addMH" class="btn btn-primary float-right">Agregar</button>
            </span>
            <?php if(isset($requisition->CountConditionsFamily)): ?>
              <input type="hidden" name="countMH" id="countMH" value="<?php echo e($requisition->CountConditionsFamily == 0 || $requisition->CountConditionsFamily == null ? 1 : $requisition->CountConditionsFamily); ?>">
              <input type="hidden" name="countTotalMH" id="countTotalMH" value="<?php echo e($requisition->CountConditionsFamily == 0 || $requisition->CountConditionsFamily == null ? 1 : $requisition->CountConditionsFamily); ?>">
            <?php else: ?>
              <input type="hidden" name="countMH" id="countMH" value="1">
              <input type="hidden" name="countTotalMH" id="countTotalMH" value="1">
            <?php endif; ?>
          </div>
          <hr>
          <div class="form-row" style="display: none;">
            <div class="form-group col-md-12">
              <?php if(isset($requisition['ConditionsFamily1'])): ?>
                <input type="hidden" class="form-control" id="ConditionsFamilyid1" name="ConditionsFamilyid1" value="<?php echo e($requisition['ConditionsFamily1']['id']); ?>">
              <?php else: ?>
                <input type="hidden" class="form-control" id="ConditionsFamilyid1" name="ConditionsFamilyid1" value="">
              <?php endif; ?>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-4">
              <label for="name1">Nombre(s)</label>
              <?php if(isset($requisition->ConditionsFamily1)): ?>
                <input type="text" class="form-control" id="name1" name="name1" placeholder="Ingresa nombre de la persona" value="<?php echo e($requisition->ConditionsFamily1['name']); ?>">
              <?php else: ?>
                <input type="text" class="form-control" id="name1" name="name1" placeholder="Ingresa nombre de la persona">
              <?php endif; ?>
            </div>
            <div class="form-group col-md-4">
              <label for="lastName1">Apellido paterno</label>
              <?php if(isset($requisition->ConditionsFamily1)): ?>
                <input type="text" class="form-control" id="lastName1" name="lastName1" placeholder="Ingresa el apellido paterno de la persona" value="<?php echo e($requisition->ConditionsFamily1['lastname']); ?>">
              <?php else: ?>
                <input type="text" class="form-control" id="lastName1" name="lastName1" placeholder="Ingresa el apellido paterno de la persona">
              <?php endif; ?>
            </div>
            <div class="form-group col-md-4">
              <label for="secondLastName1">Apellido materno</label>
              <?php if(isset($requisition->ConditionsFamily1)): ?>
                <input type="text" class="form-control" id="secondLastName1" name="secondLastName1" placeholder="Ingresa el apellido materno de la persona" value="<?php echo e($requisition->ConditionsFamily1['secondlastname']); ?>">
              <?php else: ?>
                <input type="text" class="form-control" id="secondLastName1" name="secondLastName1" placeholder="Ingresa el apellido materno de la persona">
              <?php endif; ?>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-4">
              <label for="age1">Edad</label>
              <?php if(isset($requisition->ConditionsFamily1)): ?>
                <input type="text" class="form-control" id="age1" name="age1" data-mask="000" placeholder="Ingresa la edad de la persona" value="<?php echo e($requisition->ConditionsFamily1['age']); ?>">
              <?php else: ?>
                <input type="text" class="form-control" id="age1" name="age1" data-mask="000" placeholder="Ingresa la edad de la persona">
              <?php endif; ?>
            </div>
            <div class="form-group col-md-4">
              <label for="relationship1">Parentesco</label>
              <select id="relationship1" name="relationship1" class="form-control">
                <?php if(isset($requisition->ConditionsFamily1)): ?>
                  <option value="" <?php echo e("" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>selecciona...</option>
                  <option value="padre" <?php echo e("padre" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>Padre</option>
                  <option value="madre" <?php echo e("madre" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>Madre</option>
                  <option value="hermano(a)" <?php echo e("hermano(a)" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>Hermano(a)</option>
                  <option value="tio(a)" <?php echo e("tio(a)" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>Tio(a)</option>
                  <option value="primo(a)" <?php echo e("primo(a)" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>Primo(a)</option>
                  <option value="hijo(a)" <?php echo e("hijo(a)" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>Hijo(a)</option>
                  <option value="abuelo(a)" <?php echo e("abuelo(a)" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>Abuelo(a)</option>
                  <option value="esposo(a)" <?php echo e("esposo(a)" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>Esposo(a)</option>
                  <option value="otros" <?php echo e("otros" == $requisition->ConditionsFamily1['relationship'] ? 'selected' : ''); ?>>Otros</option>
          
                <?php else: ?>
                  <option value="">selecciona...</option>
                  <option value="padre">Padre</option>
                  <option value="madre">Madre</option>
                  <option value="hermano(a)">Hermano(a)</option>
                  <option value="tio(a)">Tio(a)</option>
                  <option value="primo(a)">Primo(a)</option>
                  <option value="hijo(a)">Hijo(a)</option>
                  <option value="abuelo(a)">Abuelo(a)</option>
                  <option value="esposo(a)">Esposo(a)</option>
                  <option value="otros">Otros</option>
                <?php endif; ?>
              </select>
            </div>
            <div class="form-group col-md-4">
              <label for="civilStatus1">Edo. Civil</label>
              <select id="civilStatus1" name="civilStatus1" class="form-control">
                <?php if(isset($requisition->ConditionsFamily1)): ?>
                  <option value="" <?php echo e("" == $requisition->ConditionsFamily1['civilStatus'] ? 'selected' : ''); ?>>selecciona...</option>
                  <option value="soltero(a)" <?php echo e("soltero(a)" == $requisition->ConditionsFamily1['civilStatus'] ? 'selected' : ''); ?>>Soltero(a)</option>
                  <option value="casado(a)" <?php echo e("casado(a)" == $requisition->ConditionsFamily1['civilStatus'] ? 'selected' : ''); ?>>Casado(a)</option>
                  <option value="divorciado(a)" <?php echo e("divorciado(a)" == $requisition->ConditionsFamily1['civilStatus'] ? 'selected' : ''); ?>>Divorciado(a)</option>
                  <option value="viudo(a)" <?php echo e("viudo(a)" == $requisition->ConditionsFamily1['civilStatus'] ? 'selected' : ''); ?>>Viudo(a)</option>
                  <option value="unionLibre" <?php echo e("unionLibre" == $requisition->ConditionsFamily1['civilStatus'] ? 'selected' : ''); ?>>Unión libre</option>
                <?php else: ?>
                  <option value="">selecciona...</option>
                  <option value="soltero(a)">Soltero(a)</option>
                  <option value="casado(a)">Casado(a)</option>
                  <option value="divorciado(a)">Divorciado(a)</option>
                  <option value="viudo(a)">Viudo(a)</option>
                  <option value="unionLibre">Unión libre</option>
                <?php endif; ?>
              </select>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-6">
              <label for="scholarShip1">Escolaridad</label>
              <select id="scholarShip1" name="scholarShip1" class="form-control">
                <?php if(isset($requisition->ConditionsFamily1)): ?>
                  <option value="" <?php echo e("" == $requisition->ConditionsFamily1['scholarship'] ? 'selected' : ''); ?>>selecciona...</option>
                  <option value="sinEstudios" <?php echo e("sinEstudios" == $requisition->ConditionsFamily1['scholarship'] ? 'selected' : ''); ?>>Sin estudios</option>
                  <option value="primaria" <?php echo e("primaria" == $requisition->ConditionsFamily1['scholarship'] ? 'selected' : ''); ?>>Primaria</option>
                  <option value="secundaria" <?php echo e("secundaria" == $requisition->ConditionsFamily1['scholarship'] ? 'selected' : ''); ?>>Secundaria</option>
                  <option value="bachillerato/tecnico" <?php echo e("bachillerato/tecnico" == $requisition->ConditionsFamily1['scholarship'] ? 'selected' : ''); ?>>Bachillerato/Técnico</option>
                  <option value="licenciatura/profesional" <?php echo e("licenciatura/profesional" == $requisition->ConditionsFamily1['scholarship'] ? 'selected' : ''); ?>>Licenciatura/Profesional</option>
                  <option value="posgrado" <?php echo e("posgrado" == $requisition->ConditionsFamily1['scholarship'] ? 'selected' : ''); ?>>Posgrado</option>
                <?php else: ?>
                  <option value="">selecciona...</option>
                  <option value="sinEstudios">Sin estudios</option>
                  <option value="primaria">Primaria</option>
                  <option value="secundaria">Secundaria</option>
                  <option value="bachillerato/tecnico">Bachillerato/Técnico</option>
                  <option value="licenciatura/profesional">Licenciatura/Profesional</option>
                  <option value="posgrado">Posgrado</option>
                <?php endif; ?>
              </select>
            </div>
            <div class="form-group col-md-6">
              <label for="employments_id1">Ocupación</label>
              <select id="employments_id1" name="employments_id1" class="form-control">
                  <option value="">selecciona...</option>
                  <?php if(isset($requisition->ConditionsFamily1)): ?>
                      <?php if(isset($employments)): ?>
                          <?php $__currentLoopData = $employments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->ConditionsFamily1['employments_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                      <?php endif; ?>
                  <?php else: ?>
                    <?php if(isset($employments)): ?>
                      <?php $__currentLoopData = $employments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                  <?php endif; ?>
              </select>
            </div>
          </div>

          <?php if(isset($requisition)): ?>
            <?php for($i = 2 ; $i <= $requisition->CountConditionsFamily;$i++): ?>
              <div id="<?php echo e('fDMH-'.$i); ?>">
                <hr/>
                <button type="button" id="<?php echo e('deleteMH-'.$i); ?>" class="btn float-right" onclick="deleteMH(this)">
                  <i class="fas fa-trash-alt fa-2x colorIcon"></i>
                </button>
                <div class="form-row" style="display: none;">
                  <div class="form-group col-md-12">                    
                    <?php if(isset($requisition['ConditionsFamily'.$i])): ?>
                      <input type="hidden" class="form-control" id="<?php echo e('ConditionsFamilyid'.$i); ?>" name="<?php echo e('ConditionsFamilyid'.$i); ?>" value="<?php echo e($requisition['ConditionsFamily'.$i]['id']); ?>">
                    <?php else: ?>
                      <input type="hidden" class="form-control" id="<?php echo e('ConditionsFamilyid'.$i); ?>" name="<?php echo e('ConditionsFamilyid'.$i); ?>" value="">
                    <?php endif; ?>
                  </div>
                </div>
                <div class="form-row">
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('name'.$i); ?>">Nombre(s)</label>
                    <?php if(isset($requisition['ConditionsFamily'.$i])): ?>
                      <input type="text" class="form-control" id="<?php echo e('name'.$i); ?>" name="<?php echo e('name'.$i); ?>" placeholder="Ingresa nombre de la persona" value="<?php echo e($requisition['ConditionsFamily'.$i]['name']); ?>">
                    <?php else: ?>
                      <input type="text" class="form-control" id="<?php echo e('name'.$i); ?>" name="<?php echo e('name'.$i); ?>" placeholder="Ingresa nombre de la persona">
                    <?php endif; ?>
                  </div>
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('lastName'.$i); ?>">Apellido paterno</label>
                    <?php if(isset($requisition['ConditionsFamily'.$i])): ?>
                      <input type="text" class="form-control" id="<?php echo e('lastName'.$i); ?>" name="<?php echo e('lastName'.$i); ?>" placeholder="Ingresa el apellido paterno de la persona" value="<?php echo e($requisition['ConditionsFamily'.$i]['lastname']); ?>">
                    <?php else: ?>
                      <input type="text" class="form-control" id="<?php echo e('lastName'.$i); ?>" name="<?php echo e('lastName'.$i); ?>" placeholder="Ingresa el apellido paterno de la persona">
                    <?php endif; ?>
                  </div>
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('secondLastName'.$i); ?>">Apellido materno</label>
                    <?php if(isset($requisition['ConditionsFamily'.$i])): ?>
                      <input type="text" class="form-control" id="<?php echo e('secondLastName'.$i); ?>" name="<?php echo e('secondLastName'.$i); ?>" placeholder="Ingresa el apellido materno de la persona" value="<?php echo e($requisition['ConditionsFamily'.$i]['secondlastname']); ?>">
                    <?php else: ?>
                      <input type="text" class="form-control" id="<?php echo e('secondLastName'.$i); ?>" name="<?php echo e('secondLastName'.$i); ?>" placeholder="Ingresa el apellido materno de la persona">
                    <?php endif; ?>
                  </div>
                </div>
                <div class="form-row">
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('age'.$i); ?>">Edad</label>
                    <?php if(isset($requisition['ConditionsFamily'.$i])): ?>
                      <input type="number" class="form-control" id="<?php echo e('age'.$i); ?>" name="<?php echo e('age'.$i); ?>" placeholder="Ingresa la edad de la persona" value="<?php echo e($requisition['ConditionsFamily'.$i]['age']); ?>">
                    <?php else: ?>
                      <input type="number" class="form-control" id="<?php echo e('age'.$i); ?>" name="<?php echo e('age'.$i); ?>" placeholder="Ingresa la edad de la persona">
                    <?php endif; ?>
                  </div>
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('relationship'.$i); ?>">Parentesco</label>
                    <select id="<?php echo e('relationship'.$i); ?>" name="<?php echo e('relationship'.$i); ?>" class="form-control">
                      <?php if(isset($requisition['ConditionsFamily'.$i])): ?>
                        <option value="" <?php echo e("" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>selecciona...</option>
                        <option value="padre" <?php echo e("padre" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Padre</option>
                        <option value="madre" <?php echo e("madre" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Madre</option>
                        <option value="hermano(a)" <?php echo e("hermano(a)" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Hermano(a)</option>
                        <option value="tio(a)" <?php echo e("tio(a)" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Tio(a)</option>
                        <option value="primo(a)" <?php echo e("primo(a)" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Primo(a)</option>
                        <option value="hermano(a)" <?php echo e("hermano(a)" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Hermano(a)</option>
                        <option value="hijo(a)" <?php echo e("hijo(a)" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Hijo(a)</option>
                        <option value="abuelo(a)" <?php echo e("abuelo(a)" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Abuelo(a)</option>
                        <option value="esposo(a)" <?php echo e("esposo(a)" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Esposo(a)</option>
                        <option value="otros" <?php echo e("otros" == $requisition['ConditionsFamily'.$i]['relationship'] ? 'selected' : ''); ?>>Otros</option>
                      
                      <?php else: ?>
                        <option value="">selecciona...</option>
                        <option value="padre">Padre</option>
                        <option value="madre">Madre</option>
                        <option value="hermano(a)">Hermano(a)</option>
                        <option value="tio(a)">Tio(a)</option>
                        <option value="primo(a)">Primo(a)</option>
                        <option value="hermano(a)">Hermano(a)</option>
                        <option value="hijo(a)">Hijo(a)</option>
                        <option value="esposo(a)">Esposo(a)</option>
                        <option value="abuelo(a)">Abuelo(a)</option>
                        <option value="otros">Otros</option>
                      <?php endif; ?>
                    </select>
                  </div>
                  <div class="form-group col-md-4">
                    <label for="<?php echo e('civilStatus'.$i); ?>">Edo. Civil</label>
                    <select id="<?php echo e('civilStatus'.$i); ?>" name="<?php echo e('civilStatus'.$i); ?>" class="form-control">
                      <?php if(isset($requisition['ConditionsFamily'.$i])): ?>
                        <option value="" <?php echo e("" == $requisition['ConditionsFamily'.$i]['civilStatus'] ? 'selected' : ''); ?>>selecciona...</option>
                        <option value="soltero(a)" <?php echo e("soltero(a)" == $requisition['ConditionsFamily'.$i]['civilStatus'] ? 'selected' : ''); ?>>Soltero(a)</option>
                        <option value="casado(a)" <?php echo e("casado(a)" == $requisition['ConditionsFamily'.$i]['civilStatus'] ? 'selected' : ''); ?>>Casado(a)</option>
                        <option value="divorciado(a)" <?php echo e("divorciado(a)" == $requisition['ConditionsFamily'.$i]['civilStatus'] ? 'selected' : ''); ?>>Divorciado(a)</option>
                        <option value="viudo(a)" <?php echo e("viudo(a)" == $requisition['ConditionsFamily'.$i]['civilStatus'] ? 'selected' : ''); ?>>Viudo(a)</option>
                        <option value="unionLibre" <?php echo e("unionLibre" == $requisition['ConditionsFamily'.$i]['civilStatus'] ? 'selected' : ''); ?>>Unión libre</option>
                      <?php else: ?>
                        <option value="">selecciona...</option>
                        <option value="soltero(a)">Soltero(a)</option>
                        <option value="casado(a)">Casado(a)</option>
                        <option value="divorciado(a)">Divorciado(a)</option>
                        <option value="viudo(a)">Viudo(a)</option>
                        <option value="unionLibre">Unión libre</option>
                      <?php endif; ?>
                    </select>
                  </div>
                </div>
                <div class="form-row">
                  <div class="form-group col-md-6">
                    <label for="<?php echo e('scholarShip'.$i); ?>">Escolaridad</label>
                    <select id="<?php echo e('scholarShip'.$i); ?>" name="<?php echo e('scholarShip'.$i); ?>" class="form-control">
                      <?php if(isset($requisition['ConditionsFamily'.$i])): ?>
                        <option value="" <?php echo e("" == $requisition['ConditionsFamily'.$i]['scholarship'] ? 'selected' : ''); ?>>selecciona...</option>
                        <option value="sinEstudios" <?php echo e("sinEstudios" == $requisition['ConditionsFamily'.$i]['scholarship'] ? 'selected' : ''); ?>>Sin estudios</option>
                        <option value="primaria" <?php echo e("primaria" == $requisition['ConditionsFamily'.$i]['scholarship'] ? 'selected' : ''); ?>>Primaria</option>
                        <option value="secundaria" <?php echo e("secundaria" == $requisition['ConditionsFamily'.$i]['scholarship'] ? 'selected' : ''); ?>>Secundaria</option>
                        <option value="bachillerato/tecnico" <?php echo e("bachillerato/tecnico" == $requisition['ConditionsFamily'.$i]['scholarship'] ? 'selected' : ''); ?>>Bachillerato/Técnico</option>
                        <option value="licenciatura/profesional" <?php echo e("licenciatura/profesional" == $requisition['ConditionsFamily'.$i]['scholarship'] ? 'selected' : ''); ?>>Licenciatura/Profesional</option>
                        <option value="posgrado" <?php echo e("posgrado" == $requisition['ConditionsFamily'.$i]['scholarship'] ? 'selected' : ''); ?>>Posgrado</option>
                      <?php else: ?>
                        <option value="">selecciona...</option>
                        <option value="sinEstudios">Sin estudios</option>
                        <option value="primaria">Primaria</option>
                        <option value="secundaria">Secundaria</option>
                        <option value="bachillerato/tecnico">Bachillerato/Técnico</option>
                        <option value="licenciatura/profesional">Licenciatura/Profesional</option>
                        <option value="posgrado">Posgrado</option>
                      <?php endif; ?>
                    </select>
                  </div>
                  <div class="form-group col-md-6">
                    <label for="<?php echo e('employments_id'.$i); ?>">Ocupación</label>
                    <select id="<?php echo e('employments_id'.$i); ?>" name="<?php echo e('employments_id'.$i); ?>" class="form-control">
                      <option value="">selecciona...</option>
                      <?php if(isset($requisition['ConditionsFamily'.$i])): ?>
                        <?php if(isset($employments)): ?>
                          <?php $__currentLoopData = $employments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition['ConditionsFamily'.$i]['employments_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                      <?php else: ?>
                        <?php if(isset($employments)): ?>
                          <?php $__currentLoopData = $employments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                      <?php endif; ?>
                    </select>
                  </div>
                </div>
              </div>
            <?php endfor; ?>
          <?php endif; ?>

          <div id="MHs"></div>
          <hr>
          <a href="solicitudes"  class="btn btn-primary float-right">Cancelar</a>
          <button type="button" id="familySituation-1"  onclick="nextNavTab(this)" class="btn btn-primary float-right" style="margin-right: 3px;">Siguiente</button>
          <button type="button" id="familySituation-2"  onclick="nextNavTab(this)" class="btn btn-primary float-right" style="margin-right: 3px;">Anterior</button>
          <!---->
        </div>                
        
        <div class="tab-pane fade" id="lifeConditions" role="tabpanel" aria-labelledby="lifeConditions-tab">
          <br>
          <div class="form-row">
            <div class="form-group col-md-5">
              <label for="typeHouse">La casa del beneficiario es:</label>
              <select id="typeHouse" name="typeHouse" class="form-control" required>
                  <?php if(isset($lifeConditions)): ?>
                      <option value="" <?php echo e("" == $lifeConditions->typeHouse ? "selected" : ""); ?>>selecciona...</option>
                      <option value="propia" <?php echo e("propia" == $lifeConditions->typeHouse ? "selected" : ""); ?>>Propia</option>
                      <option value="rentada" <?php echo e("rentada" == $lifeConditions->typeHouse ? "selected" : ""); ?>>Rentada</option>
                      <option value="prestada" <?php echo e("prestada" == $lifeConditions->typeHouse ? "selected" : ""); ?>>Prestada</option>
                      <option value="invadida" <?php echo e("invadida" == $lifeConditions->typeHouse ? "selected" : ""); ?>>Invadida</option>
                  <?php else: ?>
                      <option value="">selecciona...</option>
                      <option value="propia">Propia</option>
                      <option value="rentada">Rentada</option>
                      <option value="prestada">Prestada</option>
                      <option value="invadida">Invadida</option>
                  <?php endif; ?>
              </select>
            </div>
            <div class="form-group col-md-5">
                <label for="number_rooms">Número de cuartos</label>
                <?php if(session('department_institute_id') <> 4): ?>
                  <?php if(isset($lifeConditions)): ?>
                    <input type="text" class="form-control" id="number_rooms" name="number_rooms" value="<?php echo e($lifeConditions->number_rooms); ?>" data-mask="00" placeholder="Ingresar la cantidad de cuartos">
                  <?php else: ?>
                    <input type="text" class="form-control" id="number_rooms" name="number_rooms" placeholder="Ingresar la cantidad de cuartos" data-mask="00" >
                  <?php endif; ?>
                <?php else: ?>
                  <?php if(isset($lifeConditions)): ?>
                    <input type="text" class="form-control" id="number_rooms" name="number_rooms" value="<?php echo e($lifeConditions->number_rooms); ?>" data-mask="00" placeholder="Ingresar la cantidad de cuartos" required >
                  <?php else: ?>
                    <input type="text" class="form-control" id="number_rooms" name="number_rooms" placeholder="Ingresar la cantidad de cuartos" data-mask="00" required>
                  <?php endif; ?>
                 <?php endif; ?>
            </div>
          </div>
          <hr>
          <div>
            <span class="m-0 font-weight-bold text-primary title-table">Muebles
              <button type="button" id="addFurniture" class="btn btn-primary float-right">Agregar</button>
            </span>
            <?php if(isset($requisition)): ?>
              <input type="hidden" name="countFurniture" id="countFurniture" value="<?php echo e($requisition->CountForniture == "0" || $requisition->CountForniture == null ? 1 : $requisition->CountForniture); ?>">
              <input type="hidden" name="countTotalF" id="countTotalF" value="<?php echo e($requisition->CountForniture == "0" || $requisition->CountForniture == null ? 1 : $requisition->CountForniture); ?>">
            <?php else: ?>
              <input type="hidden" name="countFurniture" id="countFurniture" value="1">
              <input type="hidden" name="countTotalF" id="countTotalF" value="1">
            <?php endif; ?>
          </div>
          <hr>
          <div class="headerAppend">Mueble Principal</div>
          <div class="form-row" style="display: none;">
            <div class="form-group col-md-12">
              <?php if(isset($requisition['furniture1'])): ?>
                <input type="hidden" class="form-control" id="furnitureid1" name="furnitureid1" value="<?php echo e($requisition['furniture1']['id']); ?>">                 
              <?php else: ?>                
                <input type="hidden" class="form-control" id="furnitureid1" name="furnitureid1" value="">
              <?php endif; ?>
          	</div>
         </div>      
          <div class="form-row">          
            <div class="form-group col-md-12">
              <label for="furnitures_id1">Mueble</label>
              <select id="furnitures_id1" name="furnitures_id1" class="form-control" required>
                <option value="">selecciona...</option>
                <?php if(isset($furnitures)): ?>
                  <?php if(isset($requisition->furniture1)): ?>
                    <?php $__currentLoopData = $furnitures; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->furniture1['furnitures_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  <?php else: ?>
                    <?php $__currentLoopData = $furnitures; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  <?php endif; ?>
                <?php endif; ?>
              </select>
            </div>
          </div>
          
          <?php if(isset($requisition)): ?>
            <?php for($i = 2 ; $i <= $requisition->CountForniture;$i++): ?>
              <div id="<?php echo e('fDF-'.$i); ?>">
                <hr>
                <div class="headerAppend">Mueble <?php echo e($i); ?>

                  <button type="button" id="<?php echo e('deleteFurniture-'.$i); ?>" class="btn float-right" onclick="deleteFurniture(this)">
                    <i class="fas fa-trash-alt fa-2x colorIcon"></i>
                  </button>
                </div>
                <div class="form-row" style="display: none;">
                  <div class="form-group col-md-12">
                    <?php if(isset($requisition['furniture'.$i])): ?>
                      <input type="hidden" class="form-control" id="<?php echo e('furnitureid'.$i); ?>" name="<?php echo e('furnitureid'.$i); ?>" value="<?php echo e($requisition['furniture'.$i]['id']); ?>">                      
                    <?php else: ?>
                      <input type="hidden" class="form-control" id="<?php echo e('furnitureid'.$i); ?>" name="<?php echo e('furnitureid'.$i); ?>" value="">
                    <?php endif; ?>
                  </div>
                </div>
                <div class="form-row">
                  <div class="form-group col-md-12">
                    <label for="<?php echo e('furnitures_id'.$i); ?>">Mueble</label>
                    <select id="<?php echo e('furnitures_id'.$i); ?>"  name="<?php echo e('furnitures_id'.$i); ?>" class="form-control" required>
                      <option value="">seleccione...</option>
                      <?php if(isset($furnitures)): ?>
                        <?php if(isset($requisition['furniture'.$i])): ?>
                          <?php $__currentLoopData = $furnitures; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition['furniture'.$i]['furnitures_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php else: ?>
                          <?php $__currentLoopData = $furnitures; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>

                      <?php endif; ?>
                    </select>
                  </div>
                </div>
              </div>
            <?php endfor; ?>
          <?php endif; ?>
          <div id="furnitures"></div>
          <hr>
          <div>
            <span class="m-0 font-weight-bold text-primary title-table">Materiales de construcción
              <button type="button" id="addBuildingMaterial" class="btn btn-primary float-right">Agregar</button>
            </span>
            <?php if(isset($requisition->CountMaterial)): ?>
              <input type="hidden" name="countBuildingMaterial" id="countBuildingMaterial" value="<?php echo e($requisition->CountMaterial == "0" || $requisition->CountMaterial == null ? 1 : $requisition->CountMaterial); ?>">
              <input type="hidden" name="countTotalBM" id="countTotalBM" value="<?php echo e($requisition->CountMaterial == "0" || $requisition->CountMaterial == null ? 1 : $requisition->CountMaterial); ?>">
            <?php else: ?>
              <input type="hidden" name="countBuildingMaterial" id="countBuildingMaterial" value="1">
              <input type="hidden" name="countTotalBM" id="countTotalBM" value="1">
            <?php endif; ?>
          </div>
          <hr>
          <div class="headerAppend">Material de Construcción Principal</div>
          <div class="form-row" style="display: none;">
            <div class="form-group col-md-12">
              <?php if(isset($requisition['buildingMaterial1'])): ?>
                <input type="hidden" class="form-control" id="buildingmaterialid1" name="buildingmaterialid1" value="<?php echo e($requisition['buildingMaterial1']['id']); ?>">                 
              <?php else: ?>                
                <input type="hidden" class="form-control" id="buildingmaterialid1" name="buildingmaterialid1" value="">
              <?php endif; ?>
          	</div>
         </div>
          
          <div class="form-row">
            <div class="form-group col-md-12">
              <label for="buildingMaterials_id1">Material de Construcción</label>
              <select id="buildingMaterials_id1" name="buildingMaterials_id1" class="form-control" required>
                <option value="">selecciona...</option>
                <?php if(isset($buildingMaterials)): ?>
                  <?php if(isset($requisition->buildingMaterial1)): ?>
                    <?php $__currentLoopData = $buildingMaterials; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->buildingMaterial1['buildingMaterials_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  <?php else: ?>
                    <?php $__currentLoopData = $buildingMaterials; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  <?php endif; ?>
                <?php endif; ?>
              </select>
            </div>
          </div>
          <?php if(isset($requisition)): ?>
            <?php for($i = 2 ; $i <= $requisition->CountMaterial;$i++): ?>
              <div id="<?php echo e('fDBM-'.$i); ?>">
                <hr>
                <div class="headerAppend">Material de Construcción <?php echo e($i); ?>

                  <button type="button" id="<?php echo e('deleteBuildingMaterial-'.$i); ?>" class="btn float-right" onclick="deleteBuildingMaterial(this)">
                    <i class="fas fa-trash-alt fa-2x colorIcon"></i>
                  </button>
                </div>
                <div class="form-row" style="display: none;">
                  <div class="form-group col-md-12">
                    <?php if(isset($requisition['buildingMaterial'.$i])): ?>
                      <input type="hidden" class="form-control" id="<?php echo e('buildingmaterialid'.$i); ?>" name="<?php echo e('buildingmaterialid'.$i); ?>" value="<?php echo e($requisition['buildingMaterial'.$i]['id']); ?>">
                    <?php else: ?>
                      <input type="hidden" class="form-control" id="<?php echo e('buildingmaterialid'.$i); ?>" name="<?php echo e('buildingmaterialid'.$i); ?>" value="">
                    <?php endif; ?>
                  </div>
                </div>
                <div class="form-row">
                  <div class="form-group col-md-12">
                    <label for="<?php echo e('buildingMaterials_id'.$i); ?>">Material</label>
                    <select id="<?php echo e('buildingMaterials_id'.$i); ?>"  name="<?php echo e('buildingMaterials_id'.$i); ?>" class="form-control" required>
                      <option value="">seleccione...</option>
                      <?php if(isset($buildingMaterials)): ?>
                        <?php if(isset($requisition['buildingMaterial'.$i])): ?>
                          <?php $__currentLoopData = $buildingMaterials; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition['buildingMaterial'.$i]['buildingMaterials_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php else: ?>
                          <?php $__currentLoopData = $buildingMaterials; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                      <?php endif; ?>
                    </select>
                  </div>
                </div>
              </div>
            <?php endfor; ?>
          <?php endif; ?>
          <div id="buildingMaterials"></div>
          <hr>
          <div>
            <span class="m-0 font-weight-bold text-primary title-table">Servicios
              <button type="button"  id="addService" class="btn btn-primary float-right">Agregar</button>
            </span>
            <?php if(isset($requisition->CountServis)): ?>
              <input type="hidden" name="countService" id="countService" value="<?php echo e($requisition->CountServis == "0" || $requisition->CountServis == null ? 1 : $requisition->CountServis); ?>">
              <input type="hidden" name="countTotalS" id="countTotalS" value="<?php echo e($requisition->CountServis == "0" || $requisition->CountServis == null ? 1 : $requisition->CountServis); ?>">
            <?php else: ?>
              <input type="hidden" name="countService" id="countService" value="1">
              <input type="hidden" name="countTotalS" id="countTotalS" value="1">
            <?php endif; ?>
          </div>
          <hr>
          <div class="headerAppend">Servicio Principal</div>
          <div class="form-row" style="display: none;">
            <div class="form-group col-md-12">
              <?php if(isset($requisition['services1'])): ?>
                <input type="hidden" class="form-control" id="servicesid1" name="servicesid1" value="<?php echo e($requisition['services1']['id']); ?>">                 
              <?php else: ?>                
                <input type="hidden" class="form-control" id="servicesid1" name="servicesid1" value="">
              <?php endif; ?>
          	</div>
         </div>
          <div class="form-row">
            <div class="form-group col-md-12">
              <label for="services_id1">Servicio</label>
              <select id="services_id1" name="services_id1" class="form-control" required>
                <option value="">selecciona...</option>
                <?php if(isset($services)): ?>
                  <?php if(isset($requisition->services1)): ?>
                    <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition->services1['services_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  <?php else: ?>
                    <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  <?php endif; ?>
                <?php endif; ?>
              </select>
            </div>
          </div>
          <?php if(isset($requisition)): ?>
            <?php for($i = 2 ; $i <= $requisition->CountServis;$i++): ?>
              <div id="<?php echo e('fDS-'.$i); ?>">
                <hr>
                <div class="headerAppend">Servicio <?php echo e($i); ?>

                  <button type="button" id="<?php echo e('deleteService-'.$i); ?>" class="btn float-right" onclick="deleteService(this)">
                    <i class="fas fa-trash-alt fa-2x colorIcon"></i>
                  </button>
                </div>
                <div class="form-row" style="display: none;">
                  <div class="form-group col-md-12">
                    <?php if(isset($requisition['services'.$i])): ?>
                      <input type="hidden" class="form-control" id="<?php echo e('servicesid'.$i); ?>" name="<?php echo e('servicesid'.$i); ?>" value="<?php echo e($requisition['services'.$i]['id']); ?>">
                    <?php else: ?>
                      <input type="hidden" class="form-control" id="<?php echo e('servicesid'.$i); ?>" name="<?php echo e('servicesid'.$i); ?>" value="">
                    <?php endif; ?>
                  </div>
                </div>
                <div class="form-group col-md-12">
                  <?php if(isset($requisition['servicesid'.$i])): ?>
                    <input type="hidden" class="form-control" id="<?php echo e('servicesid'.$i); ?>" name="<?php echo e('servicesid'.$i); ?>" value="<?php echo e($requisition['servicesid'.$i]['name']); ?>">
                  <?php else: ?>
                    <input type="hidden" class="form-control" id="<?php echo e('servicesid'.$i); ?>" name="<?php echo e('servicesid'.$i); ?>" value="">
                  <?php endif; ?>
                </div>
                <div class="form-row">
                  <div class="form-group col-md-12">
                    <label for="<?php echo e('services_id'.$i); ?>">Servicio</label>
                    <select id="<?php echo e('services_id'.$i); ?>"  name="<?php echo e('services_id'.$i); ?>" class="form-control" required>
                      <option value="">seleccione...</option>
                        <?php if(isset($services)): ?>
                          <?php if(isset($requisition['services'.$i])): ?>
                            <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <option value="<?php echo e($element['id']); ?>" <?php echo e($element['id'] == $requisition['services'.$i]['services_id'] ? 'selected' : ''); ?>><?php echo e($element['name']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <?php else: ?>
                            <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <option value="<?php echo e($element['id']); ?>"><?php echo e($element['name']); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <?php endif; ?>
                        <?php endif; ?>
                    </select>
                  </div>
                </div>
              </div>
            <?php endfor; ?>
          <?php endif; ?>

          <div id="services"></div>
          <hr>
          <a href="solicitudes"  class="btn btn-primary float-right">Cancelar</a>
          <button type="button" id="lifeConditions-1"  onclick="nextNavTab(this)" class="btn btn-primary float-right" style="margin-right: 3px;">Siguiente</button>
          <button type="button" id="lifeConditions-2"  onclick="nextNavTab(this)" class="btn btn-primary float-right" style="margin-right: 3px;">Anterior</button>
          <!---->
        </div>
        
        <div class="tab-pane fade" id="economicData" role="tabpanel" aria-labelledby="economicData-tab">
          <br>
          <div class="form-row">
            <div class="form-group col-md-4">
              <label for="income">Ingresos</label>
              <?php if(session('department_institute_id') <> 4): ?>
                  <?php if(isset($economicData)): ?>
                    <input type="text" disabled class="form-control" id="income" name="income" placeholder="Ingresa los ingresos mensuales del beneficiario"  value="<?php echo e($economicData['income']); ?>">
                  <?php else: ?>
                    <input type="text" disabled class="form-control" id="income" name="income" placeholder="Ingresa los ingresos mensuales del beneficiario" >
                  <?php endif; ?>
              <?php else: ?>
                  <?php if(isset($economicData)): ?>
                    <input type="text" class="form-control" id="income" name="income" placeholder="Ingresa los ingresos mensuales del beneficiario" required value="<?php echo e($economicData['income']); ?>">
                  <?php else: ?>
                    <input type="text" class="form-control" id="income" name="income" placeholder="Ingresa los ingresos mensuales del beneficiario" required>
                  <?php endif; ?>
              <?php endif; ?>
            </div>
            <div class="form-group col-md-4">
              <label for="expense">Egresos</label>
              <?php if(session('department_institute_id') <> 4): ?>
                  <?php if(isset($economicData)): ?>
                    <input type="text" disabled class="form-control" id="expense" name="expense" placeholder="Ingresa los egresos mensuales del beneficiario" value="<?php echo e($economicData['expense']); ?>">
                  <?php else: ?>
                    <input type="text"  disabled class="form-control" id="expense" name="expense" placeholder="Ingresa los egresos mensuales del beneficiario">
                  <?php endif; ?>
              <?php else: ?>
                  <?php if(isset($economicData)): ?>
                    <input type="text" class="form-control" id="expense" name="expense" placeholder="Ingresa los egresos mensuales del beneficiario" value="<?php echo e($economicData['expense']); ?>">
                  <?php else: ?>
                    <input type="text" class="form-control" id="expense" name="expense" placeholder="Ingresa los egresos mensuales del beneficiario">
                  <?php endif; ?>
              <?php endif; ?>
            </div>
          </div>
          <a href="solicitudes"  class="btn btn-primary float-right">Cancelar</a>
          <button type="submit" class="btn btn-primary float-right" style="margin-right: 3px;">Guardar</button>
          <button type="button" id="economicData-1"  onclick="nextNavTab(this)" class="btn btn-primary float-right" style="margin-right: 3px;">Anterior</button>
          <!---->
        </div>
       </div> 
    </form>
  </div>
</div>

<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="modalLabel">Recorte de imagen</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="img-container">
          <div class="row">
            <div class="col-md-8">
              <img id="imageCrop" src="">
            </div>
            <div class="col-md-4">
              <div class="preview"></div>
            </div>
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" id="crop">recortar</button>
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
      </div>
    </div>
  </div>
</div>


<div class="row">
  <div class="col-md-12">
    <div class="modal fade" tabindex="-1" role="dialog" id="modal-warning">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-warning-title">¡AVISO IMPORTANTE!</h4>
               <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          </div>
          <div class="modal-body">
            <div id="alert-container"></div>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">Cerrar</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('jsDashboard'); ?>
  <script>
    document.addEventListener('DOMContentLoaded', () => {
      document.querySelectorAll('input[type=text]').forEach( node => node.addEventListener('keypress', e => {
        if(e.keyCode == 13) {
          e.preventDefault();
        }
      }))
    });
  </script>  
  <script src="../assets/js/mainForm.js"></script>
  <script src="../assets/js/RequestForm.js"> </script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.6/cropper.js"></script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('base.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\ApoyosPresidencia\resources\views/catalogs/RequestsForm.blade.php ENDPATH**/ ?>