<input type="hidden" id="investigationPage" value="1"/>
<input type="hidden" id="phpasthxitr" value="{$phpasthxcount}">
<table>
    <caption>Past hx. Of testicular biobsy</caption>
    <tbody>
    <th class="wds15">Past hx 
        <button type="button" class="btn btn-xs blue"  id="addPhpasthx" data-table="phpasthx"  data-summary="1">
            <i class="fa fa-plus"></i> </button>
    </th>
    <td> 
        <table>
            <tr>
                <th class="wds45">Type </th>
                <th> Note</th>
                <th class="wds5"> </th>
            </tr>
        </table>
        <table  id="phpasthxDiv">
            {assign var=i value=1}
            {foreach $phpasthx as $data}
            <tr>
                <td class="wds45"> 
                    <select  class="form-control  pasthx_type updateElement allupdateselect" data-val="" id="pasthx_type{$i}" data-itr="{$i}" select-tableName="phpasthxtypes"  name="pasthx_type" data-colName="pasthx_type" data-id="{$data->id}" data-tableName="phpasthx" >
                        <option value="">choose</option>
                        {foreach  $phpasthx_types as $value}
                        <option value="{$value->id}" {if {$data->pasthx_type} eq  {$value->id} } selected {/if}  >{$value->name} </option>
                        {/foreach}
                        <option value="-2" class="deleteoptincompo">Delete</option>
                    </select>
                </td>
                <td>
                    <input type="text" class="amrpop form-control updateElement" id="pasthxnote{$i}" 
                           placeholder="Note" name="pasthxnote" data-colName="pasthxnote" value="{$data->pasthxnote}"   
                           data-id="{$data->id}" data-tableName="phpasthx"/>

                </td>
                <td class="wds5">
                    <a class="btn grey-cascade btn-xs deletemsgEX2" data-id="{$data->id}" 
                       data-link="{$controllname}"  data-fn="del" data-tableName="phpasthx" data-colName="del">
                        <i class="fa fa-times"></i> </a>
                </td>
            </tr>
            {capture assign=i}{$i+1}{/capture}
            {/foreach}
        </table>
    </td>
</tbody>
</table>