

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

        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="currencyController.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 id="myform" class="nameToBeChecked form-horizontal" role="form" action="currencyController.php?do=update" method="post">




                    <div class="form-group">
                        <label class="col-lg-2 control-label">اسم العملة</label>
                        <div class="col-lg-4">
                            <span id="sprytextfield1">
                                <input type="text" name="name" id="name" class="form-control" value="{$loadData->name}"/>
                                <span class="textfieldRequiredMsg">*</span></span>
                            <div id="nameError" style="display:none"></div>
                        </div>
                    </div>

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




                    <div class="form-group">
                        <label class="col-lg-2 control-label">رمز العملة</label>
                        <div class="col-lg-4">

                            <input type="text" name="symbol" id="symbol" class="form-control " value="{$loadData->symbol}"/>

                        </div>
                    </div>


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



                    <div class="form-group">
                        <label class="col-lg-2 control-label">معامل التحويل</label>
                        <div class="col-lg-4">
                            <span id="sprytextfield2">
                                <input type="text" name="conversionFactor" id="conversionFactor" class="form-control positivefloat calcOther" style="display: inline-block;width: 34%" value="{$loadData->conversionFactor}"/>
                                <span class="textfieldRequiredMsg">*</span></span>
                            =
                            <div class="input-group" style="display: inline;">
                                <input type="text" name="othercFactor" id="othercFactor"  class="form-control positivefloat calcOther" style="display: inline-block;width: 34%" value="{$loadData->otherconversionFactor}">
                                <span class="input-group-addon" style="display: inline-block;width: 23%">{$Programsettingdata->currancy}</span>
                            </div>
                        </div>
                    </div>

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

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

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


                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit" id="savebtn"  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");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    $('.calcOther').live('keyup', function () {
        var val = Number($(this).val());
        if (val == 0) {
            var otherVal = 0;
        } else {
            var otherVal = Number((1 / val).toFixed(10));
        }
        if ($(this).attr('id') == 'conversionFactor') {
            $('#othercFactor').val(otherVal);
        } else {
            $('#conversionFactor').val(otherVal);
        }

    });
</script>
{/literal}
