<?php
class M_dashboard extends CI_Model
{
	function total_pengunjung($tgl = "", $bulan = "", $tahun = "")
	{
		$q = "SELECT COUNT(id) jml FROM pengunjung WHERE id IS NOT NULL ";
		if ($tgl != "") {
			$q .= " AND tanggal='$tgl' ";
		}

		if ($bulan != "" && $tahun != "") {
			$q .= " AND MONTH(tanggal)='$bulan' AND YEAR(tanggal)='$tahun' ";
		}

		$query = $this->db->query($q);
		return $query;
	}
}
