<?php 
class Member_Model extends Model{
	function __construct(){
		parent::__construct();
	}
	function validLogin($login){
		return $this->db->getwhere("member",$login);
	}
	function updateUserPwd($pwd,$userid){
		return $this->db->where("user_id",$userid)->update("member",array("password"=>$pwd));
	}
	function validOldPwd($pwd,$userid){
		return $this->db->where(array("user_id"=>$userid,"password"=>$pwd))->get("member")->count();
	}
	function updateUserData($updata,$useid){
		return $this->db->where(array("user_id"=>$useid))->update("member",$updata);
	}
	function validMembername($name){
		return $this->db->where("user_name",$name)->get("member")->count();
	}
	function addMember($data){
		$this->db->insert("member",$data);
		return $this->db->insert_id();
	}
}