ok

Mini Shell

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

<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); ?>
<?php
$v = "? v=1";

$page_count=25;

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

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

if ($this->input->post('material')) {
    $v .= "&material=".$this->input->post('material');$page_count=-1;
}

if ($this->input->post('date')){
    $v .= "&date=".$this->input->post('date');$page_count=-1;
}

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

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

            'ajax' : { url: '<?=site_url('material_usage/get_material_usage'. $v);?>', type: 'POST', "data": function ( d ) {
                d.<?=$this->security->get_csrf_token_name();?> = "<?=$this->security->get_csrf_hash()?>";
            }},
            "buttons": [
            { extend: 'copyHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } },
            { extend: 'excelHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } },
            { extend: 'csvHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } },
            { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4', 'footer': false,
            exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } },
            { extend: 'colvis', text: 'Columns'},
            ],
            
            "pageLength": <?=$page_count?>,
            
            "columns": [
            { "data": "id", "visible": false },
            { "data": "Actions", "searchable": false, "orderable": false },
            { "data": "date" },
            { "data": "material_name", "className": "text-center" },
            { "data": "qty", "className": "text-center" },
            { "data": "remarks", "className": "text-left"},
            /*{ "data": "user_name", "className": "text-center"},
            { "data": "unit_name", "className": "text-center"},*/
           /* { "data": "Actions", "searchable": false, "orderable": false }*/
            ]

        });

        $('#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();
            }
        });

    });
</script>


<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box box-primary">
                <div class="box-header">
                    <a href="#" class="btn btn-default btn-sm toggle_form pull-right" style="margin-left: 6px;"><?= lang("show_hide"); ?></a>
                    <a href="material_usage/add" class="btn btn-success btn-sm pull-right">Add Material Usage</a>
                    <h3 class="box-title"><?= lang('list_results'); ?></h3>
                </div>
                <div class="box-body">
                    <!-- Filter Section Starts Here -->
                    <div id="form" class="panel panel-warning">
                        <div class="panel-body">
                            <?= form_open("material_usage");?>

                            <div class="row">
                                
                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <label class="control-label" for="start_date"><?= lang("start_date"); ?></label>
                                        <input type="date" name="start_date" class="form-control" id="start_date">
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <label class="control-label" for="end_date"><?= lang("end_date"); ?></label>
                                         <input type="date" name="end_date" class="form-control" id="end_date">
                                    </div>
                                </div>
                                
                                
                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <label class="control-label" for="date">Date</label>
                                         <input type="date" name="date" class="form-control" id="date">
                                    </div>
                                </div>
                                
                                <div class="col-sm-3">
                                    <div class="form-group">
                                        <label class="control-label" for="material">Material</label>
                                        <select name="material" class="form-control select2" style="width:100%" id="material">
                                            <option value="">Select Material</option>
                                            <?php
                                            foreach($products as $product){   ?>
                                               <option value="<?=$product->id?>" <?php if($_GET['cus']==$product->id){echo "selected";}?>><?=$product->name?></option> 
                                            <?php } ?>
                                        </select>
                                    </div>
                                </div>
                            
                             
                                
                                <div class="col-sm-2">
                                    <div class="form-group">
                                    <label class="control-label" for="customer">&nbsp;</label><br>
                                    <button type="submit" class="btn btn-primary"><?= lang("submit"); ?></button>
                                    </div>
                                </div>
                            </div>
                            <?= form_close();?>
                        </div>
                    </div>
                    <!-- Filter Section Ends Here -->
                    <div class="table-responsive">
                        <table id="catData" class="table table-striped table-bordered table-condensed table-hover" style="margin-bottom:5px;">
                            <thead>
                                <tr>
                                    <td colspan="6" 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 class="active">
                                    <th style="max-width:30px;"><?= lang("id"); ?></th>
                                    <th>Action</th>
                                    <th>Date</th>
                                    <th>Material Name</th>
                                    <th>Quantity</th>
                                    <th style="width:250px;">Remarks</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td colspan="6" class="dataTables_empty"><?= lang('loading_data_from_server'); ?></td>
                                </tr>
                            </tbody>
                            <tfoot>
                                
                            </tfoot>
                        </table>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>

<script type="text/javascript">
    $(document).ready(function(){
        /*$('#form').hide();*/
        $('.toggle_form').click(function(){
            $("#form").slideToggle();
            return false;
        });
    });
</script>

Zerion Mini Shell 1.0