
{if $type == "usantenatal"}

<table class="table table-striped table-hover table-bordered" dir="ltr">
    <thead>
        <tr>
            <th class="wds1">
                <input type="checkbox" id="usPrintAll">
            </th>
            <th class="wds1"> #</th>
            <th class="wds9">  Date</th>
            <th class="wds7"> W </th>

            {if  $aUs->netW >= 4 &&  $aUs->netW < 14 }
            <th class="wds11">  No. of soc</th>
            <th class="wds13">  No. of Fetal Pole</th>
            <th class="wds11">  Fetal Pulsation</th>
            <th class="wds10">  GS </th>
            <th class="wds10"> CRL</th>
            {else if  $aUs->netW >= 14 &&  $aUs->netW <= 40 }
            <th class="wds8">  No. </th>
            <th class="wds10">  Visibility </th>
            <th class="wds10">   Presentation </th>
            <th class="wds10">   Liquor</th>
            <th class="wds5">  BPD </th>
            <th class="wds5">  FL  </th>
            <th class="wds5"> AC </th>
            <th class="wds5"> EFW </th>
            {/if}

            <th>  Notes   </th>
            <th class="wds1">   </th>
            {if $ProgramesettingData->displaydoctorname eq 1}
            <th class="wds1">   Doctor  </th>
            {/if}
        </tr>
    </thead>
    <tbody>

        <tr>
            <td>
                <input type="checkbox" class="usPrint" id="usPrint{$aUs->id}"  name="pic[]"  
                       value="{$aUs->id}"/>
            </td>
            <td>{$itr}  <input type="hidden" id="netWText" value="{$antType}"/> </td>
            <td>
                <input type="text" class="form-control datepicker updateElement usDate" readonly="" 
                       placeholder="Date" data-colName="date" data-id="{$aUs->id}"  
                       data-tableName="mainantenentalus" value="{$aUs->date}"/>
            </td>
            <td>
                <label id="usLabel{$aUs->id}" 
                       {if $aUs->dateFlag == 1}style="color: red;font-size: 17px;" {else} style="color: maroon; font-weight : bolder; font-size: 17px;" {/if}>
                    {$aUs->w}</label>
            </td>
            {if  $aUs->netW >= 4 &&  $aUs->netW < 14 }
            <td>
                <select  class="form-control no_soc updateElement" name="no_soc"
                         data-colName="no_soc" data-id="{$aUs->id}"  
                         data-tableName="mainantenentalus"   id="no_soc{$aUs->id}" >
                    <option value=""></option>
                    {foreach $no_soc as $row}
                    <option value="{$row->id}" {if $aUs->no_soc == $row->id}selected{/if}>{$row->name}</option>
                    {/foreach}
                    <option value="-2" class="deleteoptincompo">Delete</option>
                </select>
            </td>
            <td>
                <select  class="form-control no_fetal updateElement" name="no_fetal"
                         data-colName="no_fetal" data-id="{$aUs->id}"  
                         data-tableName="mainantenentalus"   id="no_fetal{$aUs->id}" >
                    <option value=""></option>
                    {foreach $no_fetal as $row}
                    <option value="{$row->id}" {if $aUs->no_fetal == $row->id}selected{/if}>{$row->name}</option>
                    {/foreach}
                    <option value="-2" class="deleteoptincompo">Delete</option>
                </select>
            </td>
            <td>
                <select  class="form-control fetal_pulse updateElement" name="fetal_pulse"
                         data-colName="fetal_pulse" data-id="{$aUs->id}"  
                         data-tableName="mainantenentalus"   id="fetal_pulse{$aUs->id}" >
                    <option value=""></option>
                    {foreach $fetal_pulse as $row}
                    <option value="{$row->id}" {if $aUs->fetal_pulse == $row->id}selected{/if}>{$row->name}</option>
                    {/foreach}
                    <option value="-2" class="deleteoptincompo">Delete</option>
                </select>
            </td>
            <td>
                <input type="text" class="form-control updateElement" placeholder="GS" 
                       data-colName="gs" data-id="{$aUs->id}"  data-tableName="mainantenentalus" 
                       value="{$aUs->gs}">
            </td>
            <td>
                <input type="text" class="form-control updateElement" placeholder="CRL" 
                       data-colName="crl" data-id="{$aUs->id}"  data-tableName="mainantenentalus" 
                       value="{$aUs->crl}">
            </td>
            {else if  $aUs->netW >= 14 &&  $aUs->netW <= 40 }
            <td>
                <select  class="form-control fet_no updateElement" name="fet_no"
                         data-colName="fet_no" data-id="{$aUs->id}"  
                         data-tableName="mainantenentalus"   id="fet_no{$aUs->id}" >
                    <option value=""></option>
                    {foreach $fet_no as $row}
                    <option value="{$row->id}" {if $aUs->fet_no == $row->id}selected{/if}>{$row->name}</option>
                    {/foreach}
                    <option value="-2" class="deleteoptincompo">Delete</option>
                </select>
            </td>
            <td>
                <select  class="form-control visibility updateElement" name="visibility"
                         data-colName="visibility" data-id="{$aUs->id}"  
                         data-tableName="mainantenentalus"   id="visibility{$aUs->id}" >
                    <option value=""></option>
                    {foreach $visibility as $row}
                    <option value="{$row->id}" {if $aUs->visibility == $row->id}selected{/if}>{$row->name}</option>
                    {/foreach}
                    <option value="-2" class="deleteoptincompo">Delete</option>
                </select>
            </td>
            <td>
                <select  class="form-control ant_presentation updateElement" name="ant_presentation"
                         data-colName="ant_presentation" data-id="{$aUs->id}"  
                         data-tableName="mainantenentalus"   id="ant_presentation{$aUs->id}" >
                    <option value=""></option>
                    {foreach $ant_presentation as $row}
                    <option value="{$row->id}" {if $aUs->ant_presentation == $row->id}selected{/if}>{$row->name}</option>
                    {/foreach}
                    <option value="-2" class="deleteoptincompo">Delete</option>
                </select>
            </td>
            <td>
                <select  class="form-control ant_liquor updateElement" name="ant_liquor"
                         data-colName="ant_liquor" data-id="{$aUs->id}"  
                         data-tableName="mainantenentalus"   id="ant_liquor{$aUs->id}" >
                    <option value=""></option>
                    {foreach $ant_liquor as $row}
                    <option value="{$row->id}" {if $aUs->ant_liquor == $row->id}selected{/if}>{$row->name}</option>
                    {/foreach}
                    <option value="-2" class="deleteoptincompo">Delete</option>
                </select>
            </td>
            <td>
                <input type="text" class="form-control updateElement" placeholder="BPD" 
                       data-colName="bpd" data-id="{$aUs->id}"  data-tableName="mainantenentalus" value="{$aUs->bpd}">
            </td>
            <td>
                <input type="text" class="form-control updateElement" placeholder="FL" 
                       data-colName="fl" data-id="{$aUs->id}"  data-tableName="mainantenentalus" 
                       value="{$aUs->fl}">
            </td>
            <td>
                <input type="text" class="form-control updateElement" placeholder="AC" 
                       data-colName="ac" data-id="{$aUs->id}"  data-tableName="mainantenentalus" 
                       value="{$aUs->ac}">
            </td>
            <td>
                <input type="text" class="form-control updateElement" placeholder="EFW" 
                       data-colName="efw" data-id="{$aUs->id}"  data-tableName="mainantenentalus" 
                       value="{$aUs->efw}"> gm
            </td>
            {/if}

            <td>
                <input type="text" class="form-control updateElement amrpop" placeholder="Notes" 
                       data-colName="notes" data-id="{$aUs->id}"  data-tableName="mainantenentalus" 
                       value="{$aUs->notes}">
            </td>
            <td>
                <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$aUs->id}" 
                   style=" float: left;" href="#" data-link="antenalvisit" data-fn="delantus">
                    <i class="fa fa-close"></i>
                </a>
            </td>
            {if $ProgramesettingData->displaydoctorname eq 1}
            <td class="bold"> {$aUs->doctorname} </td>
            {/if}
        </tr>
    </tbody>
