

<input type="hidden" id="patientid" name="patientid" value="{$patientid}"/>
<input type="hidden" id="tablename" name="tableName" value="{$tableName}"/>
<input type="hidden" id="colName" name="colName" value="{$colName}"/>
<input type="hidden" id="data_selectid" name="data_selectid" value="{$data_selectid}"/>


<button type="button" class="btn btn-xs blue fright" id="addnewRowFreez" 
        data-selectClass="{if $tableName eq 'stage'}selectStageFreeze
        {else if $tableName eq 'grade'}selectGradeFreeze
        {else}{$tableName}{/if}"
        data-tableName="{$tableName}"> <i class="fa fa-plus"></i> Add</button>
<table cellspacing="10" width="100%" id="dtAddTbl">
    <thead>
        <tr>
            <th>Name</th>
            <th>Delete</th>
        </tr>
    </thead>
    {assign var=i value=1}
    {foreach $alldata as $mydata}
    <tr>
        <td style="width: 100%">

            <input type="text" class="form-control updateElementSelect"  id="newitem_name" data-id="{$mydata->id}" 
                   name="newamount_name"  data-selectClass="{if $tableName eq 'stage'}selectStageFreeze
                   {else if $tableName eq 'grade'}selectGradeFreeze{else}{$tableName}{/if}" data-select2="yes" 
                   data-colName="{if $tableName eq stage}stage{else if $tableName eq grade}grade{else if $tableName eq kit}kit{else} name {/if}" data-tableName="{$tableName}" 
                   value='{if $tableName eq kit}{$mydata->kit} {else if $tableName eq cathetr} {$mydata->cathetr}{else if $tableName eq device} {$mydata->device}{else if $tableName eq stage} {$mydata->stage}{else if $tableName eq grade} {$mydata->grade}{/if}'>


        </td>
        <td>
            {if $i <= $c}
            <a href="#" class="btn red fleft" >
                <i class="fa fa-question-circle" ></i>
            </a>
            {else}
            <a href="#" class="btn red fleft deleteModal" data-id="{$mydata->id}" data-tableName="{$tableName}" >
                <i class="fa fa-times" ></i>
            </a>
            {/if}
        </td>
    </tr>

    {capture assign=i}{$i+1}{/capture}
    {/foreach}

</table>

