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

                            <a class="btn btn-default btn-sm opFormPrint" data-id="{$operation_form.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="wds12">      Date   </th>
                                                            <td>
                                                                <input type="text" class="form-control  datepicker updateElement"   
                                                                       data-colName="op_date" 
                                                                       value="{$operation_form.op_date}"  data-tableName="operation_form" 
                                                                       data-id="{$operation_form.id}"/>
                                                            </td>

                                                            <th class="wds15">      Start of anasthesa   </th>
                                                            <td>
                                                                <input type="text" class="form-control  notPop   timepicker1 updateElement"   
                                                                       data-colName="anasthesa_start" 
                                                                       value="{$operation_form.anasthesa_start}"  data-tableName="operation_form" 
                                                                       data-id="{$operation_form.id}"/>
                                                            </td>

                                                            <th class="wds15">      End of anasthesa  </th>
                                                            <td>
                                                                <input type="text" class="form-control  notPop   timepicker1 updateElement"   
                                                                       data-colName="anasthesa_end" 
                                                                       value="{$operation_form.anasthesa_end}"  data-tableName="operation_form" 
                                                                       data-id="{$operation_form.id}"/>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      OR Num   </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="or_num" 
                                                                       value="{$operation_form.or_num}"  data-tableName="operation_form" 
                                                                       data-id="{$operation_form.id}"/>
                                                            </td>
                                                            <th>      OR Nurse   </th>
                                                            <td>
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="or_nurse" 
                                                                       value="{$operation_form.or_nurse}"  data-tableName="operation_form" 
                                                                       data-id="{$operation_form.id}"/>
                                                            </td>
                                                            <th>      Operation Category   </th>
                                                            <td>
                                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                                    <div class="md-radio-inline ltr">
                                                                        <div class="md-radio">
                                                                            <input type="radio" id="category1" 
                                                                                   name="category"
                                                                                   class="md-radiobtn updateElement"  data-id="{$operation_form.id}"     value="1"   
                                                                                   data-colName="category" data-tableName="operation_form"   
                                                                                   {if $operation_form.category == 1} checked  {/if}>
                                                                            <label for="category1">
                                                                                <span></span>
                                                                                <span class="check"></span>
                                                                                <span class="box"></span>
                                                                                Elective       </label>
                                                                        </div>
                                                                        <div class="md-radio">
                                                                            <input type="radio" id="category2" 
                                                                                   name="category"
                                                                                   class="md-radiobtn updateElement"  data-id="{$operation_form.id}"     value="2"
                                                                                   data-colName="category" data-tableName="operation_form" 
                                                                                   {if $operation_form.category == 2}checked  {/if}   >
                                                                            <label for="category2">
                                                                                <span></span>
                                                                                <span class="check"></span>
                                                                                <span class="box"></span>
                                                                                Emergency  </label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Surgeon   </th>
                                                            <td>
                                                                <select class="form-control select2me  updateMultiSelect "  id="surgeon"   
                                                                        data-placeholder="Select..." data-id="{$operation_form.id}" multiple  
                                                                        data-colName="surgeon" data-tableName="operation_form">
                                                                    <option></option>
                                                                    {foreach  $doctors as $data}
                                                                    <option value="{$data.user_id}" {if $data.user_id|in_array:$operation_form.surgeon} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                </select>
                                                            </td>
                                                            <th>      Assistant   </th>
                                                            <td>
                                                                <select class="form-control select2me  updateMultiSelect "  id="assistant"   
                                                                        data-placeholder="Select..." data-id="{$operation_form.id}" multiple  
                                                                        data-colName="assistant" data-tableName="operation_form">
                                                                    <option></option>
                                                                    {foreach  $doctors as $data}
                                                                    <option value="{$data.user_id}" {if $data.user_id|in_array:$operation_form.assistant} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                </select>
                                                            </td>
                                                            <th>      Anaesthesiologist   </th>
                                                            <td>
                                                                <select class="form-control select2me  updateMultiSelect "  id="anasthesiologist"   
                                                                        data-placeholder="Select..." data-id="{$operation_form.id}" multiple  
                                                                        data-colName="anasthesiologist" data-tableName="operation_form">
                                                                    <option></option>
                                                                    {foreach  $anaesthetists as $data}
                                                                    <option value="{$data.user_id}" {if $data.user_id|in_array:$operation_form.anasthesiologist} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                </select>
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

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

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds15">      Pre-operative diagnosis   </th>
                                                            <td>
                                                                <select class="form-control select2me  updateMultiSelect "  id="pre_diagnoses"   
                                                                        data-placeholder="Select..." data-id="{$operation_form.id}" multiple  
                                                                        data-colName="pre_diagnoses" data-tableName="operation_form">
                                                                    <option></option>
                                                                    {foreach  $preDiags as $data}
                                                                    <option value="{$data.id}" {if $data.id|in_array:$operation_form.pre_diagnoses} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                </select>
                                                            </td>

                                                            <th class="wds10">      Note   </th>
                                                            <td>
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="pre_diagnoses_note" 
                                                                          data-id="{$operation_form.id}"   data-tableName="operation_form" >
                                                                    {$operation_form.pre_diagnoses_note}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Operation  </th>
                                                            <td>
                                                                <select class="form-control select2me  updateMultiSelect "  id="operations"   
                                                                        data-placeholder="Select..." data-id="{$operation_form.id}" multiple  
                                                                        data-colName="operations" data-tableName="operation_form">
                                                                    <option></option>
                                                                    {foreach  $operations as $data}
                                                                    <option value="{$data.id}" {if $data.id|in_array:$operation_form.operations} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                </select>
                                                            </td>

                                                            <th>      Note   </th>
                                                            <td>
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="operations_note" 
                                                                          data-id="{$operation_form.id}"   data-tableName="operation_form" >
                                                                    {$operation_form.operations_note}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Procedure   </th>
                                                            <td colspan="3">
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="procedures" 
                                                                          data-id="{$operation_form.id}"   data-tableName="operation_form" >
                                                                    {$operation_form.procedures}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Operative findings   </th>
                                                            <td colspan="3">
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="findings" 
                                                                          data-id="{$operation_form.id}"   data-tableName="operation_form" >
                                                                    {$operation_form.findings}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Closure   </th>
                                                            <td colspan="3">
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="closure" 
                                                                          data-id="{$operation_form.id}"   data-tableName="operation_form" >
                                                                    {$operation_form.closure}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Complications   </th>
                                                            <td colspan="3">
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="complications" 
                                                                          data-id="{$operation_form.id}"   data-tableName="operation_form" >
                                                                    {$operation_form.complications}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>                   
                                                            <th>      Implementable Devices   </th>
                                                            <td>
                                                                <div  style=" padding-top: 0px;"
                                                                      class="form-group form-md-line-input form-md-floating-label has-info">
                                                                    <div class="md-radio-inline ltr">
                                                                        <div class="md-radio">
                                                                            <input type="radio" id="devices1" 
                                                                                   name="devices"
                                                                                   class="md-radiobtn updateElement devices"  data-id="{$operation_form.id}"     value="1"   
                                                                                   data-colName="devices" data-tableName="operation_form"   
                                                                                   {if $operation_form.devices == 1} checked  {/if}>
                                                                            <label for="devices1">
                                                                                <span></span>
                                                                                <span class="check"></span>
                                                                                <span class="box"></span>
                                                                                Yes       </label>
                                                                        </div>
                                                                        <div class="md-radio">
                                                                            <input type="radio" id="devices0" 
                                                                                   name="devices"
                                                                                   class="md-radiobtn updateElement devices"  data-id="{$operation_form.id}"     value="0"
                                                                                   data-colName="devices" data-tableName="operation_form" 
                                                                                   {if $operation_form.devices != 1}checked  {/if}   >
                                                                            <label for="devices0">
                                                                                <span></span>
                                                                                <span class="check"></span>
                                                                                <span class="box"></span>
                                                                                No  </label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </td>


                                                            <th  {if $operation_form.devices != 1} style="display:none;"  {/if}
                                                                 class="devicesDetails" >      Batch No   </th>
                                                            <td  {if $operation_form.devices != 1} style="display:none;"  {/if}
                                                                 class="devicesDetails" >
                                                                <input type="text" class="form-control   updateElement"   
                                                                       data-colName="batch_no" data-tableName="operation_form" 
                                                                       value="{$operation_form.batch_no}"      data-id="{$operation_form.id}"/>
                                                            </td>
                                                        </tr>

                                                        <tr {if $operation_form.devices != 1} style="display:none;"  {/if}
                                                            class="devicesDetails" >
                                                            <th>      Details   </th>
                                                            <td colspan="3">
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="devices_details" 
                                                                          data-id="{$operation_form.id}"   data-tableName="operation_form" >
                                                                    {$operation_form.devices_details}
                                                                </textarea>
                                                            </td>
                                                        </tr>


                                                        <tr>
                                                            <th>     Post-operative diagnosis  </th>
                                                            <td>
                                                                <select class="form-control post_diagnoses  updateElement "  id="post_diagnoses"   
                                                                        data-placeholder="Select..." data-id="{$operation_form.id}"   
                                                                        data-colName="post_diagnoses" data-tableName="operation_form">
                                                                    <option></option>
                                                                    {foreach  $postDiags as $data}
                                                                    <option value="{$data.id}" {if $data.id == $operation_form.post_diagnoses} selected {/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                                </select>
                                                            </td>
                                                            <th>      Note   </th>
                                                            <td>
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="post_diagnoses_note" 
                                                                          data-id="{$operation_form.id}"   data-tableName="operation_form" >
                                                                    {$operation_form.post_diagnoses_note}
                                                                </textarea>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>      Specimen sent to pathology    </th>
                                                            <td colspan="3">
                                                                <textarea class="form-control updateElement amrpop" rows="2" 
                                                                          placeholder="Enter more text" data-colName="to_pathology" 
                                                                          data-id="{$operation_form.id}"   data-tableName="operation_form" >
                                                                    {$operation_form.to_pathology}
                                                                </textarea>
                                                            </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>