<?php include_once(__DIR__ . '/header/header.php');?>

<?php include_once(__DIR__ . '/../libraries/congno_data_filter.php');?>



<body>

    <div id="wrapper">

        <div class="content">

            <div class="row">

                <div class="col-md-12">

                    <div class="_buttons">



                        <a id="add-button" class="btn btn-primary mright5 test pull-left display-block">

                            <i class="fa-regular fa-plus tw-mr-1"></i>

                            Thêm Mới</a>



                        <a href="<?php echo admin_url('clients/client'); ?>" class="btn btn-default pull-left display-block mright5">

                            <i class="fa-regular fa-user tw-mr-1"></i>

                            Thêm Khách Hàng </a>

                        <a href="<?php echo admin_url('leads/statuses'); ?>" class="btn btn-default pull-left mleft5">

                            <i class="fa-solid fa-car-side tw-mr-1"></i>

                            Xem Xe Ngoài

                        </a>

                        <a href="<?php echo admin_url('leads/sources'); ?>" class="btn btn-default pull-left mleft5">

                            <i class="fa-solid fa-car tw-mr-1"></i>

                            Xem Xe Nhà

                        </a>

                        <div class="visible-xs">

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

                        </div>

                    </div>

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

                    <div class="panel_s tw-mt-2 sm:tw-mt-4">

                        <div class="panel-body">

                            <div class="mbot15">

                                <h4 class="tw-mt-0 tw-font-semibold tw-text-lg tw-flex tw-items-center">

                                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"

                                        stroke-width="1.5" stroke="currentColor"

                                        class="tw-w-5 tw-h-5 tw-text-neutral-500 tw-mr-1.5">

                                        <path stroke-linecap="round" stroke-linejoin="round"

                                            d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z">

                                        </path>

                                    </svg>

                                    <span>

                                        SỔ CHI TIẾT CÔNG NỢ THÁNG

                                        <?php echo $selected_ngay_thang?>/<?php echo $selected_year ?></span>

                                </h4>

                                <div class="tw-grid tw-grid-cols-2 md:tw-grid-cols-3 lg:tw-grid-cols-6 tw-gap-2 thongke">

                                    <div

                                        class="md:tw-border-r md:tw-border-solid md:tw-border-neutral-300 tw-flex-1 tw-flex tw-items-center">

                                        <span

                                            class="tw-font-semibold tw-mr-3 rtl:tw-ml-3 tw-text-sm"><?php echo count($congno_data_filtered); ?></span>

                                        <span class="text-dark tw-truncate sm:tw-text-clip mtbot">Tổng Đơn</span>

                                    </div>

                                    <div

                                        class="md:tw-border-r md:tw-border-solid md:tw-border-neutral-300 tw-flex-1 tw-flex tw-items-center">

                                        <span

                                            class="tw-font-semibold tw-mr-3 rtl:tw-ml-3 tw-text-sm"><?php echo $future_date_count ?></span>

                                        <span class="text-danger tw-truncate sm:tw-text-clip mtbot">Đơn Tạo Trước</span>

                                    </div>

                                    <div

                                        class="md:tw-border-r md:tw-border-solid md:tw-border-neutral-300 tw-flex-1 tw-flex tw-items-center">

                                        <span class="tw-font-semibold tw-mr-3 rtl:tw-ml-3 tw-text-sm"><?php echo number_format(array_sum(array_column($congno_data_filtered, 'Phai_thu')), 0, ',', '.'); ?></span>

                                        <span class="text-success tw-truncate sm:tw-text-clip mtbot">Phải Thu</span>

                                    </div>

                                    <div

                                        class="md:tw-border-r md:tw-border-solid md:tw-border-neutral-300 tw-flex-1 tw-flex tw-items-center">

                                        <span class="tw-font-semibold tw-mr-3 rtl:tw-ml-3 tw-text-sm"><?php echo number_format(array_sum(array_column($congno_data_filtered, 'Da_thu')), 0, ',', '.'); ?></span>

                                        <span class="text-darks tw-truncate sm:tw-text-clip mtbot">Đã Thu</span>

                                    </div>

                                    <div

                                        class="md:tw-border-r md:tw-border-solid md:tw-border-neutral-300 tw-flex-1 tw-flex tw-items-center">

                                        <span

                                            class="tw-font-semibold tw-mr-3 rtl:tw-ml-3 tw-text-sm"><?php echo number_format(array_sum(array_column($congno_data_filtered, 'Gia_van_chuyen')), 0, ',', '.'); ?></span>

                                        <span class="text-info  tw-truncate sm:tw-text-clip mtbot">Giá Vận

                                            Chuyển</span>

                                    </div>        

                                    <div

                                        class="md:tw-border-r md:tw-border-solid md:tw-border-neutral-300 tw-flex-1 tw-flex tw-items-center">

                                        <span

                                            class="tw-font-semibold tw-mr-3 rtl:tw-ml-3 tw-text-sm"><?php echo number_format(array_sum(array_column($congno_data_filtered, 'Gia')), 0, ',', '.'); ?></span>

                                        <span class="tw-truncate sm:tw-text-clip mtbot"

                                            style="color:rgb(255 122 5)">Thuê

                                            Xe Ngoài</span>

                                    </div>

                                    <div

                                        class="tw-flex tw-items-center md:tw-border-r md:tw-border-solid tw-flex-1 md:tw-border-neutral-300 lg:tw-border-r-0">

                                        <span

                                            class="tw-font-semibold tw-mr-3 rtl:tw-ml-3 tw-text-sm"><?php echo number_format(array_sum(array_column($congno_data_filtered, 'Chi_phi_phat_sinh')), 0, ',', '.'); ?></span>

                                        <span class="text-muted tw-truncate" data-toggle="tooltip"

                                            data-title="Chi Phí Phát Sinh" data-original-title="" title="">

                                            <span class="tw-truncate sm:tw-text-clip mtbot" style="color:#1859d0">

                                                Phí Phát Sinh </span>

                                        </span>

                                    </div>

                                </div>



                            </div>

                            <hr class="hr-panel-separator">

                            <div class="panel-table-full">

                                <div class>

                                    <div id="clients_wrapper"

                                        class="dataTables_wrapper form-inline dt-bootstrap no-footer">

                                        <div class="row"></div>

                                        <div class="row">

                                            <?php include_once('Add_New.php');?>

                                            <?php include_once('Filter/filter.php'); ?>

                                            <?php include_once('edit_form.php'); ?>

                                        </div>

                                        <div class="table-responsive">

                                            <?php include_once('Table/table.php'); ?>

                                        </div>

                                        <div class="row">

                                            <div class="col-md-4">

                                                <div class="dataTables_info" id="recordSummary" role="status"

                                                    aria-live="polite"></div>

                                                    

                                                    

                                            </div>

                                            <div class="col-md-8 dataTables_paging">

                                                <div id="colvis"></div>

                                                <div id="" class="dt-page-jump"></div>

                                                <div class="dataTables_paginate paging_simple_numbers"

                                                    id="expenses_paginate">

                                                    <ul class="pagination">

                                                        <li class="paginate_button active"><div id="paginationControls"></div></li>

                                                    </ul>

                                                </div>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

</body>

<script src="<?php echo module_dir_url('congno', 'assets/js/scripts.js'); ?>"></script>



</html>