<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: #c1c1c1;
    }
</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={$entry_data.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=entryp_show&patientid={$patientId}"
                               class="btn btn-default btn-sm">
                                Show </a>

                            <a class="btn btn-default btn-sm assessmentFormPrint" data-id="{$entry_data.id}"
                               data-fn="entryp_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="wds10">رقم الدخول </th>
                                                       <td>
                                                          <input type="text"
                                                                 class="form-control updateElement"    data-tableName="entry_data2"
                                                                 data-colName="entry_no" value="{$entry_data.entry_no}" data-id="{$entry_data.id}" />
                                                       </td>
                                                       <th class="wds10">إسم المريض   </th>
                                                       <td>{$patient.wifename}</td>
                                                       <th class="wds10">تاريخ الدخول </th>
                                                       <td class="wds11">
                                                          <input type="text" class="form-control updateElement datepicker"
                                                                 data-colName="entry_date" value="{$entry_data.entry_date}"
                                                                 data-tableName="entry_data2" data-id="{$entry_data.id}" readonly />
                                                       </td>
                                                    </tr>
                                                 </thead>
                                              </table>

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

                                              <table>
                                                    <thead>
                                                        <tr>
                                                         <th class="wds10"> الإجراء  </th>
                                                           <td>{$entry_data.detName}</td>
                                                           
                                                           <th class="wds10">تابع ل  </th>
                                                           <td>{$entry_data.orgName}</td>

                                                           <th class="wds10"> أ.د /  </th>
                                                           <td>{$entry_data.doctorName}</td> 
                                                        </tr>
                                                    </thead>
                                              </table>

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

                                              <table>
                                                 <caption class="txtc bold" style="background-color: #666;color: white;">  بيانات المريض </caption>
                                                 <thead>
                                                    <tr>
                                                       <th class="wds10">السن     </th>
                                                       <td>{$patAge}</td>

                                                       <th class="wds10">الحالة الإجتماعية      </th>
                                                       <td>{$patient.marriageStatus}</td>
                                                    </tr>

                                                    <tr>
                                                       <th class="wds10">المهنة      </th>
                                                       <td>{$patient.wifeJob}</td>

                                                       <th class="wds10">العنوان      </th>
                                                       <td>{$patient.address}</td>
                                                    </tr>

                                                    <tr>
                                                       <th class="wds10">رقم التليفون      </th>
                                                       <td>{$patient.phone}</td>

                                                       <th class="wds10">الرقم القومى      </th>
                                                       <td>{$patient.wifenationalid}</td>
                                                    </tr>

                                                    <tr>
                                                       <th class="wds10">حول من قبل      </th>
                                                       <td>{$refDr}</td>

                                                       <th class="wds10">دخول سابق      </th>
                                                       <td>{$entryBefore}</td>
                                                    </tr>

                                                 </thead>
                                              </table>


                                              <table>
                                                 <caption class="txtc bold" style="background-color: #666;color: white;">  بيانات المرافق  </caption>
                                                 <thead>
                                                    <tr>
                                                       <th class="wds10">الإسم      </th>
                                                       <td>
                                                          <input type="text" class="form-control updateElement "
                                                                 data-colName="comp_name" value="{$entry_data.comp_name}"
                                                                 data-tableName="entry_data2" data-id="{$entry_data.id}"  />
                                                       </td>
                                                    </tr>
                                                 </thead>
                                              </table>


                                              <table>
                                                 <thead>
                                                    <tr>
                                                       <th  class="wds10">العنوان     </th>
                                                       <td>
                                                          <input type="text" class="form-control updateElement "
                                                                 data-colName="comp_address" value="{$entry_data.comp_address}"
                                                                 data-tableName="entry_data2" data-id="{$entry_data.id}"  />
                                                       </td>

                                                       <th class="wds10">رقم التليفون     </th>
                                                       <td>
                                                          <input type="text" class="form-control updateElement "
                                                                 data-colName="comp_phone" value="{$entry_data.comp_phone}"
                                                                 data-tableName="entry_data2" data-id="{$entry_data.id}"  />
                                                       </td>
                                                    </tr>

                                                    <tr>
                                                       <th >رقم قومى      </th>
                                                       <td>
                                                          <input type="text" class="form-control updateElement "
                                                                 data-colName="comp_national_id" value="{$entry_data.comp_national_id}"
                                                                 data-tableName="entry_data2" data-id="{$entry_data.id}"  />
                                                       </td>
                                                       <th class="wds10">صلة القرابة      </th>
                                                       <td>
                                                          <select class="form-control updateElement entry_relation"    id="entry_relation"
                                                                  data-colName="entry_relation" data-tableName="entry_data2" data-id="{$entry_data.id}"   >
                                                             <option value="">choose</option>
                                                             {foreach  $entry_relations as $single}
                                                             <option value="{$single.id}" {if $entry_data.entry_relation == $single.id } selected {/if} >{$single.name}</option>
                                                             {/foreach}
                                                             <option value="-1" class="deleteoptincompo">تعديل </option>
                                                          </select>
                                                       </td>
                                                    </tr>


                                                 </thead>
                                              </table>

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


                                              <table>
                                                 <thead>
                                                    <tr>
                                                       <th  class="wds10">التشخيص  المبدأى    </th>
                                                       <td>
                                                          <select multiple="" size="1"    class="form-control select2me diagnosis updatePresentHistory"
                                                                  id="diagnosis"  data-id="{$entry_data.id}"    data-colName="diagnosis"
                                                                  data-tableName="entry_data2">
                                                             <option value="">choose</option>
                                                             {foreach $alldiagnosis as $mydiagnosis}
                                                             <option value="{$mydiagnosis->id}" {if $mydiagnosis->
                                                                id|in_array:$entry_data.diagnosis}selected="selected"{/if}>{$mydiagnosis->name}
                                                             </option>
                                                             {/foreach}
                                                             <option value="-1" class="addDiagnosis">Add</option>
                                                             </option>
                                                          </select>
                                                       </td>    

                                                       <th  class="wds10">الطبيب المقيم      </th>
                                                       <td>
                                                          <select class="form-control updateElement select2me"    data-id="{$entry_data.id}" 
                                                                  data-colName="res_doctor" data-tableName="entry_data2"   >
                                                             <option value="">choose</option>
                                                             {foreach  $py_all_doc as $single}
                                                             <option value="{$single.user_id}" {if $entry_data.res_doctor == $single.user_id } selected {/if} >{$single.name}</option>
                                                             {/foreach}
                                                          </select>
                                                       </td>
                                                    </tr>


                                                 </thead>
                                              </table>


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



                                              <table>
                                                 <thead>

                                                    <tr>
                                                       <th class="wds25">ساعة الدخول </th>
                                                       <th class="wds25">تاريخ الخروج   </th>
                                                       <th class="wds25">ساعة الخروج    </th>
                                                       <th class="wds25">مدة الإقامة   </th>
                                                    </tr>


                                                    <tr>
                                                       <td>
                                                          <input type="text" class="form-control updateElement timepicker1 notPop"
                                                                 data-colName="enter_hour" value="{$entry_data.enter_hour}"
                                                                 data-tableName="entry_data2" data-id="{$entry_data.id}" readonly />
                                                       </td>

                                                       <td>
                                                          <input type="text" class="form-control updateElement datepicker notPop"
                                                                 data-colName="exit_date" value="{$entry_data.exit_date}"
                                                                 data-tableName="entry_data2" data-id="{$entry_data.id}" readonly />
                                                       </td>


                                                       <td>
                                                          <input type="text" class="form-control updateElement timepicker1 notPop"
                                                                 data-colName="exit_hour" value="{$entry_data.exit_hour}"
                                                                 data-tableName="entry_data2" data-id="{$entry_data.id}" readonly />
                                                       </td>

                                                       <td>
                                                          <input type="text"
                                                                 class="form-control updateElement"    data-tableName="entry_data2"
                                                                 data-colName="res_period" value="{$entry_data.res_period}" data-id="{$entry_data.id}" />
                                                       </td>
                                                    </tr>

                                                 </thead>
                                              </table>

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


                                              <table>
                                                 <thead>
                                                    <tr>
                                                       <th  class="wds10">الحالة عند الخروج      </th>
                                                       <td>
                                                          <select class="form-control updateElement entry_exit_case"    id="entry_exit_case"
                                                                  data-colName="entry_exit_case" data-tableName="entry_data2" data-id="{$entry_data.id}"   >
                                                             <option value="">choose</option>
                                                             {foreach  $entry_exit_cases as $single}
                                                             <option value="{$single.id}" {if $entry_data.entry_exit_case == $single.id } selected {/if} >{$single.name}</option>
                                                             {/foreach}
                                                             <option value="-1" class="deleteoptincompo">تعديل </option>
                                                          </select>
                                                       </td>

                                                       <th class="wds10">خروج إلى       </th>
                                                       <td>
                                                          <select class="form-control updateElement entry_exit"    id="entry_exit"
                                                                  data-colName="entry_exit" data-tableName="entry_data2" data-id="{$entry_data.id}"   >
                                                             <option value="">choose</option>
                                                             {foreach  $entry_exits as $single}
                                                             <option value="{$single.id}" {if $entry_data.entry_exit == $single.id } selected {/if} >{$single.name}</option>
                                                             {/foreach}
                                                             <option value="-1" class="deleteoptincompo">تعديل </option>
                                                          </select>
                                                       </td>
                                                    </tr>
                                                 </thead>
                                              </table>


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


                                              <table>
                                                 <thead>
                                                    <tr>
                                                       <th  class="wds10">اعتمد الخروج      </th>
                                                       <td>
                                                          <select class="form-control updateElement select2me"    data-id="{$entry_data.id}" 
                                                                  data-colName="exit_confirm" data-tableName="entry_data2"   >
                                                             <option value="">choose</option>
                                                             {foreach  $py_all_doc as $single}
                                                             <option value="{$single.user_id}" {if $entry_data.exit_confirm == $single.user_id } selected {/if} >{$single.name}</option>
                                                             {/foreach}
                                                          </select>
                                                       </td>    

                                                       <th  class="wds10">مدير القسطرة        </th>
                                                       <td>
                                                          <select class="form-control updateElement select2me"    data-id="{$entry_data.id}" 
                                                                  data-colName="cathe_manager" data-tableName="entry_data2"   >
                                                             <option value="">choose</option>
                                                             {foreach  $py_all_doc as $single}
                                                             <option value="{$single.user_id}" {if $entry_data.cathe_manager == $single.user_id } selected {/if} >{$single.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>
    </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 class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" aria-hidden="false"  id="edit_detectionforview">
       <div class="modal-dialog   {if  $programesetting->system_type  == 3}wds70 {else} wds50{/if}">
          <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>
                            <div id="detectionforview" class=""> </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>
<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>