<?php /* Smarty version Smarty-3.1.11, created on 2023-10-15 10:41:10
         compiled from "../views/default/saveview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:531777948652b97962a68e7-23138958%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '70efb116cd10cfcebf7dccf0a733c8356874b19f' => 
    array (
      0 => '../views/default/saveview/show.html',
      1 => 1693253994,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '531777948652b97962a68e7-23138958',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'youtubes' => 0,
    'outputString' => 0,
    'saveData' => 0,
    'save' => 0,
    'totalMainCurrency' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_652b9796314935_10634948',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_652b9796314935_10634948')) {function content_652b9796314935_10634948($_smarty_tpl) {?>

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

        <ol class="breadcrumb">
            <li><a href="#">المصروفات والايرادات</a></li>
            <li><a href="saveController.php?do=show">الخزن</a></li>
            <li class="active">عرض الخزن</li>
        </ol>




        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading" style="padding:5px 15px 15px">
                <h3 class="panel-title" style="display: inline-block;"> عرض الخزن</h3>
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[82]->url;?>
" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
                <a href="saveController.php" class="hidden-print"><input type="button"  id="submit"  style="margin-left: 12px" class="btn btn-primary pull-left " value="إضافة جديد"/></a>
            </div>
            <div class="panel-body">


                <div id="outputString" class="alert alert-block alert-success fade in" style="display:none">
                    <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">&times;</button>

                    <p id="outputStringValue"><?php echo $_smarty_tpl->tpl_vars['outputString']->value;?>
</p>

                    <div class="clearfix"></div>
                </div>



            </div>
            <hr/>



            <table class="table table-black myTablesave" >
                <thead>
                    <tr>
                          <th width="10%">الرقم</th>
                        <th>اسم الخزنة</th>
                        <th>القيمة الحالية</th>
                        <th>القيمة بالعملة الاساسية</th>
                        <th>التعليق</th>
                        <th class="noprint">تعديل</th>
                        <th class="hidden-print ">ايقاف</th>
                    </tr>
                </thead>
                <tbody>



                    <?php $_smarty_tpl->tpl_vars['totalMainCurrency'] = new Smarty_variable(0, null, 0);?>
                    <?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;
?>
                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['save']->value->conditions;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==1){?>
                    <tr class="danger">
                        <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['save']->value->conditions;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2==0){?>
                    <tr>
                        <?php }}?>
                        <td><input type="text" class="form-control" data-id="<?php echo $_smarty_tpl->tpl_vars['save']->value->saveid;?>
" id="sortby" value="<?php echo $_smarty_tpl->tpl_vars['save']->value->sortby;?>
"></td>
                        <td><?php echo $_smarty_tpl->tpl_vars['save']->value->savename;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['save']->value->savecurrentvalue;?>
 <?php echo $_smarty_tpl->tpl_vars['save']->value->currencyName;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['save']->value->savecurrentvalueInMainCurrency;?>

                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['save']->value->conditions;?>
<?php $_tmp3=ob_get_clean();?><?php if ($_tmp3==0){?>
                            <?php $_smarty_tpl->tpl_vars['totalMainCurrency'] = new Smarty_variable($_smarty_tpl->tpl_vars['totalMainCurrency']->value+$_smarty_tpl->tpl_vars['save']->value->savecurrentvalueInMainCurrency, null, 0);?>
                            <?php }?>
                        </td>
                        <td>
                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['save']->value->savedetails;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4!=''){?>
                            <?php echo $_smarty_tpl->tpl_vars['save']->value->savedetails;?>

                            <?php }else{ ?>
                            لا يوجد
                            <?php }?>
                        </td>



                        <td class="noprint">
                            <a href="saveController.php?do=edit&saveid=<?php echo $_smarty_tpl->tpl_vars['save']->value->saveid;?>
" class="btn btn-default btn-lg editicon"></a>
                        </td>
                        <td class="hidden-print ">

                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['save']->value->conditions;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==1){?>
                            <a href="saveController.php?do=delete&saveid=<?php echo $_smarty_tpl->tpl_vars['save']->value->saveid;?>
&condition=1" type="button" class="btn btn-default btn-lg correcticon"></a>

                            <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['save']->value->conditions;?>
<?php $_tmp6=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['save']->value->saveid;?>
<?php $_tmp7=ob_get_clean();?><?php if ($_tmp6==0&&$_tmp7>1){?>

                            <a href="#" type="button" class="btn btn-default btn-lg removeicon conformdel1" data-position="saveController.php?do=delete&saveid=<?php echo $_smarty_tpl->tpl_vars['save']->value->saveid;?>
&condition=0"></a>

                            <?php }}?>


                        </td>



                    </tr>
                    <?php } ?>


                </tbody>
            </table>





            <div class="clearfix"></div>
            <hr />
            <div class="col-lg-offset-8 col-lg-4 ">
                <div class="well well-sm">
                    <h4 class="text-center">الاجمالى بالعملة الاساسية:  <span><?php echo $_smarty_tpl->tpl_vars['totalMainCurrency']->value;?>
</span></h4>
                </div>
            </div>
            <div class="clearfix"></div>




            <div  class="noprint">
                <div class="col-lg-12">


                    <div class="form-group">
                        <div class="col-lg-4">
                            <button type="button" onclick="print_Custom('mycustomheader');" class="btn btn-success pull-right">طباعة</button>
                        </div>
                    </div>

                </div>
                <div class="clearfix"></div>
            </div>

            <!-- Modal -->
            <div class="hidden-print">
                <div class="modal fade " id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <div class="modal-title">تأكيد حذف الخزنه</div>
                            </div>
                            <div class="modal-body"> هل تريد حذف هذه الخزنه؟ </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">لا</button>
                                <button type="button" class="btn btn-primary savemodel1">نعم</button>
                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
            </div>
            <!-- /.modal -->




            <div class="clearfix"></div>


        </div>



    </div>

</div>


<script type="text/javascript">

$(document).ready( function () {
    $('.myTablesave').DataTable();
    $('body').on('change', '#sortby', function () {
        var id = $(this).attr('data-id');
        var sortby =  $.trim($(this).val());
        if (sortby) {
            $.post("saveController.php?do=sortby", {id: id , sortby: sortby});
        }
    });
} );


$('.conformdel1').click(function (e) {

e.preventDefault();

var elemposition = $(this).data('position');

$("#myModal1").find(".savemodel1").attr('data-position', elemposition);
$('#myModal1').modal('show');
});
$('.savemodel1').on('click', function () {

$('#myModal1').modal('hide');
var pos = $(this).attr('data-position');

window.location.href = pos;
});
</script>
<?php }} ?>