


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

        <ol class="breadcrumb">
            <li><a href="#">المصروفات والايرادات</a></li>
            <li><a href="transfermoneyController.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="myTranMnyform" class="form-horizontal" role="form" action="transfermoneyController.php?do=update" method="post" >
                    <!--    <div class="form-group">
                           <label for="saveidfrom" class="col-lg-2 control-label">من الخزنة</label>
                           <div class="col-lg-4">
                               <select class="select2 wdt100" name="saveidfrom" id="saveidfrom" onChange="loadsaveTo();">
                                   <option value="-1" >اختر خزنة</option>
                                   {foreach $saveData as $save}
                                   <option data-curr="{$save->currencyId}" data-curr-name="{$save->currencyName}" data-cfactor="{$save->conversionFactor}" data-othercfactor="{$save->otherconversionFactor}" value="{$save->saveid}" {if $loadData->saveidfrom eq  $save->saveid} selected="" {/if}>{$save->savename} {if $Programsettingdata->showCurrency == 1}- {$save->currencyName}{/if}</option>
                                   {/foreach}
                               </select>
                               <div id="fromError" style="display:none;"></div>
                           </div>
                       </div> -->


                    {if $searchinonesave == 1}
                    <input type="hidden" name="saveidfrom" id="saveidfrom" value="{$allSave}" />

                    {else}
                    <div class="form-group">
                        <label for="saveidfrom" class="col-lg-2 control-label">من الخزنة</label>
                        <div class="col-lg-4">
                            <select class="select2 wdt100" name="saveidfrom" id="saveidfrom" onChange="loadsaveTo();">
                                <option value="-1">اختر خزنة</option>
                                {foreach $allSave as $data}
                                <option data-curr="{$data->currencyId}" data-curr-name="{$data->currencyName}"
                                        data-cfactor="{$data->conversionFactor}"
                                        data-othercfactor="{$data->otherconversionFactor}" value="{$data->saveid}" {if $saveid == $data->saveid}selected{/if}>{$data->savename} {if
                                    $Programsettingdata->showCurrency == 1} - {$data->currencyName}{/if}</option>
                                {/foreach}
                            </select>
                            <div id="fromError" style="display:none;"></div>
                        </div>
                    </div>
                    {/if}


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



                    <div class="form-group">
                        <label for="savecurrentvalue" class="col-lg-2 control-label">القيمة الحالية</label>
                        <div class="col-lg-4">
                            <div class="input-group">
                                <input type="text" name="savecurrentvalue" id="savecurrentvalue"  class="form-control numberinput" value="{$saveidfromval->savecurrentvalue}" readonly="readonly" />
                                <span class="input-group-addon currencyTextFrom">{$currency}</span>
                            </div>

                        </div>
                    </div>

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


                    <div class="form-group">
                        <label for="saveidto" class="col-lg-2 control-label">إلى الخزنة</label>
                        <div class="col-lg-4">
                            <div id="saveTo">
                                <select class="select2 wdt100" name="saveidto" id="saveidto">
                                    <option value="-1">اختر خزنة</option>
                                    {foreach $saveData as $save}
                                    <option data-curr="{$save->currencyId}" data-curr-name="{$save->currencyName}" data-cfactor="{$save->conversionFactor}" data-othercfactor="{$save->otherconversionFactor}" value="{$save->saveid}" {if $loadData->saveidto eq  $save->saveid} selected="" {/if}>{$save->savename} {if $Programsettingdata->showCurrency == 1}- {$save->currencyName}{/if}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <div id="toError" style="display:none;"></div>

                        </div>
                    </div>

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

                    <div class="form-group" {if $Programsettingdata->showCurrency != 1}style="display:none;"{/if}>
                        <label class="col-lg-2 control-label">العملة</label>
                        <div class="col-lg-4">
                            <span id="spryselect1">
                                <select class="select2" name="currencyId" id="currencyId">
                                    {foreach $allCurrency as $data}
                                    <option value="{$data->id}" data-cfactor="{$data->conversionFactor}" data-othercfactor="{$data->otherconversionFactor}" {if $loadData->currencyId eq  $data->id} selected="" {/if}>{$data->name}</option>
                                    {/foreach}
                                </select>
                                <span class="selectRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <div class="form-group" {if $Programsettingdata->showCurrency != 1}style="display:none;"{/if}>
                        <label class="col-lg-2 control-label">معامل التحويل</label>
                        <div class="col-lg-4">
                            <input type="text" name="cFactor" id="cFactor" class="form-control positivefloat calcOther" onkeyup="checksaveValue();" value="{$loadData->conversionFactor}" style="display: inline-block;width: 34%"/>
                            =
                            <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%">{$currency}</span>
                            </div>
                        </div>
                    </div>
                    <!-- =================================================   -->

                    <div class="form-group">
                        <label for="transfermoneyvalue" class="col-lg-2 control-label">القيمة المحولة</label>
                        <div class="col-lg-4">
                            <div class="input-group">
                                <input type="text" name="transfermoneyvalueCurr" id="transfermoneyvalueCurr"  class="form-control positivefloat" value="{$loadData->transfermoneyvalueInCurrency}" onKeyUp="checksaveValue('transfermoneyvalueCurr');" />
                                <input type="hidden" id="transfermoneyvalueCurr_hidden" value="{$loadData->transfermoneyvalueInCurrency}"/>
                                <span class="input-group-addon" id="currencyText">{$currency}</span>
                            </div>
                            <div id="valueError" style="display:none;"></div>

                        </div>
                    </div>
                    <div class="form-group"  {if $Programsettingdata->showCurrency != 1}style="display:none;"{/if}>
                        <label for="transfermoneyvalueCurrSaveTo" class="col-lg-2 control-label">القيمة المحولة بعملة خزنة الى</label>
                        <div class="col-lg-4">
                            <div class="input-group">
                                <input type="text" name="transfermoneyvalueCurrSaveTo" id="transfermoneyvalueCurrSaveTo" class="form-control positivefloat" value="0" onkeyup="SaveToMoneyChangeReCalcCfactor();"/><!--onKeyUp="checksaveValue('transfermoneyvalue');"-->
                                <span class="input-group-addon currencyTextTo">{$currency}</span>
                            </div>

                        </div>
                    </div>
                    <div class="form-group" style="display: none;"><!--{if $Programsettingdata->showCurrency != 1}style="display:none;"{/if}-->
                        <label for="transfermoneyvalue" class="col-lg-2 control-label">القيمة المحولة بالعملة الرئيسية</label>
                        <div class="col-lg-4">
                            <div class="input-group">
                                <input type="text" name="transfermoneyvalue" id="transfermoneyvalue"  class="form-control positivefloat" value="{$loadData->transfermoneyvalue}" onKeyUp="checksaveValue('transfermoneyvalue');" />
                                <span class="input-group-addon" id="currencyText">{$currency}</span>
                            </div>
                            <div id="valueError" style="display:none;"></div>

                        </div>
                    </div>

                    <div class="form-group mg-bt5">
                        <label class="col-lg-2 control-label"> التعليق  </label>
                        <div class="col-lg-4">
                            <textarea name="comment" id="antherDetailes" class=" form-control" cols="45" rows="5">{$loadData->comment}</textarea>
                        </div>
                    </div>
                    <input type="hidden" name="transfermoneyidold" id="transfermoneyidold" value="{$loadData->transfermoneyid}">


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

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="button" id="saveTrnMnyBtn" 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 spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
</script>

{/literal}

