69 lines
1.9 KiB
PHP
69 lines
1.9 KiB
PHP
<?php
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
class ManageClaim extends CI_Controller
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('ModelProgress', 'MP');
|
|
$this->load->model('ModelService', 'MS');
|
|
$this->load->model('ModelAgen', 'MA');
|
|
$this->load->model('ModelClaim', 'MC');
|
|
$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()
|
|
{
|
|
|
|
$datProgress = $this->MP->getDataProgress();
|
|
$datService = $this->MS->getDataServiceClaim();
|
|
$datClaim = $this->MC->getViewClaim();
|
|
$datAgen = $this->MA->getDataAgen();
|
|
|
|
$data = [
|
|
'sidebar' => "data claim service",
|
|
'navChild' => "data claim input",
|
|
'claim' => $datClaim,
|
|
'service' => $datService,
|
|
'agen' => $datAgen
|
|
];
|
|
|
|
$this->load->view('master/Claim', $data);
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_garansi = $this->input->post('id_garansi');
|
|
$id_agen = $this->input->post('id_agened');
|
|
$id_service = $this->input->post('id_serviceed');
|
|
$nolap_garansi = $this->input->post('nolap_garansi');
|
|
$keterangan_garansi = $this->input->post('keterangan_garansi');
|
|
|
|
$input = [
|
|
'NOLAP_GARANSI' => $nolap_garansi,
|
|
'AGEN_ID' => $id_agen,
|
|
'KETERANGAN_GARANSI' => $keterangan_garansi,
|
|
'TANGGAL_GARANSI' => date('Y-m-d H:i:s'),
|
|
'STATUS_GARANSI' => "Proses Claim"
|
|
];
|
|
|
|
$action = $this->MC->update('garansi', $input,'ID_GARANSI',$id_garansi);
|
|
|
|
if ($action) {
|
|
$this->session->set_flashdata('flash', 'diproses');
|
|
redirect('ManageClaim');
|
|
} else {
|
|
$this->session->set_flashdata('flashgagal', 'diproses');
|
|
redirect('ManageClaim');
|
|
}
|
|
}
|
|
|
|
}
|