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

class Setting extends CI_Controller
{

	public function __construct()
	{
		parent::__construct();
		$this->load->model('Mmasuk');
	}

	public function index()
	{
		$data["setting"] = $this->db->get("setting")->result_array();
		$this->load->view('formsetting', $data);
	}

	public function edit()
	{
		$id = $this->input->post("id_tabel");
		$data = [
			"nama_ramp" => $this->input->post("nama_ramp"),
			"nomor_hp" => $this->input->post("nomor_hp"),
			"potongan_ramp" => (float) $this->input->post("potongan_harga"),
			"harga_buah" => (float) $this->input->post("harga_buah"),
			"service_wa" => $this->input->post("whatsapp"),
		];
		$this->db->where("id", $id)->update("setting", $data);
		echo "2";
	}

	// public function hapus()
	// {
	// 	$this->db->where("id", $this->input->post("id"))->delete("kendaraan");
	// 	echo "3";
	// }
}

/* End of file Masuk.php */
/* Location: ./application/controllers/Masuk.php */