<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
</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="{$youtubes[78]->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">
                <form class="form-inline hidden-print" action="tripsReport.php?do=referrers" method="post">
                    <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>


                    <div class="form-group">
                        <label class="sr-only">الوسيط</label>
                        <input type="hidden" name="referrerid" id="referrerid"/>
                    </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">بحث</button>
                </form>
            </div>

            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading">{$message}</div>
                <div class="panel-body">

                    <table class="table table-black dataTableClass">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>اسم الراكب</th>
                                <th>الرحلة</th>
                                <th>التاريخ</th>
                                <th>قيمة الحجز</th>
                            </tr>
                        </thead>
                        <tbody>
                            {assign var=total value=0}
                            {assign var=i value=1}
                            {foreach $billData as $data}
                            <tr>
                                <td>{$i}</td>
                                <td>{$data['clientname']}</td>
                                <td>{$data['tripname']}</td>
                                <td>{$data['sellbilldate']}</td>
                                <td>{$data['sellbillaftertotalbill']}</td>
                            </tr>
                            {assign var=total value=$total + $data['sellbillaftertotalbill']}
                            {assign var=i value=$i+1}
                            {/foreach}
                        </tbody>
                    </table>

                    <div class="clearfix"></div>
                    <div class="col-lg-4 ">
                        <div class="well well-sm">
                            <h4 class="text-center">مجموع الحجوزات: <span>{$total}</span></h4>
                        </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 hidden-print">طباعة</button>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>

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

{literal}
<script>
    $(function () {
        $("#referrerid").select2({
            placeholder: "اختر",
            width: '100%',
            minimumInputLength: 0, //document.getElementById("searchvalue").value,
            multiple: false,
            quietMillis: 100,
            allowClear: true,
            ajax: {
                url: "expensesControllerajex.php?do=referrer",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        term: term, //search term
                        page_limit: 10,
                    };
                },
                results: function (data) {
                    return {results: data};
                }
            },
            formatResult: function (data) {
                return data.text;
            },
            initSelection: function (element, callback) {
                var item = element.val().split(':');
                var data = {id: item[0], text: item[1]};
                callback(data);
            }
        });

    });
</script>
{/literal}
