<script>
    $(document).ready(function (e) {


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

                $("#props .radioR").prop("checked", true);
            } else {
                $("#props .radioR").prop("checked", false);

                $("#props .noradioR").prop("checked", true);
                //$(".xxx").attr("checked", "checked");
            }
        });
        $(".allowBillDelete").change(function () {
            var val = $(this).val();
            if (val == '0') {
                $('#billDeletePasswordDiv').show();
            } else {
                $('#billDeletePasswordDiv').hide();
            }
        });
    });</script>
<div class="row">
    <div class="container">

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

                    <!---------(Spry.Widget.Form.validate(this))-------->
                    <!-- Nav tabs -->
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#info" data-toggle="tab">بيانات المجموعه</a></li>
                        <li><a href="#props" data-toggle="tab">خصائص الصفحات</a></li>
                        <li><a href="#genpro" data-toggle="tab">خصائص عامه</a></li>
                    </ul>

                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div class="tab-pane active" id="info"><!-- start the 1st tab -->


                            <input type="hidden" name="usergroupid" id="usergroupid" value="{$loadData->usergroupid}" />
                            <input type="hidden" name="today" value="{$loadData->currentdate}" />
                            <div class="form-group">
                                <label class="col-lg-2 control-label">اسم المجموعة</label>
                                <div class="col-lg-4">
                                    <span id="namesx">
                                        <input type="text" required="required" name="usergroupname" id="usergroupname"
                                               value="{$loadData->usergroupname}" class="form-control"
                                               placeholder="اسم المجموعة" />
                                        <span class="textfieldRequiredMsg">*</span></span>


                                    <div id="nameError" class="alert alert-block alert-danger fade in"
                                         style="display:none">
                                        <button type="button" class="close pull-left" data-dismiss="alert"
                                                aria-hidden="true">&times;</button>
                                        <h4>رسالة خطا</h4>
                                        <p>هذا الاسم مستخدم من قبل</p>
                                        <div class="clearfix"></div>
                                    </div>

                                </div>
                            </div>

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

                            <div class="form-group">
                                <label class="col-lg-2 control-label">وصف المجموعة</label>
                                <div class="col-lg-4">
                                    <textarea name="usergroupdescription" class="form-control" cols="45"
                                              rows="5">{$loadData->usergroupdescription}</textarea>
                                </div>
                            </div>

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

                            <div class="form-group">
                                <label class="col-lg-2 control-label">حذف مؤقت</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label> <input value="1" {if {$loadData->
                                            conditions} eq 1} checked {/if} name="delete" type="radio" />
                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" {if {$loadData->
                                            conditions} eq 0} checked {/if} name="delete" type="radio" />
                                            لا</label>
                                    </div>
                                </div>
                            </div>

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

                            <div class="form-group">
                                <label class="col-lg-2 control-label">صفحة الدخول</label>
                                <div class="col-lg-4">
                                    <span id="spryselect1">
                                        <select name="startpage" data-placeholder="اختر صفحة الدخول"
                                                class="select2 wdt100" required>
                                            <option {if {$loadData->startpage} eq "index.php"} selected="selected" {/if}
                                                value="index.php">الادارة</option>
                                            <option {if {$loadData->startpage} eq "billreceiptController.php?do=show"}
                                                selected="selected" {/if} value="billreceiptController.php?do=show">
                                                ادارة الاستلام</option>
                                            <option {if {$loadData->startpage} eq "checkReportController.php?do=all"}
                                                selected="selected" {/if} value="checkReportController.php?do=all">
                                                ادارة الفحص</option>
                                            <option {if {$loadData->startpage} eq
                                                "externalMaintenanceGoReport.php?do=all"} selected="selected" {/if}
                                                value="externalMaintenanceGoReport.php?do=all"> ادارة الصيانة الخارجية
                                            </option>
                                            <option {if {$loadData->startpage} eq "stagepropertyController.php?do=show"}
                                                selected="selected" {/if} value="stagepropertyController.php?do=show">
                                                خواص المراحل</option>
                                            <option {if {$loadData->startpage} eq "receiptController.php?do=show"}
                                                selected="selected" {/if} value="receiptController.php?do=show"> ايصال
                                                استلام</option>
                                            <option {if {$loadData->startpage} eq "deleveryReportController.php?do=all"}
                                                selected="selected" {/if} value="deleveryReportController.php?do=all">
                                                ادارة التسليم</option>
                                            <option {if {$loadData->startpage} eq
                                                "maintennanceArchiveController.php?do=all"} selected="selected" {/if}
                                                value="maintennanceArchiveController.php?do=all"> الارشيف</option>
                                            <option {if {$loadData->startpage} eq
                                                "sellbillController.php?do=addresBill"} selected="selected" {/if}
                                                value="sellbillController.php?do=addresBill"> المطاعم</option>

                                        </select>
                                        <span class="selectRequiredMsg">*</span></span>
                                </div>
                            </div>

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

                            <div class="form-group">
                                <label class="col-lg-2 control-label">النوع</label>
                                <div class="col-lg-4">
                                    <span id="spryselect2">
                                        <select name="level" required id="level" data-placeholder="اختر النوع"
                                                class="select2 wdt100">
                                            <option value="-1"></option>
                                            <option value="1" {if $loadData->level eq 1} selected {/if}>مدير</option>
                                            <option value="2" {if $loadData->level eq 2} selected {/if}>محاسب</option>
                                            <option value="3" {if $loadData->level eq 3} selected {/if}>{if
                                                $Programsettingdata->delegate_seller eq 0} بائع {elseif
                                                $Programsettingdata->delegate_seller == 1}مندوب {elseif
                                                $Programsettingdata->delegate_seller == 2}طبيب {/if}</option>
                                        </select>
                                        <span class="selectRequiredMsg">*</span></span>
                                </div>
                            </div>

                            <input type="hidden" name="allPropsJson" id="allPropsJson" value="" />
                        </div><!-- end the 1st tab -->
                        <div class="tab-pane" 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="challredio" id="challredio" type="checkbox" value="" /> نعم

                                        </div>

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


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

                            {assign var=i value=1}
                            {foreach $properityData as $properity}





                            {if $properity->isallowed eq 1 && ($loadData->usergroupid > 0 || $loginSessionUsergroupId >
                            0)}<!--hide if hidden in usergroup admin and my group id < 0 "-1" or group id iam editing > 0 -->


                            <input type="hidden" value="1" name="propertydefault{$i}" />
                            <input type="hidden" name="propertyid{$i}" value="{$properity->propertyid}" />
                            <input type="hidden" name="theorder{$i}" value="0" />
                            <input type="hidden" name="relusergrouppropertiesid{$i}"
                                   value="{$properity->relusergrouppropertiesid}" />







                            {else}<!--show-->





                            {if {$properity->propertyparent} eq 0}<div class="well well-sm modfywall">{/if}
                                <div class="form-group {if {$properity->propertyparent} neq 0}propbd{/if}">
                                    <div class="col-lg-4" style="display: inline">
                                        <label class="col-lg-8 control-label">{$properity->propertyname}</label>
                                        <div class="radio-inline">
                                            <label>
                                                <input value="0"
                                                       class="radioR {if $properity->relusergrouppropertiesid==''}edited{/if}"
                                                       {if {$properity->propertyvalue} eq 0} checked {/if}
                                                name="propertydefault{$i}" type="radio" />
                                                نعم </label>
                                        </div>
                                        <div class="radio-inline">
                                            <label>
                                                <input value="1"
                                                       class="noradioR {if $properity->relusergrouppropertiesid==''}edited{/if}"
                                                       {if {$properity->propertyvalue} eq 1} checked {/if}
                                                name="propertydefault{$i}" type="radio" />
                                                لا </label>
                                        </div>
                                        <input type="hidden" name="propertyid{$i}"
                                               class="{if $properity->relusergrouppropertiesid==''}edited{/if}"
                                               value="{$properity->propertyid}" />
                                        <input type="hidden" name="relusergrouppropertiesid{$i}"
                                               class="{if $properity->relusergrouppropertiesid==''}edited{/if}"
                                               value="{$properity->relusergrouppropertiesid}" />
                                    </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{$i}" value="{$properity->theorder}"
                                                   class="form-control positiveNo {if $properity->relusergrouppropertiesid==''}edited{/if}" />
                                        </div>
                                    </div>
                                </div>
                                {if {$properity->propertyparent} eq 0}
                            </div>{/if}












                            {/if}
                            {capture assign=i}{$i+1}{/capture}
                            {/foreach}
                            <input type="hidden" name="itr" value="{$properityNum}" />



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

                        </div><!-- end the 2nd tab -->
                        <div class="tab-pane" id="genpro"><!-- start the 3rd tab -->

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">خاصيه البحث بالتاريخ فى تقرير يوميه الخزنه</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" {if {$loadData->savedailydate} eq 1} checked
                                            {/if} name="savedailydate" type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" {if {$loadData->savedailydate} eq 0}
                                            checked {/if} name="savedailydate" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>


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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار القوائم</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="hidemenu" {if {$loadData->hidemenu} eq
                                            1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="hidemenu" {if {$loadData->hidemenu}
                                            eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label"> تعديل بيانات المستخدم</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="editUserPrivlage" type="radio" {if
                                                   {$loadData->editUserPrivlage} eq 0} checked {/if}/>

                                            اسم المستخدم وكلمة المرور فقط </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="editUserPrivlage" type="radio" {if
                                                   {$loadData->editUserPrivlage} eq 1} checked {/if}/>
                                            كل البيانات </label>
                                    </div>

                                </div>
                            </div>

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


                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار تصنيفات المنتجات</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="hidecat" {if {$loadData->hidecat} eq
                                            1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="hidecat" {if {$loadData->hidecat} eq
                                            0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

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


                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">ادخال مديونيه عميل بالسالب</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="clientnegative" {if
                                                   {$loadData->clientnegative} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="clientnegative" {if
                                                   {$loadData->clientnegative} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>


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


                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">ادخال مديونيه مورد بالسالب</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="suplliernegative" {if
                                                   {$loadData->suplliernegative} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="suplliernegative" {if
                                                   {$loadData->suplliernegative} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>


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



                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">ادخال ارصده للمخازن بالسالب</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="storenegative" {if
                                                   {$loadData->storenegative} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="storenegative" {if
                                                   {$loadData->storenegative} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>

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



                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">تعديل الاسعار</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="priceupdate" {if
                                                   {$loadData->priceupdate} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="priceupdate" {if
                                                   {$loadData->priceupdate} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار تعديل وحذف فى فواتير البيع</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="allowEditDelInBills" {if
                                                   $loadData->allowEditDelInBills eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->allowEditDelInBills eq 1}
                                            checked {/if} name="allowEditDelInBills" type="radio" />
                                            لا </label>
                                    </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار تعديل وحذف فى فواتير الشراء</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="allowEditDelInBuyBills" {if
                                                   $loadData->allowEditDelInBuyBills eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->allowEditDelInBuyBills eq
                                            1} checked {/if} name="allowEditDelInBuyBills" type="radio" />
                                            لا </label>
                                    </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار تكويد المنتجات فى عرض فواتير الشراء </label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showSerializeBtn" {if
                                                   $loadData->showSerializeBtn eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->showSerializeBtn eq 1}
                                            checked {/if} name="showSerializeBtn" type="radio" />
                                            لا </label>
                                    </div>

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

                            <div class="form-group">
                                <label class="col-lg-3 control-label">السماح بحذف الفواتير</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR allowBillDelete" name="allowBillDelete"
                                                   type="radio" {if $loadData->allowBillDelete eq 0} checked {/if}/>

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR allowBillDelete" name="allowBillDelete"
                                                   type="radio" {if $loadData->allowBillDelete eq 1} checked {/if}/>
                                            لا </label>
                                    </div>

                                </div>

                            </div>
                            <!--==============================-->
                            <div class="form-group" id="billDeletePasswordDiv" {if $loadData->allowBillDelete eq
                                1}style="display: none"{/if}>
                                <label class="col-lg-3 control-label">كلمة سر حذف الفواتير</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <input type="password" class="form-control" name="billDeletePassword"
                                               value="{$loadData->billDeletePassword}" />
                                    </div>
                                </div>
                            </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار الاسعار فى تقرير مبيعات بنوع السعر</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="sellreportpricetype" {if
                                                   $loadData->sellreportpricetype eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->sellreportpricetype eq 1}
                                            checked {/if} name="sellreportpricetype" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>


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

                               <div class="form-group propbd">
                             <label class="col-lg-3 control-label">الخصم المباشر</label>
                              <div class="col-lg-4">
                                <div class="radio-inline">

                                <input  value="{$loadData->directDiscount}" type="text" class="form-control" name="directDiscount" />



                              </div>


                              </div>

                                  </div>


                            <!--==============================-->
                            <div class="form-group propbd">

                                <label class="col-lg-3 control-label">الخصم نسبه</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">

                                        <input value="{$loadData->percentageDiscount}" type="text" class="form-control"
                                               name="percentageDiscount" />



                                    </div>


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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار صافى الربح</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="netprofit" {if $loadData->netprofit eq
                                            0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->netprofit eq 1} checked
                                            {/if} name="netprofit" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار سعر الشراء فى عرض المنتجات و تفاصيل المنتج
                                    فى الفاتورة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="hideproductcatid" {if
                                                   $loadData->hideproductcatid eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="hideproductcatid" {if $loadData->hideproductcatid eq
                                            1} checked {/if} name="hideproductcatid" type="radio" />
                                            لا </label>
                                    </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">حفظ مباشر "بصريات"</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="directSaveBills" {if
                                                   {$loadData->directSaveBills} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="directSaveBills" {if
                                                   {$loadData->directSaveBills} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">نسخة احتياطية يدوى من قاعدة البيانات</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="showManualBackup" {if
                                                   {$loadData->showManualBackup} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="showManualBackup" {if
                                                   {$loadData->showManualBackup} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">حذف فى تقرير حركة المستخدمين</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="deleteMovementManage" {if
                                                   {$loadData->deleteMovementManage} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="deleteMovementManage" {if
                                                   {$loadData->deleteMovementManage} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">تحميل هواتف العملاء</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="downloadClientPhones" {if
                                                   {$loadData->downloadClientPhones} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="downloadClientPhones" {if
                                                   {$loadData->downloadClientPhones} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>

                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">جداول مراجعة الفواتير المسموحة</label>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label class="sr-only">
                                            <input type="checkbox" id="reviewBillsAllowedTables1"
                                                   name="reviewBillsAllowedTables[]" value="1" {if
                                                   1|in_array:$loadData->reviewBillsAllowedTables}checked{/if}>
                                            جديد نقدى
                                        </label>
                                        <label class="sr-only">
                                            <input type="checkbox" id="reviewBillsAllowedTables2"
                                                   name="reviewBillsAllowedTables[]" value="2" {if
                                                   2|in_array:$loadData->reviewBillsAllowedTables}checked{/if}>
                                            جديد عملاء
                                        </label>
                                        <label class="sr-only">
                                            <input type="checkbox" id="reviewBillsAllowedTables3"
                                                   name="reviewBillsAllowedTables[]" value="3" {if
                                                   3|in_array:$loadData->reviewBillsAllowedTables}checked{/if}>
                                            تمت مراجعتها
                                        </label>
                                        <label class="sr-only">
                                            <input type="checkbox" id="reviewBillsAllowedTables4"
                                                   name="reviewBillsAllowedTables[]" value="4" {if
                                                   4|in_array:$loadData->reviewBillsAllowedTables}checked{/if}>
                                            معلقة
                                        </label>
                                        <label class="sr-only">
                                            <input type="checkbox" id="reviewBillsAllowedTables5"
                                                   name="reviewBillsAllowedTables[]" value="5" {if
                                                   5|in_array:$loadData->reviewBillsAllowedTables}checked{/if}>
                                            ارشيف
                                        </label>

                                    </div>
                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار سعر الشراء فى تقرير المخازن</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showstoredetailprice" {if
                                                   $loadData->showstoredetailprice eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->showstoredetailprice eq 1}
                                            checked {/if} name="showstoredetailprice" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار ‏احصائيات ‏الصفحة الرئيسية</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showsIndexStatistics" {if
                                                   $loadData->showsIndexStatistics eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->showsIndexStatistics eq 1}
                                            checked {/if} name="showsIndexStatistics" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار خرائط ‏الصفحة الرئيسية</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showsIndexCharts" {if
                                                   $loadData->showsIndexCharts eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->showsIndexCharts eq 1}
                                            checked {/if} name="showsIndexCharts" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار تقرير المنتجات الاقل من الحد الادنى فى
                                    ‏الصفحة الرئيسية</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="showsIndexProductBelowLimitReport" {if
                                                   $loadData->showsIndexProductBelowLimitReport eq 1} checked {/if}
                                            type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" {if
                                                   $loadData->showsIndexProductBelowLimitReport eq 0} checked {/if}
                                            name="showsIndexProductBelowLimitReport" type="radio" />
                                            لا </label>
                                    </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">نسبة المندوب تقبض</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="mandobMethod" type="radio" {if
                                                   $loadData->mandobMethod eq 0} checked {/if}/>

                                            كمصروف </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="mandobMethod" type="radio" {if
                                                   $loadData->mandobMethod eq 1} checked {/if}/>
                                            كمكافئة </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">يوجد اضافة عميل فى الفاتورة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="addClientInBill" type="radio" {if
                                                   $loadData->addClientInBill eq 0} checked {/if}/>

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="addClientInBill" type="radio" {if
                                                   $loadData->addClientInBill eq 1} checked {/if}/>
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">يوجد اضافة مورد فى الفاتورة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="addsupplierInBill" type="radio" {if
                                                   $loadData->addsupplierInBill eq 0} checked {/if}/>

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="addsupplierInBill" type="radio" {if
                                                   $loadData->addsupplierInBill eq 1} checked {/if}/>
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار نقدى ومباشر</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showClientAndSupplierOne" type="radio"
                                                   {if $loadData->showClientAndSupplierOne eq 0} checked {/if}/>

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="showClientAndSupplierOne"
                                                   type="radio" {if $loadData->showClientAndSupplierOne eq 1} checked
                                            {/if}/>
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">خانة المخزن فى فاتورة الشراء فارغ</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="dontChooseStore" type="radio" {if
                                                   $loadData->dontChooseStore eq 1} checked
                                            {/if}/>
                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="dontChooseStore" type="radio" {if
                                                   $loadData->dontChooseStore eq 0} checked {/if}/>

                                            لا </label>
                                    </div>
                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اخفاء الاسعار فى الفواتير</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="hideBillPrices" type="radio" {if
                                                   $loadData->hideBillPrices eq 1} checked {/if}/>

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="hideBillPrices" type="radio" {if
                                                   $loadData->hideBillPrices eq 0} checked {/if}/>
                                            لا </label>
                                    </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار تعديل وحذف تحويل بين المخازن</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="allowStoreMoveUpdateDel" type="radio"
                                                   {if $loadData->allowStoreMoveUpdateDel eq 0} checked {/if}/>

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="allowStoreMoveUpdateDel"
                                                   type="radio" {if $loadData->allowStoreMoveUpdateDel eq 1} checked
                                            {/if}/>
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار الربح داخل فاتورة المبيعات</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="showProfitInsideBill" type="radio" {if
                                                   $loadData->showProfitInsideBill eq 1} checked {/if}/>

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="showProfitInsideBill" type="radio"
                                                   {if $loadData->showProfitInsideBill eq 0} checked {/if}/>
                                            لا </label>
                                    </div>

                                </div>
                            </div>

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">الاطلاع على قيمة الخزنة بعد التصفية</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" {if $loadData->showSaveBalanceAfterClose
                                            eq 0}
                                            checked {/if}
                                            name="showSaveBalanceAfterClose" type="radio" />
                                            لا </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="showSaveBalanceAfterClose"
                                                   type="radio" {if $loadData->showSaveBalanceAfterClose eq 1} checked
                                            {/if}/>

                                            نعم </label>
                                    </div>

                                    <div class="radio-inline">
                                        <label>
                                            <input value="2" class="noradioR" name="showSaveBalanceAfterClose"
                                                   type="radio" {if $loadData->showSaveBalanceAfterClose eq 2} checked
                                            {/if}/>
                                            الاطلاع قبل وبعد </label>
                                    </div>

                                </div>
                            </div>

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">تستطيع التعديل في نسب الإضافة والخصم في
                                    الفاتورة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="canEditAddDiscountPercentage"
                                                   type="radio" {if $loadData->canEditAddDiscountPercentage eq 1} checked
                                            {/if}/>

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" {if
                                                   $loadData->canEditAddDiscountPercentage eq 0}
                                            checked {/if}
                                            name="canEditAddDiscountPercentage" type="radio" />
                                            لا </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">ايقاف تعديل و حذف الفاتوره التى لها دفعات</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="noBillEditIfTheirIsPayments"
                                                   type="radio" {if $loadData->noBillEditIfTheirIsPayments eq 0} checked{/if}/>
                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->noBillEditIfTheirIsPayments eq 1} checked {/if}
                                            name="noBillEditIfTheirIsPayments" type="radio" />
                                            لا </label>
                                    </div>
                                </div>
                            </div>

                            <!--==============================-->
                            <div class="well well-sm modfywall">
                                <div class="form-group ">
                                    <label class="col-lg-3 control-label">خواص المطاعم</label>
                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">الاطلاع على جميع الصالات </label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="seeAllHalls" {if
                                                   {$loadData->seeAllHalls} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="seeAllHalls" {if
                                                   {$loadData->seeAllHalls} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>

                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار زر الصفحة الرئيسية </label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="homePageIcon" {if
                                                   {$loadData->homePageIcon} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="homePageIcon" {if
                                                   {$loadData->homePageIcon} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">طباعة للمطبخ تلقائيا مع انهاء الفاتورة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="autoKitchenPrint" {if
                                                   {$loadData->autoKitchenPrint} eq 1} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="autoKitchenPrint" {if
                                                   {$loadData->autoKitchenPrint} eq 0} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">الأزرار المسموح بها</label>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label class="sr-only">
                                            <input type="checkbox" id="sendKitchen" name="sendKitchen" value="1" {if
                                                   $loadData->sendKitchen == 1}checked{/if}>
                                            ارسال للمطبخ
                                        </label>

                                        <label class="sr-only">
                                            <input type="checkbox" id="printKitchen" name="printKitchen" value="1" {if
                                                   $loadData->printKitchen == 1}checked{/if}>
                                            طباعة للمطبخ
                                        </label>

                                        <label class="sr-only">
                                            <input type="checkbox" id="endBill" name="endBill" value="1" {if
                                                   $loadData->endBill == 1}checked{/if}>
                                            انهاء الفاتورة
                                        </label>

                                        <label class="sr-only">
                                            <input type="checkbox" id="endPrintBill" name="endPrintBill" value="1" {if
                                                   $loadData->endPrintBill == 1}checked{/if}>
                                            طباعة وانهاء الفاتورة
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">مسموح للمجموعة بـ</label>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label class="sr-only">
                                            <input type="checkbox" id="takeAway" name="takeAway" value="1" {if
                                                   $loadData->takeAway == 1}checked{/if}>
                                            تيك أواى
                                        </label>

                                        <label class="sr-only">
                                            <input type="checkbox" id="delivery" name="delivery" value="1" {if
                                                   $loadData->delivery == 1}checked{/if}>
                                            دليفرى
                                        </label>

                                        <label class="sr-only">
                                            <input type="checkbox" id="hall" name="hall" value="1" {if $loadData->hall
                                            == 1}checked{/if}>
                                            صالة
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">الدخول تلقائى على</label>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label class="sr-only">
                                            <input type="radio" class="radioR" name="restaurantDefaultPage" value="0"
                                                   {if {$loadData->restaurantDefaultPage} eq 0} checked {/if} >
                                            الرئيسية
                                        </label>
                                        <label class="sr-only">
                                            <input type="radio" class="radioR" name="restaurantDefaultPage" value="-1"
                                                   {if {$loadData->restaurantDefaultPage} eq -1} checked {/if}>
                                            تيك أواى
                                        </label>

                                        <label class="sr-only">
                                            <input type="radio" class="radioR" name="restaurantDefaultPage" value="-2"
                                                   {if {$loadData->restaurantDefaultPage} eq -2} checked {/if}>
                                            دليفرى
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">قيمة المدفوع</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="kitchenPayedVal" {if
                                                   {$loadData->kitchenPayedVal} eq 0} checked {/if} type="radio" />

                                            صفر </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="kitchenPayedVal" {if
                                                   {$loadData->kitchenPayedVal} eq 1} checked {/if} type="radio" />
                                            الاجمالى </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">تعديل المدفوع</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="kitchenPayedChange" {if
                                                   {$loadData->kitchenPayedChange} eq 0} checked {/if} type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="kitchenPayedChange" {if
                                                   {$loadData->kitchenPayedChange} eq 1} checked {/if} type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">زر حجز البلاى ستيشن</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="radioR" name="restaurantplaystationpalyBtn" {if
                                                   {$loadData->restaurantplaystationpalyBtn} eq 1} checked {/if}
                                            type="radio" />

                                            نعم </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="noradioR" name="restaurantplaystationpalyBtn" {if
                                                   {$loadData->restaurantplaystationpalyBtn} eq 0} checked {/if}
                                            type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="well well-sm modfywall">
                                <div class="form-group ">
                                    <label class="col-lg-6 control-label">خواص تقرير نسب الخصومات على الفواتير</label>
                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">تعطيل الخصم على اجمالى الفواتير </label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="stopDiscountOfTotalControl" {if
                                                   $loadData->stopDiscountOfTotalControl eq 0} checked {/if} type="radio"
                                            />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->stopDiscountOfTotalControl
                                            eq 1} checked {/if} name="stopDiscountOfTotalControl" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">السماح بالتعديل على الخصم فى الفاتورة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="discountOfTotalControlEditable" {if
                                                   $loadData->discountOfTotalControlEditable eq 0} checked {/if}
                                            type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if
                                                   $loadData->discountOfTotalControlEditable eq 1} checked {/if}
                                            name="discountOfTotalControlEditable" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">السماح بتخطى نسبة الخصم المسموح للمجموعة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="discountOfTotalControlMTGDA" {if
                                                   $loadData->discountOfTotalControlMTGDA eq 0} checked {/if} type="radio"
                                            /><!-- MTGDA more than group discount Allowed -->

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->discountOfTotalControlMTGDA
                                            eq 1} checked {/if} name="discountOfTotalControlMTGDA" type="radio"
                                            /><!-- MTGDA more than group discount Allowed -->
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="well well-sm modfywall">
                                <div class="form-group ">
                                    <label class="col-lg-6 control-label">خواص تقرير الاصناف بكل الاسعار - التحويل بين
                                        المخازن</label>
                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار الكمية بالمخزن</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showsStorerQuantity" {if
                                                   $loadData->showsStorerQuantity eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->showsStorerQuantity eq 1}
                                            checked {/if} name="showsStorerQuantity" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>


                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار سعر التجزئة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showSellUnitPrice" {if
                                                   $loadData->showSellUnitPrice eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->showSellUnitPrice eq 1}
                                            checked {/if} name="showSellUnitPrice" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>


                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار سعر النصف جملة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showSellHalfPrice" {if
                                                   $loadData->showSellHalfPrice eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->showSellHalfPrice eq 1}
                                            checked {/if} name="showSellHalfPrice" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>


                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار سعر الجملة</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showSellAllPrice" {if
                                                   $loadData->showSellAllPrice eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->showSellAllPrice eq 1}
                                            checked {/if} name="showSellAllPrice" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>


                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">اظهار سعر الشراء</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="showBuyPrice" {if
                                                   $loadData->showBuyPrice eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->showBuyPrice eq 1} checked
                                            {/if} name="showBuyPrice" type="radio" />
                                            لا </label>
                                    </div>

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

                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">مخزن مباشر او وسيط</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="storeSupervisorShow" type="radio" {if
                                                   $loadData->storeSupervisorShow eq 0} checked {/if}/>

                                            اخفاء </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" name="storeSupervisorShow" type="radio"
                                                   {if $loadData->storeSupervisorShow eq 1} checked {/if}/>
                                            اظهار </label>
                                    </div>

                                </div>
                            </div>

                            <!--==============================-->
                            <div class="well well-sm modfywall">
                                <div class="form-group ">
                                    <label class="col-lg-3 control-label">اعدادات الاشعارات</label>
                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">المنتجات الاقل من الحد الادنى</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="productno" {if $loadData->productno eq
                                            0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->productno eq 1} checked
                                            {/if} name="productno" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">الكمبيالات</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="kempilano" {if $loadData->kempilano eq
                                            0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->kempilano eq 1} checked
                                            {/if} name="kempilano" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label"> المنتجات الراكده من اسبوع</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="productnotsellno" {if
                                                   $loadData->productnotsellno eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->productnotsellno eq 1}
                                            checked {/if} name="productnotsellno" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label"> شيكات العملاء </label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="clientcheckno" {if
                                                   $loadData->clientcheckno eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->clientcheckno eq 1} checked
                                            {/if} name="clientcheckno" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label"> شيكات الموردين</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="suppliercheckno" {if
                                                   $loadData->suppliercheckno eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->suppliercheckno eq 1}
                                            checked {/if} name="suppliercheckno" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label"> طلبات المنتجات</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="productRequist" {if
                                                   $loadData->productRequist eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->productRequist eq 1}
                                            checked {/if} name="productRequist" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label"> طلبات أخرى من الفروع</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="otherRequist" {if
                                                   $loadData->otherRequist eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->otherRequist eq 1} checked
                                            {/if} name="otherRequist" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label">متاخرات البصريات</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="toWorkShopOrder" {if
                                                   $loadData->toWorkShopOrder eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->toWorkShopOrder eq 1}
                                            checked {/if} name="toWorkShopOrder" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                            <div class="form-group propbd">
                                <label class="col-lg-3 control-label"> فواتير التأمين</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="radioR" name="insuranceBill" {if
                                                   $loadData->insuranceBill eq 0} checked {/if} type="radio" />

                                            نعم</label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="noradioR" {if $loadData->insuranceBill eq 1} checked
                                            {/if} name="insuranceBill" type="radio" />
                                            لا </label>
                                    </div>

                                </div>
                            </div>
                            <!--==============================-->
                        </div><!-- end the 3rd tab -->
                    </div><!-- end of tabs -->
                    <!--==============================-->

                    <!--==============================-->
                    <div class="form-group">
                        <div class="col-lg-offset-8 col-lg-4">
                            <button type="button" class="btn btn-primary pull-left" id="spbutton">تعديل</button>
                        </div>
                    </div>






                </form>

            </div>

        </div>

    </div>
