<style>
    table {
        font-family: arial, sans-serif;
        border-collapse: collapse;
        width: 100%;
        table-layout: fixed
    }

    td, th {
        border: 1px solid #000000;
        text-align: center;
        padding: 2px;
    }

    tr:nth-child(even) {
        background-color: #dddddd;
    }
</style>
<div class="page-content-wrapper">
    <div class="page-content">
        <div class="row">
            <div class="col-md-12 clinick invz" id="gprinModel">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-user"></i>Discharge Summary
                        </div>
                        <div class="actions">
                            {if isset($is_add)}
                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=complete_one&&show={$show}&&patientid={$patientId}&&id={$exit_summary.id}&&tname={$tableName}" 
                               class="btn btn-default btn-sm pull-left" style="margin-right: 5px;">
                                save </a>
                            {/if}
                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=exit_show&&patientid={$patientId}" 
                               class="btn btn-default btn-sm">
                                Show </a>

                            <a class="btn btn-default btn-sm exitPrint" data-id="{$exit_summary.id}">
                                <i class="fa fa-print"></i> </a>

                        </div>
                    </div>
                    <div class="portlet-body all">

                        <!---======================================================== tab1============================================================================================ ----->

                        <div class="row">
                            <div id="ultrasoundgynaDiv">

                                <div class="row">
                                    <input type="hidden" id="patient_history" value="1"/>
                                    <div class="portlet-body form">
                                        <form>
                                            <div class="form-body">

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds17">      Consultant Name   </th>
                                                            <td>
                                                                <input type="text" class="form-control " disabled  
                                                                       value="{$exit_summary.visitDoctor}"  />
                                                            </td>

                                                            <th class="wds12">      Date of Admission   </th>
                                                            <td>
                                                                <input type="text" class="form-control  datepicker updateElement"   
                                                                       data-colName="ad_date" 
                                                                       value="{$exit_summary.ad_date}"  data-tableName="exit_summary" 
                                                                       data-id="{$exit_summary.id}"/>
                                                            </td>

                                                            <th class="wds12">      Date of Discharge   </th>
                                                            <td>
                                                                <input type="text" class="form-control  datepicker updateElement"   
                                                                       data-colName="dis_date" 
                                                                       value="{$exit_summary.dis_date}"  data-tableName="exit_summary" 
                                                                       data-id="{$exit_summary.id}"/>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Final Diagnosis   </th>
                                                            <td colspan="5">
                                                                <textarea class="form-control updateElement amrpop" rows="1" 
                                                                          placeholder="Enter more text" data-colName="final_diagnosis" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.final_diagnosis}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Hospital Course  </th>
                                                            <td colspan="5">
                                                                <textarea class="form-control updateElement amrpop" rows="1" 
                                                                          placeholder="Enter more text" data-colName="hospital_course" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.hospital_course}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Investigations   </th>
                                                            <td colspan="5">
                                                                <textarea class="form-control updateElement amrpop" rows="1" 
                                                                          placeholder="Enter more text" data-colName="investigation" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.investigation}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Additional Consulation  </th>
                                                            <td colspan="5">
                                                                <textarea class="form-control updateElement amrpop" rows="1" 
                                                                          placeholder="Enter more text" data-colName="consultation" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.consultation}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Operation / Procedure Done   </th>
                                                            <td colspan="5">
                                                                <textarea class="form-control updateElement amrpop" rows="1" 
                                                                          placeholder="Enter more text" data-colName="op_procedure" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.op_procedure}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Ancillary Services Provided    </th>
                                                            <td colspan="5">
                                                                <textarea class="form-control updateElement amrpop" rows="1" 
                                                                          placeholder="Enter more text" data-colName="servies" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.servies}
                                                                </textarea>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

                                                <div class="clearfix"></div>
                                                <hr>

                                                <div class="caption font-green-haze col-md-6">
                                                    <span class="caption-subject bold uppercase">  Patient's Medications : </span>
                                                </div>

                                                <div class="clearfix"></div>

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds33">      Before admission    </th>
                                                            <th class="wds34">      During hospital admission   </th>
                                                            <th class="wds33">      Upon discharge   </th>
                                                        </tr>

                                                        <tr>
                                                            <td>
                                                                <textarea class="form-control updateElement amrpop" rows="3" 
                                                                          placeholder="Enter more text" data-colName="med_before" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.med_before}
                                                                </textarea>
                                                            </td>

                                                            <td>
                                                                <textarea class="form-control updateElement amrpop" rows="3" 
                                                                          placeholder="Enter more text" data-colName="med_during" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.med_during}
                                                                </textarea>
                                                            </td>

                                                            <td>
                                                                <textarea class="form-control updateElement amrpop" rows="3" 
                                                                          placeholder="Enter more text" data-colName="med_upon" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.med_upon}
                                                                </textarea>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

                                                <div class="clearfix"></div>
                                                <hr>

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds17">      Discharge   </th>
                                                            <td colspan="3">
                                                                <select class="form-control discharge  updateElement "  id="discharge"   
                                                                        data-placeholder="Select..." data-id="{$exit_summary.id}"   
                                                                        data-colName="discharge" data-tableName="exit_summary">
                                                                    <option></option>
                                                                    {foreach  $discharges as $data}
                                                                    <option value="{$data.id}" {if $data.id == $exit_summary.discharge} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                                </select>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Transferred To    </th>
                                                            <td colspan="3">
                                                                <select class="form-control trans_to  updateElement "  id="trans_to"   
                                                                        data-placeholder="Select..." data-id="{$exit_summary.id}"   
                                                                        data-colName="trans_to" data-tableName="exit_summary">
                                                                    <option></option>
                                                                    {foreach  $trans_tos as $data}
                                                                    <option value="{$data.id}" {if $data.id == $exit_summary.trans_to} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                                </select>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

                                                <div class="clearfix"></div>
                                                <hr>

                                                <div class="caption font-green-haze col-md-6">
                                                    <span class="caption-subject bold uppercase">  Discharge & Follow-up Instructions : </span>
                                                </div>

                                                <div class="clearfix"></div>

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds17">      Diet   </th>
                                                            <td>
                                                                <textarea class="form-control updateElement amrpop" rows="1" 
                                                                          placeholder="Enter more text" data-colName="diet" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.diet}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th class="wds17">      Activity   </th>
                                                            <td>
                                                                <textarea class="form-control updateElement amrpop" rows="1" 
                                                                          placeholder="Enter more text" data-colName="activity" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.activity}
                                                                </textarea>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds17">      Follow-up Appointment   </th>
                                                            <td>
                                                                <select class="form-control followup_app  updateElement "  id="followup_app"   
                                                                        data-placeholder="Select..." data-id="{$exit_summary.id}"   
                                                                        data-colName="followup_app" data-tableName="exit_summary">
                                                                    <option></option>
                                                                    {foreach  $followup_apps as $data}
                                                                    <option value="{$data.id}" {if $data.id == $exit_summary.followup_app} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                                </select>
                                                            </td>
                                                            <th class="wds10">      Note   </th>
                                                            <td>
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="followup_app_note" 
                                                                          data-id="{$exit_summary.id}"   data-tableName="exit_summary" >
                                                                    {$exit_summary.followup_app_note}
                                                                </textarea>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds17">      Discharge Physician Name   </th>
                                                            <td>
                                                                <select class="form-control select2me  updateElement "  id="dis_physician"   
                                                                        data-placeholder="Select..." data-id="{$exit_summary.id}"   
                                                                        data-colName="dis_physician" data-tableName="exit_summary">
                                                                    <option></option>
                                                                    {foreach  $doctors as $data}
                                                                    <option value="{$data.user_id}" {if $data.user_id == $exit_summary.dis_physician} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                </select>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>
                                            </div>
                                        </form>
                                    </div>

                                </div>
                                <div class="clearfix"></div>

                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>

            <div class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" aria-hidden="false"  id="edit_model">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                            <h4 class="modal-title"> Edit </h4>
                        </div>
                        <div class="modal-body">
                            <div class="portlet-body form">
                                <form action="" method="post" class="form-horizontal emptyform">
                                    <div class="form-body">
                                        <!------===========================================------->
                                        <div>
                                            <div id="alldatadiv" class=""> </div>
                                        </div>

                                        <!------===========================================------->
                                        <!--                            <div class="form-group">
                                                                        <label class="col-md-3 control-label"> Name</label>
                                                                        <div class="col-md-8">
                                                                            <input type="hidden" class="form-control"  id="newitem_id" name="newamount_id" >
                                                                            <input type="text" class="form-control"  id="newitem_name" name="newamount_name" style="text-align:left;" >
                                                                            <div id="divsucess1" style="color:red; display:none;"></div>
                                                                        </div>
                                                                    </div>-->
                                        <!------===========================================------->
                                        <div class="modal-footer">
                                            <!--                                <button type="button" class="btn green" id="editmodel_submit"> Update </button>-->
                                            <button type="button" id="amountcloseinput"   class="btn default" data-dismiss="modal">Close</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<div class="clearfix"></div>
<div id="vvv"></div>
<input type="hidden" id="controllName" value="{$controllname}">
<div id="forPrint"></div>

<script>




    $(".amrpop,input[type='text']:not(.datepicker):not(.notPop),textarea:not(.notPop)").hover(function () {
        var pop_value = $(this).val();
        $(this).attr({
            "data-toggle": "popover",
            "data-trigger": "hover",
            "data-placement": "bottom",
            "data-content": pop_value
        });
        $(this).popover("show");
    });

</script>