<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="{$youtubes[103]->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">{$outputString}</p>
                    <div class="clearfix"></div>
                </div>
                <!---------  end outputString alert ------------>

                <form class="form-inline hidden-print" method="post" action="expensesReportController.php?do=showByType">
                    <div class="form-group">
                        <label class="sr-only"> نوع المصروف</label>
                        <select class="select2 wdt100"  name="expensestypeid" id="expensestypeid" >
                            <option value="-1">كل الانواع</option>
                            {foreach $alldata as $type}
                            <option value="{$type->expensestypeid}">{$type->expensestypename}</option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="sr-only">الخزنة</label>
                        <select class="select2 wdt100"  name="saveid" id="saveid" >
                            <option value="-1">كل الخزن</option>
                            {foreach $allSaves as $data}
                            <option value="{$data->saveid}">{$data->savename}</option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="sr-only">المستخدم</label>
                        <select class="select2 wdt100"  name="userid" id="userid" >
                            <option value="-1">كل المستخدمين</option>
                            {foreach $allUsers as $data}
                            <option value="{$data->userid}">{$data->employeename}</option>
                            {/foreach}
                        </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">{$message}</div>
                    <div class="panel-body">
                        <!--
                                                <div class="col-lg-offset-6 col-lg-4 ">
                                                    <div class="well well-sm">
                                                        <h4 class="text-center">إجمالي المصروفات:  {$sum}</h4>

                                                    </div>

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

                                    <th>نوع المصروف</th>
                                    <th>المبلغ</th>
                                </tr>
                            </thead>
                            <tbody>
                                {assign var=sum value=0}
                                {foreach $results as $data}
                                {if {$data->conditions} eq 1}
                                <tr class="danger">
                                    {else}
                                <tr>
                                    {/if}
                                    <td>{$data->expensestypename}</td>
                                    <td>{$data->sumExpensesValue}</td>
                                </tr>
                                {assign var=sum value=$sum+$data->sumExpensesValue}
                                {/foreach}

                            </tbody>

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

                            <div class="col-lg-offset-8 col-lg-4 ">
                                <div class="well well-sm">
                                    <h4 class="text-center">إجمالي المصروفات:  {$sum}</h4>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>


                        <div class="clearfix"></div>
                        <hr />
                        <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>

