<?php /* Smarty version Smarty-3.1.11, created on 2025-12-30 20:03:25
         compiled from "..\views\default\expensesReportview\show.html" */ ?>
<?php /*%%SmartyHeaderCode:18203695413edd83033-94855000%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '9f5d19f6c2647b89912122b520c458ef0a264002' => 
    array (
      0 => '..\\views\\default\\expensesReportview\\show.html',
      1 => 1752437506,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '18203695413edd83033-94855000',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'youtubes' => 0,
    'outputString' => 0,
    'alldata' => 0,
    'type' => 0,
    'Programsettingdata' => 0,
    'allCostcenter' => 0,
    'myallCostcenter' => 0,
    'projectid' => 0,
    'message' => 0,
    'sum' => 0,
    'expenseData' => 0,
    'data' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_695413ee0a9704_23374263',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_695413ee0a9704_23374263')) {function content_695413ee0a9704_23374263($_smarty_tpl) {?><style>
    @media print{
        .well{
            border:1px solid black;
        }
    }
</style>
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">التقارير</a></li>
            <li class="active">تقرير المصروفات</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">تقرير المصروفات
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[102]->url;?>
" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
            </div>
            <div class="panel-body">

                <!---------- start outputString alert ----------->
                <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>
                <!---------  end outputString alert ------------>

                <form class="form-inline hidden-print" method="post" action="expensesReportController.php">
                    <div class="form-group">
                        <label class="sr-only">إسم نوع المصروف</label>
                        <select data-placeholder="اختر نوع المصروف"  class="select2 wdt100"  name="expensestypeid" id="expensestypeid" >
                            <option value="-1">اختر نوع المصروف</option>


                            <?php  $_smarty_tpl->tpl_vars['type'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['type']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['alldata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['type']->key => $_smarty_tpl->tpl_vars['type']->value){
$_smarty_tpl->tpl_vars['type']->_loop = true;
?>

                            <option value="<?php echo $_smarty_tpl->tpl_vars['type']->value->expensestypeid;?>
"><?php echo $_smarty_tpl->tpl_vars['type']->value->expensestypename;?>
</option>

                            <?php } ?>

                        </select>

                    </div>
                    <div class="form-group"   <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->expensesproduct==0){?> <?php }else{ ?> style="display:none" <?php }?>>
                        <label class="sr-only ">المنتجات</label>
                        <input type="hidden" name="searchvalue" id="searchvalue" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->searchvalue;?>
"/>
                        <input type="text" name="productid" id="productid" class="select2product wdt100 clas_offerproduct" data-itr='1'  data-placeholder="اختر منتج" tabindex="301"/>
                    </div>
                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->costcenter==0){?> <?php }else{ ?> style="display:none" <?php }?>  >
                        <label class="sr-only">مركز التكلفه</label>
                        <select class="select2 wdt100" name="Costcenterid" id="Costcenterid" >
                            <option value="-1" >اختر مركز التكلفه</option>
                            <?php  $_smarty_tpl->tpl_vars['myallCostcenter'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['myallCostcenter']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allCostcenter']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['myallCostcenter']->key => $_smarty_tpl->tpl_vars['myallCostcenter']->value){
$_smarty_tpl->tpl_vars['myallCostcenter']->_loop = true;
?>
                            <option value="<?php echo $_smarty_tpl->tpl_vars['myallCostcenter']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['myallCostcenter']->value->id==$_smarty_tpl->tpl_vars['projectid']->value){?>selected=""<?php }?>><?php echo $_smarty_tpl->tpl_vars['myallCostcenter']->value->name;?>
</option>
                            <?php } ?>
                        </select>
                    </div>
                    <br />
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
                    </div>
                    <button type="submit" class="btn btn-primary hidden-print">بحث</button>
                </form>
                <div class="panel panel-default">
                    <!-- Default panel contents -->
                    <div class="panel-heading"><?php echo $_smarty_tpl->tpl_vars['message']->value;?>
</div>
                    <div class="panel-body">
                        <div class="col-lg-2 hidden-print">
                            <table style="border-spacing: 5px; border-collapse: separate;">
                                <tr>
                                    <td><div style="background-color: #f2dede;width: 22px;height: 20px"></div></td>
                                    <td>المصروف محذوف</td>
                                </tr>
                                <tr class="hidden-print">
                                    <td><div style="background-color: #ce93d8;width: 22px;height: 20px"></div></td>
                                    <td>نوع المصروف محذوف</td>
                                </tr>
                            </table>
                        </div>
                        <div class="col-lg-offset-6 col-lg-4 hidden-print">
                            <div class="well well-sm">
                                <h4 class="text-center">إجمالي المصروفات:  <?php echo $_smarty_tpl->tpl_vars['sum']->value;?>
</h4>

                            </div>

                        </div>
                        <div class="hidden-print">
                            <br /><br /><br /><br /><br />
                        </div>
                        <!-- Table -->
                        <table class="table table-black">
                            <thead>
                                <tr>

                                    <th>إسم المصروف</th>
                                    <th>نوع المصروف</th>
                                    <th>الخزنة / البنك</th>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->expensesproduct==0){?>
                                    <th>المنتج</th>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->costcenter==0){?>
                                    <th>مركز التكلفه</th>
                                    <?php }?>
                                    <th>التاريخ</th>
                                    <th>المبلغ</th>
                                    <th style="width: 20%">ملاحظات</th>
                                </tr>
                            </thead>
                            <tbody>

                                <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['expenseData']->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;
?>
                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->conditions;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==1){?>
                                <tr class="danger">
                                    <?php }elseif($_smarty_tpl->tpl_vars['data']->value->expensestypeConditions==1){?>
                                <tr style="background-color: #ce93d8">
                                    <?php }else{ ?>
                                <tr>
                                    <?php }?>

                                    <td> <?php echo $_smarty_tpl->tpl_vars['data']->value->expensesname;?>
 </td>
                                    <td><?php echo $_smarty_tpl->tpl_vars['data']->value->expensestypename;?>
</td>
                                    <td><?php if ($_smarty_tpl->tpl_vars['data']->value->saveid>0){?> <?php echo $_smarty_tpl->tpl_vars['data']->value->savename;?>
 <?php }else{ ?> <?php echo $_smarty_tpl->tpl_vars['data']->value->bankname;?>
/<?php echo $_smarty_tpl->tpl_vars['data']->value->accountname;?>
 <?php }?></td>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->expensesproduct==0){?>
                                    <td><?php echo $_smarty_tpl->tpl_vars['data']->value->productName;?>
</td>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->costcenter==0){?>
                                    <td><?php echo $_smarty_tpl->tpl_vars['data']->value->name;?>
</td>
                                    <?php }?>
                                    <td><?php echo $_smarty_tpl->tpl_vars['data']->value->expensesdate;?>
</td>
                                    <td><?php echo $_smarty_tpl->tpl_vars['data']->value->expensesValue;?>
</td>
                                    <td><?php echo $_smarty_tpl->tpl_vars['data']->value->expensesdetails;?>
</td>

                                </tr>
                                <?php } ?>

                            </tbody>

                        </table>
                        <div class="clearfix hidden-print"></div>
                        <br />
                        <div  class="">

                            <div class="col-lg-offset-8 col-lg-4 ">
                                <div class="well well-sm">
                                    <h4 class="text-center">إجمالي المصروفات:  <?php echo $_smarty_tpl->tpl_vars['sum']->value;?>
</h4>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>


                        <div class="clearfix"></div>
                        <br />
                        <div  class="hidden-print">
                            <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>
                    </div>
                </div>
            </div>
        </div>


        

        <script type="text/javascript">

            $(document).ready(function () {
                $(".positiveNo").forcepositiveNum();
                var formatResult;
                formatResult = function (data) {

                    return  data.text;
                }
                $("#productid").select2({
                    placeholder: "إسم المنتج",
                    width: '100%',
                    minimumInputLength: document.getElementById("searchvalue").value,
                    multiple: false,
                    quietMillis: 100,
                    ajax: {
                        url: "sellbillAjaxController.php?do=getProductsexpenses",
                        dataType: 'json',
                        data: function (term, page) {
                            return {
                                term: term, //search term
                                page_limit: 10,

                            };
                        },
                        results: function (data) {
                            return {results: data};
                        }
                    },
                    formatResult: formatResult,
                    initSelection: function (element, callback) {
                        var item = element.val().split(':');
                        var data = {id: item[0], text: item[1]};
                        callback(data);
                    }
                });

            });
        </script>
        <?php }} ?>