<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Delete extends CI_Controller {

	public function index($colorid='')
	{  

		$dataInsert = array(
			'idwarna' => $colorid,
		);

		$url 			= linkservice('stock') ."warna/delete/";
		$method 		= 'POST';
		$responseApi 	= admsCurl($url, $dataInsert, $method);
 
		if ($responseApi['err']) {
			echo "<hr>cURL Error #:" . $responseApi['err'];
		} else {
			$responseApiInsert = json_decode($responseApi['response'], true);
			if ($responseApiInsert['status'] == 1){
					// respon berhasil 
				$this->session->set_flashdata('message', '<div class="alert alert-danger">'.$responseApiInsert['message'].'</div>');
				redirect('master/warna/lists','refresh');

			} else if ($responseApiInsert['status'] == 0){
					// respon gagal
				$this->session->set_flashdata('message', '<div class="alert alert-warning">'.$responseApiInsert['message'].'</div>');
				redirect('master/warna/lists','refresh');

			}
		} 

	}

	function _remap($method)
	{
		$this->index($method);
	}
}

/* End of file Delete.php */
/* Location: ./application/controllers/master/warna/Delete.php */
