<meta charset="utf8">
<style>
    #mainDiv 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" id="gprinModel">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-user"></i>الفحص المبدئي للمرضى المعرضين للسقوط
                        </div>
                        <div class="actions">
                            {if isset($is_add)}
                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=complete_one&&show={$show}&&patientid={$patientId}&&id={$falling_sheet.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=falling_show&&patientid={$patientId}"
                                class="btn btn-default btn-sm">
                                Show </a>

                            <a class="btn btn-default btn-sm assessmentFormPrint" data-id="{$falling_sheet.id}"
                                data-fn="falling_print">
                                <i class="fa fa-print"></i> </a>
                        </div>
                    </div>
                    <div class="portlet-body all rtl">
                        <!---======================================================== tab1============================================================================================ ----->
                        <div class="row">
                            <div id="mainDiv">
                                <div class="row">
                                    <div class="portlet-body form">
                                        <form>
                                            <div class="form-body">
                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds12"> التاريخ </th>
                                                            <td>
                                                                <input type="text"
                                                                    class="form-control  datepicker updateElement"
                                                                    data-colName="sheet_date"
                                                                    value="{$falling_sheet.sheet_date}"
                                                                    data-tableName="falling_sheet"
                                                                    data-id="{$falling_sheet.id}" />
                                                            </td>
                                                            <th class="wds12">ملاحظات</th>
                                                            <td><textarea class="form-control updateElement amrpop"
                                                                    rows="2" placeholder="Enter more text"
                                                                    data-colName="notes" data-id="{$falling_sheet.id}"
                                                                    data-tableName="falling_sheet">
                                                            {$falling_sheet.notes}
                                                        </textarea></td>
                                                        </tr>
                                                    </thead>
                                                </table>
                                                <div class="clearfix"></div>
                                                <hr>

                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds10">م</th>
                                                            <th> تصنيف المسح المبدئي</th>
                                                            <th>نعم</th>
                                                            <th>لا</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        <tr>
                                                            <th>1</th>
                                                            <td>عدم اتزان الحركة</td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="no_balance_yes" name="no_balance"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="no_balance_yes"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.no_balance_yes eq 1}checked{/if} />
                                                            </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="no_balance_no" name="no_balance"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="no_balance_no"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.no_balance_no eq 1}checked{/if} />
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>2</th>
                                                            <td>استخدام اجهزة مساعدة للحركة </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="helping_kit_yes" name="helping_kit"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="helping_kit_yes"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.helping_kit_yes eq 1}checked{/if} />
                                                            </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="helping_kit_no" name="helping_kit"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="helping_kit_no"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.helping_kit_no eq 1}checked{/if} />
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>3</th>
                                                            <td>تناول أدوية تؤثر على الاتزان (أدوية مخدرة-أدوية
                                                                نفسية-أدوية مهدئة)</td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="affecting_drugs_yes" name="affecting_drugs"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="affecting_drugs_yes"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.affecting_drugs_yes eq
                                                                    1}checked{/if} />
                                                            </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="affecting_drugs_no" name="affecting_drugs"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="affecting_drugs_no"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.affecting_drugs_no eq
                                                                    1}checked{/if} />
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>4</th>
                                                            <td>ضعف عام</td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="general_weakness_yes" name="general_weakness"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="general_weakness_yes"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.general_weakness_yes eq
                                                                    1}checked{/if} />
                                                            </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="general_weakness_no" name="general_weakness"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="general_weakness_no"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.general_weakness_no eq
                                                                    1}checked{/if} />
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>5</th>
                                                            <td>ضعف السمع أو النظر</td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="hear_sight_defect_yes" name="hear_sight_defect"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="hear_sight_defect_yes"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.hear_sight_defect_yes eq
                                                                    1}checked{/if} />
                                                            </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="hear_sight_defect_no" name="hear_sight_defect"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="hear_sight_defect_no"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.hear_sight_defect_no eq
                                                                    1}checked{/if} />
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>6</th>
                                                            <td>السن(70)سنة أو أكثر</td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="old_age_yes" name="old_age"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="old_age_yes"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.old_age_yes eq 1}checked{/if} />
                                                            </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="old_age_no" name="old_age"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="old_age_no"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.old_age_no eq 1}checked{/if} />
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <th>7</th>
                                                            <td>طفل اقل من 6 سنوات </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="child_yes" name="child"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="child_yes"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.child_yes eq 1}checked{/if} />
                                                            </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="child_no" name="child"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="child_no"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.child_no eq 1}checked{/if} />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <th colspan="4">تصنيف المسح المبدئي للأمراض التنفسية المعدية
                                                            </th>
                                                        </tr>

                                                        <tr>
                                                            <th>1</th>
                                                            <td>هل يعاني المريض من أعراض تنفسية حادة(سعال-ضيق
                                                                تنفس-ارتفاع درجة الحرارة-فقدان حاسة الشم والتذوق-فقدان
                                                                في الشهية-ضعف عام-قيئ اسهال)</td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="breathing_issues_yes" name="breathing_issues"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="breathing_issues_yes"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.breathing_issues_yes eq
                                                                    1}checked{/if} />
                                                            </td>
                                                            <td>
                                                                <input type="checkbox" class="md-check updateCheckbox"
                                                                    id="breathing_issues_no" name="breathing_issues"
                                                                    data-tableName="falling_sheet"
                                                                    data-colName="breathing_issues_no"
                                                                    data-id="{$falling_sheet.id}" {if
                                                                    $falling_sheet.breathing_issues_no eq
                                                                    1}checked{/if} />
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="clearfix"></div>
<div id="vvv"></div>
<input type="hidden" id="controllName" value="{$controllname}">
<input type="hidden" id="patientId" value="{$patientid}" />

<div id="forPrint"></div>
<!----#########################################################################  model ##############################################################################################################--->
<div class="all">
    <!--------------------------------------------------------------------------- add Present History Model-------------------------------------------------------------------------------------->
    <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="addpresentHistoryName wds95" id="presentHistoryName"
                                            data-select="" data-tablename="" data-id="" data-mainTable="" 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>
    <!--------------------------------------------------------------------------- edit Present History  Model-------------------------------------------------------------------------------------->
    <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="" id="" method="post" class="form-horizontal  emptyform">
                            <div class="form-body">
                                <!------===========================================------->
                                <div class="form-group">
                                    <label class="col-md-1 control-label"> </label>
                                    <div class="col-md-10">
                                        <div id="alldatadiv" class=""> </div>
                                    </div>
                                    <label class="col-md-1 control-label"> </label>
                                </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>
<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>