<style>
    table {
        font-family: arial, sans-serif;
        border-collapse: collapse;
        width: 100%;

    }


    td, th {
        border: 1px solid #000000;
        text-align: center;
        padding: 2px;
    }

    tr:nth-child(even) {
        background-color: #dddddd;
    }
</style>
<div class="page-content-wrapper">
    <div class="page-content">
        <div class="row">
            <div class="col-md-12 clinick invz" id="gprinModel">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-user"></i>IVF Report
                        </div>
                        <div class="actions">
                            {if isset($is_add)}
                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=complete_one&&show={$show}&&patientid={$patientId}&&id={$ivf_report.id}&&tname={$tableName}" 
                               class="btn btn-default btn-sm pull-left" style="margin-right: 5px;">
                                save </a>
                            {else}
                            <a  class="btn btn-default btn-xs printIvfReport" 
                                data-id="{$ivf_report.id}" ><i class="fa fa-print"></i> Print 
                            </a>
                            {/if}
                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=ivf_report&&patientid={$patientId}" class="btn btn-default btn-sm">
                                Show </a>

                        </div>
                    </div>
                    <div class="portlet-body all">

                        <!---======================================================== tab1============================================================================================ ----->

                        <div class="row">
                            <div id="ultrasoundgynaDiv">

                                <div class="row">

                                    <div class="portlet-body form" >
                                        <form>
                                            <div class="form-body">

                                                <table >
                                                    <thead>
                                                        <tr>
                                                            <th class="wds15">      Supervision Dr :  </th>
                                                            <td class="wds25">
                                                                <input type="text" class="form-control "  value="{$ref_dr}"  readonly/>
                                                            </td>

                                                            <th class="wds20">     Protocol of Treatment :  </th>
                                                            <td>
                                                                <select id="treatprotocol{$ivf_report.id}"      data-rowid="{$ivf_report.id}" 
                                                                        class="form-control treatProtocol updateItemH" 
                                                                        name="treat_protocol" select-tableName="treatprotocol" data-colName="treat_protocol" 
                                                                        data-tableName="ivf_report" >
                                                                    <option value="">choose</option>
                                                                    {foreach  $treatprotocol  as $one}
                                                                    <option value="{$one->id}"{if $ivf_report.treat_protocol eq $one->id}selected{/if} >{$one->name}</option>
                                                                    {/foreach}

                                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                                </select>
                                                            </td>
                                                            <th class="wds10">      Trial No  :  </th>
                                                            <td class="wds10">
                                                                <input type="text" class="form-control updateElement " 
                                                                       value="{$ivf_report.trial_no}" data-colName="trial_no"  
                                                                       data-tableName="ivf_report" data-id="{$ivf_report.id}">
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

                                                <div class="clearfix"></div>
                                                <hr>

                                                <table >
                                                    <thead>
                                                        <tr>
                                                            <th class="wds10">     Age  </th>
                                                            <td class="wds10">{$patAge}</td>
                                                            <th class="wds10">     BMI  </th>
                                                            <td class="wds16">
                                                                <input type="text" class="form-control updateElement " 
                                                                       value="{$ivf_report.bmi}" data-colName="bmi"  
                                                                       data-tableName="ivf_report" data-id="{$ivf_report.id}">
                                                            </td>
                                                            <th class="wds10">     AMH  </th>
                                                            <td class="wds16">
                                                                <input type="text" class="form-control updateElement " 
                                                                       value="{$ivf_report.amh}" data-colName="amh"  
                                                                       data-tableName="ivf_report" data-id="{$ivf_report.id}">
                                                            </td>
                                                            <th class="wds10">     FSH  </th>
                                                            <td>
                                                                <input type="text" class="form-control updateElement " 
                                                                       value="{$ivf_report.fsh}" data-colName="fsh"  
                                                                       data-tableName="ivf_report" data-id="{$ivf_report.id}">
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

                                                <div class="clearfix"></div>
                                                <hr>
                                                <div class="portlet-body form" style="max-width: 1200px;overflow-x: auto;white-space: nowrap;">
                                                    <table style="width:1200px;" >
                                                        <caption>
                                                            <a  class="btn green-haze btn-sm fright" id="addIvfRecord" data-id="{$ivf_report.id}"
                                                                data-tableName="ivf_records" style="margin-right: 150px;"   >   
                                                                <i class="fa fa-plus"></i> Add </a>
                                                        </caption>
                                                        <thead>
                                                            <tr>
                                                                <th rowspan="3" style="width: 100px;">Date</th>
                                                                <th rowspan="3" style="width: 100px;">Cycle Day</th>
                                                                <th rowspan="3" style="width: 100px;">E2</th>
                                                                <th rowspan="3" style="width: 500px;">Drugs</th>
                                                                <th colspan="4" style="width: 400px;">Transvaginal Ultrasonography </th>
                                                                <th rowspan="3" style="width: 100px;">Endometrium </th>
                                                                <th rowspan="3" style="width: 40px;"> </th>
                                                            </tr>
                                                            <tr>
                                                                <th  colspan="2" style="width: 200px;">Right Ovary</th>
                                                                <th colspan="2"  style="width: 200px;">Left Ovary  </th>
                                                            </tr>
                                                            <tr>
                                                                <th style="width: 90px;">NO.</th>
                                                                <th style="width: 110px;">Size</th>
                                                                <th style="width: 90px;">NO.</th>
                                                                <th style="width: 110px;">Size</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody id="ivfContent">
                                                            {foreach $ivf_records as $ivf_record }
                                                            <tr>
                                                                <td>
                                                                    <input type="text" class="form-control  datepicker updateElement"   
                                                                           data-colName="record_date" value="{$ivf_record->record_date}"  
                                                                           data-tableName="ivf_records"    data-id="{$ivf_record->id}"/>
                                                                </td>
                                                                <td>
                                                                    <input type="text" class="form-control updateElement " 
                                                                           value="{$ivf_record->cycle_day}" data-colName="cycle_day"  
                                                                           data-tableName="ivf_records" data-id="{$ivf_record->id}">
                                                                </td>
                                                                <td>
                                                                    <input type="text" class="form-control updateElement " 
                                                                           value="{$ivf_record->e2}" data-colName="e2"  
                                                                           data-tableName="ivf_records" data-id="{$ivf_record->id}">
                                                                </td>
                                                                <td>
                                                                    <table >
                                                                        <thead>
                                                                            <tr>
                                                                                <th style="width: 200px;">Type
                                                                                    <a  class="btn green-haze btn-sm fright addIvfRecordDrug" id="addIvfRecordDrug{$ivf_record->id}" 
                                                                                        data-id="{$ivf_record->id}"  data-tableName="ivf_records_drugs"    
                                                                                        data-container="ivfRecordsDrugsContent{$ivf_record->id}"  >  
                                                                                        <i class="fa fa-plus"></i>  </a>
                                                                                </th>
                                                                                <th style="width: 260px;">Dose</th>
                                                                                <th style="width: 40px;"></th>
                                                                            </tr>
                                                                        </thead>
                                                                        <tbody id="ivfRecordsDrugsContent{$ivf_record->id}">
                                                                            {foreach $ivf_record->record_drugs as $data }
                                                                            <tr>
                                                                                <td>
                                                                                    <select class="form-control xx dnameIvf select2me updateElement" id="dnameRec{$data.id}" 
                                                                                            data-id="{$data.id}" data-colName="drugid" data-tableName="ivf_records_drugs" 
                                                                                            data-itr="{$data.id}" data-placeholder="Select..."  data-createNew="1" data-origin="{$ivf_record->id}" >
                                                                                        <option value=""  {if $data.drugid == ""}selected{/if} >Choose Drug</option>
                                                                                        {foreach $ivfDrugs as $drug}
                                                                                        <option value="{$drug['id']}" {if $data.drugid == $drug['id'] }selected{/if} >{$drug['drugname']} </option>
                                                                                        {/foreach}
                                                                                        <option value=""  {if $data.drugid == ""}selected{/if} >Choose Drug</option>
                                                                                    </select>
                                                                                </td>
                                                                                <td>
                                                                                    <select class="form-control xx select2me updateElement" id="ddosRec{$data.id}" 
                                                                                            data-id="{$data.id}" data-colName="drugdos" data-tableName="ivf_records_drugs" 
                                                                                            data-itr="{$data.id}" data-placeholder="Select..."  >
                                                                                        <option value="" {if $data.drugdos == ""}selected{/if}  >choose dose </option>
                                                                                        {foreach $allDrugDoses as $dos}
                                                                                        <option value="{$dos['drugdos']}" {if $data.drugdos == $dos['drugdos'] }selected{/if}  >{$dos['drugdos']}</option>
                                                                                        {/foreach}
                                                                                        <option value="" {if $data.drugdos == ""}selected{/if}  >choose dose </option>
                                                                                    </select>
                                                                                </td>
                                                                                <td>
                                                                                    <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$data.id}"  data-tableName="ivf_records_drugs" 
                                                                                       style=" float: left;" href="#" data-link="ivf_reports" data-fn="del">
                                                                                        <i class="fa fa-close"></i>
                                                                                    </a>
                                                                                </td>
                                                                            </tr>
                                                                            {/foreach}
                                                                        </tbody>
                                                                    </table>
                                                                </td>
                                                                <td>
                                                                    <input type="text" class="form-control updateElement " 
                                                                           value="{$ivf_record->r_no}" data-colName="r_no"  
                                                                           data-tableName="ivf_records" data-id="{$ivf_record->id}">
                                                                </td>
                                                                <td>
                                                                    <span class="wds25">MOF</span>
                                                                    <input type="text" class="form-control updateElement wds60 " 
                                                                           value="{$ivf_record->r_size}" data-colName="r_size"  style="display: inline;" 
                                                                           data-tableName="ivf_records" data-id="{$ivf_record->id}">
                                                                </td>
                                                                <td>
                                                                    <input type="text" class="form-control updateElement " 
                                                                           value="{$ivf_record->l_no}" data-colName="l_no"  
                                                                           data-tableName="ivf_records" data-id="{$ivf_record->id}">
                                                                </td>
                                                                <td>
                                                                    <span class="wds25">MOF</span>
                                                                    <input type="text" class="form-control updateElement  wds60" 
                                                                           value="{$ivf_record->l_size}" data-colName="l_size"  style="display: inline;"  
                                                                           data-tableName="ivf_records" data-id="{$ivf_record->id}">
                                                                </td>
                                                                <td>
                                                                    <input type="text" class="form-control updateElement " 
                                                                           value="{$ivf_record->endo}" data-colName="endo"  
                                                                           data-tableName="ivf_records" data-id="{$ivf_record->id}">
                                                                </td>
                                                                <td>
                                                                    <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$ivf_record->id}"  
                                                                       data-tableName="ivf_records" 
                                                                       style=" float: left;" href="#" data-link="ivf_reports" data-fn="del">
                                                                        <i class="fa fa-close"></i>
                                                                    </a>
                                                                </td>
                                                            </tr>
                                                            {/foreach}
                                                        </tbody>
                                                    </table>
                                                </div>

                                                <div class="clearfix"></div>
                                                <hr>

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds20">     Date Of Triggering  </th>
                                                            <td>
                                                                <input type="text" class="form-control  datepicker updateElement"   
                                                                       data-colName="trig_date" value="{$ivf_report.trig_date}"  
                                                                       data-tableName="ivf_report"    data-id="{$ivf_report.id}"/>
                                                            </td>
                                                            <th class="wds20">     Time Of Triggering  </th>
                                                            <td>
                                                                <input type="text" class="form-control notPop   timepicker1 updateElement"   
                                                                       data-colName="trig_time" value="{$ivf_report.trig_time}"  
                                                                       data-tableName="ivf_report"    data-id="{$ivf_report.id}"/>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>


                                                <div class="clearfix"></div>
                                                <hr>

                                                <table >
                                                    <caption class="txtc bold">Dose Of Triggering
                                                        <a  class="btn green-haze btn-sm fright" id="addIvfDrug" data-id="{$ivf_report.id}"
                                                            data-tableName="ivf_drugs"  data-container="ivfDrugsContent"  >  
                                                            <i class="fa fa-plus"></i> Add </a>
                                                    </caption>
                                                    <thead>
                                                        <tr>
                                                            <th>Type</th>
                                                            <th>Dose</th>
                                                            <th class="wds5"></th>
                                                        </tr>
                                                    </thead>
                                                    <tbody id="ivfDrugsContent">
                                                        {foreach $ivf_drugs as $data }
                                                        <tr>
                                                            <td>
                                                                <select class="form-control xx dnameIvf select2me updateElement" id="dnameIvf{$data.id}" 
                                                                        data-id="{$data.id}" data-colName="drugid" data-tableName="ivf_drugs" 
                                                                        data-itr="{$data.id}" data-placeholder="Select..."  data-createNew="1" >
                                                                    <option value=""  {if $data.drugid == ""}selected{/if} >Choose Drug</option>
                                                                    {foreach $ivfDrugs as $drug}
                                                                    <option value="{$drug['id']}" {if $data.drugid == $drug['id'] }selected{/if} >{$drug['drugname']} </option>
                                                                    {/foreach}
                                                                    <option value=""  {if $data.drugid == ""}selected{/if} >Choose Drug</option>
                                                                </select>
                                                            </td>
                                                            <td>
                                                                <select class="form-control xx select2me updateElement" id="ddosIvf{$data.id}" 
                                                                        data-id="{$data.id}" data-colName="drugdos" data-tableName="ivf_drugs" 
                                                                        data-itr="{$data.id}" data-placeholder="Select..."  >
                                                                    <option value="" {if $data.drugdos == ""}selected{/if}  >choose dose </option>
                                                                    {foreach $allDrugDoses as $dos}
                                                                    <option value="{$dos['drugdos']}" {if $data.drugdos == $dos['drugdos'] }selected{/if}  >{$dos['drugdos']}</option>
                                                                    {/foreach}
                                                                    <option value="" {if $data.drugdos == ""}selected{/if}  >choose dose </option>
                                                                </select>
                                                            </td>
                                                            <td>
                                                                <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$data.id}"  data-tableName="ivf_drugs" 
                                                                   style=" float: left;" href="#" data-link="ivf_reports" data-fn="del">
                                                                    <i class="fa fa-close"></i>
                                                                </a>
                                                            </td>
                                                        </tr>
                                                        {/foreach}
                                                    </tbody>
                                                </table>


                                            </div>
                                        </form>
                                    </div>

                                </div>
                                <div class="clearfix"></div>

                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>

            <div class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" aria-hidden="false"  id="edit_model">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                            <h4 class="modal-title"> Edit </h4>
                        </div>
                        <div class="modal-body">
                            <div class="portlet-body form">
                                <form action="" method="post" class="form-horizontal emptyform">
                                    <div class="form-body">
                                        <!------===========================================------->
                                        <div>
                                            <div id="alldatadiv" class=""> </div>
                                        </div>

                                        <!------===========================================------->
                                        <!--                            <div class="form-group">
                                                                        <label class="col-md-3 control-label"> Name</label>
                                                                        <div class="col-md-8">
                                                                            <input type="hidden" class="form-control"  id="newitem_id" name="newamount_id" >
                                                                            <input type="text" class="form-control"  id="newitem_name" name="newamount_name" style="text-align:left;" >
                                                                            <div id="divsucess1" style="color:red; display:none;"></div>
                                                                        </div>
                                                                    </div>-->
                                        <!------===========================================------->
                                        <div class="modal-footer">
                                            <!--                                <button type="button" class="btn green" id="editmodel_submit"> Update </button>-->
                                            <button type="button" id="amountcloseinput"   class="btn default" data-dismiss="modal">Close</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<div class="clearfix"></div>
<div id="vvv"></div>
<div id="printIvfDiv"></div>
<input type="hidden" id="controllName" value="{$controllname}">
<input type="hidden" id="ivfSelects" value="1">
<input type="hidden" id="embryoslab" value="1">

<script>


    $(".amrpop,input[type='text']:not(.datepicker):not(.notPop),textarea:not(.notPop)").hover(function () {
        var pop_value = $(this).val();
        $(this).attr({
            "data-toggle": "popover",
            "data-trigger": "hover",
            "data-placement": "bottom",
            "data-content": pop_value
        });
        $(this).popover("show");
    });

</script>