<?php /* Smarty version Smarty-3.1.11, created on 2025-01-19 17:39:39
         compiled from "../views/default/expensesTypeview/add.html" */ ?>
<?php /*%%SmartyHeaderCode:1714870270678d1cbb790740-17358895%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '2a1d35de51a1ac89911044fd8869e6ff6ec11893' => 
    array (
      0 => '../views/default/expensesTypeview/add.html',
      1 => 1697572092,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1714870270678d1cbb790740-17358895',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'allParents' => 0,
    'parent' => 0,
    'Programsettingdata' => 0,
    'searchinonesave' => 0,
    'saveid' => 0,
    'saves' => 0,
    'data' => 0,
    'userGroups' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_678d1cbb83c342_57128486',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_678d1cbb83c342_57128486')) {function content_678d1cbb83c342_57128486($_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_ADD_EXPENSE_TYPE;?>
</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title"><?php echo @EXPENSES_ADD_EXPENSE_TYPE;?>
</h3>
            </div>
            <div class="panel-body">
                
                <form id="typeform" class="nameToBeChecked form-horizontal" action="expensesTypeController.php?do=add" 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 value="-1"> -- <?php echo @EXPENSES_TYPE_CHOOSE_CATEGORY;?>
 --</option>
                                <option 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 echo $_smarty_tpl->tpl_vars['parent']->value->expensestypename;?>
</option>
                                <?php } ?>
                            </select>
                            <div id="parentError" 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" checked="">
                          <label >نعم </label>
                          <input type="radio"  name="withinsupervision_ratio" value="2">
                          <label >لا</label>
                        </div>
                    </div>

                    <div class="form-group withinsupervisionratio" >
                        <label  class="col-lg-2 control-label">  نسبة الاشراف   </label>
                        <div class="col-lg-4">
                          <input type="radio"  name="supervision_ratiotype" value="1" checked="">
                          <label >قيمه </label>
                          <input type="radio"  name="supervision_ratiotype" value="2">
                          <label >نسبه</label>
                        </div>
                    </div>

                     <div class="form-group withinsupervisionratio">
                        <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=""/>

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

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


                    <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"/>مصروفات التشغيل</label>
                            </div>
                            <div class="radio-inline">
                                <label><input value="1"  class="radioR" name="treeType" type="radio"/>مصروفات عمومية و إدارية</label>
                            </div>
                            <div class="radio-inline">
                                <label><input value="0"  class="noradioR" name="treeType" type="radio" checked="checked"/>مصروفات بيع و تسويق</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 echo @EXPENSES_TYPE_YES;?>
 </label>
                            </div>
                            <div class="radio-inline">
                                <label><input value="0"  class="noradioR" name="type"   checked="checked"  type="radio" /><?php echo @EXPENSES_TYPE_NO;?>
</label>
                            </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" class="form-control"/>
                            <div id="nameError"  style="display:none"></div>
                        </div>
                    </div>
                    <!--==============================-->
                    <?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 echo @EXPENSES_TYPE_ALL_SAFE;?>
</option>
                                <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_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['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->saveid;?>
" <?php if ($_smarty_tpl->tpl_vars['saveid']->value==$_smarty_tpl->tpl_vars['data']->value->saveid){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['data']->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['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_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['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->usergroupid;?>
"><?php echo $_smarty_tpl->tpl_vars['data']->value->usergroupname;?>
</option>
                                <?php } ?>
                            </select>
                        </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"></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 @EXPENSES_TYPE_SAVE;?>
</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();
        }
    })


    $('input[name="withinsupervision_ratio"]').live('change', function () {
        if ($('input[name="withinsupervision_ratio"]:checked').val() == 2) {
            $('.withinsupervisionratio').hide();
        } else {
            $('.withinsupervisionratio').show();
        }
    });
</script> <?php }} ?>