


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

        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="partnerwithdrawalController.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="partnerwithdrawalController.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">


                            <select class="select2 wdt100" name="partnerid" id="partnerid">


                                {foreach $partnerData as $partner}

                                <option {if {$loadData->partnerid} eq {$partner->partnerid}} selected {/if} value="{$partner->partnerid}">{$partner->partnername}</option>
                                {/foreach}

                            </select>

                        </div>
                    </div>

                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="storereporttype" class="col-lg-2 control-label">نوع العملية</label>
                        <div class=" col-lg-4">
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="partenrwithdrawaltype" id="addvalue" value="0" {if {$loadData->partenrwithdrawaltype} eq 0 } checked {/if} onclick="showhidediv(this);" checked>
                                    ايداع </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="partenrwithdrawaltype" id="discountvalue" value="1" {if {$loadData->partenrwithdrawaltype} eq 1 } checked {/if} onclick="showhidediv(this);">
                                    سحب </label>
                            </div>
                        </div>
                    </div>

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

                        <label for="partnerwithdrawalvalue" 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">
                                <!--onKeyUp="checksaveValue();"-->

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

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


                        </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="0"  name="paymethod_disabled" id="PMSave" class="PMethod" {if $loadData->saveid > 0}checked="checked"{/if}   type="radio" disabled/>

                                    خزنة </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="1" name="paymethod_disabled" id="PMBank" class="PMethod" {if $loadData->bankid > 0}checked="checked"{/if} type="radio" disabled/>
                                    بنك </label>
                            </div>
                            <input type="hidden" name="paymethod" value="{if $loadData->saveid > 0}0{else if $loadData->bankid > 0}1{/if}"/>
                        </div>
                    </div>

                    {if $loadData->saveid > 0}

                    <div class="form-group">
                        <label for="inputEmail1" class="col-lg-2 control-label">الخزنة</label>
                        <div class="col-lg-4">
                            {$saveData->savename}
                            <input type="hidden" name="saveid" id="saveid" value="{$loadData->saveid}"/>
                        </div>
                    </div>
                    {else if $loadData->bankid > 0}
                    <div class="form-group">
                        <label for="inputEmail1" class="col-lg-2 control-label">البنك</label>
                        <div class="col-lg-4">
                            {$loadData->bankname}

                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail1" class="col-lg-2 control-label">الحساب</label>
                        <div class="col-lg-4">
                            {$bankAccount->accountname}
                            <input type="hidden" name="bankaccountid" id="bankaccountid" value="{$bankAccount->accountid}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail1" class="col-lg-2 control-label">رقم الشيك</label>
                        <div class="col-lg-4">
                            {$loadData->checknum}
                            <input type="hidden" name="bankaccountid" id="bankaccountid" value="{$loadData->checknum}"/>
                        </div>
                    </div>
                    {/if}

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





                    <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="dailyentryid" value="{$loadData->dailyentryid}" />
                    <input type="hidden" name="partnerwithdrawalid" value="{$loadData->partnerwithdrawalid}"/>
                    <input type="hidden" name="partnerwithdrawaldate" value="{$loadData->partnerwithdrawaldate}"/>
                    <input type="hidden" name="partnervalue" value="{$loadData->partnerwithdrawalvalue}"/>
                    <input type="hidden" name="partnertype" value="{$loadData->partenrwithdrawaltype}"/>
                    <input type="hidden" name="conditions" value="{$loadData->conditions}"/>

                    <input type="hidden" name="saveid" value="{$loadData->saveid}"/>

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


                    <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">

    function showhidediv(rad) {
        var rads = document.getElementsByName(rad.name);
        document.getElementById('two').style.display = (rads[0].checked) ? 'block' : 'none';
        document.getElementById('container').style.display = (rads[1].checked) ? 'block' : 'none';

        $("#partnerwithdrawalvalue").val(0);
    }
</script>
{/literal}
