
<input type="hidden" id="controllName" value="operativedetails"/>
<input type="hidden" id="patientid" name="patientid" value="{$patientid}"/>
<input type="hidden" id="colName" name="colName" value="{$colName}"/>
<input type="hidden" id="mainId" name="mainId" value="{$mainId}"/>
<input type="hidden" id="tablename" name="tablename" value="{$maintableName}"/>
{assign var = c value = 0}
{*if $maintableName eq "anasthesa" || ($maintableName eq "generalanasthesa" && $anathessid eq 1) || ($maintableName eq "midlinejncision" && $anathessid eq 1) || ($maintableName eq "midlinejncision" && $anathessid eq 2)|| ($maintableName eq "midlinejncision" && $anathessid eq 3)*}
{if $maintableName eq "anasthesa"}
{assign var = c value = $c + 2}
{*else if $maintableName eq "generalanasthesa" && $anathessid eq 2*}
{*assign var = c value = $c + 4*}
{else if $maintableName eq "jncision"}
{assign var = c value = $c + 3}
{/if}


<button type="button" class="btn btn-xs blue fright" id="addnewRow"><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='{$mydata->name}' >


        </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 deleteElementmodel" data-id="{$mydata->id}" data-tableName="{$maintableName}" >
                <i class="fa fa-times" ></i>
            </a>
            {/if}
        </td>
    </tr>

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

</table>

