78 lines
1.9 KiB
PHP
78 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 ManagePiutangDagang extends CI_Controller
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('ModelPiutangDagang', 'PiutangDagang');
|
|
$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);
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
|
|
$datPiutangDagang = $this->PiutangDagang->getDataPiutangDagang();
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'piutangdagang' => $datPiutangDagang
|
|
];
|
|
|
|
$this->load->view('proses/PiutangDagang', $data);
|
|
}
|
|
|
|
public function konfirmasi()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_pda = $this->input->post('id_pda');
|
|
|
|
$update = [
|
|
'STATUS_PDA' => "LUNAS"
|
|
];
|
|
|
|
$action = $this->PiutangDagang->update('piutang_dagang', $update, 'ID_PDA', $id_pda);
|
|
|
|
if ($action) {
|
|
$this->session->set_flashdata('flash', 'dikunci');
|
|
redirect('ManagePiutangDagang');
|
|
} else {
|
|
$this->session->set_flashdata('flashgagal', 'dikunci');
|
|
redirect('ManagePiutangDagang');
|
|
}
|
|
|
|
}
|
|
|
|
public function viewDeskripsi($id)
|
|
{
|
|
$deskripsi = $this->PiutangDagang->getDataDeskripsiPDA($id);
|
|
$title = $this->PiutangDagang->getTitlePDA($id);
|
|
|
|
$data = [
|
|
'sidebar' => "menu accounting",
|
|
'navChild' => "",
|
|
'deskripsi' => $deskripsi,
|
|
'id_pda' => $id,
|
|
'title1' => $title[0]['KODE_PDA'],
|
|
'title2' => $title[0]['DEBIT'],
|
|
'title3' => $title[0]['KREDIT']
|
|
];
|
|
|
|
$this->load->view('proses/DeskripsiPDA', $data);
|
|
}
|
|
|
|
}
|