 {
 	"pluginname": "NBBI Management",
 	"systemplugin": "0",
	"iswebsite":0,
 	"version": "1.0",
 	"icon": "mif-books fg-green",
 	"table_def": [
		{
			"name": "online_course",
			"importtabledef":{"pluginname":"OnlineCourse"}
		},
		{
			"name":"nbbi_needs",
			"saveid":"ndsv",
			"getid":"ndgt",
			"delpermanentid":"nddl",
			"form":{
				"0":{
					"title":"Needs","type": "Inline","icon": "mif-dashboard",
					"fields":"*"
				}
			},
			"list":{
				"ndlt":{
					"fld":"needs,project,status",
					"includeeditdelete":true,
					"getform":"||thistbl|| 0"										
				}
			},
			"fields":[
				{"name":"needs varchar(100)","label":"Needs"},
				{"name":"project varchar(50)","fieldtype":"select","label":"Project","option":"SELECT distinct projectname FROM nbbi_department WHERE recordstatus=1"},
				{"name":"status tinyint DEFAULT 1","fieldtype":"select","label":"Status","option":"1:Open,0:Close,"}
			]
		},
		{
			"name":"nbbi_stock",
			"saveid":"stksv",
			"getid":"stkgt",
			"delid":"stkdl",
			"form":{
				"1":{
					"title":"Stock","type": "Inline","icon": "mif-dashboard",
					"saveButton":true,"clearButton":true,
					"fields":[
						"stockname,category,distributionunit",
						{"name":"projectname","type":"hidden","fieldtype":"hidden","default":"||projectname||","label":"Project Name"}
					]
				}
			},
			"list":{
				"stklt1":{
					"output":"table","getform":"nbbi_stock 1",
					"tbl":"nbbi_stock",
					"fld":"stockname,category,distributionunit",
					"includeeditdelete":true,
					"whr":"recordstatus=1 and projectname='||projectname||'",
					"header":"Stock,Category,Unit"
				}
			},
			"fields":[
				{"name":"stockname","type":"varchar(50)","label":"Stock Name","required":true},
				{"name":"category","type":"enum('Medicine','Hygiene','Stationery')","label":"Category"},
				{"name":"distributionunit","type":"enum('gm','kg','ml','l','nos')","label":"Distribution unit"},
				{"name":"projectname","type":"enum('NBBI','CMCH','NIBC-Belouri','NNEA','Campus','VDP Jhirua','Other','Asha Bhavan','Shalom Pharma')","label":"Project"}
			]
		},{
			"name":"nbbi_stockin",
			"saveid":"skinsv",
			"getid":"skingt",
			"delid":"skindt",
			"form":{
				"1":{
				"title":"Stock In","type": "Inline","icon": "mif-dashboard",
				"saveButton":true,"clearButton":true,
				"fields":"stockid,datein,quantity,remainingquantity"
				}	
			},
			"list":{
				"sinlt1":{
					"tbl":"nbbi_stockin a","getform":"nbbi_stockin 1",
					"join":"INNER JOIN nbbi_stock b ON a.stockid=b.id",
					"fld":"datein,b.stockname,quantity,remainingquantity",
					"includeeditdelete":true,
					"datefield":"datein",
					"whr":"a.remainingquantity>0 or a.remainingquantity is null",
					"header":"Date,Stock Name,Quantity,Remaining Quantity"
				}
			},
			"fields":[
				{"name":"stockid","type":"char(36)","label":"Stock","fieldtype":"select","option":"SELECT id,stockname FROM nbbi_stock where recordstatus=1 and projectname='||projectname||'"},
				{"name":"datein","type":"date","label":"Stock In date"},
				{"name":"quantity","type":"int","label":"Quantity"},
				{"name":"remainingquantity","type":"int","label":"Remaining Quantity"}
			]
		},{
			"name":"nbbi_stockout",
			"saveid":"skotsv",			
			"getid":"skotgt",
			"delid":"skotdt",
			"trigger":{
				"insert":{"sqlstatement":{
					"a":"SELECT SUM(quantity) FROM nbbi_stockout where stockinid='||stockinid||' and recordstatus=1",
					"b":"UPDATE nbbi_stockin SET remainingquantity=quantity-||GET_a|| WHERE id='||stockinid||'"
					}
				},
				"update":{"sqlstatement":{
					"a":"SELECT SUM(quantity) FROM nbbi_stockout where stockinid='||stockinid||' and recordstatus=1",
					"b":"UPDATE nbbi_stockin SET remainingquantity=quantity-||GET_a|| WHERE id='||stockinid||'"
					}
				},
				"delete":{"sqlstatement":{
					"a":"SELECT stockinid FROM nbbi_stockout where id='||ID||'",
					"b":"SELECT SUM(quantity) FROM nbbi_stockout where stockinid='||GET_a||' and recordstatus=1",
					"c":"UPDATE nbbi_stockin SET remainingquantity=quantity-||GET_b|| WHERE id='||GET_a||'"
					}
				}
			},
			"form":{
				"1":{
				"title":"Stock Out","type": "Inline","icon": "mif-dashboard",
				"saveButton":true,"clearButton":true,
				"fields":"stockinid,quantity,dateout,timeout,benid"
				}	
			},
			"list":{
				"solt1":{
					"tbl":"nbbi_stockout a","getform":"nbbi_stockout 1",
					"join":[
						"inner join nbbi_stockin b ON a.stockinid=b.id",
						"inner join nbbi_stock c ON b.stockid=c.id",
						"inner join nbbi_beneficiary d on a.benid=d.id"
					],
					"fld":"a.dateout,a.timeout,c.stockname,d.beneficiaryname,c.distributionunit,a.quantity,b.remainingquantity",
					"includeeditdelete":true,
					"datefield":"a.dateout",
					"limit":"300",
					"srt":"a.createdon desc",
					"whr":[
						"a.recordstatus=1",					
						{"if":"||anotherproject|| != BLANK and ||projectname|| != BLANK","then":" and (c.projectname = '||projectname||' or c.projectname='||anotherproject||')"},
						{"if":"||anotherproject|| = BLANK and ||projectname|| != BLANK","then":" and c.projectname = '||projectname||'"},
						{"if":"||datefrom|| != BLANK and ||dateto|| != BLANK","then":" and a.dateout BETWEEN '||datefrom||' and '||dateto||'"},
						{"if":"||datefrom|| != BLANK and ||dateto|| = BLANK","then":" and a.dateout = '||datefrom||'"},
						{"if":"||category|| != BLANK","then":" and c.category = '||category||'"}
					],
					"header":"Date,Time,Stock Name,Issued To,Unit,Quantity,Remaining"
				}
			},
			"fields":[
				{"name":"stockinid","type":"char(36)","label":"Stock","fieldtype":"select","option":"SELECT b.id,a.stockname FROM nbbi_stock a INNER JOIN nbbi_stockin b ON b.stockid=a.id where a.recordstatus=1 and (b.remainingquantity>0 or b.remainingquantity is null) and a.projectname='||projectname||'"},
				{"name":"quantity","type":"float","label":"Quantity Issued","required":true},
				{"name":"dateout","type":"date","label":"Stock Out date","required":true},
				{"name":"timeout","type":"time","label":"Stock Out Time","required":true},
				{"name":"benid","type":"char(36)","label":"Issued To","required":true,"fieldtype":"select",
					"option":[
						"select id,beneficiaryname FROM nbbi_beneficiary WHERE recordstatus=1",
						{"if":"||anotherproject|| != BLANK and ||projectname|| != BLANK","then":" and (project = '||projectname||' or project='||anotherproject||')"},
						{"if":"||anotherproject|| = BLANK and ||projectname|| != BLANK","then":" and project = '||projectname||'"}				
					]
				}
			]
		},
		{
			"name": "nbbi_asset",
			"saveid":"astsv",
			"getid":"astgt",
			"delid":"astdt",
			"form":{
				"1":{
					"title":"Asset","type": "Inline","icon": "mif-dashboard",
					"saveButton":true,"clearButton":true,
					"fields":"assetnumber,assetname,product,purchasedate,warrantyexpirydate,cost,location,usedby,assetcondition,vendor,company,lastauditdate,project"
				}								
			},
			"list":{
				"astlt":{
					"tbl":"nbbi_asset",
					"fld":"assetnumber,assetname,purchasedate,warrantyexpirydate,location,usedby",					
					"filter":"assetname,location,type,subtype,usedby,managedby,project",
					"includeeditdelete":true,
					"getform":"||thistbl|| 1"
				}
			},
			"fields": [
				{"name": "assetnumber","type": "varchar(40)","other": "NOT NULL","label":"Asset Number"},
				{"name": "assetname","type": "varchar(40)","other": "NOT NULL","label":"Asset Name"},
				{"name": "product","type": "varchar(20)","label":"Product ID"},
				{"name": "purchasedate","type": "date","label":"Purchase Date"},			
				{"name": "warrantyexpirydate","type": "date","label":"Warranty Expiry Date"},
				{"name": "cost","type": "int","other": "NOT NULL","label":"Cost"},
				{"name": "location","type": "varchar(20)","other": "NOT NULL","label":"Asset Place in Location"},
				{"name": "type","type": "varchar(20)","other": "NOT NULL","label":"Asset Type"},
				{"name": "subtype","type": "varchar(20)","label":"Asset Sub Type"},
				{"name": "usedby","type": "varchar(20)","label":"Issued To"},
				{"name": "managedby","type": "varchar(20)","label":"Managed By"},
				{"name": "assetcondition","type": "enum('Good','Need Repair','Out of Order')","label":"Asset Condition"},
				{"name": "vendor","type": "char(36)","fieldtype":"select","option":"SELECT '','' UNION ALL Select id,contactname from nbbi_contacts where recordstatus=1","label":"Purchased from"},
				{"name": "company","type": "varchar(30)","label":"Company"},
				{"name": "lastauditdate","type": "date","label":"Last Audit Date"},
				{"name": "project","type": "enum('NIINS','CMCH','NBBI','NIBC-Belouri','NNEA','Campus','VDP Jhirua','Other','Asha Bhavan','Shalom Pharma')","label":"Project"}
			]
		},
		{
			"name":"nbbi_department",
			"saveid":"37sv",
			"getid":"37gt",
			"delid":"37dt",
			"form":{
				"1":{"title":"Department","type": "2 Columns","icon": "mif-dashboard","saveButton":true,"cancelButton":true,"fields":"departmentname,projectname,assignedto"}
			},
			"list":{
				"37lt":{
					"output":"table","tbl":"nbbi_department",
					"fld":"DISTINCT(CONCAT('<a href=# onclick=Eirene.runStmt(&apos;37&apos;,{project:&apos;',projectname,'&apos;})>',projectname,'</a>')) AS project",
					"whr":"recordstatus=1","header":"Project"
				}
			},
			"fields":[				
				{"name": "departmentname","type": "varchar(50)","label":"Department Name"},
				{"name": "projectname","type": "enum('NBBI','CMCH','NIBC-Belouri','NNEA','Campus','VDP Jhirua','Other','Asha Bhavan','Shalom Pharma')","label":"Project Name"},
				{"name": "assignedto","type": "char(36)","label":"Assigned To","fieldtype":"select","option":"SELECT '' as id,'' as fullname union all SELECT id,fullname FROM eirene_users WHERE recordstatus>=1 ORDER BY fullname"}				
			]
		},
		{
			"name":"nbbi_beneficiary", 			
 			"saveid": "bensv",
 			"getid": "bengt",
 			"delid": "bendt",
			"form":{
				"1":{"title":"Beneficiary","type": "Inline","icon": "mif-books","saveButton":true,"clearButton":true,
					"fields":[
						"beneficiaryname,beneficiarynumber,project,dateofadmission,beneficiaryclass,beneficiaryyear,dob,gender,father,address,city,state,mobilenumber,email,mothertongue,status",
						{"name":"recordtype","fieldtype":"hidden","default":"Beneficiary"}
					]
				},
				"2":{
					"title":"Employee","type": "Inline","icon": "mif-user",
					"saveButton":true,"clearButton":true,
					"fields":[
						{"name":"beneficiaryname","type":"text","maxlength":"50","label":"Employee Name"},
						{"name":"beneficiarynumber","type":"text","maxlength":"50","label":"Employee ID"},
						"project",
						{"name":"dateofadmission","type":"date","label":"Appointment Date"},							
						"designation,efp,dob,gender,father,address,city,state,mobilenumber,email,mothertongue,status",
						{"name":"recordtype","fieldtype":"hidden","default":"Staff"},
						"employmenttype"
					]
				}							
			},
			"list":{
				"37chrt":{
					"action":"Get Chart New",
					"tbl":"nbbi_beneficiary","filter":"project,dateofadmission,status",
					"defaultwhr":"recordstatus=1",
					"fld":"beneficiaryclass,gender,count(*) as cnt",
					"grp":"beneficiaryclass,gender",
					"title":"Beneficiary Chart",
					"label":"beneficiaryclass",
					"secondarylabel":"gender",
					"value":"cnt",
					"type":"bar"
				},
				"37ben":{
					"tbl":"nbbi_beneficiary","filter":"beneficiaryname,beneficiaryclass,beneficiaryyear,gender,state,status,createdon",
					"getform":"nbbi_beneficiary 1",
					"getchart":"37chrt",
					"fld":"beneficiarynumber,beneficiaryname,dateofadmission,beneficiaryclass,beneficiaryyear,gender,state",					
					"includeeditdelete":true,
					"serialno":true,
					"header":"Number,Name,Admission Date,Course,Course Year,Gender,State",
					"defaultwhr":"recordstatus =1 and recordtype='Beneficiary'"					
				},
				"37stf":{
					"tbl":"nbbi_beneficiary","getform":"nbbi_beneficiary 2",
					"fld":"beneficiarynumber,beneficiaryname,employmenttype,dateofadmission,gender,state",
					"includeeditdelete":true,
					"header":"Employee ID,Name,Type,Appointment Date,Gender,State",
					"whr":"recordstatus =1 and project='||project||' and recordtype='Staff'"
				}
			},
			"fields":[
				{"name":"beneficiaryname varchar(50)","label":"Name","filterop":"like"},
				{"name":"beneficiarynumber varchar(10)","label":"Roll Number"},
				{"name":"designation varchar(60)","label":"Designation"},
				{"name":"dateofadmission date","label":"Admission Date"},
				{"name":"project varchar(30)","fieldtype":"select","option":"SELECT DISTINCT project FROM nbbi_beneficiary","label":"Project"},
				{"name":"location varchar(30)","fieldtype":"select","option":"SELECT DISTINCT location FROM nbbi_beneficiary","label":"Location"},
				{"name":"beneficiaryclass enum('','None','C.Th.','Dip.Th.','B.Th.','M.Div.','CCL','DCL','B.Th. Online','M.Div Online','School')","label":"Course"},
				{"name":"beneficiaryyear tinyint","fieldtype":"select","option":":None,-1:UKG,-2:LKG,1,2,3,4,5,6,7,8,9,10,11,12","label":"Year"},
				{"name":"dob date","label":"Date of Birth"},
				{"name":"gender varchar(6)","option":",Male,Female","label":"Gender"},
				{"name":"father varchar(20)","label":"Father/Mother"},
				{"name":"address varchar(100)","label":"Address"},
				{"name":"city varchar(20)","label":"City"},
				{"name":"state varchar(25)","option":",Andhra Pradesh,Arunachal Pradesh,Assam,Bihar,Chhattisgarh,Delhi,Goa,Gujarat,Haryana,Himachal Pradesh,Jharkhand,Karnataka,Kerala,Madhya Pradesh,Maharashtra,Manipur,Meghalaya,Mizoram,Nagaland,Odisha,Punjab,Rajasthan,Sikkim,Tamil Nadu,Telangana,Tripura,Uttar Pradesh,Uttarakhand,West Bengal,Other","label":"State"},
				{"name":"mobilenumber bigint","label":"Mobile Number"},
				{"name":"email varchar(50)","label":"Email"},
				{"name":"mothertongue varchar(20)","label":"Mother Tongue"},
				{"name":"recordtype","type":"enum('Beneficiary','Staff') DEFAULT 'Beneficiary'","label":"Record Type"},
				{"name":"employmenttype","type":"enum('Full Time','Part Time')","label":"Employment Type"},
				{"name":"epf int","fieldtype":"select","option":"0:Non-EPF,1:EPF","label":"Employment Type"},
				{"name":"status tinyint DEFAULT 1","fieldtype":"select","option":":SELECT,1:Active,0:Inactive","label":"Status"}
			]
		},		
		{
			"name": "nbbi_checklist",
			"saveid":"33sv",
			"getid":"33gt",
			"delpermanentid":"33dt",			
			"form":{
				"1":{"title":"Checklist","type": "2 Columns","icon": "mif-dashboard","saveButton":true,"cancelButton":true,"fields":"checklistname,remark,link,taskid"},
				"2":{"title":"Checklist","type": "Inline","icon": "mif-dashboard","saveButton":true,"fields":"checklistname,remark,link,taskid"}
			},
			"list":{
				"33tbl":{					
					"outputto": "php","output": "checklist",
					"tbl":"nbbi_checklist",
					"fld":[
						"checklistname,remark",
						{
							"field":{
								"if": "link != ''","type": "googlelink","href": "<link>",
								"value": "Link","caption":"Link"
							}
						}
					],					
					"header":"Name,Remark,Link",				
					"whr":[
						"recordstatus=1",
						{"if":"||TID|| != BLANK","then":" and taskid='||TID||'"},
						{"if":"||taskid|| != BLANK","then":" and taskid='||taskid||'"}
					]
				}
			},
 			"fields": [
				{
 					"name": "checklistname",
 					"type": "varchar(50)",
					"label":"Checklist Name"
 				},{
 					"name": "remark",
 					"type": "varchar(300)",
					"other":"NOT NULL DEFAULT ''",
					"label":"Remark"
 				},{
 					"name": "link",
 					"type": "googlelink",					
					"label":"Link"
 				},{
 					"name": "taskid",
 					"type": "char(36)",
					"fieldtype":"hidden",
					"label":"Task ID",
					"default":"||TID||",
					"clearDataAfterSave":"false"
 				}
			]
		},
		{
			"name": "nbbi_reporttemplate",
			"saveid":"32tem2",
			"getid":"32tem4",
			"delpermanentid":"32tem3",
			"form":{
				"1":{"title":"Report Template","type": "Horizontal","icon": "mif-dashboard","saveButton":true,"cancelButton":true,"fields":"templatename,color1,color2,color3"}
			},
 			"fields": [
				{
 					"name": "templatename",
 					"type": "varchar(50)",
					"label":"Template Name"
 				},{
 					"name": "color1",
 					"type": "char(7)",
					"label":"Colour 1"
 				},{
 					"name": "color2",
 					"type": "char(7)",
					"label":"Colour 2"					
 				},{
 					"name": "color3",
 					"type": "char(7)",
					"label":"Colour 3" 					
 				}
			]
		},
		{
			"name": "nbbi_plan",
			"saveid":"22b1sv",
			"getid":"22b1gt",
			"delpermanentid":"22b1dt",
			"form":{
				"1":{"title":"Planner","type": "Inline","icon": "mif-dashboard","fields":"taskid,datefrom,dateto,people,plan"},
				"2":{"title":"Planner","type": "Inline","icon": "mif-dashboard","fields":"datefrom,dateto,people,plan,status"}
			},
			"list":{
				"22b":{
					"outputto":"php","output":"plan","tbl": "nbbi_plan",				
					"fld":"people,DATE_FORMAT(datefrom,'%d-%M-%Y'),DATE_FORMAT(dateto,'%d-%M-%Y'),plan,status",
					"includeeditdelete":true,
					"whr": "taskid='||TID||'", 	
					"srt":"datefrom", 				
					"header": "People,From Date,To Date,Plans,Status,Function"					
				},
				"22blst":{					
					"output":"table","tbl":"nbbi_plan a",					
					"getform":"nbbi_plan 2","filter":"people,datefrom",					
					"fld":"a.datefrom,a.people,a.plan,a.status",
					"editablefields":"a.status",
					"includeeditdelete":true,
					"datefield":"a.datefrom",					
					"srt":"a.datefrom",
					"defaultwhr":"a.status=0 and a.recordstatus=1"					
				}
			},			
 			"fields": [
				{
 					"name": "taskid","type": "lookup", 					
					"lookup":{"sqlid":"22blup","tbl":"nbbi_tasks","fld":"task","whr":"status<=3"},					
					"label":"Task ID","default":"||TID||",					
					"clearDataAfterSave":"false"
 				},
				{"name": "datefrom date","label":"Beginning Date"},
				{"name": "dateto date","label":"End Date"},
				{
 					"name": "people varchar(60)","label":"Department","fieldtype":"select",
					"option":"Academic,Online,Ministry,Spiritual Affairs,Library,Admin,Other"					
 				},{"name": "plan varchar(300)","label":"Plan","filterop":"like"},
				{"name":"status tinyint NOT NULL DEFAULT 0",
					"label":"Status","fieldtype":"switch",
					"option":"0:Planned,1:Done"
				}
			]
		},
		{
			"name": "nbbi_query",
			"saveid":"22sv",
			"getid":"22gt",
			"delpermanentid":"22dt",
			"form":{
				"1":{"title":"Query","type":"Horizontal","icon":"mif-question","saveButton":true,"cancelButton":true,"fields":"taskid,query,response"},
				"2":{"title":"Query","type":"Inline","icon":"mif-dashboard","saveButton":true,"cancelButton":false,"fields":"taskid,query,response"}
				
			},
			"list":{
				"22a":{					 				
					"outputto":"php","output":"query","tbl": "nbbi_query",
					"fld":"query,response",
					"includeeditdelete":true,
					"whr": "taskid='||TID||'", 				
					"header": "Query,Response,Function"					
				}
			},
 			"fields": [
				{
 					"name": "taskid",
 					"type": "char(36)",
					"fieldtype":"lookup",
					"label":"Task ID",
					"default":"||TID||",
					"clearDataAfterSave":"false",
					"lookup":{"sqlid":"22lkup","tbl":"nbbi_tasks","fld":"task","whr":"status<=3"}
 				},{
 					"name": "query",
 					"type": "varchar(300)" ,
					"label":"Query"
 				},{
					"name":"response",
					"type":"varchar(300)",
					"label":"Response"
				}
			]
		},
		{
			"name":"nbbi_cclsubject",
			"saveid":"31ssv",
			"getid":"31sgt",
			"delid":"31sdel",
			"form":{
				"1":{"title":"CCL Subject","type":"Horizontal","icon":"mif-books","fields":"subject,term,course"}
			},
			"list":{
				"31slt":{
					"fields":"subject,term,course","getform":"||thistbl|| 1",					
					"includeeditdelete":true,"filter":"subject,term,course"
				}
			},
			"fields":[
				{"name":"subject varchar(100)","label":"Subject Name","filterop":"like"},			
				{"name":"term tinyint","label":"Term","option":"1,2,3","fieldtype":"select"},
				{"name":"course enum('CCL','DCL')","label":"Course"}
			]
		},
		{
			"name": "nbbi_cclmark",
			"saveid":"31sv",
			"getid":"31gt",
			"delpermanentid":"31dt",
			"form":{
				"1":{"title":"Mark","type":"Horizontal","icon":"mif-dashboard","saveButton":true,"cancelButton":true,"fields":"rollno,subject,type,mark"}
			},
 			"fields": [
				{
 					"name": "rollno",
 					"type": "smallint unsigned",
					"label":"Roll No"
 				},{
 					"name": "subject",
 					"type": "char(36)",
					"label":"Subject",
					"fieldtype":"select",
					"option":"select id,subject from nbbi_cclsubject order by term"
 				},{
 					"name": "type",
 					"type": "enum('Class Test 1','Class Test 2','Class Test 3','Final Exam')",
					"label":"Exam",
					"fieldtype":"select",
					"option":",Class Test 1,Class Test 2,Class Test 3,Final Exam"
 				},{
					"name":"mark",
					"type":"tinyint unsigned",
					"label":"Mark"
				}
			]
		},
		{
			"name": "nbbi_cclattendance",
			"saveid":[
				{"id":"cclasv","whr":"rollno='||rollno||' and date(createdon)=CURDATE()"}
			],
			"getid":"cclagt","delpermanentid":"ccladt", 			
			"fields": [
				{
 					"name": "rollno",
 					"type": "int unsigned" 					
 				}
			]
		},
		{
			"name":"nbbi_cclstudent",
			"fields":[
				{
					"name":"rollno",
					"type":"int unsigned"
				},{
					"name":"stuname",
					"type":"varchar(25)"
				},{
					"name":"father",
					"type":"varchar(25)"
				},{
					"name":"address",
					"type":"varchar(100)"
				},{
					"name":"mobile",
					"type":"char(10)"
				},{
					"name":"gender",
					"type":"enum('Male','Female')"
				},{
					"name":"dob",
					"type":"date"
				},{
					"name":"city",
					"type":"varchar(12)"
				},{
					"name":"state",
					"type":"varchar(20)"
				},{
					"name":"mothertongue",
					"type":"varchar(12)"
				},{
					"name":"reasonjoiningccl",
					"type":"varchar(60)"
				},{
					"name":"branch",
					"type":"varchar(12)"
				},{
					"name":"designation",
					"type":"varchar(15)"
				}
			]
		},
		{
			"name": "nbbi_courseallotment",
			"saveid": "26casv",
 			"getid": "26cagt",
 			"delpermanentid": "26cadt",
			"joindef":{
				"online_course":"||thistbl||.courseid = online_course.id",
				"online_course_users":"||thistbl||.facultyid=online_course_users.id"
			},			
			"form":{
				"1":{"title":"Course Allotment","type":"2 Columns","saveButton":true,
					"cancelButton":true,
					"fields":"courseid,mode,program,facultyid,term,academicyear,credit",
					"customButton":[
						{"value":"Print","onclick":"Eirene.runStmt(&apos;26capr&apos;)"}
					]
				}
			},
			"list":{
				"26calt":{
					"action": "Get Table",
					"name": "Get Course Allotment List",					
					"output": "#workareaTablebox","getform":"||thistbl|| 1",					
					"tbl": "nbbi_courseallotment a",
					"fld":"b.titleprint,a.program,a.mode,a.term,a.credit,a.academicyear,c.fullname",
					"usejoin":"online_course b,online_course_users c",
					"header":"Course,Program,Mode,Sem,Credit,Year,Faculty",
					"filter":"facultyid,academicyear,term,mode",
					"filterCustomButton":{"sqlid":"26capr","icon":"mif-print"},
					"includeeditdelete":true								
				},
				"26capr":{				
					"action": "MULTISTMT",
					"name": "Get PDF for Course Allotment Letter",
					"outputto": "php",
					"output": "res",
					"multistmt":[
						{
							"action":"Get Table",
							"outputto":"php",
							"output":"table1","datatable":false,"class":"dataTable",
							"tbl": "nbbi_courseallotment a",
							"fld":"b.titleprint,a.program,a.mode,a.term,a.credit,c.fullname,a.academicyear",
							"hiddencol":"5,6",
							"join":"INNER JOIN online_course b ON a.courseid = b.id INNER JOIN online_course_users c ON a.facultyid=c.id",
							"header":"Course,Program,Mode,Sem,Credit,Name"							
						},{
							"action":"Return",
							"outputto":"html",
							"output":"#workareaAppendix",
							"value":[								
								"<div>",
									"<button style='margin-right:128px' type='buttonspan' class='mif-printer fg-blue' onclick='printHTML(&apos;print&apos;)'></button>",
								"</div>",
								"<div id='print' style='margin:0;padding:0;'>",
									"<div style='font-family:&apos;Times New Roman&apos;;font-size:11pt;margin-left:1cm'>",
										"<center>",
											"<img src='resource/image/nbbi-logo.jpg'></img>",
										"</center><br>",
										"<div style='text-align:right'>Date: ||CURDATE_D_M_Y||</div><br>",
										"<center>",
											"<b>SUBJECT ALLOTMENT LETTER</b><br>(||latestdbqueryresult[0]_mode||)",
										"</center><br>",
										"<p>Dear ||latestdbqueryresult[0]_fullname||,</p><br>",
										"<div style='text-align: justify;'>As per the decision of the NBBI faculty, we are pleased to inform you that the following subjects are assigned to you for the Academic year ||latestdbqueryresult[0]_academicyear||, Sem: ||latestdbqueryresult[0]_term||. Please collect the syllabus from the academic office for the subjects assigned. You are requested to upload the syllabus as lesson on NIEA Online Portal. As per the program design, each course carries a weightage for internal assessment that encourage self-learning and a final exam which is conducted at the end of semester. For any clarification, please do not hesitate to reach out to the Deparment of Online Studies. Please also submit a Teaching planner for 120 learning hours for a full-credit course and 60 learning hours for a half-credit course.  The subjects allotted are:</div><br><br>||GET_table1||<br>Thank you for your support and wholehearted efforts in shaping the life of students. It is our united desire that the students are transformed and shaped in the image and likeness of our saviour Jesus Christ.",
											"<b>",
											"<br><br>Yours sincerely,<span style='margin-left:11cm'>Received by</span><br><br><br>",
											{"if":"||mode|| = Residential","then":"Registrar","else":"Department of Online Studies"},
											"</b>",
											"<br><span>NBBI</span><span style='margin-left:12.5cm'>NBBI Faculty</span>",
										"</div>",
									"</div>",
								"</div>"
							]
						}
					]
				}							
			},
 			"fields": [
				{
 					"name": "courseid char(36)","label":"Course ID","fieldtype":"lookup",
					"lookup":{"sqlid":"26lkup","fld":"title","tbl":"online_course","defaultwhr":"institute='NBBI'"}
 				},
				{
 					"name": "mode varchar(50)",	"label": "Mode","fieldtype":"select",
					"option":"Residential,Online"
 				},
				{
 					"name": "program varchar(50)","label":"Program","fieldtype":"select",
					"option":"M.Div.,B.Th.,Dip.Th.,C.Th.,CCL,DCL"
 				},
				{
 					"name": "facultyid char(36)","fieldtype":"select","label":"Faculty",
					"option":"select id,fullname from online_course_users WHERE isfaculty=1"
 				},
				{"name": "term tinyint","label":"Sem","fieldtype":"select","option":"1,2"},
				{"name": "academicyear char(11)", "label":"Academic Year","fieldtype":"select","option":"get array previous five academicyears"},
				{"name": "credit tinyint","label":"Credit","fieldtype":"select","option":"2,3"}
			]
		},	
		{
 			"name": "nbbi_tasks",
			"saveid":"tksv-33fun1",
			"getid":"tkgt",
			"delid":"tkdt",
			"form":{
				"1":{"title":"Task","icon":"mif-assignment","type":"2 Columns","fields":"taskid,task,taskfile,description,department,beginningdate,enddate,assignedto,remark,img"},
				"2":{"title":"Sub Task","icon":"mif-dashboard","type":"Inline","fields":"taskid,task,description,department,beginningdate,enddate,assignedto,remark"}
			},
			"list":{
				"1tklst":{					
					"outputto": "html",
					"output": {"if":"||displayoutput|| = BLANK","then":"table","else":"||displayoutput||"},
					"getform": "||thistbl|| 1",
					"tbl": "nbbi_tasks a","filter":"task,department,assignedto,status,beginningdate",
					"join": [
						"INNER JOIN eirene_users b ON a.assignedto=b.id",
						"LEFT JOIN (select taskid,count(*) as cnt from nbbi_tasks where recordstatus=1 group by taskid) c ON a.id=c.taskid",
						"LEFT JOIN (select taskid,count(*) as cnt1 from nbbi_tasks where recordstatus=1 and status>=3 group by taskid) d ON a.id=d.taskid"
					],
					"fld": "task,department,b.fullname,a.beginningdate,a.enddate,a.status",					
					"editablefields":"department,a.status",
					"srt": "a.enddate",
					"header": "Task,Department,Assigned To,Beginning Date,End Date,Status",
					"includeeditdelete":true,
					"defaultwhr":"a.status<=3 and a.recordstatus=1",													
					"onsuccess": {"if":"||displayoutput|| = BLANK","then":"cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:empty;#workareaAppendix"}
				}
			},
 			"fields": [
				{
 					"name": "taskid char(36)","label":"Task ID",
					"fieldtype":"hidden","default":"||TID||",
					"clearDataAfterSave":"false"
 				},
 				{
 					"name": "task varchar(300) NOT NULL","filterop":"like",
					"label":"Task","required":true
 				}, {
 					"name": "description varchar(500) NOT NULL",
					"label":"Description"
 				}, {
 					"name": "department varchar(36) NOT NULL",
					"label":"Department","fieldtype":"select",
					"option": "SELECT id,departmentname FROM nbbi_department where assignedto='||userid||' and recordstatus=1"
 				}, {
 					"name": "beginningdate date NOT NULL",
					"label":"Beginning Date"
 				}, {
 					"name": "enddate date NOT NULL",
					"label":"End Date"
 				}, {
 					"name": "subtasks varchar(500)",
					"label":"Sub Task"
 				}, {
 					"name": "type varchar(30)",
					"label":"Type"
 				}, {
 					"name": "assignedto varchar(36)",
					"label":"Assigned To","fieldtype":"select",
					"option":"Select id,fullname from eirene_users where recordstatus=1"
 				}, {
 					"name": "status tinyint DEFAULT 1 NOT NULL","fieldtype":"select",
					"option":"1:Created,2:In Progress,3:Done,4:Archived",
					"label":"Status"
 				}, {
 					"name": "remark varchar(300)",
					"label":"Remark"
 				},{
 					"name": "contact char(36)"					
 				}
 			]
 		}, 
		{
 			"name": "nbbi_contacts",
			"saveid": "3consv","getid": "3congt","delid": "3condt",
			"form":{
				"1":{"title":"Contact","icon":"mif-user","type":"2 Columns","fields":"contactname,description,organization,email,mobile,whatsappno,type,bankdetails,mothertongue,district,state,country,pan,gst"}
			},
			"list":{
				"3conlt":{
					"outputto": "html",
					"output": "table",						
					"getform": "||thistbl|| 1",
					"includeeditdelete":true,
					"filter":"contactname,state,type",
					"tbl": "nbbi_contacts",
					"fld": "contactname,organization,mobile,whatsapp,type,district,state",					
					"header": "Name,Organization/Company,Mobile,WhatsApp,Type,District,State",															
					"onsuccess": "cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:empty;#workareaAppendix"
				}
				
			},
 			"fields": [
				{"name": "contactname varchar(30) NOT NULL","label":"Contact Name","filterop":"like"}, 
				{"name": "description varchar(500)","label":"Description"}, 
				{"name": "organization varchar(50)","label":"Organization/Company"}, 
				{"name": "email varchar(50)","label":"Email"}, 
				{"name": "mobile varchar(10)","label":"Mobile No."}, 
				{"name": "whatsapp varchar(10)","label":"WhatsApp No."}, 
				{"name": "type","type": "enum('','Vendor','Pastor','Christian Leader','Church','Company')","label":"Type"}, 
				{"name": "bankdetails varchar(500)","fieldtype":"textarea","label":"Bank Details"}, 
				{"name": "mothertongue varchar(20)","label":"Mother Tongue"}, 
				{"name": "district varchar(30)","label":"District"}, 
				{"name": "state","type":"enum('','Bihar','Andhra Pradesh','Arunachal Pradesh','Assam','Chhattisgarh','Delhi','Goa','Gujarat','Haryana','Himachal Pradesh','Jharkhand','Karnataka','Kerala','Madhya Pradesh','Maharashtra','Manipur','Meghalaya','Mizoram','Nagaland','Odisha','Punjab','Rajasthan','Sikkim','Tamil Nadu','Telangana','Tripura','Uttar Pradesh','Uttarakhand','West Bengal','Other')","label":"State"}, 
				{"name": "country varchar(30)","label":"Country"}, 
				{"name": "pan char(10)","label":"PAN"}, 
				{"name": "gst char(11)","label":"GST No."}
			]
 		}, 
		{
 			"name": "niea_finance",
 			"fields": [{
 				"name": "taskid",
 				"type": "char(36)",
 				"other": "NOT NULL"
 			}, {
 				"name": "item",
 				"type": "varchar(50)",
 				"other": "NOT NULL"
 			}, {
 				"name": "quantity",
 				"type": "tinyint",
 				"other": "NOT NULL"
 			}, {
 				"name": "unit",
 				"type": "varchar(20)",
 				"other": "NOT NULL"
 			}, {
 				"name": "rate",
 				"type": "int",
 				"other": "NOT NULL"
 			}]
 		}, {
 			"name": "nbbi_classrecord",
 			"fields": [{
 				"name": "taskid",
 				"type": "char(36)",
 				"other": "NOT NULL"
 			}, {
 				"name": "classtype",
 				"type": "varchar(15)",
 				"other": "NOT NULL"
 			}, {
 				"name": "classdate",
 				"type": "date",
 				"other": "NOT NULL"
 			}, {
 				"name": "attendancecount",
 				"type": "tinyint",
 				"other": "NOT NULL"
 			}, {
 				"name": "lessontaught",
 				"type": "varchar(200)",
 				"other": "NOT NULL"
 			}, {
 				"name": "pptlink",
 				"type": "varchar(200)",
 				"other": "NOT NULL"
 			}, {
 				"name": "videolink",
 				"type": "varchar(200)",
 				"other": "NOT NULL"
 			}, {
 				"name": "noteslink",
 				"type": "varchar(200)",
 				"other": "NOT NULL"
 			}, {
 				"name": "lessonuploaded",
 				"type": "tinyint",
 				"other": "NOT NULL DEFAULT 0"
 			}]
 		}, {
 			"name": "nbbi_activites",
 			"fields": [{
 				"name": "activityname",
 				"type": "char(50)",
 				"other": "NOT NULL"
 			}, {
 				"name": "dept",
 				"type": "varchar(10)",
 				"other": "NOT NULL"
 			}, {
 				"name": "outcome",
 				"type": "varchar(200)",
 				"other": "NOT NULL"
 			}, {
 				"name": "status",
 				"type": "tinyint",
 				"other": "NOT NULL default 1"
 			}]
 		},
 		{
 			"name": "nbbi_student_family",
 			"fields": [{
 					"name": "stid",
 					"type": "char(36)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "name",
 					"type": "varchar(50)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "relationship",
 					"type": "varchar(30)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "dob",
 					"type": "date",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "baptized",
 					"type": "tinyint",
 					"other": "NOT NULL default 0"
 				},
 				{
 					"name": "believer",
 					"type": "tinyint",
 					"other": "NOT NULL default 0"
 				},
 				{
 					"name": "occupation",
 					"type": "varchar(30)",
 					"other": "NOT NULL"
 				}
 			]
 		},
 		{
 			"name": "nbbi_student_education",
 			"fields": [{
 					"name": "stid",
 					"type": "char(36)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "degree",
 					"type": "varchar(20)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "year",
 					"type": "int",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "board",
 					"type": "varchar(20)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "result",
 					"type": "varchar(10)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "docpath",
 					"type": "varchar(400)",
 					"other": "NOT NULL"
 				}
 			]
 		},
 		{
 			"name": "nbbi_student_reference",
 			"fields": [{
 					"name": "stid",
 					"type": "char(36)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "name",
 					"type": "varchar(50)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "email",
 					"type": "varchar(30)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "mobile",
 					"type": "int",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "docpath",
 					"type": "varchar(400)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "remark",
 					"type": "varchar(100)",
 					"other": "NOT NULL"
 				}
 			]
 		},
 		{
 			"name": "nbbi_student_marks",
 			"fields": [{

 					"name": "stid",
 					"type": "char(36)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "subject",
 					"type": "varchar(30)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "credit",
 					"type": "int",
 					"other": "NOT NULL"
 				}, {
 					"name": "semester",
 					"type": "int",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "year",
 					"type": "int",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "grade",
 					"type": "char(5)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "marks",
 					"type": "int",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "remark",
 					"type": "varchar(100)",
 					"other": "NOT NULL"
 				}
 			]
 		},
 		{
 			"name": "nbbi_student_opportunities",
 			"fields": [{
 					"name": "stid",
 					"type": "char(36)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "opportunityname",
 					"type": "varchar(100)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "category",
 					"type": "varchar(50)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "remark",
 					"type": "varchar(50)",
 					"other": "NOT NULL"
 				}
 			]
 		},
 		{
 			"name": "nbbi_timetable",
 			"fields": [{
 					"name": "subid",
 					"type": "varchar(36)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "day",
 					"type": "tinyint",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "timestart",
 					"type": "time",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "timeend",
 					"type": "time",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "facultyid",
 					"type": "char(36)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "class",
 					"type": "varchar(30)",
 					"other": "NOT NULL"
 				}
 			]
 		},
 		{
 			"name": "nbbi_institute",
 			"fields": [{
 					"name": "institutename",
 					"type": "varchar(50)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "website",
 					"type": "varchar(50)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "briefhistory",
 					"type": "varchar(1000)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "stateoffaith",
 					"type": "varchar(500)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "contact",
 					"type": "varchar(200)",
 					"other": "NOT NULL"
 				}
 			]
 		},
 		{
 			"name": "nbbi_timetable1",
 			"fields": [{
 					"name": "subid",
 					"type": "char(36)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "dates",
 					"type": "date",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "timetableid",
 					"type": "char(36)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "status",
 					"type": "tinyint",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "lessoncount",
 					"type": "int",
 					"other": "NOT NULL"
 				}
 			]
 		}, 		
 		{
 			"name": "nbbi_payments",
			"saveid": "20psv",
 			"getid": "20pgt",
 			"delpermanentid": "20pdt",
			"form":{
				"1":{"title":"Payment","type":"Inline","icon":"mif-money","fields":"paymentdate,taskid,contactid,purpose,amount,bill,pconfirmationlink,remark,chequeno,paymentfrom,paymentmode,project"},
				"2":{"title":"Payment","type":"Inline","icon":"mif-money","dataclstitleicon":"fg-blue",
						"fields":"paymentdate,taskid,contactid,purpose,amount,bill,pconfirmationlink,remark,chequeno,paymentfrom,paymentmode"
					}
				
			},
			"list":{
				"20":{
					"outputto": "php","output": "payment",				
					"tbl": "nbbi_payments a","join": "INNER JOIN nbbi_contacts b ON a.contactid=b.id",
					"fld": [
						"a.paymentdate,CONCAT(b.contactname,IF(b.organization is not null and b.organization !='',CONCAT(' (Company:',b.organization,')'),'')) contactname,a.purpose,CONCAT(a.paymentmode,IF(paymentfrom != '',CONCAT(' from ',paymentfrom),'')) as mode,a.amount",
						{"field":{								
								"if": "bill != ''",
								"type": "googlelink",
								"href": "<bill>",
								"value": "Link", 						
								"caption":"Bill"								
							}
						},
						{
							"field":{
								"if": "pconfirmationlink != ''",
								"type": "googlelink",
								"href": "<a.pconfirmationlink>",
								"value": "Link",
								"target": "_blank",
								"caption":"Payment Confirmation"
							}
						}							
					],					
					"datefield":"a.paymentdate",					
					"srt": "a.createdon","defaultwhr":"a.paymentdate<20200101",
					"vsum":"5", 				
					"header": "Date,Contact Name,Purpose,Payment Mode,Amount"						
				}				
			},
 			"fields": [{
 					"name": "paymentdate",
 					"type": "date",
 					"other": "NOT NULL DEFAULT '0001-01-01'",
					"label":"Date"
 				},{
 					"name": "taskid  varchar(36) NOT NULL","fieldtype":"lookup", 					
					"lookup":{"sqlid":"20lkp1","tbl":"nbbi_tasks","fld":"task","whr":"status<=3"}, 					
					"label":"Task ID",				
					"default":"||TID||",
					"clearDataAfterSave":"false"
 				},
 				{
 					"name": "contactid varchar(36) NOT NULL",
 					"fieldtype": "lookup","required":1,
					"lookup":{"sqlid":"20lkp2","tbl":"nbbi_contacts","fld":"contactname"}, 					
					"label":"Payment Made To"					
 				},
 				{
 					"name": "purpose",
 					"type": "varchar(1000)",
 					"other": "NOT NULL",
					"label":"Purpose"
 				},
 				{
 					"name": "amount",
 					"type": "float",
 					"other": "NOT NULL",
					"label":"Amount"
 				},
 				{
 					"name": "status",
 					"type": "int",
 					"other": "NOT NULL",
					"label":"Status",
					"fieldtype":"select","option":",1:Open,2:Payment Done"
 				},
 				{
 					"name": "bill",
 					"type": "googlelink",
					"label":"Bill"
 				},
 				{
 					"name": "pconfirmationlink",
 					"type": "googlelink",
					"label":"Confirmation Link"
 				},
 				{
 					"name": "remark",
 					"type": "varchar(100)",
 					"other": "NOT NULL",
					"label":"Remark"
 				},
 				{
 					"name": "paymentfrom",
 					"type": "varchar(100)",
 					"other": "NOT NULL",
					"label":"Payment From"
 				},
 				{
 					"name": "chequeno",
 					"type": "varchar(50)",
 					"other": "NOT NULL",
					"label":"Cheque No"
 				},
 				{
 					"name": "paymentmode",
 					"type": "enum('Cash','Internet Banking','UPI','Card','Bank Transfer','Cheque','Demand Draft')",
 					"other": "NOT NULL",
					"label":"Payment Mode"					
 				},
 				{
 					"name": "project varchar(30)", 					
 					"fieldtype": "select","option":"SELECT DISTINCT projectname FROM nbbi_department",
					"label":"Project"				
 				}
 			]
 		},
 		{
 			"name": "nbbi_links",
			"saveid": "21lsv",
 			"getid": "21lgt",
 			"delpermanentid": "21ldt",
			"form":{
				"1":{"title":"Link","type":"2 Columns","icon":"mif-link","fields":"lname,link,linktype,taskid,remark,porder"},
				"2":{"title":"Link","type":"Inline","icon":"mif-dashboard",
						"fields":[
							"lname,link,linktype,taskid,remark,porder",
							{"id":"multilink","name":"multilink","fieldtype":"textarea","label":"CSV Link Text"}							
						],
						"customButton":[
							{"class":"ml-2 button secondary", "value":"New","onclick":"$('#nbbi_links_2Form [name=id]').val('');$('#nbbi_links_2Form [name=lname]').val('');$('#nbbi_links_2Form [name=link]').val('');$('#nbbi_links_2Form [name=remark]').val('');$('#nbbi_links_2Form [name=linktype]').val();$('#nbbi_links_2Form [name=porder]').val(parseInt($('#nbbi_links_2Form [name=porder]').val())+1);"},
							{"class":"ml-2 button success", "value":"Save Bulk","onclick":"if(!$('#multilink').val()){showToast('Empty CSV Link Text','alert',5000);return false;}Eirene.runStmt('21csv-21',{taskid:'||TID||',TID:'||TID||',csv:$('#multilink').val(),remark:$('#nbbi_links_2Form [name=remark]').val(),linktype:$('#nbbi_links_2Form [name=linktype]').val(),updateTable:'1'})"}
						],
						"cancelButton":false
					}
				
			},
			"list":{
				"21":{									
					"outputto":"php",
					"output": "link",								
					"tbl": "nbbi_links",
					"fld": [
						"lname,linktype,porder,remark",
						{"field":{
								"if": "link != ''",
								"type": "googlelink",
								"href": "<link>",
								"value": "Link"	,
								"caption":"Link"								
							}
						}
					],
					"whr":[
						"recordstatus=1",
						{"if":"||TID|| != BLANK","then":" and taskid='||TID||'"},
						{"if":"||taskid|| != BLANK","then":" and taskid='||taskid||'"},
						{"if":"||onlypdf|| != BLANK","then":" and linktype='PDF'"}
					],
					"srt": "porder", 				
					"header": "Name,Type,Order,Remark"					
				}
 			},			
 			"fields": [{
 					"name": "lname",
 					"type": "varchar(200)",
 					"other": "NOT NULL",
					"label":"Link Name"
 				},
 				{
 					"name": "link",
 					"type": "googlelink",
 					"other": "NOT NULL",
					"label":"Link"
 				},
 				{
 					"name": "linktype",
 					"type": "enum('Image','PDF','Other Document','Featured Image1','Featured Image2')",
 					"other": "NOT NULL DEFAULT 'PDF'",
					"label":"Link Type"
 				},
 				{
 					"name": "taskid",
 					"type": "char(36)",
 					"other": "NOT NULL",
					"default":"||TID||",
					"fieldtype":"hidden",
					"label":"Task ID"
 				},
 				{
 					"name": "remark",
 					"type": "varchar(100)",
 					"other": "NOT NULL",
					"label":"Remark"
 				},
 				{
 					"name": "porder",
 					"type": "tinyint",
 					"other": "NOT NULL DEFAULT 1",
					"label":"Order","required":true
 				}
 			]
 		},
 		{
 			"name": "nbbi_journal",
			"saveid": "22jsv",
 			"getid": "22gtj",
 			"delpermanentid": "22jdt",
			"form":{
				"1":{"title":"Journal","icon":"mif-note","type":"Horizontal","fields":"jdate,title,remark,taskid,link"},
				"2":{"title":"Journal","icon":"mif-dashboard","type":"Inline","fields":"jdate,title,remark,taskid,link"}
			},
			"list":{
				"22":{								
					"outputto":"php",
					"output":"journal",					 				
					"tbl": "nbbi_journal","getform":"||thistbl|| 1",
					"includeeditdelete":true,"filter":"jdate,title,taskid",
					"fld": [
						"jdate,title,remark",
						{
							"field":{
								"if": "link != ''",
								"type": "googlelink",
								"href": "<link>",
								"value": "Link",
								"target": "_blank",							
								"caption":"Link"
							}
						}
					],					
					"datefield":"jdate",					
					"srt": "jdate DESC", 				
					"header": "Date,Title,Remark,Link,Function"
				}
			},
 			"fields": [{
 					"name": "jdate",
 					"type": "date",
					"label":"Date"
 				},{
 					"name": "title",
 					"type": "varchar(200)",
 					"other": "NOT NULL",
					"label":"Title"
 				},
 				{
 					"name": "remark",
 					"type": "varchar(200)",
 					"other": "NOT NULL",
					"label":"Remark"
 				},
 				{
 					"name": "taskid char(36) NOT NULL","fieldtype":"lookup", 					
					"lookup":{"sqlid":"22lkup","tbl":"nbbi_tasks","fld":"task","whr":"status<=3"}, 										
					"label":"Task ID",
					"default":"||TID||",
					"clearDataAfterSave":"false"
 				},
 				{
 					"name": "link",
 					"type": "googlelink",			
					"label":"Link"
 				}
 			]
 		}, 		
 		{
 			"name": "eirene_developer_sql",
 			"fields": [{
 					"name": "customid",
 					"type": "varchar(20)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "pluginid",
 					"type": "varchar(100)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "pname",
 					"type": "varchar(50)",
 					"other": "NOT NUll"
 				},
 				{
 					"name": "sqlstmt",
 					"type": "varchar(8000)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "status",
 					"type": "tinyint",
 					"other": "NOT NULL"
 				}
 			]
 		},
 		{
 			"name": "nbbi_medical_incidents",
 			"fields": [{
 					"name": "muserid",
 					"type": "char(36)",
 					"other": "NOT NULL"
 				}, {
 					"name": "idate",
 					"type": "date",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "complaints",
 					"type": "varchar(100)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "vdate",
 					"type": "date",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "treatment",
 					"type": "varchar(200)",
 					"other": "NOT NULL"
 				},
 				{
 					"name": "status",
 					"type": "tinyint",
 					"other": "NOT NULL"
 				}
 			]
 		},
		{
			"name": "nbbi_facultyattendance",
 			"fields": [
				{
 					"name": "classname",
 					"type": "varchar(10)",
 					"other": "NOT NULL"
 				},{
 					"name": "classyear",
 					"type": "tinyint",
 					"other": "NOT NULL"
 				},{
 					"name": "period",
 					"type": "tinyint",
 					"other": "NOT NULL"
 				}
			]
		},
		{
 			"name": "nbbi_taskreportelem",
			"saveid": "34sv",
			"getid": "34gt",
			"delpermanentid": "34dt",
			"form":{
				"1":{"title":"Report Elements","icon":"mif-dashboard","type":"Inline","fields":"taskid,item,porder,class,style,otherjson"}				
			},
			"list":{
				"34tbl":{					
					"outputto": "php","output": "taskreport",					
					"tbl":"nbbi_taskreportelem",
					"fld":"item,porder",
					"includeeditdelete":true,
					"header":"Item,Order,Function",
					"whr":"taskid='||TID||'","srt":"porder"
				}
			},
 			"fields": [
				{
					"name": "taskid",
					"type":"char(36)",
					"other":"NOT NULL",
					"label":"Task ID",
					"fieldtype":"hidden",
					"default":"||TID||",
					"clearDataAfterSave":"false"
				},
				{
 					"name": "item",
 					"type": "enum('Featured Image','Title','Heading','Text Block','Featured Content and Description','Featured Post','Finance','Image','Image Gallery','Journals','Checklist','PDF')",
 					"other": "NOT NULL",
					"label":"Item"
 				},{
					"name": "porder",
					"type":"int",
					"other":"DEFAULT 1",
					"label":"Order",
					"required":true
				},{
					"name": "class",
					"type":"varchar(200)",
					"other":"",
					"label":"HTML Class"
				},{
					"name": "style",
					"type":"varchar(1000)",
					"other":"",
					"label":"HTML Style"
				},{
					"name": "otherjson",
					"type":"varchar(5000)",
					"other":"",
					"label":"Other JSON"
				}
			]
		},{
 			"name": "nbbi_dailyworks",
			"saveid": "35sv",
			"getid": "35gt",
			"delpermanentid": "35dt",
			"form":{
				"0":{"title":"Daily Works","icon":"mif-dashboard","type":"Inline","fields":"*"},				
				"1":{"title":"Daily Works","icon":"mif-dashboard","type":"Inline","fields":"work,workupdate,link"}				
			},
			"list":{
				"35tbl":{					
					"outputto": "html","output": "table",
					"validate":"none","getform":"||thistbl|| 1",
					"tbl":"||thistbl||",
					"fld":"work,workupdate,link",
					"includeeditdelete":true,
					"editablefields":"workupdate,link",
					"header":"Item,Update,Link",
					"whr":"responsible='||pr||' and workstatus=0",
					"srt":"createdon",
					"onsuccess":"cmd:dom,fun:show;#workareaTablebox-cmd:dom,fun:show;#workareaFilter"
				},
				"35tbl1":{					
					"outputto": "html","output": "table",				
					"tbl":"||thistbl||","getform":"||thistbl|| 0",
					"filter":[
						"responsible,workstatus",
						{"name":"datefrom","type":"date","label":"Date From"},
						{"name":"dateto","type":"date","label":"Date To"}
					],
					"fld":"responsible,work,workupdate,link",
					"includeeditdelete":true,
					"editablefields":"work,workupdate,link",
					"header":"Person Responsible,Item,Update,Link",					
					"whr":[
						"recordstatus=1",
						{"if":"||workstatus|| != BLANK","then":" and workstatus=||workstatus||","else":" and workstatus=0"},
						{"if":"||datefrom|| != BLANK ||dateto|| != BLANK","then":" and DATE(createdon)>='||datefrom||' and DATE(createdon)<='||dateto||'"},
						{"if":"||responsible| != BLANK","then":" and responsible='||responsible||'"}
					],
					"srt":"responsible,createdon",
					"onsuccess":"cmd:dom,fun:show;#workareaTablebox-cmd:dom,fun:show;#workareaFilter"
				}
			},
 			"fields": [
				{
					"name": "responsible","other":"NOT NULL","label":"Person Responsible",
					"type":"enum('Lijo','Subin','Edward','Holy','Rita','Samuel','Chiru','Ashish','Dr Alex','AK Journal')"										
				},
				{"name": "work","type":"varchar(300)","fieldtype":"textarea","label":"Item"},
				{"name": "workupdate","type":"varchar(300)","fieldtype":"textarea","label":"Update"},
				{"name": "link","type":"varchar(300)","fieldtype":"text","label":"G-Drive Link (PDF/JPG)"},
				{"name": "workstatus","type":"int","fieldtype":"select","option":"0:Open,1:Closed,:All","label":"Work Status"}
			]
		},{
			"name":"nbbi_questions",
			"saveid":"quesv","getid":"quegt","delid":"quedt",
			"form":{
				"0":{"title":"Questions","icon":"mif-dashboard","type":"1 Column","fields":"question,description"}				
			},
			"list":{
				"quelt":{
					"tbl":"||thistbl||","fld":"*",
					"whr":"recordstatus=1","limit":"50",
					"filter":"question,status"
				}
			},			
			"fields":[
				{"name":"question","type":"varchar(2000)","fieldtype":"textarea","label":"Question"},
				{"name":"description","type":"varchar(3000)","fieldtype":"textarea","label":"Description"},
				{"name":"status","type":"tinyint","fieldtype":"select","other":"DEFAULT 0","option":"0:Open,1:Closed","label":"Status"}
			]
		},
		{
			"name":"nbbi_answers",
			"saveid":"anssv","getid":"ansgt","delid":"ansdt",
			"fields":[
				{"name":"queid","type":"char(36)","fieldtype":"hidden","label":"Question ID"},
				{"name":"answer","type":"varchar(3999)","fieldtype":"textarea","label":"Answer"},
				{"name":"status","type":"tinyint","fieldtype":"select","option":"0:Open,1:Closed","label":"Status"}
			]
		},{
			"name":"nbbi_notes",
			"saveid":"nsv","getid":"ngt","delpermanentid":"ndt",
			"form":{
				"0":{"title":"Notes","icon":"mif-pencil","type":"1 Column","fields":"linkedid,title,status,notes"}
			},
			"list":{
				"nlt":{
					"tbl":"||thistbl||","fld":"title,status","defaultwhr":"status=0 and recordstatus=1",
					"getform":"||thistbl|| 0","includeeditdelete":true,
					"functionfield":[
						{"type":"icon","class":"mif-open-book","onclick":"Eirene.temp='<id>';$('#nltchktext').val('<id>');Eirene.runStmt('nhtml',{id:'<id>'})","caption":"Notes"}
					],
					"prepend":"<div><input type='hidden' id='nltchktext'></div><script>Eirene.temp='0';</script>"
				},
				"nhtml":{
					"action":"Get HTML","output":"#workareaAppendix",
					"tbl":"||thistbl||","fld":"id,title,notes","whr":"id='||id||'",
					"onsuccess":"cmd:dom,fun:show;#workareaAppendix",
					"template":[
						"<div id='nltnotes'>",
							"<div>",
								"<button class='mif-link' onclick='copy(&apos;https://cmch.niea.in/cmchapp.php?needlogin=false&plugin=NBBI Management&stmt=nhtml&id=||id||&apos;)'></button>",
							"</div>",
							"<div>||title||</div>",
							"<div>||notes||</div>",
						"</div>",
						"<script>if(Eirene.temp){if(Eirene.temp==$('#nltchktext').val()){setTimeout(function(){Eirene.runStmt('nhtml',{id:Eirene.temp,inbackground:1})},5000)}}</script>"
					]
				}
			},
			"fields":[
				{"name":"linkedid varchar(36)","label":"Linked to","fieldtype":"lookup","lookup":{"sqlid":"nlkup1","fld":"id,task","tbl":"nbbi_tasks"}},
				{"name":"title varchar(300)","label":"Title","filterop":"like"},
				{"name":"notes text","label":"Notes","fieldtype":"texteditor"},
				{"name":"status text","label":"Status","fieldtype":"select","option":"0:Open,1:Closed"}
			]
		},{
			"name":"nbbi_onlinemark",
			"saveid":"omsv","getid":"omgt","delpermanentid":"omdt",
			"form":{
				"0":{"title":"Online Mark","icon":"mif-pencil","type":"2 Columns","fields":"*"}
			},
			"joindef":{
				"online_course":"online_course.id=nbbi_onlinemark.subjectid"
			},
			"list":{
				"omlt":{
					"output":"#workareaTablebox","getform":"||thistbl|| 0",
					"filter":"rollno,subjectid","usejoin":"online_course b",
					"fld":"a.rollno,b.titleprint,a.test1,a.test2,a.test3,a.drta,a.presentation,a.assignment,a.readingreport,a.internaltotal,a.finalexam,a.total,a.ispass",
					"tbl":"||thistbl|| a"
				},
				"ombsv":{
					"action":"Save Row From CSV",
					"tbl":"||thistbl||",
					"command":"insertorupdate",
					"fld":[
						"subjectid,rollno,||mktype||"						
					],
					"fldtype":"s,n,n",
					"value":"||subject||,'||0||',||1||",
					"whr":"subjectid='||subject||' and rollno=||0|| and recordstatus=1",
					"csvstring":"||csv||"
				},
				"ombfrm":{
					"action":"Return","outputto":"php",
					"output":"res",
					"elem":{
						"output":"#workareaFilter1",
						"elem":[
							{"type":"lookup","lookup":{"sqlid":"omlkup"},"id":"subjectid","name":"subjectid","label":"Subject"},
							{"type":"textarea","id":"stulttxt","name":"stulttxt","onblur":"let str=$(this).val().replace(/\\\\t/g,',');$(this).val(str);","label":"Mark"},
							{"type":"select","option":"test1:Quiz1,test2:Quiz3,test3:Quiz3,drta:Digital Round Table Attendance,presentation:Presentation,assignment:Assignment,readingreport:Reading Report,finalexam:Final Exam","id":"mktype","name":"mktype","label":"Mark Type"},
							{"type":"button","id":"stultbtn","name":"stultbtn","value":"Save","onclick":"let subjectid=$('#subjectid').val();if(!subjectid){showToast('No subject selected','alert',5000);return false;} let val=$('#stulttxt').val();if(!val){showToast('No value entered','alert',5000);return false;} Eirene.runStmt('ombsv',{csv:val,mktype:$('#mktype').val(),subject:subjectid});"}
						]
					}
				}
			},			
			"fields":[
				{"name":"rollno varchar(10)","fieldtype":"text","required":true,"label":"Roll No"},				
				{"name":"subjectid varchar(36)","fieldtype":"lookup","lookup":{"sqlid":"omlkup","fld":"id,CONCAT(programlinked,'-',titleprint)","tbl":"online_course","whr":"titleprint like '%||searchtext||%'","defaultwhr":"status=1 and institute='NBBI'"},"required":true,"label":"Subject"},
				{"name":"test1 tinyint DEFAULT 0","fieldtype":"text","label":"CT1","placeholder":"Class Test 1 Mark"},
				{"name":"test2 tinyint DEFAULT 0","fieldtype":"text","label":"CT2","placeholder":"Class Test 2 Mark"},
				{"name":"test3 tinyint DEFAULT 0","fieldtype":"text","label":"CT3","placeholder":"Class Test 3 Mark"},
				{"name":"drta tinyint DEFAULT 0","fieldtype":"text","label":"DRT","placeholder":"Digital Round Table Mark"},
				{"name":"assignment tinyint DEFAULT 0","fieldtype":"text","label":"AM1","placeholder":"Assignment 1 Mark"},
				{"name":"readingreport tinyint DEFAULT 0","fieldtype":"text","label":"AM2","placeholder":"Assignment 2 Mark"},
				{"name":"internaltotal tinyint GENERATED ALWAYS AS (CEIL((test1+test2+test3+drta+assignment+readingreport)*60/100))","fieldtype":"text","label":"Internal (Total)"},
				{"name":"finalexam tinyint","fieldtype":"text","label":"Final Exam","placeholder":"Final Exam Mark"},
				{"name":"total tinyint GENERATED ALWAYS AS (internaltotal+finalexam)","fieldtype":"text","label":"Total"},				
				{"name":"isinternalpass tinyint GENERATED ALWAYS AS (if(internaltotal >= 24,1,0))","fieldtype":"text","label":"Is Pass (Internal)"},
				{"name":"isexternalpass tinyint GENERATED ALWAYS AS (if(finalexam>=16,1,0))","fieldtype":"text","label":"Is Pass (External)"},
				{"name":"ispass tinyint GENERATED ALWAYS AS (if(isinternalpass=1 AND isexternalpass=1,1,0))","fieldtype":"text","label":"Is Pass"}
			]
		}
 	],
 	"sqlcommands_oninstall": [],
 	"form": [
 	],
 	"form_html": "",
 	"navbutton": [{
 		"customid": "1",
 		"caption": "NBBI Management",
 		"icon": "mif-books fg-green",
 		"btntype": "ribbon-button",
 		"btngroup": "Online Course",
 		"btntab": "Online Education",
 		"btnorder": "1",
 		"onclick": "initializePlugin();"
 	}],
 	"script": "",
 	"formbuttons": [{
 			"name": "task",
 			"caption": "Task",
 			"icon": "mif-menu fg-red",
 			"onclick": "Eirene.runStmt('35lt-35flt-1tkflt')"
 		},{
 			"name": "taskblg",
 			"caption": "Task Blog",
 			"icon": "mif-menu fg-red",
 			"onclick": "Eirene.runStmt('30tkbl')"
 		}, {
 			"name": "contact",
 			"caption": "Contact",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('3conlt')"
 		}, {
 			"name": "ccl",
 			"caption": "CCL",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('31cclc-31ccld')"
 		}, {
 			"name": "activity",
 			"caption": "Activity",
 			"icon": "mif-book fg-red",
 			"onclick": "Eirene.runStmt('5rntlt')"
 		},
 		{
 			"name": "studentprofile",
 			"caption": "Profile",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('stflt-uslst')"
 		},
 		{
 			"name": "timetable",
 			"caption": "Time Table",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('14-14flt')"
 		},
 		{
 			"name": "institutes",
 			"caption": "Institutes",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('15-15flt')"
 		}, 		
 		{
 			"name": "medicalincident",
 			"caption": "Mediacal Incident",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('25')"
 		},
 		{
 			"name": "courseallotment",
 			"caption": "Course Allotment",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('26calt',{mode:'',term:'',faculty:'',academicyear:''})"
 		},
 		{
 			"name": "onlineCourses",
 			"caption": "Online Courses",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('27lt');$('#workareaFilter').show();"
 		},
 		{
 			"name": "attendance",
 			"caption": "Attendance",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('28lt-28ltbt-28ltft',{attendancedate:formatDate(),period:1})"
 		},
 		{
 			"name": "dailywork",
 			"caption": "Daily Work",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('35tbl1')"
 		},
 		{
 			"name": "settings",
 			"caption": "Settings",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('29lt')"
 		}
 	],
 	"sqlstatement": [
		{
			"id":"1tkflt",
			"name":"Task Buttons",
			"sql":{
				"action":"Return","outputto":"php","output":"res","value":"",
				"elem": {
 					"output": "#workareaFilter",
 					"parent": "div",
 					"elem": [
 						{
 							"name": "s1a","type": "button","value": "Project","onclick": "Eirene.runStmt('37lt')","title": "Project List"
 						},{
 							"name": "s1b","type": "button","value": "Department","onclick": "Eirene.runStmt('35lt-35flt')","title": "Department List"
 						},
 						{
 							"name": "s2","type": "button","value": "Task","onclick": "Eirene.runStmt('1tklst')","title": "Task List"
 						},{
 							"name": "s-journal","type": "button","value": "Journal","onclick": "Eirene.runStmt('22',{var22_outputto:'html',var22_output:'table',var22_includeeditdelete:'true',var22_filter:'jdate',var22_getform:'nbbi_journal 2'})","title": "Journal"
 						},{
 							"name": "s-Finance","type": "button","value": "Finance","onclick": "Eirene.runStmt('1fnlst')","title": "Finance"
 						},{
 							"name": "s-notes","type": "button","value": "Notes","onclick": "Eirene.runStmt('nlt')","title": "Notes"
 						},{
 							"name": "s-Query","type": "button","value": "Query","onclick": "Eirene.runStmt('1qrlst-1qrflt')","title": "Finance"
 						},{
 							"name": "s-Plan","type": "button","value": "Planner","onclick": "Eirene.runStmt('22blst')","title": "Planner"
 						},{
 							"name": "s-template","type": "button","value": "Report Template","onclick": "Eirene.runStmt('32tem1-32tem5')","title": "Report Template"
 						}
 					]
 				},
				"onsuccess": "cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:empty;#workareaAppendix"
			}
		},
 		{		
			"id":"1jrlt",
			"name":"Journal Filter List",
			"sql":{
				"action":"Return",
				"validate":"eirene_users",
				"outputto":"php",
				"output":"res",
				"value":[
					{"call":"22","getform":"nbbi_journal 2",
					"includeeditdelete":"true","outputto":"html",
					"output":"table",
					"filter":[
						"title,taskid",
						{"name":"datefrom","type":"date","label":"Date From"},
						{"name":"dateto","type":"date","label":"Date To"}
					]
					}
				]
				
			}
		},{
			"id":"1fnlst",
			"name":"Get Payment List",
			"sql":{
				"action":"Return",
				"outputto":"php",
				"value":[
					"",
					{"call":"20","output":"#workareaTablebox","outputto":"html","filter":"paymentdate,status,project","getform":"nbbi_payments 1","includeeditdelete":"true"}
				]
				
			}
		},{
			"id":"1qrlst",
			"name":"Get Query List",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table",
				"tbl":"nbbi_query a",
				"getform":"nbbi_query 2",
				"includeeditdelete":true,
				"join":"INNER JOIN nbbi_tasks c ON a.taskid=c.id",
				"fld":"c.task,a.query",				
				"header":"Task,Query,",
				"functionfield":[
					{					
						"type": "text",						
						"value": "<a.response>",												
						"caption":"Response",
						"onblur":"Eirene.runStmt('22sv',{ID:'<a.id>',response:$(this).val()})"
					}
				],
				"whr":[
					"a.recordstatus=1",
					{"if":"||fromdate|| != BLANK and ||todate|| != BLANK","then":" and DATE(a.createdon) between '||fromdate||' and '||todate||'","else":" and a.response =''"}
				]
			}
		},{
			"id":"1qrflt",
			"name":"Query Filter",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"res",
				"value":"",
				"elem":{
					"outputto":"html",
					"output":"#workareaFilter1",
					"elem":[
						{
							"name":"f1",
							"id":"1qrflt-f1",
							"label":"From",
							"class":"mr-2",
							"type":"datepicker"							
						},{
							"name":"f2",
							"id":"1qrflt-f2",
							"label":"To",
							"class":"mr-2",
							"type":"datepicker"							
						},
						{
							"name": "f4",
							"type": "button",
							"value": "Get",
							"onclick": "Eirene.runStmt('1qrlst',{fromdate:$('#1qrflt-f1').val(),todate:$('#1qrflt-f2').val()})"
						}
					]
				}
			}
		},		 	
 		{
 			"id": "6fint1",
 			"name": "Get Table-Finance",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "php",
 				"output": "fin",
 				"tbl": "niea_finance",
 				"fld": "item,quantity,unit,rate,(rate * quantity) as total",
 				"header": "Item,Quantity,Unit,Rate,Total",
 				"whr": "taskid='||taskid||'",
 				"prepend": "<div id='finance1234' class='d-flex flex-justify-around flex-wrap'><div><div>Item</div><div><input type='text' name='item'/></div></div><div><div>Quantity</div><div><input type='text' name='quantity'/></div></div><div><div>Unit</div><div><input type='text' name='unit'/></div></div><div><div>Rate</div><div><input type='text' name='rate'/></div></div></div><div><button class='button primary p-2' onclick='Eirene.runStmt(&quot&6finsv&quot&,{taskid:&quot&||taskid||&quot&,item:$(&quot&#finance1234 input[name=item]&quot&).val(),quantity:$(&quot&#finance1234 input[name=quantity]&quot&).val(),unit:$(&quot&#finance1234 input[name=unit]&quot&).val(),rate:$(&quot&#finance1234 input[name=rate]&quot&).val()})'>Save</button></div>",
 				"onsuccess": "cmd:dom,fun:showdialog;Finance;info;||GET_fin||"
 			}
 		},
 		{
 			"id": "8actlt",
 			"name": "Activity List",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"formname": "activity",
 				"tbl": "niea_activity a",
 				"whr": "status=1 and recordstatus>0",
 				"delid": "8actdt",
 				"fld": "activityname,dept,outcome",
 				"header": "Activity,Department,Outcome",
 				"elem": {
 					"output": "#workareaFilter",
 					"parent": "div",
 					"elem": [{
 							"name": "s1",
 							"type": "buttonspan",
 							"class": "mif-plus fg-red",
 							"caption": "",
 							"onclick": "showForm(&apos;nbbi_activites&apos;)",
 							"title": "Add New Activity"
 						},
 						{
 							"name": "s2",
 							"type": "buttonspan",
 							"class": "mif-menu fg-red",
 							"caption": "",
 							"onclick": "Eirene.runStmt(&apos;8actlt&apos;)",
 							"title": "Activity List"
 						},
 						{
 							"name": "s3",
 							"caption": "Active",
 							"type": "button",
 							"class": "fg-red",
 							"sqlid": "8actlt",
 							"whr": "status=1",
 							"title": "Active List"
 						},
 						{
 							"name": "s4",
 							"caption": "Inactive",
 							"type": "button",
 							"class": "fg-red",
 							"sqlid": "8actlt",
 							"whr": "status=0",
 							"title": "Inactive List"
 						}
 					]
 				},
 				"functionfield": [{
 					"type": "group",
 					"caption": "Function",
 					"grp": [{
 							"type": "icon",
 							"class": "icon mif-pencil",
 							"title": "Edit Record",
 							"onclick": "edit('activity','<a.id>',true)"
 						},
 						{
 							"type": "icon",
 							"class": "icon mif-cross",
 							"title": "Delete Record",
 							"onclick": "Eirene.runStmt2('8actdt','ID','<a.id>')"
 						}
 					]
 				}],
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter"
 			}
 		},
 		{
 			"id": "uslst",
 			"name": "student  List",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter",
 					"elem": [
						{
 							"name": "f1",
 							"displaynone": "1",
 							"whr": [
 								"recordstatus=1 and isfaculty!=1", 
								{"if":"||institute|| != BLANK","then": " and linked_to_institution='||institute||'"},
 								{"if": "||program|| != BLANK","then": " and linked_to_program='||program||'"},
 								{"if": "||state|| != BLANK","then": " and state='||state||'"},
 								{"if": "||name|| != BLANK","then": " and fullname like '%||name||%'"},
 								{"if": "||year|| != BLANK","then": " and admissionyear=||year||"},
 								{"if": "||edumode|| != BLANK","then": " and educationmode='||edumode||'"},
 								{"if": "||gender|| != BLANK","then": " and gender='||gender||'"}
 							]
 						},
 						{
 							"name": "fnew",
 							"value": "+",
 							"type": "button",
							"class":"fg-red",
 							"onclick": "showWindowInDialog('online_course_users_student')"
 						},{
 							"name": "f2",
 							"value": "Student Profile",
 							"type": "button",
 							"onclick": "Eirene.runStmt('uslst-stflt',{isfaculty:0,admissionyear:date_format(now(),'%Y'})"							
 						},
 						{
 							"name": "f3",
 							"value": "Faculty Profile",
 							"type": "button",
 							"onclick": "Eirene.runStmt('uslst1')"
 						}
 					]
 				},
 				"fld": "fullname,gender,state,linked_to_program,admissionyear",
 				"functionfield": [{
 						"type": "group",
 						"grp": [{
 								"type": "icon",
 								"class": "mif-user-plus fg-red mr-2",
 								"value": "",
 								"title": "Add Family Details",
 								"onclick": "showWindowInDialog('studentfamily');$('#sf_userid').val('<id>')"
 							},
 							{
 								"type": "icon",
 								"class": "mif-school fg-red mr-2",
 								"value": "",
 								"title": "Add Education Details",
 								"onclick": "showWindowInDialog('studenteducaton');$('#sf_userid').val('<id>')"
 							},
 							{
 								"type": "icon",
 								"class": "mif-file-text fg-red mr-2",
 								"value": "",
 								"title": "Add Reference Details",
 								"onclick": "showWindowInDialog('studentreference');$('#sf_userid').val('<id>')"
 							},
 							{
 								"type": "icon",
 								"class": "mif-gift fg-red mr-2",
 								"value": "",
 								"title": "Add Marks Details",
 								"onclick": "showWindowInDialog('studentmarks');$('#sf_userid').val('<id>')"
 							},
 							{
 								"type": "icon",
 								"class": "mif-user-check fg-red mr-2",
 								"value": "",
 								"title": "Add Opportunity Details",
 								"onclick": "showWindowInDialog('studentopportunities');$('#sf_userid').val('<id>')"
 							}

 						]
 					},
 					{
 						"type": "icon",
 						"class": "mif-file-text mif-2x",
 						"title": "Transcript Print",
 						"onclick": "Eirene.runStmt('12pr1',{ID:'<id>'})"
 					},
 					{
 						"type": "icon",
 						"class": "mif-printer mif-2x",
 						"title": "Profile Print",
 						"onclick": "Eirene.runStmt('11pr',{ID:'<id>'})"
 					},
 					{
 						"type": "icon",
 						"class": "mif-profile mif-2x",
 						"title": "View Student Profile",
 						"onclick": "Eirene.runStmt('spview',{ID:'<id>'})"
 					},
 					{
 						"type": "icon",
 						"class": "mif-pencil mr-2",
 						"title": "Edit User Details",
 						"onclick": "edit('Online Course Users student','<id>',true)"
 					}
 				],
 				"tbl": "online_course_users",
 				"header": "Name,Gender,State,Course,Year",
 				"whr": [
					"recordstatus=1", 
					{"if":"||isfaculty|| != BLANK","then": " and isfaculty=||isfaculty||"},
					{"if":"||linked_to_institution|| != BLANK","then": " and linked_to_institution='||linked_to_institution||'"},
					{"if":"||institute|| != BLANK","then": " and linked_to_institution='||institute||'"},
					{"if": "||program|| != BLANK","then": " and linked_to_program='||program||'"},
					{"if": "||state|| != BLANK","then": " and state='||state||'"},
					{"if": "||name|| != BLANK","then": " and fullname like '%||name||%'"},
					{"if": "||admissionyear|| != BLANK","then": " and admissionyear=||admissionyear||"},
					{"if": "||year|| != BLANK","then": " and admissionyear=||year||"},
					{"if": "||edumode|| != BLANK","then": " and educationmode='||edumode||'"},
					{"if": "||educationmode|| != BLANK","then": " and educationmode='||educationmode||'"},
					{"if": "||gender|| != BLANK","then": " and gender='||gender||'"}
				],
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter;fast-cmd:dom,fun:empty;#workareaAppendix;fast"
 			}
 		},
 		{
 			"id": "uslst1",
 			"name": "Faculty  List",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter",
 					"elem": [{
 							"name": "f1",
 							"displaynone": "1",
 							"whr": [
 								"recordstatus=1 and isfaculty=1", {
 									"if": "||institute|| != BLANK",
 									"then": " and linked_to_institution='||institute||'"
 								},
 								{
 									"if": "||program|| != BLANK",
 									"then": " and linked_to_program='||program||'"
 								},
 								{
 									"if": "||state|| != BLANK",
 									"then": " and state='||state||'"
 								},
 								{
 									"if": "||name|| != BLANK",
 									"then": " and fullname like '%||name||%'"
 								}
 							]
 						},

 						{
 							"name": "f2",
 							"value": "Student Profile",
 							"type": "button",
 							"onclick": "Eirene.runStmt('uslst-stflt')"
 						},
 						{
 							"name": "f3",
 							"value": "Faculty Profile",
 							"type": "button",
 							"onclick": "Eirene.runStmt('uslst1')"
 						}
 					]
 				},
 				"fld": "fullname,gender,state",
 				"functionfield": [{
 						"type": "group",
 						"grp": [{
 								"type": "button",
 								"class": "mif-user-plus fg-red mr-2",
 								"value": "Family",
 								"title": "Add Family Details",
 								"onclick": "showWindowInDialog('studentfamily');$('#sf_userid').val('<id>')"
 							},
 							{
 								"type": "button",
 								"class": "mif-school fg-red mr-2",
 								"value": "Education",
 								"title": "Add Education Details",
 								"onclick": "showWindowInDialog('studenteducaton');$('#sf_userid').val('<id>')"
 							},
 							{
 								"type": "button",
 								"class": "mif-file-text fg-red mr-2",
 								"value": "Reference",
 								"title": "Add Reference Details",
 								"onclick": "showWindowInDialog('studentreference');$('#sf_userid').val('<id>')"
 							},
 							{
 								"type": "button",
 								"class": "mif-user-check fg-red mr-2",
 								"value": "Opportunities",
 								"title": "Add Opportunity Details",
 								"onclick": "showWindowInDialog('studentopportunities');$('#sf_userid').val('<id>')"
 							}

 						]
 					},
 					{
 						"type": "icon",
 						"class": "mif-printer mif-2x",
 						"title": "Profile Print",
 						"onclick": "Eirene.runStmt('11pr1',{ID:'<id>'})"
 					},
 					{
 						"type": "icon",
 						"class": "mif-profile mif-2x",
 						"title": "View Faculty Profile",
 						"onclick": "Eirene.runStmt('fpview',{ID:'<id>'})"
 					},
 					{
 						"type": "icon",
 						"class": "mif-pencil mr-2",
 						"title": "Edit User Details",
 						"onclick": "edit('Online Course Users','<id>')"
 					}
 				],
 				"tbl": "online_course_users",
 				"header": "Name,Gender,State",
 				"whr": "recordstatus=1 and isfaculty=1",
 				"onsuccess": "cmd:dom,fun:empty;#workareaFilter1;fast-cmd:dom,fun:empty;#workareaAppendix;fast"
 			}
 		},
 		{
 			"id": "stbtn",
 			"name": "Student Profile Buttons",
 			"sql": {
 				"action": "Return",
 				"outputto": "php",
 				"output": "demo",
 				"value": "",
 				"outputfilter": "#workareaFilter",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter",
 					"elem": [{
 						"name": "f1",
 						"displaynone": "1",
 						"whr": [
 							"recordstatus=1",
 							{
 								"if": "||program|| != BLANK",
 								"then": " and linked_to_program='||program||'"
 							},
 							{
 								"if": "||state|| != BLANK",
 								"then": " and state='||state||'"
 							},
 							{
 								"if": "||name|| != BLANK",
 								"then": "and fullname like '%||name||%'"
 							},
 							{
 								"if": "||institute|| != BLANK",
 								"then": "and linked_to_institution='||institute||'"
 							}
 						]
 					}]
 				},
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter;fast"
 			}
 		},
 		{
 			"id": "stflt",
 			"name": "student profile Filter",
 			"sql": {
 				"action": "Return",
 				"outputto": "php",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter1",
 					"elem": [{
 							"name": "f1",
 							"id": "linked_to_institution",
 							"type": "select",
 							"option": ",NIBS,NBBI,NIBI,Other",
 							"label": "Institute:"
 						},
 						{
 							"name": "f2",
 							"id": "linked_to_program",
 							"type": "select",
 							"option": ",Bachelor of Theology,Master of Divinity,Master of Theology,Diploma in Theology,Certificate in Theology",
 							"label": "Program:"
 						},
 						{
 							"name": "f3",
 							"id": "state",
 							"type": "select",
 							"option": ",Andhra Pradesh,Arunachal Pradesh,Assam,Bihar,Chhattisgarh,Goa,Gujarat,Haryana,Himachal Pradesh,Jharkhand,Karnataka,Kerala,Madhya Pradesh,Maharashtra,Manipur,Meghalaya,Mizoram,Nagaland,Odisha,Punjab,Rajasthan,Sikkim,Tamil Nadu,Telangana,Tripura,Uttar Pradesh,Uttarakhand,West Bengal,Other",
 							"label": "State:"
 						},
 						{
 							"name": "f4",
 							"id": "status",
 							"type": "select",
 							"option": ",Current student,Formar student",
 							"label": "Status:"
 						},
 						{
 							"name": "f4a",
 							"id": "edumode",
 							"type": "select",
 							"option": ",Online,Residential",
 							"label": "Edu Mode:"
 						}, {
 							"name": "f5",
 							"id": "year",
 							"type": "text",
 							"placeholder": "Adm.Year(Format:YYYY)"
 						}, {
 							"name": "f6",
 							"id": "name",
 							"type": "text",
 							"placeholder": "Name"
 						}, {
 							"name": "f7",
 							"id": "gender",
 							"type": "select",
 							"option": ",Male,Female",
							"label":"Gender: "
 						},
 						{
 							"name": "f8",
 							"type": "button",
 							"value": "Get",
 							"onclick": "Eirene.runStmt('uslst',{institute:$('#linked_to_institution').val(),program:$('#linked_to_program').val(),state:$('#state').val(),status:$('#status').val(),year:$('#year').val(),name:$('#name').val(),edumode:$('#edumode').val(),gender:$('#gender').val()})"
 						}
 					]
 				},
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter1;fast"
 			}
 		},
 		{
 			"id": "spview",
 			"name": "Student Profile View",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"multistmt": [{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"fld": "name,relationship,dob,baptized,believer,occupation",
 						"functionfield": [{
 							"type": "icon",
 							"class": "mif-pencil mr-2",
 							"title": "Edit",
 							"onclick": "edit('studentfamily','<id>')"
 						}, {
 							"type": "icon",
 							"class": "mif-cross fg-red ",
 							"title": "Delete",
 							"onclick": "Eirene.runStmt2('9sfdt','ID','<id>')"
 						}],
 						"tbl": "nbbi_student_family",
 						"header": "Name,Relatioship,Date of Birth,Baptized,Believer,Occupation",
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Family Details ",
 						"append": ""
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Degree,Year,University/Board,Result,Certificate",
 						"tbl": "nbbi_student_education",
 						"fld": "degree,year,board,result,docpath",
 						"functionfield": [{
 							"type": "icon",
 							"class": "mif-pencil mr-2",
 							"title": "Edit",
 							"onclick": "edit('studenteducaton','<id>')"
 						}, {
 							"type": "icon",
 							"class": "mif-cross fg-red ",
 							"title": "Delete",
 							"onclick": "Eirene.runStmt2('10sedt','ID','<id>')"
 						}],
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Education Details"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Name,Email,Mobile,Reference,Remark",
 						"tbl": "nbbi_student_reference",
 						"fld": "name,email,mobile,docpath,remark",
 						"functionfield": [{
 							"type": "icon",
 							"class": "mif-pencil mr-2",
 							"title": "Edit",
 							"onclick": "edit('studentreference','<id>')"
 						}, {
 							"type": "icon",
 							"class": "mif-cross fg-red ",
 							"title": "Delete",
 							"onclick": "Eirene.runStmt2('11srdt','ID','<id>')"
 						}],
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Reference Details"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Subject,Credit,Year,Semester,Grade,Marks,Remark",
 						"tbl": "nbbi_student_marks",
 						"fld": "subject,credit,year,semester,grade,marks,remark",
 						"functionfield": [{
 							"type": "icon",
 							"class": "mif-pencil mr-2",
 							"title": "Edit",
 							"onclick": "edit('studentmarks','<id>')"
 						}, {
 							"type": "icon",
 							"class": "mif-cross fg-red ",
 							"title": "Delete",
 							"onclick": "Eirene.runStmt2('12smdt','ID','<id>')"
 						}],
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "<button type='buttonspan' class='mif-printer fg-blue' onclick='Eirene.runStmt(&apos;12pr&apos;,{ID:&apos;||ID||&apos;})'></button> Marks Details "
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Opportunity,Category,Remark",
 						"tbl": "nbbi_student_opportunities",
 						"fld": "opportunityname,category,remark",
 						"functionfield": [{
 							"type": "icon",
 							"class": "mif-pencil mr-2",
 							"title": "Edit",
 							"onclick": "edit('studentopportunities','<id>')"
 						}, {
 							"type": "icon",
 							"class": "mif-cross fg-red ",
 							"title": "Delete",
 							"onclick": "Eirene.runStmt2('13sodt','ID','<id>')"
 						}],
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "<button type='buttonspan' class='mif-printer fg-blue' onclick='Eirene.runStmt(&apos;14pr&apos;,{ID:&apos;||ID||&apos;})'></button> Opportunities Details"
 					}
 				]
 			}
 		},
 		{
 			"id": "fpview",
 			"name": "Faculty Profile View",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"multistmt": [{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"fld": "name,relationship,dob,baptized,believer,occupation",
 						"functionfield": [{
 							"type": "icon",
 							"class": "mif-pencil mr-2",
 							"title": "Edit",
 							"onclick": "edit('studentfamily','<id>')"
 						}, {
 							"type": "icon",
 							"class": "mif-cross fg-red ",
 							"title": "Delete",
 							"onclick": "Eirene.runStmt2('9sfdt','ID','<id>')"
 						}],
 						"tbl": "nbbi_student_family",
 						"header": "Name,Relatioship,Date of Birth,Baptized,Believer,Occupation",
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Family Details ",
 						"append": ""
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Degree,Year,University/Board,Result,Certificate",
 						"tbl": "nbbi_student_education",
 						"fld": "degree,year,board,result,docpath",
 						"functionfield": [{
 							"type": "icon",
 							"class": "mif-pencil mr-2",
 							"title": "Edit",
 							"onclick": "edit('studenteducaton','<id>')"
 						}, {
 							"type": "icon",
 							"class": "mif-cross fg-red ",
 							"title": "Delete",
 							"onclick": "Eirene.runStmt2('10sedt','ID','<id>')"
 						}],
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Education Details"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Name,Email,Mobile,Reference,Remark",
 						"tbl": "nbbi_student_reference",
 						"fld": "name,email,mobile,docpath,remark",
 						"functionfield": [{
 							"type": "icon",
 							"class": "mif-pencil mr-2",
 							"title": "Edit",
 							"onclick": "edit('studentreference','<id>')"
 						}, {
 							"type": "icon",
 							"class": "mif-cross fg-red ",
 							"title": "Delete",
 							"onclick": "Eirene.runStmt2('11srdt','ID','<id>')"
 						}],
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Reference Details"

 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Opportunity,Category,Remark",
 						"tbl": "nbbi_student_opportunities",
 						"fld": "opportunityname,category,remark",
 						"functionfield": [{
 							"type": "icon",
 							"class": "mif-pencil mr-2",
 							"title": "Edit",
 							"onclick": "edit('studentopportunities','<id>')"
 						}, {
 							"type": "icon",
 							"class": "mif-cross fg-red ",
 							"title": "Delete",
 							"onclick": "Eirene.runStmt2('13sodt','ID','<id>')"
 						}],
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "<button type='buttonspan' class='mif-printer fg-blue' onclick='Eirene.runStmt(&apos;14pr&apos;,{ID:&apos;||ID||&apos;})'></button> Opportunities Details"
 					}
 				]
 			}
 		},
 		{
 			"id": "14",
 			"name": "View Time Table Details",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter",
 					"elem": [{
 							"name": "f1",
 							"type": "buttonspan",
 							"icon": "mif-plus fg-red",
 							"value": "",
 							"onclick": "showWindowInDialog('timetable')",
 							"title": "Add Time Table"
 						}, {
 							"name": "f2",
 							"type": "button",
 							"value": "Time Table",
 							"onclick": "Eirene.runStmt('14-14flt')",
 							"title": "Details of Time table"
 						},
 						{
 							"name": "f4",
 							"type": "button",
 							"value": "Subject",
 							"onclick": "Eirene.runStmt('14a')",
 							"title": "Details of Time table"
 						},
 						{
 							"name": "f5",
 							"type": "button",
 							"value": "Report",
 							"title": "Add To Report",
 							"onclick": "Eirene.runStmt('14tr',{ds:formatDate(new Date().addDays(-(new Date().getDay()-1))),de:formatDate(new Date().addDays(-(new Date().getDay()-6)))})"
 						}
 					]
 				},
 				"prepend": "<button type:'buttonspan' class='mif-printer fg-blue' onclick='Eirene.runStmt(&apos;14prt&apos;)' ></button>",
 				"header": "Subject,Day,Class,Starting Time, Ending Time,Faculty",
 				"tbl": "nbbi_timetable a",
 				"join": "LEFT JOIN online_course b ON a.subid=b.id LEFT JOIN online_course_users c ON a.facultyid=c.id",
 				"fld": "b.title,if(a.day=1,'Mon',(if(a.day=2,'Tue',(if(a.day=3,'Wed',(if(a.day=4,'Thu',(if(a.day=5,'Fri',(if(a.day=6,'Sat',(if(a.day=0,'SUn',('')))))))))))))) as day,a.class,a.timestart,a.timeend,c.fullname",
 				"functionfield": [{

 					"type": "icon",
 					"class": "mif-pencil mr-2",
 					"title": "Edit",
 					"onclick": "edit('timetable','<a.id>')"
 				}, {
 					"type": "icon",
 					"class": "mif-cross fg-red ",
 					"title": "Delete",
 					"onclick": "Eirene.runStmt2('14ttdt','ID','<a.id>')"
 				}],
 				"whr": [
					"a.recordstatus=1",
					{"if": "||subid|| != BLANK","then": " and a.subid='||subid||'"},
					{"if": "||day|| != BLANK","then": " and a.day='||day||'"},
					{"if": "||faculty|| != BLANK","then": " and a.facultyid='||faculty||'"}
				],
 				"onsuccess": "cmd:dom,fun:empty;#workareaAppendix;fast"
 			}
 		},
 		{
 			"id": "14a",
 			"name": "View subject- Time Table Details",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"header": "Subject,Days,Class,Lesson Count,Faculty",
 				"tbl": "nbbi_timetable a",
 				"join": [
 					"LEFT JOIN online_course b ON a.subid=b.id",
 					"LEFT JOIN online_course_users c ON a.facultyid=c.id",
 					"LEFT JOIN (select courseid,count(*) as lcount from online_lesson where type='Reading' and recordstatus=1 GROUP BY courseid) d on d.courseid=b.id"
 				],
 				"fld": "b.title,GROUP_CONCAT(a.day) as day,a.class,d.lcount,c.fullname",
 				"grp": "b.title,a.class,c.fullname",
 				"srt": "a.day",
 				"whr": "a.recordstatus=1",
 				"onsuccess": "cmd:dom,fun:empty;#workareaAppendix;fast"
 			}
 		},

 		{
 			"id": "14prt",
 			"name": "Time Table Print",
 			"sql": {
 				"action": "Get Matrix",
 				"output": "#workareaAppendix",
 				"appendoutput":1,
 				"row": "day",
 				"col": "timestart",
 				"val": "title",
 				"keepallcontent": true,
 				"seperator": "<br>",
 				"class": "eirene-table dataTable",
 				"tbl": "nbbi_timetable a",
 				"srt": "a.day",
 				"join": "INNER JOIN online_course b ON a.subid=b.id",
 				"fld": "if(a.day=1,'Mon',(if(a.day=2,'Tue',(if(a.day=3,'Wed',(if(a.day=4,'Thu',(if(a.day=5,'Fri',(if(a.day=6,'Sat',(if(a.day=0,'SUn',('')))))))))))))) as day,a.timestart,b.title",
 				"whr": "a.recordstatus=1",
 				"prepend": "<h3 class='mt-3'><center>Time Table<center></h3>",
 				"header": "Day,Time",
 				"class": "eirene-table dataTable",
 				"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast-cmd:dom,fun:function;printHTML;workareaAppendix"
 			}
 		},
 		{
 			"id": "14flt",
 			"name": "Time Table Filter",
 			"sql": {
 				"action": "Return",
 				"outputto": "php",
 				"value": "",
 				"output": "demo",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter1",
 					"elem": [{
 							"name": "f1",
 							"id": "subid",
 							"type": "select",
 							"class": "mr-2",
 							"option": "SELECT '','' UNION ALL SELECT id,title from online_course where recordstatus=1",
 							"label": "Subject:"
 						},
 						{
 							"name": "f2",
 							"id": "day",
 							"type": "select",
 							"class": "mr-2",
 							"option": ",0:Sun,1:Mon,2:Tue,3:Wend:,4:Thu,5:Fri,6:Sat",
 							"label": "Day:"

 						},
 						{
 							"name": "f3",
 							"id": "faculty",
 							"type": "select",
 							"class": "mr-2",
 							"option": "SELECT '','' UNION ALL SELECT id,fullname from online_course_users where isfaculty=1",
 							"label": "Faculty:"
 						},
 						{
 							"name": "f7",
 							"type": "button",
 							"value": "Get",
 							"onclick": "Eirene.runStmt('14',{subid:$('#subid').val(),day:$('#day').val(),faculty:$('#faculty').val()})"
 						}
 					]
 				},
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter1;fast-cmd:dom,fun:show;#workareaFilter;fast"
 			}
 		},
 		{
 			"id": "15",
 			"name": "View Institute Details",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter",
 					"elem": [{
 							"name": "f1",
 							"type": "buttonspan",
 							"icon": "mif-plus fg-red",
 							"value": "",
 							"onclick": "showWindowInDialog('institute')",
 							"title": "Add Institute Details"
 						}, {
 							"name": "f2",
 							"type": "button",
 							"value": "Institute",
 							"onclick": "Eirene.runStmt('15')",
 							"title": "Details of Institute"
 						} 						
 					]
 				},
 				"header": "Institute Name, Website, Brief History, State of Faith, Contact",
 				"tbl": "nbbi_institute",
 				"fld": "institutename,website,briefhistory,stateoffaith,contact",
 				"functionfield": [{
 					"type": "icon",
 					"class": "mif-pencil mr-2",
 					"title": "Edit",
 					"onclick": "edit('institute','<id>')"
 				}, {
 					"type": "icon",
 					"class": "mif-cross fg-red ",
 					"title": "Delete",
 					"onclick": "Eirene.runStmt2('15itdt','ID','<id>')"
 				}],
 				"whr":[
					"recordstatus=1",
					{"if": "||institute|| != BLANK","then": "and institutename like '%||institute||%'"}
				],
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter1;fast-cmd:dom,fun:show;#workareaFilter;fast-cmd:dom,fun:empty;#workareaAppendix;fast"
 			}
 		},
 		{
 			"id": "15flt",
 			"name": "Institute Filter",
 			"sql": {
 				"action": "Return",
 				"outputto": "php",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter1",
 					"elem": [{
 							"name": "f1",
 							"id": "name",
 							"type": "text",
 							"placeholder": "Name Of Institute"
 						},
 						{
 							"name": "f2",
 							"type": "button",
 							"value": "Get",
 							"onclick": "Eirene.runStmt('15',{institute:$('#name').val()})"
 						}
 					]
 				},
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter1;fast-cmd:dom,fun:show;#workareaFilter;fast"
 			}
 		}, 		
 		
 		{
 			"id": "11pr",
 			"name": "Get Opportunities HTML(User details)",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"multistmt": [{
 						"action": "Get HTML",
 						"appendoutput":1,
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"prepend": [
 							"<center><img src='resource/image/cmch_logo1.png' width='400' height='60'></center>",
 							"<DIV class='font-ArialNarrow'><center><h6>Student Profile<h6></center></DIV>"
 						],
 						"template": [
 							"<table class='font-ArialNarrow' style='margin-left:2cm;margin-right:3cm;margin-top:10px;width:80%;font-size:0.8em'>",
 							"<tr><td style='width:110px' class='pl-1'><b>Name</b></td><td style= class='p-1'>||fullname||</td><td style='width:110px' class='p-1'><b>Admission No</b></td><td style= class='p-1'></td></tr>",
 							"<tr><td style='width:110px' class='pl-1'><b>Course</b></td><td style= class='p-1'>||linked_to_program||</td><td style='width:110px' class='p-1'><b>Institute</b></td><td style= class='p-1'>||linked_to_institution||</td></tr>",
 							"</table>"
 						],
 						"tbl": "online_course_users",
 						"fld": "fullname,linked_to_institution,linked_to_program",
 						"whr": "id='||ID||'",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"fld": "name,relationship,dob,baptized,believer,occupation",
 						"tbl": "nbbi_student_family",
 						"header": "Name,Relatioship,Date of Birth,Baptized,Believer,Occupation",
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Family Details "
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Degree,Year,University/Board,Result,Certificate",
 						"tbl": "nbbi_student_education",
 						"fld": "degree,year,board,result,docpath",
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Education Details"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Name,Email,Mobile,Reference,Remark",
 						"tbl": "nbbi_student_reference",
 						"fld": "name,email,mobile,docpath,remark",
 						"whr": "stid='||ID||' and recordstatus=1",
 						"prepend": "Reference Details",
 						"onsuccess": "cmd:dom,fun:function;printHTML;workareaAppendix"

 					}
 				]
 			}
 		},
 		{
 			"id": "11pr1",
 			"name": "Get Opportunities HTML(User details)",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"multistmt": [{
 						"action": "Get HTML",
 						"appendoutput":1,
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"prepend": [
 							"<center><img src='resource/image/cmch_logo1.png' width='400' height='60'></center>",
 							"<DIV class='font-ArialNarrow'><center><h6>Faculty Profile<h6></center></DIV>"
 						],
 						"template": [
 							"<table class='font-ArialNarrow' style='margin-left:2cm;margin-right:3cm;margin-top:10px;width:80%;font-size:0.8em'>",
 							"<tr><td style='width:110px' class='pl-1'><b>Name</b></td><td style= class='p-1'>||fullname||</td><td style='width:110px' class='p-1'><b>Admission No</b></td><td style= class='p-1'></td></tr>",
 							"<tr><td style='width:110px' class='pl-1'><b>Course</b></td><td style= class='p-1'>||linked_to_program||</td><td style='width:110px' class='p-1'><b>Institute</b></td><td style= class='p-1'>||linked_to_institution||</td></tr>",
 							"</table>"
 						],
 						"tbl": "online_course_users",
 						"fld": "fullname,linked_to_institution,linked_to_program",
 						"whr": "id='||ID||'",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"fld": "name,relationship,dob,baptized,believer,occupation",
 						"tbl": "nbbi_student_family",
 						"header": "Name,Relatioship,Date of Birth,Baptized,Believer,Occupation",
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Family Details "
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Degree,Year,University/Board,Result,Certificate",
 						"tbl": "nbbi_student_education",
 						"fld": "degree,year,board,result,docpath",
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast",
 						"prepend": "Education Details"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Name,Email,Mobile,Reference,Remark",
 						"tbl": "nbbi_student_reference",
 						"fld": "name,email,mobile,docpath,remark",
 						"whr": "stid='||ID||' and recordstatus=1",
 						"prepend": "Reference Details",
 						"onsuccess": "cmd:dom,fun:function;printHTML;workareaAppendix"
 					}
 				]
 			}
 		},
 		{
 			"id": "12pr",
 			"name": "Get Mark HTML(User details)",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"multistmt": [{
 						"action": "Get HTML",
 						"appendoutput":1,
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"prepend": [
 							"<center><img src='resource/image/cmch_logo1.png' width='400' height='60'></center>",
 							"<DIV class='font-ArialNarrow'><center><h6>Mark Details<h6></center></DIV>"
 						],
 						"template": [
 							"<table class='font-ArialNarrow' style='margin-left:4cm;margin-right:3cm;margin-top:10px;width:80%;font-size:0.8em'>",
 							"<tr><td style='width:110px' class='pl-1'><b>Name</b></td><td style= class='p-1'>||fullname||</td><td style='width:110px' class='p-1'><b>Admission No</b></td><td style= class='p-1'></td></tr>",
 							"<tr><td style='width:110px' class='pl-1'><b>Course</b></td><td style= class='p-1'>||linked_to_program||</td><td style='width:110px' class='p-1'><b>Institute</b></td><td style= class='p-1'>||linked_to_institution||</td></tr>",
 							"</table>"
 						],
 						"tbl": "online_course_users",
 						"fld": "fullname,linked_to_institution,linked_to_program",
 						"whr": "id='||ID||'",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Subject,Credit,Year,Grade,Marks,Remark",
 						"tbl": "nbbi_student_marks",
 						"fld": "subject,credit,year,grade,marks,remark",
 						"whr": "stid='||ID||' and recordstatus=1",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast-cmd:dom,fun:function;printHTML;workareaAppendix"
 					}
 				]
 			}
 		},
 		{
 			"id": "12pr1",
 			"name": "Get Opportunities HTML(User details)",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"multistmt": [{
 						"action": "Get HTML",
 						"appendoutput":1,
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"prepend": [
 							"<center><img src='resource/image/cmch_logo1.png' width='400' height='60'></center>",
 							"<DIV class='font-ArialNarrow'><center><h6>TRANSRIPT<h6></center></DIV>",
 							"<DIV style='margin-left:1.5cm' class='font-ArialNarrow'><b>The Academic Record of:<b></DIV>"
 						],
 						"template": [
 							"<table class='font-ArialNarrow' style='margin-left:2cm;margin-right:3cm;margin-top:10px;width:80%;font-size:1.2em'>",
 							"<tr><td style='width:110px' class='pl-6'><b>Name:</b>||fullname||<br><b>Address:</b>||district||,||state||</td>",
 							"<td style='width:110px' class='pl-6'><b>Sex:</b><br><b>Admitted:</b><br><b>Graduated:</b></td>",
 							"<td style='width:110px' class='pl-6'><b>Degree conferred:</b>||linked_to_institution||||<br><b>Class Distinction</b><br><b>Final Average:</b><br><b>Duration of Stusy</b><br><b>Date of Issue:</b></td></tr>",
 							"</table>"
 						],
 						"tbl": "online_course_users",
 						"fld": "fullname,linked_to_institution,linked_to_program",
 						"whr": "id='||ID||'",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Subject,Marks",
 						"tbl": "nbbi_student_marks",
 						"fld": "subject,marks",
 						"whr": "stid='||ID||' and recordstatus=1 and year=1 and semester=1",
 						"prepend": "<DIV><center>I YEAR:SEMESTER I</center></DIV>"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Subject,Marks",
 						"tbl": "nbbi_student_marks",
 						"fld": "subject,marks",
 						"whr": "stid='||ID||' and recordstatus=1 and year=1 and semester=2",
 						"prepend": "<DIV><center>I YEAR:SEMESTER II</center></DIV>"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Subject,Marks",
 						"tbl": "nbbi_student_marks",
 						"fld": "subject,marks",
 						"whr": "stid='||ID||' and recordstatus=1 and year=2 and semester=1",
 						"prepend": "<DIV><center>II YEAR:SEMESTER I</center></DIV>"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Subject,Marks",
 						"tbl": "nbbi_student_marks",
 						"fld": "subject,marks",
 						"whr": "stid='||ID||' and recordstatus=1 and year=2 and semester=2",
 						"prepend": "<DIV><center>II YEAR:SEMESTER II</center></DIV>"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Subject,Marks",
 						"tbl": "nbbi_student_marks",
 						"fld": "subject,marks",
 						"whr": "stid='||ID||' and recordstatus=1 and year=3 and semester=1",
 						"prepend": "<DIV><center>III YEAR:SEMESTER I</center></DIV>"
 					},
 					{
 						"action": "Get Table",
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"appendoutput":1,
 						"header": "Subject,Marks",
 						"tbl": "nbbi_student_marks",
 						"fld": "subject,marks",
 						"whr": "stid='||ID||' and recordstatus=1 and year=3 and semester=2",
 						"prepend": "<DIV><center>III YEAR:SEMESTER II</center></DIV>"
 					}
 				]
 			}
 		},
 		{
 			"id": "14pr",
 			"name": "Get Opportunities HTML(User details)",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"multistmt": [{
 						"action": "Get HTML",
 						"appendoutput":1,
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"prepend": [
 							"<center><img src='resource/image/cmch_logo1.png' width='400' height='60'></center>",
 							"<DIV class='font-ArialNarrow'><center><h6>Opportunities Details<h6></center></DIV>"
 						],
 						"template": [
 							"<table class='font-ArialNarrow' style='margin-left:2cm;margin-right:3cm;margin-top:10px;width:80%;font-size:0.8em'>",
 							"<tr><td style='width:110px' class='pl-1'><b>Name</b></td><td style= class='p-1'>||fullname||</td><td style='width:110px' class='p-1'><b>Admission No</b></td><td style= class='p-1'></td></tr>",
 							"<tr><td style='width:110px' class='pl-1'><b>Course</b></td><td style= class='p-1'>||linked_to_program||</td><td style='width:110px' class='p-1'><b>Institute</b></td><td style= class='p-1'>||linked_to_institution||</td></tr>",
 							"</table>"
 						],
 						"tbl": "online_course_users",
 						"fld": "fullname,linked_to_institution,linked_to_program",
 						"whr": "id='||ID||'",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast"
 					},
 					{
 						"action": "Get Table",
 						"appendoutput":1,
 						"outputto": "html",
 						"output": "#workareaAppendix",
 						"header": "Opportunities,Category,Remark",
 						"tbl": "nbbi_student_opportunities",
 						"fld": "opportunityname,category,remark",
 						"whr": "stid='||ID||'",
 						"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast-cmd:dom,fun:function;printHTML;workareaAppendix"
 					}
 				]
 			}
 		},  		 		
 		{
 			"id": "21csv",
 			"name": "Save Task Link Details-CSV",
 			"sql": {
 				"action": "Save Row From CSV",
 				"outputto": "php",
 				"output": "res",
 				"command": "insert",
 				"tbl":[
					"nbbi_links",
					{"sqlstatement":{"rcnt":"SELECT count(*) FROM nbbi_links WHERE taskid='||taskid||'"}}
				],
				"csvstring":"||csv||",
 				"fld": "id,taskid,lname,link,remark,linktype,createdby,porder", 				
 				"value": "UUID(),'||taskid||','||0||','||1||','||remark||','||linktype||','||USERID||',||GET_rcnt||+||loopcount||", 				
 				"onsuccess": "cmd:dom,fun:showtoast;success;Saving Successful-cmd:dom,fun:val;input[name=lname];BLANK",
 				"onfailure": "cmd:dom,fun:showtoast;alert;Saving failed"			
 			}
 		},
		{
			"id":"23fcnt",
			"name":"Task Report Settings",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"","appendoutput":1,
				"value":"",
				"elem":[
					{
						"parent": "div",
						"style":"padding:20px 10px;background-color:#eef5f9;border-radius:10px",
						"outputto":"php","output": "taskreportsettings",
						"elem": [
							{
								"name": "f1",
								"id": "23_f1",
								"type": "select",
								"class":"mr-2",
								"selectedvalue":"SELECT featuredcontent1 FROM nbbi_tasks where id='||TID||'",
								"option":"SELECT '','' UNION SELECT id,checklistname FROM nbbi_checklist where taskid='||TID||'",
								"label":"Featured Content 1",
								"onchange":"Eirene.runStmt('tksv',{ID:'||TID||',featuredcontent1:$(this).val()});"
							},{
								"name": "f2",
								"id": "23_f2",
								"type": "select",
								"class":"mr-2",
								"selectedvalue":"SELECT featuredcontent2 FROM nbbi_tasks where id='||TID||'",
								"option":"SELECT '','' UNION SELECT id,checklistname FROM nbbi_checklist where taskid='||TID||'",
								"label":"Featured Content 2",
								"onchange":"Eirene.runStmt('tksv',{ID:'||TID||',featuredcontent2:$(this).val()});"							
							},{
								"name": "f3",
								"id": "23_f3",
								"type": "select",
								"selectedvalue":"SELECT featuredcontent3 FROM nbbi_tasks where id='||TID||'",
								"option":"SELECT '','' UNION SELECT id,checklistname FROM nbbi_checklist where taskid='||TID||'",
								"label":"Featured Content 3",
								"onchange":"Eirene.runStmt('tksv',{ID:'||TID||',featuredcontent3:$(this).val()});"							
							}
						]
					}
				]
			}
		}, 		 		
 		{
 			"id": "25",
 			"name": "Mediacal Incident Details",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"tbl": "nbbi_medical_incidents a",
 				"join": "LEFT JOIN online_course_users b ON b.id=a.muserid",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter",
 					"elem": [{
 						"name": "f1",
 						"type": "buttonspan",
 						"icon": "mif-plus fg-red",
 						"value": "",
 						"onclick": "showWindowInDialog('medicalincident')",
 						"title": "Add Need"
 					}, {
 						"name": "f2",
 						"type": "button",
 						"value": "Incidents",
 						"onclick": "Eirene.runStmt('25')",
 						"title": "Needs"
 					}]
 				},
 				"fld": "b.fullname,a.idate,a.complaints,a.vdate,a.treatment,a.status",
 				"functionfield": [{
 					"type": "group",
 					"caption": "Action",
 					"grp": [{
 							"type": "icon",
 							"class": "mif-pencil fg-blue mr-2",
 							"onclick": "edit('medicalincident','<a.id>',true)"
 						},
 						{
 							"type": "icon",
 							"class": "mif-cross fg-red",
 							"onclick": "Eirene.runStmt2('25mdt','ID','<a.id>')"
 						}
 					]
 				}],
 				"header": "Name,Date of Mediacal Incident, Primary Complaint,Date of Visiting Hospital, Treatment, Current Status",
 				"whr": "a.recordstatus=1",
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter;slow-cmd:dom,fun:show;#workareaFilter1;slow-cmd:dom,fun:empty;#workareaAppendix;slow"

 			}
 		},		
 		{
			"id": "26cael",
 			"name": "Send Email for Course Allotment Letter",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"output": "res",
				"multistmt":[
					{
						"action":"Get Table",
						"outputto":"php",
						"output":"table1",
						"tbl": "nbbi_courseallotment a",
						"fld":"b.titleprint,b.programlinked,a.mode,a.term,a.credit",
						"join":"INNER JOIN online_course b ON a.courseid = b.id INNER JOIN online_course_users c ON a.facultyid=c.id",
						"header":"Course,Program,Mode,Term,Credit",
						"whr":"a.recordstatus=1 and a.facultyid='||faculty||' and a.academicyear='||academicyear||' and a.term='||term||' and a.mode='||mode||'",
						"tdstyle":"padding:8px 10px;background-color:white;vertical-align: middle!important;color:#90969b;"
					},{
						"action":"Send Email",
						"outputto":"php",
						"output":"email",
						"to":"||emailto||",
						"cc":"||USER_username||",
						"subject":"Subject Allotment Letter",
						"content":[
							"<div><div style='font-family:&apos;Times New Roman&apos;;font-size:11pt;margin:1cm'><center></center><br><div style='text-align:right'>Date: ||CURDATE_D_M_Y||</div><br><center>",
							"<b>SUBJECT ALLOTMENT LETTER</b><br>(||mode||)",
							"</center><br>Dear ||facultyname||,<br><div style='text-align: justify;'>As per the decision of the NBBI faculty, we are pleased to inform you that the following subjects are assigned to you for the Academic year ||academicyear||, Term: ||term||. Please collect the syllabus from the academic office for the subjects assigned. You are requested to provide a copy of the syllabus to the students during the first week of classes for residential program. For Online program, please upload the syllabus as lesson on NIEA Online Portal. As per the program design, each course carries a weightage for internal assessment that encourage self-learning and a final exam which is conducted at the end of term/semester. For any clarification, please do not hesitate to reach out to the Academic Office. Please also submit a Teaching planner for 40 class hours for a full-credit course and 20 class hours for a half-credit course. Each full-credit course will consist of 20 lessons and a half-credit course will consist of 10 lessons. The subjects allotted are:</div><br><br>||GET_table1||<br>Thank you for your support and wholehearted efforts in shaping the life of students. It is our united desire that the students are transformed and shaped in the image and likeness of our saviour Jesus Christ.",
							"<br><br>Yours sincerely,<span style='margin-left:11cm'>Received by</span><br><br><br><b>",
							{"if":"||mode|| = Residential","then":"Registrar","else":"Online Coordinator"},
							"</b><br><span>NBBI</span><span style='margin-left:12.5cm'>NBBI Faculty</span></div></div>"						
						],
						"onsuccess": "cmd:dom,fun:showtoast;success;Email Sent Successfully",
						"onfailure": "cmd:dom,fun:showtoast;alert;Email Sending Failed"
					}
				]
			}
		},{
			"id": "27lt",
			"name": "Online Course List",
			"sql": {
				"action": "Get Table",
				"output":"#workareaTablebox",
				"getform": "online_course 0","filter":"a.title,a.programlinked,a.institute,a.status",
				"fld": "a.coursecode,a.title,c.fullname,a.programlinked,a.status,(SELECT count(*) as cnt FROM online_lesson WHERE courseid=a.id)",
				"tbl": "online_course a",
				"join": [					
					"INNER JOIN online_course_users c ON a.authorid=c.id",
					"LEFT JOIN (SELECT courseid,count(id) as subscribers FROM online_course_mycourse where expirydate>='||TODAY||' GROUP BY courseid) b ON a.id=b.courseid"
				],				
				"header": "Code,Title,Author,Program,Status,Lesson Count",
				"includeeditdelete":true,
				"editablefields":"a.coursecode,a.status"			
			}
		},{
			"id": "29lt",
			"name": "Settings",
			"sql": {
				"action": "Get Table",
				"outputto": "html",
				"output": "table",
				"tbl": "eirene_meta",
				"fld": "pname",
				"functionfield": [{
						"if":"ptype = 'Text'",
						"type": "text",
						"value": "<pdata>",
						"caption": "Value1",						
						"onblur": "Eirene.runStmt('29sv',{ID:'<id>',value:$(this).val()})"
					},{
						"if":"ptype = 'Select'",
						"type": "select",
						"value": "<pdata>",
						"values":"<poption>",
						"caption": "Value2",						
						"onchange": "Eirene.runStmt('29sv',{ID:'<id>',value:$(this).val()})"
					}],

				"header": "Settings",
				"commaseperatedfld": true,
				"whr": "recordstatus=1 and pluginid1='||pluginid||'",
				"onsuccess": "cmd:dom,fun:show;#workareaFilter;slow-cmd:dom,fun:empty;#workareaFilter1;slow-cmd:dom,fun:hide;#workareaAppendix;slow-cmd:dom,fun:function;convertSelect;#workareaTablebox"
			}
		},
		{
			"id": "29sv",
			"name": "Save Settings",
			"sql": {
				"action": "Save Row",
				"outputto": "php",
				"output": "res",
				"tbl": "eirene_meta",
				"fld": "pdata",
				"value": "||value||",
				"fldtype": "s",
				"command": "update",
				"whr": "id='||ID||'",
				"onsuccess": "cmd:dom,fun:showtoast;success;Saving Successful",
				"onfailure": "cmd:dom,fun:showtoast;alert;Saving Failed"
			}
		},{
			"id":"30tkbl",
			"name":"Task Blog",
			"sql":{
				"action":"MULTISTMT",
				"outputto":"php","output":"res",
				"validate":"none",
				"multistmt":[
					{
						"action":"Return",
						"outputto":"html","output":"#workareaFilter",
						"value":[
							"<button class='border border-radius-4 p-3 bd-white' onclick='Eirene.runStmt(&apos;30tkbl&apos;,{type:&apos;Residential&apos;})'>NBBI (Residential)</button>",
							"<button class='border border-radius-4 p-3 bd-white' onclick='Eirene.runStmt(&apos;30tkbl&apos;,{type:&apos;Online&apos;})'>NBBI (Online)</button>",
							"<button class='border border-radius-4 p-3 bd-white' onclick='Eirene.runStmt(&apos;30tkbl&apos;,{type:&apos;CCL&apos;})'>NBBI (CCL)</button>",
							"<button class='border border-radius-4 p-3 bd-white' onclick='Eirene.runStmt(&apos;30tkbl&apos;,{type:&apos;Admin&apos;})'>Admin</button>"						
						],
						"onsuccess":"cmd:dom,fun:show;#workareaFilter"
					},{
						"action":"Get Carousel",
						"outputto":"html","output":"#workareaFilter1",
						"tbl":"nbbi_tasks a",
						"join":"LEFT JOIN nbbi_links b ON a.id=b.taskid",
						"fld":"CONCAT('<div style=&apos;padding:10px;color:white;&apos; class=&apos;fg-blue-hover&apos; onclick=&apos;Eirene.runStmt(&apos;34trep&apos;,{taskid:&apos;',a.id,'&apos;})&apos;><h3 style=&apos;margin-top:250px;&apos; class=&apos;font-Ubuntu-Bold&apos;>',a.task,'</h3>','<br><div>',a.description,'</div></div>') as text,CONCAT('http://drive.google.com/uc?export=view&id=',b.link) as image",
						"whr":[
								"b.linktype='Featured Image1' and (a.status=3 or a.status=4)",
								{"if":"||type|| = BLANK","then":" and a.type='Residential'","else":"and a.type='||type||'"}
						],
						"limit":"8",
						"srt":"a.modifiedon DESC",
						"height":"400px",
						"onsuccess":"cmd:dom,fun:show;#workareaFilter1"
					},{
						"action":"Get HTML",
						"outputto":"html","output":"#workareaTablebox",
						"tbl":"nbbi_tasks a",
						"join":"LEFT JOIN nbbi_links b ON a.id=b.taskid",
						"fld":"a.id,CONCAT('http://drive.google.com/uc?export=view&id=',b.link) as image,a.task,a.description",
						"whr":[
							"b.linktype='Featured Image1' and (a.status=3 or a.status=4)",
							{"if":"||type|| = BLANK","then":" and a.type='Residential'","else":"and a.type='||type||'"}
						],						
						"srt":"a.modifiedon DESC",
						"parent":"div style='height:400px;overflow-y:auto'",
						"template":	"<div style='display: inline-grid;grid-template-columns: auto auto;margin-top:10px' onclick='Eirene.runStmt(&apos;34trep&apos;,{taskid:&apos;||id||&apos;})'><div class='p-2 border border-radius-5 eirene-shadow2-hover' style='height:80px;background:linear-gradient(#fff, #E7E8EB)'><div class='border border-radius-3 bd-gray' style='width:64px;height:60px;background-size:64px 60px;background-image:url(&apos;||image||&apos;)'></div></div><div class='ml-3 p-2 border border-radius-5 eirene-shadow2-hover' style='color:#6B7074;height:80px;overflow:hidden;background-color:#F9F9FB;' onMouseOver='this.style.color=&apos;#0b6bbd&apos;' onMouseOut='this.style.color=&apos;#6B7074&apos;'><h6>||task||</h6><div style='margin-top:6px;font-size:10pt'>||description||</div></div></div>",						
						"onsuccess":"cmd:dom,fun:show;#workareaTablebox"
					}
				]
			}			
		},{
			"id":"31ccla",
			"name":"CCL Attendance Form",
			"sql":{
				"action":"Return",
				"validate":"none",
				"outputto":"php",
				"output":"res",
				"value":"",
				"elem":[
					{
						"outputto":"html","output":"#workareaTablebox",
						"parent":"div",
						"elem":[
							{
								"name":"31cclrollno",
								"id":"31cclrollno",
								"type":"text",
								"class":"mr-2",
								"label":"Roll No."
							},{
								"name":"btn",
								"type":"button",
								"value":"Save",
								"onclick":"Eirene.runStmt('31cclb',{rollno:$('#31cclrollno').val(),pluginid:'||PLUGINID||'})"
							}					
						]
					},{
						"outputto":"html","output":"#workareaFilter",
						"parent":"div",
						"elem":[
							{
								"name":"31b1",								
								"type":"button",
								"value":"Attendance",
								"class":"mr-2",
								"onclick":"Eirene.runStmt('31ccla');$('#workareaFilter1').hide();"
							},{
								"name":"31b2",								
								"type":"button",
								"value":"Student List",
								"class":"mr-2",
								"onclick":"Eirene.runStmt('31cclf',{pluginid:'||PLUGINID||'});$('#workareaFilter1').hide()"
							},{
								"name":"31b3",								
								"type":"button",
								"value":"Attendance Summary",
								"class":"mr-2",
								"onclick":"Eirene.runStmt('31sf1',{pluginid:'||PLUGINID||'})"
							},{
								"name":"31b4",								
								"type":"button",
								"value":"Marks",
								"class":"mr-2",
								"onclick":"Eirene.runStmt('31sf2',{pluginid:'||PLUGINID||'});"
							},{
								"name":"31b5",								
								"type":"button",
								"value":"Notes",
								"class":"mr-2",
								"onclick":"Eirene.runStmt('31cclk',{pluginid:'||PLUGINID||'});"
							}
						]
					}
				],
				"onsuccess":"cmd:dom,fun:show;#workareaTablebox-cmd:dom,fun:hide;#workareaFilter1"
			}
		},{
			"id":"31sf1",
			"name":"Filter - Monthly Attendance for Student",
			"sql":{
				"action":"Return","outputto":"php","output":"res","validate":"none",
				"value":"",
				"elem":[
					{
						"outputto":"html","output":"#workareaFilter1",
						"parent":"div",
						"elem":[
							{
								"name":"31fb2",
								"id":"31fb2",
								"type":"text",
								"label":"Enter Roll No",
								"class":"mr-2"								
							},{
								"name":"31fb1",
								"id":"31fb1",
								"type":"datepicker",
								"label":"Select Date",
								"class":"mr-2"								
							},{
								"name":"31fb3",								
								"type":"button",
								"value":"Get Attendance Summary",
								"class":"mr-2",
								"onclick":"let rl=$('#31fb2').val();if(!rl){showToast('Enter Roll No','alert',5000);return false;}let dt=$('#31fb1').val();if(!dt){showToast('Select Date','alert',5000);return false;}dt=dt.split('-');dt=dt[0]+'-'+dt[1];Eirene.runStmt('31cclg',{rollno:rl,ccldate:dt,pluginid:&apos;||PLUGINID||&apos;});"
							}
						]
					}
				],
				"onsuccess":"cmd:dom,fun:show;#workareaFilter1"
			}
		},{
			"id":"31sf2",
			"name":"Filter - Mark for Student",
			"sql":{
				"action":"Return","outputto":"php","output":"res","validate":"none",
				"value":"",
				"elem":[
					{
						"outputto":"html","output":"#workareaFilter1",
						"parent":"div",
						"elem":[
							{
								"name":"31fb2",
								"id":"31fb2",
								"type":"text",
								"label":"Enter Roll No",
								"class":"mr-2"								
							},{
								"name":"31fb3",								
								"type":"button",
								"value":"Get Mark",
								"class":"mr-2",
								"onclick":"let rl=$('#31fb2').val();if(!rl){showToast('Enter Roll No','alert',5000);return false;}Eirene.runStmt('31ccli',{rollno:rl,pluginid:&apos;||PLUGINID||&apos;});"
							}
						]
					}
				],
				"onsuccess":"cmd:dom,fun:show;#workareaFilter1"
			}
		},{
			"id":"31sf3",
			"name":"Filter - Mark for Faculty",
			"sql":{
				"action":"Return","outputto":"php","output":"res","validate":"none",
				"value":"",
				"elem":[
					{
						"outputto":"html","output":"#workareaFilter1",
						"parent":"div",
						"elem":[
							{
								"name":"31fb2a",
								"id":"31fb2a",
								"type":"tab",
								"tabs":[
									{
										"heading":"Filter",
										"content":[
											{
												"name":"31fb2",
												"id":"31fb2",
												"type":"select",
												"option":"select id,subject from nbbi_cclsubject",
												"label":"Subject",
												"class":"mr-2"								
											},{
												"name":"31fb1",
												"id":"31fb1",
												"type":"select",
												"option":"Class Test 1,Class Test 2,Class Test 3,Final Exam",
												"label":"Exam Type",
												"class":"mr-2"								
											},{
												"name":"31fb3",								
												"type":"button",
												"value":"Get Mark",
												"class":"mr-2",
												"onclick":"Eirene.runStmt('31cclj',{subject:$('#31fb2').val(),type:$('#31fb1').val(),pluginid:&apos;||PLUGINID||&apos;});"
											},{
												"name":"31fb3a",								
												"type":"button",
												"value":"Get Consolidate Mark",
												"class":"mr-2",
												"onclick":"Eirene.runStmt('31cclo',{subjectid:$('#31fb2').val(),type:$('#31fb1').val()});"
											},{
												"name":"31fb4",								
												"type":"button",
												"value":"Duplicate Entries",
												"class":"mr-2",
												"onclick":"Eirene.runStmt('31cck',{subject:$('#31fb2').val(),type:$('#31fb1').val(),pluginid:&apos;||PLUGINID||&apos;});"
											},{
												"name":"31fb5",								
												"type":"button",
												"value":"Term 1 Result",
												"class":"mr-2",
												"onclick":"Eirene.runStmt('31ccn',{term:1});"
											},{
												"name":"31fb6",								
												"type":"button",
												"value":"Term 2 Result",
												"class":"mr-2",
												"onclick":"Eirene.runStmt('31ccn',{term:2});"
											},{
												"name":"31fb7",								
												"type":"button",
												"value":"Term 3 Result",
												"class":"mr-2",
												"onclick":"Eirene.runStmt('31ccn',{term:3});"
											}
										]
									},{
										"heading":"Bulk Upload Marks",
										"content":[
											{
												"name":"31fb4",	
												"id":"31fb4",
												"type":"textarea",
												"value":"",
												"class":"mr-2"
											},{
												"name":"31fb5",	
												"id":"31fb5",
												"type":"button",
												"value":"Upload Mark",
												"class":"mr-2",
												"onclick":"Eirene.runStmt('31ccll',{csv:$('#31fb4').val(),course:$('#31fb2').val(),type:$('#31fb1').val(),confirmBeforeProcess:'Check Subject and Exam Type before saving. Also check if CSV first column is rollno and second column is mark obtained.'})"
											}
										]
									}
								]
							}
							
						]
					}
				],
				"onsuccess":"cmd:dom,fun:show;#workareaFilter1"
			}
		},{
			"id":"31cclb",
			"name":"Save CCL Roll No for Attendance",
			"sql":{
				"action":"Save Table",
				"validate":"none",
				"outputto":"php","output":"res",
				"tbl":"nbbi_cclattendance",
				"fld":"rollno",
				"fldtype":"n",
				"command":"insertorupdate",
				"value":"||rollno||",
				"whr":"rollno='||rollno||' and DATE(createdon)=CURDATE()",
				"onsuccess":[
					"cmd:dom,fun:showtoast;success;Saving Successful",
					"cmd:dom,fun:showmessage;#workareaTablebox;Saving Successful;success;Roll Number ||rollno|| is saved successfully."
				],
				"onfailure":"cmd:dom,fun:showtoast;alert;Saving Failed"
			}
		},{
			"id":"31clrn",
			"name":"CCL Attendance Code",
			"sql":{
				"action":"Get HTML",
				"output":"#workareaTablebox",
				"tbl":"eirene_meta",
				"fld":"pdata",
				"whr":"pname='CCL Attendance Code'",
				"template":[
					"Attendance Code: <h4>||pdata||</h4>",
					{"gethtml":{"name":"31cclr2","type":"button","value":"Reset Code","onclick":"Eirene.runStmt('31clr2-31clrn')"}},
					{"sqlstatement":
						{"a":"SELECT count(*) FROM nbbi_cclattendance a INNER JOIN nbbi_beneficiary b ON a.rollno=b.beneficiarynumber  WHERE date(a.createdon)=curdate() and b.beneficiaryclass='CCL'",
						"b":"SELECT count(*) FROM nbbi_cclattendance a INNER JOIN nbbi_beneficiary b ON a.rollno=b.beneficiarynumber  WHERE date(a.createdon)=curdate() and b.beneficiaryclass='DCL'"
						}
					},
					"<p>CCL Attendance Count: <b>||a||</b></p>",
					"<p>DCL Attendance Count: <b>||b||</b></p>"					
				]
			}
		},{
			"id":"31clr2",
			"name":"CCL Attendance Code Reset",
			"sql":{
				"action":"Return",
				"value":[
					{"sqlstatement":{"a":"SELECT IF(DATE(modifiedon)=CURDATE(),0,1) FROM eirene_meta WHERE pname='CCL Attendance Code'"}},
					{"if":"||a|| = 1","then":[
						{"sqlstatement":{"b":"SELECT FLOOR(1000 + RAND() * 9000)","c":"UPDATE eirene_meta SET pdata='||b||' WHERE pname='CCL Attendance Code'"}}						
					]},
					{"if":"||a|| = 1 and ||b|| != BLANK","then":{"domoutput":"showtoast;success;Attendance Code Reset Successful"}}
				]
			}
		},{
			"id":"31cclc",
			"name":"CCL Attendance List",
			"sql":{
				"action":"Get Table",
				"validate":"none",
				"outputto":"html",
				"output":"table",				
				"tbl":"nbbi_cclattendance a",
				"join":"INNER JOIN nbbi_cclstudent b ON a.rollno=b.rollno",
				"fld":"a.createdon,b.stuname,a.rollno",	
				"header":"Date,Name,Roll No.",
				"datefield":"a.createdon",
				"whr":[
					{"if":"||ccldate|| = BLANK","then":" DATE(a.createdon)=CURDATE()","else":"DATE(a.createdon)='||ccldate||'"}
				],
				"srt":"a.rollno"
				
			}
		},{
			"id":"31ccld",
			"name":"CCL Attendance Filter",
			"sql":{
				"action":"Return",
				"validate":"none",
				"outputto":"php",
				"output":"res",
				"value":"",
				"elem":[
					{
						"output":"#workareaFilter",
						"parent":"div",
						"elem":[
							{
								"name":"31atta",								
								"type":"button",
								"value":"Attendance Code",
								"onclick":"Eirene.runStmt('31clrn')"
							},{
								"name":"31att",								
								"type":"button",
								"value":"Attendance List",
								"onclick":"Eirene.runStmt('31cclc')"
							},{
								"name":"31b1",								
								"type":"button",
								"value":"Attendance Link",
								"onclick":"copy('https://cmch.niea.in/cmchapp.php?pluginid=||PLUGINID||&needlogin=false&stmt=31ccla&pagetitle=CCL')"
							},{
								"name":"31b2",								
								"type":"button",
								"value":"Student List",
								"onclick":"Eirene.runStmt('37ben')"
							},{
								"name":"31b3",								
								"type":"button",
								"value":"Mark List",
								"onclick":"Eirene.runStmt('31sf3')"
							},{
								"name":"31b4",								
								"type":"button",
								"value":"Subject",
								"onclick":"Eirene.runStmt('31slt')"
							}
						]
					},{
						"output":"#workareaFilter1",
						"parent":"div",
						"elem":[
							{
								"name":"31ccldate",
								"id":"31ccldate",
								"type":"datepicker",
								"class":"mr-2",
								"label":"Date"
							},{
								"name":"btn",
								"type":"button",
								"value":"Get List",
								"class":"mr-2",
								"onclick":"let dt=$('#31ccldate').val();if(!dt){showToast('Select Date','alert',5000);return false}Eirene.runStmt('31cclc',{ccldate:dt})"
							},{
								"name":"btn",
								"type":"button",
								"value":"Get Month Summary",
								"onclick":"let dt=$('#31ccldate').val();if(!dt){showToast('Select Date','alert',5000);return false}dt=dt.split('-');dt=dt[0]+'-'+dt[1];Eirene.runStmt('31cclh',{ccldate:dt})"
							}
						]
					}
				],
				"onsuccess":"cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:show;#workareaFilter1"
			}
		},{
			"id":"31ccle",
			"name":"CCL student List (For Faculty)",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table",
				"tbl":"nbbi_cclstudent",
				"fld":"rollno,stuname,gender,city,state,mobile,designation",
				"header":"Roll No.,Name,Gender,City,State,Mobile,Designation",
				"whr":"recordstatus=1",
				"srt":"rollno"
			}
		},{
			"id":"31cclf",
			"name":"CCL student List (For Student)",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table","validate":"none",
				"tbl":"nbbi_cclstudent",
				"fld":"rollno,stuname,gender,city,state,designation",
				"header":"Roll No.,Name,Gender,City,State,Designation",
				"whr":"recordstatus=1",
				"srt":"rollno"
			}
		},{
			"id":"31cclg",
			"name":"CCL student Monthly Attendance (For Student)",
			"sql":{
				"action":"MULTISTMT",
				"outputto":"php","output":"res","validate":"none",
				"multistmt":[
					{
						"action":"Get Value","outputto":"php","output":"stuname",
						"tbl":"nbbi_cclstudent",
						"fld":"stuname",						
						"whr":"recordstatus=1 and rollno=||rollno||"	
					},{
						"action":"Get Value","outputto":"php","output":"countattendance",
						"tbl":"nbbi_cclattendance",
						"fld":"count(*)",						
						"whr":"recordstatus=1 and rollno=||rollno|| and DATE_FORMAT(createdon,'%Y-%m')='||ccldate||'"	
					},{
						"action":"Get Table","outputto":"php","output":"table1",
						"tbl":"nbbi_cclattendance",
						"fld":"createdon",
						"header":"Attendance Date",
						"datefield":"createdon",
						"whr":"recordstatus=1 and rollno=||rollno|| and DATE_FORMAT(createdon,'%Y-%m')='||ccldate||'",
						"srt":"createdon DESC"
					},{
						"action":"Return","outputto":"html","output":"#workareaTablebox",
						"value":"<h3>Attendance Count</h3>Name: ||GET_stuname||<br>Total Attendance: ||GET_countattendance||<br><br><h3>Attendance Dates</h3>||GET_table1||"
					}
				]
			}
		},{
			"id":"31cclh",
			"name":"CCL student Monthly Attendance (For Faculty)",
			"sql":{
				"action":"Get Matrix",
				"outputto":"html","output":"#workareaTablebox",
				"class":"eirene-table dataTable",
				"tbl":"nbbi_cclattendance a",
				"join":"INNER JOIN nbbi_cclstudent b ON a.rollno=b.rollno",
				"fld":"a.rollno,DATE_FORMAT(a.createdon,'%d') as dt,'1' as val,b.stuname",
				"whr":"DATE_FORMAT(a.createdon,'%Y-%m')='||ccldate||'",
				"srt":"a.rollno,a.createdon",
				"row":"rollno","col":"dt","val":"val","additionalcol":"stuname",
				"hsum":1				
			}
		},{
			"id":"31ccli",
			"name":"CCL Student Mark (for student)",
			"sql":{
				"action":"MULTISTMT","validate":"none",
				"multistmt":[
					{
						"action":"Get Row",
						"outputto":"php","output":"stu",
						"tbl":"nbbi_cclstudent",
						"fld":"stuname,address",
						"whr":"rollno=||rollno||"
					},					
					{
						"action":"Get Matrix",
						"output":"mark",
						"stmt":[
								"SELECT b.subject,a.type,if(a.mark<8,CONCAT('<span class=fg-red>',a.mark,'</span>'),a.mark) as mark,b.term FROM nbbi_cclmark a",
								"INNER JOIN nbbi_cclsubject b ON a.subject=b.id WHERE a.rollno=||rollno|| and a.type='Class Test 1'",
								"UNION ALL",
								"SELECT b.subject,a.type,if(a.mark<8,CONCAT('<span class=fg-red>',a.mark,'</span>'),a.mark) as mark,b.term FROM nbbi_cclmark a",
								"INNER JOIN nbbi_cclsubject b ON a.subject=b.id WHERE a.rollno=||rollno|| and a.type='Class Test 2'",
								"UNION ALL",
								"SELECT b.subject,a.type,if(a.mark<24,CONCAT('<span class=fg-red>',a.mark,'</span>'),a.mark) as mark,b.term FROM nbbi_cclmark a",
								"INNER JOIN nbbi_cclsubject b ON a.subject=b.id WHERE a.rollno=||rollno|| and a.type='Final Exam'",
								"ORDER BY term"								
						],						
						"class":"eirene-table dataTable",
						"header":"Subject,Exam Type,Mark Obtained,Term",												
						"row":"subject",
						"col":"type",
						"val":"mark",
						"hsum":true,
						"sortcol":1
					},{
						"action":"Return","output":"#workareaTablebox",
						"value":"<b>Roll No: </b>||rollno||<br><b>Name: </b>||GET_stu_stuname||<br><b>Address: </b>||GET_stu_address||<br><br>||GET_mark||"
					}
				]
				
			}
			
		},{
			"id":"31cclj",
			"name":"CCL Student Mark (for faculty)",
			"sql":{
				"action":"Get Table",
				"output":"table",
				"tbl":"nbbi_cclmark a",
				"join":[
					"INNER JOIN nbbi_cclstudent b ON a.rollno=b.rollno",
					"INNER JOIN nbbi_cclsubject c ON a.subject=c.id"
				],
				"fld":"a.rollno,b.stuname,c.subject,a.type,a.mark",
				"srt":"a.rollno",
				"header":"Roll No.,Name,Subject,Exam Type,Mark Obtained",
				"whr":"c.id='||subject||' and a.type='||type||'"
			}
			
		},{
			"id":"31cck",
			"name":"CCL Student Mark (Duplicate Entries)",
			"sql":{
				"action":"Get Table",
				"output":"table",
				"tbl":"nbbi_cclmark a",
				"join":"INNER JOIN nbbi_cclstudent b ON a.rollno=b.rollno",
				"fld":"a.rollno,b.stuname,a.subject,a.type,count(*) as cnt",
				"hiddencol":"5",
				"functionfield":[
					{							
						"type": "link",
						"class": "",
						"value": "<count(*)>",
						"onclick": "Eirene.runStmt('31ccl',{subject:'||subject||',type:'||type||',rollno:<a.rollno>})",
						"caption":"MarkCount",
						"target":""
					}					
				],
				"srt":"a.rollno",
				"grp":"a.rollno,b.stuname,a.subject,a.type",
				"header":"Roll No.,Name,Subject,Exam Type,Count",
				"whr":"subject='||subject||' and type='||type||'",
				"having":"cnt>1"
			}
			
		},{
			"id":"31ccl",
			"name":"CCL Student Mark (Duplicate Entries-Details)",
			"sql":{
				"action":"Get Table",
				"output":"#workareaAppendix",
				"tbl":"nbbi_cclmark a",
				"join":"INNER JOIN nbbi_cclstudent b ON a.rollno=b.rollno",
				"fld":"a.rollno,b.stuname,a.subject,a.type,mark",
				"functionfield":[
					{
						"type":"icon",
						"class":"mif-cross fg-blue",
						"onclick":"Eirene.currentelem=$(this).parent().parent();Eirene.runStmt('31ccm',{ID:'<a.id>'});",
						"caption":"DeleteMark"
					}
				],
				"srt":"a.rollno",				
				"header":"Roll No.,Name,Subject,Exam Type,Mark",
				"whr":"a.subject='||subject||' and a.type='||type||' and a.rollno=||rollno||",
				"onsuccess":"cmd:dom,fun:show;#workareaAppendix"
				
			}
			
		},{
			"id":"31ccm",
			"name":"Delete Student Mark (From Duplicate Entries)",
			"sql":{
				"action":"Delete Row Permanently",	
				"outputto":"php",
				"tbl":"nbbi_cclmark",				
				"whr":"id='||ID||'",
				"onsuccess":"cmd:dom,fun:showtoast;success;Delete Successful-cmd:dom,fun:hide;current",
				"onfailure":"cmd:dom,fun:showtoast;alert;Delete Failed"				
			}
			
		},{
			"id":"31ccn",
			"name":"Get CCL Term Result",
			"sql":{
				"action":"Get Matrix",	
				"outputto":"html",
				"output":"#workareaTablebox",
				"class":"eirene-table dataTable",
				"tbl":"nbbi_cclmark a",
				"fld":"a.rollno,b.stuname,c.subject,IF(SUM(a.mark)<40,CONCAT('<span class=&apos;fg-red&apos;>',SUM(a.mark),'</span>'),SUM(a.mark)) as mark",
				"join":[
					"INNER JOIN nbbi_cclstudent b ON a.rollno=b.rollno",
					"INNER JOIN nbbi_cclsubject c ON a.subject=c.id"
				],
				"header":"Roll No,Stu Name,Subject,Mark",
				"whr":"c.term=||term||",
				"srt":"a.rollno,c.subject,type",
				"grp":"a.rollno,b.stuname,c.subject",
				"row":"rollno",
				"col":"subject",
				"val":"mark",
				"additionalcol":"stuname"						
			}
			
		},{
			"id":"31cclk",
			"name":"CCL Notes",
			"sql":{
				"action":"Get Table","validate":"none",
				"output":"table",
				"tbl":"nbbi_links",				
				"fld":"lname",
				"functionfield":[
					{
						"if": "link != ''",
						"type": "googlelink",
						"href": "<link>",
						"value": "Link",
						"target": "_blank",							
						"caption":"Link"
					}
				],				
				"header":"Name",
				"whr":"recordstatus=1 and lname like '%notes%' and taskid='b734458c-1228-11ed-91b8-525400a09ba1' and linktype='PDF'"
			}
			
		},{
			"id":"31ccll",
			"name":"Upload Marks from CSV",
			"sql":{
				"action":"Save Row From CSV",
				"outputto":"php","output":"res",
				"tbl":"nbbi_cclmark",
				"fld":"id,subject,type,rollno,mark,createdby",
				"value":"UUID(),'||course||','||type||',||0||,||1||,'||USERID||'",
				"csvstring":"||csv||",
				"onsuccess":"cmd:dom,fun:showtoast;success;Saving Successful",
				"onfailure":"cmd:dom,fun:showtoast;alert;Saving Failed"
			}
		},{
			"id":"31cclo",
			"name":"CCL Subject Consolidate Marks",
			"sql":{
				"action":"Get Matrix","output":"#workareaTablebox",
				"class":"dataTable",
				"tbl":"nbbi_cclstudent c",				
				"fld":"c.rollno,a.type,a.mark",
				"join":[
					"LEFT JOIN (select rollno,type,mark,b.subject from nbbi_cclmark a1 INNER JOIN nbbi_cclsubject b ON a1.subject=b.id where a1.subject='||subjectid||') a ON a.rollno=c.rollno"
				],				
				"srt":"c.rollno",
				"row":"rollno",
				"col":"type",
				"val":"mark",				
				"hsum":true				
			}
		},{
			"id":"32tem1",
			"name":"Report Template List",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table",
				"formname":"nbbi_reporttemplate",
				"tbl":"nbbi_reporttemplate",
				"fld":"templatename,color1,color2,color3",
				"functionfield":[
					{
						"type": "edit"			
					},{
						"type": "delete"						
					}
				],
				"whr":"recordstatus=1",
				"header":"Name,Color1,Color2,Color3"				
			}
		},{
			"id":"32tem5",
			"name":"Template Filter",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"res",
				"value":"",
				"elem":{
					"outputto":"html","output":"#workareaFilter1",
					"elem":[
						{
							"name":"32tem5-1",
							"id":"32tem5-1",
							"type":"button",
							"value":"",
							"class":"mif-plus fg-red p-2",
							"title":"Add Template",
							"onclick":"showForm('nbbi_reporttemplate 1')"
						}
					]
				}
			}
		},{
			"id":"33fun1",
			"name":"Copy checklist from parent task to sub task",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"res",
				"value":[
					"",					
					{
						"if":"||ID|| = BLANK and ||taskid|| != BLANK",
						"then":{
							"sqlstatement":{
								"a":"create temporary table temp_checklist (checklistname varchar(50))",
								"b":"INSERT INTO temp_checklist (checklistname) SELECT checklistname FROM nbbi_checklist WHERE taskid='||taskid||'",
								"c":"INSERT INTO nbbi_checklist (id,checklistname,remark,link,createdby,taskid) SELECT UUID(),checklistname,'','','||userid||','||lastinsertid||' FROM temp_checklist",
								"d":"create temporary table temp_taskreportelem (item varchar(100),porder tinyint,class varchar(200),style varchar(1000),otherjson varchar(2000))",
								"e":"INSERT INTO temp_taskreportelem (item,porder,class,style,otherjson) SELECT item,porder,class,style,otherjson FROM nbbi_taskreportelem WHERE taskid='||taskid||'",
								"f":"INSERT INTO nbbi_taskreportelem (id,createdby,taskid,item,porder,class,style,otherjson) SELECT UUID(),'||userid||','||lastinsertid||',item,porder,class,style,otherjson FROM temp_taskreportelem"
							}
						}
					}
				]
			}
		},{
			"id":"34trep",
			"name":"Print Task Report",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"res",
				"value":[
					{
						"sqlstatement":{
							"a":"SELECT count(*) FROM nbbi_taskreportelem WHERE taskid='||taskid||'"
						}
					}
				],
				"onsuccess":{"if":"||GET_a|| > 0","then":"34tre0-34tre1-34tre2","else":"1tkpr1-1tkprt"}
				
			}
			
		},{
			"id":"34tre0",
			"name":"Print task report - featured content",
			"sql":{
				"action":"MULTISTMT",
				"outputto":"php","output":"res",
				"multistmt":[
					{
						"action":"Get Row",
						"outputto":"php",
						"output":"taskrow",
						"tbl":"nbbi_tasks a",
						"whr":"a.id='||taskid||'",
						"join":"LEFT JOIN nbbi_contacts b ON a.contact=b.id",
						"fld":"a.task,a.description,a.imagecount,CONCAT('col',a.imagecolumn) imagecolumn,imagecolumn as imagecolumn1,a.template,a.estimatedbudget,CONCAT(b.contactname,IF(b.organization is not null or b.organization !='',CONCAT(' (Company:',b.organization,')'),''),IF(b.gst is not null or b.gst !='',CONCAT(' (GST:',b.gst,')'),'')) contactname,b.district,IF(b.pan is not null and b.pan !='',CONCAT(' bearing PAN NO. ',b.pan),'')as pan,IF(b.mobile !='',CONCAT(' Mobile No. ',b.mobile),'') mobile,DATE_FORMAT(a.beginningdate,'%d-%m-%Y')as bdate,DATE_FORMAT(a.enddate,'%d-%m-%Y') as edate,featuredcontent1,featuredcontent2,featuredcontent3,pagebackgroundcolor"
					},{
						"action":"Get Row",
						"outputto":"php","output":"featuredcontent1",						
						"tbl":"nbbi_journal",
						"fld":"title,remark",
						"whr":"id='||GET_taskrow_featuredcontent1||'",
						"union":" UNION SELECT checklistname AS title,remark FROM nbbi_checklist where id='||GET_taskrow_featuredcontent1||'",
						"limit":"1"
					},{
						"action":"Get Row",
						"outputto":"php","output":"featuredcontent2",						
						"tbl":"nbbi_journal",
						"fld":"title,remark",
						"whr":"id='||GET_taskrow_featuredcontent2||'",
						"union":" UNION SELECT checklistname AS title,remark FROM nbbi_checklist where id='||GET_taskrow_featuredcontent2||'",
						"limit":"1"
					},{
						"action":"Get Row",
						"outputto":"php","output":"featuredcontent3",						
						"tbl":"nbbi_journal",
						"fld":"title,remark",
						"whr":"id='||GET_taskrow_featuredcontent3||'",
						"union":" UNION SELECT checklistname AS title,remark FROM nbbi_checklist where id='||GET_taskrow_featuredcontent3||'",
						"limit":"1"
					}
				]
			}
		
		},{
			"id":"34tre1",
			"name":"Get Task Report Template Colors",
			"sql":{
				"action":"Get Row","outputto":"php","output":"template",				
				"validate":"none",				
				"tbl":"nbbi_reporttemplate",
				"fld":"color1,color2,color3",
				"whr":[					
					{"if":"||template|| != BLANK","then":"id='||template||'","else":"id='||GET_taskrow_template||'"}
				],
				"onsuccess":[
					"cmd:dom,fun:jqueryfunction;$('.templatecolor1').css('background&dash&color'&comma&'||GET_template_color1||')",
					"cmd:dom,fun:jqueryfunction;$('.templatecolor2').css('background&dash&color'&comma&'||GET_template_color2||')",
					"cmd:dom,fun:jqueryfunction;$('.templatecolor3').css('background&dash&color'&comma&'||GET_template_color3||')"
				]
			}
		},{
			"id":"34tre2",
			"name":"Get Report Template",
			"sql":{
				"action":"Get HTML",
				"outputto":"html","output":"#workareaAppendix",
				"tbl":"nbbi_taskreportelem",
				"fld":"REPLACE(item,' ','_') as item,class,style,otherjson",
				"whr":"taskid='||taskid||'",
				"srt":"porder",
				"prepend":[
					"<div>",
						"<a href='#print'>",
							"<span class='mif-printer fg-blue' onclick='printHTML(&apos;printarea&apos;)'></span>",
						"</a>",						
						{"elem":
							{"parent":"div",
								"elem":[
									{"name":"r","type":"return","value":"<h3>Settings</h3>"},
									{"name":"r-0","id":"r-0","class":"mr-2","label":"Template","type":"select","selectedvalue":"||GET_taskrow_template||","option":"select id,templatename from nbbi_reporttemplate order by templatename","onchange":"Eirene.runStmt('tksv-34tre1',{ID:'||taskid||',template:$(this).val()})"},
									{"name":"r-1","id":"r-1","class":"mr-2","label":"Background colour","type":"text","value":"||GET_taskrow_pagebackgroundcolor||","onblur":"Eirene.runStmt('tksv',{taskid:'||taskid||',bg:$(this).val()});$('#printarea').css('background-color',$(this).val())"}									
								]
							}
						},									
					"</div>",
					"<div id='printarea' style='width:21cm;padding:1.5cm;'>",
					"<div style='background-color:||GET_taskrow_pagebackgroundcolor||'>"
				],				
				"template":{
					"case":"||item||",					
					"Featured_Image":[
							{"sqlstatement":{"featuredimage1":"SELECT CONCAT('http://drive.google.com/uc?export=view&id=',link) link from nbbi_links where taskid='||taskid||' and linktype='Featured Image1' LIMIT 1"}},
							"<div>",
							"<img src='||GET_featuredimage1||'",
							{"if":"||class|| != BLANK","then":" class='||class||'"},
							{"if":"||style|| != BLANK","then":" style='||style||'","else":" style='width:100%;'"},
							"></div>"
					],
					"Title":[
							"<div",
							{"if":"||class|| != BLANK","then":" class='||class||'","else":" class='font-Ubuntu-Bold'"},
							{"if":"||style|| != BLANK","then":" style='||style||'","else":" style='color:white;margin-top:-100px;margin-left:20px;font-size:25pt'"},
							">||GET_taskrow_task||</div>"
					],
					"Heading":[
							"<h5",
							{"if":"||class|| != BLANK","then":" class='templatecolor3 ||class||'","else":" class='templatecolor3 font-Ubuntu-Bold'"},
							{"if":"||style|| != BLANK","then":" style='margin-top:20px;background-color:||GET_template_color3||;padding:5px;color:white;||style||'","else":" style='color:white;padding:5px;margin-top:20px;background-color:||GET_template_color3||;'"},
							">||otherjson||</h5>"
					],
					"Text_Block":[							
							"<div",
							{"if":"||class|| != BLANK","then":" class='p-2 templatecolor1 ||class||'","else":" class='font-Ubuntu-Regular templatecolor1'"},
							{"if":"||style|| != BLANK","then":" style='padding:20px;||style||'","else":" style='padding:20px; background-color:||GET_template_color1||;color:black;margin-top:10px;font-size:11pt'"},
							">||otherjson||</div>"
					],
					"Featured_Content_and_Description":[
						{"sqlstatement":{"featuredimage2":"SELECT CONCAT('http://drive.google.com/uc?export=view&id=',link) link from nbbi_links where taskid='||taskid||' and linktype='Featured Image2' LIMIT 1"}},
						"<div style='height:6cm;background-color:||GET_template_color1||;align:justify;padding:1cm;padding:0.5cm;",
						{"if":"||style|| != BLANK","then":"||style||"},
						"'",
						{"if":"||class|| != BLANK","then":" class='templatecolor1 ||class||'","else":" class='templatecolor1'"},
						">",
							"<table border='0' style='border-collapse:collapse'>",
								"<tr>",
									"<td style='width:75%;padding:0.5cm;height:4cm'><span style='font-size:10pt'>||GET_taskrow_description||</span></td>",
									"<td style='background-image:url(&apos;",
										{"if":"||GET_featuredimage2||","value":"BLANK","then":"||GET_featuredimage1||","else":"||GET_featuredimage2||"},
									"&apos;);background-size:cover'></td>",
								"</tr>",
							"</table>",
						"</div>"
					],
					"Featured_Post":"<div style='margin-top:30px;'><table style='border-collapse:collapse' border='0'><tr><td style='width:33%;padding:1cm;vertical-align:middle;background-color:||GET_template_color1||;text-align:center' class='templatecolor1'>01<br><h4>||GET_featuredcontent1_title||</h4><br><div style='font-size:10pt'>||GET_featuredcontent1_remark||</div></td><td style='padding:1cm;vertical-align:middle;background-color:||GET_template_color2||;color:white;text-align:center;width:33%;'  class='templatecolor2'>02<br><h4>||GET_featuredcontent2_title||</h4><br><div style='font-size:10pt'>||GET_featuredcontent2_remark||</div></td><td style='padding:1cm;vertical-align:middle;background-color:||GET_template_color3||;color:white;text-align:center;width:33%;'  class='templatecolor3'>03<h4>||GET_featuredcontent3_title||</h4><br><div style='font-size:10pt'>||GET_featuredcontent3_remark||</div> </td></tr></table></div>",
					"Finance":[
						{"call":"20","output":"paymenttable"},
						{"localvalue":{"a":"{||otherjson||}"}},
						"<div",
						{"if":"||style|| != BLANK","then":" style='margin-top:30px;||style||;'","else":" style='margin-top:30px;'"},
						{"if":"||class|| != BLANK","then":" class='||class||'"},
						"><h5 class='templatecolor3' style='background-color:||GET_template_color3||;color:white;padding:5px'>",
						{"if":"||heading|| != BLANK","then":"||heading||","else":"Payment"},
						"</h5>",
						"||GET_paymenttable||</div>"
					],
					"Image":[
						{"localvalue":{"a":"{||otherjson||}"}},
						{"sqlstatement":{"imgsrc":"SELECT CONCAT('http://drive.google.com/uc?export=view&id=',link) lnk FROM nbbi_links WHERE taskid='||taskid||' and linktype ='Image' AND porder='||imgid||'"}},
						"<div style='margin-top:30px;'>",
						{"if":"||heading|| != BLANK","then":"<h5 class='templatecolor3' style='background-color:||GET_template_color3||;color:white;padding:5px'>||heading||</h5>","else":""},
						"<img ",
						{"if":"||style|| != BLANK","then":" style='||style||'"},
						{"if":"||class|| != BLANK","then":" class='||class||'"},
						"src='||GET_imgsrc||'/>",
						{"if":"||caption|| != BLANK","then":"<p>||caption||</p>","else":""},
						"</div>"
					],
					"Image_Gallery":[
						{"call":"34tre3"},						
						{"if":"||heading|| != BLANK","then":"<h5 class='templatecolor3' style='background-color:||GET_template_color3||;color:white;padding:5px'>||heading||</h5>","else":""},
						"<div style='margin-top:30px;'>||GET_taskimages||</div>"
					],
					"Journals":[
						{"call":"22","srt":"jdate"},
						{"localvalue":{"a":"{||otherjson||}"}},
						"<div style='margin-top:30px;",
						{"if":"||style|| != BLANK","then":"||style||"},
						{"if":"||class|| != BLANK","then":" class='||class||'"},
						"'><h5 class='templatecolor3' style='background-color:||GET_template_color3||;;color:white;padding:5px'>",
						{"if":"||heading|| != BLANK","then":"||heading||","else":"Journal"},
						"</h5>||GET_journal||</div>"
					],
					"Checklist":[
						{"call":"33tbl","outputto":"php","output":"checklist","header":"Item,Remark,Link"},
						{"localvalue":{"a":"{||otherjson||}"}},
						"<div style='margin-top:30px;",
						{"if":"||style|| != BLANK","then":"||style||"},
						{"if":"||class|| != BLANK","then":" class='||class||'"},
						"'><h5 class='templatecolor3' style='background-color:||GET_template_color3||;;color:white;padding:5px'>",
						{"if":"||heading|| != BLANK","then":"||heading||","else":"Checklist"},
						"</h5>||GET_checklist||</div>"
					],
					"PDF":[
						{"call":"21","onlypdf":"true","output":"pdfdocument"},
						{"localvalue":{"a":"{||otherjson||}"}},
						"<div style='margin-top:30px;",
						{"if":"||style|| != BLANK","then":"||style||"},
						{"if":"||class|| != BLANK","then":" class='||class||'"},
						"'><h5 class='templatecolor3' style='background-color:||GET_template_color3||;color:white;padding:5px'>",
						{"if":"||heading|| != BLANK","then":"||heading||","else":"PDF Document"},
						"</h5>||GET_pdfdocument||</div>"
					]
				},
				"append":"</div></div>",
				
				"onsuccess":"cmd:dom,fun:show;#workareaAppendix;-cmd:dom,fun:scrollinview;printarea"
			}
		},{
			"id":"34tre3",
			"name":"Get Task Report - Image",
			"sql":{
				"action": "Get HTML",
				"outputto": "php",
				"output": "taskimages",					
				"tbl": [
					"nbbi_links",
					{"localvalue":{"a":"{||otherjson||}"}}
				],
				"fld": "CONCAT('http://drive.google.com/uc?export=view&id=',link) lnk",
				"whr":[
					"taskid='||taskid||' and linktype ='Image'",
					{"if":"||imgid|| != BLANK","then":" and porder IN (||imgid||)"}
				],							
				"parent":"div style='display:flex;flex-flow:row wrap;page-break-before: always;'",
				"template":["<div style='width:",
							{"if":"||columns|| = BLANK","then":{"localvalue":{"columns":"||GET_taskrow_imagecolumn||"}}},
							{"case":"||columns||","col1":"100%","col2":"50%","col3":"33%","col4":"25%","1":"100%","2":"50%","3":"33%","4":"25%"},									
							";padding:0.15cm;overflow:hidden'><img loading='lazy' src='||lnk||' style='width:100%;'></div>"
				]
			}
		},
		{
			"id":"35lt",
			"name":"Department List",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table",
				"formname":"nbbi_department",
				"tbl":"nbbi_department a",
				"join":[
					"INNER JOIN eirene_users b ON a.assignedto=b.id",
					"LEFT JOIN (select department,count(*) as taskcnt from nbbi_tasks WHERE status<4 group by department) c ON c.department=a.id",
					"LEFT JOIN (select f.id,count(*) as plancnt from nbbi_plan d inner join nbbi_tasks e ON d.taskid=e.id INNER JOIN nbbi_department f ON e.department=f.id where d.status=0 group by f.departmentname) g ON g.id=a.id"
				],				
				"fld":[
					"a.departmentname,b.fullname",
					"CONCAT('<a href=&apos;#&apos; onclick=&apos;Eirene.runStmt(&apos;1tklst&apos;,{includesubtask:1,department:&apos;',a.id,'&apos;,displayoutput:&apos;#workareaAppendix&apos;})&apos;>',c.taskcnt,'</a>') as cnt,CONCAT('<a href=&apos;#&apos; onclick=&apos;Eirene.runStmt(&apos;35pln&apos;,{department:&apos;',a.id,'&apos;})&apos;>',g.plancnt,'</a>') as plncnt"
				],
				"grp":"a.departmentname,b.fullname",
				"union":"UNION ALL select '','',count(*) as taskcnt,'','' from nbbi_tasks WHERE status<4",
				"functionfield":[
					{
 						"type": "group",
 						"caption": "Function",
						"grp":[
							{"type":"edit"},
							{"type":"delete"}								
						]
					}
				],
				"header":"Department,Assigned To,Active Tasks,Active Plan",
				"whr":"a.recordstatus=1"
			}
		},{
			"id":"35pln",
			"name":"Plan List",
			"sql":{
				"action":"Get Table","output":"#workareaAppendix",
				"tbl":"nbbi_plan d",
				"fld":"e.task,d.people,d.plan,d.datefrom,d.dateto",
				"join":[
					"inner join nbbi_tasks e ON d.taskid=e.id",
					"INNER JOIN nbbi_department f ON e.department=f.id"
				],
				"functionfield":[
					{
						"name":"35plnchk",
						"type":"switch",
						"value":"<d.status>",
						"onchange":"let status=0;if($(this).prop('checked')){status=1;}Eirene.runStmt('22b1sv',{status:status,ID:'<d.id>'})",						
						"title":"Save"
					}
				],
				"header":"Task,People,Plan,From,To,Function",
				"datefield":"d.datefrom,d.dateto",
				"whr":"d.status=0 and e.department='||department||'",
				"onsuccess":"cmd:dom,fun:function;datatable;#workareaAppendix"
			}
		},{
			"id":"35flt",
			"name":"Filter Project",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"res",
				"value":"",
				"elem":[
					{
						"outputto":"html","output":"#workareaFilter1",
						"elem":[
							{
								"name":"35fltb1",
								"id":"35fltb1",
								"type":"buttonspan",
								"icon":"mif-plus",
								"value":" Department",
								"onclick":"showForm('nbbi_department 1')"
							}
						]
					}
				],
				"onsuccess":"cmd:dom,fun:show;#workareaFilter1"
			}
		},{
			"id":"36chkm",
			"name":"Checklist Matrix",
			"sql":{
				"action":"Get Matrix",
				"outputto":"html","output": "#checklistmatrix",
 				"prepend": "<div class='mt-4' style='padding:20px 10px;background-color:#eef5f9;border-radius:10px;'><div>Checklist Summary</div>",
 				"append":"</div>",				
 				"appendoutput":1,
				"tbl":[
					"nbbi_checklist a"				
				],				
				"join":[
					"INNER JOIN nbbi_tasks b ON a.taskid=b.id",
					"INNER JOIN nbbi_tasks c ON b.taskid=c.id"
				],
				"fld":"b.task,a.checklistname,IF(a.link<>'',CONCAT('<a target=_blank href=http://drive.google.com/uc?export=view&id=',a.link,'>',a.remark,'</a>'),a.remark) as rem",
				"class":"eirene-table dataTable",
				"whr":"c.id='||TID||'",
				"srt":"a.createdon",
				"col":"checklistname","row":"task","val":"rem"				
			}
		},
		{
			"id":"37",
			"name":"Project Management",
			"sql":{
				"action":"Return","outputto":"html","output":"#workareaAppendix",
				"value":[
					{"call":"37ben","outputto":"php","output":"benlist","getform":"nbbi_beneficiary 1"},
					{"call":"37stf","outputto":"php","output":"stafflist","getform":"nbbi_beneficiary 2"},
					{"call":"astlt","outputto":"php","output":"assetlist"},
					{"call":"ndlt","outputto":"php","output":"needlist"},					
					"<div class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'>||GET_benlist||</div>",
					"<div class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'>||GET_stafflist||</div>",
					"<div class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'>||GET_assetlist||</div>",
					"<div class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'>||GET_needlist||</div>",
					"<div class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'>||GET_financelist||</div>",
					"<script>datatable('#workareaAppendix')</script>"
				],
				"onsuccess":"cmd:dom,fun:show;#workareaAppendix"
			}
		},{
			"id":"skot1",
			"name":"Run Commands After Stock Out",
			"sql":{
				"action":"Return","outputto":"html","output":"#workareaAppendix",
				"value":[					
					{"sqlstatement":
						{
							"a":"SELECT SUM(quantity) FROM nbbi_stockout where stockinid='||stockinid||'",
							"b":"UPDATE nbbi_stockin SET remainingquantity=quantity-||GET_a|| WHERE id='||stockinid||'"
						}
					}					
				]
			}
		}		
	]
 }