

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

        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="partnerTransferBetweenController.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="partnerTransferBetweenController.php?do=update" method="post" id="submitnew">
                    <div class="form-group">
                        <label for="partnerid" class="col-lg-2 control-label">من الشريك</label>
                        <div class="col-lg-4">
                            <span id="spryselect1">
                                <select class="select2 wdt100" name="partneridfrom" id="partneridfrom">
                                    <option value="-1">اختر شريك</option>
                                    {foreach $partnerData as $partner}
                                    <option value="{$partner->partnerid}" data-money="{$partner->partnermoney}" {if  $loadData->partneridfrom eq $partner->partnerid} selected="" {/if}>{$partner->partnername}</option>
                                    {/foreach}
                                </select>
                                <span class="selectInvalidMsg"> *</span></span>
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">

                        <label for="partnervalue" class="col-lg-2 control-label" id="two"  >قيمة الايداع</label>

                        <label for="partnerwithdrawalvalue" class="col-lg-2 control-label" id="container"  style="display:none">قيمة السحب</label>



                        <div class="col-lg-4">


                            <div class="input-group">

                                <span id="sprytextfield2">
                                    <input type="text" name="partnervalue" id="partnervalue"    class="form-control positivefloat" autocomplete="off" placeholder="قيمة السحب"   value="{$loadData->partnervalue}" />
                                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">ادخل القيمة صحيحة</span></span>

                                <span class="input-group-addon">{$currency}</span>
                            </div>


                        </div>
                    </div>
                     <div class="form-group">
                        <label for="partnerid" class="col-lg-2 control-label">الى  الشريك</label>
                        <div class="col-lg-4">
                            <span id="spryselect1">
                                <select class="select2 wdt100" name="partneridto" id="partneridto" disabled="">
                                    <option value="-1">اختر شريك</option>
                                    {foreach $partnerData as $partner}
                                    <option value="{$partner->partnerid}" {if  $loadData->partneridto eq $partner->partnerid} selected="" {/if}>{$partner->partnername}</option>
                                    {/foreach}
                                </select>
                                <span class="selectInvalidMsg"> *</span></span>
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="comment" class="col-lg-2 control-label">التعليق</label>
                        <div class="col-lg-4">

                            <textarea  class="form-control" rows="3" name="comment">{$loadData->comment}</textarea>

                        </div>
                    </div>
                    <input type="hidden" name="oldpartneridfrom" id="oldpartneridfrom"
                    value="0" data-name="">
                    <input type="hidden" name="oldpartnertransferbetweenid" 
                    value="{$loadData->partnertransferbetweenid}">

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

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="button"  class="btn btn-primary pull-left submitnew">تعديل  الامر</button>
                        </div>
                    </div>




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




    </div>
</div>



{literal}

<script type="text/javascript">

  
$(document).ready(function() {
   $(document).on('change', "#partneridfrom", function ()
    {
      var oldpartneridfrom = $("#oldpartneridfrom").val();
      if (oldpartneridfrom > 0) {
        var dataname = $("#oldpartneridfrom").attr("data-name");
        $("#partneridto").append('<option value='+oldpartneridfrom+' >'+dataname+'</option>');
      }
      var partneridfrom = $(this).val();
      var text = $(this).find('option:selected').text();
      $("#oldpartneridfrom").attr("data-name",text);
      $("#oldpartneridfrom").val(partneridfrom);
      $("#partneridto").attr('disabled',false);
      var optionmoney = $(this).find('option:selected').attr('data-money');
      $("#partnervalue").val(optionmoney);
      $('#partneridto option[value='+partneridfrom+']').remove();
    
    });
  
});


</script>
{/literal}
