

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

        <ol class="breadcrumb">
            <li><a href="#">بصريات </a></li>
            <li><a href="otherrequests.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" id="otherrequestsForm" role="form" action="otherrequests.php?do=update" method="post"  enctype="multipart/form-data">

                    <div class="form-group">

                        <label class="col-lg-2 control-label">ارسال الطلب الى  </label>
                        <div class="col-lg-4">
                            <div class="radio-inline">
                                <label>
                                    <input value="0" {if $otherRequest->requestTo == 0}  checked  {/if} class="requestTo"  name="requestTo"   type="radio"  />

                                    فرع  </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="1"   {if $otherRequest->requestTo == 1}  checked  {/if}  class="requestTo" name="requestTo"  type="radio" />
                                    مجموعه مستخدمين  </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="2"   {if $otherRequest->requestTo == 2}  checked  {/if}  class="requestTo" name="requestTo"  type="radio" />
                                    مستخدم </label>
                            </div>
                        </div>
                    </div>


                    <div class="row">
                        <hr/>
                        <div class="col-lg-6">
                            <h4></h4>
                        </div>
                        <div class="col-lg-6">
                            <h4></h4>
                        </div>
                    </div>

                    <div id="toBranch" {if $otherRequest->requestTo != 0}  style="display: none;"  {/if}>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">اسم الفرع  </label>
                            <div class="col-lg-6">
                                <select name="branchId" id="branchId" data-placeholder="اختر"  class="select2 wdt100" >
                                    <option value="-1"> اختر </option>
                                    {foreach $branches as $branch}
                                    <option value="{$branch->branchId}"  {if $otherRequest->requestTo == 0 && $otherRequest->requestToId == $branch->branchId}  selected  {/if} >{$branch->branchName} </option>
                                    {/foreach}
                                </select>

                            </div>
                            <span id="branchIdError" class=" alert-block alert-danger fade in" style="padding: 5px 5px 5px 5px; display: none ;">اختر الفرع أولا</span>
                        </div>
                    </div>

                    <div id="toUserGroup"  {if $otherRequest->requestTo != 1}  style="display: none;"  {/if}>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">المجموعة </label>
                            <div class="col-lg-6">
                                <select name="userGroupId" id="userGroupId" data-placeholder="اختر"  class="select2 wdt100" >
                                    <option value="-1"> اختر </option>
                                    {foreach $userGroups as $userGroup}
                                    <option value="{$userGroup->usergroupid}"  {if $otherRequest->requestTo == 1 && $otherRequest->requestToId == $userGroup->usergroupid}  selected  {/if}>{$userGroup->usergroupname} </option>
                                    {/foreach}
                                </select>

                            </div>
                            <span id="userGroupIdError" class=" alert-block alert-danger fade in" style="padding: 5px 5px 5px 5px; display: none ;">اختر المجموعة أولا</span>
                        </div>
                    </div>

                    <div id="toUser" {if $otherRequest->requestTo != 2}  style="display: none;"  {/if} >
                        <div class="form-group">
                            <label class="col-lg-2 control-label">المستخدم </label>
                            <div class="col-lg-6">
                                <select name="userId" id="userId" data-placeholder="اختر"  class="select2 wdt100" >
                                    <option value="-1"> اختر </option>
                                    {foreach $users as $user}
                                    <option value="{$user->userid}"  {if $otherRequest->requestTo == 2 && $otherRequest->requestToId == $user->userid}  selected  {/if}>{$user->username} </option>
                                    {/foreach}
                                </select>

                            </div>
                            <span id="userIdError" class=" alert-block alert-danger fade in" style="padding: 5px 5px 5px 5px; display: none ;">اختر المستخدم أولا</span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-lg-2 control-label">عنوان الطلب </label>
                        <div class="col-lg-6">
                            <input name="requestTitle" id="requestTitle" type="text"  class="form-control" value="{$otherRequest->requestTitle}" />

                        </div>
                        <span id="requestTitleError" class=" alert-block alert-danger fade in" style="padding: 5px 5px 5px 5px; display: none ;">ادخل عنوان الطلب </span>
                    </div>

                    <div class="form-group">
                        <label class="col-lg-2 control-label">المحتوى </label>
                        <div class="col-lg-6">
                            <textarea class="form-control" rows="5" name="comment" id="comment"> {$otherRequest->comment} </textarea>
                        </div>
                    </div>


                    <div class="form-group">
                        <div class="col-lg-8">
                            <input name="edit" id="edit" type="hidden" value="1" />
                            <input name="requestId" id="requestId" type="hidden" value="{$otherRequest->id}" />
                            <button type="button"  class="btn btn-primary pull-left saveRequestOther">ارسال  </button>
                        </div>

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

            <hr/>

            <div class="clearfix"></div>


        </div>




    </div>
</div>




