<tr> <th style="width: 5%">No</th> <th style="width: 10%">Tanggal</th> <th style="width: 15%">No Bukti</th> <th style="width: 10%">No Rekening</th> <th style="width: 20%">Nama Rekening</th> <th style="width: 20%">Keterangan</th> <th style="width: 10%">Debet</th> <th style="width: 10%">Kredit</th> </tr> <?php $no = 1; $debit_total = 0; $credit_total = 0; foreach ($rows as $value) { echo "\n <tr>\n <td style='text-align:center'>{$no}</td>\n <td>" . sql_to_human($value->journals_date) . "</td>\n <td>{$value->transaction_id}</td>\n <td>{$value->account_no}</td>\n <td>{$value->account_name}</td>\n <td>{$value->remark}</td>\n <td style='text-align:right'>" . format_idr_currency($value->debit) . "</td>\n <td style='text-align:right'>" . format_idr_currency($value->credit) . "</td>\n </tr>\n "; $no++; $debit_total += $value->debit; $credit_total += $value->credit; } ?> <tr> <th colspan="6" class="right">Total</th> <th class="right"><?php echo format_idr_currency($debit_total); ?> </th> <th class="right"><?php echo format_idr_currency($credit_total); ?> </th>
public function print_report() { // error_reporting(0); $label_account = ''; if ($this->input->get('account_id') == '0') { //all acount $view = 'ledger/print_all'; $rows = $this->ledger_model->get_report($this->input->get('month'), $this->input->get('year')); } else { //per account $view = 'ledger/print'; $rows = $this->ledger_model->get_report($this->input->get('month'), $this->input->get('year'), $this->input->get('account_id')); $label_account = "{$rows[0]->account_no} {$rows[0]->account_name}"; } if (count($rows) == 0) { echo "<script>alert('Tidak ada data!');close();</script>"; exit; } $saldo = 0; $data['rows'] = array(); $i = 1; $current_account_id = 0; foreach ($rows as $row) { if ($current_account_id != $row->account_id) { $i = 1; $saldo = 0; } $current_account_id = $row->account_id; $row->no = $i++; $row->journals_date = sql_to_human($row->journals_date); $row->debit_txt = format_idr_currency($row->debit); $row->credit_txt = format_idr_currency($row->credit); $row->saldo_debit = '0'; $row->saldo_credit = '0'; $saldo = $saldo + $row->debit - $row->credit; if ($saldo > 0) { $row->saldo_debit = format_idr_currency($saldo); } else { if ($saldo < 0) { $row->saldo_credit = format_idr_currency(abs($saldo)); } } array_push($data['rows'], $row); } $data['company_name'] = $this->_get_company_name(); $data['company_address'] = $this->_get_company_address(); $month = month_indo($this->input->get('month')); $data['period'] = $month . ' ' . $this->input->get('year'); $html = $this->load->view($view, $data, true); $this->load->library('tumbaspdf'); $title = "Buku Besar {$label_account} {$data['period']}"; $this->tumbaspdf->set_author("{$data['company_name']} - {$this->_user_name}"); $this->tumbaspdf->generate_pdf($html, $title); }
public function view($param = '') { if ($this->input->is_ajax_request() && $param != '') { $data = $this->employee_model->get_info(decode($param)); $data->employee_id = encode($data->employee_id); $data->birth_date = sql_to_human($data->birth_date); $this->load->view('employee/view', $data); } else { echo 'Forbidden access!'; } }
<!-- mini logo for sidebar mini 50x50 pixels --> <span class="logo-mini"><b><i class="fa fa-desktop"></i></b></span> <!-- logo for regular state and mobile devices --> <span class="logo-lg"><b><i class="fa fa-desktop"></i> AKSI </b></span> </a> <!-- Header Navbar --> <nav class="navbar navbar-static-top" role="navigation"> <!-- Sidebar toggle button--> <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"> <span class="sr-only">Toggle navigation</span> </a> <span style="font-size: 18px; color: white; line-height: 50px; text-spacing: trim-start;"> Aplikasi Koperasi <i class="fa fa-calendar"></i> <?php echo sql_to_human(date('Y-m-d')); ?> </span> <!-- Navbar Right Menu --> <div class="navbar-custom-menu"> <ul class="nav navbar-nav"> <!-- <!-- Messages: style can be found in dropdown.less--> <!-- <li class="dropdown messages-menu"> Menu toggle button <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-envelope-o"></i> <span class="label label-success">4</span> </a> <ul class="dropdown-menu"> <li class="header">You have 4 messages</li>
public function edit($param = '') { if ($this->input->is_ajax_request()) { if ($this->input->post() == FALSE) { $this->load->model(array('account_model')); $data = $this->db->get_where('t_trx_journals', array('journals_id' => decode($param)))->row_array(); $data['journals_date'] = sql_to_human($data['journals_date']); $data['journals_id'] = $param; $data['journals_detail'] = $this->db->get_where('t_trx_journals_detail', array('journals_id' => decode($param)))->result(); $data['account_list'] = $this->account_model->get_all(); $data['title'] = 'Edit Jurnal Umum'; $data['content'] = 'journals/edit'; $this->load->view($data['content'], $data); } else { //SAVING DATA HERE $this->_set_rules(); if ($this->form_validation->run() == TRUE) { $this->db->trans_start(); $journals_id = decode($this->input->post('journals_id')); //save header $data_header = array('journals_id' => $journals_id, 'journals_date' => human_to_sql($this->input->post('journals_date')), 'transaction_id' => $this->input->post('transaction_id'), 'remark' => $this->input->post('remark'), 'journals_type' => 1); $this->global_model->save_data('t_trx_journals', $data_header, 'journals_id'); //delete old detail $this->db->delete('t_trx_journals_detail', array('journals_id' => $journals_id)); //save detail foreach ($this->input->post('account_id') as $key => $value) { $data_detail = array('journals_id' => $journals_id, 'account_id' => $this->input->post("account_id[{$key}]"), 'debit' => $this->input->post("debit[{$key}]"), 'credit' => $this->input->post("credit[{$key}]")); $this->global_model->save_data('t_trx_journals_detail', $data_detail); } $response = array(); $this->db->trans_complete(); if ($this->db->trans_status() == TRUE) { $response = array('status' => 'success', 'message' => 'Berhasil mengedit jurnal.'); } else { $response = array('status' => 'error', 'message' => 'Gagal mengedit jurnal.'); } } else { $response = array('status' => 'warning', 'message' => validation_errors()); } echo json_encode($response); } } else { echo 'Forbidden access'; } }