<?php
class UserTable extends Table {
	
	const C_TABLE 				= "USERS" ;
	const C_PK      			= "USER_ID" ;
	const C_ID 					= "USER_ID" ;
	const C_NAME 				= "USER_NAME";
	const C_USER_GROUP			= "USER_USER_GROUP";
    const C_FULL_NAME 			= "USER_FULL_NAME";
    const C_EMAIL 				= "USER_EMAIL";
	const C_PWD1 				= "USER_PWD1" ;
	const C_PWD2 				= "USER_PWD2";
	const C_LAST_LOGIN 			= "USER_LAST_LOGIN";
	const C_CHANGE_PWD 			= "USER_CHANGE_PWD";
	const C_FAIL_COUNT 			= "USER_FAIL_COUNT";
	const C_MEMO 				= "USER_MEMO";
	const C_BLOCKED 			= "BLOCKED";
}

class UserTableDetail extends TableDetail {
    const C_ID                  = "identity||NO|";
    const C_NAME                = "nvarchar|20|NO|''";
    const C_FULL_NAME           = "nvarchar|50|NO|''";
    const C_EMAIL               = "nvarchar|100|NO|''";
	const C_USER_GROUP			= "int||NO|(0)";
    const C_PWD1                = "nvarchar|40|NO|''";
    const C_PWD2                = "nvarchar|40|NO|''";
    const C_LAST_LOGIN          = "datetime||NO|getdate()";
    const C_CHANGE_PWD          = "tinyint||NO|(0)";
    const C_FAIL_COUNT          = "tinyint||NO|(0)";
    const C_MEMO 		        = "ntext||NO|''";
    const C_BLOCKED             = "bit||NO|(0)";
}

class UserTableDefault {
	const record = array(array("M"=>"",UserTable::C_NAME=>"'admin'", 
										UserTable::C_FULL_NAME=>"'Administrator'",
										UserTable::C_USER_GROUP=>"'1'",
										UserTable::C_PWD1=>"'b5ca39df335d882848b409bc221ac465'",
										UserTable::C_PWD2=>"'f210389b91d7a02088b363173a7390949267aa53'"));
}
?>