<?php /* Smarty version Smarty-3.1.11, created on 2024-08-26 07:35:54
         compiled from "../views/obgy/patients/add.html" */ ?>
<?php /*%%SmartyHeaderCode:126255088966cc92cac83378-09361872%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '6d80a5aacd19ad3bdad923656e0f80ca7504c0e2' => 
    array (
      0 => '../views/obgy/patients/add.html',
      1 => 1648347286,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '126255088966cc92cac83378-09361872',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'shcontrollname' => 0,
    'breadcrumbs' => 0,
    'programesetting' => 0,
    'hosturl' => 0,
    'controllname' => 0,
    'lastpatient' => 0,
    'treeId' => 0,
    'stausnoauto' => 0,
    'allTypes' => 0,
    'row' => 0,
    'wAge' => 0,
    'education' => 0,
    'wifejobs' => 0,
    'wifestatus' => 0,
    'nationalIdMatch' => 0,
    'wifebl' => 0,
    'doctors' => 0,
    'previous_marriages' => 0,
    'previous_marriage' => 0,
    'husbandtypes' => 0,
    'hAge' => 0,
    'husbandjobs' => 0,
    'hus_previous_marriages' => 0,
    'hus_previous_marriage' => 0,
    'today' => 0,
    'allDetections' => 0,
    'i' => 0,
    'visit_periods' => 0,
    'data' => 0,
    'k' => 0,
    'allWifeJobs' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_66cc92cae3b731_81125707',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_66cc92cae3b731_81125707')) {function content_66cc92cae3b731_81125707($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include '/home/dromargt4it/public_html/obgy/_library/smarty_plg/libs/plugins/modifier.date_format.php';
?><meta charset="utf8">

<!-- BEGIN CONTENT -->
<div class="page-content-wrapper" id="mydiv">
    <div class="page-content">
        <!-- BEGIN PAGE HEADER-- >
    <h3 class="page-title">
        <?php echo $_smarty_tpl->tpl_vars['shcontrollname']->value;?>

    </h3>
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <?php echo $_smarty_tpl->tpl_vars['breadcrumbs']->value;?>

        </ul>
    </div>
        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row" >
            <div class="col-md-12">
                <!-- BEGIN SAMPLE FORM PORTLET-->
                <div class="portlet box blue placeholderlabel">
                    <div class="portlet-title">
                        <div class="caption fright">
                            بيانات <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->programview==1){?>  الزوجة  <?php }else{ ?> المريض  <?php }?>
                        </div>
                        <div class="tools fleft">
                            <a href="#" class="collapse">
                            </a>
                            <a class="fff bold" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/controllers/<?php echo $_smarty_tpl->tpl_vars['controllname']->value;?>
.php?ac=show">عرض جميع المرضى </a>
                        </div>
                    </div>
                    <!--                    <?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
-->

                    <div class="portlet-body form">
                        <form action="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/controllers/<?php echo $_smarty_tpl->tpl_vars['controllname']->value;?>
.php?ac=addfinish" method="post" class="awval_validation" id="awval" enctype="multipart/form-data" data-ng-app="demo" data-ng-controller="DemoFileUploadController" data-file-upload="options" data-ng-class="{'fileupload-processing': processing() || loadingFiles}">
                            <div class="form-body">
                                <div class="clinick rtl">
                                    <div class="row">
                                        <input type="hidden" name="treeId" id="treeId" value="<?php echo $_smarty_tpl->tpl_vars['treeId']->value;?>
"/>
                                        <div class="col-md-1">
                                            <?php if (isset($_smarty_tpl->tpl_vars['stausnoauto']->value)&&$_smarty_tpl->tpl_vars['stausnoauto']->value==0){?>
                                            <div class="form-group form-md-line-input form-md-floating-label has-info" id="wifestatuscontain">
                                                <input type="text" name="statusno" readonly id="statusno" class="form-control "  
                                                       data-ptname="statusno" data-mawdgod="1" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->statusno;?>
">
                                                <label for="form_control_1" class="txtc">

                                                    <!--                                                    رقم الحالة-->

                                                </label>
                                                <span  id="lb_ckwifestatusno" class="help-block clrred" style="display: none;">هذا الاسم موجود من قبل</span>
                                            </div>
                                            <?php }elseif($_smarty_tpl->tpl_vars['stausnoauto']->value==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 updatelastptID" 
                                                       data-ptname="statusno" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->statusno;?>
">
                                                <label for="form_control_1" class="txtc">
                                                    <!--رقم الحالة-->

                                                </label>
                                                <span  id="lb_ckwifestatusno" class="help-block clrred" style="display: none;">هذا الاسم موجود من قبل</span>
                                            </div>
                                            <?php }?>
                                        </div>
                                        <div class="col-md-3" id="wifeuptype">
                                            <div class="form-group  form-md-floating-label has-info">
                                                <label for="form_control_1" class="txtc">صفة <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->programview==1){?>  المريضة  <?php }else{ ?> المريض  <?php }?></label>
                                                <select  class="form-control select2me updatelastptID wTypes" name="wiftypeid" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="wiftypeid" id="wifetype" >
                                                    <option value=""></option>
                                                    <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allTypes']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                    <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->wiftypeid==$_smarty_tpl->tpl_vars['row']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                    <?php } ?>
                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                </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 updatelastptIDtwice" data-ptname="wifename" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->wifename;?>
"  required="required" />
                                                <span  id="lb_ckwifename" class="help-block clrred" style="display: none;">هذا الاسم موجود من قبل</span>
                                                <label for="form_control_1" class="txtc">اسم <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->programview==1){?>  المريضة  <?php }else{ ?> المريض  <?php }?></label>

                                            </div>
                                            <!--                                            <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 updatelastptID" data-ptname="wifename" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->wifename;?>
">
                                                                                            <label for="form_control_1" class="txtc">اسم <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->programview==1){?>  المريضة  <?php }else{ ?> المريض  <?php }?></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="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" type="text" data-colresult="wifeage" data-ptname="dateofbirth" id="dateofbirth_cc" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->dateofbirth;?>
"  name="dateofbirth" />
                                                <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 updatelastptID txtc" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="wifeage" name="wifeage"  id="wifeage" value="<?php echo $_smarty_tpl->tpl_vars['wAge']->value;?>
" />
                                                <span id="errmsg"></span>
                                                <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-floating-label has-info">
                                                <label for="form_control_1" class="txtc">التعليم</label>
                                                <select class="form-control select2me updatelastptID edu" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="wifeeducation" name="education" id="education">
                                                    <option value=""></option>
                                                    <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['education']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                    <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->wifeeducation==$_smarty_tpl->tpl_vars['row']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                    <?php } ?>
                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                </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 select2me updatelastptID wjob" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="wifejob" name="wifejob"  id="wifejob" />
                                                <option value=""></option>
                                                <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['wifejobs']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"  <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->wifejob==$_smarty_tpl->tpl_vars['row']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                <?php } ?>
                                                <option value="0" class="deleteoptincompo" > حذف </option>
                                                </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 select2me updatelastptID wstatus"    data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="statuesid" name="wifestatus" id="wifestatus" style="width: 150px !important" >
                                                    <option value=""></option>
                                                    <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['wifestatus']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                    <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->statuesid==$_smarty_tpl->tpl_vars['row']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                    <?php } ?>
                                                    <option value="0" class="deleteoptincompo">حذف </option>
                                                </select>
                                            </div>
                                        </div>
                                        <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->programview==0){?>
                                        <div class="col-md-2">
                                            <div class="form-group form-md-floating-label has-info">
                                                <label class="txtc">النوع</label>
                                                <select class="form-control select2me updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="gender" name="gender" id="gender" style="width: 150px !important" >
                                                    <option value=""></option>
                                                    <option value="0" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->gender==0){?>selected<?php }?>>ذكر</option>
                                                    <option value="1" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->gender==1){?>selected<?php }?>>انثي</option>
                                                </select>
                                            </div>
                                        </div>
                                        <?php }?>

                                        <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->programview==1){?> 
                                        <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->statuesid==1){?>
                                        <div class="displaynot"  style="display: none;"  >
                                            <?php }elseif($_smarty_tpl->tpl_vars['lastpatient']->value->statuesid==3){?>
                                            <div class="displaynot">
                                                <?php }else{ ?>
                                                <div class="displaynot">
                                                    <?php }?>
                                                    <div class="col-md-1">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">

                                                            <input type="text" name="mirragefromy"  class="form-control updatelastptID digitsOnly" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="mirragefromy" id="mirragefromy"  value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->mirragefromy;?>
" />
                                                            <label id="husbandLive"  for="form_control_1" class="txtc"> <!--منذ--></label>
                                                            <span class="input-group-addon">سنة </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"  class="form-control updatelastptID digitsOnly" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="mirragefromm"  id="mirragefromm" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->mirragefromm;?>
" />
                                                            <label id="husbandLive"  for="form_control_1" class="txtc"> </label>
                                                            <span class="input-group-addon">شهر</span>
                                                        </div>
                                                    </div>

                                                    <input type="hidden" name="mirragefrom"  data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="mirragefrom" value="" />

                                                    <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 updatelastptID digitsOnly" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="boyson" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->boyson;?>
" />
                                                            <label for="form_control_1" class="txtc"></label>
                                                            <span class="input-group-addon">الذكور </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 updatelastptID digitsOnly" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="girlson" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->girlson;?>
" />
                                                            <label for="form_control_1" class="txtc"></label>
                                                            <span class="input-group-addon">الإناث </span>
                                                        </div>
                                                    </div>
                                                </div>

                                            </div>
                                            <?php }else{ ?>
                                        </div>
                                        <?php }?>


                                        <div class="row">
                                            <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 updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="address" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->address;?>
" />
                                                    <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 type="text" name="phone" id="phone"  class="form-control updatelastptID digitsOnly uniquePhone "  maxlength="11" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
"  data-ptname="phone"  value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->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" id="mobile"   class="form-control updatelastptID digitsOnly uniquePhone "  data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="mobile"  value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->mobile;?>
" />
                                                    <span id="lb_ckmobile" class="help-block clrred"
                                                          style="display: none;">هذا الرقم موجود من قبل</span>
                                                    <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" id="wifenationalidcontain">
                                                    <input type="text" class="form-control digitsOnly"  maxlength="14" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="wifenationalid" name="wifenationalid" id="wifenationalid" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->wifenationalid;?>
" />
                                                    <label for="form_control_1" class="txtc">رقم البطاقة</label>
                                                    <span  id="lb_ckeckwifenationalid" class="help-block clrred" <?php if ($_smarty_tpl->tpl_vars['nationalIdMatch']->value==2){?><?php }else{ ?> style="display: none;" <?php }?>><?php if ($_smarty_tpl->tpl_vars['nationalIdMatch']->value==2){?>هذا الرقم خاطئ<?php }else{ ?>  <?php }?></span>

                                                </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 select2me bloodtype updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="wifebl" id="bloodtype" name="wifebl"  />
                                                    <option value=""></option>
                                                    <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['wifebl']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                    <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->wifebl==$_smarty_tpl->tpl_vars['row']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                    <?php } ?>
                                                    <option value="0" class="deleteoptincompo">حذف</option>
                                                    </select>
                                                </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 updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="importantnote"  value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->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 updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="spacialnotes" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->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 updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="risk" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->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="txtc">درجة الخطورة</label>
                                                    <select class="form-control select2me updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="risktype" name="risktype">
                                                        <option value=""></option>
                                                        <option value="1" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->risktype==1){?>selected<?php }?>>منخفض</option>
                                                        <option value="2" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->risktype==2){?>selected<?php }?>>متوسط</option>
                                                        <option style="background: red;" value="3" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->risktype==3){?>selected<?php }?>>مرتفع </option>

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

                                        <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->patient_doctor==1){?> 
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group form-md-floating-label has-info">
                                                    <label for="form_control_1" class="txtc">   الطبيب المعالج </label>
                                                    <select  class="form-control select2me updatelastptID" name="doctorid" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="doctorid" id="doctorid" >
                                                        <option value=""></option>
                                                        <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['doctors']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                        <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value['user_id'];?>
" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->doctorid==$_smarty_tpl->tpl_vars['row']->value['user_id']){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value['name'];?>
</option>
                                                        <?php } ?>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <?php }?>

                                        <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->previous_marriage==1){?> 
                                        <input type="hidden" id="controllName" value="instruction"/>
                                        <div class="portlet box blue portletcustom wds75">
                                            <div class="portlet-title">
                                                <div class="caption fright">
                                                    <a class="fff bold" href="javascript:;"  id="addPrevMarr" data-for="1"
                                                       style="margin-right: 15px;" data-patientId="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
"> 
                                                        <i class="fa fa-plus"></i></a> زواج سابق    
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-body">
                                            <div class="clinick rtl"   id="prevMarrContainer1">

                                                <?php  $_smarty_tpl->tpl_vars['previous_marriage'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['previous_marriage']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['previous_marriages']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['previous_marriage']->key => $_smarty_tpl->tpl_vars['previous_marriage']->value){
$_smarty_tpl->tpl_vars['previous_marriage']->_loop = true;
?>
                                                <div class="row">

                                                    <div class="col-md-2">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input type="text"  name="period<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->id;?>
" 
                                                                   class="form-control updateElement" 
                                                                   data-colName="period" data-tableName="previous_marriage"    
                                                                   data-id="<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->id;?>
"     value="<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->period;?>
" 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 type="text"  name="males<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->id;?>
" 
                                                                   class="form-control updateElement" 
                                                                   data-colName="males" data-tableName="previous_marriage"    
                                                                   data-id="<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->id;?>
"     value="<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->males;?>
" 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 type="text"  name="females<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->id;?>
" 
                                                                   class="form-control updateElement" 
                                                                   data-colName="females" data-tableName="previous_marriage"    
                                                                   data-id="<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->id;?>
"     value="<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->females;?>
" 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 type="text"  name="last_age<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->id;?>
" 
                                                                   class="form-control updateElement" 
                                                                   data-colName="last_age" data-tableName="previous_marriage"    
                                                                   data-id="<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->id;?>
"     value="<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->last_age;?>
" required  />
                                                            <label for="form_control_1" class="txtc">سن الأصغر  </label>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-1" style="margin-top: 25px;">
                                                        <a class="btn grey-cascade btn-xs deletemsgEX"  data-tableName="previous_marriage" 
                                                           data-id="<?php echo $_smarty_tpl->tpl_vars['previous_marriage']->value->id;?>
" style=" float: left;" href="#" 
                                                           data-link="instruction" data-fn="delinst">  <i class="fa fa-close"></i>
                                                        </a>
                                                    </div>

                                                </div>
                                                <?php } ?> 
                                            </div>
                                        </div>
                                        <?php }?>

                                        <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->programview==1){?> 
                                        <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->statuesid==1){?>
                                        <div class="hiddenforsng"  style="display: none;"  >
                                            <?php }elseif($_smarty_tpl->tpl_vars['lastpatient']->value->statuesid==3){?>
                                            <div class="hiddenforsng"  style="display: none;"  >
                                                <?php }else{ ?>
                                                <div class="hiddenforsng">
                                                    <?php }?>
                                                    <div class="portlet box blue portletcustom">
                                                        <div class="portlet-title">
                                                            <div class="caption fright">
                                                                بيانات الزوج
                                                            </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 select2me updatelastptID htype" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" name="husbandtypeid" data-ptname="husbandtypeid" id="husbandtype" />
                                                                <option value=""></option>
                                                                <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['husbandtypes']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                                <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->husbandtypeid==$_smarty_tpl->tpl_vars['row']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                                <?php } ?>
                                                                <option value="0" class="deleteoptincompo">حذف</option>
                                                                </select>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-5">
                                                            <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                                <input type="text" name="husdandname" class="form-control updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="husdandname" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->husdandname;?>
" />
                                                                <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="calcdatehusband mask_date_new form-control txtl updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="husbanddateofbirth" type="text"  value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->husbanddateofbirth;?>
"   id="husbanddateofbirth" name="husbanddateofbirth" />
                                                                <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  updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="husbandage" name="husbandage" id="husbandage" value="<?php echo $_smarty_tpl->tpl_vars['hAge']->value;?>
" />
                                                                <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-floating-label has-info">
                                                                <label for="form_control_1" class="txtc">تعليم الزوج</label>
                                                                <select class="form-control select2me updatelastptID edu" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="husbandeducation" name="husbandeducation" id="educationhus" />
                                                                <option value=""></option>
                                                                <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['education']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                                <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->husbandeducation==$_smarty_tpl->tpl_vars['row']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                                <?php } ?>
                                                                <option value="0" class="deleteoptincompo">حذف</option>
                                                                </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 select2me updatelastptID hjob" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="husbandjob" name="husbandjob" id="husbandjob" />
                                                                <option value=""></option>
                                                                <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['husbandjobs']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                                <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"<?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->husbandjob==$_smarty_tpl->tpl_vars['row']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                                <?php } ?>
                                                                <option value="0" class="deleteoptincompo">حذف</option>
                                                                </select>
                                                            </div>
                                                        </div>
                                                        <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"  maxlength="14" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="husbandnationalid" name="husbandnationalid" id="husbandnationalid" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->husbandnationalid;?>
" />
                                                                <label for="form_control_1" class="txtc">رقم البطاقة </label>
                                                                <!--<label class="control-label" id="lb_ckeckhusbandnationalid" style="display: none; color: red; text-align: center; background-color: rgb(255, 255, 255);border: 1px solid;"> هذا الرقم موجود من قبل</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 select2me bloodtype updatelastptID" data-id="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" data-ptname="husbandbl" name="husbandbl" id="bloodtypehus" />
                                                                <option value=""></option>
                                                                <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['wifebl']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                                <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['lastpatient']->value->husbandbl==$_smarty_tpl->tpl_vars['row']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                                <?php } ?>
                                                                <option value="0" class="deleteoptincompo">حذف</option>
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="col-md-6">
                                                            <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                                <textarea class="form-control save_husband_patient_notes" rows="2" name="husband_notes"><?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->husband_notes;?>
</textarea>
                                                                <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">
                                                                <textarea class="form-control save_husband_patient_habits" rows="2" name="husband_habbits"><?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->husband_habbits;?>
</textarea>
                                                                <label for="form_control_1" class="txtc"> عادات</label>
                                                            </div>
                                                        </div>

                                                    </div>

                                                    <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->previous_marriage==1){?> 
                                                    <div class="portlet box blue portletcustom wds75">
                                                        <div class="portlet-title">
                                                            <div class="caption fright">
                                                                <a class="fff bold" href="javascript:;"  id="addPrevMarr" data-for="2"
                                                                   style="margin-right: 15px;" data-patientId="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
"> 
                                                                    <i class="fa fa-plus"></i></a> زواج سابق    
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="form-body">
                                                        <div class="clinick rtl"   id="prevMarrContainer2">

                                                            <?php  $_smarty_tpl->tpl_vars['hus_previous_marriage'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['hus_previous_marriage']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['hus_previous_marriages']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['hus_previous_marriage']->key => $_smarty_tpl->tpl_vars['hus_previous_marriage']->value){
$_smarty_tpl->tpl_vars['hus_previous_marriage']->_loop = true;
?>
                                                            <div class="row">

                                                                <div class="col-md-2">
                                                                    <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                                        <input type="text"  name="period<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->id;?>
" 
                                                                               class="form-control updateElement" 
                                                                               data-colName="period" data-tableName="hus_previous_marriage"    
                                                                               data-id="<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->id;?>
"     value="<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->period;?>
" 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 type="text"  name="males<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->id;?>
" 
                                                                               class="form-control updateElement" 
                                                                               data-colName="males" data-tableName="hus_previous_marriage"    
                                                                               data-id="<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->id;?>
"     value="<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->males;?>
" 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 type="text"  name="females<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->id;?>
" 
                                                                               class="form-control updateElement" 
                                                                               data-colName="females" data-tableName="hus_previous_marriage"    
                                                                               data-id="<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->id;?>
"     value="<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->females;?>
" 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 type="text"  name="last_age<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->id;?>
" 
                                                                               class="form-control updateElement" 
                                                                               data-colName="last_age" data-tableName="hus_previous_marriage"    
                                                                               data-id="<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->id;?>
"     value="<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->last_age;?>
" required  />
                                                                        <label for="form_control_1" class="txtc">سن الأصغر   </label>
                                                                    </div>
                                                                </div>

                                                                <div class="col-md-1" style="margin-top: 25px;">
                                                                    <a class="btn grey-cascade btn-xs deletemsgEX"  data-tableName="hus_previous_marriage" 
                                                                       data-id="<?php echo $_smarty_tpl->tpl_vars['hus_previous_marriage']->value->id;?>
" style=" float: left;" href="#" 
                                                                       data-link="instruction" data-fn="delinst">  <i class="fa fa-close"></i>
                                                                    </a>
                                                                </div>

                                                            </div>
                                                            <?php } ?> 
                                                        </div>
                                                    </div>
                                                    <?php }?>
                                                </div>
                                                <div class="clearfix"></div>
                                            </div>
                                            <?php }?>
                                            <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->

                                            <!-- The table listing the files available for upload/download -->


                                            <div class="scroller" style="height: 300px;">
                                                <ul class="files ng-cloak anjuploadfiles" data-ng-repeat="file in queue" data-ng-class="{'processing': file.$processing()} ">
                                                    <li data-ng-switch data-on="!!file.thumbnailUrl" style="display: none;">
                                                        <div class="preview fileptipload" data-ng-switch-when="true">
                                                            <a data-ng-href="{{file.url}}" title="{{file.name}}" download="{{file.name}}" data-gallery><img data-ng-src="{{file.thumbnailUrl}}" alt=""></a>
                                                        </div>
                                                        <div class="preview fileptipload" data-ng-switch-default data-file-upload-preview="file"></div>
                                                        <!--                                    </li>
                                                                                            <li>-->
                                                        <p class="name" data-ng-switch data-on="!!file.url">
                                                            <span data-ng-switch-when="true" data-ng-switch data-on="!!file.thumbnailUrl">
                                                                <a data-ng-switch-when="true" data-ng-href="{{file.url}}" title="{{file.name}}" download="{{file.name}}" data-gallery>{{file.name}}</a>
                                                                <a data-ng-switch-default data-ng-href="{{file.url}}" title="{{file.name}}" download="{{file.name}}">{{file.name}}</a>
                                                            </span>
                                                            <span data-ng-switch-default>{{file.name}}</span>
                                                        </p>
                                                        <strong data-ng-show="file.error" class="error text-danger">{{file.error}}</strong>
                                                        <!--                                    </li>
                                                                                            <li>-->
                                                        <p class="size">{{file.size| formatFileSize}}</p>
                                                        <div class="progress progress-striped active fade" data-ng-class="{pending: 'in'}[file.$state()]" data-file-upload-progress="file.$progress()">
                                                            <div class="progress-bar progress-bar-success" data-ng-style="{width: num + '%'}"></div>
                                                        </div>
                                                        <!--                                    </li>

                                                                                            <li>-->
                                                        <button style="float: left;" type="button" class="btn btn-primary start" data-ng-click="file.$submit()" data-ng-hide="!file.$submit || options.autoUpload" data-ng-disabled="file.$state() == 'pending' || file.$state() == 'rejected'">
                                                            <i class="glyphicon glyphicon-upload"></i>
                                                            <span>ابدأ الرفع</span>
                                                        </button>
                                                        <button type="button" class="btn btn-warning cancel" data-ng-click="file.$cancel()" data-ng-hide="!file.$cancel">
                                                            <i class="glyphicon glyphicon-ban-circle"></i>
                                                            <span>إلغاء</span>
                                                        </button>
                                                        <button data-ng-controller="FileDestroyController" type="button" class="btn btn-danger destroy" data-ng-click="file.$destroy()" data-ng-hide="!file.$destroy">
                                                            <i class="glyphicon glyphicon-trash"></i>
                                                            <span>حذف</span>
                                                        </button>
                                                    </li>
                                                </ul>
                                            </div>

                                            <div class="portlet box blue portletcustom">
                                                <div class="portlet-title">
                                                    <div class="caption fright">
                                                        أضافة زيارة
                                                        <input type="checkbox" id="addV" name="addV"  class="md-check" value="1" checked="">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="clinick rtl">
                                                <div class="row" id="vDiv">

                                                    <div class="col-md-2 wds10">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <!--<input class="form-control datepicker22 edited" name="visitdate"   type="text" value="<?php echo smarty_modifier_date_format(time(),'%Y-%m-%d');?>
"  id="visitdate" required disabled>-->
                                                            <input class="form-control datepicker edited"  type="text"  id="visitdate" name="visitdate"  value="<?php echo $_smarty_tpl->tpl_vars['today']->value;?>
">
                                                            <label for="form_control_1"  class="txtc">تاريخ الزيارة </label>
                                                        </div>
                                                    </div>
                                                    <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->visitsform!=1){?>
                                                    <div class="col-md-2">
                                                        <label for="form_control_1">نوع الكشف</label>
                                                        <div class="form-group  form-md-floating-label has-info">
                                                            <select  class="form-control" name="detectionid" id="detectionid" required select-tableName="visits" data-tableName="visits" data-maintable = "detections" data-colName="detectionid" data-id="0">
                                                                <option value=""></option>
                                                                <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                                                                <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDetections']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                                <?php if ($_smarty_tpl->tpl_vars['i']->value==1){?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['row']->value->detectionval;?>
<?php $_tmp1=ob_get_clean();?><?php $_smarty_tpl->tpl_vars['k'] = new Smarty_variable($_tmp1, null, 0);?><?php }?>
                                                                <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['i']->value==1){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                                <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'i', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['i']->value+1;?>
<?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
if (!empty($_capture_buffer)) {
 if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());
 if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());
 Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();
} else $_smarty_tpl->capture_error();?>
                                                                <?php } ?>
                                                                <option value="-1">إضافة كشف</option>
                                                                <option value="0" class="deleteoptincompo">حذف</option>
                                                            </select>
                                                        </div>
                                                    </div>

                                                    <?php }else{ ?>
                                                    <div class="col-md-3">
                                                        <label for="form_control_1">القسم</label>
                                                        <div class="form-group  form-md-floating-label has-info">
                                                            <select  class="form-control " name="detectionid" id="detectionid" required select-tableName="visits" data-tableName="visits" data-maintable = "detections" data-colName="detectionid" data-id="0">
                                                                <option value=""></option>
                                                                <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                                                                <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDetections']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                                                                <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['i']->value==1){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                                                                <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'i', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['i']->value+1;?>
<?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
if (!empty($_capture_buffer)) {
 if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());
 if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());
 Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();
} else $_smarty_tpl->capture_error();?>
                                                                <?php } ?>
                                                                <option value="-1">إضافة قسم</option>
                                                                <option value="0" class="deleteoptincompo">حذف</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <?php }?>

                                                    <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->visit_period==1){?> 
                                                    <input type="hidden"    id="visitPeriod"  value="1">
                                                    <div class="col-md-2">
                                                        <label for="form_control_1">فترة  الكشف</label>
                                                        <div class="form-group  form-md-floating-label has-info">
                                                            <select  class="form-control select2me visit_periods" name="visit_period" id="visit_period" 
                                                                     placeholder="اختر  الفترة  " required="required"  >
                                                                <option value=""></option>
                                                                <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                                                                <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['visit_periods']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>
                                                                <option value="<?php echo $_smarty_tpl->tpl_vars['data']->value->id;?>
"  <?php if ($_smarty_tpl->tpl_vars['i']->value==1){?>selected <?php }?> ><?php echo $_smarty_tpl->tpl_vars['data']->value->name;?>
</option>
                                                                <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'i', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['i']->value+1;?>
<?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
if (!empty($_capture_buffer)) {
 if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());
 if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());
 Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();
} else $_smarty_tpl->capture_error();?>
                                                                <?php } ?>
                                                                <option value="-2" class="deleteoptincompo">حذف</option>
                                                            </select>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-1 wds7">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input  class="form-control"  type="text" value="" id="periodPatCount" disabled>
                                                            <label for="form_control_1"  class="txtr">   الزيارات   </label>
                                                        </div>
                                                    </div>

                                                    <?php }?>

                                                    <div class="col-md-1 wds7">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input  class="form-control digitsOnly detectionvalue"  type="text"  id="totaldetectionvalue" value="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
" name="totaldetectionvalue" required="required">
                                                            <label for="form_control_1"  class="txtr"> قيمة الكشف </label>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-1 wds7">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input  class="form-control digitsOnly detectionvalue"  type="text"  id="discount" value="0" name="discount" required="required">
                                                            <label for="form_control_1"  class="txtr">  الخصم </label>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-1 wds7">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input  class="form-control digitsOnly detectionvalue"  type="text"  id="detectionvalue_cash" value="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
" name="detectionvalue_cash" required="required">
                                                            <label for="form_control_1"  class="txtr">  كاش </label>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-1 wds7">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input  class="form-control digitsOnly detectionvalue"  type="text"  id="detectionvalue_visa" value="0" name="detectionvalue_visa" required="required">
                                                            <label for="form_control_1"  class="txtr">  فيزا </label>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-1 wds7">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input  class="form-control digitsOnly"  type="text"  id="restdetectionvalue" value="0" name="restdetectionvalue" required="required" readonly="">
                                                            <label for="form_control_1"  class="txtr">  المتبقى </label>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-1 wds7">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input  class="form-control"  type="checkbox"  id="payVisit" value="1" name="payVisit" checked="checked">
                                                            <label for="form_control_1"  class="txtr">دفع</label>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-1 wds7">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input  class="form-control"  type="checkbox"  id="urgent" value="1" name="urgent" >
                                                            <label for="form_control_1"  class="txtr">إنتظار </label>
                                                        </div>
                                                    </div>

                                                </div>
                                            </div>
                                            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->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="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->mobile;?>
" />
                                                    </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>
                                            <?php }?>
                                        </div>

                                        <div class="form-actions">
                                            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->programview==1){?> 
                                            <div class="col-md-4">
                                                <div class=" fileupload-buttonbar">
                                                    <div class="col-lg-12">
                                                        <!-- The fileinput-button span is used to style the file input field as button -->
                                                        <span class="btn btn-success fileinput-button" ng-class="{disabled: disabled}">
                                                            <i class="glyphicon glyphicon-plus"></i>
                                                            <span>إضافة ملف...</span>
                                                            <input type="file" name="files[]" multiple ng-disabled="disabled">
                                                        </span>
                                                        <button type="button" class="btn btn-primary start" data-ng-click="submit()">
                                                            <i class="glyphicon glyphicon-upload"></i>
                                                            <span>ابدأ الرفع</span>
                                                        </button>
                                                        <button type="button" class="btn btn-warning cancel" data-ng-click="cancel()">
                                                            <i class="glyphicon glyphicon-ban-circle"></i>
                                                            <span>إلغاء الرفع</span>
                                                        </button>
                                                        <!-- The global file processing state -->
                                                        <span class="fileupload-process"></span>
                                                    </div>
                                                    <!-- The global progress state -->
                                                    <div class="col-lg-5 fade" data-ng-class="{in: active()}">
                                                        <!-- The global progress bar -->
                                                        <div class="progress progress-striped active" data-file-upload-progress="progress()">
                                                            <div class="progress-bar progress-bar-success" data-ng-style="{width: num + '%'}"></div></div>
                                                        <!-- The extended global progress state -->
                                                        <div class="progress-extended">&nbsp;</div>
                                                    </div>
                                                </div>
                                            </div>

                                            <?php }?>
                                            <input type="hidden" name="ptntid" id="ptntid" value="<?php echo $_smarty_tpl->tpl_vars['lastpatient']->value->id;?>
" />

                                            <div class="col-md-8">
                                                <input type="submit" class="btn green btn-block btn-lg" id="patient_submit"  name="submit" value="إضافة">
                                            </div>
                                        </div>
                                        </form>




                                    </div>
                                </div>
                                <!-- END SAMPLE FORM PORTLET-->
                            </div>
                    </div>
                    <div style="clear: both;">
                    </div>
                    <!-- END PAGE CONTENT-->
                </div>
            </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="wifestatusmodel" 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 id="sourcejob" style="display: none;">
                <option value="">لايوجد</option>
                <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allWifeJobs']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
                <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['row']->value->title;?>
</option>
                <?php } ?>
                <option value="0" > حذف </option>
            </div>

            <!-----------------------------------------------Detection Models----------------------------------------------->

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

                            </div>-->

            <div class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" aria-hidden="false"  id="edit_detectionforview">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                            <h4 class="modal-title"> Edit </h4>
                        </div>
                        <div class="modal-body">
                            <div class="portlet-body form">
                                <form action="" id="" method="post" class="form-horizontal  emptyform" >
                                    <div class="form-body">
                                        <!------===========================================------->
                                        <div>
                                            <div id="detectionforview" class=""> </div>
                                        </div>

                                        <!------===========================================------->
                                        <!--                            <div class="form-group">
                                                                        <label class="col-md-3 control-label"> Name</label>
                                                                        <div class="col-md-8">
                                                                            <input type="hidden" class="form-control"  id="newitem_id" name="newamount_id" >
                                                                            <input type="text" class="form-control"  id="newitem_name" name="newamount_name" style="text-align:left;" >
                                                                            <div id="divsucess1" style="color:red; display:none;"></div>
                                                                        </div>
                                                                    </div>-->
                                        <!------===========================================------->
                                        <div class="modal-footer">
                                            <!--                                <button type="button" class="btn green" id="editmodel_submit"> Update </button>-->
                                            <button type="button" id="amountcloseinput"   class="btn default" data-dismiss="modal">Close</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                </div>
            </div>

            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->visitsform!=1){?>
            <div class="modal fade" id="detectionadd" tabindex="-1" role="basic" aria-hidden="true">
                <meta charset="utf8"/>
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button style="float: left;" type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                            <h4 class="modal-title txtr bold"> إضافة كشف </h4>
                            <span id="sucssmsg" style="display: none;">لقد تم إضافة كشف جديد</span>
                        </div>
                        <div class="modal-body modtbl"  style="margin: 15px;">
                            <from  id="form_add_detection" action="" method="post">
                                <table class="table table-bordered table-striped table-hover">
                                    <thead>
                                    <th>نوع الكشف</th>
                                    <th class="wds20">قيمة الكشف</th>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <div class="input-group wds100" >
                                                    <input type="text" class="form-control" name="detectiontp" id="detectiontp" >
                                                </div>
                                            </td>
                                            <td>
                                                <div class="input-group">
                                                    <input type="text" class="form-control positivefloat" name="detectionvl"  id="detectionvl">
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </from>

                            <div class="modal-footer">
                                <button type="button" class="btn default" data-dismiss="modal">إغلاق</button>
                                <button type="button" class="btn blue" id="detectionadd_submit" >حفظ</button>

                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
            </div>

            <?php }else{ ?>
            <div class="modal fade" id="detectionadd" tabindex="-1" role="basic" aria-hidden="true">
                <meta charset="utf8"/>
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button style="float: left;" type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                            <h4 class="modal-title txtr bold"> إضافة قسم </h4>
                            <span id="sucssmsg" style="display: none;">لقد تم إضافة قسم جديد</span>
                        </div>
                        <div class="modal-body modtbl"  style="margin: 15px;">
                            <from  id="form_add_detection" action="" method="post">
                                <table class="table table-bordered table-striped table-hover">
                                    <thead>
                                    <th>اسم القسم</th>
                                    <th style="display: none;" >قيمة الكشف</th>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <div class="input-group wds100" >
                                                    <input type="text" class="form-control" name="detectiontp" id="detectiontp" >
                                                </div>
                                            </td>
                                            <td style="display: none;">
                                                <div class="input-group">
                                                    <input type="text" class="form-control positivefloat" name="detectionvl" value="0" id="detectionvl" >
                                                </div>
                                            </td>

                                        </tr>
                                    </tbody>
                                </table>
                            </from>

                            <div class="modal-footer">
                                <button type="button" class="btn default" data-dismiss="modal">إغلاق</button>
                                <button type="button" class="btn blue" id="detectionadd_submit" >حفظ</button>

                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
            </div>
            <?php }?><?php }} ?>