
<div class="portlet box purple">
    <div class="portlet-title">
        <div class="caption">Past History </div>
        <div class="actions"></div>
        <div class="tools">
            <a href="#" class="collapse" title="تصغير / تكبير"></a>
        </div>
    </div>
    <div class="portlet-body">
        <div class="row">
            <div id="ultrasoundgynaDiv">
                <div class="row">
                    <div class="portlet-body form" >
                        <form>
                            <div class="form-body">
                                <input type="hidden" id="pastsurgical_itr" value="{$pastsurgicalcount}"/>
                                <input type="hidden" id="gynecological_itr" value="{$phpastgynecologicalcount}"/>
                                <input type="hidden" id="pastmedical_itr" value="{$phpastmedicalcount}" />

                                <table>
                                    <tbody>
                                        <tr>
                                            <th class="wds15">Medical
                                                <button type="button" class="btn btn-xs blue" id="pastmedical_btn" data-summary="1">
                                                    <i class="fa fa-plus"></i> </button>
                                            </th>
                                            <td> 
                                                <table>
                                                    <tr>
                                                        <th class="wds45">Disease </th>
                                                        <th> Note</th>
                                                        <th class="wds10"> Husband</th>
                                                        <th class="wds5"> </th>
                                                    </tr>
                                                </table>
                                                <table  id="pastmedical_div">
                                                    {assign var=i value=1}
                                                    {foreach $mypastmedical as $myallphpastmedical}
                                                    <tr>
                                                        <td class="wds45">
                                                            <select  class="form-control medicaldisease updateElement allupdateselect" id="medicaldisease{$i}" data-val="{$myallphpastmedical->medicaldisease}" data-itr="{$i}"  name="medicaldisease" data-colName="medicaldisease" select-tableName="phpastmedicaldisease" data-id="{$myallphpastmedical->id}" data-tableName="phpastmedical" >
                                                                <option value="">choose</option>
                                                                {foreach  $allphpastmedicaldisease as $myallphpastmedicaldisease}
                                                                <option value="{$myallphpastmedicaldisease->id}" {if {$myallphpastmedical->medicaldisease} eq  {$myallphpastmedicaldisease->id} } selected {/if}>{$myallphpastmedicaldisease->name} </option>
                                                                {/foreach}
                                                                <option value="-2" class="deleteoptincompo">Delete</option>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <input type="text" class="amrpop form-control updateElement"  
                                                                   name="medicalnote" data-colName="medicalnote" placeholder="Note" 
                                                                   value="{$myallphpastmedical->medicalnote}" 
                                                                   data-id="{$myallphpastmedical->id}" data-tableName="phpastmedical"/>
                                                        </td>
                                                        <td class="wds10">
                                                            <input type="checkbox"   id="for_husband" value="1" class="updateElementCheck" 
                                                                   data-id="{$myallphpastmedical->id}" data-tableName="phpastmedical" 
                                                                   data-colName="for_husband"  
                                                                   {if $myallphpastmedical->for_husband  == 1 } checked {/if}>
                                                        </td>
                                                        <td class="wds5">
                                                            <a class="btn grey-cascade btn-xs deletemsgEX2" data-id="{$myallphpastmedical->id}" 
                                                               data-link="{$controllname}"  data-fn="del" data-tableName="phpastmedical" data-colName="del">
                                                                <i class="fa fa-times"></i> </a>
                                                        </td>
                                                    </tr>
                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th> Surgical 
                                                <button type="button" class="btn btn-xs blue" id="pastsurgical_btn" data-summary="1">
                                                    <i class="fa fa-plus"></i> </button>
                                            </th>
                                            <td> 
                                                <table>
                                                    <tr>
                                                        <th class="wds45">Operation </th>
                                                        <th> Note</th>
                                                        <th class="wds10"> Husband</th>
                                                        <th class="wds5"> </th>
                                                    </tr>
                                                </table>
                                                <table  id="pastsurgical_div">
                                                    {assign var=i value=1}
                                                    {foreach $pastsurgical as $myallpastsurgical}
                                                    <tr>
                                                        <td class="wds45">
                                                            <select  class="form-control surgicaloperation updateElement allupdateselect" id="surgicaloperation{$i}" data-val="{$myallpastsurgical->surgicaloperation}" data-itr="{$i}"  name="surgicaloperation" select-tableName="phpastsurgicaloperation" data-colName="surgicaloperation" data-id="{$myallpastsurgical->id}" data-tableName="phpastsurgical" >
                                                                <option value="">choose</option>
                                                                {foreach  $allphpastsurgicaloperation as $myallphpastsurgicaloperation}
                                                                <option value="{$myallphpastsurgicaloperation->id}" {if {$myallpastsurgical->surgicaloperation} eq  {$myallphpastsurgicaloperation->id} } selected {/if}>{$myallphpastsurgicaloperation->name} </option>
                                                                {/foreach}
                                                                <option value="-2" class="deleteoptincompo">Delete</option>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <input type="text" class="amrpop form-control updateElement" 
                                                                   name="surgicalnote" data-colName="surgicalnote" placeholder="Note" 
                                                                   data-id="{$myallpastsurgical->id}" data-tableName="phpastsurgical" 
                                                                   value="{$myallpastsurgical->surgicalnote}"/>
                                                        </td>
                                                        <td class="wds10">
                                                            <input type="checkbox"   id="for_husband" value="1" class="updateElementCheck" 
                                                                   data-id="{$myallpastsurgical->id}" data-tableName="phpastsurgical"  
                                                                   data-colName="for_husband"   
                                                                   {if $myallpastsurgical->for_husband  == 1 } checked {/if}>
                                                        </td>
                                                        <td class="wds5">
                                                            <a class="btn grey-cascade btn-xs deletemsgEX2" data-id="{$myallpastsurgical->id}" 
                                                               data-link="{$controllname}"  data-fn="del" data-tableName="phpastsurgical" data-colName="del">
                                                                <i class="fa fa-times"></i> </a>
                                                        </td>
                                                    </tr>
                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>Gynecological
                                                <button type="button" class="btn btn-xs blue" id="gynecological_btn" data-summary="1">
                                                    <i class="fa fa-plus"></i> </button>
                                            </th>
                                            <td> 
                                                <table>
                                                    <tr>
                                                        <th class="wds45">Operation </th>
                                                        <th> Note</th>
                                                        <th class="wds5"> </th>
                                                    </tr>
                                                </table>
                                                <table  id="gynecological_div">
                                                    {assign var=i value=1}
                                                    {foreach $phpastgynecological as $myallpastgynecological}
                                                    <tr>
                                                        <td class="wds45">
                                                            <select  class="form-control gynecologicaloperation  updateElement allupdateselect" id="gynecologicaloperation{$i}" data-val="{$myallpastgynecological->gynecologicaloperation}" data-itr="{$i}"  name="gynecologicaloperation" data-colName="gynecologicaloperation" select-tableName="phpastgynecologicaloperation" data-id="{$myallpastgynecological->id}" data-tableName="phpastgynecological" >
                                                                <option value="">choose</option>
                                                                {foreach  $allphpastgynecologicaloperation as $myallphpastgynecologicaloperation}
                                                                <option value="{$myallphpastgynecologicaloperation->id}" {if {$myallpastgynecological->gynecologicaloperation} eq  {$myallphpastgynecologicaloperation->id} } selected {/if}>{$myallphpastgynecologicaloperation->name} </option>
                                                                {/foreach}
                                                                <option value="-2" class="deleteoptincompo">Delete</option>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <input type="text" class="amrpop form-control updateElement" name="gynecologicalnote" 
                                                                   data-colName="gynecologicalnote" placeholder="Note" data-id="{$myallpastgynecological->id}" 
                                                                   data-tableName="phpastgynecological" value="{$myallpastgynecological->gynecologicalnote}"/>
                                                        </td>

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



