<?= $this->extend('layout'); ?>

<?= $this->section('css'); ?>
<link rel="stylesheet" href="/assets/jquery-ui-1.13.2.custom/jquery-ui.css">
<link rel="stylesheet" href="/css/mawim.css">
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
    <?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<?php session()->set('redirect_url',base_url('/viewActivities')); ?>
<div class="page-content">
    <div class="row">        
        <div class="col-xxl-8 col-12">        
            <div class="text-white-50"><h2>Verlauf</h2></div>
            <form class="form row row-cols align-items-bottom" id="getData" method="post" action="<?= base_url() ?>/Ajax/getTabelData">
                <div class="row">
                    <div class="col-lg-3 col-12">
                        <input type="text" class="form-control" id="datepickers" data-date-format="mm.dd.yyyy" name="datum_start" placeholder="Datum Start" value="<?= $datum_start??$start ?>"/>
                    </div>
                    <div class="col-lg-3 col-12">
                        <input type="text" class="form-control" id="datepickere" data-date-format="mm.dd.yyyy" name="datum_ende" placeholder="Datum Ende"  value="<?= $datum_ende??$ende ?>"/>
                    </div>
                    <div class="col-lg-3 col-12">
                        <div class="form-group">
                            <?= form_dropdown('source', $sourcelist, $source,'id="source" class="form-select"'); ?>
                        </div>
                    </div>
                    <div class="col-lg-3 col-12">
                        <a class="btn btn-primary" onclick="datatable.ajax.reload();" role="button">Aktualisieren</a>
                    </div>   
                </div>     
            </form>
            <table class="table table-sm table-striped" id="bookings" cellspacing="0"></table>
        </div>
        <div class="col-xxl-4 col-12 d-none d-xxl-block">
            <div class="text-white-50"><h2>Aktuelle Kontostände</h2></div>
            <table class="table table-striped table-sm" id="accounts" cellspacing="0"></table>
        </div>
    </div>
</div>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
    <script src="/assets/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
    <script>
        $.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen',
            closeText: 'schließen', closeStatus: 'ohne Änderungen schließen',
            prevText: '<zurück', prevStatus: 'letzten Monat zeigen',
            nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen',
            currentText: 'heute', currentStatus: '',
            monthNames: ['Januar','Februar','März','April','Mai','Juni',
            'Juli','August','September','Oktober','November','Dezember'],
            monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
            'Jul','Aug','Sep','Okt','Nov','Dez'],
            monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen',
            weekHeader: 'Wo', weekStatus: 'Woche des Monats',
            dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
            dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
            dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
            dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d',
            dateFormat: 'dd.mm.yy', firstDay: 1, 
            initStatus: 'Wähle ein Datum', isRTL: false};
        $.datepicker.setDefaults($.datepicker.regional['de']);
        $('#datepickers').datepicker(
        {
            format: "dd.mm.yyyy",
            language: 'de-DE',
            weekStart: 1,
            autoclose: true,
            todayHighlight: false});
        $('#datepickere').datepicker(
        {
            format: "dd.mm.yyyy",
            language: 'de-DE',
            weekStart: 1,
            autoclose: true,
            todayHighlight: false});
    </script>  
   <script src="/js/tables.js"></script>
   <script src="/js/tab_accounts.js"></script>
   <script src="/js/activities.js"></script>
 
<?= $this->endSection(); ?>