• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI for Accounting

#11
This is my akun view


<div class="row" style="margin-bottom: 10px">
<div class="col-md-4">
<h2 style="margin-top:0px"><b>Data</b> | Akun</h2>
</div>
<div class="col-md-4 text-center">
<div style="margin-top: 4px" id="message">
<?php echo $this->session->userdata('message') <> '' ? $this->session->userdata('message') : ''; ?>
</div>
</div>
<div class="col-md-4 text-right">
<?php echo anchor(site_url('akun/create'), 'Create', 'class="btn btn-primary"'); ?>
<?php echo anchor(site_url('akun/excel'), 'Excel', 'class="btn btn-primary"'); ?>
<?php echo anchor(site_url('akun/word'), 'Word', 'class="btn btn-primary"'); ?>
</div>
</div>
<table class="table table-bordered table-striped table-hover" id="mytable">
<thead>
<tr>
<th width="80px">No</th>
<th>Kode Akun</th>
<th>Nama Akun</th>
<th>Saldo Normal</th>
<th>Saldo</th>
<th width="200px">Action</th>
</tr>
</thead>

</table>
<script src="<?php echo base_url('assets/js/jquery-1.11.2.min.js') ?>"></script>
<script src="<?php echo base_url('assets/datatables/jquery.dataTables.js') ?>"></script>
<script src="<?php echo base_url('assets/datatables/dataTables.bootstrap.js') ?>"></script>
<script type="text/javascript">
$(document).ready(function() {
$.fn.dataTableExt.oApi.fnPagingInfo = function(oSettings)
{
return {
"iStart": oSettings._iDisplayStart,
"iEnd": oSettings.fnDisplayEnd(),
"iLength": oSettings._iDisplayLength,
"iTotal": oSettings.fnRecordsTotal(),
"iFilteredTotal": oSettings.fnRecordsDisplay(),
"iPage": Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength),
"iTotalPages": Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength)
};
};

var t = $("#mytable").dataTable({
initComplete: function() {
var api = this.api();
$('#mytable_filter input')
.off('.DT')
.on('keyup.DT', function(e) {
if (e.keyCode == 13) {
api.search(this.value).draw();
}
});
},
oLanguage: {
sProcessing: "loading..."
},
processing: true,
serverSide: true,
ajax: {"url": "akun/json", "type": "POST"},
columns: [
{
"data": "id",
"orderable": false
},{"data": "kode_akun"},{"data": "nama_akun"},{"data": "saldo_normal"},{"data": "saldo"},
{
"data" : "action",
"orderable": false,
"className" : "text-center"
}
],
order: [[0, 'desc']],
rowCallback: function(row, data, iDisplayIndex) {
var info = this.fnPagingInfo();
var page = info.iPage;
var length = info.iLength;
var index = page * length + (iDisplayIndex + 1);
$('td:eq(0)', row).html(index);
}
});
});
</script>
Reply

#12
So, I get trouble when try to join two tables (akun and akun_detail)
Reply

#13
Is it possible to view join table by selecting data in one click?
Reply

#14
(10-01-2017, 03:57 PM)tamam Wrote: Is it possible to view join table by selecting data in one click?

Yes of course it is.

You posted a lot of code. Not sure why.

Your click (assuming it is not js) calls a controller. Your controller collects the data (be it a joined query, multiple queries, queries and logic applied, whatever you need) and sends it to a view.

Your view displays the requested data in whatever format you want.

If you have a more detailed question, then for the sake of our time, perhaps you could narrow down your question so that we do not have to read tons of code.

You sent me a buddy request but not sure why? I have been on this forum for a long time but have not ever received one of these. So thank you but the power of CI remains foremost in the CI team actually doing the work, and then in the community that willingly helps if we can.

Best wishes,

Paul.
Reply

#15
(10-01-2017, 05:44 PM)PaulD Wrote:
(10-01-2017, 03:57 PM)tamam Wrote: Is it possible to view join table by selecting data in one click?

Yes of course it is.

You posted a lot of code. Not sure why.

Your click (assuming it is not js) calls a controller. Your controller collects the data (be it a joined query, multiple queries, queries and logic applied, whatever you need) and sends it to a view.

Your view displays the requested data in whatever format you want.

If you have a more detailed question, then for the sake of our time, perhaps you could narrow down your question so that we do not have to read tons of code.

You sent me a buddy request but not sure why? I have been on this forum for a long time but have not ever received one of these. So thank you but the power of CI remains foremost in the CI team actually doing the work, and then in the community that willingly helps if we can.

Best wishes,

Paul.

Ok Paul, thank for your respond and I would like to apologize if any mistake of me.

For the sample of my code which I posted in this forum, it is to describe my problem in coding. So, I apologize if you have in mind. Next, I will try as can as possible to make that more simply.

And, about the buddy request, it is just to honour some one that respond my post. So, once again I’m so sorry…


sincerely yours
Tam
Reply

#16
@taman ... using "code" or "php" tags around your code will improve the odds that people will read it, rather than close the thread because "TL;DR" Undecided
Reply

#17
(10-01-2017, 08:00 PM)ciadmin Wrote: @taman ... using "code" or "php" tags around your code will improve the odds that people will read it, rather than close the thread because "TL;DR" Undecided

Ok ok Admin...

Thank for your advice....
Reply

#18
@tamam

Seriously, we are here to help and I am sure everyone wishes you the best of luck with your project. CI is a powerful framework and many great sites are powered by it. You have nothing to apologise for. Look forward to helping you with any questions in the future,

Paul.
Reply

#19
(10-02-2017, 11:10 AM)PaulD Wrote: @tamam

Seriously, we are here to help and I am sure everyone wishes you the best of luck with your project. CI is a powerful framework and many great sites are powered by it. You have nothing to apologise for. Look forward to helping you with any questions in the future,

Paul.

Ok Paul..
Thank you very much for your respond. Next, I will try make straight question in this forum..
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.