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

        <ol class="breadcrumb">
            <li><a href="#">المصروفات والايرادات</a></li>
            <li><a href="bankaccountController.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">


                {literal}
                <form id='myBankAccForm' class="nameToBeChecked form-horizontal" action="bankaccountController.php?do=update" method="post" >
                    {/literal}

                    <div class="form-group">
                        <label for="bankid" class="col-lg-2 control-label"> البنك</label>
                        <div class="col-lg-4">
                            <p class="form-control-static">
                                {foreach $bankData as $bank}
                                {if {$loadData->bankid} eq {$bank->bankid}} {$bank->bankname} {/if}

                                {/foreach}
                            </p>
                            <div id="bankidError" style="display:none;"></div>

                        </div>
                    </div>



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

                    <div class="form-group">
                        <label for="accountname" class="col-lg-2 control-label"> اسم الحساب</label>
                        <div class="col-lg-4">

                            <input type="text" name="accountname" id="accountname" class="form-control" placeholder="اسم الحساب" value="{$loadData->accountname}" />
                            <div id="accuntNameError" style="display:none;"></div>
                        </div>
                    </div>


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



                    <div class="form-group">
                        <label for="accountnumber" class="col-lg-2 control-label"> رقم الحساب</label>
                        <div class="col-lg-4">

                            <input type="text" name="accountnumber" id="accountnumber" class="form-control" placeholder="رقم الحساب" value="{$loadData->accountnumber}" />
                            <div id="accuntNumberError" style="display:none;"></div>
                        </div>
                    </div>


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


                    <div class="form-group">
                        <label for="accountbeginingbalance" class="col-lg-2 control-label">قيمة الحساب</label>
                        <div class="col-lg-4">
                            <div class="input-group">
                                <input type="text" name="accountbeginingbalance" id="accountbeginingbalance"   class="form-control numberinput" placeholder="قيمة الحساب" readonly value="{$loadData->accountbeginingbalance}"/>
                                <span class="input-group-addon">{$currency}</span>
                            </div>
                            <div id="balanceError" style="display:none;"></div>
                        </div>
                    </div>


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



                    <div class="form-group">
                        <label for="accountcurrencytype" class="col-lg-2 control-label">نوع العملة</label>
                        <div class="col-lg-4">
                            <input type="text" name="accountcurrencytype" id="accountcurrencytype"  class="form-control " placeholder="نوع العملة" value="{$loadData->accountcurrencytype}"/>
                            <div id="typeError" style="display:none;"></div>
                        </div>
                    </div>


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



                    <div class="form-group">
                        <label for="accountcurrencytype" class="col-lg-2 control-label">فيزا</label>
                        <div class="col-lg-4">
                            <input type="checkbox" name="visa" id="visa" value="1" {if $loadData->visa == 1}checked{/if}/>
                        </div>
                    </div>
                    <div class="form-group" id="visaDisPerDiv" {if $loadData->visa != 1}style="display: none"{/if}>
                        <label for="accountcurrencytype" class="col-lg-2 control-label">نسبة مصروفات الفيزا</label>
                        <div class="col-lg-4">
                            <input type="text" name="visaDisPer" id="visaDisPer" class="form-control positivefloat" placeholder="0" value="{$loadData->visaDisPer}"/>
                        </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="accountid" id="accountid" value="{$loadData->accountid}"/>
                    <input type="hidden" name="accountdate" value="{$loadData->accountdate}"/>
                    <input type="hidden" id="bankid" name="bankid" value="{$loadData->bankid}"/>
                    <input type="hidden" id="oldname" name="oldname" value="{$loadData->accountname}"/>

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


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


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




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




    </div>
</div>



{literal}

<script type="text/javascript">

    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "real");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
    $('#visa').live('change', function () {
        if ($(this).attr('checked') == "checked") {
            $('#visaDisPerDiv').show();
        } else {
            $('#visaDisPerDiv').hide();
        }
    });
</script>

{/literal}

