<?php /* Smarty version Smarty-3.1.11, created on 2025-01-19 17:51:07
         compiled from "../views/default/expensesTypeview/edit.html" */ ?>
<?php /*%%SmartyHeaderCode:1068677205678d1f6bca2850-73818996%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'afe3d6e4773137e18cf92ec9b82e1ff7d28916be' => 
    array (
      0 => '../views/default/expensesTypeview/edit.html',
      1 => 1697572092,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1068677205678d1f6bca2850-73818996',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'data' => 0,
    'allParents' => 0,
    'parent' => 0,
    'Programsettingdata' => 0,
    'searchinonesave' => 0,
    'saveid' => 0,
    'saves' => 0,
    'save' => 0,
    'userGroups' => 0,
    'group' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_678d1f6bd9cd95_60058467',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_678d1f6bd9cd95_60058467')) {function content_678d1f6bd9cd95_60058467($_smarty_tpl) {?>
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#"><?php echo @EXPENSES_REVENUE;?>
</a></li>
            <li><a href="#"><?php echo @EXPENSES;?>
</a></li>
            <li class="active"><?php echo @EXPENSES_TYPE_EDIT;?>
</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title"><?php echo @EXPENSES_TYPE_EDIT;?>
</h3>
            </div>
            <div class="panel-body">
                <form id="typeform" class="nameToBeChecked form-horizontal" action="expensesTypeController.php?do=update&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->expensestypeid;?>
" method="post">
                    <!--validate the form before checking name-->




                    <div class="form-group">
                        <label class="col-lg-2 control-label"><?php echo @EXPENSES_TYPE_MAIN_CLASSIFICATION;?>
</label>
                        <div class="col-lg-5">
                            <select name="parent" id="parent" class="select2 wdt100">
                                <option></option>
                                <option <?php if ($_smarty_tpl->tpl_vars['data']->value->parent==0){?> selected <?php }?> value="0"><?php echo @EXPENSES_TYPE_NO_MAIN_CLASSIFICATION;?>
</option>
                                <?php  $_smarty_tpl->tpl_vars['parent'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['parent']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allParents']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['parent']->key => $_smarty_tpl->tpl_vars['parent']->value){
$_smarty_tpl->tpl_vars['parent']->_loop = true;
?>
                                <option value="<?php echo $_smarty_tpl->tpl_vars['parent']->value->expensestypeid;?>
" <?php if ($_smarty_tpl->tpl_vars['data']->value->parent==$_smarty_tpl->tpl_vars['parent']->value->expensestypeid){?> selected <?php }?>><?php echo $_smarty_tpl->tpl_vars['parent']->value->expensestypename;?>
</option>
                                <?php } ?>
                            </select>
                            <div id="parentError" style="display:none;"></div>
                        </div>
                    </div>

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

                    <div class="form-group">
                        <label class="col-lg-2 control-label"><?php echo @EXPENSES_TYPE_NAME;?>
</label>
                        <div class="col-lg-5">
                            <input type="text" name="name" id="name" value="<?php echo $_smarty_tpl->tpl_vars['data']->value->expensestypename;?>
" class="form-control"/>
                            <input type="hidden" name="oldname" id="oldname" value="<?php echo $_smarty_tpl->tpl_vars['data']->value->expensestypename;?>
"/>

                            <input type="hidden" name="expensestypeid" id="expensestypeid" value="<?php echo $_smarty_tpl->tpl_vars['data']->value->expensestypeid;?>
"/>
                            <div id="nameError"  style="display:none;"></div>
                        </div>
                    </div>

                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->realestatedev==0){?> 

                     <div class="form-group">
                        <label  class="col-lg-2 control-label"> داخل نسبة الاشراف   </label>
                        <div class="col-lg-4">
                          <input type="radio"  name="withinsupervision_ratio" value="1" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->withinsupervision_ratio;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==1){?> checked="checked"  <?php }?>"">
                          <label >نعم </label>
                          <input type="radio"  name="withinsupervision_ratio" value="2" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->withinsupervision_ratio;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2==2){?> checked="checked"  <?php }?>>
                          <label >لا</label>
                        </div>
                    </div>

                    <div class="form-group withinsupervisionratio" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->withinsupervision_ratio;?>
<?php $_tmp3=ob_get_clean();?><?php if ($_tmp3==2){?> style="display: none;" <?php }?>>
                        <label  class="col-lg-2 control-label">  نسبة الاشراف   </label>
                        <div class="col-lg-4">
                          <input type="radio"  name="supervision_ratiotype" value="1" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->supervision_ratiotype;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==1){?> checked="checked"  <?php }?>>
                          <label >قيمه </label>
                          <input type="radio"  name="supervision_ratiotype" value="2" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->supervision_ratiotype;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==2){?> checked="checked"  <?php }?>>
                          <label >نسبه</label>
                        </div>
                    </div>

                     <div class="form-group withinsupervisionratio" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->withinsupervision_ratio;?>
<?php $_tmp6=ob_get_clean();?><?php if ($_tmp6==2){?> style="display: none;" <?php }?>>
                        <label for="supervision_amount" class="col-lg-2 control-label"> مبلغ الاشراف   </label>
                        <div class="col-lg-4">
                            <input type="text" name="supervision_amount" id="supervision_amount" data-id='' class="form-control" placeholder="  مبلغ الاشراف  " required="" value="<?php echo $_smarty_tpl->tpl_vars['data']->value->supervision_amount;?>
" />

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

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

                     <?php if ($_smarty_tpl->tpl_vars['searchinonesave']->value==1){?>
                    <input type="hidden" name="saveid" id="saveid" value="<?php echo $_smarty_tpl->tpl_vars['saveid']->value;?>
" />
                    <?php }else{ ?>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"><?php echo @EXPENSES_TYPE_SAFE;?>
</label>
                        <div class="col-lg-5">
                            <select name="saveid" id="saveid" class="select2 wdt100">
                                <option value="0" <?php if ($_smarty_tpl->tpl_vars['saveid']->value==0){?>selected<?php }?>><?php echo @EXPENSES_TYPE_ALL_SAFE;?>
</option>
                                <?php  $_smarty_tpl->tpl_vars['save'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['save']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['saves']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['save']->key => $_smarty_tpl->tpl_vars['save']->value){
$_smarty_tpl->tpl_vars['save']->_loop = true;
?>
                                <option value="<?php echo $_smarty_tpl->tpl_vars['save']->value->saveid;?>
" <?php if ($_smarty_tpl->tpl_vars['data']->value->saveid==$_smarty_tpl->tpl_vars['save']->value->saveid){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['save']->value->savename;?>
</option>
                                <?php } ?>
                            </select>
                        </div>
                    </div>
                    <?php }?>
                    
                   
                    <!--==============================-->
                    <div class="form-group">
                        <label class="col-lg-2 control-label"><?php echo @EXPENSES_TYPE_USER_GROUPS;?>
</label>
                        <div class="col-lg-5">
                            <select multiple name="addOnlyGroupIds[]" id="addOnlyGroupIds" class="select2 wdt100">
                                <?php  $_smarty_tpl->tpl_vars['group'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['group']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['userGroups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['group']->key => $_smarty_tpl->tpl_vars['group']->value){
$_smarty_tpl->tpl_vars['group']->_loop = true;
?>
                                <option value="<?php echo $_smarty_tpl->tpl_vars['group']->value->usergroupid;?>
" <?php if (in_array($_smarty_tpl->tpl_vars['group']->value->usergroupid,$_smarty_tpl->tpl_vars['data']->value->addOnlyGroupIds)){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['group']->value->usergroupname;?>
</option>
                                <?php } ?>
                            </select>
                        </div>
                    </div>

                    <!--==============================-->
                    <div class="form-group" id="treeTypeDiv">
                        <label class="col-lg-2 control-label"> النوع فى شجرة الحسابات</label>
                        <div class="col-lg-5">
                            <div class="radio-inline">
                                <label><input value="2"  class="radioR" name="treeType" type="radio" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->treeType;?>
<?php $_tmp7=ob_get_clean();?><?php if ($_tmp7==2){?> checked="checked"  <?php }?>/>مصروفات التشغيل</label>
                            </div>
                            <div class="radio-inline">
                                <label><input value="1"  class="radioR" name="treeType" type="radio" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->treeType;?>
<?php $_tmp8=ob_get_clean();?><?php if ($_tmp8==1){?> checked="checked"  <?php }?>/>مصروفات عمومية و إدارية</label>
                            </div>
                            <div class="radio-inline">
                                <label><input value="0"  class="noradioR" name="treeType" type="radio" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->treeType;?>
<?php $_tmp9=ob_get_clean();?><?php if ($_tmp9==0){?> checked="checked"  <?php }?>/>مصروفات بيع و تسويق</label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"><?php echo @EXPENSES_TYPE_MANUFACTURING;?>
</label>
                        <div class="col-lg-5">
                            <div class="radio-inline">
                                <label>
                                    <input value="1"  class="radioR" name="type"   type="radio"   <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->type;?>
<?php $_tmp10=ob_get_clean();?><?php if ($_tmp10==1){?> checked="checked"  <?php }?>/>

                                    <?php echo @EXPENSES_TYPE_YES;?>
 </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="0"  class="noradioR" name="type"   type="radio"   <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->type;?>
<?php $_tmp11=ob_get_clean();?><?php if ($_tmp11==0){?> checked="checked"  <?php }?>/>
                                    <?php echo @EXPENSES_TYPE_NO;?>
 </label>
                            </div>

                        </div>
                    </div>
                    <!--==============================-->

                    <div class="form-group">
                        <label class="col-lg-2 control-label"><?php echo @EXPENSES_TYPE_OTHER_DETAILS;?>
</label>
                        <div class="col-lg-5">
                            <textarea cols="20" rows="5" name="descripe" id="descripe" class="form-control"><?php echo $_smarty_tpl->tpl_vars['data']->value->expensestypedetails;?>
</textarea>
                        </div>
                    </div>

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

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="button" id="savebtn"  class="btn btn-primary pull-left"><?php echo @EDIT;?>
</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1");
    $('#parent').on('change', function () {
        var val = Number($(this).val());
        if (val > 0) {
            $('#treeTypeDiv').hide();
        } else {
            $('#treeTypeDiv').show();
        }
    })
    $('#parent').change();
</script> <?php }} ?>