<tr>
    <td>
        <select class="form-control  dcat select2me" name="dcat{$itr}" id="dcat{$itr}"  data-placeholder="Select..."  data-itr="{$itr}" >
            <option value="">Choose Category</option>
            {foreach $allDrugcats as $cat}
            <option value="{$cat['drugcat']}" >{$cat['drugcat']}</option>
            {/foreach}
        </select>
    </td>
    <td>
        <select class="form-control  dname select2me " data-createNew="0" name="dname{$itr}"  id="dname{$itr}"  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  dtype select2me " name="dtype{$itr}" id="dtype{$itr}"   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   select2me " name="ddos{$itr}"  id="ddos{$itr}" 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 deletefrow" data-id="" style=" float: left;" >
            <i class="fa fa-close"></i>
        </a>
    </td>
</tr>


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