<meta charset="utf8" />
<div class="page-content-wrapper azdata">
    <div class="page-content" >
        <div class="row" {if $hospitalView == 0 } style="display: none;"  {/if}>
            <div class="top-menu" style=" background: #fff; height: 40px; ">
                <ul class="nav navbar-nav pull-right">
                    <!-- BEGIN USER LOGIN DROPDOWN -->
                    <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
                    <li class="dropdown dropdown-user">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" style=" padding: 10px; ">
                            <img alt="" class="img-circle" src="{$path}/_assets/admin/layout/img/avatar3_small.png"  style=" height: 20px; "/>
                            <span class="username username-hide-on-mobile">
                                {$openname}  </span>
                            <i class="fa fa-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-default">
                            <li>
                                <a href="{$hosturl}/controllers/_myprofile.php">
                                    <i class="icon-user"></i> My Profile</a>
                            </li>
                            <li class="divider">
                            </li>
                            <li>
                                <a href="{$hosturl}/controllers/login.php?ac=logout">
                                    <i class="icon-key"></i> Log Out</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>


        <div class="row">
            <div class="col-md-12" style="padding-right: 0px; padding-left: 0px;">
                <div class="portlet box blue">
                    <!--                    <div class="portlet-title" style="height: 5px">
                                            <div class="caption">
                                                <i class="fa fa-edit"></i> Patient History Data
                                            </div>
                                        </div>-->
                    <div class="portlet-body" >     
                        <!-- END PAGE HEADER-->
                        <!-- BEGIN PAGE CONTENT-->

                        <div class="row arabic" style="font-size: 19px;">
                            <div class="aw_xblue">
                                <table class="table table-bordered table-hover table-striped nopdngtbl" style="direction: rtl;margin: 5px 0px;">
                                    <tr>
                                        <td class="txtr"  {if $simpleView == 1}style="font-size: 18px;" {/if}>{if !empty($patientdata.wifetype)}{$patientdata.wifetype} {/if}/ {$patientdata.wifename}</td>
                                        <td class="txtr">
                                            {if $new_dateofbirth_calc != ''} 
                                            {$new_dateofbirth_calc} سنة {/if}  </td>
                                        <td class="txtr">{if !empty($patientdata.wifejob)}{$patientdata.wifejob}{/if}</td>
                                        <td class="txtr">{$patientdata.address}</td>
                                        <td class="txtr wds15">رقم {if $programesetting->programview == 1 }  المريضة  {else} المريض  {/if} : {$patientdata.statusno}</td>
                                        {if $patientdata.statuesid == 4 || $patientdata.statuesid == 3}<td colspan="4" class="wds15"></td>{/if}
                                    </tr>
                                    <tr>
                                        {if $patientdata.statuesid != 1}
                                        {if $patientdata.mirragefromdate }

                                        {if $patientdata.statuesid == 4}
                                        <td class="txtr">{$wifeStatus} منذ  &nbsp; &nbsp; &nbsp;
                                            {else} <td class="txtr">{$wifeStatus} منذ &nbsp; &nbsp; &nbsp; &nbsp;
                                            {/if}
                                            {if $mirragemonths == 0} {$mirrageyears}&nbsp; سنة
                                            {elseif $mirrageyears==0 } {if $mirragemonths==1}{$mirragemonths} شهر {else}{$mirragemonths} شهور {/if}
                                            {else } {$mirragemonths} : {$mirrageyears}&nbsp;     سنة
                                            {/if}
                                        </td>
                                        {else}
                                        {if $patientdata.statuesid == 4}<td class="txtr">{$wifeStatus} منذ &nbsp; &nbsp; &nbsp;  {else} <td class="txtr">{$wifeStatus} منذ :  {/if}

                                            {/if}
                                        <td class="txtr"> الذكور: {$patientdata.boyson} </td>
                                        <td class="txtr"> الإناث: {$patientdata.girlson} </td>
                                        {/if}
                                        <td class="txtr" style=" direction: ltr; "> <a href="#" id="patientsBMI" data-bmi="{$exmination->bmi}" data-WT="{$exmination->weight}"  data-HT="{$exmination->height}" data-id="{$exmination->id}">BMI : {$exmination->bmi}</a>  </td>
                                        <td class="txtr" colspan="2"> <a href="#" class="patientsfile"> </a>  </td>
                                        {if $patientdata.statuesid == 1 ||  $patientdata.statuesid == 4 || $patientdata.statuesid == 3}

                                        {if $patient_doctor == 1}
                                        <td class="txtr">الطبيب المعالج     : {$patient_doctor_name}</td>
                                        {/if}

                                        {if $hospitalView == 1}
                                        <td rowspan="2" id="patientstatusno" class="wds15" colspan="2">
                                            <a class="a_edit" target="_blank" href="{$hosturl}/controllers/patients.php?ac=edit&id={$patientid}">
                                                تعديل بيانات {if $programesetting->programview == 1 }  المريضة  {else} المريض  {/if}</a>
                                        </td>
                                        <td rowspan="2" id="patientstatusno" class="wds15">
                                            <a class="a_edit"  href="{$hosturl}/controllers/patients.php?ac=showendvisits&patientid={$patientid}">
                                                تقرير خروج</a>
                                        </td>
                                        {else}
                                        <td rowspan="2" id="patientstatusno" class="wds15" colspan="3">
                                            <a class="a_edit" target="_blank" href="{$hosturl}/controllers/patients.php?ac=edit&id={$patientid}">
                                                تعديل بيانات {if $programesetting->programview == 1 }  المريضة  {else} المريض  {/if}</a>
                                        </td>
                                        {/if}

                                        {/if}
                                    </tr>
                                    {if $patientdata.statuesid != 1 &&  $patientdata.statuesid != 4 && $patientdata.statuesid != 3}
                                    <tr>
                                        <td class="txtr" {if $simpleView == 1}style="font-size: 18px;" {/if} >{if !empty($patientdata.husbandtype)}{$patientdata.husbandtype} {/if}/ {$patientdata.husdandname}</td>
                                        <td class="txtr">{if  $patientdata.statuesid != 3 }{if $new_dateofbirth_husband != '' } {$new_dateofbirth_husband} سنة {/if} {/if}</td>
                                        <td class="txtr">{if !empty($patientdata.husbandjob)}{$patientdata.husbandjob} {/if}</td>

                                        {if $patient_doctor == 1}
                                        <td class="txtr">الطبيب المعالج     : {$patient_doctor_name}</td>
                                        {/if}

                                        {if $hospitalView == 1}
                                        <td rowspan="2" id="patientstatusno" class="wds15">
                                            <a class="a_edit" target="_blank" href="{$hosturl}/controllers/patients.php?ac=edit&id={$patientid}">
                                                تعديل بيانات {if $programesetting->programview == 1 }  المريضة  {else} المريض  {/if}</a>
                                        </td>
                                        <td rowspan="2" id="patientstatusno" class="wds15">
                                            <a class="a_edit"  href="{$hosturl}/controllers/patients.php?ac=showendvisits&patientid={$patientid}">
                                                تقرير خروج</a>
                                        </td>
                                        {else}
                                        <td rowspan="2" id="patientstatusno" class="wds15" colspan="2">
                                            <a class="a_edit" target="_blank" href="{$hosturl}/controllers/patients.php?ac=edit&id={$patientid}">
                                                تعديل بيانات {if $programesetting->programview == 1 }  المريضة  {else} المريض  {/if}</a>
                                        </td>
                                        {/if}

                                    </tr>
                                    {/if}
                                </table>
                            </div>
                        </div>
                        <div class="row" {if $simpleView == 1}style="display: none;font-size: 17px;"  {else}  style="font-size: 17px;"  {/if} >



                            <input type="hidden" id="patientid" value="{$patientId}"/>

                            <div class="row">
                                <div class="col-md-12" style="padding-right: 0px; padding-left: 0px;">

                                    <div class="aw_green">



                                        {if $phmenstrualcount > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}" class="blue gothislinkagnew" data-go="#tab_0_0"> Menstrual H</a>
                                                </td>

                                                {if $idData == "yes"}
                                                {if !empty($phregualrity) && ($phregualrity->id eq 1  || $phregualrity->id eq 2)  }



                                                {if $phregualrity} <td class="txtl">{$phregualrity->name}</td>{/if}

                                                {if $myphmenstrual->phlMP}<td class="txtl"><label class="bold" style="color:  #004179;">LMP </label> :  {$myphmenstrual->phlMP}</td>{/if}


                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" data-id="" id="mensturaldata_btn">Detail</button>

                                                </td>
                                                {else}



                                                {if $myphmenstrual->menarche} <td class="txtl"> {$myphmenstrual->menarche} <label class="bold" style="color:  #004179;">Y </label> </td>{/if}

                                                {if $myphmenstrual->duration} <td class="txtl">{$myphmenstrual->duration} <label class="bold" style="color:  #004179;"> D  </label></td>{/if}

                                                {if $myphmenstrual->length} <td class="txtl">{$myphmenstrual->length} <label class="bold" style="color:  #004179;"> D </label></td>{/if}

                                                {if $phregualrity}<td class="txtl">{$phregualrity->name}</td>{/if}

                                                {if $phamount} <td class="txtl">{$phamount->name}</td>{/if}

                                                {if $phdysmenorrhoea}<td class="txtl">{$phdysmenorrhoea->name}</td>{/if}

                                                {if $myphmenstrual->phlMP} <td class="txtl"><label class="bold" style="color:  #004179;">LMP </label> : {$myphmenstrual->phlMP} </td> {/if}


                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" data-id="" id="mensturaldata_btn">Detail</button>

                                                </td>



                                                {/if}





                                                {else}
                                                <td class="txtl">
                                                    <label>data is empty</label>
                                                </td>
                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" data-id="" id="mensturaldata_btn">Detail</button>

                                                </td>



                                                {/if}
                                            </tr>
                                        </table>
                                        {/if}

                                        <!-- ========================================================Contraception================================================================-->

                                        {if $myallcontractcount > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}" class="blue gothislinkagnew" data-go="#tab_1_6">   Contraception H </a>
                                                </td>
                                                {if $idData1 == "yes"}

                                                {if $phcontracttype->name} <td class="txtl"><label class="bold" style="color:  #004179;">Type : </label> {$phcontracttype->name}</td>{/if}

                                                {if $myallcontract->contduration} <td class="txtl"><label class="bold" style="color:  #004179;"> Duration : </label>  {$myallcontract->contduration} Y </td> {/if}

                                                {if $myallcontract->contstopped} <td class="txtl"><label class="bold" style="color:  #004179;"> Stopped : </label>   {$myallcontract->contstopped} Y  </td>{/if}

                                                {if $myallcontract->contranote} <td class="txtl"><label class="bold" style="color:  #004179;"> Note : </label>  {$myallcontract->contranote} </td> {/if}

                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" data-id="" id="contractdata_btn">Detail</button>
                                                </td>

                                                {else}
                                                <td class="txtl">
                                                    <label>data is empty</label>
                                                </td>
                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" data-id="" id="contractdata_btn">Detail</button>
                                                </td>

                                                {/if}
                                            </tr>

                                        </table>
                                        {/if}



                                        <!-- ========================================================Obstetric H================================================================-->
                                        <!-------   Gynecology clinic show obsteric --------------> 

                                        {if $programesetting->programview == 1}
                                        {if $myallobsteric > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}" class="blue gothislinkagnew" data-go="#tab_2_6">    Obstetric H </a>
                                                </td>



                                                <td class="txtl"> <label class="bold" style="color:  #004179;">G : </label>   {$myallobsteric}</td>

                                                <td class="txtl"> <label class="bold" style="color:  #004179;"> P : </label>  {$pcounter}</td>
                                                <td class="txtl"> <label class="bold" style="color:  #004179;"> SVD : </label>  {$svdcounter}</td>

                                                <td class="txtl"> <label class="bold" style="color:  #004179;"> C.S : </label>  {$cscounter}</td>

                                                <td class="txtl"> <label class="bold" style="color:  #004179;"> AB : </label>  {$abcounter}</td>

                                                <td class="txtl"><label class="bold" style="color:  #004179;"> Ectopic : </label>  {$Ectopiccounter}</td>

                                                <td class="txtl"> <label class="bold" style="color:  #004179;"> V.mole : </label>  {$vmodelcounter}</td>


                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" id="obstetricdata_btn">Detail</button>
                                                </td>

                                            </tr>

                                        </table>

                                        {else}

                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}" class="blue gothislinkagnew" data-go="#tab_2_6">    Obstetric H </a>
                                                </td>



                                                <td class="txtl"> <label class="bold" style="color:  #3598DC;">G : </label>   0</td>

                                                <td class="txtl"> <label class="bold" style="color:  #3598DC;"> P : </label>  0</td>
                                                <td class="txtl"> <label class="bold" style="color:  #3598DC;"> SVD : </label>  0</td>

                                                <td class="txtl"> <label class="bold" style="color:  #3598DC;"> C.S : </label>  0</td>

                                                <td class="txtl"> <label class="bold" style="color:  #3598DC;"> AB : </label>  0</td>

                                                <td class="txtl"><label class="bold" style="color:  #3598DC;"> Ectopic : </label>  0</td>

                                                <td class="txtl"> <label class="bold" style="color:  #3598DC;"> V.mole : </label>  0</td>


                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" id="obstetricdata_btn">Detail</button>
                                                </td>

                                            </tr>

                                        </table>

                                        {/if}

                                        <!-------   general clinic show examination --------------> 
                                        {else if $showExam == 1 && $programesetting->programview != 1 }
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/examination.php?ac=index&patientid={$patientId}" class="blue gothislinkagnew" data-go="#tab_2_6">    Examination </a>
                                                </td>



                                                <td class="txtl"> 
                                                    <label class="bold bp_mask" style="color:  #004179;">BP1 : </label>  
                                                    {$exmination->bP}
                                                    mmHg
                                                </td>

                                                <td class="txtl">
                                                    <label class="bold bp_mask" style="color:  #004179;"> BP2 : </label>
                                                    {$exmination->bp2}
                                                    mmHg
                                                </td>

                                                <td class="txtl"> 
                                                    <label class="bold" style="color:  #004179;">Pulse : </label>
                                                    {$exmination->pulse} /min 
                                                </td>

                                                <td class="txtl"> 
                                                    <label class="bold" style="color:  #004179;">RGB : </label>
                                                    {$exmination->rgb} mg/dl 
                                                </td>

                                                <td class="txtl"> 
                                                    <label class="bold" style="color:  #004179;">WT : </label>
                                                    {$exmination->weight} KG
                                                </td>

                                                <td class="txtl"> 
                                                    <label class="bold" style="color:  #004179;">HT : </label>
                                                    {$exmination->height} M
                                                </td>

                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" id="examdata_btn">Detail</button>
                                                </td>

                                            </tr>

                                        </table>

                                        {/if}






                                        <!-- ========================================================Past Medical H================================================================-->
                                        {if $allpastmedicalWcount > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}"
                                                       class="blue2 gothislinkagnew" data-go="#tab_55_6" data-second-go="#tab_00_00">
                                                        Past Medical H  ( Wife ) </a>
                                                </td>

                                                <td class="txtl" style="width:8%;"> <label class="bold" style="color:  #004179;"> Disease : </label></td>
                                                {assign var=i value=1}
                                                <td class="txtl">
                                                    {foreach $allpastmedicalW as $myallpastmedical}

                                                    {$myallpastmedical.name},&nbsp;

                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}
                                                </td>

                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright pastmedicaldata_btn" id="pastmedicaldata_btn">Detail</button>
                                                </td>
                                            </tr>
                                        </table>
                                        {/if}

                                        {if $allpastmedicalHcount > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}"
                                                       class="blue2 gothislinkagnew" data-go="#tab_55_6" data-second-go="#tab_00_00">
                                                        Past Medical H  ( Husband ) </a>
                                                </td>

                                                <td class="txtl" style="width:8%;"> <label class="bold" style="color:  #004179;"> Disease : </label></td>
                                                {assign var=i value=1}
                                                <td class="txtl">
                                                    {foreach $allpastmedicalH as $myallpastmedical}

                                                    {$myallpastmedical.name},&nbsp;

                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}
                                                </td>

                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright pastmedicaldata_btn" id="pastmedicaldata_btn">Detail</button>
                                                </td>
                                            </tr>
                                        </table>
                                        {/if}











                                        <!-- ========================================================Past surgical H================================================================-->

                                        {if $allpastsurgicalWcount > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}"
                                                       class="blue2 gothislinkagnew" data-go="#tab_55_6" data-second-go="#tab_10_6">
                                                        Past Surgical H ( Wife ) </a>
                                                </td>

                                                <td class="txtl" style="width:8%;"><label class="bold" style="color:  #004179;"> Operation : </label></td>
                                                <td class="txtl">
                                                    {assign var=i value=1}
                                                    {foreach $allpastsurgicalW as $myallpastsurgical}
                                                    {$myallpastsurgical.name},&nbsp;
                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}
                                                </td>

                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright phpastsurgical_btn" id="phpastsurgical_btn">Detail</button>
                                                </td>
                                            </tr>
                                        </table>
                                        {/if}

                                        {if $allpastsurgicalHcount > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}"
                                                       class="blue2 gothislinkagnew" data-go="#tab_55_6" data-second-go="#tab_10_6">
                                                        Past Surgical H   ( Husband ) </a>
                                                </td>

                                                <td class="txtl" style="width:8%;"><label class="bold" style="color:  #004179;"> Operation : </label></td>
                                                <td class="txtl">
                                                    {assign var=i value=1}
                                                    {foreach $allpastsurgicalH as $myallpastsurgical}
                                                    {$myallpastsurgical.name},&nbsp;
                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}
                                                </td>

                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright phpastsurgical_btn" id="phpastsurgical_btn">Detail</button>
                                                </td>
                                            </tr>
                                        </table>
                                        {/if}

                                        <!-- ========================================================Past Gynecological H================================================================-->

                                        {if $allphpastgynecologicalcount > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}" class="blue gothislinkagnew" data-go="#tab_55_6" data-second-go="#tab_20_6">   Past Gynecological H</a>
                                                </td>

                                                <td class="txtl" style="width:8%;"><label class="bold" style="color:  #004179;"> Operation : </label></td>
                                                <td class="txtl">
                                                    {assign var=i value=1}
                                                    {foreach $allphpastgynecological as $myallphpastgynecological}
                                                    {$myallphpastgynecological.name},&nbsp;


                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}
                                                </td>




                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" id="phpastgynecological_btn">Detail</button>
                                                </td>




                                            </tr>
                                        </table>
                                        {/if}








                                        <!-- ========================================================Past art H================================================================-->

                                        {if $allphpastartcount > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">
                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}" class="blue gothislinkagnew" data-go="#tab_55_6" data-second-go="#tab_30_6" data-third-go="#tab_art_1">   ART External </a>
                                                </td>

                                                <td class="txtl" style="width:8%;"><label class="bold" style="color:  #004179;"> Type : </label></td>
                                                <td class="txtl">
                                                    {assign var=i value=1}
                                                    {foreach $allphpastart as $myallphpastart}
                                                    {$myallphpastart.name},&nbsp;

                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}
                                                </td>
                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" id="phpastart_btn">Detail</button>
                                                </td>
                                            </tr>
                                        </table>
                                        {/if}

                                        {if $internalphpastartcount> 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">
                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}" class="blue gothislinkagnew" data-go="#tab_55_6" data-second-go="#tab_30_6"  data-third-go="#tab_art_2">   ART INTERNAL  </a>
                                                </td>

                                                <td class="txtl" style="width:8%;"><label class="bold" style="color:  #004179;"> Place : </label></td>
                                                <td class="txtl">
                                                    {assign var=i value=1}
                                                    {foreach $internalphpastart as $myallphpastart}
                                                    {$myallphpastart.monitordate} :  {$myallphpastart.place},&nbsp;

                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}

                                                </td>
                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" id="internalpastart_btn">Detail</button>
                                                </td>
                                            </tr>
                                        </table>
                                        {/if}

                                        <!-- ========================================================Family H================================================================-->
                                        {if $allphfamilycount > 0}
                                        <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                            <tr class="odd gradeX gradeXY">

                                                <td class="bold">
                                                    <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$patientId}" class="blue gothislinkagnew" data-go="#tab_4_6">    Family H</a>
                                                </td>


                                                <td class="txtl" style="width:8%;"><label class="bold" style="color:  #004179;"> Disease : </label></td>
                                                <td class="txtl">
                                                    {assign var=i value=1}
                                                    {foreach $allphfamily as $myallphfamily}
                                                    {$myallphfamily.name},&nbsp;


                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}
                                                </td>





                                                <td style="width:1%;">
                                                    <button type="button" class="btn btn-xs green fright" id="phfamily_btn">Detail</button>
                                                </td>


                                            </tr>
                                        </table>
                                        {/if}


                                    </div>
                                    {if $btype  == 1  ||  $hbtype  == 1 ||  $risk  == 1 ||  $notes  == 1 }
                                    <div class="alert-danger_h opsrisk" style="    margin-top: 5px; {if $patientdata.risktype} {if $patientdata.risktype eq 1} border: 3px solid green !important;{else if $patientdata.risktype eq 2} border: 3px solid #E0E037 !important;{else if $patientdata.risktype eq 3} border: 3px solid red !important;{/if} {else}border: 3px solid red !important; {/if}">
                                        <div class="row">
                                            {if $risk  == 1  }
                                            <div class="col-md-4" style="padding: 0px"> <b style=" float: left; width: 15%; "><u>Risks </u></b> <label style="color: black;font-weight: 600;float: left;width: 85%;">{if $patientdata.risk} {$patientdata.risk}  {else} لايوجد {/if}</label></div>
                                            {/if}
                                            {if $notes  == 1  }
                                            <div class="col-md-4" style="padding: 0px"> <b style=" float: left; width: 16%; "><u>Notes : </u></b><label style="color: black;font-weight: 600;float: left;width: 84%;">{if $patientdata.importantnote} {$patientdata.importantnote} {else} لايوجد {/if}</label> <span> </span></div>
                                            {/if}
                                            <div class="col-md-4 fright">
                                                {if $btype  == 1  }
                                                <div class="col-md-6 " style=" text-align: right; padding: 0px;float:right;"> <label style="color: black;    font-weight: 600;">{if  $patientdata.wifeblpatientdata} {$patientdata.wifeblpatientdata} {else} لايوجد  {/if}</label> : <b><u> فصيله الدم</u></b> </div>
                                                {/if}
                                                {if $hbtype  == 1  }
                                                <div class="col-md-6 " style=" text-align: right; padding: 0px; float:right; ">  <label style="color: black;    font-weight: 600;">{if  $patientdata.husblpatientdata} {$patientdata.husblpatientdata} {else} لايوجد {/if}</label>  : <b><u> فصيله الزوج </u></b></div>
                                                {/if}
                                            </div>
                                        </div>
                                    </div>

                                    {/if}

                                </div>
                            </div>
                        </div>

                        {if $programesetting->previous_marriage == 1 && ($prevMarCount > 0  || $prevMarHCount > 0  ) } 
                        <div class="row arabic" style="font-size: 17px;  direction: rtl !important;">
                            <div class="aw_green">
                                <table class="table table-striped table-bordered table-hover nopdngtbl" >
                                    {if  $prevMarHCount > 0  } 
                                    <tr class="odd gradeX">
                                        <td class="bold" style="width: 140px !important;">      زواج سابق للزوج  </td>
                                        {foreach $hus_previous_marriages as $hus_previous_marriage }
                                        <td class="txtr"> 
                                            <label class="bold" style="color:  #004179;">المدة : {$hus_previous_marriage.period}  &nbsp;</label> 
                                            <label class="bold" style="color:  #004179;">ذكور : {$hus_previous_marriage.males} &nbsp;</label> 
                                            <label class="bold" style="color:  #004179;">اناث : {$hus_previous_marriage.females} &nbsp;</label> 
                                            <label class="bold" style="color:  #004179;">سن الأصغر :  {$hus_previous_marriage.last_age} </label>
                                        </td>
                                        {/foreach} 
                                    </tr>
                                    {/if}

                                    {if  $prevMarCount > 0  } 
                                    <tr class="odd gradeX">
                                        <td class="bold" style="width: 140px !important;">      زواج سابق للزوجة   </td>
                                        {foreach $previous_marriages as $previous_marriage }
                                        <td class="txtr"> 
                                            <label class="bold" style="color:  #004179;">المدة : {$previous_marriage.period}  &nbsp;</label> 
                                            <label class="bold" style="color:  #004179;">ذكور : {$previous_marriage.males} &nbsp;</label> 
                                            <label class="bold" style="color:  #004179;">اناث : {$previous_marriage.females} &nbsp;</label> 
                                            <label class="bold" style="color:  #004179;">سن الأصغر :  {$previous_marriage.last_age} </label>
                                        </td>
                                        {/foreach} 
                                    </tr>
                                    {/if}

                                </table>
                            </div>
                        </div>
                        {/if}


                    </div>



                </div>
            </div>
        </div>
    </div>
    <div class="clearfix"></div>
