public function main()
	{

		// Input Panel
		$data['modulecode'] = $this->input->post('modulecode');
		$modulecode = $this->input->post('modulecode');


		if($modulecode == "ID" || $modulecode == "IW"|| $modulecode == "IP" || $modulecode == "IB" || $modulecode == "INB"|| $modulecode == "ILK" ||$modulecode == "AT") 
		{
			$data['listWebsites'] = $this->m_masters->getWebsites()->result();
		}

		if($modulecode == "ILK") 
		{
			$data['listTransactionType'] = $this->m_masters->getTransactionType()->result();
		}
		if($modulecode == "IB" || $modulecode == "INB") 
		{
			$data['listStatusBank'] = $this->m_masters->getStatusBank()->result();
		}

		if($modulecode == "ID" || $modulecode == "IW" || $modulecode == "ITDI" || $modulecode == "IEO" || $modulecode == "IENO" || $modulecode == "SILK" || $modulecode == "ILK" ||$modulecode == "AT" || $modulecode == "IED" || $modulecode == "IEW") 
		{
			$data['listBanks'] = $this->m_masters->getBanks()->result();	
		}
		if($modulecode == "ID" || $modulecode == "IW" || $modulecode == "ITDI" || $modulecode == "IEO" || $modulecode == "IENO" || $modulecode == "AT") 
		{
			$data['listCurrencyRate'] = $this->m_masters->getCurrencyRate()->result();
		}


		if($modulecode == 'IED' || $modulecode == 'IEW')
		{
			$querystring = "select adminname from users 
			where 
			website = '".$this->session->userdata('website')."'
			 
			order by createddate desc";
		
			// echo $querystring;
			$data['listcs'] = $this->m_masters->querying($querystring)->result();
		}
		if($modulecode == "ID" || $modulecode == "IW" || $modulecode == 'IED' || $modulecode == 'IEW') 
		{
			$data['listStatusTransaksi'] = $this->m_masters->getStatusTransaksi()->result();
			$querystring = "select website from users where AdminName = '" .$this->session->userdata('username')."'";
			$data['website'] = $this->m_masters->querying($querystring)->result();
		}
		if($modulecode == "ID" || $modulecode == "IP")
		{		
			$data['listTelemarketing'] = $this->m_masters->getTelemarketing()->result();
		}
		if($modulecode == "IEO" || $modulecode == "IENO" )
		{
			$data['listExpenses'] = $this->m_masters->getExpenses()->result();
		}
		if($modulecode == "ITDI"   )
		{
		$data['listTransferDana'] = $this->m_masters->getTransferDana()->result();
		}
		if($modulecode == "IB" || $modulecode == "INB")
		{
			$data['listBankStatuses'] = $this->m_masters->getBankStatuses()->result();
		}
		if($modulecode == "IB")
		{
			$data['listBankPositions'] = $this->m_masters->getBankPositions()->result();
		}
		if($modulecode == "IP" || $modulecode == 'IB' || $modulecode == "INB")
		{
			$data['listBankMaster'] = $this->m_masters->getBankMaster()->result();
		}
		if($modulecode == "IWE")
		{
			$data['listWebsiteGroups'] = $this->m_masters->getWebsiteGroups()->result();
		}

		if($modulecode == "ILK")
		{
			$data['listLembarKerjaArr'] = $this->m_work->posts();
			$data['listLembarKerja'] = $this->m_work->posts()->result();
		}

		


		// datagrid

		
		if($modulecode == 'ID')
		{

		$querystring = "select username, website, nomorrekeningtujuan,namarekening,nomorrekening,amount,currency, adminname,createddate from deposits 
			where createddate <= concat(cast(date_format(now(),'%Y-%m-%d') as char), ' 23:59:59')
			and 
			createddate >= concat(cast(date_sub(date_format(now(),'%Y-%m-%d'), INTERVAL 1 DAY) as char), ' 00:00:00')
			and
			website = '".$this->session->userdata('website')."'
			order by createddate desc";
		$data['datatable'] = $this->m_masters->querying($querystring)->result();
		// echo $querystring;
		}

		else if($modulecode == 'IW')
		{
		$querystring = "select username, website, nomorrekeningpengirim,namarekening,nomorrekening,amount,currency, adminname,createddate from withdrawals 
			where createddate <= concat(cast(date_format(now(),'%Y-%m-%d') as char), ' 23:59:59')
			and 
			createddate >= concat(cast(date_sub(date_format(now(),'%Y-%m-%d'), INTERVAL 1 DAY) as char), ' 00:00:00')
			and
			website = '".$this->session->userdata('website')."'
			order by createddate desc";
		$data['datatable'] = $this->m_masters->querying($querystring)->result();
		}

		else if($modulecode == 'IEO')
		{
		$data['datatable'] = $this->m_masters->querying("select nomorrekeningpengirim,namarekeningpengirim,bankpengirim,nomorrekeningtujuan,namarekeningtujuan,banktujuan, amount,currency,keterangan,adminname,createddate from expenses order by createddate desc limit 10")->result();
		}

		else if($modulecode == 'ITDI' )
		{
		$data['datatable'] = $this->m_masters->querying("select nomorrekeningpengirim,namarekeningpengirim,bankpengirim,nomorrekeningtujuan,namarekeningtujuan,banktujuan, amount,currency,keterangan,adminname,createddate from transferdana 
			where createddate >= concat(cast(date_format(now(),'%Y-%m-%d') as char), ' 00:00:00')
			and 
			createddate <= concat(cast(date_sub(date_format(now(),'%Y-%m-%d'), INTERVAL 0 DAY) as char), ' 23:59:59')
			order by createddate desc")->result();
		}

		else if($modulecode == 'IP')
		{
		$data['datatable'] = $this->m_masters->querying("select username,website,namarekening,nomorrekening,bankrekening,photosurl,keterangan,referral,telemarketing,adminname,createddate from players order by createddate desc limit 10")->result();
		}

		else if($modulecode == 'IB' || $modulecode == 'INB')
		{
		$data['datatable'] = $this->m_masters->querying("select namarekening,nomorrekening,bankrekening,saldo,statusbank,website,status,position,hierarchno,adminname,createddate from banks order by createddate desc")->result();
		}

		else if($modulecode == 'ICR')
		{
		$data['datatable'] = $this->m_masters->querying("select currency,idrtosaidcurrency, adminname, createddate from currencyrate order by createddate desc")->result();
		}

		else if($modulecode == 'IT')
		{
		$data['datatable'] = $this->m_masters->querying("select telemarketing,adminname, createddate from telemarketing  order by createddate desc")->result();
		}

		else if($modulecode == 'IWE')
		{
		$data['datatable'] = $this->m_masters->querying("select website,websitegroup,adminname, createddate from websites  order by createddate desc")->result();
		}

		else if($modulecode == 'IBP')
		{
		$data['datatable'] = $this->m_masters->querying("select position,adminname, createddate from banksposition  order by createddate desc")->result();
		}

		else if($modulecode == 'IBS')
		{
		$data['datatable'] = $this->m_masters->querying("select status,adminname, createddate from banksstatus  order by createddate desc")->result();
		}

		else if($modulecode == 'IKE')
		{
		$data['datatable'] = $this->m_masters->querying("select keterangan,adminname, createddate from keteranganexpense  order by createddate desc")->result();
		}

		else if($modulecode == 'IKTD')
		{
		$data['datatable'] = $this->m_masters->querying("select keterangan,adminname, createddate from keterangantransferdana  order by createddate desc")->result();
		}

		else if($modulecode == 'IST')
		{
		$data['datatable'] = $this->m_masters->querying("select status,adminname, createddate from statustransaksi  order by createddate desc")->result();
		}

		else if($modulecode == 'IENO')
		{
		$data['datatable'] = $this->m_masters->querying("select nomorrekeningpengirim,namarekeningpengirim,bankpengirim,nomorrekeningtujuan,namarekeningtujuan,banktujuan, amount,currency,keterangan,photosurl,adminname,createddate from expenses order by createddate desc limit 10")->result();
		}

		$this->load->view("v_".$modulecode,$data);
		// echo $querystring;
		// $this->load->view("v_IR",$data);
		
	}