

<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}"/>


<button type="button" class="btn btn-xs blue fright" id="addnewRow" data-selectClass="{$tableName}" 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"  id="newitem_name" data-id="{$mydata->id}" name="newamount_name" value='{if $tableName eq freezingmedia}{$mydata->media} {else if $tableName eq freezingprotocol} {$mydata->protocol}{/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>