</div>
<!-- END PAGE CONTENT-->
<!-- END CONTENT -->

<!--==============================================================model for detail ============================================================================ -->
<div class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" aria-hidden="false"  id="phdetail_model">
    <div class="modal-dialog wds80">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"> SHOW DATA </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <div id="alldetails"></div>
                    <div class="modal-footer">
                        <button type="button" class="btn default" data-dismiss="modal">Close</button>
                    </div>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
    </div>
</div>
<div class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" aria-hidden="false"  id="ptfilemodel">
    <div class="modal-dialog wds49">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"> SHOW DATA </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">

                    <div id="showdatapatientfiles"> </div>
                    <div class="modal-footer">
                        <button type="button" class="btn default" data-dismiss="modal">Close</button>
                    </div>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
    </div>
</div>


<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="showBmi" style="min-width:1000px;">
    <div class="modal-dialog  modal-lg wds12">
        <div class="modal-content" style=" width: 198px; ">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">  </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <div class="row">
                        <div class="col-md-12" style="background: #85aff3;border-radius: 5%;">
                            <div class="portlet blue-hoki box" style="box-shadow: 0 0 0;">
                                <div class="portlet-title" style=" background-color: #c20a1c; ">
                                    <div class="caption">  BMI Calculations   </div>
                                </div>
                                <div class="portlet-body all" style=" background-color: #85aff3; ">
                                    <div>
                                        <table class="table table-striped table-hover table-bordered" style="margin-top:5px; width: 198px; position: relative; left: -20px; border: 0;">
                                            <thead>
                                                <tr>
                                                    <th> <div align="center">Weight </div></th>
                                                    <td style=" width: 60px; ">
                                                        <input type="text" class="form-control  examinationBMI positivefloat" id="examinationWeight" data-id="" data-colName="weight" data-tableName="examination" value="" />
                                                    </td>
                                                    <th>Kg</th>
                                                </tr>
                                                <tr>
                                                    <th> <div align="center">Height </div></th>
                                                    <td>
                                                        <input type="text" class="form-control   examinationBMI positivefloat" id="examinationHeight" data-id="" data-colName="height" data-tableName="examination" value="" />
                                                    </td>
                                                    <th>M</th>
                                                </tr>
                                                <tr>
                                                    <th> <div align="center">BMI </div></th>
                                                    <td>
                                                        <input type="text" class="form-control " disabled="disabled" id="examinationBMI" data-id="" data-colName="bmi" data-tableName="examination" value="" />
                                                    </td>
                                                    <th>Kg/ m²</th>
                                                </tr>
                                            </thead>

                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!--                        <div class="modal-footer">
                                                    <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>

                                                </div> -->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

