

<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="userController.php?do=show">المستخدمين</a></li>
            <li class="active">تعديل مستخدم</li>
        </ol>


        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">تعديل مستخدم</h3>
            </div>
            <div class="panel-body">
                <form class="form-horizontal" role="form" action="userController.php?do=update" method="post">




                    <div class="form-group">
                        <label for="username" class="col-lg-2 control-label">اسم المستخدم</label>
                        <div class="col-lg-4">

                            <span id="name">
                                <input type="text" class="form-control" placeholder="اسم المستخدم" name="username" onkeyup="chechUserValidById(this.value);" value="{$loadData->username}">
                                <span class="textfieldRequiredMsg">*</span></span>


                            <div id="usernamedata" 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 for="password" class="col-lg-2 control-label">كلمة المرور</label>
                        <div class="col-lg-4">

                            <span id="sprytextfield1">
                                <input type="password" name="password" class="form-control" placeholder="كلمة المرور" value="{$loadData->password}"/>
                                <span class="textfieldRequiredMsg">*</span></span>

                        </div>
                    </div>



                    <div class="form-group">
                        <label for="employeename" class="col-lg-2 control-label">اسم الموظف</label>
                        <div class="col-lg-4">

                            <span id="sprytextfield2">
                                <input type="text" class="form-control" placeholder="اسم الموظف" name="employeename"  value="{$loadData->employeename}">
                                <span class="textfieldRequiredMsg">*</span></span>

                        </div>
                    </div>




                    <div class="form-group">
                        <label for="usergroupid" class="col-lg-2 control-label">المجموعة</label>
                        <div class="col-lg-4">


                            <span id="spryselect2">
                                <select class="select2 wdt100" name="usergroupid" id="usergroupid">

                                    {foreach $UserGroupData as $UserGroup}

                                    <option {if {$loadData->usergroupid} eq {$UserGroup->usergroupid}} selected="selected" {/if}  value="{$UserGroup->usergroupid}">{$UserGroup->usergroupname}</option>

                                    {/foreach}

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


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

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

                    <div class="form-group">
                        <label for="usergroupid" class="col-lg-2 control-label"> الفرع</label>
                        <div class="col-lg-4">

                            <select required  class="select2 wdt100" name="branchid" id="branchid">
                                <option value="-1">اختر الفرع</option>
                                <option value="0" {if {$loadData->branchId} eq 0} selected="selected" {/if}>  كل الفروع</option>

                                {foreach $allbranchdata as $myallbranchdata}

                                <option {if {$loadData->branchId} eq {$myallbranchdata->branchId}} selected="selected" {/if}     value="{$myallbranchdata->branchId}">{$myallbranchdata->branchName}</option>
                                {/foreach}


                            </select>

                        </div>
                    </div>

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


                    <div class="form-group">
                        <label for="employeename" class="col-lg-2 control-label">نسبه {if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if}</label>
                        <div class="col-lg-4"><span id="sprytextfield3">
                                <input type="text"  class="form-control" placeholder="نسبه {if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if}" value="{$loadData->awardrate}" name="awardrate" />
                                <span class="textfieldRequiredMsg">***.</span><span class="textfieldInvalidFormatMsg">ادخل رقم مناسب.</span></span></div>
                    </div>

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



                    <div class="form-group">
                        <label for="saveid" class="col-lg-2 control-label">الخزنة</label>
                        <div class="col-lg-4">

                            <span id="spryselect3">
                                <select class="select2 wdt100" name="saveid" id="saveid">


                                    {foreach $saveData as $save}

                                    <option {if {$loadData->saveid} eq {$save->saveid}} selected="selected" {/if} value="{$save->saveid}">{$save->savename}</option>

                                    {/foreach}


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




                    <div class="form-group">
                        <label for="saveid" class="col-lg-2 control-label">البحث فى يوميه الخزنه</label>
                        <div class="col-lg-4">


                            <select class="select2 wdt100" name="searchinonesave" id="searchinonesave">
                                <option   {if {$loadData->searchinonesave} eq 0} selected="selected" {/if}  value="0">كل الخزن</option>
                                <option {if {$loadData->searchinonesave} eq 1} selected="selected" {/if} value="1">خزنه المستخدم فقط</option>
                            </select>

                        </div>
                    </div>




                    <div class="form-group">
                        <label for="userstoreid" class="col-lg-2 control-label">المخزن</label>
                        <div class="col-lg-4">

                            <span id="spryselect4">
                                <select class="select2 wdt100" name="userstoreid" id="userstoreid">
                                    <option value="-1">اختر المخزن</option>
                                    <option value="0" {if {$loadData->userstoreid} eq '0'} selected="selected" {/if}>كل المخازن</option>
                                    {foreach $storData as $mystorData}

                                    <option value="{$mystorData->storeId}" {if {$loadData->userstoreid} eq {$mystorData->storeId}} selected="selected" {/if}>{$mystorData->storeName}</option>

                                    {/foreach}


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





                    <input type="hidden" name="userid" id="userid" value="{$loadData->userid}"/>
                    <input type="hidden" name="currentdate" value="{$loadData->currentdate}"/>
                    <input type="hidden" name="conditions" value="{$loadData->conditions}"/>





                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit" id="submit" class="btn btn-primary pull-left">حفظ الامر</button>
                        </div>
                    </div>




                </form>
            </div>
        </div>




    </div>
</div>



{literal}
<script type="text/javascript">
    var name = new Spry.Widget.ValidationTextField("name");
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "real");
</script>
{/literal}
