ok

Mini Shell

Direktori : /home2/selectio/www/mm-tailor-billing/themes/default/views/reports/
Upload File :
Current File : /home2/selectio/www/mm-tailor-billing/themes/default/views/reports/staff_report.php

<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); ?>

<?php
$v = "?v=1";

if ($this->input->post('users')) {
    $v .= "&users=" . $this->input->post('users');
}
if ($this->input->post('start_date')) {
    $v .= "&start_date=" . $this->input->post('start_date');
}
if ($this->input->post('end_date')) {
    $v .= "&end_date=" . $this->input->post('end_date');
}

?>

<script type="text/javascript">
    $(document).ready(function() {

        var table = $('#PayRData').DataTable({

            'ajax' : { url: '<?=site_url('reports/get_staff_reports/'. $v);?>', type: 'POST', "data": function ( d ) {
                d.<?=$this->security->get_csrf_token_name();?> = "<?=$this->security->get_csrf_hash()?>";
            }},
            "buttons": [
            { extend: 'copyHtml5', 'footer': true, exportOptions: { columns: [ 0, 1, 2, 3, 4 ] } },
            { extend: 'excelHtml5', 'footer': true, exportOptions: { columns: [ 0, 1, 2, 3, 4 ] } },
            { extend: 'csvHtml5', 'footer': true, exportOptions: { columns: [ 0, 1, 2, 3, 4 ] } },
            { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4', 'footer': true,
            exportOptions: { columns: [ 0, 1, 2, 3, 4 ] } },
            { extend: 'colvis', text: 'Columns'},
            ],
            "pageLength": 25,
            
            "aaSorting": [[ 1, "asc" ]],
            
            "columns": [
            { "data": "id", "visible": false },
            { "data": "first_name" ,"className": "text-center" },
            { "data": "cutting_shirt" ,"className": "table_cutting" },
            { "data": "cutting_pant" ,"className": "table_cutting" },
            { "data": "stitching_shirt" ,"className": "table_stitching" },
            { "data": "stitching_pant" ,"className": "table_stitching" }
            
            
            ],
            "footerCallback": function (  tfoot, data, start, end, display ) {
                var api = this.api(), data;
                $(api.column(2).footer()).html( cf(api.column(2).data().reduce( function (a, b) { return pf(a) + pf(b); }, 0)) );
                $(api.column(3).footer()).html( cf(api.column(3).data().reduce( function (a, b) { return pf(a) + pf(b); }, 0)) );
                $(api.column(4).footer()).html( cf(api.column(4).data().reduce( function (a, b) { return pf(a) + pf(b); }, 0)) );
                $(api.column(5).footer()).html( cf(api.column(5).data().reduce( function (a, b) { return pf(a) + pf(b); }, 0)) );
            }

        });

        $('#search_table').on( 'keyup change', function (e) {
            var code = (e.keyCode ? e.keyCode : e.which);
            if (((code == 13 && table.search() !== this.value) || (table.search() !== '' && this.value === ''))) {
                table.search( this.value ).draw();
            }
        });

        table.columns().every(function () {
            var self = this;
            $( 'input.datepicker', this.footer() ).on('dp.change', function (e) {
                self.search( this.value ).draw();
            });
            $( 'input:not(.datepicker)', this.footer() ).on('keyup change', function (e) {
                var code = (e.keyCode ? e.keyCode : e.which);
                if (((code == 13 && self.search() !== this.value) || (self.search() !== '' && this.value === ''))) {
                    self.search( this.value ).draw();
                }
            });
            $( 'select', this.footer() ).on('change', function (e) {
                self.search( this.value ).draw();
            });
        });

    });
</script>

<script type="text/javascript">
    $(document).ready(function(){
        //$('#form').hide();
        $('.toggle_form').click(function(){
            $("#form").slideToggle();
            return false;
        });
    });
</script>
<style type="text/css">
    .table td:nth-child(3) { text-align: center; }
    .text-right {
    text-align: center!important;
}
</style>
<style>
    .table_cutting{
        background: aqua;
        text-align: center;
        font-size: 20px;
    }
    .table_stitching{
        background: #b2d9b2;
        text-align: center;
        font-size: 20px;
    }
    
