@php
use App\Http\Controllers\ConsultantController;
use App\Http\Controllers\OptoController;

@endphp
  @foreach($ptsummary as $result)
  @php 
  $TreatName1 = (new OptoController)->convertMarathi($result->TreatType1,$result->TreatDose1,
$result->TreatFreq1,$result->TreatDur1,$result->TreatEye1);
$TreatName2 = (new OptoController)->convertMarathi($result->TreatType2,$result->TreatDose2,
$result->TreatFreq2,$result->TreatDur2,$result->TreatEye2);
$TreatName3 = (new OptoController)->convertMarathi($result->TreatType3,$result->TreatDose3,
$result->TreatFreq3,$result->TreatDur3,$result->TreatEye3);
$TreatName4 = (new OptoController)->convertMarathi($result->TreatType4,$result->TreatDose4,
$result->TreatFreq4,$result->TreatDur4,$result->TreatEye4);
$TreatName5 = (new OptoController)->convertMarathi($result->TreatType5,$result->TreatDose5,
$result->TreatFreq5,$result->TreatDur5,$result->TreatEye5);
$TreatName6 = (new OptoController)->convertMarathi($result->TreatType6,$result->TreatDose6,
$result->TreatFreq6,$result->TreatDur6,$result->TreatEye6);
$TreatName7 = (new OptoController)->convertMarathi($result->TreatType7,$result->TreatDose7,
$result->TreatFreq7,$result->TreatDur7,$result->TreatEye7);
$TreatName8 = (new OptoController)->convertMarathi($result->TreatType8,$result->TreatDose8,
$result->TreatFreq8,$result->TreatDur8,$result->TreatEye8);
$TreatName9 = (new OptoController)->convertMarathi($result->TreatType9,$result->TreatDose9,
$result->TreatFreq9,$result->TreatDur9,$result->TreatEye9);
$TreatName10 = (new OptoController)->convertMarathi($result->TreatType10,$result->TreatDose10,
$result->TreatFreq10,$result->TreatDur10,$result->TreatEye10);
@endphp
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1158" id="showvisitrec"><table width="100%" border="0" align="left" cellpadding="2" cellspacing="2">
      <tr>
        <td colspan="3" align="left" valign="top"><table width="100%" border="0" align="center" cellpadding="4" cellspacing="0" class="tblborder">
            <tr style="border:1px; color:#333333">
              <td width="21%" align="left" valign="middle" class="tdbrd">Name/Age/Gender</td>
              <td width="33%" align="left" valign="middle" class="style4"><strong>{{$result->PatientName}} / {{$result->ptage}} / {{$result->ptgender}}</strong></td>
              <td width="8%" align="left" valign="middle" class="tdbrd">MRD No</td>
              <td width="9%" align="center" valign="middle" class="txtallvalues">{{$result->MrdNo}}</td>
              <td width="8%" align="center" valign="middle" class="tdbrd">Date</td>
              <td width="21%" align="center" valign="middle" class="style5">{{date("d/m/Y", strtotime(str_replace('-', '/',$result->VisitDate)))}}</td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td width="602" align="left" valign="top"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
            <tr>
              <td align="left" valign="top">&nbsp;</td>
            </tr>
            <tr>
              <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="4" class="tdbrd1">
                  <tr>
                    <td height="45" align="left" valign="top" class="tdbrd">Complaints</td>
                    <td align="left" valign="top" class="txtallvalues">{{$result->Complaint1}} {{$result->CompDays1}}
                            {{$result->CompEyes1}}<br>
                            {{$result->Complaint2}} {{$result->CompDays2}} {{$result->CompEyes2}}<br>
                            {{$result->Complaint3}} {{$result->CompDays3}} {{$result->CompEyes3}}</td>
                  </tr>
                  <tr>
                    <td height="45" align="left" valign="top" class="tdbrd">Ocular History</td>
                    <td width="79%" align="left" valign="top" class="txtallvalues">{{$result->PastHistory}}</td>
                  </tr>
                  <tr>
                    <td height="45" align="left" valign="top" class="tdbrd">Medical &amp; Other History</td>
                    <td align="left" valign="top" class="txtallvalues"> @if($result->ChkDm == 'DM')
                                DM from {{$result->DmFrom}} {{$result->DmPeriod}}
                                @endif
                                @if($result->ChkHt == 'HT')
                                <br>
                                HT from {{$result->HtFrom}} {{$result->HtPeriod}}
                                @endif
                                @if($result->ChkCad == 'C.A.D')
                                <br>
                                C.A.D from {{$result->CadFrom}} {{$result->CadPeriod}}
                                @endif
                                @if($result->ChkProst == 'Prost.')
                                <br>
                                Prost. from {{$result->ProstFrom}} {{$result->ProstPeriod}}
                                @endif
                                @if($result->ChkCopd == 'COPD')
                                <br>
                                COPD from {{$result->CopdFrom}} {{$result->CopdPeriod}}
                                @endif
                                @if($result->ChkOther == 'Other')
                                <br>
                                Other - from {{$result->OtherFrom}} {{$result->OtherPeriod}}
                                @endif
  </td>                                                                                                                                                                 </td>
                  </tr>
              </table></td>
            </tr>
            
            <tr>
              <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="4" >
                <tr >
                  <td width="20%"  class="txtfundus"><strong>Visual Acuity </strong></td>
                  <td width="40%" align="center" valign="top" class="txtfundus">RE</td>
                  <td width="40%" align="center" valign="top" class="txtfundus" >LE</td>
                </tr>
                <tr>
                  <td >&nbsp;</td>
                  <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td width="12%" align="center" valign="top" class="txtallvalues">unaided</td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->VaRe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="txtallvalues">PH</td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->VaPhRe}}</strong></td>
                    </tr>
                  </table></td>
                  <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td width="12%" align="center" valign="top" class="txtallvalues">unaided</td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->VaLe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="txtallvalues">PH</td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->VaPhLe}}</strong></td>
                    </tr>
                  </table></td>
                </tr>
                <tr>
                  <td class="txtfundus" ><strong>Old Glasses</strong> </td>
                  <td align="left" valign="top" >&nbsp;</td>
                  <td align="left" valign="top">&nbsp;</td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
                    <tr>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->PgSphRe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->PgCylRe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->PgAxisRe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->PgNearAddRe}}</strong></td>
                    </tr>
                    <tr>
                      <td colspan="2" align="center" valign="top" class="tdbrd">{{$result->VaReNear}}</td>
                      <td colspan="2" align="center" valign="top" class="tdbrd">{{$result->OgRe}}</td>
                    </tr>
                  </table></td>
                  <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
                    <tr>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->PgSphLe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->PgCylLe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->PgAxisLe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->PgNearAddLe}}</strong></td>
                    </tr>
                    <tr>
                      <td colspan="2" align="center" valign="top" class="tdbrd">{{$result->VaLeNear}}</td>
                      <td colspan="2" align="center" valign="top" class="tdbrd">{{$result->OgLe}}</td>
                    </tr>
                  </table></td>
                </tr>
                <tr>
                  <td width="20%" class="txtfundus"><strong>Ref. &amp; Glasses</strong> </td>
                  <td width="40%" align="left" valign="top">&nbsp;</td>
                  <td align="left" valign="top">&nbsp;</td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
                    <tr>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->SrSphRe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->SrCylRe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->SrAxisRe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->SrNearAddRe}}</strong></td>
                    </tr>
                    <tr>
                      <td colspan="2" align="center" valign="top" class="tdbrd">{{$result->SrVaGlassRe}}</td>
                      <td colspan="2" align="center" valign="top" class="tdbrd">{{$result->SrNvRe}}</td>
                    </tr>
                  </table></td>
                  <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
                    <tr>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->SrSphLe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->SrCylLe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->SrAxisLe}}</strong></td>
                      <td width="12%" align="center" valign="top" class="tdbrd"><strong>{{$result->SrNearAddLe}}</strong></td>
                    </tr>
                    <tr>
                      <td colspan="2" align="center" valign="top" class="tdbrd">{{$result->SrVaGlassLe}}</td>
                      <td colspan="2" align="center" valign="top" class="tdbrd">{{$result->SrNvLe}}</td>
                    </tr>
                  </table></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td align="left" valign="top" class="txtfundus"><strong>Ocular Examination </strong></td>
            </tr>
            <tr>
              <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="3" class="tblborder">
                  <tr>
                    <td width="14%" class="tdbrd">&nbsp;</td>
                    <td width="40%" align="left" valign="top" class="tdbrd"><div align="center">RE</div></td>
                    <td width="46%" align="left" valign="top" class="tdbrd"><div align="center">LE</div></td>
                  </tr>
                  <tr>
        <td width="14%" style="height:33px;" align="left" valign="middle" class="tdbrd">Oc.Mov </td>
        <td width="40%" align="left" valign="top" class="txtallvalues">{{$result->ReOcMov}}</td>
        <td width="46%" align="left" valign="top" class="txtallvalues">{{$result->LeOcMov}}</td>
      </tr>
      <tr>
        <td height="21" style="height:33px;" align="left" valign="top" class="tdbrd">Lids</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->ReLids}}</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->LeLids}}</td>
      </tr>
      <tr>
        <td align="left" style="height:33px;" valign="middle" class="tdbrd">Conjuntiva</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->ReConj}}</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->LeConj}}</td>
      </tr>
      <tr>
        <td width="14%" style="height:33px;" height="50" align="left" valign="top" class="tdbrd">Cornea</td>
        <td align="left" valign="top" class="txtallvalues"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="18%" align="left" valign="top"><img src="{{url('roundimg.png')}}" /> </td>
              <td width="82%" align="left" valign="top" class="txtfundus" style="color:black;">&nbsp;{{$result->ReCornea}}</td>
            </tr>
          </table></td>
        <td align="left" valign="top" class="txtallvalues"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="18%" align="left" valign="top"><img src="{{url('roundimg.png')}}" /> </td>
              <td width="82%" align="left" valign="top" class="txtfundus" style="color:black;">&nbsp;{{$result->LeCornea}}</td>
            </tr>
          </table>          </td>
      </tr>

      
      <tr>
        <td class="tdbrd" style="height:33px;">Ant Chamber </td>
        <td align="left" valign="top" class="txtallvalues">{{$result->ReAntChamber}}</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->LeAntChamber}}</td>
      </tr>
      <tr>
        <td class="tdbrd" style="height:33px;">Iris</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->ReIris}}</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->LeIris}}</td>
      </tr>
      <tr>
        <td class="tdbrd" style="height:33px;">Pupil</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->RePupil}}</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->LePupil}}</td>
      </tr>
      <tr>
        <td class="tdbrd" style="height:33px;">IOP</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->ReIop}}</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->LeIop}}</td>
      </tr>
      <tr>
        <td height="40" align="left" valign="middle" class="tdbrd"  style="height:33px;">Lens</td>
        <td align="left" valign="top" class="txtallvalues"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="12%" align="left" valign="top"><img src="{{url('roundimg.png')}}" /> </td>
              <td width="11%" align="left" valign="top" style="padding-left:5px;"><img src="{{url('eclipseimg.png')}}" /></td>
              <td width="71%" align="left" valign="top" class="txtfundus" style="color:black;">{{$result->ReLens}}</td>
            </tr>
          </table>          </td>
        <td align="left" valign="top" class="txtallvalues" style="height:33px;"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="12%" align="left" valign="top"><img src="{{url('roundimg.png')}}" /> </td>
              <td width="10%" align="left" valign="top" style="padding-left:5px;"><img src="{{url('eclipseimg.png')}}" /></td>
              <td width="72%" align="left" valign="top" class="txtfundus" style="color:black;">&nbsp;{{$result->LeLens}}</td>
            </tr>
          </table></td>
      </tr>

      <tr>
        <td class="tdbrd" style="height:33px;">Lens 2</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->ReLens2}}</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->LeLens2}}</td>
      </tr>

      
      <tr>
        <td class="tdbrd" style="height:33px;">NLP</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->ReNlp}}</td>
        <td align="left" valign="top" class="txtallvalues">{{$result->LeNlp}}</td>
      </tr>
        </table></td>
      </tr>
              
            <tr>
              <td align="left" valign="top">&nbsp;</td>
            </tr>
        </table></td>
        <td width="31" align="left" valign="top">&nbsp;</td>
        <td width="510" align="left" valign="top"><table width="100%" border="0" align="center" cellpadding="3" cellspacing="0">
          <tr>
            <td class="txtfundus"><strong>Fundus Drawing </strong></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="10" class="tblborder">
              <tr>
                <td width="21%" height="218" ><table width="100%" border="0" cellspacing="0" cellpadding="12">
                    <tr>
                      <td align="left" valign="top" class="txtfundus">Media</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus">Optic Disc </td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus">Macula</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus">B.V</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus">Periphery</td>
                    </tr>
                </table></td>
                <td align="left" valign="top" class="tdbrd1"><table width="100%" border="0" cellspacing="0" cellpadding="12">
                    <tr>
                      <td align="left" valign="top" class="txtfundus">{{$result->ReMedia}}</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus">{{$result->ReOptDisc}}</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus">{{$result->ReMacBV}}</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus" >{{$result->ReBv}}</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus" >{{$result->ReMidPerPh}}</td>
                    </tr>
                </table></td>
                <td align="left" valign="top" class="tdbrd1"><table width="100%" border="0" cellspacing="0" cellpadding="12">
                    <tr>
                      <td align="left" valign="top" class="txtfundus" >{{$result->LeMedia}}</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus">{{$result->LeOptDisc}}</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus" >{{$result->LeMacBV}}</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus" >{{$result->LeBv}}</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="txtfundus" >{{$result->LeMidPerPh}}</td>
                    </tr>
                </table></td>
              </tr>
            </table>
              </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="7" class="tblborder">
              <tr>
                <td width="21%" height="68" align="left" valign="top" class="tdbrd">Investigation </td>
                <td align="left" valign="top" class="txtallvalues">&nbsp;{{$result->InvStName}}</td>
              </tr>
              <tr>
                <td height="68" align="left" valign="top" class="tdbrd">Diagnosis</td>
                <td align="left" valign="top" class="txtallvalues">&nbsp;{{$result->Diagnosis}}</td>
              </tr>
              <tr>
                <td height="68" align="left" valign="top" class="tdbrd">Advice </td>
                <td align="left" valign="top" class="txtallvalues">&nbsp;{{$result->Advice}}</td>
              </tr>
              <tr>
                <td width="21%" height="68" align="left" valign="top" class="tdbrd">Treatment</td>
                <td align="left" valign="top" class="tdbrd"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  Rx,
                  @if($result->TreatChk1 == 1)
                                @if($result->TreatFreq1 == '8 TAP' || $result->TreatFreq1 == '6 TAP' ||
                                $result->TreatFreq1 == '4 TAP' || $result->TreatFreq1 == '3 TAP' ||
                                $result->TreatFreq1 == '2 TAP' || $result->TreatFreq1 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName1}}</strong></td>
                                </tr>
                                @php
                                $TapValue = $result->TreatFreq1;
                                $data1 = (new ConsultantController)->getTapValue($TapValue);
                                @endphp
                                @foreach($data1 as $result1)
                                @php $treattapname1 = (new
                                OptoController)->convertMarathi($result->TreatType1,$result->TreatDose1,
                                $result1->Value,$result->TreatDur1,$result->TreatEye1); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;" >
                                        {{$treattapname1}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName1}}</strong></td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName1}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif

                                @if($result->TreatChk2 == 1)
                                @if($result->TreatFreq2 == '8 TAP' || $result->TreatFreq2 == '6 TAP' ||
                                $result->TreatFreq2 == '4 TAP' || $result->TreatFreq2 == '3 TAP' ||
                                $result->TreatFreq2 == '2 TAP' || $result->TreatFreq2 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName2}} </strong></td>
                                </tr>
                                @php
                                $TapValue2 = $result->TreatFreq2;
                                $data2 = (new ConsultantController)->getTapValue($TapValue2);
                                @endphp
                                @foreach($data2 as $result2)
                                @php $treattapname2 = (new
                                OptoController)->convertMarathi($result->TreatType2,$result->TreatDose2,
                                $result2->Value,$result->TreatDur2,$result->TreatEye2); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$treattapname2}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName2}} </strong></td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName2}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif


                                @if($result->TreatChk3 == 1)
                                @if($result->TreatFreq3 == '8 TAP' || $result->TreatFreq3 == '6 TAP' ||
                                $result->TreatFreq3 == '4 TAP' || $result->TreatFreq3 == '3 TAP' ||
                                $result->TreatFreq3 == '2 TAP' || $result->TreatFreq3 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName3}} </td>
                                </tr>
                                @php
                                $TapValue3 = $result->TreatFreq3;
                                $data3 = (new ConsultantController)->getTapValue($TapValue3);
                                @endphp
                                @foreach($data3 as $result3)
                                @php $treattapname3 = (new
                                OptoController)->convertMarathi($result->TreatType3,$result->TreatDose3,
                                $result3->Value,$result->TreatDur3,$result->TreatEye3); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$treattapname3}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName3}} </td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName3}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif

                                @if($result->TreatChk4 == 1)
                                @if($result->TreatFreq4 == '8 TAP' || $result->TreatFreq4 == '6 TAP' ||
                                $result->TreatFreq4 == '4 TAP' || $result->TreatFreq4 == '3 TAP' ||
                                $result->TreatFreq4 == '2 TAP' || $result->TreatFreq4 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName4}}</strong> </td>
                                </tr>
                                @php
                                $TapValue4 = $result->TreatFreq4;
                                $data4 = (new ConsultantController)->getTapValue($TapValue4);
                                @endphp
                                @foreach($data4 as $result4)
                                @php $treattapname4 = (new
                                OptoController)->convertMarathi($result->TreatType4,$result->TreatDose4,
                                $result4->Value,$result->TreatDur4,$result->TreatEye4); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$treattapname4}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName4}}</strong> </td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName4}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif

                                @if($result->TreatChk5 == 1)
                                @if($result->TreatFreq5 == '8 TAP' || $result->TreatFreq5 == '6 TAP' ||
                                $result->TreatFreq5 == '4 TAP' || $result->TreatFreq5 == '3 TAP' ||
                                $result->TreatFreq5 == '2 TAP' || $result->TreatFreq5 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top"><strong>{{$result->TreatName5}}</strong></td>
                                </tr>
                                @php
                                $TapValue5 = $result->TreatFreq5;
                                $data5 = (new ConsultantController)->getTapValue($TapValue5);
                                @endphp
                                @foreach($data5 as $result5)
                                @php $treattapname5 = (new
                                OptoController)->convertMarathi($result->TreatType5,$result->TreatDose5,
                                $result5->Value,$result->TreatDur5,$result->TreatEye5); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$treattapname5}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName5}}</strong> </td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName5}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif

                                @if($result->TreatChk6 == 1)
                                @if($result->TreatFreq6 == '8 TAP' || $result->TreatFreq6 == '6 TAP' ||
                                $result->TreatFreq6 == '4 TAP' || $result->TreatFreq6 == '3 TAP' ||
                                $result->TreatFreq6 == '2 TAP' || $result->TreatFreq6 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName6}}</strong> </td>
                                </tr>
                                @php
                                $TapValue6 = $result->TreatFreq6;
                                $data6 = (new ConsultantController)->getTapValue($TapValue6);
                                @endphp
                                @foreach($data6 as $result6)
                                @php $treattapname6 = (new
                                OptoController)->convertMarathi($result->TreatType6,$result->TreatDose6,
                                $result6->Value,$result->TreatDur6,$result->TreatEye6); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$treattapname6}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName6}}</strong> </td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName6}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif

                                @if($result->TreatChk5 == 1)
                                @if($result->TreatFreq7 == '8 TAP' || $result->TreatFreq7 == '6 TAP' ||
                                $result->TreatFreq7 == '4 TAP' || $result->TreatFreq7 == '3 TAP' ||
                                $result->TreatFreq7 == '2 TAP' || $result->TreatFreq7 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName7}}</strong></td>
                                </tr>
                                @php
                                $TapValue7 = $result->TreatFreq7;
                                $data7 = (new ConsultantController)->getTapValue($TapValue7);
                                @endphp
                                @foreach($data7 as $result7)
                                @php $treattapname7 = (new
                                OptoController)->convertMarathi($result->TreatType7,$result->TreatDose7,
                                $result7->Value,$result->TreatDur7,$result->TreatEye7); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$treattapname7}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName7}}</strong> </td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName7}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif

                                @if($result->TreatChk8 == 1)
                                @if($result->TreatFreq8 == '8 TAP' || $result->TreatFreq8 == '6 TAP' ||
                                $result->TreatFreq8 == '4 TAP' || $result->TreatFreq8 == '3 TAP' ||
                                $result->TreatFreq8 == '2 TAP' || $result->TreatFreq8 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName8}}</strong></td>
                                </tr>
                                @php
                                $TapValue8 = $result->TreatFreq8;
                                $data8 = (new ConsultantController)->getTapValue($TapValue8);
                                @endphp
                                @foreach($data8 as $result8)
                                @php $treattapname8 = (new
                                OptoController)->convertMarathi($result->TreatType8,$result->TreatDose8,
                                $result8->Value,$result->TreatDur8,$result->TreatEye8); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$treattapname8}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName8}}</strong> </td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName8}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif

                                @if($result->TreatChk9 == 1)
                                @if($result->TreatFreq9 == '8 TAP' || $result->TreatFreq9 == '6 TAP' ||
                                $result->TreatFreq9 == '4 TAP' || $result->TreatFreq9 == '3 TAP' ||
                                $result->TreatFreq9 == '2 TAP' || $result->TreatFreq9 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName9}}</strong> </td>
                                </tr>
                                @php
                                $TapValue9 = $result->TreatFreq9;
                                $data9 = (new ConsultantController)->getTapValue($TapValue9);
                                @endphp
                                @foreach($data9 as $result9)
                                @php $treattapname9 = (new
                                OptoController)->convertMarathi($result->TreatType9,$result->TreatDose9,
                                $result9->Value,$result->TreatDur9,$result->TreatEye9); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$treattapname9}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName9}}</strong> </td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName9}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif

                                @if($result->TreatChk10 == 1)
                                @if($result->TreatFreq10 == '8 TAP' || $result->TreatFreq10 == '6 TAP' ||
                                $result->TreatFreq10 == '4 TAP' || $result->TreatFreq10 == '3 TAP' ||
                                $result->TreatFreq10 == '2 TAP' || $result->TreatFreq10 == '1 TAP')
                                <tr>
                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName10}}</strong> </td>
                                </tr>
                                @php
                                $TapValue10 = $result->TreatFreq10;
                                $data10 = (new ConsultantController)->getTapValue($TapValue10);
                                @endphp
                                @foreach($data10 as $result10)
                                @php $treattapname10 = (new
                                OptoController)->convertMarathi($result->TreatType10,$result->TreatDose10,
                                $result10->Value,$result->TreatDur10,$result->TreatEye10); @endphp
                                <tr>

                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$treattapname10}}</td>
                                    @endforeach
                                </tr>
                                @else
                                <tr>

                                    <td align="left" valign="top" class="addrfont"><strong>{{$result->TreatName10}}</strong> </td>
                                </tr>
                                <tr>
                                    <td style="text-align:justify;font-family: Shivaji01;padding-left: 25px;">
                                        {{$TreatName10}}</td>
                                </tr>
                                @endif
                                <!-- <tr>
                                    <td align="left" valign="top">&nbsp;</td>
                                </tr> -->
                                @endif
                </table></td>
              </tr>
              <tr>
                <td width="21%" height="68" align="left" valign="top" class="tdbrd">Cost Quote</td>
                <td align="left" valign="top" class="tdbrd"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                {{$result->CostCoated}}
              </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table></


@endforeach