<?php
class SettingModel{
	public $id;
	public $setting_name;
	public $setting_val;
	public $setting_type; //1 text 2 blob
}
class SettingPaymentModel{
	public $setting_bank_name ;
	public $setting_account_number;
	public $setting_account_name;
	public $setting_qr_code;
	public $setting_remark;
}


class Settings{
	private $conn = null;
	function __construct(){
		$db = new DB();
		$this->conn = $db->DBConnect();
	}
	public function getMMK(){
		$sql = "select * from app_settings where setting_name = 'mmk' " ; 
		$result = $this->conn->query($sql);
		$setting = new SettingModel();
		while($row = $result->fetch_assoc()) {
			

			$setting->id = $row["id"];
			$setting->setting_name = $row["setting_name"];
			$setting->setting_val =  $row["setting_val"];

			
		}
		return $setting;
	}

	public function getSettingPayment(){
		$sql = "select * from setting_payments " ; 
		$result = $this->conn->query($sql);
		
		$payments = array();
		while($row = $result->fetch_assoc()) {
			$setting_payment = new SettingPaymentModel();
			$setting_payment->setting_bank_name = $row["bank_name"];
			$setting_payment->setting_account_number = $row["account_number"];
			$setting_payment->setting_account_name = $row["account_name"];
			$setting_payment->setting_qr_code = $row["qr_code"];
			$setting_payment->setting_remark = $row["remark"];
			
			$payments[] = $setting_payment;
		}

		return $payments;
	}



	
}


?>