<?php /* Smarty version Smarty-3.1.11, created on 2023-08-23 13:26:35
         compiled from "..\views\obgy\visits\detectionmodel.html" */ ?>
<?php /*%%SmartyHeaderCode:2417764e5eceb87c982-18697978%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '2043e2d54a2815fa78f9965d3d6f9831d8149fdf' => 
    array (
      0 => '..\\views\\obgy\\visits\\detectionmodel.html',
      1 => 1674618552,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2417764e5eceb87c982-18697978',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'patientid' => 0,
    'colName' => 0,
    'mainId' => 0,
    'maintableName' => 0,
    'programesetting' => 0,
    'alldata' => 0,
    'i' => 0,
    'mydata' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_64e5ecebdd0b17_03758276',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_64e5ecebdd0b17_03758276')) {function content_64e5ecebdd0b17_03758276($_smarty_tpl) {?>
<input type="hidden" id="controllName" value="visits"/>
<input type="hidden" id="patientid" name="patientid" value="<?php echo $_smarty_tpl->tpl_vars['patientid']->value;?>
"/>
<input type="hidden" id="colName" name="colName" value="<?php echo $_smarty_tpl->tpl_vars['colName']->value;?>
"/>
<input type="hidden" id="mainId" name="mainId" value="<?php echo $_smarty_tpl->tpl_vars['mainId']->value;?>
"/>
<input type="hidden" id="tablename" name="tablename" value="<?php echo $_smarty_tpl->tpl_vars['maintableName']->value;?>
"/>
<input type="hidden" id="isHospital" name="isHospital" value="<?php echo $_smarty_tpl->tpl_vars['programesetting']->value->visitsform;?>
"/>

<button type="button" class="btn blue  fright wds20" id="addRow">
    <i class="fa fa-plus"></i> إضافة
</button>

<div class="clearfix"></div>
<?php if ($_smarty_tpl->tpl_vars['programesetting']->value->visitsform!=1){?>
<table  id="dtAddTbl" dir="rtl" class="wds100 table table-bordered">
    <thead>
        <tr>
            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_type!=2){?>
            <th class="txtc wds9">خدمة العملاء </th>
            <?php }?>
            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_type==1||$_smarty_tpl->tpl_vars['programesetting']->value->system_type==4){?>
            <th class="txtc wds10"> العمليات </th>
            <th class="txtc wds10"> فاتورة صفريه </th>
            <?php }?>
            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->erpdb!=''){?>
            <th class="txtc wds10"> تحصيلERP </th>
            <?php }?>
            <th class="txtc">الاسم</th>
            <th class="txtc wds11">القيمة</th>
            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_type==3){?>
            <th class="txtc wds15">النوع   </th>
            <th class="txtc wds7">عدد الوحدات    </th>
            <th class="txtc wds7">المقدم      </th>
            <th class="txtc wds7">الباقى  على / جلسة      </th>
            <?php }?>
            <th class="txtc wds4"></th>
        </tr>
    </thead>
    <input type="hidden" id="dtcount" value="<?php echo count($_smarty_tpl->tpl_vars['alldata']->value);?>
">
    <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
    <?php  $_smarty_tpl->tpl_vars['mydata'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['mydata']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['alldata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['mydata']->key => $_smarty_tpl->tpl_vars['mydata']->value){
$_smarty_tpl->tpl_vars['mydata']->_loop = true;
?>
    <tr>

        <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_type!=2){?>
        <td>
            <input type="checkbox" data-colName="for_customer" data-tableName="detections"   value="1"
                   class="form-control updateElementCheck" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
"
                   <?php if ($_smarty_tpl->tpl_vars['mydata']->value->for_customer==1){?>  checked   <?php }?> >
        </td>
        <?php }?>
        <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_type==1||$_smarty_tpl->tpl_vars['programesetting']->value->system_type==4){?>
        <td>
            <input type="checkbox" data-colName="for_operation" data-tableName="detections"   value="1"
                   class="form-control updateElementCheck" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
"
                   <?php if ($_smarty_tpl->tpl_vars['mydata']->value->for_operation==1){?>  checked   <?php }?> >
        </td>
        <td>
            <input type="checkbox" data-colName="iserpzerobill" data-tableName="detections"   value="1"
                   class="form-control updateElementCheck" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
"
                   <?php if ($_smarty_tpl->tpl_vars['mydata']->value->iserpzerobill==1){?>  checked   <?php }?> >
        </td>
        <?php }?>

        <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->erpdb!=''){?>
        <td>
            <input type="checkbox"  data-colName="iserppayment" data-tableName="detections"   value="1" id="isERPPayment<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"
                   class="form-control updateDetectionModel" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
"
                   <?php if ($_smarty_tpl->tpl_vars['mydata']->value->iserppayment==1){?>  checked   <?php }?> >
        </td>
        <?php }?>
        <td>
            <input type="text" class="form-control updateDetectionModel"  id="allnewitem_name<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"
                   data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
" name="newamount_name" value='<?php echo $_smarty_tpl->tpl_vars['mydata']->value->title;?>
' >
        </td>

        <td>
            <input type="text" class="form-control updateDetectionModel"  id="allnewitem_value<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"
                   data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
" name="newamount_name" value='<?php echo $_smarty_tpl->tpl_vars['mydata']->value->detectionval;?>
' >
        </td>

        <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_type==3){?>

        <td>
            <div class="md-radio-inline">
                <div class="md-radio">
                    <input type="radio" data-colName="type" data-tableName="detections"   value="1"
                           name="type<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"  class="form-control updateElement" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"
                           data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
"  id="type1P<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['mydata']->value->type==1){?>  checked   <?php }?> >
                    <label for="type1P<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
">
                        <span></span>
                        <span class="check"></span>
                        <span class="box"></span>
                        نبضات          </label>
                </div>

                <div class="md-radio">
                    <input type="radio" data-colName="type" data-tableName="detections"   value="2"
                           name="type<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="form-control updateElement" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"
                           data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
"   id="type2S<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['mydata']->value->type==2){?>  checked   <?php }?> >
                    <label for="type2S<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
">
                        <span></span>
                        <span class="check"></span>
                        <span class="box"></span>
                        جلسات         </label>
                </div>
            </div>
        </td>

        <td>
            <input type="text" class="form-control updateElement"  data-colName="units"
                   data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
" data-tableName="detections" value='<?php echo $_smarty_tpl->tpl_vars['mydata']->value->units;?>
' >
        </td>

        <td>
            <input type="text" class="form-control updateElement"  data-colName="min_paid"
                   data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
" data-tableName="detections" value='<?php echo $_smarty_tpl->tpl_vars['mydata']->value->min_paid;?>
' >
        </td><!-- comment -->

        <td>
            <input type="text" class="form-control updateElement"  data-colName="max_session"
                   data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
" data-tableName="detections" value='<?php echo $_smarty_tpl->tpl_vars['mydata']->value->max_session;?>
' >
        </td>

        <?php }?>

        <td>
            <a href="#" class="btn red fleft deleteelement" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
" data-link="visits"
               data-fun="deldetection" style="padding: 2px 0px;width: 100%">
                <i class="fa fa-times" ></i>
            </a>
        </td>

    </tr>

    <?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 } ?>

</table>

<?php }else{ ?>

<table  id="dtAddTbl" dir="rtl">
    <thead>
        <tr>
            <th><center>الاسم</center></th>
<th>حذف</th>
</tr>
</thead>
<input type="hidden" id="dtcount" value="<?php echo count($_smarty_tpl->tpl_vars['alldata']->value);?>
">
<?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
<?php  $_smarty_tpl->tpl_vars['mydata'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['mydata']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['alldata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['mydata']->key => $_smarty_tpl->tpl_vars['mydata']->value){
$_smarty_tpl->tpl_vars['mydata']->_loop = true;
?>
<tr>
    <td style="width: 100%">

        <input type="text" class="form-control updateDetectionModel"  id="allnewitem_name<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
" name="newamount_name" value='<?php echo $_smarty_tpl->tpl_vars['mydata']->value->title;?>
' >
    </td>
    <td>
        <a href="#" class="btn red fleft deleteelement" data-id="<?php echo $_smarty_tpl->tpl_vars['mydata']->value->id;?>
" data-link="visits" data-fun="deldetection" style="padding: 2px 0px;width: 100%">
            <i class="fa fa-times" ></i>
        </a>

    </td>
</tr>

<?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 } ?>

</table>
<?php }?>
<?php }} ?>