

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


                {literal}
                <form id="myform" class="nameToBeChecked form-horizontal" role="form" action="currencyController.php?do=add" method="post" >

                    {/literal}




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

                        </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%"/>
                                <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%">
                                <span class="input-group-addon" style="display: inline-block;width: 23%">{$Programsettingdata->currancy}</span>
                            </div>
                        </div>

                    </div>

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

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