<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>Pre-Anaesthetic Record
                        </div>
                        <div class="actions">
                            {if isset($is_add)}
                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=complete_one&&show={$show}&&patientid={$patientId}&&id={$pre_anaesthetic.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=pre_show&&patientid={$patientId}" 
                               class="btn btn-default btn-sm">
                                Show </a>

                            <a class="btn btn-default btn-sm prePrint" data-id="{$pre_anaesthetic.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"/>
                                    <input type="hidden" id="updateD" value="1"/>
                                    <div class="portlet-body form">
                                        <form>
                                            <div class="form-body">

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds17">      Wt    </th>
                                                            <td>
                                                                <div class="input-group">
                                                                    <input type="text" class="form-control " disabled     value="{$exmination->weight}"  />
                                                                    <span class="input-group-addon">  KG</span>
                                                                </div>
                                                            </td>

                                                            <th class="wds12">      Ht   </th>
                                                            <td>
                                                                <div class="input-group">
                                                                    <input type="text" class="form-control " disabled   value="{$exmination->height}"  />
                                                                    <span class="input-group-addon">  M</span>
                                                                </div>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>       Diagnosis   </th>
                                                            <td colspan="3">
                                                                {$pre_diagnoses}
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>       Proposed Operation   </th>
                                                            <td colspan="3">
                                                                {$operations}
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      History   </th>
                                                            <td colspan="3">
                                                                <select multiple="" size="1" class="form-control select2me pre_history updateDiagnosis"
                                                                        id="pre_history"   data-id="{$pre_anaesthetic.id}" data-colName="pre_history" 
                                                                        data-tableName="pre_anaesthetic">
                                                                    <option value="">choose</option>
                                                                    {foreach  $pre_history as $data}
                                                                    <option value="{$data.id}" {if $data.id|in_array:$pre_anaesthetic.pre_history} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                    <option value="-1" class="addDiagnosis">Add</option>
                                                                    <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-12">
                                                    <span class="caption-subject bold uppercase">  Drug Therapy before surgery : </span>
                                                    <a class="btn btn-success btn-sm fright" data-id="{$pre_anaesthetic.id}" id="DrugTherapyAdd">
                                                        <i class="fa fa-plus"></i> </a>
                                                </div>

                                                <div class="clearfix"></div>
                                                <input type="hidden" id="DrugTherapyItr" value="{$drug_therapyCount}"/>
                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds5">      No    </th>
                                                            <th class="wds31">      Drug    </th>
                                                            <th class="wds31">      Dose   </th>
                                                            <th class="wds33">      Duration   </th>
                                                        </tr>
                                                    </thead>
                                                    <tbody id="DrugTherapyDiv">
                                                        {assign var=m value=1}
                                                        {foreach $drug_therapy as $drug}
                                                        <tr>
                                                            <td>{$m}</td>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="drug"   value="{$drug.drug}"  
                                                                       data-tableName="drug_therapy"  data-id="{$drug.id}"/>
                                                            </td>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="dose"   value="{$drug.dose}"  
                                                                       data-tableName="drug_therapy"  data-id="{$drug.id}"/>
                                                            </td>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="duration"   value="{$drug.duration}"  
                                                                       data-tableName="drug_therapy"  data-id="{$drug.id}"/>
                                                            </td>
                                                        </tr>
                                                        {capture assign=m}{$m+1}{/capture}
                                                        {/foreach}
                                                    </tbody>
                                                </table>

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

                                                <div class="caption font-green-haze col-md-6">
                                                    <span class="caption-subject bold uppercase">  Physical Examination : </span>
                                                </div>

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

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds17">      General Condition    </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="general_cond"   value="{$pre_anaesthetic.general_cond}"  
                                                                       data-tableName="pre_anaesthetic"  data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                            <th class="wds17">      Airway Assessment   </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="airway"   value="{$pre_anaesthetic.airway}"  
                                                                       data-tableName="pre_anaesthetic"  data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

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

                                                <table>
                                                    <tr>
                                                        <th class="wds17">      Blood Pressure    </th>
                                                        <td>
                                                            <div class="input-group">
                                                                <input type="text" class="form-control  bp_mask txtc" disabled  value="{$exmination->b_p}"/>
                                                                <span class="input-group-addon">mmHg</span>
                                                            </div>
                                                        </td>

                                                        <th class="wds15">      Heart Rate   </th>
                                                        <td>
                                                            <div class="input-group">
                                                                <input type="text" class="form-control " disabled   value="{$exmination->pulse}"  />
                                                                <span class="input-group-addon">/min</span>
                                                            </div>
                                                        </td>

                                                        <th class="wds15">     Temperature   </th>
                                                        <td>
                                                            <div class="input-group">
                                                                <input type="text" class="form-control " disabled   value="{$exmination->temp}"  />
                                                                <span class="input-group-addon">  </span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>


                                                <table>
                                                    <tr>
                                                        <th class="wds17">      Chest and heart    </th>
                                                        <td>
                                                            {$exmination->chestandheart}
                                                        </td>

                                                        <th class="wds15">      Abdomen   </th>
                                                        <td>
                                                            {$exmination->abdomen}
                                                        </td>

                                                        <th class="wds15">        </th>
                                                        <td>
                                                            <div class="input-group">

                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>


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

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


                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds17">      ECG    </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="ecg" 
                                                                       value="{$pre_anaesthetic.ecg}"  data-tableName="pre_anaesthetic" 
                                                                       data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th class="wds17">      Chest X-ray    </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="chest_xray" 
                                                                       value="{$pre_anaesthetic.chest_xray}"  data-tableName="pre_anaesthetic" 
                                                                       data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <th class="wds17">      Abdomen  Ultra sound   </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="abdomen_ultra" 
                                                                       value="{$pre_anaesthetic.abdomen_ultra}"  data-tableName="pre_anaesthetic" 
                                                                       data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th class="wds17">      Echocardiography    </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="echo" 
                                                                       value="{$pre_anaesthetic.echo}"  data-tableName="pre_anaesthetic" 
                                                                       data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th class="wds17">      Angiography    </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="angiography" 
                                                                       value="{$pre_anaesthetic.angiography}"  data-tableName="pre_anaesthetic" 
                                                                       data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th class="wds17">      Carotid Duplex    </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="carotid_duplex" 
                                                                       value="{$pre_anaesthetic.carotid_duplex}"  data-tableName="pre_anaesthetic" 
                                                                       data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th class="wds17">      Radial Duplex    </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="radial_duplex" 
                                                                       value="{$pre_anaesthetic.radial_duplex}"  data-tableName="pre_anaesthetic" 
                                                                       data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <th class="wds17">      Comments    </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="comments" 
                                                                       value="{$pre_anaesthetic.comments}"  data-tableName="pre_anaesthetic" 
                                                                       data-id="{$pre_anaesthetic.id}"/>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>
                                                <div class="clearfix"></div>
                                                <hr>

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th>
                                                                The patient is safe candidate for anaesthesia type : 
                                                            </th>
                                                            <td>

                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="anaesthesia_type" 
                                                                       value="{$pre_anaesthetic.anaesthesia_type}"  data-tableName="pre_anaesthetic" 
                                                                       data-id="{$pre_anaesthetic.id}"/>
                                                            </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 class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" aria-hidden="false"  id="add_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"> Add New </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <form action="" id="" method="post" class="form-horizontal  emptyform" >
                        <div class="form-body">
                            <!------===========================================------->
                            <div class="form-group">
                                <div class="col-md-1"></div>
                                <label class="col-md-3 control-label txtl"> Name </label>
                                <div class="col-md-8">
                                    <input type="text" class="addDiagnosisName wds95" id="diagnosisName" data-select="" data-tablename="" data-id="" value="">
                                </div>
                            </div>

                            <!------===========================================------->
                            <div class="modal-footer">
                                <button type="button" id="amountcloseinput"   class="btn default" data-dismiss="modal">Close</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
    </div>
</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>