
{if $type == "usantenatal"}
<tr>
    <td>
        <input type="checkbox" class="usPrint" id="usPrint{$aUs->id}"  name="pic[]"  value="{$aUs->id}"/>
    </td>
    <td>{$itr}</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: 18px;" {else} style="color: maroon; font-weight : bolder; font-size: 18px;" {/if}>{$aUs->w}</label>
    </td>
    <td>
        <input type="text" class="form-control updateElement" placeholder="N" data-colName="nga" data-id="{$aUs->id}"  data-tableName="mainantenentalus" value="{$aUs->nga}">
    </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>
    <td>
        <input type="text" class="form-control updateElement" placeholder="FHR" data-colName="fhr" data-id="{$aUs->id}"  data-tableName="mainantenentalus" value="{$aUs->fhr}">
    </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="Placenta" data-colName="placenta" data-id="{$aUs->id}"  data-tableName="mainantenentalus" value="{$aUs->placenta}">
    </td>
    <td>
        <input type="text" class="form-control updateElement" placeholder="AI" data-colName="ai" data-id="{$aUs->id}"  data-tableName="mainantenentalus" value="{$aUs->ai}">
    </td>
    <td>
        <input type="text" class="form-control updateElement" placeholder="FWT" data-colName="fwt" data-id="{$aUs->id}"  data-tableName="mainantenentalus" value="{$aUs->fwt}">
    </td>
    <td>
        <input type="text" class="form-control updateElement" 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>
<!----------------------------------------------------------------------------------------------------------------------------------------------------->
{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']} {if $programSettingData->visitsform eq 3}(left {$drug['currentbalance']}){/if}</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>

    <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}