</table>

<!----------------------------------------------------------------------------------------------------------------------------------------------------->
{else if $type == "drug"}
<tr>
    <td>
        <select class="form-control xx dcat " id="dcat{$itr}" name="dcat{$itr}"  data-itr="{$itr}"  data-placeholder="Select..."  >
            <option value="">Choose Category</option>
            {foreach $allDrugcats as $cat}
            <option value="{$cat['drugcat']}">{$cat['drugcat']}</option>
            {/foreach}
        </select>
    </td>
    <td>
        <select class="form-control xx dname updateElement" id="dname{$itr}" data-createNew="0" data-id="{$gynaDrug->id}" data-colName="drugid" data-tableName="mainantenentaldrugs" data-itr="{$itr}" data-placeholder="Select..."  >
            <option value="">Choose Drug</option>
            {foreach $drugs as $drug}
            <option value="{$drug['id']}">{$drug['drugname']} </option>
            {/foreach}
        </select>
    </td>
    <td>
        <select class="form-control xx dtype updateElement" id="dtype{$itr}" data-id="{$gynaDrug->id}" data-colName="drugtype" data-tableName="mainantenentaldrugs" data-itr="{$itr}" data-placeholder="Select..."  >
            <option value="">Choose Form</option>
            {foreach $allDrugTypes as $type}
            <option value="{$type['drugtype']}">{$type['drugtype']}</option>
            {/foreach}
        </select>
    </td>
    <td>
        <select class="form-control xx ddos updateElement" id="ddos{$itr}" data-id="{$gynaDrug->id}" data-colName="drugdos" data-tableName="mainantenentaldrugs" data-itr="{$itr}" data-placeholder="Select..."  >
            <option value="">choose dose </option>
            {foreach $allDrugDoses as $dos}
            <option value="{$dos['drugdos']}">{$dos['drugdos']}</option>
            {/foreach}
        </select>
    </td>
    {if $programSettingData->presquantity eq 1}
    <td id="drugQuantity{$itr}">
        -                                                            
    </td>
    {/if}
    <td>
        <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$gynaDrug->id}" style=" float: left;" href="#" data-link="antenalvisit" data-fn="addprescription">
            <i class="fa fa-close"></i>
        </a>
    </td>
</tr>

<!----------------------------------------------------------------------------------------------------------------------------------------------------->
{/if}





{literal}
<script type="text/javascript" >
    var itr = $('#drugItr').val();
    if ($().select2)
    {
        $('#dcat' + itr).select2({placeholder: "Select", allowClear: true});
        $('#dname' + itr).select2({placeholder: "Select", allowClear: true});
        $('#dtype' + itr).select2({placeholder: "Select", allowClear: true});
        $('#ddos' + itr).select2({placeholder: "Select", allowClear: true});
    }

    $('.datepickertoday').datepicker('setDate', '+0');
    $(".datepicker").datepicker({
        todayBtn: "linked",
        autoclose: true,
        todayHighlight: true,
        format: 'yy-mm-dd',
        isRTL: true
    });
</script>
{/literal}
