<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/pdf.css" />
    <table width="100%" cellpadding="2" cellspacing="3" border="0" bordercolor="#c1c1c1" id="yw0" class="detail-view2">
          <tr>  
          <td><img align="center" src="<?php echo Yii::app()->request->baseUrl;?>/images/logo.png" width ="80px" heigth="80px"/></td>
          <?php if ($model->id_status == 1) { ?>

            <td style="background:#fff; text-align: left;" colspan="2"><b>Solicitud de montepio</b><br></td>

          <?php }elseif ($model->id_status == 2) { ?>
            
            <td style="background:#fff; text-align: left;" colspan="2"><b>Solicitud de montepio aprobada</b><br></td>

          <?php }elseif ($model->id_status == 3) { ?>

            <td style="background:#fff; text-align: left;" colspan="2"><b>Solicitud de montepio denegada</b><br></td>

          <?php } ?>
          </tr>
          <tr>
            <td colspan="3"><p style="padding:15px; text-align:justify;">Señores:</p></td>            
          </tr>
          <tr>
            <td colspan="3"><p style="padding:15px; text-align:justify;"><strong><?php echo $modelEmpresa->nom_emp;?></strong></p></td>            
          </tr>
          <tr>
            <td colspan="3"><p style="padding:15px; text-align:justify;">Tengo el agrado de dirigirme a ustedes en mi condici&oacute;n de beneficiario del fallecido(a) (<?php echo $model->idAsociado->nombre.' '.$model->idAsociado->apellidos;?>) en la oportunidad de solicitar
                el beneficio montepio, a continuación se presentan los datos de la solicitud:
                </p>
            </td>            
          </tr>
          <br>
    </table>

    <table class="datos" width="100%" cellpadding="5" cellspacing="5" border="0" >
          <tr>
            <td style="background:#1a3e7f; color: #fff;" colspan="2"><center><b>Datos personales del fallecido</b></center></td>
          </tr>
                <tr>
                  <td><b><span >Nombres y Apellidos</span></b><br> <?php  echo $model->idAsociado->nombre.' '.$model->idAsociado->apellidos;?></td>            
                  <td><b>Cedula de identidad</b><br> <?php echo $model->idAsociado->cedula;?></td>
                </tr>
                <tr>
                  <td><b>Fecha de inscripci&oacute;n</b><br> <?php echo $model->idAsociado->fechaingreso; ?></td>
                  <td><b>Fecha de fallecimiento</b><br> <?php echo $model->idAsociado->fecha_estatus; ?></td>
                </tr> 
                <tr>
                  <td><b><span >Empresa</span></b><br> <?php echo ($model->idAsociado->lugartrabajo0)?$model->idAsociado->lugartrabajo0->descripcion:""; ?></td>            
                  <td><b>Unidad</b><br> <?php echo ($model->idAsociado->unidad)?$model->idAsociado->unidad->descripcion:""; ?></td>
                </tr>
                <tr>
                  <td><b>&Uacute;ltimo sueldo</b><br> Bs <?php echo $model->idAsociado->utltimoSueldo($model->id_asociado);?></td>
                  <td><b>Porcentaje</b><br> <?php echo ($model->idAsociado->aportes)?$model->idAsociado->aportes->descripcion.'%':""; ?></td>
                </tr>
                <tr>
                  <td colspan="2"><b>Status</b><br> <?php echo strtoupper($model->idAsociado->idEstatus->nombre_estatus); ?></td>
                </tr>
     </table>

     <br>

     <table class="datos" width="100%" cellpadding="5" cellspacing="5" border="0">
        <tr>
            <td style="background:#1a3e7f; color: #fff;" colspan="2"><center><b>Datos del solicitante</b></center></td>
        </tr>
        <tr>
          <td><b><span>Nombres y apellidos</span></b><br> <?php echo $solicitante->nombre.' '.$solicitante->apellido; ?></td>
          <td><b>C&eacute;dula</b><br> <?php echo $solicitante->cedula; ?></td>
        </tr>
        <tr>
          <td><b>Parentesco</b><br> <?php echo $solicitante->parent->descripcion; ?></td>
          <td><b>Fecha de nacimiento</b><br> <?php echo date("d-m-Y", strtotime($solicitante->fecha)); ?></td>
        </tr>
      </table>

       <p style="text-align: center;">A continuaci&oacute;n se listan los beneficiarios registrados por el fallecido, entre los cuales se realizará la distribución del monto que se pagar&aacute; por concepto de montepio.</p>
        <h3 style="text-align: center">Beneficiarios</h3>
        <div style="text-align: center">
            
        <table class="amortizacion" cellpadding="2">
            <?php if ($model->id_status == 1 || $model->id_status == 3) { ?>
              <tr>
                <th></th>
                <th>Nombres y apellidos</td>
                <th>C&eacute;dula</th>
                <th>Parentesco</th>
                <th>Fecha de Nacimiento</th>
              </tr>
               
               <?php foreach ($beneficiarios as $key => $value):?>
                  
                <tr>
                    <td><b>Beneficiario N° <?php echo $key + 1; ?></b></td>
                    <td><?php echo $value->idBeneficiario->nombre.' '.$value->idBeneficiario->apellido; ?></td>
                    <td><?php echo $value->idBeneficiario->cedula; ?></td>
                    <td><?php echo $value->idBeneficiario->parent->descripcion; ?></td>
                    <td><?php echo date("d-m-Y", strtotime($value->idBeneficiario->fecha)); ?></td>
                </tr>
                      
              <?php endforeach;?>

            <?php }elseif ($model->id_status == 2) { ?> 

              <tr>
                <th></th>
                <th>Nombres y apellidos</td>
                <th>C&eacute;dula</th>
                <th>Parentesco</th>
                <th>Fecha de Nacimiento</th>
                <th>Distribuci&oacute;n de montepio</th>
              </tr>             
            
              <?php foreach ($beneficiarios as $key => $value):?>
                  
                <tr>
                    <td><b>Beneficiario N° <?php echo $key + 1; ?></b></td>
                    <td><?php echo $value->idBeneficiario->nombre.' '.$value->idBeneficiario->apellido; ?></td>
                    <td><?php echo $value->idBeneficiario->cedula; ?></td>
                    <td><?php echo $value->idBeneficiario->parent->descripcion; ?></td>
                    <td><?php echo date("d-m-Y", strtotime($value->idBeneficiario->fecha)); ?></td>
                    <td><?php echo "Bs. ".number_format($value->monto_distribuido, 2,'.',','); ?></td>
                </tr>
                      
              <?php endforeach;?>

            <?php } ?>  
        </table>
        
          
            <table width="100%" cellpadding="3" cellspacing="3" border="0" bordercolor="#000000" id="yw0" class="detail-view2">
              <tr>
                <td colspan="2">
                  <p style="padding:15px; text-align:justify;">Sin m&aacute;s a que hacer referencia por el momento quien subscribe</p>
                </td>
              </tr>         
            </table>
        <br/>

     <table  align="center">
        <tr>
            <td>          
                <p><center><strong><?php echo $solicitante->nombre.' '.$solicitante->apellido; ?></strong></center></p>
                <br>
                <p><center>_________________________________________________________<br>Firma del solicitante</center></p>
           </td>
        </tr>
    </table>    
         <br/>
         <table class="firma">
                <tr>
                    <td style="background: #cccccc; border-bottom: 1px solid #000; border-left: 0 solid #000;"><strong>Recibido:</strong></td>
                    <td style="background: #cccccc; border-bottom: 1px solid #000;"><strong>Fecha de proceso:</strong></td>
                    <td style="background: #cccccc; border-bottom: 1px solid #000;"><strong>Ejecutado por:</strong></td>
                </tr>
                <tr>
                    <td style="border-left: 0 solid #000;" >&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table>