<?php 

/**
 * SharedController Controller
 * @category  Controller / Model
 */
class SharedController extends BaseController{
	
	/**
     * user_username_value_exist Model Action
     * @return array
     */
	function user_username_value_exist($val){
		$db = $this->GetModel();
		$db->where("username", $val);
		$exist = $db->has("user");
		return $exist;
	}

	/**
     * user_password_value_exist Model Action
     * @return array
     */
	function user_password_value_exist($val){
		$db = $this->GetModel();
		$db->where("password", $val);
		$exist = $db->has("user");
		return $exist;
	}

	/**
     * user_email_value_exist Model Action
     * @return array
     */
	function user_email_value_exist($val){
		$db = $this->GetModel();
		$db->where("email", $val);
		$exist = $db->has("user");
		return $exist;
	}

	/**
     * getcount_agak Model Action
     * @return Value
     */
	function getcount_agak(){
		$db = $this->GetModel();
		$sqltext = "SELECT COUNT(*) AS num FROM agak";
		$queryparams = null;
		$val = $db->rawQueryValue($sqltext, $queryparams);
		
		if(is_array($val)){
			return $val[0];
		}
		return $val;
	}

	/**
     * getcount_sppg Model Action
     * @return Value
     */
	function getcount_sppg(){
		$db = $this->GetModel();
		$sqltext = "SELECT COUNT(*) AS num FROM sppg";
		$queryparams = null;
		$val = $db->rawQueryValue($sqltext, $queryparams);
		
		if(is_array($val)){
			return $val[0];
		}
		return $val;
	}

	/**
     * getcount_datasppg Model Action
     * @return Value
     */
	function getcount_datasppg(){
		$db = $this->GetModel();
		$sqltext = "SELECT COUNT(*) AS num FROM sppg";
		$queryparams = null;
		$val = $db->rawQueryValue($sqltext, $queryparams);
		
		if(is_array($val)){
			return $val[0];
		}
		return $val;
	}

	/**
     * getcount_dataagak Model Action
     * @return Value
     */
	function getcount_dataagak(){
		$db = $this->GetModel();
		$sqltext = "SELECT COUNT(*) AS num FROM agak";
		$queryparams = null;
		$val = $db->rawQueryValue($sqltext, $queryparams);
		
		if(is_array($val)){
			return $val[0];
		}
		return $val;
	}

}
