64 lines
1.6 KiB
PHP
64 lines
1.6 KiB
PHP
<?php
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
class ManageStockItp extends CI_Controller
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('ModelProgress', 'MP');
|
|
$this->load->model('ModelService', 'MS');
|
|
$this->load->model('ModelOperator', 'MO');
|
|
$this->load->model('ModelTeknisi', 'MT');
|
|
$this->load->model('ModelStock', 'MSt');
|
|
$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()
|
|
{
|
|
|
|
$datStock = $this->MSt->getDataStockItp();
|
|
$datService = $this->MS->getDataService();
|
|
$datTeknisi = $this->MT->getDataTeknisi();
|
|
|
|
$data = [
|
|
'sidebar' => "data laporan service",
|
|
'navChild' => "data laporan stock itp",
|
|
'stock' => $datStock,
|
|
'service' => $datService,
|
|
'teknisi' => $datTeknisi
|
|
];
|
|
|
|
$this->load->view('master/StockItp', $data);
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
$method = $this->input->post('method');
|
|
$id_progress = $this->input->post('id_progress');
|
|
$status_progress = $this->input->post('status_progressed');
|
|
|
|
|
|
$input = [
|
|
'STATUS_PROGRESS' => $status_progress,
|
|
'TANGGAL_KONFIRM' => date('Y-m-d H:i:s')
|
|
];
|
|
|
|
$action = $this->MP->update('progress', $input, 'ID_PROGRESS',$id_progress);
|
|
|
|
if ($action) {
|
|
$this->session->set_flashdata('flash', 'ditambah');
|
|
redirect('ManageStockItp');
|
|
} else {
|
|
$this->session->set_flashdata('flashgagal', 'ditambah');
|
|
redirect('ManageStockItp');
|
|
}
|
|
}
|
|
|
|
}
|