<style>
  #header {
    /* font-family: Arial, Helvetica, sans-serif; */
    border-collapse: collapse;
    width: 100%;
  }
  
  #header td, #customers th {
   
    padding-left:4px;
    font-size:12px;
  }
  
  #header tr:nth-child(even){background-color: #ffffff;}
  
  #header tr:hover {background-color: #ddd;}
  
  #header th {
    /* padding-top: 12px;
    padding-bottom: 12px; */
    text-align: left;
    /* padding:4px; */
    color:black;
  }
  </style>
  
  
  
  
  <style>
  #scan {
    /* font-family: Arial, Helvetica, sans-serif; */
    border-collapse: collapse;
    width: 100%;
  }
  
  #scan td, #scan th {
   
    padding: 8px;
    font-size:11px;
  }
  
  #scan tr:nth-child(even){background-color: #ffffff;}
  
  #scan tr:hover {background-color: #ddd;}
  
  #scan th {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    padding:4px;
    color:black;
  }
  </style>
  
  
  <style>
  #scan {
    /* font-family: Arial, Helvetica, sans-serif; */
    border-collapse: collapse;
    width: 100%;
  }
  
  #scan td, #scan th {
    border-collapse: collapse;
    padding: 8px;
    font-size:11px;
  }
  
  #scan tr:nth-child(even){background-color: #ffffff;}
  
  #scan tr:hover {background-color: #ddd;}
  
  #scan th {
    border-collapse: collapse;
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    padding:4px;
    color:black;
  }
  </style>
  
  
  
  <style>
  #details {
    /* font-family: Arial, Helvetica, sans-serif; */
    border-collapse: collapse;
    width: 100%;
  }
  
  #details td, #details th {
   
    padding: 8px;
    font-size:11px;
  }
  
  #details tr:nth-child(even){background-color: #ffffff;}
  
  #details tr:hover {background-color: #ddd;}
  
  #details th {
    padding-top: 12px;
   font-style:bold;
    padding-bottom: 12px;
    text-align: left;
    padding:4px;
    color:black;
  }
  .container{
    page-break-after:always;
    padding: 20px 20px 20px 20px;
  }
  .tablestyle{
    font-size:12px;
  }
  .tablestyle td, .tablestyle th{
    /* padding-top: 12px; */
    /* border:1px solid black; */
  
  }
  .page-break {
      page-break-before: always;
  }
  </style>
    @foreach($datanotiskedua as $index=>$lel)
    {{-- {{dd($notis['nama']['alamat1'])}} --}}




  <div class="container">
    <table id="header">
      <tr>
        <th rowspan="4"  style="width:50px"><br><img src="{{ asset('img/ARRAHN1.png') }}" style="width:70px"></img></th>
          <th colspan="1">{{ $cawangan_detail['namacaw'] }}</th>
      </tr>
      <tr>
        <td style="vertical-align:top;">{{ $cawangan_detail['alamat1'] }}</td>
        <td></td>
      </tr>
      <tr>
        <td style="vertical-align:top;">{{ $cawangan_detail['alamat2'] }}</td>
        <td></td>
      </tr>
      <tr>
        <td style="vertical-align:top;">{{ ' No Tel : '. $cawangan_detail['notel'] . ' No Faks : '. $cawangan_detail['nofaks'] }}</td>
        <td></td>
      </tr>
    </table>
    <br>
  
  
    <div>
      <table class="tablestyle">
        <tr>
          <td width="15%">NO.RUJUKAN</td>
          <td width="1%">:</td>
          <td>{{$lel['norujukan']}}</td>
        </tr>
          <tr>
          <td width="15%">TARIKH
          </td>
          <td width="1%">:</td>
          <td width="43%">@php 
            $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);
                $datez = $myDateTime->format('d-m-Y');
                //echo($datez);
                $fmt = datefmt_create(
                        'ms_MY',
                        IntlDateFormatter::LONG,
                        IntlDateFormatter::NONE,
                        'Asia/Kuala_Lumpur',
                        IntlDateFormatter::GREGORIAN
                    );
                    $cal = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);

                    echo '' . strtoupper($fmt->format($cal));
            @endphp
            <td colspan="3"></td>
  </td>
        </tr>
        <tr>
          <td><br></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td width="14%"></td>
          <td width="1%"></td>
          <td></td>
  
        </tr>
        <tr>
          <td style="vertical-align:top;">KEPADA</td>
          <td style="vertical-align:top;">:</td>
          <td style="vertical-align:top;">{{ $lel['nama'] }}
            <br> {{ strtoupper($lel['alamat']) }} <br>
            {{ ' ' . $lel['poskod'] . ' ' . strtoupper($lel['daerah']) . ' ' . strtoupper($lel['negeri'])}}</td>
          <td></td>
          <td style="vertical-align:top;"></td>
          <td style="vertical-align:top;"></td>
          <td style="vertical-align:top;"></td>
        </tr>
      </table>

  
      <p>Tuan/Puan,</p>
      <h4><u>NOTIS PEMBERITAHUAN</u></h4>
      <p>Dengan hormatnya dimaklumkan, akaun pembiayaan tuan/puan akan cukup tempoh <strong>12 bulan.</strong></p>
        
      <table cellspacing="3" style="padding: 5px;">
        <tr>
          <td>No.Rujukan</td>
          <td>:</td>
          <td>{{$lel['norujukan']}}</td>
        </tr>
        <tr>
          <td>Jumlah Pembiayaan</td>
          <td>:</td>
          <td>RM{{number_format($lel['pinjaman'], 2, '.', ',')}}</td>
        </tr>
        <tr>
          <td>Jumlah Keuntungan</td>
          <td>:</td>
          @if($lel['tagbaru'] == '0')
          <td>RM{{number_format($lel['keuntungan'], 2, '.', ',')}}</td>
          @elseif($lel['tagbaru'] == '1')
          <td>RM{{number_format($lel['keuntungan']['ujrah']+$lel['keuntungan']['onepercent'], 2, '.', ',')}}</td>
          @endif
        </tr>
        <tr>
          <td>Tarikh Tamat Kontrak</td>
          <td>:</td>
          <td><strong>@php 
              $myDateTime = DateTime::createFromFormat('Y-m-d', $lel['tmatang1']);
                  $datez = $myDateTime->format('d-m-Y');
                  echo($datez);
              @endphp</strong></td>
        </tr>
      </table>
  
      <p>Oleh yang demikian, tuan/puan atau wakil boleh membuat bayaran tersebut secepat mungkin. Jika pihak tuan/puan memerlukan sebarang pertanyaan, sila hubungi kakitangan cawangan kami yang sentiasa sedia membantu. <br/> 
        Sekian, terima kasih.</p>

      <p>Nota:</p>
      <i>Sila abaikan notis ini sekiranya pihak tuan/puan telah membuat urusan diatas.</i>
  
      <p>Notis ini adalah cetakan komputer dan tiada tandatangan diperlukan.</p>
  
    </div>
  </div>
  @endforeach