<div class="portlet box purple">
    <div class="portlet-title">
        <div class="caption">Obstetric 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">
                                <table>
                                    <thead>
                                        <tr>
                                            <th class="wds2"> G  </th>  
                                            <th class="wds2"> P </th>
                                            <th class="wds2"> AB  </th>  
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <input type="text" class="amrpop form-control updateElement" 
                                                       placeholder=" G " name="g"
                                                       data-colName="g" data-id="{$obstetric_case->id}" 
                                                       data-tableName="obstetric_case" value="{$obstetric_case->g}"/>
                                            </td>
                                            <td>
                                                <input type="text" class="amrpop form-control updateElement" 
                                                       placeholder=" P " name="p"
                                                       data-colName="p" data-id="{$obstetric_case->id}" 
                                                       data-tableName="obstetric_case" value="{$obstetric_case->p}"/>
                                            </td>
                                            <td>
                                                <input type="text" class="amrpop form-control updateElement" 
                                                       placeholder=" AB " name="ab"
                                                       data-colName="ab" data-id="{$obstetric_case->id}" 
                                                       data-tableName="obstetric_case" value="{$obstetric_case->ab}"/>
                                            </td>
                                        </tr>
                                </table>

                                <table>
                                    <caption>           Previous Deliveries        </caption>
                                    <tbody>
                                        <tr>
                                            <th class="wds16"> FTNDs   :   </th>  
                                            <td>
                                                <select id="ftnds{$obstetric_case->id}"  
                                                        class="form-control ftndsSelect updateElement"  data-colName="ftnds"
                                                        data-rowid="{$obstetric_case->id}"  data-id="{$obstetric_case->id}"
                                                        name="ftnds" select-tableName="ftnds"   
                                                        data-tableName="obstetric_case" >
                                                    <option value="">choose</option>
                                                    {foreach  $ftnds as $one}
                                                    <option value="{$one->id}"{if $obstetric_case->ftnds eq $one->id}selected{/if}>{$one->name}</option>
                                                    {/foreach}

                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                </select>
                                            </td>
                                        </tr>

                                        <tr>
                                            <th> Preterm Labors   :   </th>  
                                            <td>
                                                <select id="preterm{$obstetric_case->id}"  
                                                        class="form-control pretermSelect updateElement"  data-colName="preterm"
                                                        data-rowid="{$obstetric_case->id}"  data-id="{$obstetric_case->id}"
                                                        name="preterm" select-tableName="preterm"   
                                                        data-tableName="obstetric_case" >
                                                    <option value="">choose</option>
                                                    {foreach  $preterm as $one}
                                                    <option value="{$one->id}"{if $obstetric_case->preterm eq $one->id}selected{/if}>{$one->name}</option>
                                                    {/foreach}

                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                </select>
                                            </td>
                                        </tr>

                                        <tr>
                                            <th> Still Births   :   </th>  
                                            <td>
                                                <select id="still_birth{$obstetric_case->id}"  
                                                        class="form-control still_birthSelect updateElement"  data-colName="still_birth"
                                                        data-rowid="{$obstetric_case->id}"  data-id="{$obstetric_case->id}"
                                                        name="still_birth" select-tableName="still_birth"   
                                                        data-tableName="obstetric_case" >
                                                    <option value="">choose</option>
                                                    {foreach  $still_birth as $one}
                                                    <option value="{$one->id}"{if $obstetric_case->still_birth eq $one->id}selected{/if}>{$one->name}</option>
                                                    {/foreach}

                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                </select>
                                            </td>
                                        </tr>

                                        <tr>
                                            <th> Difficult Labors   :   </th>  
                                            <td>
                                                <select id="difficults{$obstetric_case->id}"  
                                                        class="form-control difficultsSelect updateElement"  data-colName="difficults"
                                                        data-rowid="{$obstetric_case->id}"  data-id="{$obstetric_case->id}"
                                                        name="difficults" select-tableName="difficults"   
                                                        data-tableName="obstetric_case" >
                                                    <option value="">choose</option>
                                                    {foreach  $difficults as $one}
                                                    <option value="{$one->id}"{if $obstetric_case->difficults eq $one->id}selected{/if}>{$one->name}</option>
                                                    {/foreach}

                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                </select>
                                            </td>
                                        </tr>

                                        <tr>
                                            <th> C.S   :   </th>  
                                            <td>
                                                <select id="cs{$obstetric_case->id}"  
                                                        class="form-control csSelect updateElement"  data-colName="cs"
                                                        data-rowid="{$obstetric_case->id}"  data-id="{$obstetric_case->id}"
                                                        name="cs" select-tableName="cs"   
                                                        data-tableName="obstetric_case" >
                                                    <option value="">choose</option>
                                                    {foreach  $cs as $one}
                                                    <option value="{$one->id}"{if $obstetric_case->cs eq $one->id}selected{/if}>{$one->name}</option>
                                                    {/foreach}

                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th> Date Of Last Delivery  : </th>  
                                            <td>
                                                <input type="text" placeholder="Last Delivery" name="last_delivery"  
                                                       class="form-control updateElement datepicker"  data-colName="last_delivery"  
                                                       data-id="{$obstetric_case->id}" data-tableName="obstetric_case" 
                                                       value="{$obstetric_case->last_delivery}"/>
                                            </td>
                                        </tr>
                                </table>

                                <table>
                                    <caption>           Previous Pregnancies    
                                        <button type="button" class="btn btn-xs blue addNewRow"  
                                                data-tableName="previous_pregnancies" >  <i class="fa fa-plus"></i> </button>
                                    </caption>
                                    <tbody id="previous_pregnanciesContainer">
                                        {foreach $previous_pregnancies as $prev }
                                        <tr>
                                            <td class="wds35">
                                                <div class="col-md-12">
                                                    <div class="col-md-6">
                                                        <div class="md-radio-list">
                                                            <div class="md-radio">
                                                                <input type="radio" id="prev_preg1_{$prev->id}" name="prev_preg{$prev->id}"  
                                                                       class="md-radiobtn sradio updateElement" value="1"  data-id="{$prev->id}"
                                                                       data-colName="prev_preg" data-tableName="previous_pregnancies"
                                                                       {if  $prev->prev_preg == 1 } checked {/if}>
                                                                <label for="prev_preg1_{$prev->id}">
                                                                    <span></span>
                                                                    <span class="check"></span>
                                                                    <span class="box"></span>
                                                                    Not complicated</label>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-6">
                                                        <div class="md-radio-list">
                                                            <div class="md-radio">
                                                                <input type="radio" id="prev_preg2_{$prev->id}" name="prev_preg{$prev->id}" 
                                                                       class="md-radiobtn sradio updateElement" value="2"  data-id="{$prev->id}"
                                                                       data-colName="prev_preg" data-tableName="previous_pregnancies"
                                                                       {if  $prev->prev_preg  == 2 } checked {/if}>
                                                                <label for="prev_preg2_{$prev->id}">
                                                                    <span></span>
                                                                    <span class="check"></span>
                                                                    <span class="box"></span>
                                                                    Complicated  </label>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </td>
                                            <th class="wds11"> Notes   :   </th>  
                                            <td>
                                                <input type="text" class="form-control  updateElement txtc" 
                                                       data-tableName="previous_pregnancies" data-colName="prev_preg_note" data-id="{$prev->id}" 
                                                       value="{$prev->prev_preg_note}"/>
                                            </td>
                                        </tr>
                                        {/foreach}
                                </table>

                                <table>
                                    <caption>           Previous Puerperium      
                                        <button type="button" class="btn btn-xs blue addNewRow"  
                                                data-tableName="previous_puerperium" >  <i class="fa fa-plus"></i> </button>
                                    </caption>
                                    <tbody id="previous_puerperiumContainer">
                                        {foreach $previous_puerperium as $prev }
                                        <tr>
                                            <td class="wds35">
                                                <div class="col-md-12">
                                                    <div class="col-md-6">
                                                        <div class="md-radio-list">
                                                            <div class="md-radio">
                                                                <input type="radio" id="prev_puer1_{$prev->id}" name="prev_puer{$prev->id}"  
                                                                       class="md-radiobtn sradio updateElement" value="1"  data-id="{$prev->id}"
                                                                       data-colName="prev_puer" data-tableName="previous_puerperium"
                                                                       {if  $prev->prev_puer == 1 } checked {/if}>
                                                                <label for="prev_puer1_{$prev->id}">
                                                                    <span></span>
                                                                    <span class="check"></span>
                                                                    <span class="box"></span>
                                                                    Not complicated</label>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-6">
                                                        <div class="md-radio-list">
                                                            <div class="md-radio">
                                                                <input type="radio" id="prev_puer2_{$prev->id}" name="prev_puer{$prev->id}" 
                                                                       class="md-radiobtn sradio updateElement" value="2"  data-id="{$prev->id}"
                                                                       data-colName="prev_puer" data-tableName="previous_puerperium"
                                                                       {if  $prev->prev_puer  == 2 } checked {/if}>
                                                                <label for="prev_puer2_{$prev->id}">
                                                                    <span></span>
                                                                    <span class="check"></span>
                                                                    <span class="box"></span>
                                                                    Complicated  </label>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </td>
                                            <th class="wds11"> Notes   :   </th>  
                                            <td>
                                                <input type="text" class="form-control  updateElement txtc" 
                                                       data-tableName="previous_puerperium" data-colName="prev_puer_note" data-id="{$prev->id}" 
                                                       value="{$prev->prev_puer_note}"/>
                                            </td>
                                        </tr>
                                        {/foreach}
                                </table>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
</div>