<?php /* Smarty version Smarty-3.1.11, created on 2025-01-27 12:59:58
         compiled from "../views/default/usergroupviewadmin/edit.html" */ ?>
<?php /*%%SmartyHeaderCode:10627940026797672e385c84-03301446%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '92fa4cc8f6a92dfd36940cce2af02357971d6a99' => 
    array (
      0 => '../views/default/usergroupviewadmin/edit.html',
      1 => 1672089200,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '10627940026797672e385c84-03301446',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'properityData' => 0,
    'properity' => 0,
    'i' => 0,
    'properityNum' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_6797672e41e8d8_73377443',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6797672e41e8d8_73377443')) {function content_6797672e41e8d8_73377443($_smarty_tpl) {?><script>
    $(document).ready(function (e) {


        $("#challredio").change(function () {
            if ($(this).is(':checked'))
            {

                $(".radioR").prop("checked", true);
            } else
            {
                $(".radioR").prop("checked", false);
                $(".noradioR").prop("checked", true);
                //$(".xxx").attr("checked", "checked");
            }
        }


        )
    });</script>
<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="#">مجموعات المستخدمين</a></li>
            <li class="active">admin</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title">admin </h3>
            </div>
            <div class="panel-body">
                
                <form class="nameToBeChecked form-horizontal" action="usergroupControllerAdmin.php?do=update" method="post" id="form1"><!--validate the form before checking name-->
                    

                    <!---------(Spry.Widget.Form.validate(this))-------->
                    <!-- Nav tabs -->
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#props" data-toggle="tab">خصائص الصفحات</a></li>
                    </ul>

                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div class="tab-pane active" id="props"><!-- start the 2nd tab -->
                            <div class="well well-sm modfywall">
                                <div class="form-group">
                                    <label class="col-lg-3 control-label"> اختيار كل الخصائص بنعم</label>
                                    <div class="col-lg-4">
                                        <div class="radio-inline">

                                            <input name="" id="challredio" type="checkbox" value="" /> نعم

                                        </div>

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


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

                            <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                            <?php  $_smarty_tpl->tpl_vars['properity'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['properity']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['properityData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['properity']->key => $_smarty_tpl->tpl_vars['properity']->value){
$_smarty_tpl->tpl_vars['properity']->_loop = true;
?>
                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['properity']->value->propertyparent;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==0){?><div class="well well-sm modfywall"><?php }?>
                                <div class="form-group <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['properity']->value->propertyparent;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2!=0){?>propbd<?php }?>">
                                    <div class="col-lg-4" style="display: inline">
                                        <label  class="col-lg-8 control-label"><?php echo $_smarty_tpl->tpl_vars['properity']->value->propertyname;?>
</label>
                                        <div class="radio-inline">
                                            <label>
                                                <input value="0" class="radioR" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['properity']->value->isallowed;?>
<?php $_tmp3=ob_get_clean();?><?php if ($_tmp3==0){?> checked <?php }?> name="propertydefault<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="radio" />
                                                نعم </label>
                                        </div>
                                        <div class="radio-inline">
                                            <label>
                                                <input value="1" class="noradioR" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['properity']->value->isallowed;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==1){?> checked <?php }?> name="propertydefault<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="radio" />
                                                لا </label>
                                        </div>
                                        <input type="hidden" name="propertyid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['properity']->value->propertyid;?>
"/>
                                        <input type="hidden" name="id<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['properity']->value->id;?>
"/>
                                    </div>
                                    <!--                                    <div class="col-lg-3" style="display: inline">
                                                                            <label  class="col-lg-3 control-label">الترتيب</label>
                                                                            <div class="col-lg-6">
                                                                                <input type="text" name="theorder<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['properity']->value->theorder;?>
" class="form-control positiveNo"/>
                                                                            </div>
                                                                        </div>-->
                                </div>
                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['properity']->value->propertyparent;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==0){?></div><?php }?>
                            <?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 } ?>
                            <input type="hidden" name="itr" value="<?php echo $_smarty_tpl->tpl_vars['properityNum']->value;?>
"/>



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

                        </div><!-- end the 2nd tab -->

                    </div><!-- end of tabs -->
                    <!--==============================-->

                    <!--==============================-->
                    <div class="form-group">
                        <div class="col-lg-offset-8 col-lg-4">
                            <button type="submit" class="btn btn-primary pull-left" id="spbutton">حفظ</button>
                        </div>
                    </div>






                </form>

            </div>

        </div>

    </div>
</div>

<script>
    $('input[type="text"], input[type="radio"], input[type="checkbox"], input[type="password"]').change(function () {
        var thisis = $(this);
        var type = thisis.attr('type');
        switch (type) {
            case "checkbox":
                if (thisis.attr('id') == "challredio") {//mark all properities as changed
                    $('[name^="propertydefault"]').addClass('edited');
                    $('[name^="propertyid"]').addClass('edited');
                    $('[name^="id"]').addClass('edited');
                    $('[name^="theorder"]').addClass('edited');
                    $('[name^="relusergrouppropertiesid"]').addClass('edited');
                } else {
                    //not only the element.there is special case has name=reviewBillsAllowedTables[]  if other checkboxes of that name was not changed but marked value will be wrong
                    $('input[name="' + thisis.attr('name') + '"]').addClass('edited');
                }
                break;
            case "radio":
                if (thisis.attr('name').indexOf("propertydefault") == 0) {
                    var i = $(this).attr('name').substr(15);
                    $('[name="propertydefault' + i + '"]').addClass('edited');
                    $('[name="propertyid' + i + '"]').addClass('edited');
                    $('[name="id' + i + '"]').addClass('edited');
                    $('[name="theorder' + i + '"]').addClass('edited');
                    $('[name="relusergrouppropertiesid' + i + '"]').addClass('edited');
                } else {
                    $(this).addClass('edited');
                }
                break;
            case "text":
                if (thisis.attr('name').indexOf("theorder") == 0) {
                    var i = $(this).attr('name').substr(8);
                    $('[name="propertydefault' + i + '"]').addClass('edited');
                    $('[name="propertyid' + i + '"]').addClass('edited');
                    $('[name="id' + i + '"]').addClass('edited');
                    $('[name="theorder' + i + '"]').addClass('edited');
                    $('[name="relusergrouppropertiesid' + i + '"]').addClass('edited');
                } else {
                    $(this).addClass('edited');
                }
                break;
            default:
                $(this).addClass('edited');
                break;
        }
        $(this).addClass('edited');
    });
    $('#form1').on('submit', function () {
        /* ---------------------------------------------------------------------- */
        //## just before submitting stop sending elements not changed by removing attribute name
        //this step is for input[type="hidden"] of properities not changed to remove it
        $('[name^="propertyid"]').not('.edited').remove();
        $('[name^="relusergrouppropertiesid"]').not('.edited').remove();
        //this step is to remove generally not changed of the selector
        $('select, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], input[type="password"]').not('.edited').removeAttr('name');
        //nullNotAllowedOnChange "checkbox" elements sent with zero instead of null for notchecked case
        $('input.edited[type="checkbox"]:not(:checked)').each(function () {
            $(this).removeClass('edited');
            $(this).after('<input type="hidden" name="' + $(this).attr('name') + '" value=0>');
            $(this).removeAttr('name');
        });
        /* ---------------------------------------------------------------------- */
    });
</script>
<?php }} ?>