<div class="card" style="margin-bottom: 1%;">
    <input type="hidden" id="crossInvest" value="1" />
    <div class="card-header txtl">
        <div class="fright wds100">
            <table class="table" style="width: 100%">
                <tbody>
                    <tr>
                        <td rowspan="2">   
                            <span style="float: left;">
                                <input type="checkbox"  class="checkGroup" value="{$inv->id}" name="invCheck[]">
                            </span>

                            <a class="card-link fleft" data-toggle="collapse" href="#invDiv{$inv->id}">
                                {$inv->invname}
                            </a>

                            <div class="col-md-1  fright">
                                <a class="btn btn-xs  bg-green-haze  printResultsOne "  data-id="{$inv->id}"   
                                   href="javascript:;"   > <i class="fa fa-print"></i> 
                                </a>
                            </div>   

                            {if  $inv->hasPdf== 1 }
                            <div class="col-md-1  fright">
                                <a href="#"  class="btn green-jungle btn-xs"
                                   onclick="document.getElementById('invPdf_{$inv->id}').click(); return false;" >
                                    <i class="fa fa-upload"></i>  </a>
                                <input type="file" name="invPdf_{$inv->id}"  id="invPdf_{$inv->id}"  
                                       class=" form-control addInvPdf" data-id="{$inv->id}" style="visibility:hidden;"  >
                            </div>   

                            <div class="col-md-1  fright">
                                {if  $inv->pdf != ''  &&  $inv->pdf != '.'  &&  $inv->pdf != Null &&  $inv->pdf != 'no image'  }
                                <a class=" btn  btn-xs blue" download="{$inv->invname}_{$patientNo}" 
                                   href="{$hosturl}/../upload/inv_pdf/{$patientNo}/{$inv->pdf}" id="pdfDownload{$inv->id}" >
                                    <i class="fa fa-download"></i>
                                </a>

                                {else}
                                <a class=" btn  btn-xs blue" download="{$inv->invname}_{$patientNo}" 
                                   id="pdfDownload{$inv->id}" style="display: none;" >
                                    <i class="fa fa-download"></i>
                                </a>
                                {/if}
                                <img src="{$hosturl}/../upload/loading.gif" id="talks-loading{$inv->id}" style="display: none;">
                            </div>   
                            {/if}



                        </td>
                        <th class="wds5 txtc"> F </th>
                        <th class="wds5 txtc"> V </th>
                        <th class="wds5 txtc"> P </th>
                        <th class="wds5 txtc"> D </th>
                        <td class="wds5 txtc"> S </td>
                    </tr>

                    <tr>
                        <td>
                            {if  $inv->filled == 1 }
                            <i class="fa fa-check  invStatusChange"   data-colName="filled"  data-val="0" 
                               data-id="{$inv->id}"    id="invFilled{$inv->id}" 
                               style="color: #119866;font-size: 20px;margin-top: 5%;margin-bottom: 10%;"></i> 
                            {else}
                            <i class="fa fa-times invStatusChange"   data-colName="filled"    data-val="1" 
                               data-id="{$inv->id}"    id="invFilled{$inv->id}" 
                               style="color: red;font-size: 20px;margin-top: 5%;margin-bottom: 10%;"></i> 
                            {/if}
                        </td>

                        <td>
                            {if  $inv->verified == 1 }
                            <i class="fa fa-check invStatusChange"   data-colName="verified"   data-val="0"  
                               data-id="{$inv->id}" 
                               style="color: #119866;font-size: 20px;margin-top: 5%;margin-bottom: 10%;"></i> 
                            {else}
                            <i class="fa fa-times invStatusChange"   data-colName="verified"    data-val="1" 
                               data-id="{$inv->id}"  
                               style="color: red;font-size: 20px;margin-top: 5%;margin-bottom: 10%;"></i> 
                            {/if}
                        </td>

                        <td>
                            {if  $inv->printed == 1 }
                            <i class="fa fa-check invStatusChange"    data-colName="printed"    data-val="0"      id="invPrinted{$inv->id}" 
                               data-id="{$inv->id}" 
                               style="color: #119866;font-size: 20px;margin-top: 5%;margin-bottom: 10%;"></i> 
                            {else}
                            <i class="fa fa-times invStatusChange"    data-colName="printed"    data-val="1"      id="invPrinted{$inv->id}" 
                               data-id="{$inv->id}"  
                               style="color: red;font-size: 20px;margin-top: 5%;margin-bottom: 10%;"></i> 
                            {/if}
                        </td>

                        <td>
                            {if  $inv->delivered == 1 }
                            <i class="fa fa-check invReDeliver "     data-id="{$inv->id}"  data-paid="{$paid}"  data-val="1" 
                               style="color: #119866;font-size: 20px;margin-top: 5%;"></i> 
                            {else}
                            <i class="fa fa-times invStatusChange"    data-colName="delivered"    data-val="1" 
                               data-id="{$inv->id}"  data-paid="{$paid}" 
                               style="color: red;font-size: 20px;margin-top: 5%;margin-bottom: 10%;"></i> 
                            {/if}
                        </td>

                        <td>
                            {if  $inv->sent == 1 }
                            <i class="fa fa-check invStatusChange"  data-colName="sent"    data-val="0" 
                               data-id="{$inv->id}"    
                               style="color: #119866;font-size: 20px;margin-top: 5%;margin-bottom: 10%;"></i> 
                            {else}
                            <i class="fa fa-times invStatusChange"    data-colName="sent"    data-val="1" 
                               data-id="{$inv->id}"  
                               style="color: red;font-size: 20px;margin-top: 5%;margin-bottom: 10%;"></i> 
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5">
                            <div class="form-group collapse  " data-parent="#accordion" style=" width: 100%; float: left;   border-bottom:1px solid black;  margin: 5px;padding-bottom: 5px;" id="invDiv{$inv->id}">
                                <div class="card-body">



                                    <div class="form-group col-md-12 " style=" float: left; margin-top: 5px; ">

                                        <label class="col-md-2 wds20 control-label bold txtl" style=" font-size: 16px;">The Patient  : </label>

                                        <div class="col-md-2 wds8">
                                            <select     select-colName="name"    select-tableName="cross_abo"     class="form-control updateInvest  cross_abo"  
                                                        data-colName="abo"   data-id="{$inv->cross.id}"  data-tableName="{$inv->tableName}"
                                                        id="cross_abo"  {if $archive == 1 } disabled="" {/if} >
                                                <option value=""></option>
                                                {foreach $cross_abo as $data}
                                                <option value="{$data->id}" {if $inv->cross.abo ==    $data->id }selected{/if}>{$data->name}</option>
                                                {/foreach}
                                                <option value="-2" class="deleteoptincompo">حذف</option>
                                            </select>
                                        </div>


                                        <div class="col-md-4 wds12">
                                            <select     select-colName="name"    select-tableName="cross_rh"     class="form-control updateInvest  cross_rh"  
                                                        data-colName="rh"   data-id="{$inv->cross.id}"  data-tableName="{$inv->tableName}"
                                                        id="cross_rh"  {if $archive == 1 } disabled="" {/if} >
                                                <option value=""></option>
                                                {foreach $cross_rh as $data}
                                                <option value="{$data->id}" {if $inv->cross.rh ==    $data->id }selected{/if}>{$data->name}</option>
                                                {/foreach}
                                                <option value="-2" class="deleteoptincompo">حذف</option>
                                            </select>
                                        </div>
                                    </div>




                                    <div class="form-group col-md-12 " style=" float: left; margin-top: 5px; background-color: #ddd; ">
                                        <input type="hidden" id="crossDonnersItr" value="{$inv->cross.donnersItr}" />

                                        <label class=" col-md-2 wds20 control-label bold txtl" style=" font-size: 16px;">The Donors  : 
                                            {if $archive != 1 }
                                            <a class=" btn-success btn-xs " id="AddDonor"  href="javascript:;"  data-cross="{$inv->cross.id}" 
                                               style="margin-right: 0px;"  >
                                                <i class="fa fa-plus"></i> </a>
                                            {/if}
                                        </label>
                                        <div class="col-md-2 wds8">ABO</div>
                                        <div class="col-md-2 wds12">Rh</div>
                                        <div class="col-md-2 wds15">Compatibility</div>
                                        <div class="col-md-2 wds15">HCV</div>
                                        <div class="col-md-2 wds15">HBsAg</div>
                                        <div class="col-md-2 wds15">HV</div>
                                    </div>

                                    <div id="donorsDiv">        
                                        {assign var=i value=1}
                                        {foreach $inv->cross.donners as $donner}

                                        <div class="form-group col-md-12 " style=" float: left; margin-top: 5px; ">

                                            <div class="col-md-2 wds20">

                                                <input type="text"  class="form-control updateInvest   notPop   " data-colName="name"     
                                                       data-id="{$donner.id}"  data-tableName="investigationresults_cross_donners" 
                                                       value="{$donner.name}"  {if $archive == 1 } disabled="" {/if} >

                                            </div>

                                            <div class="col-md-2 wds8">
                                                <select     select-colName="name"    select-tableName="cross_abo"     class="form-control updateInvest  cross_abo"  
                                                            data-colName="abo"   data-id="{$donner.id}"  data-tableName="investigationresults_cross_donners"
                                                            id="donner_abo{$i}" data-itr="{$i}"  {if $archive == 1 } disabled="" {/if} >
                                                    <option value=""></option>
                                                    {foreach $cross_abo as $data}
                                                    <option value="{$data->id}" {if $donner.abo ==    $data->id }selected{/if}>{$data->name}</option>
                                                    {/foreach}
                                                    <option value="-2" class="deleteoptincompo">حذف</option>
                                                </select>
                                            </div>


                                            <div class="col-md-2 wds12">
                                                <select     select-colName="name"    select-tableName="cross_rh"     class="form-control updateInvest  cross_rh"  
                                                            data-colName="rh"   data-id="{$donner.id}"  data-tableName="investigationresults_cross_donners"
                                                            id="donner_rh{$i}" data-itr="{$i}"   {if $archive == 1 } disabled="" {/if} >
                                                    <option value=""></option>
                                                    {foreach $cross_rh as $data}
                                                    <option value="{$data->id}" {if $donner.rh ==    $data->id }selected{/if}>{$data->name}</option>
                                                    {/foreach}
                                                    <option value="-2" class="deleteoptincompo">حذف</option>
                                                </select>
                                            </div>


                                            <div class="col-md-2 wds15">
                                                <select     select-colName="name"    select-tableName="cross_compatibility"     class="form-control updateInvest  cross_compatibility"  
                                                            data-colName="compatibility"   data-id="{$donner.id}"  data-tableName="investigationresults_cross_donners"
                                                            id="cross_compatibility{$i}" data-itr="{$i}"   {if $archive == 1 } disabled="" {/if} >
                                                    <option value=""></option>
                                                    {foreach $cross_compatibility as $data}
                                                    <option value="{$data->id}" {if $donner.compatibility ==    $data->id }selected{/if}>{$data->name}</option>
                                                    {/foreach}
                                                    <option value="-2" class="deleteoptincompo">حذف</option>
                                                </select>
                                            </div>


                                            <div class="col-md-2 wds15">
                                                <select     select-colName="name"    select-tableName="cross_hcv"     class="form-control updateInvest  cross_hcv"  
                                                            data-colName="hcv"   data-id="{$donner.id}"  data-tableName="investigationresults_cross_donners"
                                                            id="cross_hcv{$i}" data-itr="{$i}"   {if $archive == 1 } disabled="" {/if} >
                                                    <option value=""></option>
                                                    {foreach $cross_hcv as $data}
                                                    <option value="{$data->id}" {if $donner.hcv ==    $data->id }selected{/if}>{$data->name}</option>
                                                    {/foreach}
                                                    <option value="-2" class="deleteoptincompo">حذف</option>
                                                </select>
                                            </div>


                                            <div class="col-md-2 wds15">
                                                <select     select-colName="name"    select-tableName="cross_hbsag"     class="form-control updateInvest  cross_hbsag"  
                                                            data-colName="hbsag"   data-id="{$donner.id}"  data-tableName="investigationresults_cross_donners"
                                                            id="cross_hbsag{$i}" data-itr="{$i}"   {if $archive == 1 } disabled="" {/if} >
                                                    <option value=""></option>
                                                    {foreach $cross_hbsag as $data}
                                                    <option value="{$data->id}" {if $donner.hbsag ==    $data->id }selected{/if}>{$data->name}</option>
                                                    {/foreach}
                                                    <option value="-2" class="deleteoptincompo">حذف</option>
                                                </select>
                                            </div>


                                            <div class="col-md-2 wds15">
                                                <select     select-colName="name"    select-tableName="cross_hv"     class="form-control updateInvest  cross_hv"  
                                                            data-colName="hv"   data-id="{$donner.id}"  data-tableName="investigationresults_cross_donners"
                                                            id="cross_hv{$i}" data-itr="{$i}"   {if $archive == 1 } disabled="" {/if} >
                                                    <option value=""></option>
                                                    {foreach $cross_hv as $data}
                                                    <option value="{$data->id}" {if $donner.hv ==    $data->id }selected{/if}>{$data->name}</option>
                                                    {/foreach}
                                                    <option value="-2" class="deleteoptincompo">حذف</option>
                                                </select>
                                            </div>


                                        </div>

                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}

                                    </div>





                                    <div class="form-group col-md-12 " style=" float: left;margin-top :  5px; ">
                                        <label class="col-md-2 control-label bold txtl" style=" font-size: 16px;"> Comment </label>
                                        <div class="col-md-10">
                                            <textarea class="form-control updateInvest txtc   notPop   " rows="2" data-id="{$inv->cross.id}" data-colName="comment" 
                                                      data-tableName="{$inv->tableName}" placeholder="Enter more text" >
                                                {$inv->cross.comment}
                                            </textarea>
                                        </div>
                                    </div>


                                </div>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

</div>