<tr>
    <td>
        <input type="text" class="form-control  datepicker updateElement" data-colName="drug_date"
            data-tableName="medication_med" data-itr="{$itr}" data-id="{$data->id}" />
    </td>
    <td>
        <input type="text" class="form-control timepicker updateElement" data-colName="drug_time" value=""
            data-tableName="medication_med" data-itr="{$itr}" data-id="{$data->id}" />
    </td>
    <td>
        <select class="form-control xx dname select2me updateElement" id="dname{$itr}" data-id="{$data->id}"
            data-colName="drugid" data-tableName="medication_med" data-itr="{$itr}" data-placeholder="Select...">
            <option value="" {if $data->drugid =="" }selected{/if}>Choose Drug</option>
            {foreach $drugs as $drug}
            <option value="{$drug['id']}">{$drug['drugname']}</option>
            {/foreach}
            <option value="" {if $data->drugid=="" }selected{/if}>Choose Drug</option>
        </select>

    </td>
    <td>
        <input type="text" class="form-control updateElement" data-colName="drug_form" value=""
            data-tableName="medication_med" data-itr="{$itr}" data-id="{$data->id}" />
    </td>
    <td>
        <input type="text" class="form-control updateElement" data-colName="drug_direction" value=""
            data-tableName="medication_med" data-itr="{$itr}" data-id="{$data->id}" />
    </td>
    <td>
        <input type="text" class="form-control timepicker updateElement" data-colName="drug_given_time" value=""
            data-tableName="medication_med" data-itr="{$itr}" data-id="{$data->id}" data-toggle="popover"
            data-trigger="hover" data-placement="bottom" data-content="" data-date-format="HH:ii p" />
    </td>
    <td>
        <input type="text" class="form-control updateElement" data-colName="checked_by" data-tableName="medication_med"
            data-itr="{$itr}" data-id="{$data->id}" />
    </td>
    <td>
        <a class="btn grey-cascade btn-xs deletemsgEX" data-itr="{$itr}" data-id="{$data->id}"
            data-tableName="medication_med" style=" float: left;" href="#" data-link="heart_reports" data-fn="del">
            <i class="fa fa-close"></i>
        </a>
    </td>
</tr>


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