{
	"pluginname":"Users",
	"version":1.1,
	"systemplugin":true,
	"table_def":[
				{
					"name":"users",
					"fields":[		
						{"name":"username","type":"varchar(20)","other":"NOT NULL"},
						{"name":"fullname","type":"varchar(40)","other":"NOT NULL"},
						{"name":"pass","type":"varchar(20)","other":"NOT NULL DEFAULT 'password'"},
						{"name":"profileid","type":"uniqueidentifier","other":"NOT NULL"},
						{"name":"lastlogindate","type":"date","other":""},
						{"name":"status","type":"tinyint","other":"NOT NULL DEFAULT 1"}						
					]	
				}
			],
	"sqlcommands_oninstall":[					 
					"INSERT INTO users (username,createdby,status) VALUES ('admin','||userid||',2)"	
				  ],
	"form":{
				"name":"users",
				"formtype":"Default",
				"dbtable":"users",
				"title":"Users",
				"icon":"mif-users fg-crimson",
				"width":"400px",
				"flex_row":"false",
				"saveButton":true,
				"cancelButton":true,				
				"field": [
							{"name":"username","label":"User Name","fieldtype":"s","type":"text"},													
							{"name":"fullname","label":"User Full Name","fieldtype":"s","type":"text"},													
							{"name":"profileid","label":"Profile","fieldtype":"s","type":"select","option":"SELECT id,profilename FROM profile WHERE status=1 and recordstatus=1"}													
						]
			},
	"form_html":"",
	"navbutton":[				
					{"customid":"1","caption":"Users","icon":"mif-users fg-crimson","btntype":"ribbon-button","btngroup":"Users","btntab":"Developer","btnorder":"3","onclick":"initializePlugin();"}				
				],
	"formbuttons":[	
					{"name":"adduser","caption":"","icon":"mif-plus fg-red","onclick":"showNewForm('users')"},
					{"name":"activeUsers","caption":" Active Users","icon":"mif-list fg-green","onclick":"getTableFromSqlStatement('1')"},
					{"name":"inActiveUsers","caption":" Inactive Users","icon":"mif-list fg-cobalt","onclick":"getTableFromSqlStatement('2')"},
					{"name":"deletedUsers","caption":" Deleted Users","icon":"mif-list fg-red","onclick":"getTableFromSqlStatement('3')"},
					{"name":"privilegedUsers","caption":" Privileged Users","icon":"mif-list fg-yellow","onclick":"getTableFromSqlStatement('4')"}
				  ],
	"script":"",
	"sqlstatement":[
						{"customid":"1","name":"Active Users","sql":"SELECT username,status,lastlogindate,createdon,CONCAT('<div onclick=''changeRecordValue(\\\"',id,'\\\",\\\"users\\\",\\\"pass\\\",\\\"password\\\",\\\"s\\\",\\\"User Password rest to password\\\",\\\"User Password rest failed\\\")''>Reset Password</div>') FROM users WHERE status=1 and recordstatus=1","header":"Username,Status,Last Login,Created On,","change_status":"0:Suspend:User Suspended:User Suspension Failed","edit_record":"1"},
						{"customid":"2","name":"Inactive Users","sql":"SELECT username,status,lastlogindate,createdon FROM users WHERE status=0 and recordstatus=1","header":"Username,Status,Last Login,Created On","change_status":"1:Activate:User Activated:User Activation Failed","delete_record":"1"},
						{"customid":"3","name":"Deleted Users","sql":"SELECT username,status,lastlogindate,createdon FROM users WHERE recordstatus=0","header":"Username,Status,Last Login,Created On","restore_record":"1"},
						{"customid":"4","name":"Privileged Users","sql":"SELECT username,status,lastlogindate,createdon FROM users WHERE status>1","header":"Username,Status,Last Login,Created On"}
					]
}

