<?php
class mail_model extends AmysqlModel {
	public function select($where) {
		$sql = "SELECT email FROM `authme` WHERE `username` = '" . $where . "'";
		return $this->_all ( $sql );
	}
	public function mail($mail, $user) {
		$data = array (
				"address" => $mail,
				"statu" => '1',
				"time" => date ( "Y-m-d" ) 
		);
		// var_dump($data);
		return $this->_update ( 'mail', $data, "WHERE user='" . $user . "'" ) != 0;
	}
	public function status($user) {
		$sql = "SELECT * FROM `mail` WHERE `user` = '" . $user . "' and `statu` = 1";
		return $this->_all ( $sql );
	}
}
?>