</style>
<section class="content">
    <div class="row">
        <div class="col-sm-12">
            <div class="box box-primary">
                <div class="box-header">
                    <a href="#" class="btn btn-default btn-sm toggle_form pull-right"><?= lang("show_hide"); ?></a>
                    <h3 class="box-title"><?= lang('customize_report'); ?></h3>
                    </div>
                    <div class="box-body">
                        <div id="form" class="panel panel-warning">
                            <div class="panel-body">

                                <?= form_open("reports/staff_report"); ?>
                                <div class="row">
                                    
                                    <div class="col-sm-3">
                                        <div class="form-group">
                                            <label class="control-label" for="users"><?= lang("users"); ?></label>
                                            <?php
                                            $u[0] = lang("select")." ".lang("users");
                                            foreach($users as $user){
                                                $u[$user->id] = $user->first_name;
                                            }
                                            echo form_dropdown('users', $u, set_value('users'), 'class="form-control select2" style="width:100%" id="users"'); ?>
                                        </div>
                                    </div>
                                    
                                    <div class="col-sm-2">
                                        <div class="form-group">
                                            <label class="control-label" for="start_date">Start Date</label>
                                            <input type="date" name="start_date" id="start_date" class="form-control" style="width:100%;" />
                                        </div>
                                    </div>
                                    
                                    <div class="col-sm-2">
                                        <div class="form-group">
                                            <label class="control-label" for="end_date">End Date</label>
                                            <input type="date" name="end_date" id="end_date" class="form-control" style="width:100%;" />
                                        </div>
                                    </div>

                                <div class="col-sm-3">
                                    <br><button type="submit" class="btn btn-primary"><?= lang("submit"); ?></button>
                                </div>
                            </div>
                            <?= form_close(); ?>

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

                    <div class="table-responsive">
                        <table id="PayRData" class="table table-bordered table-hover table-striped table-condensed reports-table">
                            <thead>
                                <tr>
                                    <td colspan="4" class="p0"><input type="text" class="form-control b0" name="search_table" id="search_table" placeholder="<?= lang('type_hit_enter'); ?>" style="width:100%;"></td>
                                </tr>
                                <tr>
                                    <th style="max-width:30px;"><?= lang("id"); ?></th>
                                    <th class="col-xs-3" rowspan="2" style="font-size: 26px;color: brown; vertical-align: top;">Staff Name</th>
                                    <th class="col-xs-3" colspan="2" style="background: aqua;">Cutting</th>
                                    <th class="col-xs-2" colspan="2" style="background: #b2d9b2;">Stitching</th>
                                </tr>
                                <tr>
                                    <th></th>
                                    <th class="col-xs-1" style="background: aqua;">Shirt</th>
                                    <th class="col-xs-1" style="background: aqua;">Pant</th>
                                    <th class="col-xs-1" style="background: #b2d9b2;">Shirt</th>
                                    <th class="col-xs-1" style="background: #b2d9b2;">Pant</th>
                                </tr>
                            </thead>
                            <tbody style="font-size: 18px;">
                                <tr>
                                    <td colspan="6" class="dataTables_empty"><?= lang('loading_data_from_server') ?></td>
                                </tr>
                            </tbody>
                            <tfoot>
                                <tr class="active">
                                    <th style="max-width:30px;"><input type="text" class="text_filter" placeholder="[<?= lang('id'); ?>]"></th>
                                    <th class="col-xs-3">Staff Name</th>
                                    <th class="col-xs-1" style="font-size: 20px;text-align: center; background: aqua;">Cutting Pant</th>
                                    <th class="col-xs-1" style="font-size: 20px;text-align: center; background: aqua;">Cutting Shirt</th>
                                    <th class="col-xs-1" style="font-size: 20px;text-align: center; background: #b2d9b2;">Stitching Pant</th>
                                    <th class="col-xs-1" style="font-size: 20px;text-align: center; background: #b2d9b2;">Stitching Shirt</th>
                                </tr>
                                
                            </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</section>

<script src="<?= $assets ?>plugins/bootstrap-datetimepicker/js/moment.min.js" type="text/javascript"></script>
<script src="<?= $assets ?>plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $('.datetimepicker').datetimepicker({
            format: 'YYYY-MM-DD HH:mm'
        });
        $('.datepicker').datetimepicker({format: 'YYYY-MM-DD', showClear: true, showClose: true, useCurrent: false, widgetPositioning: {horizontal: 'auto', vertical: 'bottom'}, widgetParent: $('.dataTable tfoot')});
    });
</script>

Zerion Mini Shell 1.0