-------------------------------------------------------------------------------------------------------------------------------------->
{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="infertilitydrugs" 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="infertilitydrugs" 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="infertilitydrugs" 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="infertility" 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}
