<?php /* Smarty version Smarty-3.1.11, created on 2024-07-15 17:12:22
         compiled from "..\views\default\transfermoneyview\add.html" */ ?>
<?php /*%%SmartyHeaderCode:1526866953c56409bb6-72489510%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '5f06b48a8df90b354802f219a69d6c06e8b7b4a8' => 
    array (
      0 => '..\\views\\default\\transfermoneyview\\add.html',
      1 => 1697400934,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1526866953c56409bb6-72489510',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'saveData' => 0,
    'save' => 0,
    'Programsettingdata' => 0,
    'searchinonesave' => 0,
    'allSave' => 0,
    'data' => 0,
    'saveid' => 0,
    'currency' => 0,
    'allCurrency' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_66953c564dcfb4_25102611',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_66953c564dcfb4_25102611')) {function content_66953c564dcfb4_25102611($_smarty_tpl) {?><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=add"
                    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>
                                <?php  $_smarty_tpl->tpl_vars['save'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['save']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['saveData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['save']->key => $_smarty_tpl->tpl_vars['save']->value){
$_smarty_tpl->tpl_vars['save']->_loop = true;
?>
                                <option data-curr="<?php echo $_smarty_tpl->tpl_vars['save']->value->currencyId;?>
" data-curr-name="<?php echo $_smarty_tpl->tpl_vars['save']->value->currencyName;?>
"
                                    data-cfactor="<?php echo $_smarty_tpl->tpl_vars['save']->value->conversionFactor;?>
"
                                    data-othercfactor="<?php echo $_smarty_tpl->tpl_vars['save']->value->otherconversionFactor;?>
" value="<?php echo $_smarty_tpl->tpl_vars['save']->value->saveid;?>
">
                                    <?php echo $_smarty_tpl->tpl_vars['save']->value->savename;?>
 <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showCurrency==1){?>-
                                    <?php echo $_smarty_tpl->tpl_vars['save']->value->currencyName;?>
<?php }?></option>
                                <?php } ?>
                            </select>
                            <div id="fromError" style="display:none;"></div>
                        </div>
                    </div> -->



                    <?php if ($_smarty_tpl->tpl_vars['searchinonesave']->value==1){?>
                    <input type="hidden" name="saveidfrom" id="saveidfrom" value="<?php echo $_smarty_tpl->tpl_vars['allSave']->value;?>
" />
                    
                    <?php }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>
                                <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allSave']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>
                                <option data-curr="<?php echo $_smarty_tpl->tpl_vars['data']->value->currencyId;?>
" data-curr-name="<?php echo $_smarty_tpl->tpl_vars['data']->value->currencyName;?>
"
                                    data-cfactor="<?php echo $_smarty_tpl->tpl_vars['data']->value->conversionFactor;?>
"
                                    data-othercfactor="<?php echo $_smarty_tpl->tpl_vars['data']->value->otherconversionFactor;?>
" value="<?php echo $_smarty_tpl->tpl_vars['data']->value->saveid;?>
" <?php if ($_smarty_tpl->tpl_vars['saveid']->value==$_smarty_tpl->tpl_vars['data']->value->saveid){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['data']->value->savename;?>
 <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showCurrency==1){?> - <?php echo $_smarty_tpl->tpl_vars['data']->value->currencyName;?>
<?php }?></option>
                                <?php } ?>
                            </select>
                            <div id="fromError" style="display:none;"></div>
                        </div>
                    </div>
                    <?php }?>
                    
                    <!-- =================================================   -->



                    <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="0" readonly="readonly" />
                                <span class="input-group-addon currencyTextFrom"><?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</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>
                                </select>
                            </div>
                            <div id="toError" style="display:none;"></div>

                        </div>
                    </div>

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

                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showCurrency!=1){?>style="display:none;"<?php }?>>
                        <label class="col-lg-2 control-label">العملة</label>
                        <div class="col-lg-4">
                            <span id="spryselect1">
                                <select class="select2" name="currencyId" id="currencyId">
                                    <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allCurrency']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>
                                    <option value="<?php echo $_smarty_tpl->tpl_vars['data']->value->id;?>
" data-cfactor="<?php echo $_smarty_tpl->tpl_vars['data']->value->conversionFactor;?>
"
                                        data-othercfactor="<?php echo $_smarty_tpl->tpl_vars['data']->value->otherconversionFactor;?>
"><?php echo $_smarty_tpl->tpl_vars['data']->value->name;?>
</option>
                                    <?php } ?>
                                </select>
                                <span class="selectRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showCurrency!=1){?>style="display:none;"<?php }?>>
                        <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();" style="display: inline-block;width: 35%" />
                            =
                            <div class="input-group" style="display: inline;">
                                <input type="text" name="otherCFactor" id="otherCFactor"
                                    class="form-control positivefloat calcOther"
                                    style="display: inline-block;width: 35%" />
                                <span class="input-group-addon"
                                    style="display: inline-block;width: 24%"><?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</span>
                            </div>
                        </div>
                    </div>
                    <!-- =================================================   -->

                    <div class="form-group">
                        <label for="transfermoneyvalueCurr" 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="0"
                                    onKeyUp="checksaveValue('transfermoneyvalueCurr');" />
                                <span class="input-group-addon" id="currencyText"><?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</span>
                            </div>
                            <div id="valueError" style="display:none;"></div>

                        </div>
                    </div>
                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showCurrency!=1){?>style="display:none;"<?php }?>>
                        <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"><?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</span>
                            </div>

                        </div>
                    </div>
                    <div class="form-group" style="display: none;">
                        <!--<?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showCurrency!=1){?>style="display:none;"<?php }?>-->
                        <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="0"
                                    onKeyUp="checksaveValue('transfermoneyvalue');" />
                                <span class="input-group-addon"><?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</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"></textarea>
                        </div>
                    </div>


                    <!-- =================================================   -->
                    <input type="hidden" name="printTxt" id="printTxt" value="0" />
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">

                            <button type="button" id="saveAndPrint" class="btn btn-success pull-left">حفظ
                                وطباعة</button>

                            <button type="button" id="saveTrnMnyBtn" class="btn btn-primary pull-left">حفظ
                                الامر</button>
                        </div>
                    </div>


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




    </div>
</div>





<script type="text/javascript">

    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "real");
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", { isRequired: false, invalidValue: "-1" });
</script>

<script>
    $('#saveAndPrint').on('click', function () {
        $('#saveTrnMnyBtn').attr('disabled');
        $('#printTxt').val(1);
        $('#saveTrnMnyBtn').trigger('click');
    });
</script>

<?php }} ?>