<meta charset="utf8">
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
    <div class="page-content">
        <!-- BEGIN PAGE HEADER-- >
        <h3 class="page-title">
            {$shcontrollname}
        </h3>

        <!--<meta charset="utf8">-->

        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row">
            <div class="col-md-12 ">
                <!-- BEGIN SAMPLE FORM PORTLET-->
                <div class="portlet box blue placeholderlabel editx">
                    <div class="portlet-title">
                        <div class="caption fright">
                            {if $programesetting->system_type  == 2 || $programesetting->system_lang == 2}    بيانات الحالة  {else}        بيانات الزوجة   {/if}      
                            <input type="checkbox" id="wifeData" name="wifeData"
                                   class="md-check" value="1"  {if $hasWife == 1} checked="" {/if} >
                        </div>
                        <!--                        <div class="caption fright" style="margin-right: 5px; font-weight: bold;">
                                                    (تاريخ الاضافة : {$addTime } - {$addDate} )
                                                </div>-->
                        <div class="tools fleft">
                            <a href="#" class="collapse">
                            </a>
                            <a class="fff bold" href="{$hosturl}/controllers/{$controllname}.php?ac=show">عرض جميع المرضى <i class="fa fa-users"></i>   </a>
                        </div>
                    </div>
                    <div class="portlet-body form">
                        <form action="{$hosturl}/controllers/{$controllname}.php?ac=update" method="post"  enctype="multipart/form-data" id="addfinishForm"  data-ng-app="demo" data-ng-controller="DemoFileUploadController" data-file-upload="options" data-ng-class="{literal}{'fileupload-processing': processing() || loadingFiles}{/literal}">
                            <div class="form-body">
                                <div class="clinick rtl">
                                    <div class="row">
                                        <div class="col-md-12 txtc" style="    background-color: bisque;">

                                            <div class="col-md-2">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info"   style="padding-top: 0px;">
                                                    <input class="form-control  mask_date_new   " name="revision_date"
                                                           type="text"   value="{$getOnePatient->revision_date}" />
                                                </div>
                                            </div>


                                            <div class="md-checkbox-inline col-md-1">
                                                <div class="md-checkbox">
                                                    <input type="checkbox" id="revisioned" class="md-check" name="revisioned" 
                                                           value="1"  {if $getOnePatient->revisioned == 1}   checked="" {/if} >
                                                    <label for="revisioned">
                                                        <span></span>
                                                        <span class="check"></span>
                                                        <span class="box"></span>
                                                        Revisioned  </label>
                                                </div>
                                            </div>


                                            <div class="md-checkbox-inline col-md-1">
                                                <div class="md-checkbox">
                                                    <input type="checkbox" id="vip" class="md-check" name="vip" 
                                                           value="1"  {if $getOnePatient->vip == 1}   checked="" {/if} >
                                                    <label for="vip">
                                                        <span></span>
                                                        <span class="check"></span>
                                                        <span class="box"></span>
                                                        VIP  </label>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info" 
                                                     style="padding-top: 0px;">
                                                    <input type="text" name="vip_comment" class="form-control "  
                                                           value="{$getOnePatient->vip_comment}"/>
                                                </div>
                                            </div>

                                            {if  $programesetting->system_lang == 2}       
                                            <input type="hidden" id="controllName" value="invoffers"/>
                                            <div class="col-md-2">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info" style=" padding-top: 0; ">
                                                    <div class="md-radio-inline ltr ">
                                                        <div class="md-radio">
                                                            <input type="radio" id="gender0" name="gender" 
                                                                   class="md-radiobtn updateElement"  data-id="{$getOnePatient->id}"  value="0"   
                                                                   data-colName="gender" data-tableName="patients"   
                                                                   {if $getOnePatient->gender == 0}checked  {/if}>
                                                            <label for="gender0">
                                                                <span></span>
                                                                <span class="check"></span>
                                                                <span class="box"></span>
                                                                أنثى      </label>
                                                        </div>
                                                        <div class="md-radio"  style="margin-right: 25px;">
                                                            <input type="radio" id="gender1" name="gender" 
                                                                   class="md-radiobtn updateElement"  data-id="{$getOnePatient->id}"     value="1"
                                                                   data-colName="gender" data-tableName="patients" 
                                                                   {if $getOnePatient->gender == 1}checked  {/if}   >
                                                            <label for="gender1">
                                                                <span></span>
                                                                <span class="check"></span>
                                                                <span class="box"></span>
                                                                ذكر </label>
                                                        </div>
                                                    </div>
                                                    <span class="input-group-addon go2r bold">النوع </span>
                                                </div>
                                            </div>
                                            {/if}   
                                        </div>
                                    </div>

                                    <div class="row">
                                        <input type="hidden" name="treeId" id="treeId" value="{$treeId}"/>
                                        <input type="hidden" id="PatientAdd" value="1"/>
                                        <div class="col-md-1">
                                            <div class="form-group form-md-line-input form-md-floating-label has-info" id="wifestatuscontain">
                                                <input type="text" name="statusno" id="statusno" class="form-control statusno_edit_check"  
                                                       value="{$getOnePatient->statusno}" required="required" readonly>
                                                <label for="form_control_1" class="txtc">
                                                    <!--رقم الحالة-->
                                                </label>
                                                <span  id="lb_ckwifestatusno" class="help-block clrred" style="display: none;">هذا الرقم موجود من قبل</span>
                                            </div>
                                        </div>

                                        {if $programesetting->rfc  == 1}
                                        <div class="col-md-1">
                                            <div class="form-group  form-md-floating-label has-info">
                                                <label for="form_control_1" class="txtc">RFC</label>
                                                <select class="form-control  select2h"  required   name="wrfc"  id="wrfc" 
                                                        {if $allowEditRfc  != 1 }  disabled  {/if}>
                                                    <option value=""></option>
                                                    <option value="1" {if $getOnePatient->wrfc eq 1 } selected {/if} >Yes</option>
                                                    <option value="2" {if $getOnePatient->wrfc eq 2 } selected {/if} >No</option>
                                                </select>
                                            </div>
                                        </div>
                                        {/if}



                                        <div class="col-md-2">
                                            <div class="form-group  form-md-floating-label has-info">
                                                <label for="form_control_1" class="txtc">
                                                    الصفة

                                                </label>
                                                <select  class="form-control  wTypes" name="wifetype"  id="wifetype" >
                                                    <option value=""></option>
                                                    {foreach $allTypes as $row}
                                                    <option value="{$row->id}" {if $row->id eq $getOnePatient->wiftypeid} selected {/if}>{$row->title}</option>
                                                    {/foreach}
                                                    {if $smarty.session.role_id neq 3}
                                                    <option value="0" class="deleteoptincompo">حذف</option>{/if}
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-5">
                                            <div class="form-group form-md-line-input form-md-floating-label has-info" id="wifenamecontain">
                                                <input type="text" id="wifename"  name="wifename"  class="form-control" value="{$getOnePatient->wifename}"   {if $hasWife == 1} required {/if} >
                                                <label for="form_control_1" class="txtc">
                                                    الإسم
                                                </label>
                                                <span  id="lb_ckwifename" class="help-block clrred" style="display: none;">هذا الاسم موجود من قبل</span>
                                            </div>
                                        </div>




                                        <div class="col-md-2">
                                            <div class="form-group form-md-line-input form-md-floating-label has-info">

                                                <input class="form-control calcdatew mask_date_new txtl"  data-id="{$getOnePatient->id}" type="text" data-colresult="wifeage"  id="dateofbirth_cc" name="dateofbirth" value="{$datewifebirth}" />


                                                <label for="form_control_1" class="txtc">
                                                    <!--تاريخ الميلاد-->
                                                </label>
                                                <span class="input-group-addon go2r">تاريخ الميلاد </span>
                                            </div>
                                        </div>
                                        <div class="col-md-1">
                                            <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                <input type="text" class="form-control "  name="wifeage"  id="wifeage" value="{$wAge}"/>

                                                <label for="form_control_1" class="txtc"></label>
                                                <span class="input-group-addon go2r">السن</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">

                                        <div class="col-md-3">
                                            <div class="form-group form-md-line-input form-md-floating-label has-info" id="wifenationalidcontain">
                                                <input type="text" class="form-control digitsOnly" data-ptname="wifenationalid"    
                                                       data-id="{$getOnePatient->id}"  
                                                       {if $smarty.session.role_id neq 19 && $programesetting->national_id_req  == 1} required {/if}   
                                                name="wifenationalid" id="wifenationalid"  
                                                value="{$getOnePatient->wifenationalid}"/>
                                                <label for="form_control_1" class="txtc">رقم البطاقة</label>
                                                <span  id="lb_ckeckwifenationalid" class="help-block clrred" style="display: none;"></span>
                                            </div>
                                        </div>

                                        <div class="col-md-2">
                                            <div class="form-group form-md-line-input form-md-floating-label has-info" id="passportcontain">
                                                <input type="text" class="form-control" data-ptname="passport"    data-id="{$getOnePatient->id}"
                                                       name="passport" id="passport"  value="{$getOnePatient->passport}"/>
                                                <label for="form_control_1" class="txtc">جواز السفر</label>
                                                <span  id="lb_ckeckpassport" class="help-block clrred" style="display: none;"></span>
                                            </div>
                                        </div>

                                        <div class="col-md-3">
                                            <div class="form-group  form-md-floating-label has-info">
                                                <label for="form_control_1" class="txtc">الوظيفة</label>
                                                <select class="form-control  wjob"  data-ptname="wifejob" name="wifejob"  id="wifejob" placeholder="">
                                                    <option value="">لايوجد</option>
                                                    {foreach $wifejobs as $row}
                                                    <option value="{$row->id}"  {if $getOnePatient->wifejob eq $row->id}selected{/if}>{$row->title}</option>
                                                    {/foreach}
                                                    {if $smarty.session.role_id neq 3}
                                                    <option value="0" class="deleteoptincompo"> حذف </option>{/if}
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <div class="form-group form-md-floating-label has-info">
                                                <label for="form_control_1" class="txtc">الحالة الإجتماعية</label>
                                                <select class="form-control  wstatus"  data-ptname="statuesid" name="wifestatus" id="wifestatus" placeholder="" style="width: 150px !important">
                                                    <option value="">لايوجد</option>
                                                    {foreach $wifestatus as $row}
                                                    <option value="{$row->id}" {if $getOnePatient->statuesid eq $row->id}selected{/if}>{$row->title}</option>
                                                    {/foreach}
                                                    {if $smarty.session.role_id neq 3}
                                                    <option value="0" class="deleteoptincompo">حذف</option>{/if}
                                                </select>
                                            </div>
                                        </div>

                                        {if $getOnePatient->statuesid == 1}
                                        <div class="displaynot"  style="display: none;"  >
                                            {else}
                                            <div class="displaynot">
                                                {/if}


                                                <div class="col-md-1">
                                                    <div class="form-group form-md-line-input form-md-floating-label has-info">

                                                        <input type="text" name="mirragefromy"  min="0" class="form-control digitsOnly"  data-ptname="mirragefromy" id="mirragefromy"  value="{$mirragefromy}" />
                                                        <label id="husbandLive"  for="form_control_1" class="txtc"> </label>
                                                        <span class="input-group-addon go2leftlabel">سنة </span>
                                                    </div>
                                                </div>

                                                <div class="col-md-1">
                                                    <div class="form-group form-md-line-input form-md-floating-label has-info">

                                                        <input type="text" name="mirragefromm" min="0" max="12" class="form-control digitsOnly"  data-ptname="mirragefromm"  id="mirragefromm" value="{$mirragefromm}" />
                                                        <label id="husbandLive"  for="form_control_1" class="txtr"> </label>
                                                        <span class="input-group-addon go2leftlabel">شهر</span>
                                                    </div>
                                                </div>

                                                <!--div class="col-md-1">
                                                    <div class="form-group form-md-line-input form-md-floating-label has-info">

                                                        <input type="text" name="boyson" class="form-control " data-ptname="boyson" value="{$getOnePatient->boyson}"/>


                                                        <label for="form_control_1" class="txtc">&nbsp;</label>
                                                        <span class="input-group-addon go2leftlabel">ذكور</span>
                                                    </div>
                                                </div>
                                                <div class="col-md-1">
                                                    <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                        <input type="text" name="girlson" class="form-control "  data-ptname="girlson" value="{$getOnePatient->girlson}"/>
                                                        <label for="form_control_1" class="txtc">&nbsp;</label>
                                                        <span class="input-group-addon go2leftlabel">إناث</span>
                                                    </div>
                                                </div-->
                                            </div>


                                        </div>
                                        <div class="row">

                                            <div class="col-md-4">
                                                <div class="form-group  form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">التعليم</label>
                                                    <select class="form-control  edu" data-ptname="wifeeducation" name="education" id="education"  placeholder="">
                                                        <option value=""></option>
                                                        {foreach $education as $row}
                                                        <option value="{$row->id}" {if $getOnePatient->wifeeducation eq $row->id}selected{/if}>{$row->title}</option>
                                                        {/foreach}
                                                        {if $smarty.session.role_id neq 3}
                                                        <option value="0" class="deleteoptincompo">حذف</option>{/if}
                                                    </select>

                                                </div>
                                            </div>



                                            <div class="col-md-2 ">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                    <input type="text" name="phone" id="phone" 
                                                           class="form-control digitsOnly uniquePhone" required
                                                           data-ptname="phone"   value="{$getOnePatient->phone}">
                                                    <span id="lb_ckphone" class="help-block clrred"
                                                          style="display: none;">هذا الرقم موجود من قبل</span>
                                                    <label for="form_control_1" class="txtc">الموبايل 1</label>
                                                </div>
                                            </div>
                                            <div class="col-md-2 ">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                    <input type="text" name="mobile"  
                                                           class="form-control digitsOnly uniquePhone"
                                                           id="mobile"  data-ptname="mobile"   value="{$getOnePatient->mobile}">
                                                    <span id="lb_ckmobile" class="help-block clrred"
                                                          style="display: none;">هذا الرقم موجود من قبل</span>

                                                    <label for="form_control_1" class="txtc">الموبايل 2</label>
                                                </div>
                                            </div>

                                            <div class="col-md-2 ">
                                                <div class="form-group form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">فصيلة الدم</label>
                                                    <select class="form-control  bloodtype "  data-ptname="wifebl" id="bloodtype" name="wifebl"   placeholder="">
                                                        <option value=""></option>
                                                        {foreach $wifebl as $row}
                                                        <option value="{$row->id}" {if $getOnePatient->wifebl eq $row->id}selected{/if}>{$row->title}</option>
                                                        {/foreach}
                                                        {if $smarty.session.role_id neq 3}
                                                        <option value="0" class="deleteoptincompo">حذف</option>{/if}
                                                    </select>
                                                </div>
                                            </div>


                                        </div>


                                        <div class="row">
                                            <div class="col-md-4">
                                                <div class="form-group  form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">المحافظة </label>
                                                    <select class="form-control   governorate"  name="governorate" id="governorate" data-ptname="governorate">
                                                        <option value=""></option>
                                                        {foreach $governorates as $row}
                                                        <option value="{$row->id}" {if $getOnePatient->governorate eq
                                                            $row->id}selected{/if}>{$row->name}
                                                        </option>
                                                        {/foreach}
                                                        {if $smarty.session.role_id neq 3}
                                                        <option value="0" class="deleteoptincompo">حذف</option>{/if}
                                                    </select>

                                                </div>
                                            </div>


                                            <div class="col-md-4">
                                                <div class="form-group  form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">المركز </label>
                                                    <select class="form-control   governorate_centers"  name="governorate_center" 
                                                            id="governorate_centers"    data-ptname="governorate_center">
                                                        <option value=""></option>
                                                        {foreach $governorate_centers as $row}
                                                        <option value="{$row->id}" {if $getOnePatient->governorate_center eq
                                                            $row->id}selected{/if}>{$row->name}
                                                        </option>
                                                        {/foreach}
                                                        {if $smarty.session.role_id neq 3 &&  $getOnePatient->governorate > 0}
                                                        <option value="0" class="deleteoptincompo">حذف</option>{/if}
                                                    </select>

                                                </div>
                                            </div>

                                            <div class="col-md-4">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                    <input type="text" name="address" class="form-control "  data-ptname="address" 
                                                           value="{$getOnePatient->address}">
                                                    <label for="form_control_1" class="txtc">العنوان</label>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">

                                            <div class="col-md-6">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                    <input type="text" name="importantnote" class="form-control "  data-ptname="importantnote"  value="{$getOnePatient->importantnote}"/>
                                                    <label for="form_control_1" class="txtc"> ملاحظات هامة</label>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                    <input type="text" name="spacialnotes" class="form-control "  data-ptname="spacialnotes" value="{$getOnePatient->spacialnotes}"/>

                                                    <label for="form_control_1" class="txtc"> عادات خاصة</label>
                                                </div>
                                            </div>

                                        </div>

                                        <div class="row">
                                            <div class="col-md-10">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                    <input type="text" name="risk" class="form-control "  data-ptname="risk" value="{$getOnePatient->risk}"/>

                                                    <label for="form_control_1" class="txtc">نوع الخطورة</label>
                                                </div>
                                            </div>
                                            <div class="col-md-2">
                                                <div class="form-group form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtr">درجة الخطورة</label>
                                                    <select class="form-control  updatelastptID" data-id="{$getOnePatient->id}" data-ptname="risktype" name="risktype" placeholder="">
                                                        <!--<option value="">اختر درجة الخطورة</option>-->
                                                        <option value="1" {if $getOnePatient->risktype eq 1}selected{/if}>منخفض</option>
                                                        <option value="2" {if $getOnePatient->risktype eq 2}selected{/if}>متوسط</option>
                                                        <option value="3" {if $getOnePatient->risktype eq 3}selected{/if}>مرتفع </option>

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

                                        </div>
                                        {if $programesetting->system_type  == 1 ||  $programesetting->system_type  == 3  ||  $programesetting->system_type  == 4}
                                        <div class="row">

                                            <div class="col-md-2">
                                                <div class="form-group form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">محولة  من </label>
                                                    <select class="form-control  editData refer_doctor "
                                                            data-id="{$getOnePatient->id}"
                                                            data-ptname="refer_doctor" name="refer_doctor" {if $hasWife == 1} required {/if}
                                                            id="refer_doctor">
                                                        <option value=""></option>
                                                        <option value="-1" {if $getOnePatient->refer_doctor eq -1 }selected{/if}>لا يوجد</option>
                                                        {foreach $refer as $data}
                                                        <option value="{$data->id}" {if $getOnePatient->refer_doctor eq
                                                            $data->id && $getOnePatient->refer_doctor_tb == 0}selected{/if}>{$data->name}</option>
                                                        {/foreach}

                                                        {foreach $py_all_doc as $data}
                                                        <option value="*{$data.user_id}" {if $getOnePatient->refer_doctor eq
                                                            $data.user_id && $getOnePatient->refer_doctor_tb == 1 }selected{/if}>{$data.name}</option>
                                                        {/foreach}


                                                        {if $smarty.session.role_id neq 3}
                                                        <option value="0" class="deleteoptincompo">حذف</option>
                                                        {/if}
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="col-md-2">
                                                <div class="form-group form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">الجنسية </label>
                                                    <select class="form-control  editData nationality "
                                                            data-id="{$getOnePatient->id}"
                                                            data-ptname="nationality" name="nationality"
                                                            id="nationality">
                                                        <option value=""></option>
                                                        {foreach $nationality as $data}
                                                        <option value="{$data->id}" {if $getOnePatient->nationality eq
                                                            $data->id}selected{/if}>{$data->name}</option>
                                                        {/foreach}
                                                        {if $smarty.session.role_id neq 3}
                                                        <option value="0" class="deleteoptincompo">حذف</option>
                                                        {/if}
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="col-md-2">
                                                <div class="form-group form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">الديانة </label>
                                                    <select class="form-control  editData religion "
                                                            data-id="{$getOnePatient->id}"
                                                            data-ptname="religion" name="religion"
                                                            id="religion">
                                                        <option value=""></option>
                                                        {foreach $religion as $data}
                                                        <option value="{$data->id}" {if $getOnePatient->religion eq
                                                            $data->id}selected{/if}>{$data->name}</option>
                                                        {/foreach}
                                                        {if $smarty.session.role_id neq 3}
                                                        <option value="0" class="deleteoptincompo">حذف</option>
                                                        {/if}
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="col-md-3">
                                                <div class="form-group form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">الطبيب المعالج 1 </label>
                                                    <select class="form-control select2 "
                                                            data-id="{$getOnePatient->id}"
                                                            data-ptname="doctor1" name="doctor1" {if $hasWife == 1} required {/if}
                                                            id="doctor1">
                                                        <option value=""></option>
                                                        <option value="-1" {if $getOnePatient->doctor1 eq -1 }selected{/if}>لا يوجد</option>
                                                        {foreach $py_all_doc as $data}
                                                        <option value="{$data.user_id}" {if $getOnePatient->doctor1 eq
                                                            $data.user_id}selected{/if}>{$data.name}</option>
                                                        {/foreach}
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="col-md-3">
                                                <div class="form-group form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">الطبيب المعالج 2 </label>
                                                    <select class="form-control "
                                                            data-id="{$getOnePatient->id}"
                                                            data-ptname="doctor2" name="doctor2"
                                                            id="doctor2">
                                                        <option value=""></option>
                                                        <option value="-1" {if $getOnePatient->doctor2 eq -1 }selected{/if}>لا يوجد</option>
                                                        {foreach $py_all_doc as $data}
                                                        <option value="{$data.user_id}" {if $getOnePatient->doctor2 eq
                                                            $data.user_id}selected{/if}>{$data.name}</option>
                                                        {/foreach}
                                                    </select>
                                                </div>
                                            </div>


                                        </div>
                                        {/if}

                                        {if $programesetting->system_lang != 2 }

                                        {if $getOnePatient->statuesid == 1 || $getOnePatient->statuesid == 4}
                                        <div class="hiddenforsng"  style="display: none;"  >
                                            {elseif $getOnePatient->statuesid == 3}
                                            <div class="hiddenforsng"  style="display: none;"  >
                                                {else}
                                                <div class="hiddenforsng">
                                                    {/if}
                                                    <div class="portlet box blue portletcustom">
                                                        <div class="portlet-title">
                                                            <div class="caption fright">

                                                                <input type="checkbox" id="HusData" name="HusData"
                                                                       class="md-check" value="1" {if $hasHus == 1} checked="" {/if}  >
                                                                بيانات الزوج
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">

                                                        {if $programesetting->rfc  == 1}
                                                        <div class="col-md-1">
                                                            <div class="form-group  form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">RFC</label>
                                                                <select class="form-control select2h"  required    name="rfc"  id="rfc"    
                                                                        {if $allowEditRfc  != 1 } disabled  {/if} >
                                                                    <option value=""></option>
                                                                    <option value="1" {if $getOnePatient->rfc eq 1 } selected {/if} >Yes</option>
                                                                    <option value="2" {if $getOnePatient->rfc eq 2 } selected {/if} >No</option>
                                                                </select>
                                                            </div>
                                                        </div>
                                                        {/if}

                                                        <div class="col-md-2">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc"> الصفة</label>
                                                                <select class="form-control  htype"  name="husbandtypeid" data-ptname="husbandtypeid" id="husbandtype" placeholder="">
                                                                    <option value=""></option>
                                                                    {foreach $husbandtypes as $row}
                                                                    <option value="{$row->id}" {if $getOnePatient->husbandtypeid eq $row->id}selected{/if}>{$row->title}</option>
                                                                    {/foreach}
                                                                    {if $smarty.session.role_id neq 3}
                                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                                    {/if}
                                                                </select>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-4">
                                                            <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                                <input type="text" name="husdandname" class="form-control" 
                                                                       {if $hasHus == 1} required {/if}    id="husdandname"
                                                                       data-ptname="husdandname" value="{$getOnePatient->husdandname}"/>
                                                                <label for="form_control_1" class="txtc"> اسم الزوج</label>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-3">
                                                            <div class="form-group form-md-line-input form-md-floating-label has-info">

                                                                <input class="calcdatehusband mask_date_new form-control  "  data-id="{$getOnePatient->id}" type="text" id="husbanddateofbirth" name="husbanddateofbirth" value="{$datehusbirth}"/>

                                                                <label for="form_control_1"></label>
                                                                <span class="input-group-addon go2r">تاريخ الميلاد </span>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-2">
                                                            <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                                <input type="text" class="form-control "  data-ptname="husbandage" name="husbandage" id="husbandage" value="{$hAge}"/>
                                                                <label for="form_control_1" class="txtc"></label>
                                                                <span class="input-group-addon go2r">السن </span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">

                                                        <div class="col-md-3">
                                                            <div class="form-group form-md-line-input form-md-floating-label has-info" id="husbandnationalidcontent">
                                                                <input type="text" class="form-control digitsOnly"  data-ptname="husbandnationalid" 
                                                                       data-id="{$getOnePatient->id}"    
                                                                       name="husbandnationalid" id="husbandnationalid" value="{$getOnePatient->husbandnationalid}"/>
                                                                <label for="form_control_1" class="txtc">رقم البطاقة </label>
                                                                <span  id="lb_ckeckhusbandnationalid" class="help-block clrred" style="display: none;"></span>
                                                            </div>
                                                        </div>


                                                        <div class="col-md-3">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">تعليم الزوج</label>
                                                                <select class="form-control  edu"  data-ptname="husbandeducation" name="husbandeducation" id="educationhus" placeholder="">
                                                                    <option value=""></option>
                                                                    {foreach $education as $row}
                                                                    <option value="{$row->id}" {if $getOnePatient->husbandeducation eq $row->id}selected{/if}>{$row->title}</option>
                                                                    {/foreach}
                                                                    {if $smarty.session.role_id neq 3}
                                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                                    {/if}
                                                                </select>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-3">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">الوظيفة</label>
                                                                <select class="form-control  hjob "  data-ptname="husbandjob" name="husbandjob" id="husbandjob" placeholder="">
                                                                    <option value=""></option>
                                                                    {foreach $husbandjobs as $row}
                                                                    <option value="{$row->id}"{if $getOnePatient->husbandjob eq $row->id}selected{/if}>{$row->title}</option>
                                                                    {/foreach}
                                                                    {if $smarty.session.role_id neq 3}
                                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                                    {/if}
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="col-md-3">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">فصيلة الدم</label>
                                                                <select class="form-control  bloodtype "  data-ptname="husbandbl" name="husbandbl" id="bloodtypehus" placeholder="">
                                                                    <option value=""></option>
                                                                    {foreach $wifebl as $row}
                                                                    <option value="{$row->id}" {if $getOnePatient->husbandbl eq $row->id}selected{/if}>{$row->title}</option>
                                                                    {/foreach}
                                                                    {if $smarty.session.role_id neq 3}
                                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                                    {/if}
                                                                </select>
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <div class="row">

                                                        <div class="col-md-3">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">الحالة الإجتماعية</label>
                                                                <select class="form-control  hstatus"  data-ptname="hus_statuesid" name="husstatus" 
                                                                        id="husstatus" placeholder="" style="width: 150px !important">
                                                                    <option value="">لايوجد</option>
                                                                    {foreach $husstatus as $row}
                                                                    <option value="{$row->id}" {if $getOnePatient->hus_statuesid eq $row->id}selected{/if}>{$row->title}</option>
                                                                    {/foreach}
                                                                    {if $smarty.session.role_id neq 3}
                                                                    <option value="0" class="deleteoptincompo">حذف</option>{/if}
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="col-md-4">
                                                            <div class="form-group form-md-line-input form-md-floating-label has-info"
                                                                 id="hpassportcontain">
                                                                <input type="text" class="form-control" data-ptname="hus_passport"   
                                                                       data-id="{$getOnePatient->id}"
                                                                       name="hus_passport" id="hus_passport"  value="{$getOnePatient->hus_passport}"/>
                                                                <label for="form_control_1" class="txtc">جواز السفر</label>
                                                                <span  id="lb_ckeckpassporth" class="help-block clrred" style="display: none;"></span>
                                                            </div>
                                                        </div>

                                                        <div class="col-md-4">
                                                            <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                                <input type="text" name="hus_mobile"  maxlength="11"
                                                                       class="form-control digitsOnly "
                                                                       id="hus_mobile"  data-ptname="hus_mobile"   value="{$getOnePatient->hus_mobile}">


                                                                <label for="form_control_1" class="txtc">الموبايل </label>
                                                            </div>
                                                        </div>

                                                    </div>


                                                    {if $programesetting->system_type  == 1  ||  $programesetting->system_type  == 4}
                                                    <div class="row">
                                                        <div class="col-md-2">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">محول  من </label>
                                                                <select class="form-control  editData h_refer_doctor "
                                                                        data-id="{$getOnePatient->id}"
                                                                        data-ptname="h_refer_doctor" name="h_refer_doctor" {if $hasHus == 1} required {/if}
                                                                        id="h_refer_doctor">
                                                                    <option value=""></option>
                                                                    <option value="-1" {if $getOnePatient->h_refer_doctor eq -1 }selected{/if}>لا يوجد</option>
                                                                    {foreach $refer as $data}
                                                                    <option value="{$data->id}" {if $getOnePatient->h_refer_doctor eq
                                                                        $data->id && $getOnePatient->h_refer_doctor_tb == 0 }selected{/if}>{$data->name}</option>
                                                                    {/foreach}

                                                                    {foreach $py_all_doc as $data}
                                                                    <option value="*{$data.user_id}" {if $getOnePatient->h_refer_doctor eq
                                                                        $data.user_id && $getOnePatient->h_refer_doctor_tb == 1 }selected{/if}>{$data.name}</option>
                                                                    {/foreach}


                                                                    {if $smarty.session.role_id neq 3}
                                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                                    {/if}
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="col-md-2">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">الجنسية </label>
                                                                <select class="form-control  editData h_nationality "
                                                                        data-id="{$getOnePatient->id}"
                                                                        data-ptname="h_nationality" name="h_nationality"
                                                                        id="h_nationality">
                                                                    <option value=""></option>
                                                                    {foreach $hnationality as $data}
                                                                    <option value="{$data->id}" {if $getOnePatient->h_nationality eq
                                                                        $data->id}selected{/if}>{$data->name}</option>
                                                                    {/foreach}
                                                                    {if $smarty.session.role_id neq 3}
                                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                                    {/if}
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="col-md-2">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">الديانة </label>
                                                                <select class="form-control  editData h_religion "
                                                                        data-id="{$getOnePatient->id}"
                                                                        data-ptname="h_religion" name="h_religion"
                                                                        id="h_religion">
                                                                    <option value=""></option>
                                                                    {foreach $hreligion as $data}
                                                                    <option value="{$data->id}" {if $getOnePatient->h_religion eq
                                                                        $data->id}selected{/if}>{$data->name}</option>
                                                                    {/foreach}
                                                                    {if $smarty.session.role_id neq 3}
                                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                                    {/if}
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="col-md-3">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">الطبيب المعالج 1 </label>
                                                                <select class="form-control  "
                                                                        data-id="{$getOnePatient->id}"
                                                                        data-ptname="h_doctor1" name="h_doctor1" {if $hasHus == 1} required {/if}
                                                                        id="h_doctor1">
                                                                    <option value=""></option>
                                                                    <option value="-1" {if $getOnePatient->h_doctor1 eq -1 }selected{/if}>لا يوجد</option>
                                                                    {foreach $py_all_doc as $data}
                                                                    <option value="{$data.user_id}" {if $getOnePatient->h_doctor1 eq
                                                                        $data.user_id}selected{/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="col-md-3">
                                                            <div class="form-group form-md-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">الطبيب المعالج 2 </label>
                                                                <select class="form-control  "
                                                                        data-id="{$getOnePatient->id}"
                                                                        data-ptname="h_doctor2" name="h_doctor2"
                                                                        id="h_doctor2">
                                                                    <option value=""></option>
                                                                    <option value="-1" {if $getOnePatient->h_doctor2 eq -1 }selected{/if}>لا يوجد</option>
                                                                    {foreach $py_all_doc as $data}
                                                                    <option value="{$data.user_id}" {if $getOnePatient->h_doctor2 eq
                                                                        $data.user_id}selected{/if}>{$data.name}</option>
                                                                    {/foreach}
                                                                </select>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    {/if}


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


                                        <div class="portlet box blue portletcustom">
                                            <div class="portlet-title">
                                                <div class="caption fright">
                                                    <a class="fff bold" href="javascript:;"  id="addChild"
                                                       style="margin-right: 15px;"  data-patientId="{$getOnePatient->id}"> 
                                                        <i class="fa fa-plus"></i></a>

                                                    الأطفال    
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-body">
                                            <div class="clinick rtl"   id="childsContainer">
                                                <input type="hidden" id="controllName" value="invoffers"/>
                                                {foreach $childs as $child }
                                                <div class="row">

                                                    <div class="col-md-6">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input type="text"  name="child_name{$child->id}" class="form-control updateElement" 
                                                                   data-colName="child_name" data-tableName="patients_childs"    
                                                                   data-id="{$child->id}"     value="{$child->child_name}" required  />
                                                            <label for="form_control_1" class="txtc">الإسم </label>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-2">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input class="form-control  mask_date_new  childdateofbirth updateElement"
                                                                   data-id="{$child->id}" type="text"    data-colName="birth_date"  
                                                                   name="birth_date{$child->id}"
                                                                   data-tableName="patients_childs"      value="{$child->birth_date}" />
                                                            <label for="form_control_1" class="txtc"> </label>
                                                            <span class="input-group-addon go2r">تاريخ الميلاد </span>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-2" style="margin-right: 25px;">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <div class="md-radio-inline ltr">
                                                                <div class="md-radio">
                                                                    <input type="radio" id="gender{$child->id}_0" name="gender{$child->id}" 
                                                                           class="md-radiobtn updateElement"  data-id="{$child->id}"     value="0"   
                                                                           data-colName="gender" data-tableName="patients_childs"   
                                                                           {if $child->gender == 0}checked  {/if}>
                                                                    <label for="gender{$child->id}_0">
                                                                        <span></span>
                                                                        <span class="check"></span>
                                                                        <span class="box"></span>
                                                                        أنثى      </label>
                                                                </div>
                                                                <div class="md-radio">
                                                                    <input type="radio" id="gender{$child->id}_1" name="gender{$child->id}" 
                                                                           class="md-radiobtn updateElement"  data-id="{$child->id}"     value="1"
                                                                           data-colName="gender" data-tableName="patients_childs" 
                                                                           {if $child->gender == 1}checked  {/if}   >
                                                                    <label for="gender{$child->id}_1">
                                                                        <span></span>
                                                                        <span class="check"></span>
                                                                        <span class="box"></span>
                                                                        ذكر </label>
                                                                </div>
                                                            </div>
                                                            <span class="input-group-addon go2r">النوع </span>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-1" style="margin-top: 25px;">
                                                        <a class="btn grey-cascade btn-xs deletemsgEX"  data-tableName="patients_childs" 
                                                           data-id="{$child->id}" style=" float: left;" href="#" 
                                                           data-link="instruction" data-fn="delinst">  <i class="fa fa-close"></i>
                                                        </a>
                                                    </div>

                                                </div>
                                                {/foreach} 
                                            </div>
                                        </div>
                                        {/if}


                                        {if $programesetting->entrydetails == 1 } 
                                        <div class="portlet box blue portletcustom">
                                            <div class="portlet-title">
                                                <div class="caption fright">
                                                    بيانات الدخول - خاصة بتطبيق الموبايل
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row clinick rtl">
                                            <div class="col-md-4">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                    <label for="form_control_1">اسم المستخدم   "الموبايل"</label>
                                                    <input readonly type="text" class="form-control" placeholder="اسم المستخدم" 
                                                           name="uName" id="uName" minlength="3" autocomplete="false" 
                                                           value="{$getOnePatient->phone}">
                                                </div>
                                            </div>
                                            <div class="col-md-4">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                    <label for="form_control_1">كلمة المرور الجديدة</label>
                                                    <input type="password" class="form-control" placeholder="كلمة المرور الجديدة" 
                                                           name="password" id="password" minlength="3" autocomplete="false">
                                                </div>
                                            </div>
                                            <div class="col-md-4">
                                                <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                    <label for="form_control_1">تأكيد كلمة المرور الجديدة</label>
                                                    <input type="password" class="form-control" placeholder="تأكيد كلمة المرور الجديدة" 
                                                           id="confirmpassword"  name="confirmpassword" minlength="3" 
                                                           equalTo="#password" autocomplete="false">
                                                </div>
                                            </div>
                                        </div>

                                        {/if}

                                        {if $programesetting->birth_notify  == 1 } 

                                        <div class="portlet box blue portletcustom">
                                            <div class="portlet-title">
                                                <div class="caption fright">
                                                    <a class="btn green-haze btn-xs"   style="margin-right: 15px;" 
                                                       id="printBirthNotify"  data-patientId="{$getOnePatient->id}">
                                                        <i class="fa fa-print"></i>  </a>

                                                    إخطار ولادة     
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-body">
                                            <div class="clinick rtl">
                                                <div class="row">
                                                    <div class="col-md-11">
                                                        <table class="table table-hover portlet light bg-inverse">
                                                            <thead>
                                                                <tr>
                                                                    <th class="wds10"> م</th>
                                                                    <th class="wds25">تاريخ الإخطار   </th>
                                                                    <th> المستخدم</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody   id="notifyContainer">
                                                                {assign var="i" value="1"}
                                                                {foreach $birthNotifications as $data }
                                                                <tr>
                                                                    <td>{$i}</td>
                                                                    <td>{$data->notify_date}</td>
                                                                    <td>{$data->userName}</td>
                                                                </tr>
                                                                {assign var="i" value={$i+1}}
                                                                {/foreach} 
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {/if}


                                        <div class="portlet box blue portletcustom">
                                            <div class="portlet-title">
                                                <div class="caption fright">
                                                    بيانات عامة
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            {if $programesetting->system_type  == 1  ||  $programesetting->system_type  == 4}
                                            <div class="col-md-4" style="text-align: right; float: right;">
                                                <label>وسيلة المعرفة بالمركز  </label>
                                                <div class="form-group  form-md-floating-label has-info">

                                                    <select class="form-control editData knownfrom "
                                                            data-id="{$getOnePatient->id}"
                                                            data-ptname="knownfrom" name="knownfrom"
                                                            id="knownfrom">
                                                        <option value=""></option>
                                                        {foreach $knownfrom as $data}
                                                        <option value="{$data->id}" {if $getOnePatient->knownfrom eq
                                                            $data->id}selected{/if}>{$data->name}</option>
                                                        {/foreach}
                                                        {if $smarty.session.role_id neq 3}
                                                        <option value="0" class="deleteoptincompo">حذف</option>
                                                        {/if}
                                                    </select>
                                                </div>
                                            </div>
                                            {/if}

                                            <div class="md-checkbox-inline col-md-3 fright">
                                                <div class="md-checkbox">
                                                    <input type="checkbox" id="file_card"  class="md-check  " name="file_card" 
                                                           value="1"   {if $getOnePatient->file_card == 1}   checked="" {/if} >
                                                    <label for="file_card">
                                                        <span></span>
                                                        <span class="check"></span>
                                                        <span class="box"></span>
                                                        كارت الفايل  </label>
                                                </div>
                                            </div>

                                            <div class="md-checkbox-inline col-md-3 fright">
                                                <div class="md-checkbox">
                                                    <input type="checkbox" id="case_card" class="md-check  " name="case_card" 
                                                           value="1"   {if $getOnePatient->case_card == 1}   checked="" {/if} >
                                                    <label for="case_card">
                                                        <span></span>
                                                        <span class="check"></span>
                                                        <span class="box"></span>
                                                        كارت الحالة  </label>
                                                </div>
                                            </div>

                                            <div class="col-md-12" id="patientFilesDiv">
                                                {assign var="i" value="1"}
                                                {foreach $allImgs as $data}
                                                <div class="col-md-3">
                                                    <div class="row clinick ltr" >

                                                        <div class="col-md-12">
                                                            <div class="fileinput fileinput-new" data-provides="fileinput">
                                                                <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 250px; height: 170px;">
                                                                    <img class="showPatFile" {if $data} src="{$hosturl}/../upload/patientfiles/{$patientId}/{$data}"{/if}/>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="row clinick ltr" >
                                                        <div class="col-md-6">

                                                            <button type="button" class="btn btn-xs red fright delPImg" data-pId="{$patientId}" data-name="{$data}">
                                                                <i class="fa fa-close"></i>
                                                            </button>

                                                            <a class="btn btn-xs blue fright" download="{$statusno} -  {$data}"
                                                               href="{$hosturl}/../upload/patientfiles/{$patientId}/{$data}">
                                                                <i class="fa fa-download"></i>
                                                            </a>

                                                        </div>
                                                    </div>

                                                </div>
                                                {assign var="i" value=$i+1}
                                                {/foreach}

                                                {assign var="i" value="1"}
                                                {foreach $allPdf as $data}
                                                <div class="col-md-3">
                                                    <div class="row clinick ltr" >

                                                        <div class="col-md-12">
                                                            <div class="fileinput fileinput-new" data-provides="fileinput">
                                                                <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 250px; height: 170px;">
                                                                    <img src="{$hosturl}/views/obgy/_assets/custom/images/pdficon.png" width="50" height="50"/>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="row clinick ltr" >
                                                        <div class="col-md-6">

                                                            <button type="button" class="btn btn-xs red fright delPImg" data-pId="{$patientId}" data-name="{$data}">
                                                                <i class="fa fa-close"></i>
                                                            </button>

                                                            <a class="btn btn-xs blue fright" download="{$statusno} -  {$data}"
                                                               href="{$hosturl}/../upload/patientfiles/{$patientId}/{$data}">
                                                                <i class="fa fa-download"></i>
                                                            </a>

                                                        </div>
                                                    </div>

                                                </div>
                                                {assign var="i" value=$i+1}
                                                {/foreach}

                                                {assign var="i" value="1"}
                                                {foreach $allDoc as $data}
                                                <div class="col-md-3">
                                                    <div class="row clinick ltr" >

                                                        <div class="col-md-12">
                                                            <div class="fileinput fileinput-new" data-provides="fileinput">
                                                                <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 250px; height: 170px;">
                                                                    <img src="{$hosturl}/views/obgy/_assets/custom/images/wordicon.png" width="50" height="50"/>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="row clinick ltr" >
                                                        <div class="col-md-6">

                                                            <button type="button" class="btn btn-xs red fright delPImg" data-pId="{$patientId}" data-name="{$data}">
                                                                <i class="fa fa-close"></i>
                                                            </button>

                                                            <a class="btn btn-xs blue fright" download="{$statusno} -  {$data}"
                                                               href="{$hosturl}/../upload/patientfiles/{$patientId}/{$data}">
                                                                <i class="fa fa-download"></i>
                                                            </a>

                                                        </div>
                                                    </div>

                                                </div>
                                                {assign var="i" value=$i+1}
                                                {/foreach}



                                            </div>


                                        </div>
                                    </div>



                                    <div class="form-actions">

                                        <div class="col-md-2" style="text-align: right;margin: 0 5px;">
                                            <input type="hidden" name="patientid" value="{$getOnePatient->id}" />
                                            <input type="hidden" id="edited" value="1" />
                                            <input type="hidden" name="ptntid" id="ptntid" value="{$getOnePatient->id}" />
                                            <input type="hidden" name="dirName" id="dirName"   value="patientrecords"/>
                                            <input type="submit" class="btn green btn-block btn-lg" id="patient_submit"  name="submit" value="حفظ">
                                        </div>

                                        {if $programesetting->system_type  == 1  ||  $programesetting->system_type  == 4}
                                        <div class="col-md-2">
                                            <input type="button" class="btn blue btn-block btn-lg"
                                                   id="patient_submit_print" value=" طباعه">
                                        </div>
                                        {/if}

                                        <div class="col-md-3" style="text-align: right;margin: 0 5px;">
                                            <label for="patientFiles" class="btn default btn-block btn-lg">إضافة ملف</label>
                                            <input type="file" name="patientFiles[]" multiple id="patientFiles"
                                                   class=" form-control" style="visibility:hidden;"  >
                                        </div>
                                    </div>
                                    {if $programesetting->voice_record  == 1  }
                                    <input type="hidden" id="hasRecord" value="1" />
                                    <div class="form-actions col-md-12">

                                        <div class="col-md-1">
                                            <input type="file" name="voiceFiles[]" multiple id="voiceFiles"  
                                                   class=" form-control" style="visibility:hidden;"  >
                                            <label for="voiceFiles" class="btn default btn-block btn-lg">Upload</label>       
                                        </div>


                                        <div class="col-md-4">
                                            <div id="controls">
                                                <button class="recordButtom" id="recordButton">Record</button>
                                                <button class="recordButtom" id="pauseButton" disabled>Pause</button>
                                                <button class="recordButtom" id="stopButton" disabled>Stop</button>
                                            </div>

                                            <!--div id="formats">Format: start recording to see sample rate</div-->
                                        </div>

                                        <div class="col-md-6">
                                            <p><strong>Voice Record:</strong></p>
                                            <ol id="recordingsList">
                                                {if $voiceRecord == 1 } 
                                                <li>
                                                    <audio controls  src="{$hosturl}/../upload/patientrecords/{$getOnePatient->id}.{$voiceExt}"> </audio>
                                                </li>
                                                {/if}
                                            </ol>
                                        </div>
                                    </div>
                                    {/if}
                                    </form>
                                </div>
                            </div>
                            <!-- END SAMPLE FORM PORTLET-->
                    </div>
                </div>
                <div style="clear: both;">
                </div>
                <!-- END PAGE CONTENT-->
            </div>
        </div>

        <div id="talks-loading" style="z-index: 3000;position: absolute;top: 10%;right: 2%;left: 6%;display:none; height: 65%; background-color: rgba(0, 0, 0,0.27); padding-top: 10%;" align="center">
            <img src="{$hosturl}/../upload/loading.gif">
        </div>

        <!-- END CONTENT -->
        <div class="modal fade" id="datareceivedwifejob" tabindex="-1" role="basic" aria-hidden="true">
        </div>
        <div class="modal fade" id="allEducation" tabindex="-1" role="basic" aria-hidden="true">
        </div>

        <div class="modal fade" id="allgovernorate" tabindex="-1" role="basic" aria-hidden="true">
        </div>
        <div class="modal fade" id="wifestatusmodel" tabindex="-1" role="basic" aria-hidden="true">
        </div>

        <div class="modal fade" id="husstatusmodel" tabindex="-1" role="basic" aria-hidden="true">
        </div>


        <div class="modal fade" id="wifetypedel" tabindex="-1" role="basic" aria-hidden="true">
        </div>
        <div class="modal fade" id="husbandtypedel" tabindex="-1" role="basic" aria-hidden="true">
        </div>

        <div class="modal fade" id="editModal" tabindex="-1" role="basic" aria-hidden="true">
        </div>



        <div    id="patient_profile_print" style="display :none;">

            <div class="row text-right" style="direction: rtl;">
                <div class="col-md-12">
                    <h1 class="h1" style="text-align: center;">إذن قبول دخول المركز </h1>
                </div>

                <div class="col-md-12">

                    <table style="width: 98%;margin: 5px auto;" cellpadding="2" class="noborder">
                        {if $programesetting->system_type  == 1  ||  $programesetting->system_type  == 4}
                        <tr>
                            <td>
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span style="float: right;margin-right: 5px;margin-left: 20%">
                                        {if $programesetting->system_lang  == 1 }
                                        <span class="bold">  RFC ( للزوجة  ) : </span>
                                        {else}
                                        <span class="bold">  RFC ( للمريض   ) : </span>
                                        {/if}
                                        <span id="prt_rfc_w" ></span>
                                    </span>
                                </h4>
                            </td>
                            <td>
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">  RFC ( للزوج )  : </span>
                                        <span id="prt_rfc_h" ></span>
                                    </span>
                                </h4>
                            </td>
                        </tr>
                        {/if}
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">    التاريخ  :    </span>
                                        <span id="prt_date">{$smarty.now|date_format:"%Y-%m-%d"}</span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                {if $programesetting->system_type  == 1  ||  $programesetting->system_type  == 4}
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;">
                                        <span class="bold">  وسيلة المعرفة بالمركز :      </span>
                                        <span id="prt_knownfrom"></span></span>
                                </h4>
                                {/if}
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold"> اسم الحالة        </span>
                                        <span id="prt_w_name"></span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;">
                                        <span class="bold">  اسم الزوج :      </span>
                                        <span id="prt_h_name"></span></span>
                                </h4>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">  السن:      </span>
                                        <span id="prt_wage"></span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;">
                                        <span class="bold">   السن :     </span>
                                        <span id="prt_hage"></span></span>
                                </h4>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">  رقم قومى :      </span>
                                        <span id="prt_wnational"></span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;">
                                        <span class="bold">  رقم قومى  :      </span>
                                        <span id="prt_hnational"></span></span>
                                </h4>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">  الوظيفة :     </span>
                                        <span id="prt_wjob"></span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;">
                                        <span class="bold">  الوظيفة  :      </span>
                                        <span id="prt_hjob"></span></span>
                                </h4>
                            </td>
                        </tr>
                        {if $programesetting->system_type  == 1  ||  $programesetting->system_type  == 4}
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold"> الجنسية / الديانة  :      </span>
                                        <span id="prt_wreligion"></span></span>
                                </h4>
                            </td>

                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;">
                                        <span class="bold">  الجنسية / الديانة   :     </span>
                                        <span id="prt_hreligion"></span></span>
                                </h4>
                            </td>
                        </tr>
                        {/if}
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">    الموبايل 1 :    </span>
                                        <span id="prt_phone"></span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;">
                                        <span class="bold">   الموبايل 2  :     </span>
                                        <span id="prt_mobile"></span></span>
                                </h4>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;">
                                        <span class="bold">   العنوان  :     </span>
                                        <span id="prt_address"></span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">

                            </td>
                        </tr>
                        {if $programesetting->system_type  == 1  ||  $programesetting->system_type  == 4}
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">   الطبيب المحول  :     </span>
                                        <span id="prt_wrefer"></span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;">
                                        <span class="bold">   الطبيب المحول   :     </span>
                                        <span id="prt_hrefer"></span></span>
                                </h4>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">   الطبيب المعالج (1)  :     </span>
                                        <span id="prt_wdoc1"></span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;">
                                        <span class="bold">   الطبيب المعالج (1)   :     </span>
                                        <span id="prt_hdoc1"></span></span>
                                </h4>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">   الطبيب المعالج (2)  :     </span>
                                        <span id="prt_wdoc2"></span></span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;">
                                        <span class="bold">  الطبيب المعالج (2)   :      </span>
                                        <span id="prt_hdoc2"></span></span>
                                </h4>
                            </td>
                        </tr>
                        {/if}
                        <tr>
                            <td>
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">   الخدمة المطلوبة :     </span>
                                        <span id="prt_service"></span></span>
                                </h4>
                            </td>

                            <td>
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span  style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">    اسم المستخدم  :     </span>
                                        <span>{$userName}</span></span>
                                </h4>
                            </td>
                        </tr>
                        <tr class="emptyLine">
                            <td  colspan="2"> </td>
                        </tr>
                        <!--tr>
                            <td colspan="2">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span class="bold"  style="float: right;margin-right: 5px;margin-left: 20%">    إننى أقبل سداد تكاليف الاقامة والعلاج وجميع المصروفات الخاصة بى خلال فترة اقامتى بالمركز <span id="prt_patient_name"></span></span>
                                </h4>
                            </td>
                        </tr>

                        <tr>
                            <td colspan="2">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span   style="float: right;margin-right: 5px;margin-left: 20%">
                                        <span class="bold">    توقيع المريض أو ولى الامر :    </span>
                                    </span>
                                    <span style="float: right;margin-right: 5px;">.................................................</span>
                                </h4>
                            </td>
                        </tr-->

                        <tr>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span class="bold"  style="margin-right: 20%">الطبيب المقيم       </span>
                                </h4>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >
                                    <span class="bold"  style="float: left;    margin-left: 45%;">مدير عام المركز</span>
                                </h4>
                            </td>
                        </tr>

                        <tr>
                            <td style="width: 50%;">
                                </br>
                                </br>
                            </td>
                            <td style="width: 50%;">
                                <h4 style="direction: rtl" class="arbfnt" >

                                </h4>
                            </td>
                        </tr>

                        <tr>
                            <td style="width: 50%;">
                                {if $programesetting->barcode_print  == 1 }
                                <img id="xx"  src="{$hosturl}/../upload/barcodes/{$getOnePatient->statusno}.png">
                                {/if}
                            </td>
                            <td style="width: 50%;text-align: center;">
                                <h4 style="direction: rtl">
                                    <span id="prt_patient_no" style="font-weight: bolder; font-size: 75px;" ></span>
                                </h4>
                            </td>
                        </tr>


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

        </div>

        {literal}
        <style>

            .noborder tr { height: 10mm; }
            .emptyLine{ height: 30mm !important; }
            .bold { font-weight: bold;}
            .h1 { font-weight: 900; font-size: 28px;}

            .form-group.form-md-line-input .help-block {
                position: absolute;
                margin: 2px 0 0 0;
                opacity: 1;
                filter: alpha(opacity=0);
                font-size: 13px;
            }

            @media print {
                #patient_profile_print {
                    transform: scale(.9);
                }

                .noborder tr { height: 10mm; }
                .emptyLine{ height: 30mm !important;}

                .bold { font-weight: bold;}
                .h1 { font-weight: 900; font-size: 28px;}
            }
        </style>
        {/literal}

        <style>

            @page {ldelim}
            size: auto;
            margin-top: {$programesetting->above2}cm !important;
            margin-bottom: {$programesetting->buttom2}cm !important;
            {rdelim}

            .arbfnt {ldelim}
            font-size: {$programesetting->fontsizear2}px !important;
            {rdelim}

            .enfnt {ldelim}
            font-size: {$programesetting->fontsizeen2}px !important;
            {rdelim}

            #content, #page {
                width: 100%;
                margin: 0;
                float: none;
            }


            /* Unnötige Elemente ausblenden für den Druck */

            #header-widgets, nav, aside.mashsb-container,
            .sidebar, .mashshare-top, .mashshare-bottom,
            .content-ads, .make-comment, .author-bio,
            .heading, .related-posts, #decomments-form-add-comment,
            #breadcrumbs, #footer, .post-byline, .meta-single,
            .site-title img, .post-tags, .readability
            {
                display: none;
            }



        </style>

        <div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="showPatFileM" style="min-width:1000px;">
            <div class="modal-dialog  modal-lg wds65">
                <div class="modal-content" style="">
                    <div class="modal-body" style="background: rgba(0,0,0,.5);">
                        <div class="portlet-body">
                            <button type="button" class="close"
                                    style="margin-right: 5px; margin-top: 10px; width: 20px; height: 20px;"
                                    data-dismiss="modal" aria-hidden="true"></button>
                            <div class="row">
                                <div class="col-md-12" style="text-align: center;" >
                                    <div class="fileinput fileinput-new" data-provides="fileinput">
                                        <div class="fileinput-preview thumbnail" data-trigger="fileinput">
                                            <img id="source_image" />
                                        </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>


        <div id="printPatDiv"></div>
