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

        <ol class="breadcrumb">
            <li><a href="#">المصروفات والايرادات</a></li>
            <li><a href="savecloseController.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="mySaveCloseform" class="form-horizontal" role="form" action="savecloseController.php?do=add"
                    method="post">
                    {if $searchinonesave == 1}
                    <input type="hidden" name="saveidfrom" id="saveidfrom" value="{$saveid}" />

                    {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="getSaveValue();">
                                <option value="-1">اختر خزنة</option>
                                {foreach $allSave as $data}
                                {if $userData->closeSavid neq $data->saveid}
                                <option data-curr="{$data->currencyId}" data-curr-name="{$data->currencyName}"
                                    data-cfactor="{$data->conversionFactor}"
                                    data-othercfactor="{$data->otherconversionFactor}" value="{$data->saveid}">
                                    {$data->savename} {if
                                    $Programsettingdata->showCurrency == 1} - {$data->currencyName}{/if}</option>
                                {/if}
                                {/foreach}
                            </select>
                            <div id="fromError" style="display:none;"></div>
                        </div>
                    </div>
                    {/if}
                    <input type="hidden" value="0" id="savefromVal" />
                    <!-- =================================================   -->
                    {if $userGroupData->showSaveBalanceAfterClose eq 1 || $userGroupData->showSaveBalanceAfterClose eq
                    2}
                    <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">{$currency}</span>
                            </div>

                        </div>
                    </div>
                    {/if}
                    <!-- =================================================   -->
                    {if $userGroupData->showSaveBalanceAfterClose eq 2}
                    <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="saveaftervalue"
                                    class="form-control numberinput" value="0" readonly="readonly" />
                                <span class="input-group-addon currencyTextFrom">{$currency}</span>
                            </div>

                        </div>
                    </div>
                    {/if}
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="saveclosevalue" class="col-lg-2 control-label">القيمة</label>
                        <div class="col-lg-4">
                            <div class="input-group">
                                <input type="text" name="saveclosevalue" id="saveclosevalue"
                                    class="form-control positivefloat" value="0" />
                                <span class="input-group-addon">{$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"></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="saveAndPrintClose" class="btn btn-success pull-left">حفظ
                                وطباعة</button>

                            <button type="button" id="saveCloseBtn" class="btn btn-primary pull-left">حفظ
                                الامر</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{literal}
<script>
    $('#saveAndPrintClose').on('click', function () {
        $('#saveCloseBtn').attr('disabled');
        $('#printTxt').val(1);
        $('#saveCloseBtn').trigger('click');
    });

</script>

{/literal}