</div>
{literal}
<script type="text/javascript">
    var namesx = new Spry.Widget.ValidationTextField("namesx");
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {invalidValue: "-1"});
    var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {invalidValue: "-1"});</script>
{/literal}
{literal}
<script type="text/javascript">
    /* ---------------------------------------------------------------------- */
    //## record changes part

    //get hidden properities to remove it as it wont be changed
    $('input[type="hidden"][name^="propertydefault"]').each(function () {
        var i = $(this).attr('name').substr(15);
        $('[name="propertydefault' + i + '"]').remove();
        $('[name="propertyid' + i + '"]').remove();
        $('[name="theorder' + i + '"]').remove();
        $('[name="relusergrouppropertiesid' + i + '"]').remove();
    });
    $('select, textarea').change(function () {
        $(this).addClass('edited');
    });
    $('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^="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="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="theorder' + i + '"]').addClass('edited');
                    $('[name="relusergrouppropertiesid' + i + '"]').addClass('edited');
                } else {
                    $(this).addClass('edited');
                }
                break;
            default:
                $(this).addClass('edited');
                break;
        }
        $(this).addClass('edited');
    });
    /* ---------------------------------------------------------------------- */
    $('#spbutton').live('click', function (e) {
        //ckeck name
        var tableName = 'usergroup';
        var inputName = 'usergroupname';
        var name = $("#" + inputName).val();
        var id = $("#usergroupid").val();
        $.ajax({
            url: 'checkRedundantNames.php?do=checkNameWithId&name=' + name + '&id=' + id + '&tablename=' + tableName,
            success: function (data) {
                //alert(data);
                if (data == '0') {
                    $("#nameError").css("display", "none");
                    var myForm = document.getElementById("spform");
                    var SS = Spry.Widget.Form.validate(myForm);
                    if (SS == true) {
                        if (!$('#spbutton').hasClass("processing")) {
                            $('#spbutton').addClass("processing");
                            /* ---------------------------------------------------------------------- */
                            //## 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');
                            });
                            /* ---------------------------------------------------------------------- */
                            var obj = {};
                            /* Iterate over every input. */
                            $("#props [type='text'], #props [type='hidden'], #props [type='radio']:checked").each(function () {
                                //console.log($(this).attr('name') + ' ++++++ ' + $(this).val());
                                /* Cache the id of the input. */
                                obj[$(this).attr('name')] = $(this).val();
                                $(this).removeAttr('name');
                            });
                            $('#allPropsJson').val(JSON.stringify(obj));
                            /* ---------------------------------------------------------------------- */
                            myForm.submit();
                            //$('#spbutton').unbind('click');
                        }
                    }

                } else if (data == '1') {
                    $("#" + inputName).val("");
                    $("#" + inputName).focus();
                    $("#nameError").css("display", "block");
                    return false;
                }
            }
        });
    });
</script>
{/literal}