ok
Direktori : /home2/selectio/www/mm-tailor-billing/themes/default/views/purchases/delete_files/ |
Current File : /home2/selectio/www/mm-tailor-billing/themes/default/views/purchases/delete_files/expenses.php |
<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); ?> <?php $v = "?v=1"; if ($this->input->post('category')){ $v .= "&category=".$this->input->post('category'); } if ($this->input->post('sub_category')){ $v .= "&sub_category=".$this->input->post('sub_category'); } 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() { function attach(x) { if (x !== null) { return '<a href="<?=base_url();?>uploads/'+x+'" target="_blank" class="btn btn-primary btn-block"><i class="fa fa-chain"></i></a>'; } return ''; } var table = $('#expData').DataTable({ 'ajax' : { url: '<?=site_url('purchases/get_expenses'.$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, 5 ] } }, { extend: 'excelHtml5', 'footer': true, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } }, { extend: 'csvHtml5', 'footer': true, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } }, { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4', 'footer': true, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } }, { extend: 'colvis', text: 'Columns'}, ], "columns": [ { "data": "id", "visible": false }, { "data": "date" }, { "data": "amount", "render": currencyFormat }, { "data": "note" }, { "data": "category", "className": "text-center" }, { "data": "sub_category", "className": "text-center"}, { "data": "user" }, /*{ "data": "attachment", "render": attach, "searchable": false, "orderable": false },*/ { "data": "Actions", "searchable": false, "orderable": false } ], "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)) ); } }); $('#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> <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="add_expense" class="btn btn-success btn-sm pull-right">Add Expense</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("purchases/expenses");?> <div class="row"> <div class="col-sm-3"> <div class="form-group"> <label class="control-label" for="category">Category</label> <select name="category" id="category" class="form-control select2" onchange="getsubCategory()" onkey="getsubCategory()" style="width:100%"> <option value="">All Category</option> <?php $f=1; foreach($expense_category as $category){ ?> <option value="<?=$category->id?>"><?=$category->name?></option> <?php $f++; } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label class="control-label" for="category">Sub Category</label> <select name="sub_category" id="sub_category" class="form-control" style="width:100%"> <option value="0">All Sub Category</option> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label class="control-label" for="start_date"><?= lang("start_date"); ?></label> <?= form_input('start_date', set_value('start_date'), 'class="form-control datetimepicker" id="start_date"');?> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label class="control-label" for="end_date"><?= lang("end_date"); ?></label> <?= form_input('end_date', set_value('end_date'), 'class="form-control datetimepicker" id="end_date"');?> </div> </div> <div class="col-sm-12"> <button type="submit" class="btn btn-primary"><?= lang("submit"); ?></button> </div> </div> <?= form_close();?> </div> </div> <!-- Filter Section Ends Here --> <div class="table-responsive"> <table id="expData" class="table table-bordered table-hover table-striped"> <thead> <tr class="active"> <th style="max-width:30px;"><?= lang("id"); ?></th> <th class="col-xs-2"><?= lang("date"); ?></th> <th class="col-xs-1"><?= lang("amount"); ?></th> <th class="col-xs-4"><?= lang("note"); ?></th> <th class="col-xs-4"><?= lang("accounts"); ?></th> <th class="col-xs-4"><?= lang("variations"); ?></th> <th class="col-xs-2"><?= lang("created_by"); ?></th> <!--<th style="min-width:30px; width: 30px; text-align: center;"><i class="fa fa-chain"></i></th>--> <th style="width:100px;"> <?= lang("actions"); ?> </th> </tr> </thead> <tbody> <tr> <td colspan="8" 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-sm-2"><span class="datepickercon"><input type="text" class="text_filter datepicker" placeholder="[<?= lang('date'); ?>]"></span></th> <th class="col-xs-1"><?= lang('amount'); ?></th> <th><input type="text" class="text_filter" placeholder="[<?= lang('note'); ?>]"></th> <th class="col-xs-1"><?= lang('category'); ?></th> <th class="col-xs-1"><?= lang('sub_category'); ?></th> <th><input type="text" class="text_filter" placeholder="[<?= lang('created_by'); ?>]"></th> <!--<th style="width:25px; padding-right:5px;"><i class="fa fa-chain"></i></th>--> <th style="width:75px;"><?= lang('actions'); ?></th> </tr> <tr> <td colspan="9" 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> </tfoot> </table> </div> <div class="clearfix"></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"> $(document).ready(function() { $('.datepicker').datetimepicker({format: 'YYYY-MM-DD', showClear: true, showClose: true, useCurrent: false, widgetPositioning: {horizontal: 'auto', vertical: 'bottom'}, widgetParent: $('.dataTable tfoot')}); }); $(function () { $('.datetimepicker').datetimepicker({ format: 'YYYY-MM-DD' }); }); </script> <script type="text/javascript"> $(document).ready(function(){ $('#form').hide(); $('.toggle_form').click(function(){ $("#form").slideToggle(); return false; }); }); </script> <script> function getsubCategory(){ var category=$('#category').val(); $.ajax({ type: "get", url: '<?=site_url('purchases/get_filter_sub_category');?>', data : {category:category}, dataType: "text", success: function(t) { $('#sub_category').append(t); }, error:function(err){ alert(err); } }); $('#sub_category').empty(); } </script>