

<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="addnewRowEmb" 
        data-selectClass="{if $tableName eq 'stage'}selectStage
        {else if $tableName eq 'grade'}selectGrade
        {else if $tableName eq 'embryo_emb'}selectEmb
        {else if $tableName eq 'embryo_result'}selectRes
        {else if $tableName eq 'embryo_lot_select'}selectLotSelect
        {else if $tableName eq 'embryo_catheter_select'}selectCatherSelect
        {else if $tableName eq 'embryo_device'}selectDevice
        {else if $tableName eq 'embryo_tank'}selectTank
        {else if $tableName eq 'embryo_kit_type'}selectKitType
        {else if $tableName eq 'varic_select'}varicSelect
        {else if $tableName eq 'asp_select'}aspSelect
        {else if $tableName eq 'tb_select'}tbSelect
        {else if $tableName eq 'mtb_select'}mtbSelect
        {else if $tableName eq 'treatprotocol'}treatProtocol 
        {else if $tableName eq 'sperum_source'}selectSpSource
        {else if $tableName eq 'semen_process'}selectSemenProcess
        {else if $tableName eq 'growthmedia'}growthmedia
        {else if $tableName eq 'growthoil'}growthoil
        {else if $tableName eq 'growthincubator'}growthincubator
        {else if $tableName eq 'cancel_reason'}selectCancelReason
        {else}selectTable{/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 class="wds10">Delete</th>
        </tr>
    </thead>
    {assign var=i value=1}
    {foreach $alldata as $mydata}
    <tr>
        <td>
            <input type="text" class="form-control"  id="newitem_name" data-id="{$mydata->id}" 
                   name="newamount_name" 
                   value='{if $tableName eq stage}{$mydata->stage} {else if $tableName eq grade} {$mydata->grade}{else}{$mydata->name}{/if}'>
        </td>
        <td>
            <a href="#" class="btn  btn-xs red  deleteModalEmb wds100"  data-id="{$mydata->id}" 
               data-tableName="{$tableName}" > <i class="fa fa-times" ></i>
            </a>

        </td>
    </tr>

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

</table>

<input type="hidden" id="embryoslab" value="1">
