80 lines
1.9 KiB
PHP
80 lines
1.9 KiB
PHP
<?php
|
|
|
|
use Restserver\Libraries\REST_Controller;
|
|
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
require APPPATH . 'libraries/REST_Controller.php';
|
|
require APPPATH . 'libraries/Format.php';
|
|
|
|
class ManageHutangDagang extends CI_Controller
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('ModelHutangDagang', 'HutangDagang');
|
|
$this->load->library(['datatables', 'form_validation']);
|
|
$this->form_validation->set_error_delimiters('', '');
|
|
}
|
|
public function output_json($data, $encode = true)
|
|
{
|
|
if ($encode) $data = json_encode($data);
|
|
$this->output->set_content_type('application/json')->set_output($data);
|
|
}
|
|
|
|
//Step One, Input Hutang Dagang
|
|
public function index()
|
|
{
|
|
|
|
$datHutangDagang = $this->HutangDagang->getDataHutangDagang();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'hutangdagang' => $datHutangDagang
|
|
];
|
|
|
|
$this->load->view('proses/HutangDagang', $data);
|
|
}
|
|
|
|
public function konfirmasi()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_hda = $this->input->post('id_hda');
|
|
|
|
$update = [
|
|
'STATUS_HDA' => "LUNAS"
|
|
];
|
|
|
|
$action = $this->HutangDagang->update('hutang_dagang', $update, 'ID_HDA', $id_hda);
|
|
|
|
if ($action) {
|
|
$this->session->set_flashdata('flash', 'dikunci');
|
|
redirect('ManageHutangDagang');
|
|
} else {
|
|
$this->session->set_flashdata('flashgagal', 'dikunci');
|
|
redirect('ManageHutangDagang');
|
|
}
|
|
|
|
}
|
|
|
|
//Step Two, View Deskripsi
|
|
public function viewDeskripsi($id)
|
|
{
|
|
$deskripsi = $this->HutangDagang->getDataDeskripsiHDA($id);
|
|
$title = $this->HutangDagang->getTitleHDA($id);
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'deskripsi' => $deskripsi,
|
|
'id_hda' => $id,
|
|
'title1' => $title[0]['KODE_HDA'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['KREDIT']
|
|
];
|
|
|
|
$this->load->view('proses/DeskripsiHDA', $data);
|
|
}
|
|
|
|
}
|