<tr>
    <td>
        <input type="text" class="form-control datepicker" data-id="{$gyna_obj->id}" data-colName="gynadate" data-tableName="gyna" value="{$gyna_obj->gynadate}" readonly />
    </td>
    {if $ProgramesettingData->gynalmp eq 1}
    <td>
        <input type="text" class="form-control datepicker" data-id="{$gyna_obj->id}" data-colName="gynalmp" data-tableName="gyna" value="{$gyna_obj->gynalmp}" readonly />
    </td>
    {/if}
    {if $ProgramesettingData->diagnosshow eq 0}

    <td>
        <!--select2me complaint-->

        <input type="hidden" id="currentid" value="{$gyna_obj->id}"/>
        <select multiple="" class="form-control select2me complaint updateDiagnosis" id="complaint{$gyna_obj->id}" data-id="{$gyna_obj->id}" data-colName="complaintid" data-tableName="gyna">
            <option value="">choose</option>
            {foreach $allcomplaint as $comp}
            <option value="{$comp->id}" {if $gyna_obj->complaintid == $comp->id}selected="selected"{/if}>{$comp->name}</option>
            {/foreach}
            <option value="-1" class="addDiagnosis">Add</option>
            <option value="-2" class="deleteoptincompo">Delete</option>
        </select>

        <!-- <input type="text" class="form-control updateElement" data-id="{$gyna_obj->id}" data-colName="diagnosisid" data-tableName="gyna" value="{$gyna_obj->diagnosisid}"/>  -->
    </td>

    <td>
        <!--select2me diagnosis-->
        <select multiple="" class="form-control select2me diagnosis updateDiagnosis" id="diagnosis{$gyna_obj->id}" data-id="{$gyna_obj->id}" data-colName="diagnosisid" data-tableName="gyna">
            <option value="">choose</option>
            {foreach $alldiagnosis as $mydiagnosis}
            <option value="{$mydiagnosis->id}" {if $gyna_obj->diagnosisid == $mydiagnosis->id}selected="selected"{/if}>{$mydiagnosis->name}</option>
            {/foreach}
            <option value="-1" class="addDiagnosis">Add</option>
            <option value="-2" class="deleteoptincompo">Delete</option>
        </select>

        <!-- <input type="text" class="form-control updateElement" data-id="{$gyna_obj->id}" data-colName="diagnosisid" data-tableName="gyna" value="{$gyna_obj->diagnosisid}"/>  -->
    </td>
    {else}
    <td>
        <input type="text" class="form-control updateElement" data-id="{$gyna_obj->id}" data-colName="complaint" data-tableName="gyna" value="{$gyna_obj->complaint}"/>
    </td>
    {/if}
    <td>
        <textarea class="form-control updateElement txtc" rows="1" data-id="{$gyna_obj->id}" data-colName="notes" data-tableName="gyna" placeholder="Enter more text">{$gyna_obj->notes}</textarea>
    </td>
    <td>
        <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$gyna_obj->id}" style=" float: left;" href="#" data-link="gyna" data-fn="del">
            <i class="fa fa-close"></i>
        </a>
    </td>
</tr>


{literal}
<script type="text/javascript" >
    $('.datepickertoday').datepicker('setDate', '+0');
    $('.datepicker').datepicker();
    var diagnosis_itr = $('#currentid').val();
    $('#currentid').remove();
    $('#diagnosis' + diagnosis_itr).select2({
        width: '270px',
        allowClear: true,
        formatNoMatches: function (term) {
            //return "<input class='form-control' id='newregTerm' value='" + term + "'><a href='#' id='addregnew' data-id=" + diagnosis_itr + " class='btn btn-default'>Add</a>"
        }
    });
    $('#complaint' + diagnosis_itr).select2({
        width: '270px',
        allowClear: true,
        formatNoMatches: function (term) {
            //return "<input class='form-control' id='newregTerm' value='" + term + "'><a href='#' id='addregnew' data-id=" + diagnosis_itr + " class='btn btn-default'>Add</a>"
        }
    });
</script>
{/literal}

