 {
 	"pluginname": "NBBI Management",
 	"systemplugin": "0",
	"iswebsite":0,
 	"version": "1.0",
 	"icon": "mif-books fg-green",
 	"table_def": [
		{
			"name":"nbbi_project",
			"saveid":"35sv",
			"getid":"35gt",
			"delid":"35dt",
			"form":{
				"1":{"title":"Project","formtype": "2 Columns","icon": "mif-dashboard","saveButton":true,"cancelButton":true,"fields":"projectname,assignedto"}
			},
			"fields":[				
				{"name": "projectname","type": "varchar(50)","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","formtype": "Horizontal","icon": "mif-books","saveButton":true,"cancelButton":true,"fields":"beneficiaryname,beneficiarynumber,dateofadmission,beneficiaryclass,beneficiaryyear,dob,gender,father,address,city,state,mobilenumber,email,mothertongue"}
			},
			"fields":[
				{"name":"beneficiaryname","type":"varchar(50)","label":"Name"},
				{"name":"beneficiarynumber","type":"int","label":"Roll Number"},
				{"name":"dateofadmission","type":"date","label":"Admission Date"},
				{"name":"beneficiaryclass","type":"varchar(15)","option":"C.Th.,Dip.Th.,B.Th.,M.Div.,CCL,B.Th. Online,M.Div Online,School","label":"Course"},
				{"name":"beneficiaryyear","type":"tinyint","option":"1,2,3,4,5,6,7,8,9,10,11,12","label":"Year"},
				{"name":"dob","type":"date","label":"Date of Birth"},
				{"name":"gender","type":"varchar(6)","option":"Male,Female","label":"Gender"},
				{"name":"father","type":"varchar(20)","label":"Father/Mother"},
				{"name":"address","type":"varchar(100)","label":"Address"},
				{"name":"city","type":"varchar(20)","label":"City"},
				{"name":"state","type":"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","type":"int","label":"Mobile Number"},
				{"name":"email","type":"varchar(50)","label":"Email"},
				{"name":"mothertongue","type":"varchar(20)","label":"Mother Tongue"},
				{"name":"status","type":"tinyint","label":"Status"}
			]
		},
		{
			"name": "nbbi_checklist",
			"saveid":"33sv",
			"getid":"33gt",
			"delid":"33dt",
			"form":{
				"1":{"title":"Checklist","formtype": "2 Columns","icon": "mif-dashboard","saveButton":true,"cancelButton":true,"fields":"checklistname,remark,link,taskid"},
				"2":{"title":"Checklist","formtype": "Inline Form","icon": "mif-dashboard","saveButton":true,"fields":"checklistname,remark,link,taskid"}
			},
 			"fields": [
				{
 					"name": "checklistname",
 					"type": "varchar(50)",
					"label":"Checklist Name"
 				},{
 					"name": "remark",
 					"type": "varchar(300)",
					"other":"NOT NULL DEFAULT ''",
					"label":"Remark"
 				},{
 					"name": "link",
 					"type": "varchar(50)",
					"other":"NOT NULL DEFAULT ''",
					"label":"Link"
 				},{
 					"name": "taskid",
 					"type": "char(36)",
					"fieldtype":"hidden",
					"label":"Task ID"
 				}
			]
		},
		{
			"name": "nbbi_reporttemplate",
			"saveid":"32tem2",
			"getid":"32tem4",
			"delpermanentid":"32tem3",
			"form":{
				"1":{"title":"Report Template","formtype": "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_communication",
			"saveid":"22b1sv",
			"getid":"22b1gt",
			"delpermanentid":"22b1dt",
			"form":{
				"1":{"title":"Planner","formtype": "Inline Form","icon": "mif-dashboard","saveButton":true,"cancelButton":true,"fields":"taskid,datefrom,dateto,people,communication"}
			},
 			"fields": [
				{
 					"name": "taskid",
 					"type": "char(36)",
					"fieldtype":"hidden",
					"label":"Task ID"
 				},{
 					"name": "datefrom",
 					"type": "date",
					"other":"NOT NULL DEFAULT '0000-00-00'",
					"label":"Date From"
 				},{
 					"name": "dateto",
 					"type": "date",
					"other":"NOT NULL DEFAULT '0000-00-00'",
					"label":"Date To"
 				},{
 					"name": "people",
 					"type": "varchar(60)",
					"label":"People"					
 				},{
 					"name": "communication",
 					"type": "varchar(300)",
					"label":"Communication"
 				},{
					"name":"status",
					"type":"tinyint",
					"other":"NOT NULL DEFAULT 0",
					"label":"Status"
				}
			]
		},
		{
			"name": "nbbi_query",
			"saveid":"22sv",
			"getid":"22gt",
			"delpermanentid":"22dt",
			"form":{
				"1":{"title":"Query","formtype":"Horizontal","icon":"mif-question","saveButton":true,"cancelButton":true,"fields":"taskid,query,response"}
			},
 			"fields": [
				{
 					"name": "taskid",
 					"type": "char(36)",
					"fieldtype":"hidden",
					"label":"Task ID"
 				},{
 					"name": "query",
 					"type": "varchar(300)" ,
					"label":"Query"
 				},{
					"name":"response",
					"type":"varchar(300)",
					"label":"Response"
				}
			]
		},
		{
			"name": "nbbi_cclmark",
			"saveid":"31sv",
			"getid":"31gt",
			"delpermanentid":"31dt",
			"form":{
				"1":{"title":"Mark","formtype":"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": "enum('Christian Leadership I','Old Testament Survey','Introduction to Bible Characters','Foundation of Christian Faith','Christian Leadership II','New Testament Survey','History of Christianity','Homiletics','Christian Leadership III','Church Planting and Church Growth','Life and Ministry of Paul','Pastoral Care and Pastoral Ministry')",
					"label":"Subject",
					"fieldtype":"select",
					"option":",Christian Leadership I,Old Testament Survey,Introduction to Bible Characters,Foundation of Christian Faith,Christian Leadership II,New Testament Survey,History of Christianity,Homiletics,Christian Leadership III,Church Planting and Church Growth,Life and Ministry of Paul,Pastoral Care and Pastoral Ministry"
 				},{
 					"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",
 			"fields": [
				{
 					"name": "rollno",
 					"type": "smallint unsigned" 					
 				}
			]
		},
		{
			"name":"nbbi_cclstudent",
			"fields":[
				{
					"name":"rollno",
					"type":"smallint 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",
			"form":{
				"1":{"title":"Course Allotment","formtype":"Horizontal","saveButton":true,"cancelButton":true,"fields":"courseid,mode,program,facultyid,term,academicyear,credit"}
			},
 			"fields": [
				{
 					"name": "courseid",
 					"type": "char(36)",
 					"label":"Course ID",
					"fieldtype":"select",
					"option":"select id,title FROM online_course WHERE recordstatus=1"
 				},{
 					"name": "mode",
 					"type": "varchar(50)",
 					"label": "Mode",
					"fieldtype":"select",
					"option":"Residential,Online"
 				},{
 					"name": "program",
 					"type": "varchar(50)",
 					"label":"Program",
					"fieldtype":"select",
					"option":"M.Div.,B.Th.,Dip.Th.,C.Th.,CCL"
 				},{
 					"name": "facultyid",
 					"type": "char(36)",
 					"other": "",
					"fieldtype":"select",
					"option":"select id,fullname from online_course_users WHERE isfaculty=1"
 				},{
 					"name": "term",
 					"type": "tinyint", 					
					"label":"Term"
 				},{
 					"name": "academicyear",
 					"type": "char(7)", 					
					"label":"Academic Year"
 				},{
 					"name": "credit",
 					"type": "tinyint",
 					"label":"Credit"
 				}
			]
		},	
		{
 			"name": "nbbi_tasks",
			"saveid":"tksv",
			"getid":"tkgt",
			"delid":"tkdt",
			"form":{
				"1":{"title":"task","icon":"mif-assignment","formtype":"2 Columns","saveButton":true,"cancelButton":true,"fields":"taskid,task,description,department,beginningdate,enddate,assignedto,remark"}
			},
 			"fields": [
				{
 					"name": "taskid",
 					"type": "char(36)",
 					"other": "",
					"label":"Task ID",
					"fieldtype":"hidden"
 				},
 				{
 					"name": "task",
 					"type": "varchar(300)",
 					"other": "NOT NULL",
					"label":"Task",
					"required":true
 				}, {
 					"name": "description",
 					"type": "varchar(500)",
 					"other": "NOT NULL",
					"label":"Description"
 				}, {
 					"name": "department",
 					"type": "varchar(36)",
 					"other": "NOT NULL",
					"label":"Department",
					"option": "SELECT id,projectname FROM nbbi_project where assignedto='||userid||' and recordstatus=1"
 				}, {
 					"name": "beginningdate",
 					"type": "DATE",
 					"other": "NOT NULL",
					"label":"Date From"
 				}, {
 					"name": "enddate",
 					"type": "DATE",
 					"other": "NOT NULL",
					"label":"Date To"
 				}, {
 					"name": "subtasks",
 					"type": "varchar(500)",
					"label":"Sub Task"
 				}, {
 					"name": "type",
 					"type": "varchar(30)",
					"label":"Type"
 				}, {
 					"name": "assignedto",
 					"type": "varchar(36)",
					"label":"Assigned To",
					"fieldtype":"select",
					"option":"Select id,fullname from eirene_users where recordstatus=1"
 				}, {
 					"name": "status",
 					"type": "tinyint DEFAULT 1",
 					"other": "NOT NULL",
					"label":"Status"
 				}, {
 					"name": "remark",
 					"type": "varchar(300)",
					"label":"Remark"
 				}, {
 					"name": "question",
 					"type": "tinyint",
 					"other": "NOT NULL DEFAULT 0"
 				},{
 					"name": "emails",
 					"type": "varchar(2000)",
					"label":"Collaborators"
 				},{
 					"name": "template",
 					"type": "char(36)",
					"other":"NOT Null DEFAULT 'd43dff48-1ec3-11ed-91b8-525400a09ba1'"
 				},{
 					"name": "submittedbysign",
 					"type": "varchar(4000)"					
 				},{
 					"name": "submittedbyuserid",
 					"type": "char(36)"					
 				},{
 					"name": "submitteddate",
 					"type": "date"					
 				},{
 					"name": "approvedbysign",
 					"type": "varchar(4000)"					
 				},{
 					"name": "approvedbyuserid",
 					"type": "char(36)"				
 				},{
 					"name": "approveddate",
 					"type": "date"					
 				},{
 					"name": "contact",
 					"type": "char(36)"					
 				},{
 					"name": "estimatedbudget",
 					"type": "int",
					"label":"Estimate Budget"
 				},{
 					"name": "featuredcontent1",
 					"type": "varchar(36)"				
 				},{
 					"name": "featuredcontent2",
 					"type": "varchar(36)"					
 				},{
 					"name": "featuredcontent3",
 					"type": "varchar(36)"			
 				},{
 					"name": "imagecount",
 					"type": "tinyint",
					"other":"NOT NULL default 6"
 				},{
 					"name": "imagecolumn",
 					"type": "tinyint",
					"other":"NOT NULL default 3"
 				},{
 					"name": "pagebackgroundcolor",
 					"type": "char(7)",
					"other":"NOT NULL default '#fff'"
 				}
 			]
 		}, 
		{
 			"name": "nbbi_contacts",
			"saveid": "3consv",
 			"getid": "3congt",
 			"delid": "3condt",
			"form":{
				"1":{"title":"Contact","icon":"mif-user","formtype":"2 Columns","fields":"contactname,description,organization,email,mobile,whatsappno,type,bankdetails,mothertongue,district,state,country,pan,gst"}
			},
 			"fields": [{
 				"name": "contactname",
 				"type": "varchar(30)",
 				"other": "NOT NULL",
				"label":"Contact Name"
 			}, {
 				"name": "description",
 				"type": "varchar(500)",
				"label":"Description"
 			}, {
 				"name": "organization",
 				"type": "varchar(50)",
				"label":"Organization/Company"
 			}, {
 				"name": "email",
 				"type": "varchar(50)",
				"label":"Email"
 			}, {
 				"name": "mobile",
 				"type": "varchar(10)",
				"label":"Mobile No."
 			}, {
 				"name": "whatsapp",
 				"type": "varchar(10)",
				"label":"WhatsApp No."
 			}, {
 				"name": "type",
 				"type": "enum('Vendor','Pastor','Christian Leader','Church','Company')",
				"label":"Type"
 			}, {
 				"name": "bankdetails",
 				"type": "varchar(500)",
				"fieldtype":"textarea",
				"label":"Bank Details"
 			}, {
 				"name": "mothertongue",
 				"type": "varchar(20)",
				"label":"Mother Tongue"
 			}, {
 				"name": "district",
 				"type": "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",
 				"type": "varchar(30)",
				"label":"Country"
 			}, {
 				"name": "pan",
 				"type": "char(10)",
				"label":"PAN"
 			}, {
 				"name": "gst",
 				"type": "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","formtype":"Horizontal","saveButton":true,"cancelButton":true,"icon":"mif-money","fields":"paymentdate,taskid,contactid,purpose,amount,bill,pconfirmationlink,remark,chequeno,paymentfrom,paymentmode"}
			},
 			"fields": [{
 					"name": "paymentdate",
 					"type": "date",
 					"other": "NOT NULL",
					"label":"Date"
 				},{
 					"name": "taskid",
 					"type": "char(36)",
 					"other": "NOT NULL",
					"label":"Task ID",
					"fieldtype":"hidden"
 				},
 				{
 					"name": "contactid",
 					"type": "char(36)",
 					"other": "NOT NULL",
					"label":"Payment Made To",
					"fieldtype":"select",
					"option":"SELECT id,contactname FROM nbbi_contacts where recordstatus=1 ORDER BY contactname"
 				},
 				{
 					"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":"hidden"
 				},
 				{
 					"name": "bill",
 					"type": "varchar(150)",
					"label":"Bill"
 				},
 				{
 					"name": "pconfirmationlink",
 					"type": "varchar(150)",
					"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": "nbbi_links",
			"saveid": "21lsv",
 			"getid": "21lgt",
 			"delpermanentid": "21ldt",
			"form":{
				"1":{"title":"Link","formtype":"2 Columns","icon":"mif-link","fields":"lname,link,linktype,taskid,remark,porder"},
				"2":{"title":"Link","formtype":"Inline Form","icon":"mif-link","fields":"lname,link,linktype,taskid,remark,porder"}
			},
 			"fields": [{
 					"name": "lname",
 					"type": "varchar(200)",
 					"other": "NOT NULL",
					"label":"Link Name"
 				},
 				{
 					"name": "link",
 					"type": "varchar(200)",
 					"other": "NOT NULL",
					"label":"Link"
 				},
 				{
 					"name": "linktype",
 					"type": "enum('Image','PDF','Other Document')",
 					"other": "NOT NULL DEFAULT ''",
					"label":"Link Type"
 				},
 				{
 					"name": "taskid",
 					"type": "char(36)",
 					"other": "NOT NULL",
					"fieldtype":"hidden",
					"label":"Task ID"
 				},
 				{
 					"name": "remark",
 					"type": "varchar(100)",
 					"other": "NOT NULL",
					"label":"Remark"
 				},
 				{
 					"name": "porder",
 					"type": "tinyint",
 					"other": "NOT NULL DEFAULT 1",
					"order":"Order"
 				}
 			]
 		},
 		{
 			"name": "nbbi_journal",
			"saveid": "22jsv",
 			"getid": "22gtj",
 			"delpermanentid": "22jdt",
			"form":{
				"1":{"title":"Journal","icon":"mif-note","fieldtype":"Horizontal","fields":"jdate,title,remark,taskid,link"}
			},
 			"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",
 					"type": "char(36)",
 					"other": "NOT NULL",
					"fieldtype":"hidden",
					"label":"Task ID"
 				},
 				{
 					"name": "link",
 					"type": "char(200)",			
					"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","formtype":"Inline Form","fields":"taskid,item,porder,class,style,otherjson"}
			},
 			"fields": [
				{
					"name": "taskid",
					"type":"char(36)",
					"other":"NOT NULL",
					"label":"Task ID",
					"fieldtype":"hidden"
				},
				{
 					"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"
				},{
					"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"
				}
			]
		}
 	],
 	"sqlcommands_oninstall": [],
 	"form": [
		{
 			"name": "nbbiproject",
 			"formtype": "Horizontal",
 			"title": "Project",
 			"icon": "mif-books fg-green",
 			"saveButton": "true",
 			"saveid": "35sv",
 			"getid": "35gt",
 			"delid": "35dt",
			"command":"insertorupdate",
			"tbl":"nbbi_project",
			"fld":"projectname,assignedto",				
			"fldtype":"s,u",
			"value":"||projectname||,||assignedto||",
			"whr":"id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"width": "100%",
 			"field": [
				{
 					"name": "projectname",
 					"label": "Project Name",
					"maxlength":"50",
 					"fieldtype": "s",
 					"type": "text"					
 				},{
 					"name": "assignedto",
 					"label": "Assigned to",
					"maxlength":"50",
 					"fieldtype": "s",
 					"type": "select",
					"option":"SELECT '' as id,'' as fullname union all SELECT id,fullname FROM eirene_users WHERE recordstatus>=1 ORDER BY fullname"					
 				}
			]
		},
		{
 			"name": "reporttemplate",
 			"formtype": "Horizontal",
 			"title": "Report Template",
 			"icon": "mif-books fg-green",
 			"saveButton": "true",
 			"saveid": "32tem2",
 			"getid": "32tem4",
 			"delpermanentid": "32tem3",
			"command":"insertorupdate",
			"tbl":"nbbi_reporttemplate",
			"fld":"templatename,color1,color2,color3",				
			"fldtype":"s,s,s,s",
			"value":"||templatename||,||color1||,||color2||,||color3||",
			"whr":"id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"width": "100%",
 			"field": [
				{
 					"name": "templatename",
 					"label": "Template Name",
					"maxlength":"50",
 					"fieldtype": "s",
 					"type": "text"					
 				},{
 					"name": "color1",
 					"label": "Colour1",
					"maxlength":"7",
 					"fieldtype": "s",
 					"type": "text"					
 				},{
 					"name": "color2",
 					"label": "Colour2",
					"maxlength":"7",
 					"fieldtype": "s",
 					"type": "text"					
 				},{
 					"name": "color3",
 					"label": "Colour3",
					"maxlength":"7",
 					"fieldtype": "s",
 					"type": "text"					
 				}
			]
		},
		{
 			"name": "courseallotment",
 			"formtype": "Default",
 			"title": "Course Allotment",
 			"icon": "mif-books fg-green",
 			"saveButton": "true",
 			"saveid": "26casv",
 			"getid": "26cagt",
 			"delpermanentid": "26cadt",
			"tbl": "nbbi_courseallotment",
			"fld":"courseid,mode,facultyid,term,academicyear,credit,program",
			"fldtype":"u,s,u,n,s,n,s",
			"value":"||courseid||,||mode||,||facultyid||,||term||,||academicyear||,||credit||,||program||",
			"command":"insertorupdate",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"width": "100%",
 			"field": [{
 					"name": "courseid",
 					"label": "Subject",
 					"fieldtype": "s",
 					"type": "select",
					"option":"SELECT id,title FROM online_course where status=1 and institute='NBBI'"
 				},{
 					"name": "mode",
 					"label": "Teaching Mode",
 					"fieldtype": "s",
 					"type": "select",
					"option":",Residential,Online"
 				},{
 					"name": "program",
 					"label": "Program",
 					"fieldtype": "s",
 					"type": "select",
					"option":",Certificate in Theology,Certificate in Leadership,Diploma in Theology,Bachelor of Theology,Master of Divinity"
 				},{
 					"name": "facultyid",
 					"label": "Faculty",
 					"fieldtype": "s",
 					"type": "select",
					"option":"select id,fullname FROM online_course_users WHERE status=1 and isfaculty=1 and linked_to_institution='NBBI'"
 				},{
 					"name": "term",
 					"label": "Term",
 					"fieldtype": "n",
 					"type": "select",
					"option":",1,2,3"
 				},{
 					"name": "credit",
 					"label": "Credit",
 					"fieldtype": "n",
 					"type": "select",
					"option":",1,2,3,4"
 				},{
 					"name": "academicyear",
 					"label": "Academic Year",
 					"fieldtype": "s",
 					"type": "text"					
 				}
			]
		},
		{
 			"name": "task",
 			"formtype": "Default",
 			"title": "Task",
 			"icon": "mif-books fg-green",
 			"saveButton": "true",
 			"saveid": "1tksav",
 			"getid": "1tkget",
			"delpermanentid":"1tkdel",
			"command": "insertorupdate",
			"tbl": "nbbi_tasks",
			"fld": "meetingid,task,description,department,beginningdate,enddate,subtasks,type,assignedto,remark,emails,template,submittedbyuserid,approvedbyuserid,contact,estimatedbudget,imagecount,imagecolumn,status",
			"fldtype": "s,s,s,s,d,d,s,s,u,s,s,s,u,u,u,n,n,n,n",
			"value": "||meetingid||,||task||,||description||,||department||,||beginningdate||,||enddate||,||subtasks||,||type||,||assignedto||,||remark||,||emails||,||template||,||submittedby||,||approvedby||,||contact||,||estimatedbudget||,||imagecount||,||imagecolumn||,||status||",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"width": "100%",
 			"field": [{
 					"name": "meetingid",
 					"label": "Meeting ID",
 					"fieldtype": "s",
 					"type": "hidden"

 				},
 				{
 					"name": "task",
 					"label": "Task",
 					"fieldtype": "s",
 					"type": "text",
 					"required": "Yes",
 					"max": "300"
 				}, {
 					"name": "description",
 					"label": "Description",
 					"fieldtype": "s",
 					"type": "textarea",
 					"required": "Yes",
 					"max": "500"
 				},{
 					"name": "estimatedbudget",
 					"label": "Estimated Budget",
 					"fieldtype": "s",
 					"type": "text",
 					"required": "Yes" 					
 				},{
 					"name": "contact",
 					"label": "Contact",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "select '','' UNION select id,CONCAT(contactname,' (Company: ',organization,')') contactname FROM nbbi_contacts where recordstatus=1" 					
 				}, {
 					"name": "department",
 					"label": "Department",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "SELECT id,projectname FROM nbbi_project where assignedto='||userid||' and recordstatus=1",
 					"required": "Yes"
 				}, {
 					"name": "beginningdate",
 					"label": "Beginning Date",
 					"fieldtype": "s",
 					"type": "datepicker",
 					"required": "Yes",
 					"jsevent": "onchange",
 					"jsfun": "if(!$(&quot;input[name=enddate]&quot;).val())$(&quot;input[name=enddate]&quot;).val($(this).val())"
 				}, {
 					"name": "enddate",
 					"label": "End Date",
 					"fieldtype": "s",
 					"type": "datepicker",
 					"required": "Yes"
 				}, {
 					"name": "subtasks",
 					"label": "Sub Tasks",
 					"fieldtype": "s",
 					"type": "textarea",
 					"max": "500"
 				}, {
 					"name": "type",
 					"label": "Task Type",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "Admin,Residential,Online,CCL,Other"
 				}, {
 					"name": "assignedto",
 					"label": "Assigned to",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "SELECT id,fullname from eirene_users WHERE status>0",
 					"default": "||userid||"
 				}, {
 					"name": "remark",
 					"label": "Remark",
 					"fieldtype": "s",
 					"type": "textarea",
 					"max": "300"
 				}, {
 					"name": "emails",
 					"label": "Collaborator Email Ids (Comma seperated)",
 					"fieldtype": "s",
 					"type": "textarea",
 					"max": "2000"
 				}, {
 					"name": "imagecount",
 					"label": "Images in report",
 					"fieldtype": "n",
 					"type": "number",
					"default":3,
 					"required": 1
 				}, {
 					"name": "imagecolumn",
 					"label": "Image Columns in report",
 					"fieldtype": "n",
 					"type": "select",
					"option":"3,1,2,4",
 					"required": 1
 				}, {
 					"name": "template",
 					"label": "Template",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "SELECT id,templatename FROM nbbi_reporttemplate order by templatename"
 				}, {
 					"name": "submittedby",
 					"label": "Submission By",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "SELECT '','' UNION ALL SELECT id,fullname FROM eirene_users where status>=1 and recordstatus=1"
 				}, {
 					"name": "approvedby",
 					"label": "To be Approved By",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "SELECT '','' UNION ALL SELECT id,fullname FROM eirene_users where status>=1 and recordstatus=1"
 				}
 			]
 		}, {
 			"name": "contact",
 			"formtype": "Default",
 			"title": "Contact",
 			"icon": "mif-user fg-green",
 			"saveButton": "true",
 			"saveid": "3consv",
 			"getid": "3congt",
 			"delid": "3condt",
			"command": "insertorupdate",
			"tbl": "nbbi_contacts",
			"fld": "contactname,description,organization,email,mobile,whatsapp,type,bankdetails,mothertongue,district,state,country,pan,gst",
			"fldtype": "s,s,s,s,s,s,s,s,s,s,s,s,s,s",
			"value": "||name||,||description||,||organization||,||email||,||mobile||,||whatsapp||,||type||,||bankdetails||,||mothertongue||,||district||,||state||,||country||,||pan||,||gst||",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"width": "100%",
 			"field": [{
 				"name": "name",
 				"label": "Contact Name",
 				"fieldtype": "s",
 				"type": "text",
 				"required": 1,
 				"max": "30"
 			}, {
 				"name": "description",
 				"label": "Description",
 				"fieldtype": "s",
 				"type": "textarea",
 				"max": "500"
 			}, {
 				"name": "organization",
 				"label": "Organization/Company",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "50"
 			}, {
 				"name": "email",
 				"label": "Email",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "50"
 			}, {
 				"name": "mobile",
 				"label": "Mobile No.",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "10"
 			}, {
 				"name": "whatsapp",
 				"label": "WhatsApp No.",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "10"
 			}, {
 				"name": "type",
 				"label": "Contact Type",
 				"fieldtype": "s",
 				"type": "select",
 				"option": "Vendor,Pastor,Christian Leader"
 			}, {
 				"name": "bankdetails",
 				"label": "Bank Details",
 				"fieldtype": "s",
 				"type": "textarea",
 				"max": "500"
 			}, {
 				"name": "pan",
 				"label": "PAN",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "10"
 			}, {
 				"name": "gst",
 				"label": "GST",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "20"
 			}, {
 				"name": "mothertongue",
 				"label": "Mother Tongue",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "20"
 			}, {
 				"name": "district",
 				"label": "District",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "30"
 			}, {
 				"name": "state",
 				"label": "State",
 				"fieldtype": "s",
 				"type": "select",
 				"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"
 			}, {
 				"name": "country",
 				"label": "Country",
 				"fieldtype": "s",
 				"type": "select3",
 				"option": "India,Nepal,Bangladesh,USA,Germany,Switzerland,England"
 			}]
 		}, {
 			"name": "rent",
 			"formtype": "Default",
 			"title": "Rent",
 			"icon": "mif-user fg-green",
 			"saveButton": "true",
 			"saveid": "5rntsv",
 			"getid": "5rntgt",
 			"delpermanentid": "5rntdt",
			"command": "insertorupdate",
			"tbl": "niea_rent",
			"fld": "link,tenant,contractsignedby,owner,rentamount,electricityamount,paymode,bankdetails,agreementstartdate,agreementenddate,status,remark",
			"fldtype": "s,s,s,s,n,n,s,s,d,d,n,s",
			"value": "||link||,||tenant||,||contract||,||owner||,||rent||,||electricityamount||,||paymode||,||bankdetails||,||agreementstartdate||,||agreementenddate||,||status||,||remark||",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"width": "100%",
 			"field": [{
 				"name": "tenant",
 				"label": "Tenant Name",
 				"fieldtype": "s",
 				"type": "text",
 				"required": 1,
 				"max": "30"
 			}, {
 				"name": "contract",
 				"label": "Contract Signed By",
 				"fieldtype": "s",
 				"type": "text",
 				"required": 1,
 				"max": "30"
 			}, {
 				"name": "owner",
 				"label": "House Owner Name",
 				"fieldtype": "s",
 				"type": "text",
 				"required": 1,
 				"max": "30"
 			}, {
 				"name": "rent",
 				"label": "House Rent Amount",
 				"fieldtype": "n",
 				"type": "text",
 				"required": 1,
 				"max": "30"
 			}, {
 				"name": "electricityamount",
 				"label": "Electricity Amount",
 				"fieldtype": "n",
 				"type": "text",
 				"required": 1,
 				"max": "30"
 			}, {
 				"name": "paymode",
 				"label": "Payment Mode",
 				"fieldtype": "s",
 				"type": "select",
 				"option": "Cash,Bank Transfer,NEFT Transfer,DD,Cheque,Other",
 				"required": 1
 			}, {
 				"name": "bankdetails",
 				"label": "Bank Details",
 				"fieldtype": "s",
 				"type": "textarea",
 				"required": 1,
 				"max": "500"
 			}, {
 				"name": "agreementstartdate",
 				"label": "Agreement Start Date",
 				"fieldtype": "d",
 				"type": "datepicker",
 				"required": 1
 			}, {
 				"name": "agreementenddate",
 				"label": "Agreement End Date",
 				"fieldtype": "d",
 				"type": "datepicker",
 				"required": 1
 			}, {
 				"name": "status",
 				"label": "Agreement Status",
 				"fieldtype": "n",
 				"type": "select",
 				"required": 1,
 				"option": "0:Inactive,1:Active"
 			}, {
 				"name": "remark",
 				"label": "Remark",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "300"
 			}, {
 				"name": "link",
 				"label": "Agreement Link",
 				"fieldtype": "s",
 				"type": "text",
 				"max": "500"
 			}]
 		},
		{
 			"name": "finance",
 			"formtype": "Default",
 			"title": "Contact",
 			"icon": "mif-dollar2 fg-green",
 			"saveButton": "true",
 			"saveid": "6finsv",
 			"getid": "6fingt",
 			"delpermanentid": "6findt",
			"command": "insertorupdate",
			"tbl": "niea_finance",
			"fld": "taskid,item,quantity,unit,rate",
			"fldtype": "u,s,n,s,n",
			"value": "||taskid||,||item||,||quantity||,||unit||,||rate||",
			"whr":"id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"width": "100%",
 			"field": [{
 				"name": "item",
 				"label": "Item",
 				"fieldtype": "s",
 				"type": "text",
 				"required": 1,
 				"max": "50"
 			}, {
 				"name": "quantity",
 				"label": "Quantity",
 				"fieldtype": "n",
 				"type": "text",
 				"required": 1
 			}, {
 				"name": "unit",
 				"label": "Unit",
 				"fieldtype": "s",
 				"type": "select",
 				"option": "kg,gm,ltr,ml,labourer,pound,km,feet,inch,other",
 				"required": 1
 			}, {
 				"name": "rate",
 				"label": "Rate",
 				"fieldtype": "n",
 				"type": "text",
 				"required": 1
 			}]
 		},
		{
 			"name": "activity",
 			"formtype": "Default",
 			"title": "Activity",
 			"icon": "mif-book fg-green",
 			"saveButton": "true",
 			"saveid": "8actsv",
 			"getid": "8actgt",
 			"delpermanentid": "8actdt",
			"tbl": "nbbi_activites",
			"fld": "activityname,dept,outcome,status",
			"fldtype": "s,s,s,n",
			"command": "insertorupdate",
			"value": "||activityname||,||dept||,||outcome||,||status||",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"width": "100%",
 			"field": [{
 				"name": "activityname",
 				"label": "Activity Name",
 				"fieldtype": "s",
 				"type": "text",
 				"required": 1,
 				"max": "50"
 			}, {
 				"name": "dept",
 				"label": "Department",
 				"fieldtype": "s",
 				"type": "select",
 				"option": "Academic,Spiritual,Ministry",
 				"required": 1,
 				"max": "10"
 			}, {
 				"name": "outcome",
 				"label": "Expected Outcome",
 				"fieldtype": "s",
 				"type": "text",
 				"required": 1,
 				"max": "200"
 			}, {
 				"name": "status",
 				"label": "Status",
 				"fieldtype": "n",
 				"type": "select",
 				"option": "1:Active,0:Inactive",
 				"required": 1
 			}]
 		},
 		{
 			"name": "studentfamily",
 			"formtype": "Default",
 			"title": "Family Details",
 			"icon": "mif-book fg-green",
 			"saveButton": "true",
 			"saveid": "9sfsv",
 			"getid": "9sfgt",
 			"delpermanentid": "9sfdt",
			"tbl": "nbbi_student_family",
			"fld": "stid,name,relationship,dob,baptized,believer,occupation",
			"value": "||sf_userid||,||name||,||relationship||,||dob||,||baptized||,||believer||,||occupation||",
			"fldtype": "s,s,s,s,n,n,s",
			"command": "insertorupdate",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 				"name": "name",
 				"label": "Name",
 				"fieldtype": "s",
 				"type": "text",
 				"required": 1
 			}, {
 				"name": "sf_userid",
 				"label": "userid",
 				"fieldtype": "s",
 				"type": "hidden"
 			}, {
 				"name": "relationship",
 				"label": "Relatioship",
 				"fieldtype": "s",
 				"type": "text",
 				"required": 1
 			}, {
 				"name": "dob",
 				"label": "Date Of Birth",
 				"fieldtype": "s",
 				"type": "datepicker"
 			}, {
 				"name": "baptized",
 				"label": "Baptized",
 				"fieldtype": "s",
 				"type": "select",
 				"option": "0:Yes,1:No"
 			}, {
 				"name": "believer",
 				"label": "Believer",
 				"fieldtype": "s",
 				"type": "select",
 				"option": "0:Yes,1:No"
 			}, {
 				"name": "occupation",
 				"label": "Occupation",
 				"fieldtype": "s",
 				"type": "text"
 			}]

 		}, {
 			"name": "studenteducaton",
 			"formtype": "Default",
 			"title": "Education Details",
 			"icon": "mif-book fg-green",
 			"saveButton": "true",
 			"saveid": "10sesv",
 			"getid": "10segt",
 			"delpermanentid": "10sedt",
			"tbl": "nbbi_student_education",
			"fld": "stid,degree,year,board,result,docpath",
			"value": "||sf_userid||,||degree||,||year||,||board||,||result||,||docpath||",
			"fldtype": "s,s,n,s,s,s",
			"command": "insertorupdate",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "degree",
 					"label": "Degree/Class",
 					"fieldtype": "s",
 					"type": "text",
 					"required": 1
 				},
 				{
 					"name": "sf_userid",
 					"label": "userid",
 					"fieldtype": "s",
 					"type": "hidden"
 				},
 				{
 					"name": "year",
 					"label": "Year",
 					"type": "number",
 					"fieldtype": "n"
 				},
 				{
 					"name": "board",
 					"label": "University/Board",
 					"type": "text",
 					"fieldtype": "s"
 				},

 				{
 					"name": "result",
 					"label": "Result",
 					"type": "text",
 					"fieldtype": "s"
 				},
 				{
 					"name": "docpath",
 					"fieldtype": "s",
 					"type": "file",
 					"label": "Certificate"
 				}
 			]

 		},
 		{
 			"name": "studentreference",
 			"formtype": "Default",
 			"title": "Reference Details",
 			"icon": "mif-book fg-green",
 			"saveButton": "true",
 			"saveid": "11srsv",
 			"getid": "11srgt",
 			"delpermanentid": "11srdt",
			"tbl": "nbbi_student_reference",
			"fld": "stid,name,email,mobile,docpath,remark",
			"value": "||sf_userid||,||name||,||email||,||mobile||,||docpath||,||remark||",
			"fldtype": "s,s,s,n,s,s",
			"command": "insertorupdate",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "name",
 					"label": "Name",
 					"fieldtype": "s",
 					"type": "text",
 					"required": 1
 				},
 				{
 					"name": "sf_userid",
 					"label": "userid",
 					"fieldtype": "s",
 					"type": "hidden"
 				},
 				{
 					"name": "mobile",
 					"label": "Mobile Number",
 					"type": "number",
 					"fieldtype": "n"
 				},
 				{
 					"name": "email",
 					"label": "Email",
 					"type": "text",
 					"fieldtype": "s"
 				},
 				{
 					"name": "docpath",
 					"fieldtype": "s",
 					"type": "file",
 					"label": "Reference Letter"
 				},
 				{
 					"name": "remark",
 					"label": "Remark",
 					"type": "text",
 					"fieldtype": "s"
 				}
 			]

 		},
 		{
 			"name": "studentmarks",
 			"formtype": "Default",
 			"title": "Marks Details",
 			"icon": "mif-book fg-green",
 			"saveButton": "true",
 			"saveid": "12smsv",
 			"getid": "12smgt",
 			"delpermanentid": "12smdt",
			"tbl": "nbbi_student_marks",
			"fld": "stid,subject,credit,year,semester,grade,marks,remark",
			"value": "||sf_userid||,||subject||,||credit||,||year||,||semester||,||grade||,||marks||,||remark||",
			"fldtype": "s,s,n,n,n,s,n,s",
			"command": "insertorupdate",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "subject",
 					"label": "Subject",
 					"fieldtype": "s",
 					"type": "select",
 					"required": 1,
 					"option": "SELECT title FROM online_course"
 				},
 				{
 					"name": "sf_userid",
 					"label": "userid",
 					"fieldtype": "s",
 					"type": "hidden"
 				}, {
 					"name": "credit",
 					"label": "Credit",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "0,1,2,3,4,5"
 				}, {
 					"name": "year",
 					"label": "Year",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "1:1 Year,2:2 Year,3:3 Year"
 				}, {
 					"name": "semester",
 					"label": "Semester",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "1:Semester I,2:Semester II"
 				}, {
 					"name": "grade",
 					"label": "Grade",
 					"fieldtype": "s",
 					"type": "text"
 				}, {
 					"name": "marks",
 					"label": "Mark",
 					"fieldtype": "n",
 					"type": "number"
 				},
 				{
 					"name": "remark",
 					"label": "Remark",
 					"type": "text",
 					"fieldtype": "s"
 				}
 			]

 		},
 		{
 			"name": "studentopportunities",
 			"formtype": "Default",
 			"title": "Student Opportunities",
 			"saveButton": "true",
 			"saveid": "13sosv",
 			"getid": "13sogt",
 			"delpermanentid": "13sodt",
			"tbl": "nbbi_student_opportunities",
			"fld": "stid,opportunityname,category,remark",
			"value": "||sf_userid||,||opportunityname||,||category||,||remark||",
			"fldtype": "s,s,s,s",
			"command": "insertorupdate",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "sf_userid",
 					"label": "userid",
 					"fieldtype": "s",
 					"type": "hidden"
 				},
 				{
 					"name": "opportunityname",
 					"label": "Opportunity Name",
 					"fieldtype": "s",
 					"type": "text",
 					"required": 1
 				},
 				{
 					"name": "category",
 					"label": "Category",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "Academic,Spiritual,Ministry"
 				},
 				{
 					"name": "remark",
 					"label": "Remark",
 					"fieldtype": "text",
 					"type": "text"
 				}
 			]
 		},
 		{
 			"name": "timetable",
 			"formtype": "Horizontal",
 			"title": "Time Table",
 			"saveButton": "true",
 			"saveid": "14ttsv",
 			"getid": "14gttt",
 			"delpermanentid": "14ttdt",
			"tbl": "nbbi_timetable",
			"fld": "subid,day,class,timestart,timeend,facultyid",
			"value": "||subid||,||day||,||class||,||timestart||,||timeend||,||facultyid||",
			"fldtype": "s,n,s,s,s,s",
			"command": "insertorupdate",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "subid",
 					"label": "Subject Name",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "select id,title from online_course where recordstatus=1"
 				},
 				{
 					"name": "class",
 					"label": "Course",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "M.Div I,M.Div II,B.Th I,B.Th II,B.Th III,D.Th I,D.Th II,,C.Th,CBS"
 				},


 				{
 					"name": "day",
 					"label": "Day",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "0:Sun,1:Mon,2:Tue,3:Wend:,4:Thu,5:Fri,6:Sat"
 				},
 				{
 					"name": "timestart",
 					"label": "Starting Time",
 					"fieldtype": "s",
 					"type": "timepicker"
 				},
 				{
 					"name": "timeend",
 					"label": "Ending Time",
 					"fieldtype": "s",
 					"type": "timepicker"
 				},
 				{
 					"name": "facultyid",
 					"label": "Faculty",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "select id,fullname from online_course_users where isfaculty=1"
 				}
 			]
 		},
 		{
 			"name": "institute",
 			"formtype": "Horizontal",
 			"title": "Institute",
 			"saveButton": "true",
 			"saveid": "15itsv",
 			"getid": "15itgt",
 			"delpermanentid": "15itdt",
			"tbl": "nbbi_institute",
			"fld": "institutename,website,briefhistory,stateoffaith,contact",
			"value": "||institutename||,||website||,||briefhistory||,||stateoffaith||,||contact||",
			"fldtype": "s,s,s,s,s",
			"command": "insertorupdate",
			"whr": "id=||ID||",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "institutename",
 					"label": "Institute Name",
 					"fieldtype": "s",
 					"type": "text",
 					"required": "1"
 				},
 				{
 					"name": "website",
 					"label": "Website",
 					"fieldtype": "s",
 					"type": "text"
 				},
 				{
 					"name": "briefhistory",
 					"label": "Brief History",
 					"fieldtype": "s",
 					"type": "textarea"
 				},
 				{
 					"name": "stateoffaith",
 					"label": "State of Faith",
 					"fieldtype": "s",
 					"type": "textarea"
 				},
 				{
 					"name": "contact",
 					"label": "label",
 					"fieldtype": "s",
 					"type": "textarea"
 				}
 			]
 		},
 		{
 			"name": "Online Course Users",
 			"formtype": "Horizontal",
 			"title": "Online Course Users",
 			"icon": "mif-user",
 			"saveButton": true,
 			"saveid": "17svud",
 			"getid": "17gtud",
			"command": "insertorupdate",
			"tbl": "online_course_users",
			"fld": "emailid,fullname,gender,linked_to_institution,district,state,phoneno,alternate_phoneno,whatsappno,recommendedby,admissionyear,isfaculty",
			"fldtype": "s,s,s,s,s,s,s,s,s,s,n,n",
			"value": "||emailid||,||fullname||,||gender||,||linked_to_institution||,||district||,||state||,||phoneno||,||alternate_phoneno||,||whatsappno||,||recommendedby||,||admissionyear||,||isfaculty||",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "emailid",
 					"label": "Email",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "0",
 					"maxlength": "200",
 					"readonly": 1
 				},
 				{
 					"name": "isfaculty",
 					"label": "Is Faculty",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "0:Student,1:Faculty"

 				}, {
 					"name": "fullname",
 					"label": "Full Name",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "0",
 					"maxlength": "100"
 				},
 				{
 					"name": "gender",
 					"label": "Gender",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "Male,Female",

 					"allownull": "0"
 				},
 				{
 					"name": "linked_to_institution",
 					"label": "Linked to Institution",
 					"fieldtype": "s",
 					"type": "select",
 					"option": ":Select,NIBS,NBBI,NIBI,Other",
 					"allownull": "1"
 				},

 				{
 					"name": "district",
 					"label": "District",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "30"
 				},
 				{
 					"name": "state",
 					"label": "State",
 					"fieldtype": "s",
 					"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",

 					"allownull": "1"
 				},
 				{
 					"name": "phoneno",
 					"label": "Phone No (10 digit only)",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "10"
 				},
 				{
 					"name": "alternate_phoneno",
 					"label": "Alternate Phone No (10 digit only)",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "10"
 				},
 				{
 					"name": "whatsappno",
 					"label": "WhatsApp No",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "15"
 				}, {
 					"name": "recommendedby",
 					"label": "Recommended By",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "50"
 				}, {
					"name": "admissionyear",
					"label": "Admission Year",
					"fieldtype": "n",
					"type": "text",				
					"maxlength": "4"
				}
 			]
 		},
 		{
 			"name": "Online Course Users student",
 			"formtype": "Horizontal",
 			"title": "Online Course Users",
 			"icon": "mif-user",
 			"saveButton": true,
 			"saveid": "18sdsv",
 			"getid": "18sdgt",
			"command": "insertorupdate",
			"tbl": "online_course_users",
			"fld": "emailid,fullname,gender,linked_to_institution,linked_to_program,educationmode,district,state,phoneno,alternate_phoneno,whatsappno,recommendedby,isfaculty,admissionyear",
			"fldtype": "s,s,s,s,s,s,s,s,s,s,s,s,n,n",
			"value": "||emailid||,||fullname||,||gender||,||linked_to_institution||,||linked_to_program||,||educationmode||,||district||,||state||,||phoneno||,||alternate_phoneno||,||whatsappno||,||recommendedby||,||isfaculty||,||admissionyear||",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "emailid",
 					"label": "Email",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "0",
 					"maxlength": "200",
 					"readonly": 1
 				},
 				{
 					"name": "isfaculty",
 					"label": "Is Faculty",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "0:Student,1:Faculty"
 				}, {
 					"name": "fullname",
 					"label": "Full Name",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "0",
 					"maxlength": "100"
 				},
 				{
 					"name": "gender",
 					"label": "Gender",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "Male,Female",
 					"allownull": "0"
 				},
 				{
 					"name": "linked_to_institution",
 					"label": "Linked to Institution",
 					"fieldtype": "s",
 					"type": "select",
 					"option": ":Select,NIBS,NBBI,NIBI,Other",
 					"allownull": "1"
 				},
 				{
 					"name": "linked_to_program",
 					"label": "Program of Study",
 					"fieldtype": "s",
 					"type": "select",
 					"option": ":None,Bachelor of Theology,Master of Divinity,Master of Theology,Diploma in Theology,Certificate in Theology",
 					"allownull": "1"
 				}, {
 					"name": "educationmode",
 					"label": "Education Mode",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "Online,Residential",
 					"allownull": "0"
 				},
 				{
 					"name": "district",
 					"label": "District",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "30"
 				},
 				{
 					"name": "state",
 					"label": "District",
 					"fieldtype": "s",
 					"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",
 					"allownull": "1"
 				},
 				{
 					"name": "phoneno",
 					"label": "Phone No (10 digit only)",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "10"
 				},
 				{
 					"name": "alternate_phoneno",
 					"label": "Alternate Phone No (10 digit only)",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "10"
 				},
 				{
 					"name": "whatsappno",
 					"label": "WhatsApp No",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "15"
 				}, {
 					"name": "recommendedby",
 					"label": "Recommended By",
 					"fieldtype": "s",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "50"
 				}, {
 					"name": "admissionyear",
 					"label": "Admission Year",
 					"fieldtype": "n",
 					"type": "text",
 					"allownull": "1",
 					"maxlength": "4"
 				}
 			]
 		},
 		{
 			"name": "meeting",
 			"formtype": "Horizontal",
 			"title": "Meeting Details",
 			"icon": "mif-user",
 			"saveButton": true,
 			"saveid": "19msv",
 			"getid": "19mgt",
 			"delpermanentid": "19mdt",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "mdate",
 					"label": "Date",
 					"fieldtype": "s",
 					"type": "datepicker",
 					"required": true
 				},
 				{
 					"name": "ftime",
 					"label": "From(Time)",
 					"fieldtype": "s",
 					"type": "timepicker"
 				},
 				{
 					"name": "ttime",
 					"label": "To(Time)",
 					"fieldtype": "s",
 					"type": "timepicker"
 				},
 				{
 					"name": "participants",
 					"label": "Participants",
 					"fieldtype": "s",
 					"type": "textarea"
 				},
 				{
 					"name": "platform",
 					"label": "Platform",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "1:Virtual,2:Physical"
 				},
 				{
 					"name": "agenda",
 					"label": "Agenda",
 					"fieldtype": "s",
 					"type": "textarea"
 				},
 				{
 					"name": "outcome",
 					"label": "Outcome",
 					"fieldtype": "s",
 					"type": "textarea"
 				},
 				{
 					"name": "document",
 					"label": "Documents",
 					"type": "text",
 					"fieldtype": "s"
 				}

 			]
 		},
 		{
 			"name": "subtask",
 			"formtype": "Default",
 			"title": "Task",
 			"icon": "mif-books fg-green",
 			"saveButton": "true",
 			"saveid": "23stsv",
 			"getid": "23stgt",
			"command": "insertorupdate",
			"tbl": "nbbi_tasks",
			"fld": "taskid,task,description,department,beginningdate,enddate,subtasks,type,assignedto,remark,emails",
			"fldtype": "s,s,s,s,d,d,s,s,u,s,s",
			"value": "||taskid||,||task||,||description||,||department||,||beginningdate||,||enddate||,||subtasks||,||type||,||assignedto||,||remark||,||emails||",
			"whr": "id='||ID||'",
			"onsuccess":"cmd:dom,fun:showtoast;success;Saving Successful-33fun1",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"width": "100%",
 			"field": [{
 					"name": "taskid",
 					"label": "Task ID",
 					"fieldtype": "s",
 					"type": "hidden"

 				},
 				{
 					"name": "task",
 					"label": "Sub Task",
 					"fieldtype": "s",
 					"type": "text",
 					"required": "Yes",
 					"max": "300"
 				}, {
 					"name": "description",
 					"label": "Description",
 					"fieldtype": "s",
 					"type": "textarea",
 					"required": "Yes",
 					"max": "500"
 				}, {
 					"name": "department",
 					"label": "Department",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "SELECT id,projectname FROM nbbi_project WHERE assignedto='||userid||' and recordstatus=1",
 					"required": "Yes"
 				}, {
 					"name": "beginningdate",
 					"label": "Beginning Date",
 					"fieldtype": "s",
 					"type": "datepicker",
 					"required": "Yes",
 					"jsevent": "onchange",
 					"jsfun": "if(!$(&quot;input[name=enddate]&quot;).val())$(&quot;input[name=enddate]&quot;).val($(this).val())"
 				}, {
 					"name": "enddate",
 					"label": "End Date",
 					"fieldtype": "s",
 					"type": "datepicker",
 					"required": "Yes"
 				}, {
 					"name": "subtasks",
 					"label": "Sub Tasks",
 					"fieldtype": "s",
 					"type": "textarea",
 					"max": "500"
 				}, {
 					"name": "type",
 					"label": "Task Type",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "Event,Class,Activity,Leave,Maintenance,Other"
 				}, {
 					"name": "assignedto",
 					"label": "Assigned to",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "SELECT id,fullname from eirene_users WHERE status>0",
 					"default": "||userid||"
 				}, {
 					"name": "remark",
 					"label": "Remark",
 					"fieldtype": "s",
 					"type": "textarea",
 					"max": "300"
 				}, {
 					"name": "emails",
 					"label": "Collaborator Email Ids (Comma seperated)",
 					"fieldtype": "s",
 					"type": "textarea",
 					"max": "2000"
 				}
 			]
 		},
 		{
 			"name": "payment",
 			"formtype": "Horizontal",
 			"title": "Payment Details",
 			"icon": "mif-user",
 			"saveButton": true,
 			"saveid": "20psv",
 			"getid": "20pgt",
 			"delpermanentid": "20pdt",
			"command": "insertorupdate",				
			"tbl": "nbbi_payments",						
			"fld": "paymentdate,bill,taskid,contactid,purpose,amount,pconfirmationlink,remark,paymentfrom,chequeno,paymentmode",
			"fldtype": "s,g,s,s,s,n,g,s,s,s,s",
			"value": "||paymentdate||,||bill||,||taskid||,||contactid||,||purpose||,||amount||,||pconfirmationlink||,||remark||,||paymentfrom||,||chequeno||,||paymentmode||",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "taskid",
 					"label": "TaskID",
 					"fieldtype": "s",
 					"type": "hidden"
 				},{
 					"name": "paymentdate",
 					"label": "Payment Date",
 					"fieldtype": "s",
 					"type": "datepicker"
 				},
 				{
 					"name": "contactid",
 					"label": "Contact Name",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "select id,CONCAT(contactname,' (Company:',organization,')') contactname from nbbi_contacts where recordstatus=1"
 				},
 				{
 					"name": "purpose",
 					"label": "Purpose",
 					"fieldtype": "s",
 					"type": "text"
 				},
 				{
 					"name": "amount",
 					"label": "Amount",
 					"fieldtype": "n",
 					"type": "number",
 					"required": "1"
 				},
 				{
 					"name": "paymentfrom",
 					"label": "Payment-From",
 					"fieldtype": "s",
 					"type": "text"
 				},
 				{
 					"name": "chequeno",
 					"label": "Cheque No./UTR No.",
 					"fieldtype": "s",
 					"type": "text"
 				},
 				{
 					"name": "paymentmode",
 					"label": "Payment Mode",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "Cash,Internet Banking,UPI,Card,Bank Transfer,Cheque,Demand Draft"
 				},
 				{
 					"name": "bill",
 					"label": "Bill/Invoice",
 					"fieldtype": "s",
 					"type": "text"
 				}, 				
 				{
 					"name": "pconfirmationlink",
 					"label": "Payment Confirmation LInk",
 					"fieldtype": "s",
 					"type": "text"
 				},
 				{
 					"name": "remark",
 					"label": "Remark",
 					"fieldtype": "s",
 					"type": "text"
 				}
 			]
 		},
 		{
 			"name": "links",
 			"formtype": "Horizontal",
 			"title": "Link Details",
 			"icon": "mif-user",
 			"saveButton": true,
 			"saveid": "21lsv",
 			"getid": "21lgt",
 			"delpermanentid": "21ldt",
			"command": "insertorupdate",
			"tbl": "nbbi_links",
			"fld": "taskid,lname,link,remark,linktype,porder",
			"fldtype": "s,s,g,s,s,n",
			"value":[
				"||taskid||",
				"||lname||",
				"||link||",
				"||remark||",
				"||linktype||",
				{"sqlstatement":{"rcnt":"SELECT count(*)+1 FROM nbbi_links WHERE taskid='||taskid||'"}},
				{"if":"||porder||","op":"!=","value":"BLANK","then":"||porder||","else":"||GET_rcnt||"}
			],
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "lname",
 					"label": "Name",
 					"fieldtype": "s",
 					"type": "text",
 					"required": "1"

 				},
 				{
 					"name": "link",
 					"label": "Link",
 					"fieldtype": "s",
 					"type": "text",
 					"required": "1"
 				},{
 					"name": "linktype",
 					"label": "Link Type",
 					"fieldtype": "s",
 					"type": "select",
					"option":"Image,PDF,Word,Excel,Other,Featured Image1,Featured Image2,Featured Image3,Featured Image4",
 					"required": "1"
 				},
 				{
 					"name": "taskid",
 					"label": "TaskiD",
 					"fieldtype": "s",
 					"type": "hidden"
 				},
 				{
 					"name": "remark",
 					"label": "Remark",
 					"fieldtype": "s",
 					"type": "text"
 				},
 				{
 					"name": "porder",
 					"label": "Order",
 					"fieldtype": "n",
 					"type": "number"
 				}
 			]
 		},
 		{
 			"name": "journal",
 			"formtype": "Horizontal",
 			"title": "Journal Details",
 			"icon": "mif-user",
 			"saveButton": true,
 			"saveid": "22jsv",
 			"getid": "22gtj",
 			"delpermanentid": "22jdt",
			"command": "insertorupdate",
			"tbl": "nbbi_journal",
			"fld": "jdate,taskid,title,remark",
			"fldtype": "s,s,s,s",
			"value": "||jdate||,||taskid||,||title||,||remark||",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "jdate",
 					"label": "Date",
 					"fieldtype": "s",
 					"type": "datepicker",
 					"required": "1"
 				},{
 					"name": "title",
 					"label": "Title",
 					"fieldtype": "s",
 					"type": "text",
 					"required": "1"
 				},
 				{
 					"name": "taskid",
 					"label": "TaskiD",
 					"fieldtype": "s",
 					"type": "hidden"
 				},
 				{
 					"name": "remark",
 					"label": "Remark",
 					"fieldtype": "s",
 					"type": "text"
 				},
 				{
 					"name": "updateTable",
 					"label": "updateTable",
 					"fieldtype": "s",
 					"type": "hidden"
					
 				},{
 					"name": "TID",
 					"label": "TID",
 					"fieldtype": "s",
 					"type": "hidden"
 				}
 			]
 		},
 		{
 			"name": "medicalincident",
 			"formtype": "Horizontal",
 			"title": "Medical Incident",
 			"icon": "mif-user",
 			"saveButton": true,
 			"saveid": "25msv",
 			"getid": "25mgt",
 			"delpermanentid": "25mdt",
			"tbl": "nbbi_medical_incidents",
			"fld": "muserid,idate,complaints,vdate,treatment,status",
			"value": "||muserid||,||idate||,||complaints||,||vdate||,||treatment||,||status||",
			"fldtype": "s,s,s,s,s,n",
			"command": "insertorupdate",
			"whr": "id='||ID||'",
 			"cancelButton": "true",
 			"flex_row": "true",
 			"flex_justify": "start",
 			"field": [{
 					"name": "muserid",
 					"type": "select",
 					"fieldtype": "s",
 					"label": "Name",
 					"option": "Select id,fullname from online_course_users where recordstatus=1 and linked_to_institution='NBBI'"
 				}, {
 					"name": "idate",
 					"label": "Date of Medical Incident",
 					"fieldtype": "s",
 					"type": "datepicker",
 					"required": "1"
 				},
 				{
 					"name": "complaints",
 					"label": "Primary Complaints",
 					"fieldtype": "s",
 					"type": "text"
 				},
 				{
 					"name": "vdate",
 					"label": "Date of visiting the Hospital",
 					"fieldtype": "s",
 					"type": "datepicker"
 				},
 				{
 					"name": "treatment",
 					"label": "Treatment",
 					"fieldtype": "s",
 					"type": "text"
 				},
 				{
 					"name": "status",
 					"label": "Current Status",
 					"fieldtype": "s",
 					"type": "select",
 					"option": "0:Sick and Not Attending Class,1:Sick and Attending Class,2:Hospitalized,3:Recovered"
 				}

 			]
 		},
		{
			"name": "Online_Course",
			"formtype": "Horizontal",
			"title": "Online Course",
			"icon": "mif-books fg-green",
			"saveButton": "true",
			"saveid": "27sv",
			"getid": "27gt",
			"command": "insertorupdate",
			"tbl": "online_course",
			"fld": "title,titleprint,subtitle,description,price,department,programlinked,timeneeded,credit,goals,connexionmodel,image_path,authorid,fastforward,owner,language,institute",
			"fldtype": "s,s,s,s,n,s,s,s,n,s,s,s,u,n,u,s,s",
			"whr": "id='||ID||'",
			"value": "||title||,||titleprint||,||subtitle||,||description||,||price||,||department||,||programlinked||,||timeneeded||,||credit||,||goals||,||connexionmodel||,||image_path||,||authorid||,||fastforward||,||owner||,||language||,||institute||",
			"cancelButton": "true",
			"flex_row": "true",
			"flex_justify": "start",
			"width": "100%",
			"field": [{
					"name": "title",
					"label": "Course Title",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"maxlength": "300",
					"onblur":"if(!$('#titleprint').val()){$('#titleprint').val($(this).val());}"
				},{
					"name": "titleprint",
					"label": "Course Title (Print)",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"maxlength": "300"
				},
				{
					"name": "subtitle",
					"label": "Course Sub Title",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"maxlength": "300"
				},
				{
					"name": "description",
					"label": "Course Description",
					"fieldtype": "s",
					"type": "textarea",
					"required": "Yes",
					"maxlength": "500"
				},
				{
					"name": "price",
					"label": "Price",
					"fieldtype": "n",
					"type": "text",
					"required": "Yes"
				},
				{
					"name": "department",
					"label": "Department",
					"fieldtype": "s",
					"type": "select",
					"option": "TE,LT,MED,CC",
					"required": "Yes"
				},
				{
					"name": "programlinked",
					"label": "Linked to Program",
					"fieldtype": "s",
					"type": "select3",
					"option": "None,Bachelor of Theology,Master of Divinity,Master of Theology,Diploma in Theology,Certificate in Theology",
					"required": "Yes"
				},
				{
					"name": "timeneeded",
					"label": "Time Needed",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"maxlength": "100"
				}, {
					"name": "credit",
					"label": "Credit",
					"fieldtype": "n",
					"type": "select",
					"option": "0,1,2,3,4",
					"required": "Yes"
				}, {
					"name": "language",
					"label": "Language",
					"fieldtype": "s",
					"type": "select",
					"option": "English,Hindi,Malayalam,Tamil,Angika",
					"required": "Yes"
				}, {
					"name": "goals",
					"label": "Goals of the Course",
					"fieldtype": "s",
					"type": "textarea",
					"required": "Yes",
					"maxlength": "2000"
				}, {
					"name": "connexionmodel",
					"label": "ConneXion Model Focus",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"maxlength": "100"
				},
				{
					"name": "image_path",
					"label": "Image Path",
					"fieldtype": "s",
					"type": "file",
					"required": "Yes",
					"maxsize": "100kb",
					"uploadstmt": "33"
				},
				{
					"name": "authorid",
					"label": "Author",
					"fieldtype": "u",
					"type": "select",
					"option": "SELECT id,fullname FROM online_course_users where status=1 and isfaculty=1",
					"required": "Yes"
				}, {
					"name": "fastforward",
					"label": "Fast Forward",
					"fieldtype": "n",
					"type": "select",
					"option": "0:No,1:Yes",
					"required": "Yes"
				}, {
					"name": "owner",
					"label": "Owner",
					"fieldtype": "u",
					"type": "select",
					"option": "SELECT id,fullname FROM online_course_users where status=1 and isfaculty=1",
					"default": "||USERID||",
					"required": "Yes"
				}, {
					"name": "language",
					"label": "Language",
					"fieldtype": "s",
					"type": "select3",
					"option": "English,Hindi,Malayalam,Tamil",
					"default": "English",
					"required": "Yes"
				}, {
					"name": "institute",
					"label": "Institute",
					"fieldtype": "s",
					"type": "select",
					"option": "NIBS,NBBI,NIBI",
					"default": "NIBS",
					"required": "Yes"
				}
			]
		},
		{
			"name": "task_reportelem",
			"formtype": "Horizontal",
			"title": "Task Report Element",
			"icon": "mif-books fg-green",
			"saveButton": "true",
			"saveid": "34sv",
			"getid": "34gt",
			"delpermanentid": "34dt",
			"tbl":"nbbi_taskreportelem",
			"fld":"taskid,item,porder,class,style,otherjson",
			"value":"||taskid||,||item||,||order||,||class||,||style||,||other||",
			"fldtype":"u,s,n,s,s,s",
			"whr":"id='||ID||'",
			"cancelButton": "true",
			"flex_row": "true",
			"flex_justify": "start",
			"width": "100%",
			"field": [
				{
					"name": "taskid",
					"label": "Task ID",
					"fieldtype": "s",
					"type": "hidden",
					"required": "Yes"					
				},{
					"name": "item",
					"label": "Item",
					"fieldtype": "s",
					"type": "select",
					"option":"Featured Image,Title,Heading,Text Block,Featured Content and Description,Featured Post,Finance,Image,Image Gallery,Journals,Checklist,PDF",
					"required": "Yes",
					"maxlength":"200"
				},{
					"name": "order",
					"label": "Order",
					"fieldtype": "n",
					"type": "number",
					"required": "Yes"					
				},{
					"name": "class",
					"label": "Class",
					"fieldtype": "s",
					"type": "text",
					"maxlength":"200",
					"required": "Yes"					
				},{
					"name": "style",
					"label": "Style",
					"fieldtype": "s",
					"type": "text",
					"maxlength":"1000",
					"required": "Yes"					
				},{
					"name": "other",
					"label": "Other Attrib",
					"fieldtype": "s",
					"type": "text",
					"maxlength":"500",
					"required": "Yes"					
				}
			]
		},
		{
			"name": "task_planner",
			"formtype": "Horizontal",
			"title": "Task Planner",
			"icon": "mif-books fg-green",
			"saveButton": "true",
			"saveid": "22b1sv",
			"getid": "22b1gt",
			"delpermanentid": "22b1dt",
			"command": "insertorupdate",
			"tbl": "nbbi_communication",
			"fld": "people,datefrom,dateto,communication,status,taskid",
			"fldtype": "s,d,d,s,n,u",
			"value": "||people||,||datefrom||,||dateto||,||communication||,||status||,||taskid||",
			"whr": "id='||ID||'",
			"cancelButton": "true",
			"flex_row": "true",
			"flex_justify": "start",
			"width": "100%",
			"field": [
				{
					"name": "taskid",
					"label": "Task ID",
					"fieldtype": "s",
					"type": "hidden",
					"required": "Yes"					
				},{
					"name": "datefrom",
					"label": "From Date",
					"fieldtype": "d",
					"type": "datepicker",
					"required": "Yes"					
				},{
					"name": "dateto",
					"label": "To Date",
					"fieldtype": "d",
					"type": "datepicker",
					"required": "Yes"					
				},{
					"name": "people",
					"label": "People",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes"					
				},{
					"name": "communication",
					"label": "Plan",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes"					
				},{
					"name": "status",
					"label": "Status",
					"fieldtype": "s",
					"type": "select",
					"option":"0:Planned,1:Done"									
				}
			]
		}
 	],
 	"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-3cflt')"
 		}, {
 			"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-26cflt',{mode:'',term:'',faculty:'',academicyear:''})"
 		},
 		{
 			"name": "onlineCourses",
 			"caption": "Online Courses",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('27lt-27flt')"
 		},
 		{
 			"name": "attendance",
 			"caption": "Attendance",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('28lt-28ltbt-28ltft',{attendancedate:formatDate(),period:1})"
 		},
 		{
 			"name": "settings",
 			"caption": "Settings",
 			"icon": "mif-users fg-red",
 			"onclick": "Eirene.runStmt('29lt')"
 		}
 	],
 	"sqlstatement": [
		{
 			"id": "1tklst",
 			"name": "Task List",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"formname": "task",
 				"tbl": "nbbi_tasks a",
 				"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": "CONCAT('<a onclick=\\\"Eirene.runStmt(&apos;23fcnt-23-20-21-22-22a-22b-33tbl-34tbl-36chkm&apos;,{TID:&apos;',a.id,'&apos;})\\\">',a.task,'</a>')as task,b.fullname,a.beginningdate,a.enddate",
 				"whr":[
					"a.recordstatus=1 and (a.createdby='||userid||' or a.assignedto='||userid||')",
					{"if":"||includesubtask||","op":"=","value":"BLANK","then":"and a.taskid IS NULL"},
					{"if":"||project||","op":"!=","value":"BLANK","then":"and a.department='||project||'"},
					{"if": "||assignedto||","op": "!=","value": "BLANK","then": "and a.assignedto ='||assignedto||'"},
					{"if": "||task||","op": "!=","value": "BLANK","then": "and a.task like '%||task||%'"},
					{"if": "||status||","op": "!=","value": "BLANK","then": "and a.status ='||status||'","else":" and a.status<=3"},
					{"if": "||dtf||","op": "!=","value": "BLANK","and": "||dtt||","andop": "!=","andvalue": "BLANK","then": " and a.beginningdate>='||dtf||' and a.beginningdate<='||dtt||'"},
					{"if": "||dtf||","op": "!=","value": "BLANK","and": "||dtt||","andop": "=","andvalue": "BLANK","then": " and a.beginningdate='||dtf||'"}
				],
 				"srt": "a.enddate",
 				"header": "Task,Assigned To,Beginning Date,End Date",
 				"functionfield": [
					{
						"prepend":true,
						"type":"select",
						"option":"SELECT id,projectname FROM nbbi_project where assignedto='||userid||' and recordstatus=1",
						"caption":"Project",
						"value":"<a.department>",
						"onchange":"Eirene.runStmt('1tksav',{department:$(this).val(),ID:'<a.id>'})"
					},{
						"type":"select",
						"option":"1:Created,2:In Progress,3:Done,4:Archived",
						"caption":"Status",
						"value":"<a.status>",
						"onchange":"Eirene.runStmt('1tksav',{status:$(this).val(),ID:'<a.id>'})"
					},
					{
 						"type": "group",
 						"caption": "Subtask Status",
 						"grp": [{
 								"if": "d.cnt1 IS NULL",
 								"type": "icon",
 								"value": "0/<c.cnt>"
 							},
 							{
 								"if": "d.cnt1 IS NOT NULL",
 								"type": "icon",
 								"value": "<d.cnt1>/<c.cnt>"
 							}

 						]
 					},
 					{
 						"type": "group",
 						"caption": "Function",
 						"grp": [
 							{
 								"type": "icon",
 								"class": "icon mif-pencil mr-2",
 								"title": "Edit Record",
 								"onclick": "edit('task','<a.id>',true)"
 							}, 							
 							{
 								"type": "icon",
 								"class": "icon mif-printer mr-2",
 								"title": "Print",
 								"onclick": "Eirene.runStmt('34trep',{taskid:'<a.id>'})"
 							},
 							{
 								"type": "icon",
 								"class": "icon mif-verified mr-2",
 								"title": "Approval",
 								"onclick": "Eirene.runStmt('1tkapr',{taskid:'<a.id>',display:'appendix'})"
 							},
 							{
 								"type": "icon",
 								"class": "icon mif-link mr-2",
 								"title": "Copy Link",
 								"onclick": "copy('https://cmch.niea.in/cmchapp.php?pluginid=||PLUGINID||&stmt=1tkapr&taskid=<a.id>')"
 							},
 							{
 								"type": "icon",
 								"class": "icon mif-mail mr-2",
 								"title": "Email to Collaborators",
 								"onclick": "Eirene.runStmt('2tkreF',{taskid:'<a.id>'})"
 							}
 						]
 					}
 				],
 				"srt": "a.beginningdate DESC",
 				"limit": "2000", 				
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:empty;#workareaAppendix"
 			}

 		},{
			"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('35lt-35flt')","title": "Project List"
 						},
 						{
 							"name": "s2","type": "button","value": "Task","onclick": "Eirene.runStmt('1tklst-1flt')","title": "Task List"
 						},{
 							"name": "s-journal","type": "button","value": "Journal","onclick": "Eirene.runStmt('1flt2',{filtertable:'s5'})","title": "Journal"
 						},{
 							"name": "s-Finance","type": "button","value": "Finance","onclick": "Eirene.runStmt('1fnlst-1fnflt')","title": "Finance"
 						},{
 							"name": "s-Query","type": "button","value": "Query","onclick": "Eirene.runStmt('1qrlst-1qrflt')","title": "Finance"
 						},{
 							"name": "s-Communication","type": "button","value": "Planner","onclick": "Eirene.runStmt('22blst-22bflt')","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": "1flt",
 			"name": "Task Filter",
 			"sql": {
 				"action": "Return",
 				"outputto": "php",
 				"elem": [					
					{
						"output": "#workareaFilter1",					
						"elem":[
							{
								"id":"1flttab1",
								"name":"1flttab1",
								"type": "tab",								
								"tabs": [
									{
										"heading":"Filter",
										"content":[
											{
												"name": "s1",
												"type": "buttonspan",
												"class": "mif-plus fg-red mr-2",
												"value": " Task",
												"onclick": "show form(&apos;nbbi_tasks 1&apos;)",
												"title": "Add New Task"
											},{
												"name": "f0",
												"id": "1taskf0",
												"type": "text",
												"placeholder":"Task",												
												"class":"mr-2"
											},{
												"name": "f1",
												"id": "1assignedto",
												"type": "select",
												"option": "SELECT '','' UNION ALL SELECT DISTINCT id,fullname from eirene_users WHERE status>0",
												"label": "Assigned To",
												"class":"mr-2"
											},
											{
												"name": "f1a",
												"id": "1status",
												"class":"ml-2",
												"type": "select",
												"option": ",1:Assigned,2:In Progress,3:Done,4:Archive",
												"label": "Status"
											},
											{
												"name": "f2",
												"id": "1dtf",
												"class":"ml-2",
												"type": "datepicker",
												"title":"Date From"
											},
											{
												"name": "f3",
												"id": "1dtt",
												"class":"ml-2",
												"type": "datepicker",
												"title":"Date To"
											},
											{
												"name": "f4",
												"type": "button",
												"class":"ml-2",
												"value": "Get",
												"onclick": "Eirene.runStmt('1tklst',{task:$('#1taskf0').val(),assignedto:$('#1assignedto').val(),status:$('#1status').val(),dtf:$('#1dtf').val(),dtt:$('#1dtt').val()})"
											}
										]
									}
								]
							}
						]
					}
				],
				"onsuccess":"cmd:dom,fun:show;#workareaFilter1"
 			}
 		},{
 			"id": "1flt2",
 			"name": "Task Journal Filter",
 			"sql": {
 				"action": "Return",
 				"outputto": "php",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter1",
 					"elem": [
						{
							"name":"f1",
							"id":"1flt2-f1",
							"type":"datepicker"							
						},{
							"name":"f2",
							"id":"1flt2-f2",
							"type":"datepicker"							
						},
 						{
 							"name": "f4",
 							"type": "button",
 							"value": "Get",
 							"onclick": "Eirene.runStmt('1jrlt',{sdate:$('#1flt2-f1').val(),edate:$('#1flt2-f2').val()})"
 						}
 					]
 				}
 			}
 		},{
			"id":"1tkapr",
			"name":"Task Approvals",
			"sql":{
				"action":"MULTISTMT",
				"outputto":"php",
				"output":"res",
				"multistmt":[
					{
						"action":"Get Row",
						"outputto":"php",
						"output":"taskrow",
						"tbl":"nbbi_tasks a",
						"join":"LEFT JOIN nbbi_contacts b ON a.contact=b.id",
						"whr":"a.id='||taskid||'",
						"fld":"a.task,a.description,a.remark,a.estimatedbudget,CONCAT(b.contactname,IF(b.organization is not null and b.organization !='',CONCAT(' (Company:',b.organization,')'),''),IF(b.gst is not null or b.gst !='',CONCAT(' (GST:',b.gst,')'),'')) contactname,b.bankdetails,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,a.submittedbyuserid,a.approvedbyuserid,a.submittedbysign,a.approvedbysign,DATE_FORMAT(a.submitteddate,'%d-%m-%Y') as submitteddate,DATE_FORMAT(a.approveddate,'%d-%m-%Y') as approveddate"
					},{
						"action": "Get Table",
						"outputto": "php",
						"output": "linktable",					
						"tbl": "nbbi_links",
						"fld": "lname,linktype,remark",
						"functionfield": [{
							"if": "link!=''",
							"type": "googlelink",
							"href": "<link>",
							"value": "Link",
							"target": "_blank",							
							"caption":"lnk"
						}],
						"whr": "taskid='||taskid||'",
						"srt": "createdon", 				
						"header": "Name,Type,Remark,Task Link"						
					},{
						"action":"Return",
						"outputto":"html",
						"output":{"if":"||display||","value":"appendix","then":"#workareaAppendix","else":"#workareaTablebox"},
						"value":[
							"<div style='width:100%'>",
								"<h3>Task: ||GET_taskrow_task||</h3>",
								"<div style='margin-top:10px'><b>Description:</b> ||GET_taskrow_description||</div>",
								"<div style='margin-top:10px'><b>Estimated Budget:</b> Rs.||GET_taskrow_estimatedbudget||</div>",
								"<div style='margin-top:10px'><b>Contact:</b> ||GET_taskrow_contactname||,||GET_taskrow_district||||GET_taskrow_mobile||||GET_taskrow_pan||</div>",
								"<div style='margin-top:10px'><b>Bank Details:</b> ||GET_taskrow_bankdetails||</div>",
								"<div style='margin-top:10px'><b>Remark:</b> ||GET_taskrow_remark||</div>",
								"<table border='0' style='border-collapse:collapse;margin-top:2cm;width:100%'>",								
								"<tr>",
									"<td style='width:50%'>",
										{"if":"||GET_taskrow_submittedbysign||","op":"=","value":"BLANK","and":"||USERID||","andvalue":"||GET_taskrow_submittedbyuserid||","then":"<div id='submittedBySignature' class='signature' style='background-color:rgb(211,211,211);color:darkblue'></div>","else":"<div id='submittedBySignatureDisplay'><img src='||GET_taskrow_submittedbysign||'></div>"},
									"</td>",
									"<td style='width:50%'>",
										{"if":"||GET_taskrow_approvedbysign||","op":"=","value":"BLANK","and":"||USERID||","andvalue":"||GET_taskrow_approvedbyuserid||","then":"<div id='approvedBySignature' class='signature' style='background-color:rgb(211,211,211);color:darkblue'></div>","else":"<div id='approvedBySignatureDisplay'><img src='||GET_taskrow_approvedbysign||'></div>"},
									"</td>",									
								"</tr>",
								"<tr>",
									"<td style='width:50%'>Submitted By</td><td>Approved by</td>",
								"</tr>",
								"<tr><td style='width:50%'>||GET_taskrow_submitteddate||</td><td>||GET_taskrow_approveddate||</td></tr>",
								"<tr>",
									"<td style='width:50%'>",
										{"if":"||GET_taskrow_submittedbysign||","op":"!=","value":"BLANK","and":"||USERID||","andvalue":"||GET_taskrow_submittedbyuserid||","then":"<button type='button' onclick='if($(this).text()==&apos;Change&apos;){if($(&apos;#submittedBySignatureDisplay&apos;).length==1){$(&apos;#submittedBySignatureDisplay&apos;).attr(&apos;id&apos;,&apos;submittedBySignature&apos;).addClass(&apos;signature&apos;).css(&apos;color&apos;,&apos;darkblue&apos;).html(&apos;&apos;);convertSignature(&apos;#workareaAppendix&apos;);}else{$(&apos;#submittedBySignature&apos;).jSignature(&apos;reset&apos;);} $(this).text(&apos;Save&apos;)}else{Eirene.runStmt(&apos;1sbsgn&apos;,{taskid:&apos;||taskid||&apos;,sign:$(&apos;#submittedBySignature&apos;).jSignature(&apos;getData&apos;),taskstatus:&apos;submitted&apos;});$(this).text(&apos;Change&apos;)}'>Change</button>"},
										{"if":"||GET_taskrow_submittedbysign||","op":"=","value":"BLANK","and":"||USERID||","andvalue":"||GET_taskrow_submittedbyuserid||","then":"<button type='button' onclick='Eirene.runStmt(&apos;1sbsgn&apos;,{taskid:&apos;||taskid||&apos;,sign:$(&apos;#submittedBySignature&apos;).jSignature(&apos;getData&apos;),taskstatus:&apos;submitted&apos;})'>Save</button>"},
									"</td>",
									"<td>",
										{"if":"||GET_taskrow_approvedbysign||","op":"!=","value":"BLANK","and":"||USERID||","andvalue":"||GET_taskrow_approvedbyuserid||","then":"<button type='button' onclick='if($(this).text()==&apos;Change&apos;){if($(&apos;#approvedBySignatureDisplay&apos;).length==1){$(&apos;#approvedBySignatureDisplay&apos;).attr(&apos;id&apos;,&apos;approvedBySignature&apos;).addClass(&apos;signature&apos;).css(&apos;color&apos;,&apos;darkblue&apos;).html(&apos;&apos;);convertSignature(&apos;#workareaAppendix&apos;);}else{$(&apos;#approvedBySignature&apos;).jSignature(&apos;reset&apos;);}$(this).text(&apos;Save&apos;)}else{Eirene.runStmt(&apos;1apsgn&apos;,{taskid:&apos;||taskid||&apos;,sign:$(&apos;#approvedBySignature&apos;).jSignature(&apos;getData&apos;),taskstatus:&apos;approved&apos;});$(this).text(&apos;Change&apos;)}'>Change</button>"},
										{"if":"||GET_taskrow_approvedbysign||","op":"=","value":"BLANK","and":"||USERID||","andvalue":"||GET_taskrow_approvedbyuserid||","then":"<button type='button'onclick='Eirene.runStmt(&apos;1apsgn&apos;,{taskid:&apos;||taskid||&apos;,sign:$(&apos;#approvedBySignature&apos;).jSignature(&apos;getData&apos;),taskstatus:&apos;approved&apos;})'>Save</button>"},
									"</td>",
								"</tr>",
								"</table>",
								"<h3 style='margin-top:30px'>Documents</h3>",
								"<div>||GET_linktable||</div>",
							"</div>",
							"<script>",
							{"if":"||display||","value":"appendix","then":"convertSignature('#workareaAppendix');","else":"convertSignature('#workareaTablebox');"},
							"</script>"
						],
						"onsuccess":[							
							{"if":"||display||","value":"appendix","then":"cmd:dom,fun:show;#workareaAppendix","else":"cmd:dom,fun:show;#workareaTablebox"}
						]
					}
				]
			}
		},{
			"id":"1sbsgn",
			"name":"Save Submitted By Signature",
			"sql":{
				"action":"MULTISTMT",
				"outputto":"php","output":"res",
				"multistmt":[
					{
						"action":"Save Row",
						"outputto":"php",
						"output":"res",
						"command":"update",
						"tbl":"nbbi_tasks",
						"fld":"submittedbysign,submitteddate",
						"fldtype":"s,n",
						"value":"||sign||,CURRENT_DATE()",
						"whr":"id='||taskid||'",
						"onsuccess":"cmd:dom,fun:showtoast;success;Saving Successful-1tkeml",
						"onfailure":"cmd:dom,fun:showtoast;alert;Saving Failed"
					},{
						"action":"Save Row",
						"outputto":"php","output":"res",
						"command":"insert",
						"tbl":"nbbi_journal",
						"fld":"jdate,title,remark,taskid",
						"fldtype":"n,s,s,u",
						"value":"CURRENT_DATE(),Task Submitted,Task signed and submitted by ||USER_fullname||.,||taskid||"
					}
				]
			}
		},{
			"id":"1apsgn",
			"name":"Save Submitted By Signature",
			"sql":{
				"action":"MULTISTMT",
				"outputto":"php","output":"res",
				"multistmt":[
					{
						"action":"Save Row",
						"outputto":"php",
						"output":"res",
						"command":"update",
						"tbl":"nbbi_tasks",
						"fld":"approvedbysign,approveddate",
						"fldtype":"s,n",
						"value":"||sign||,CURRENT_DATE()",
						"whr":"id='||taskid||'",
						"onsuccess":"cmd:dom,fun:showtoast;success;Saving Successful-1tkeml",
						"onfailure":"cmd:dom,fun:showtoast;alert;Saving Failed"				
					},{
						"action":"Save Row",
						"outputto":"php","output":"res",
						"command":"insert",
						"tbl":"nbbi_journal",
						"fld":"jdate,title,remark,taskid",
						"fldtype":"n,s,s,u",
						"value":"CURRENT_DATE(),Task Approved,Task signed and approved by ||USER_fullname||.,||taskid||"
					}
				]
			}
		},{
			"id":"1tkeml",
			"name":"Task Approval/Submitted Email",
			"sql":{
				"action":"MULTISTMT",
				"outputto":"php","output":"res",
				"multistmt":[
					{
						"action":"Get Row",
						"outputto":"php",
						"output":"taskrow",
						"tbl":"nbbi_tasks a",
						"join":[
								"LEFT JOIN nbbi_contacts b ON a.contact=b.id",
								"LEFT JOIN eirene_users c ON a.submittedbyuserid=c.id",
								"LEFT JOIN eirene_users d on a.approvedbyuserid=d.id"
							],
						"whr":"a.id='||taskid||'",
						"fld":"a.task,a.description,a.remark,a.estimatedbudget,c.username as submittedbyemail,d.username as approvedbyemail,CONCAT(b.contactname,IF(b.organization is not null and b.organization !='',CONCAT(' (Company:',b.organization,')'),'')) contactname,b.bankdetails,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,a.submittedbyuserid,a.approvedbyuserid,a.submittedbysign,a.approvedbysign,DATE_FORMAT(a.submitteddate,'%d-%m-%Y') as submitteddate,DATE_FORMAT(a.approveddate,'%d-%m-%Y') as approveddate,c.fullname as submittedbyname,d.fullname as approvedbyname"
					},{
						"action": "Get Table",
						"outputto": "php",
						"output": "linktable",					
						"tbl": "nbbi_links",
						"fld": "lname,linktype,remark",
						"functionfield": [{
							"if": "link!=''",
							"type": "googlelink",
							"href": "<link>",
							"value": "Link",
							"target": "_blank",							
							"caption":"lnk"
						}],
						"whr": "taskid='||taskid||'",
						"srt": "createdon", 				
						"header": "Name,Type,Remark,Task Link"						
					},{
						"action":"Return",
						"outputto":"php",
						"output":"emailcontent",
						"value":[
							"<div style='width:100%'>",
								{"if":"||taskstatus||","value":"submitted",
									"then":"A request is created and submitted for your review and approval. Details of the task is below.<br>Click <a href='https://cmch.niea.in/cmchapp.php?pluginid=||PLUGINID||&taskid=||taskid||&stmt=1tkapr'>here</a> to approve the task.<br>",
									"else":"Request is approved. Details of the task is below.<br>"
								},
								"<h3>Task: ||GET_taskrow_task||</h3>",
								"<div style='margin-top:10px'><b>Description:</b> ||GET_taskrow_description||</div>",
								"<div style='margin-top:10px'><b>Estimated Budget:</b> Rs.||GET_taskrow_estimatedbudget||</div>",
								"<div style='margin-top:10px'><b>Contact:</b> ||GET_taskrow_contactname||,||GET_taskrow_district||||GET_taskrow_mobile||||GET_taskrow_pan||</div>",
								"<div style='margin-top:10px'><b>Bank Details:</b> ||GET_taskrow_bankdetails||</div>",
								"<div style='margin-top:10px'><b>Remark:</b> ||GET_taskrow_remark||</div>",
								"<table border='0' style='border-collapse:collapse;margin-top:2cm;'>",
								"<tr><td style='border:0'><img src='||GET_taskrow_submittedbysign||'></td><td style='border:0'><img src='||GET_taskrow_approvedbysign||'></td></tr>",
								"<tr><td style='border:0'><center>Submitted by</center></td><td style='border:0'><center>Approved by</center></td></tr>",
								"<tr><td style='border:0'><center>||GET_taskrow_submittedbyname||</td><td style='border:0'><center>||GET_taskrow_approvedbyname||</center></td></tr>",
								"<tr><td style='border:0'><center>||GET_taskrow_submitteddate||</td><td style='border:0'><center>||GET_taskrow_approveddate||</center></td></tr>",
								"</table>",
								"<div style='margin-top:10px'>||GET_linktable||</div>",
							"</div>"
						]
					},{
						"action":"Send Email",
						"outputto":"php","output":"res",
						"to":"||GET_taskrow_submittedbyemail||",
						"cc":"||GET_taskrow_approvedbyemail||",
						"content":"||GET_emailcontent||",
						"subject":[
							{"if":"||taskstatus||","value":"submitted",
								"then":"Request is submitted for approval: ||GET_taskrow_task||",
								"else":"Request is Approved: ||GET_taskrow_task||"
							}
						],
						"title":[
							{"if":"||taskstatus||","value":"submitted",
							"then":"Request is submitted for approval",
							"then":"Request is Approved"
							}
						],
						"sendername":"NIEA Task Manager"						
					}				
				]				
			}
		},{
			"id":"1tkpr1",
			"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":{"if":"||GET_taskrow_featuredcontent1||","op":"!=","value":"BLANK","then":"title,remark","else":"'Contact' as title,'||GET_taskrow_contactname||, ||GET_taskrow_district||||GET_taskrow_mobile||||GET_taskrow_pan||.' as remark"},
						"whr":{"if":"||GET_taskrow_featuredcontent1||","op":"!=","value":"BLANK","then":"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":{"if":"||GET_taskrow_featuredcontent2||","op":"!=","value":"BLANK","then":"title,remark","else":"'Task Duration' as title,'The task began on: ||GET_taskrow_bdate|| and the task ended/ending on:||GET_taskrow_edate||.' as remark"},
						"whr":{"if":"||GET_taskrow_featuredcontent2||","op":"!=","value":"BLANK","then":"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":{"if":"||GET_taskrow_featuredcontent3||","op":"!=","value":"BLANK","then":"title,remark","else":"'Payment' as title,'Approved Budget:||GET_taskrow_estimatedbudget||<br>Total amount spent for completion of the task: ||GET_totalpayments||.' as remark"},
						"whr":{"if":"||GET_taskrow_featuredcontent3||","op":"!=","value":"BLANK","then":"id='||GET_taskrow_featuredcontent3||'"},
						"union":" UNION SELECT checklistname AS title,remark FROM nbbi_checklist where id='||GET_taskrow_featuredcontent3||'",
						"limit":"1"
					}
				]
			}
		
		},{
			"id":"1tkprt",
			"name":"Print Task Report",
			"sql":{
				"action":"MULTISTMT",
				"outputto":"php",
				"output":"res",
				"validate":"none",
				"multistmt":[
					{
						"action":"Get Value",
						"outputto":"php",
						"output":"featuredimage1",
						"tbl":"nbbi_links",
						"fld":"CONCAT('http://drive.google.com/uc?export=view&id=',link)",
						"whr":"taskid='||taskid||' and linktype='Featured Image1'",
						"limit":"1"
					},{
						"action":"Get Value",
						"outputto":"php",
						"output":"featuredimage2",
						"tbl":"nbbi_links",
						"fld":"CONCAT('http://drive.google.com/uc?export=view&id=',link)",
						"whr":"taskid='||taskid||' and linktype='Featured Image2'",
						"srt":"linktype DESC",
						"limit":"1"
					},{
						"action": "Get Table",
						"outputto": "php",
						"output": "linktable",					
						"tbl": "nbbi_links",
						"fld": "lname,linktype,remark",
						"functionfield": [{
							"if": "link!=''",
							"type": "googlelink",
							"href": "<link>",
							"value": "Link",
							"target": "_blank",							
							"caption":"lnk"
						}],
						"whr": "taskid='||taskid||' and linktype NOT LIKE '%Featured%'",
						"srt": "createdon", 				
						"header": "Name,Type,Remark,Task Link"						
					},{
						"action": "Get HTML",
						"outputto": "php",
						"output": "taskimages",					
						"tbl": "nbbi_links",
						"fld": "CONCAT('http://drive.google.com/uc?export=view&id=',link) lnk",
						"whr": "taskid='||taskid||' and linktype ='Image'",
						"srt": "createdon",
						"limit":"||GET_taskrow_imagecount||",
						"parent":"div style='display:flex;flex-flow:row wrap'",
						"template":["<div style='width:",
									{"case":"||GET_taskrow_imagecolumn||","col1":"100%","col2":"50%","col3":"33%","col4":"25%"},									
									";padding:0.15cm;overflow:hidden'><img src='||lnk||' style='width:100%;'></div>"
						]
					},{
						"action":"Get Value",
						"outputto":"php","output":"totalamt",
						"tbl":"nbbi_payments",
						"fld":"SUM(amount)",
						"whr":"taskid='||taskid||'"
					},{
						"action": "Get Table",
						"outputto": "php",
						"output": "paymenttable",
						"precheck":{"if":"||GET_totalamt||","op":">","value":"0"},
						"tbl": "nbbi_payments a",
						"join": "INNER JOIN nbbi_contacts b ON a.contactid=b.id",
						"fld":["DATE_FORMAT(a.paymentdate,'%d-%m-%Y')",
								"a.purpose",
								"a.paymentmode as mode",
								"a.amount",
								"IF(a.bill !='',CONCAT('<a target=_blank href=http://drive.google.com/uc?export=view&id=',a.bill,'>Link</a>'),'')",
								"IF(a.pconfirmationlink !='',CONCAT('<a target=_blank href=http://drive.google.com/uc?export=view&id=',a.pconfirmationlink,'>Link</a>'),'')"								
						],						
						"whr": "a.taskid='||taskid||'",
						"srt": "a.createdon",
						"vsum":"4",
						"header": "Date,Purpose,Mode,Amount,Bill,Payment Confirmation"
					},{
						"action": "Get Value",
						"outputto": "php",
						"output": "totalpayments",						 				
						"tbl": "nbbi_payments",						
						"fld": "SUM(amount)",
						"whr": "taskid='||taskid||'"		
					},{
						"action":"Get Value",
						"outputto":"php","output":"journalcount",
						"tbl":"nbbi_journal","fld":"count(*)",
						"whr":[
							"recordstatus=1 and jdate >'2020-01-01'",
							"and taskid='||taskid||'"
						]
					},{
						"action":"Get Table",						
						"outputto":"php",
						"output":"journal",
						"precheck":{"if":"||GET_journalcount||","op":">","value":"0"},
						"tbl":"nbbi_journal a",						
						"fld":"DATE_FORMAT(a.jdate,'%d-%m-%Y')as journaldate,a.title,a.remark",
						"header":"Date,Title,Remark",
						"whr":[
							"a.recordstatus=1 and a.jdate >'2020-01-01'",
							"and a.taskid='||taskid||'"
						],
						"srt":"a.jdate"
					},{
						"action":"Get Row","outputto":"php","output":"template",
						"tbl":"nbbi_reporttemplate",
						"fld":"color1,color2,color3",
						"whr":[
							{"if":"||templateid||","op":"!=","value":"BLANK","then":"id='||templateid||'","else":"id='||GET_taskrow_template||'"}
						]
					},{
						"action":"Return",
						"outputto":"html",
						"output":"#workareaAppendix",
						"value":[
								"<div>",
									"<a href='#print'>",
										"<span class='mif-printer fg-blue' onclick='printHTML(&apos;printarea&apos;)'></span>",
									"</a>",
									{"elem":{"outputto":"php","output":"res","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('1svtmp-34trep',{taskid:'||taskid||',templateid:$(this).val()})"},
											{"name":"r-1","id":"r-1","class":"mr-2","label":"Background colour","type":"text","value":"||GET_taskrow_pagebackgroundcolor||","onblur":"Eirene.runStmt('1svbg',{taskid:'||taskid||',bg:$(this).val()});$('#printarea').css('background-color',$(this).val())"},
											{"name":"r-2","id":"r-2","class":"mr-2","label":"Images in Columns","type":"select","option":"1,2,3,4","selectedvalue":"||GET_taskrow_imagecolumn1||","onchange":"Eirene.runStmt('1svcol-34trep',{taskid:'||taskid||',imgcol:$(this).val()});"},
											{"name":"r-3","id":"r-3","class":"ml-2","label":"Images Count","type":"number","value":"||GET_taskrow_imagecount||","onchange":"Eirene.runStmt('1svcnt-34trep',{taskid:'||taskid||',imgcnt:$(this).val()});"}
										]
									}},									
								"</div>",
								"<div id='printarea' style='width:21cm;padding:1.5cm;'>",
									"<div style='background-color:||GET_taskrow_pagebackgroundcolor||'>",
										"<div><img src='||GET_featuredimage1||' style='width:100%;'></div>",
										"<div style='color:white;margin-top:-100px;margin-left:20px;font-size:25pt' class='font-Ubuntu-Bold'>||GET_taskrow_task||</div>",
										"<div style='height:6cm;background-color:||GET_template_color1||;align:justify;padding:1cm;margin-top:50px;padding:0.5cm'>",
											"<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>",
										"<div style='margin-top:30px;'><h3>Documents</h3>||GET_linktable||</div>",
										{"if":"||GET_totalamt||","op":">","value":"0","then":"<div style='margin-top:30px;'><h3>Payments</h3>||GET_paymenttable||</div>"},
										"<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'>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%;'>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%;'>03<h4>||GET_featuredcontent3_title||</h4><br><div style='font-size:10pt'>||GET_featuredcontent3_remark||</div> </td></tr></table></div>",
										"<div style='margin-top:30px;'>||GET_taskimages||</div>",
										{"if":"||GET_journalcount||","op":">","value":"0","then":"<div style='margin-top:30px;'><h3>Journal</h3>||GET_journal||</div>"},
									"</div>",
								"</div>"
						],
						"onsuccess":"cmd:dom,fun:show;#workareaAppendix;-cmd:dom,fun:scrollinview;printarea"
					}				
				]
			}
		},{
			"id":"1svbg",
			"name":"Save Task Report Background Color",
			"sql":{
				"action":"Save Row","outputto":"php","output":"res",
				"command":"update",
				"tbl":"nbbi_tasks","fld":"pagebackgroundcolor","fldtype":"s",
				"value":"||bg||",
				"whr":"id='||taskid||'"
			}
		},{
			"id":"1svcol",
			"name":"Save Image Columns in Grid",
			"sql":{
				"action":"Save Row","outputto":"php","output":"res",
				"command":"update",
				"tbl":"nbbi_tasks","fld":"imagecolumn","fldtype":"n",
				"value":"||imgcol||",
				"whr":"id='||taskid||'"
			}
		},{
			"id":"1svcnt",
			"name":"Save Image Count Grid",
			"sql":{
				"action":"Save Row","outputto":"php","output":"res",
				"command":"update",
				"tbl":"nbbi_tasks","fld":"imagecount","fldtype":"n",
				"value":"||imgcnt||",
				"whr":"id='||taskid||'"
			}
		},{
			"id":"1svtmp",
			"name":"Save Task Template",
			"sql":{
				"action":"Save Row","outputto":"php","output":"res",
				"command":"update",
				"tbl":"nbbi_tasks","fld":"template","fldtype":"s",
				"value":"||templateid||",
				"whr":"id='||taskid||'"
			}
		},{
			"id":"1jrlt",
			"name":"Journal Filter List",
			"sql":{
				"action":"Get Table",
				"validate":"eirene_users",
				"outputto":"html",
				"output":"table",
				"tbl":"nbbi_journal a",
				"join":"INNER JOIN nbbi_tasks b ON a.taskid=b.id",
				"fld":"b.task,GROUP_CONCAT(DISTINCT a.remark ORDER BY a.jdate SEPARATOR '<br>')",
				"whr":[
					"a.recordstatus=1",
					"and a.jdate>='||sdate||' and a.jdate<='||edate||'"
				],
				"header":"Task,Remark",
				"grp":"b.task",
				"srt":"a.taskid,a.jdate"
			}
		},{
			"id":"1fnlst",
			"name":"Get Payment List",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table",
				"tbl":"nbbi_payments a",
				"join":[
						"INNER JOIN nbbi_contacts b ON a.contactid=b.id",
						"INNER JOIN nbbi_tasks c ON a.taskid=c.id"
				],
				"fld":"c.task,a.paymentdate,b.contactname,a.purpose,a.amount",
				"datefield":"a.paymentdate",
				"header":"Task,Date,Name,Purpose,Amount",
				"functionfield":[
					{
						"if": "bill!=''",
						"type": "googlelink",
						"href": "<bill>",
						"value": "Link",
						"target": "_blank",							
						"caption":"Link"
					},{
 							"type": "icon",
 							"class": "icon mif-pencil",
 							"title": "Edit Record",
 							"onclick": "edit('payment','<a.id>',true)",
 							"caption": "Edit"
 					},{
 							"type": "icon",
 							"class": "icon mif-file-text",
 							"title": "Process Payment",
 							"onclick": "Eirene.runStmt('1fnprc',{ID:'<a.id>'})",
 							"caption": "Process Payment"
 					}
				],
				"whr":[
					"a.recordstatus=1",
					{"if":"||frompaymentdate||","op":"!=","value":"BLANK","andif":"||topaymentdate||","andop":"!=","andvalue":"BLANK","then":" and (paymentdate>='||frompaymentdate||' and paymentdate<='||topaymentdate||')","else":" and paymentdate='0000-00-00'"}
				]
			}
		},{
			"id":"1fnprc",
			"name":"Get Process Payment Note",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"#workareaAppendix",
				"tbl":"nbbi_payments a",
				"fld":"b.contactname,a.purpose,a.paymentmode,a.amount,if(a.bill = '','',CONCAT('<a href=\\\"http://drive.google.com/uc?export=view&id=',a.bill,'\\\" target=\\\"_blank\\\">','link</a>')) as billlink,b.bankdetails",
				"join":"INNER JOIN nbbi_contacts b ON a.contactid=b.id",
				"header":"Name,Purpose,Payment Mode,Amount,Bill Link,Bank Details",
				"whr":"a.id='||ID||'",
				"onsuccess":"cmd:dom,fun:show;#workareaAppendix"
			}
		},{
			"id":"1fnflt",
			"name":"Finance Filter",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"res",
				"value":"",
				"elem":{
					"outputto":"html",
					"output":"#workareaFilter1",
					"elem":[
						{
							"name":"f1",
							"id":"1fnflt-f1",
							"label":"From",
							"class":"mr-2",
							"type":"datepicker"							
						},{
							"name":"f2",
							"id":"1fnflt-f2",
							"label":"To",
							"class":"mr-2",
							"type":"datepicker"							
						},
						{
							"name": "f4",
							"type": "button",
							"value": "Get",
							"onclick": "Eirene.runStmt('1fnlst',{frompaymentdate:$('#1fnflt-f1').val(),topaymentdate:$('#1fnflt-f2').val()})"
						}
					]
				}
			}
		},{
			"id":"1qrlst",
			"name":"Get Query List",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table",
				"tbl":"nbbi_query a",
				"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('22asv1',{ID:'<a.id>',response:$(this).val()})"
					}
				],
				"whr":[
					"a.recordstatus=1",
					{"if":"||fromdate||","op":"!=","value":"BLANK","andif":"||todate||","andop":"!=","andvalue":"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": "2tkreF",
 			"name": "Send Email on new Journal Entry",
 			"sql":{
				"action":"MULTISTMT","outputto":"php","output":"res",
				"multistmt":[
					{
						"action":"Get Row",
						"outputto":"php",
						"output":"taskrow",
						"tbl":"nbbi_tasks a",
						"join":"LEFT JOIN nbbi_contacts b ON a.contact=b.id",
						"whr":"a.id='||taskid||'",
						"fld":"a.task,a.description,a.type,a.enddate,a.emails",
						"datefield":"a.enddate"
					},{
						"action":"Get Table",						
						"outputto":"php",
						"output":"journal",						
						"tbl":"nbbi_journal a",						
						"fld":"DATE_FORMAT(a.jdate,'%d-%m-%Y')as journaldate,a.title,a.remark",
						"header":"Date,Title,Remark",
						"whr":[
							"a.recordstatus=1 and a.jdate >'2020-01-01'",
							"and a.taskid='||taskid||'"
						],
						"srt":"a.jdate DESC"
					},{
						"action": "Get Table",
						"outputto": "php",
						"output": "linktable",
						"precheck":{"if":"||GET_taskrow_emails||","op":"!=","value":"BLANK"},
						"tbl": "nbbi_links",
						"fld": "lname,linktype,remark",
						"functionfield": [{
							"if": "link!=''",
							"type": "googlelink",
							"href": "<link>",
							"value": "Link",
							"target": "_blank",							
							"caption":"lnk"
						}],
						"whr": "taskid='||taskid||' and linktype NOT LIKE '%Featured%'",
						"srt": "createdon", 				
						"header": "Name,Type,Remark,Task Link"						
					},{
						"action": "Send Email",
						"title": "Task",						
						"sendername": "Task Management",
						"precheck":{"if":"||GET_taskrow_emails||","op":"!=","value":"BLANK"},
						"to": "||GET_taskrow_emails||",
						"replyto": "||USER_username||",
						"subject": "||GET_taskrow_task||",
						"content": "The task has received new update.<br><b>Task: </b>||GET_taskrow_task||<br><b>Description: </b>||GET_taskrow_description||<br><b>Type: </b>||GET_taskrow_type||<br><b>Due Date: </b>||GET_taskrow_enddate||<br><br>||GET_journal||<br><br>||GET_linktable||<br><br>With best wishes,<br><b>NIEA Task Management</b><br>On behalf of<br>||USER_fullname||",
						"onsuccess":"cmd:dom,fun:showtoast;success;Email Sent",
						"onfailure":"cmd:dom,fun:showtoast;alert;Email Sending Failed"
					}
				]
			}
		},
 		{
 			"id": "3conlt",
 			"name": "Contact List",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"delstmt": "3condt",
 				"formname": "contact",
 				"tbl": "nbbi_contacts",
 				"fld": "contactname,organization,mobile,whatsapp,type,district,state",
 				"header": "Name,Organization/Company,Mobile,WhatsApp,Type,District,State",
 				"whr": "recordstatus>0",
 				"elem": {
 					"output": "#workareaFilter",
 					"parent": "div",
 					"elem": [{
 							"name": "f1",
 							"type": "buttonspan",
 							"icon": "mif-plus fg-red",
 							"value": "",
 							"onclick": "showForm('nbbi_contacts')",
 							"title": "Add Contact"
 						},
 						{
 							"name": "f2",
 							"type": "buttonspan",
 							"icon": "icon mif-menu",
 							"value": "",
 							"onclick": "Eirene.runStmt('3conlt')",
 							"title": "Contact List"

 						},
 						{
 							"name": "f3",
 							"displaynone": "1",
 							"whr": [
 								"recordstatus=1",
 								{
 									"if": "||type||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": " and type='||type||'"
 								},
 								{
 									"if": "||state||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and state='||state||'"
 								},
 								{
 									"if": "||mothertongue||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": " and contactname like '%||mothertongue||%' or organization like '%||mothertongue||%'"

 								}

 							]
 						}
 					]
 				},
 				"functionfield": [{
 					"type": "group",
 					"caption": "Function",
 					"grp": [{
 							"type": "icon",
 							"class": "icon mif-pencil",
 							"title": "Edit Record",
 							"onclick": "edit('contact','<id>',true)",
 							"caption": "Edit"
 						},
 						{
 							"type": "icon",
 							"class": "icon mif-cross",
 							"title": "Delete Record",
 							"onclick": "Eirene.runStmt2('3condt','ID','<id>')",
 							"caption": "DeleteRecord"
 						}
 					]
 				}],
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:empty;#workareaAppendix"
 			}
 		},
 		{
 			"id": "3cflt",
 			"name": "Contact Filter",
 			"sql": {
 				"action": "Return",
 				"outputto": "php",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter1",
 					"elem": [{
 							"name": "f1",
 							"id": "3type",
 							"type": "select",
 							"option": ",Vendor,Pastor,Christian Leader"
 						},
 						{
 							"name": "f2",
 							"id": "3state",
 							"type": "select",
 							"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"
 						},
 						{
 							"name": "f3",
 							"id": "3mothertongue",
 							"type": "text",
 							"title": "Mother Tongue",
 							"placeholder": "Search"
 						},
 						{
 							"name": "f4",
 							"type": "button",
 							"value": "Get",
 							"onclick": "Eirene.runStmt('3conlt',{filtertable:'f3',type:$('#3type').val(),state:$('#3state').val(),mothertongue:$('#3mothertongue').val()})"
 						}
 					]
 				},
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter1;fast-cmd:dom,fun:show;#workareaFilter;fast"
 			}
 		}, 		 	
 		{
 			"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": "7clssv",
 			"name": "Save Class Details",
 			"sql": {
 				"action": "Save Row",
 				"outputto": "php",
 				"output": "res",
 				"command": "insert",
 				"tbl": "nbbi_classrecord",
 				"fld": "taskid,classtype,classdate,attendancecount,lessontaught,pptlink,videolink,noteslink,lessonuploaded",
 				"fldtype": "u,s,d,n,s,s,s,s,n",
 				"value": "||taskid||,||classtype||,||classdate||,||attendancecount||,||lessontaught||,||pptlink||,||videolink||,||noteslink||,||lessonuploaded||",
 				"onsuccess": "cmd:dom,fun:showtoast;success;Saving Successful-cmd:dom,fun:html;input[name=classdate];BLANK",
 				"onfailure": "cmd:dom,fun:showtoast;alert;Saving Failed"
 			}
 		},
 		{
 			"id": "7clsgt",
 			"name": "Get Class Details",
 			"sql": {
 				"action": "Get Row",
 				"outputto": "html",
 				"output": "edit",
 				"tbl": "nbbi_classrecord",
 				"fld": "id,taskid,classtype,classdate,attendancecount,lessontaught,pptlink,videolink,noteslink,lessonuploaded",
 				"whr": "id='||id||'",
 				"jsfunction": "edit1"
 			}
 		},
 		{
 			"id": "7clst1",
 			"name": "Get Table-Class",
 			"sql": {
 				"action": "Get HTML",
 				"outputto": "html",
 				"delstmt": "7clsdl",
 				"output": "cls",
 				"datefield": "classdate",
 				"tbl": "nbbi_classrecord",
 				"fld": "classdate,classtype,attendancecount,lessontaught,IF(pptlink <>'',CONCAT('<a href=\\\"',pptlink,'\\\" target=\\\"_blank\\\">PPT</a>'),'') as pptlink,IF(videolink <>'',CONCAT('<a href=\\\"',videolink,'\\\" target=\\\"_blank\\\">Video</a>'),'') as videolink,IF(noteslink <>'',CONCAT('<a href=\\\"',noteslink,'\\\" target=\\\"_blank\\\">Notes</a>'),'') as noteslink,lessonuploaded",
 				"parent": "table ><tr><th>Date</th><th>Type</th><th>*</th><th>Lesson Taught</th><th>PPT</th><th>Video</th><th>Notes</th><th>Lesson Uploaded</th><th></th></tr",
 				"template": "<tr><td style='border:1px solid silver;padding:2px'>||classdate||</td><td style='border:1px solid silver;padding:2px'>||classtype||</td><td style='border:1px solid silver;padding:2px'>||attendancecount||</td><td style='border:1px solid silver;padding:2px'>||lessontaught||</td><td style='border:1px solid silver;padding:2px'>||pptlink||</td><td style='border:1px solid silver;padding:2px'>||videolink||</td><td style='border:1px solid silver;padding:2px'>||noteslink||</td><td style='border:1px solid silver;padding:2px'>||lessonuploaded||</td><td>||delcol||</td></tr>",
 				"whr": "taskid='||taskid||'",
 				"srt": "classdate DESC",
 				"onsuccess": "cmd:dom,fun:html;#_target_3;||cls||"
 			},
 			"delete_record": 1
 		},
 		{
 			"id": "7clst2",
 			"name": "Get ClassRecord Tabs",
 			"sql": {
 				"action": "Return",
 				"outputto": "html",
 				"output": "cls",
 				"value": "<ul data-role='tabs' data-expand-point='sm'><li><a href='#_target_1'>Form</a></li><li><a href='#_target_2' onclick='Eirene.runStmt1(&apos;7clsm2-7clsm1&apos;,&apos;taskid&apos;,&apos;||taskid||&apos;)'>Summary</a></li><li><a href='#_target_3' onclick='Eirene.runStmt1(&apos;7clst1&apos;,&apos;taskid&apos;,&apos;||taskid||&apos;)'>Details</a></li></ul><div class='border bd-default no-border-top p-2'><div id='_target_1'>||GET_frm||</div><div id='_target_2'></div><div id='_target_3'></div></div>",
 				"onsuccess": "cmd:dom,fun:showdialog;Class Record;||cls||-cmd:dom,fun:function;convertSelect;#crct-cmd:dom,fun:function;convertSelect;#crlp"
 			}
 		},
 		{
 			"id": "7clsfm",
 			"name": "Get Class Form",
 			"sql": {
 				"action": "Return",
 				"outputto": "php",
 				"output": "frm",
 				"value": "<div id='classrecord1234' class='row'><div class='cell-md-6'><label>Class</label><div id='crct'><select type='select0' name='classtype' values='Class,Reading Report,Assignment,Class Test'></select></div></div><div class='cell-md-6'><label>Date</label><div><input type='date' name='classdate'/></div></div><div class='cell-md-6'><label>Attendance Count</label><div><input type='number' name='attendancecount'/></div></div><div class='cell-md-6'><label>Lesson Topic</label><div><input type='text' name='lessontaught'/></div></div><div class='cell-md-6'><label>PPT Link</label><div><input type='text' name='pptlink'/></div></div><div class='cell-md-6'><label>Video Link</label><div><input type='text' name='videolink'/></div></div><div class='cell-md-6'><label>Notes Link</label><div><input type='text' name='noteslink'/></div></div><div class='cell-md-6'><label>Lesson Uploaded</label><div id='crlp'><select type='select0' values='0:No,1:Yes' name='lessonuploaded'></select></div></div></div><div><button class='button primary p-2' onclick='Eirene.runStmt(&quot;7clssv&quot;,{taskid:&quot;||taskid||&quot;,classtype:$(&quot;#classrecord1234 select[name=classtype]&quot;).val(),classdate:$(&quot;#classrecord1234 input[name=classdate]&quot;).val(),attendancecount:$(&quot;#classrecord1234 input[name=attendancecount]&quot;).val(),lessontaught:$(&quot;#classrecord1234 input[name=lessontaught]&quot;).val(),pptlink:$(&quot;#classrecord1234 input[name=pptlink]&quot;).val(),videolink:$(&quot;#classrecord1234 input[name=videolink]&quot;).val(),noteslink:$(&quot;#classrecord1234 input[name=noteslink]&quot;).val(),lessonuploaded:$(&quot;#classrecord1234 select[name=lessonuploaded]&quot;).val()})'>Save</button></div>"
 			}
 		},
 		{
 			"id": "7clsdl",
 			"name": "Delete Class Record",
 			"sql": {
 				"action": "Delete Row Permanently",
 				"outputto": "php",
 				"output": "res",
 				"tbl": "nbbi_classrecord",
 				"whr": "id='||ID||'",
 				"onsuccess": "cmd:dom,fun:showtoast;success;Delete Successful",
 				"onfailure": "cmd:dom,fun:showtoast;alert;Delete Failed"
 			}
 		},
 		{
 			"id": "7clsm1",
 			"name": "Get Class Record Summary",
 			"sql": {
 				"action": "Get Matrix",
 				"outputto": "html",
 				"output": "sum",
 				"tbl": "nbbi_classrecord",
 				"fld": "'Total' as rec,classtype,count(*) as val",
 				"whr": "taskid='||taskid||'",
 				"grp": "classtype",
 				"row": "classtype",
 				"col": "rec",
 				"val": "val",
 				"matrixtableclass": "eirene-table dataTable",
 				"onsuccess": "cmd:dom,fun:append;#_target_2;||sum||"

 			}
 		},
 		{
 			"id": "7clsm2",
 			"name": "Get Class Record Summary",
 			"sql": {
 				"action": "Get Matrix",
 				"outputto": "html",
 				"output": "sum1",
 				"tbl": "nbbi_classrecord",
 				"fld": "'This Week' as rec,classtype,count(*) as val",
 				"whr": "YEARWEEK(classdate) = YEARWEEK(NOW()) and taskid='||taskid||'",
 				"grp": "classtype",
 				"row": "classtype",
 				"col": "rec",
 				"val": "val",
 				"matrixtableclass": "eirene-table dataTable",
 				"onsuccess": "cmd:dom,fun:html;#_target_2;||sum1||"

 			}
 		},
 		{
 			"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",
 				"delstmt": "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||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": " and linked_to_institution='||institute||'"
 								},
 								{
 									"if": "||program||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and linked_to_program='||program||'"
 								},
 								{
 									"if": "||state||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and state='||state||'"
 								},
 								{
 									"if": "||name||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and fullname like '%||name||%'"
 								},
 								{
 									"if": "||year||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and admissionyear=||year||"
 								},
 								{
 									"if": "||edumode||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and educationmode='||edumode||'"
 								},
 								{
 									"if": "||gender||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and gender='||gender||'"
 								}
 							]
 						},{
 							"name": "fdef",
 							"displaynone": "1",
 							"whr": [
								"recordstatus=1 and isfaculty!=1", 
 								" and admissionyear=date_format(now(),'%Y')"
							]
						},
 						{
 							"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',{filtertable:'fdef'})"
 						},
 						{
 							"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 and isfaculty!=1",
 				"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||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": " and linked_to_institution='||institute||'"
 								},
 								{
 									"if": "||program||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and linked_to_program='||program||'"
 								},
 								{
 									"if": "||state||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and state='||state||'"
 								},
 								{
 									"if": "||name||",
 									"op": "!=",
 									"value": "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||",
 								"op": "!=",
 								"value": "BLANK",
 								"then": "and linked_to_program='||program||'"
 							},
 							{
 								"if": "||state||",
 								"op": "!=",
 								"value": "BLANK",
 								"then": "and state='||state||'"
 							},
 							{
 								"if": "||name||",
 								"op": "!=",
 								"value": "BLANK",
 								"then": "and fullname like '%||name||%'"
 							},
 							{
 								"if": "||institute||",
 								"op": "!=",
 								"value": "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',{filtertable:'f1',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": "f3",
 							"displaynone": "1",
 							"whr": [
 								"a.recordstatus=1",
 								{
 									"if": "||subid||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and a.subid='||subid||'"
 								},
 								{
 									"if": "||day||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and a.day='||day||'"
 								},
 								{
 									"if": "||faculty||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and a.facultyid='||faculty||'"
 								}
 							]
 						}, {
 							"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",
 				"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,
 				"contentseperator": "<br>",
 				"matrixtableclass": "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',{filtertable:'f3',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"
 						},
 						{
 							"name": "f3",
 							"displaynone": "1",
 							"whr": [
 								"recordstatus=1",
 								{
 									"if": "||institute||",
 									"op": "!=",
 									"value": "BLANK",
 									"then": "and institutename like '%||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",
 				"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',{filtertable:'f3',institute:$('#name').val()})"
 						}
 					]
 				},
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter1;fast-cmd:dom,fun:show;#workareaFilter;fast"
 			}
 		},
 		{
 			"id": "16",
 			"name": "View Time Table (Report Details)",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter1",
 					"elem": [{
 							"name": "f1",
 							"id": "16dtfrom",
 							"caption": "Date From: ",
 							"type": "datepicker",
 							"value": "||CURDATE||"
 						},
 						{
 							"name": "f3",
 							"type": "button",
 							"value": "Add",
 							"onclick": "if(!$('#16dtfrom').val()){showToast('Select Date','alert',5000);return false;}Eirene.runStmt('16loop-14tr',{df:$('#16dtfrom').val(),ds:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-1))),de:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-5)))})"
 						}
 					]
 				},
 				"output": "table",
 				"header": "Subject,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 nbbi_timetable1 d ON d.timetableid=a.id",
 				"fld": "b.title,c.fullname",
 				"srt": "d.dates DESC",
 				"functionfield": [{
 						"type": "group",
 						"caption": "Mon",
 						"grp": [{
 								"if": "a.day=1 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts1',{ID:'<d.id>'})"
 							},
 							{
 								"if": "a.day=1 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts',{ID:'<d.id>'})"
 							}
 						]
 					},
 					{
 						"type": "group",
 						"caption": "Tue",
 						"grp": [{
 								"if": "a.day=2 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done"
 							},
 							{
 								"if": "a.day=2 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done"
 							}
 						]
 					},
 					{
 						"type": "group",
 						"caption": "Wed",
 						"grp": [{
 								"if": "a.day=3 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done"
 							},
 							{
 								"if": "a.day=3 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done"
 							}
 						]
 					},
 					{
 						"type": "group",
 						"caption": "Thu",
 						"grp": [{
 								"if": "a.day=4 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done"
 							},
 							{
 								"if": "a.day=4 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done"
 							}
 						]
 					},
 					{
 						"type": "group",
 						"caption": "Fri",
 						"grp": [{
 								"if": "a.day=5 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done"
 							},
 							{
 								"if": "a.day=5 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done"
 							}
 						]
 					}
 				],
 				"whr": "d.recordstatus=1",
 				"onsuccess": "cmd:dom,fun:show;#workareaFilter1;fast-cmd:dom,fun:show;#workareaFilter;fast-cmd:dom,fun:empty;#workareaAppendix;fast"
 			}
 		},
 		{
 			"id": "16a",
 			"name": "View Rport- Time Table Details",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter1",
 					"elem": [{
 							"name": "f1",
 							"id": "16dtfrom",
 							"caption": "Date From: ",
 							"type": "datepicker",
 							"value": "||CURDATE||"
 						},
 						{
 							"name": "f3",
 							"type": "button",
 							"value": "Add",
 							"onclick": "if(!$('#16dtfrom').val()){showToast('Select Date','alert',5000);return false;}Eirene.runStmt('16loop-14tr',{ds1:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-1))),df:$('#16dtfrom').val(),ds:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()))),de:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-5)))})"
 						},
 						{
 							"name": "f4",
 							"type": "button",
 							"value": "Get",
 							"displaynone": 1,
 							"onclick": "Eirene.runStmt('14tr',{df:$('#16dtfrom').val(),ds:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-1))),de:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-5)))})"
 						}
 					]
 				},
 				"header": "Subject ,Faculty",
 				"prepend": "<center><div style='font-size:1.2em'><b>||ds||(Monday) To ||de|| (Friday)</b></div></br></center>",
 				"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 nbbi_timetable1 d ON d.timetableid=a.id",
 				"fld": "b.title,c.fullname",
 				"functionfield": [{
 						"type": "group",
 						"caption": "Mon",
 						"grp": [{
 								"if": "a.day=1 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							},
 							{
 								"if": "a.day=1 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							}
 						]
 					},
 					{
 						"type": "group",
 						"caption": "Tue",
 						"grp": [{
 								"if": "a.day=2 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							},
 							{
 								"if": "a.day=2 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							}
 						]
 					},
 					{
 						"type": "group",
 						"caption": "Wed",
 						"grp": [{
 								"if": "a.day=3 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							},
 							{
 								"if": "a.day=3 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							}
 						]
 					},
 					{
 						"type": "group",
 						"caption": "Thu",
 						"grp": [{
 								"if": "a.day=4 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							},
 							{
 								"if": "a.day=4 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							}
 						]
 					},
 					{
 						"type": "group",
 						"caption": "Fri",
 						"grp": [{
 								"if": "a.day=5 and d.status=1",
 								"type": "icon",
 								"class": "mif-done",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							},
 							{
 								"if": "a.day=5 and d.status=0",
 								"type": "icon",
 								"class": "mif-cross-light",
 								"title": "Done",
 								"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 							}
 						]
 					}
 				],
 				"whr": "d.recordstatus=1 and d.dates >= '||ds||' and d.dates <= '||de||' ",
 				"onsuccess": "cmd:dom,fun:empty;#workareaAppendix;fast"
 			}
 		},
 		{
 			"id": "14tr",
 			"name": "Time Table Report",
 			"sql": {
 				"action": "Get Matrix",
 				"row": "a",
 				"col": "b",
 				"val": "days",
				"additionalcol":"class",
 				"outputto": "html",
 				"output": "#workareaTablebox",
 				"elem": {
 					"parent": "div",
 					"output": "#workareaFilter1",
 					"elem": [{
 							"name": "f1",
 							"id": "16dtfrom",
 							"caption": "Date From: ",
 							"type": "datepicker",
 							"value": "||CURDATE||"
 						},
 						{
 							"name": "f3",
 							"type": "button",
 							"value": "Add",
 							"onclick": "if(!$('#16dtfrom').val()){showToast('Select Date','alert',5000);return false;}Eirene.runStmt('16loop-14tr',{ds1:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-1))),df:$('#16dtfrom').val(),ds:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay())+1)),de:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-6)))})"
 						},
 						{
 							"name": "f3a",
 							"type": "button",
 							"value": "Delete",
 							"onclick": "if(!$('#16dtfrom').val()){showToast('Select Date','alert',5000);return false;}Eirene.runStmt('14trd',{confirmBeforeProcess:'Check action before you proceed.',ds:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay())+1)),de:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-6)))})"
 						},
 						{
 							"name": "f4",
 							"type": "button",
 							"value": "Get",
 							"displaynone": 1,
 							"onclick": "Eirene.runStmt('14tr',{df:$('#16dtfrom').val(),ds:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-1))),de:formatDate(new Date($('#16dtfrom').val()).addDays(-(new Date($('#16dtfrom').val()).getDay()-5)))})"
 						}
 					]
 				},
 				"tbl": "nbbi_timetable a",
 				"prepend": "<center><div style='font-size:1.2em'><b>||ds||(Monday) To ||de|| (Saturday)</b></div></br></center>",
 				"join": "LEFT JOIN online_course b ON a.subid=b.id LEFT JOIN online_course_users c ON a.facultyid=c.id LEFT JOIN nbbi_timetable1 d ON d.timetableid=a.id",
 				"matrixtableclass": "dataTable font-ArialNarrow",
 				"matrixtablestyle": "border:1px solid black;border-collapse:collapse;margin-left:2cm;margin-top:0.5cm;width:75%;font-size:0.8em",
 				"fld": "CONCAT(b.title,'(',a.class,'-',c.fullname,')') as a,a.class,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 b",
 				"srt": "a.day",
 				"functionfield": [{
 					"type": "group",
 					"caption": "days",
 					"grp": [{
 							"if": "a.day=1 and d.status=1",
 							"type": "icon",
 							"class": "mif-done",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						},
 						{
 							"if": "a.day=1 and d.status=0",
 							"type": "icon",
 							"class": "mif-cross-light",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						},
 						{
 							"if": "a.day=2 and d.status=1",
 							"type": "icon",
 							"class": "mif-done",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						},
 						{
 							"if": "a.day=2 and d.status=0",
 							"type": "icon",
 							"class": "mif-cross-light",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						},
 						{
 							"if": "a.day=3 and d.status=1",
 							"type": "icon",
 							"class": "mif-done",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						},
 						{
 							"if": "a.day=3 and d.status=0",
 							"type": "icon",
 							"class": "mif-cross-light",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						},
 						{
 							"if": "a.day=4 and d.status=1",
 							"type": "icon",
 							"class": "mif-done",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						},
 						{
 							"if": "a.day=4 and d.status=0",
 							"type": "icon",
 							"class": "mif-cross-light",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						},
 						{
 							"if": "a.day=5 and d.status=1",
 							"type": "icon",
 							"class": "mif-done",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts1-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						},
 						{
 							"if": "a.day=5 and d.status=0",
 							"type": "icon",
 							"class": "mif-cross-light",
 							"title": "Done",
 							"onclick": "Eirene.runStmt('16sts-14tr',{ID:'<d.id>',ds:'||ds||',de:'||de||'})"
 						}
 					]
 				}],
 				"whr": "d.recordstatus=1 and d.dates >= '||ds||' and d.dates <= '||de||' ",
 				"onsuccess": "cmd:dom,fun:empty;#workareaAppendix;fast"
 			}
 		},
 		{
 			"id": "14trd",
 			"name": "Delete Time Table Report",
 			"sql": {
 				"action": "Delete Row",
 				"outputto": "php",
 				"output": "res",
 				"tbl": "nbbi_timetable1",
 				"whr": "dates >= '||ds||' and dates <= '||de||' ",
 				"onsuccess": "cmd:dom,fun:showtoast;success;Delete Successful",
 				"onfailure": "cmd:dom,fun:showtoast;alert;Delete Failed"
 			}
 		},
 		{

 			"id": "16sts",
 			"name": "Save Status(Time Table1)",
 			"sql": {
 				"action": "Save Row",
 				"outputto": "php",
 				"tbl": "nbbi_timetable1",
 				"fld": "status",
 				"value": "1",
 				"fldtype": "n",
 				"command": "update",
 				"whr": "id= '||ID||'",
 				"onsuccess": "cmd:dom,fun:showtoast;success;Saving Successful",
 				"onfailure": "cmd:dom,fun:showtoast;alert;Saving Failed"
 			}
 		},
 		{

 			"id": "16sts1",
 			"name": "Save Status(Time Table1)",
 			"sql": {
 				"action": "Save Row",
 				"outputto": "php",
 				"tbl": "nbbi_timetable1",
 				"fld": "status",
 				"value": "0",
 				"fldtype": "n",
 				"command": "update",
 				"whr": "id= '||ID||'",
 				"onsuccess": "cmd:dom,fun:showtoast;success;Saving Successful",
 				"onfailure": "cmd:dom,fun:showtoast;alert;Saving Failed"
 			}
 		},
 		{
 			"id": "16loop",
 			"name": "Loop for Time table1",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"output": "res",
 				"multistmt": [{
 						"action": "Get Value",
 						"outputto": "php",
 						"output": "chk",
 						"stmt": "SELECT count(dates) FROM nbbi_timetable1 where dates='||ds1||' and recordstatus=1"
 					},
 					{
 						"precheck": [{
 							"if": "||GET_chk||",
 							"op": "=",
 							"value": "0"
 						}],
 						"action": "Loop",
 						"output": "res",
 						"outputto": "php",
 						"looptype": "number",
 						"start": "0",
 						"end": "6",
 						"loopsqlid": "16svtt"
 					},
 					{
 						"action": "IF",
 						"outputto": "php",
 						"output": "chk1",
 						"value": "||GET_chk||",
 						"value1": "0",
 						"op": "!=",
 						"then": "cmd:dom,fun:showtoast;alert;Report is already added You can mark it now"
 					}
 				]
 			}
 		},
 		{
 			"id": "16svtt",
 			"name": "Add Time Table Details(Time Table1)",
 			"sql": {
 				"action": "MULTISTMT",
 				"outputto": "php",
 				"output": "res",
 				"multistmt": [

 					{

 						"action": "Run",
 						"outputto": "php",
 						"output": "res",
 						"stmt": "INSERT INTO nbbi_timetable1(id,subid,dates,timetableid,createdby) SELECT UUID(),subid,date_add('||ds||',interval ||currentloopvalue|| day),id,'||USERID||' FROM nbbi_timetable WHERE day='||currentloopvalue||' and recordstatus=1",
 						"onfailure": "cmd:dom,fun:showtoast;alert;Adding Failed",
 						"onsuccess": "cmd:dom,fun:showtoast;success;Report Added You can mark it now"

 					}
 				]
 			}
 		},
 		{
 			"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": "20",
 			"name": "Payment Details",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "#workareaAppendix",
				"prepend": "<div class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'><div><span class='mif-plus mr-2 fg-blue' onclick='showForm(&apos;nbbi_payments&apos;);$(&apos;#taskid&apos;).val(&apos;||TID||&apos;)'></span> Payment Details</div>",
 				"append":"</div>", 				
 				"tbl": "nbbi_payments a",
 				"join": "INNER JOIN nbbi_contacts b ON a.contactid=b.id",
 				"fld": "DATE_FORMAT(a.paymentdate,'%d-%m-%Y'),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",
 				"whr": "a.taskid='||TID||'",
 				"srt": "a.createdon",
				"vsum":"5",
 				"appendoutput":1,
 				"header": "Date,Contact Name,Purpose,Payment Mode,Amount",
 				"functionfield": [{
 						"if": "bill!=''",
 						"type": "googlelink",
 						"href": "<bill>",
 						"value": "Link", 						
						"caption":"Bill",
						"target": "_blank"
 					},
 					{
 						"if": "pconfirmationlink!=''",
 						"type": "googlelink",
 						"href": "<a.pconfirmationlink>",
 						"value": "Link",
 						"target": "_blank",
						"caption":"Payment Confirmation"
 					},
 					{
 						"type": "group",
 						"caption": "Function",
 						"grp": [{
 								"type": "icon",
 								"class": "icon mif-hammer mr-2",
 								"title": "In Progress",
 								"caption": "In Progress",
 								"onclick": "Eirene.runStmt('',{ID:'<a.id>'})"
 							}, {
 								"type": "icon",
 								"class": "icon mif-done mr-2",
 								"title": "Done",
 								"caption": "Done",
 								"onclick": "Eirene.runStmt('',{ID:'<a.id>'})"
 							}, {
 								"type": "icon",
 								"class": "icon mif-stack mr-2",
 								"title": "Archive",
 								"caption": "Archive",
 								"onclick": "Eirene.runStmt('',{ID:'<a.id>'})"
 							},
 							{
 								"type": "icon",
 								"class": "icon mif-pencil",
 								"title": "Edit Record",
 								"onclick": "edit(&apos;payment&apos;,'<a.id>',true)"
 							},
 							{
 								"type": "icon",
 								"class": "icon mif-cross",
 								"title": "Delete Record",
 								"onclick": "Eirene.runStmt2('20pdt','ID','<a.id>')"
 							}
 						]
 					}
 				],
 				"onsuccess": "cmd:dom,fun:show;#workareaAppendix"
 			}

 		}, 		
 		{
 			"id": "21",
 			"name": "Links",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": {"if":"||updateTable||","op":"=","value":"1","then":"#task_linktable","else":"#workareaAppendix"},
				"prepend": [
							"<div id='task_linktable' class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'>",
							"<div>Links</div>",
							"<input type='hidden' id='21_id'/>",
							"<div><span>Name</span><input type='text' id='21_name'/>",
							"<span>Link</span><input type='text' id='21_link'/>",
							"<span>Link Type</span><select class='select0' values='Image,PDF,Word,Excel,Other,Featured Image1,Featured Image2,Featured Image3,Featured Image4' type='text' id='21_linktype'/>",
							"<span>Remark</span><input type='text' id='21_remark'/>",
							"<span>Porder</span><input type='text' id='21_porder'/>",
							"<button class='button ml-2' onclick='Eirene.runStmt(&apos;21lsv-21&apos;,{ID:$(&apos;#21_id&apos;).val(),taskid:&apos;||TID||&apos;,TID:&apos;||TID||&apos;,lname:$(&apos;#21_name&apos;).val(),link:$(&apos;#21_link&apos;).val(),remark:$(&apos;#21_remark&apos;).val(),linktype:$(&apos;#21_linktype&apos;).val(),porder:$(&apos;#21_porder&apos;).val(),updateTable:&apos;1&apos;})'>Save</button>",
							"Multiple Links <textarea id='multilink'></textarea>",
							"<button class='button ml-2' onclick='Eirene.runStmt(&apos;21csv-21&apos;,{taskid:&apos;||TID||&apos;,TID:&apos;||TID||&apos;,lname:$(&apos;#21_name&apos;).val(),csv:$(&apos;#multilink&apos;).val(),remark:$(&apos;#21_remark&apos;).val(),linktype:$(&apos;#21_linktype&apos;).val(),updateTable:&apos;1&apos;})'>Save Bulk</button></div>"
						],				
 				"append":"</div><script>convertSelect('#workareaAppendix')</script>", 				
 				"tbl": "nbbi_links",
 				"fld": "lname,linktype,porder,remark",
 				"whr": "taskid='||TID||'",
 				"srt": "createdon,porder",
 				"appendoutput":{"if":"||updateTable||","op":"=","value":"1","then":false,"else":true},
 				"header": "Name,Type,Order,Remark,Task Link,",
 				"functionfield": [{
 						"if": "link!=''",
 						"type": "googlelink",
 						"href": "<link>",
 						"value": "Link",
 						"target": "_blank" 						
 					},
 					{
 						"type": "group",
 						"caption": "Function",
 						"grp": [{
 								"type": "icon",
 								"class": "icon mif-pencil",
 								"title": "Edit Record",
 								"onclick": "$('#21_id').val('<id>');$('#21_name').val('<lname>');$('#21_link').val('<link>');$('#21_linktype').val('<linktype>');$('#21_remark').val('<remark>');$('#21_porder').val('<porder>');"
 							},
 							{
 								"type": "icon",
 								"class": "icon mif-cross",
 								"title": "Delete Record",
 								"onclick": "Eirene.runStmt2('21ldt','ID','<id>')"
 							}
 						]
 					}
 				]
 			}
 		},
 		{
 			"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": "22",
 			"name": "Journal",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output":{"if":"||updateTable||","op":"=","value":"1","then":"#task_journaltable","else":"#workareaAppendix"},
				"prepend": [
							"<div id='task_journaltable' class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'><div>Journal</div>",
							"<div><input type='hidden' id='22_id'/><span>Date</span><input type='date' id='22_jdate'/><span>Title</span><input type='text' id='22_title'/><span>Remark</span><input type='text' id='22_remark'/><button class='button ml-2' onclick='Eirene.runStmt(&apos;22jsv-22&apos;,{ID:$(&apos;#22_id&apos;).val(),taskid:&apos;||TID||&apos;,TID:&apos;||TID||&apos;,jdate:$(&apos;#22_jdate&apos;).val(),title:$(&apos;#22_title&apos;).val(),remark:$(&apos;#22_remark&apos;).val(),updateTable:1})'>Save</button></div>"
						],
 				"append":"</div>", 				
 				"tbl": "nbbi_journal",
 				"fld": "DATE_FORMAT(jdate,'%d-%m-%Y')as jdate,title,remark",
 				"whr": "taskid='||TID||'",
 				"srt": "jdate DESC",
 				"appendoutput":{"if":"||updateTable||","op":"=","value":"1","then":"0","else":"1"},
 				"header": "Date,Title,Remark,",
 				"functionfield": [
 					{
 						"type": "group",
 						"caption": "Function",
 						"grp": [{
 								"type": "icon",
 								"class": "icon mif-pencil",
 								"title": "Edit Record",
 								"onclick": "$('#22_id').val('<id>');$('#22_jdate').val('<jdate>');$('#22_title').val('<title>');$('#22_remark').val('<remark>');"
 							},
 							{
 								"type": "icon",
 								"class": "icon mif-cross",
 								"title": "Delete Record",
 								"onclick": "Eirene.runStmt('22jdt-22',{ID:'<id>',TID:'||TID||',updateTable:'1',confirmBeforeProcess:'Confirm delete. You will not be able to recover data.'})"
 							}
 						]
 					}
 				]
 			}
 		},
 		{
 			"id": "22a",
 			"name": "Query List",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output":{"if":"||updateTable||","op":"=","value":"1","then":"#task_querytable","else":"#workareaAppendix"},
				"prepend": [
							"<div id='task_querytable' class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'><div>Query</div>",
							"<div><input type='hidden' id='22a_id'/><span>Query</span><input type='text' id='22a_query' maxlength='300' class='mr-2'/><span>Response</span><input type='text' id='22a_response' maxlength='300' class='mr-2'/><button class='button ml-2' onclick='Eirene.runStmt(&apos;22asv-22a&apos;,{ID:$(&apos;#22a_id&apos;).val(),taskid:&apos;||TID||&apos;,TID:&apos;||TID||&apos;,query:$(&apos;#22a_query&apos;).val(),response:$(&apos;#22a_response&apos;).val(),updateTable:1})'>Save</button></div>"
						],
 				"append":"</div>", 				
 				"tbl": "nbbi_query",
 				"fld": "query,response",
 				"whr": "taskid='||TID||'", 				
 				"appendoutput":{"if":"||updateTable||","op":"=","value":"1","then":"0","else":"1"},
 				"header": "Query,Response,",
 				"functionfield": [
 					{
 						"type": "group",
 						"caption": "Function",
 						"grp": [{
 								"type": "icon",
 								"class": "icon mif-pencil",
 								"title": "Edit Record",
 								"onclick": "$('#22a_id').val('<id>');$('#22a_query').val('<query>');$('#22a_response').val('<response>');"
 							},
 							{
 								"type": "icon",
 								"class": "icon mif-cross",
 								"title": "Delete Record",
 								"onclick": "Eirene.runStmt('22adel-22a',{ID:'<id>',TID:'||TID||',updateTable:'1',confirmBeforeProcess:'Confirm delete. You will not be able to recover data.'})"
 							}
 						]
 					}
 				]
 			}
 		},
 		{
 			"id": "22asv",
 			"name": "Save Query",
 			"sql": {
 				"action": "Save Table",
 				"outputto": "php",
 				"output": "res",
 				"command": "insertorupdate",
 				"tbl": "nbbi_query",
 				"fld": "query,response,taskid",
 				"fldtype": "s,s,u",
 				"value": "||query||,||response||,||taskid||",
 				"whr": "id='||ID||'",
 				"onsuccess": "cmd:dom,fun:showtoast;success;Saving successful",
 				"onfailure": "cmd:dom,fun:showtoast;alert;Saving failed"
 			}
 		},
 		{
 			"id": "22asv1",
 			"name": "Save Query-Response",
 			"sql": {
 				"action": "Save Table",
 				"outputto": "php",
 				"output": "res",
 				"command": "update",
 				"tbl": "nbbi_query",
 				"fld": "response",
 				"fldtype": "s",
 				"value": "||response||",
 				"whr": "id='||ID||'",
 				"onsuccess": "cmd:dom,fun:showtoast;success;Saving successful",
 				"onfailure": "cmd:dom,fun:showtoast;alert;Saving failed"
 			}
 		},
 		{
 			"id": "22adel",
 			"name": "Delete",
 			"sql": {
 				"action": "Delete Row Permanently",
 				"outputto": "php",
 				"output": "res",
 				"tbl": "nbbi_query",
 				"whr": "id='||ID||'",
 				"onsuccess": "cmd:dom,fun:showtoast;success;Delete Successful",
 				"onfailure": "cmd:dom,fun:showtoast;alert;Delete failed"
 			}
 		},		
 		{
 			"id": "22svr",
 			"name": "Save Remark- Journal",
 			"sql": {
 				"action": "Save Row",
 				"outputto": "php",
 				"tbl": "nbbi_journal",
 				"fld": "remark",
 				"value": "||remark||",
 				"fldtype": "s",
 				"command": "update",
 				"whr": "id='||ID||' ",
 				"onsuccess": "cmd:dom,fun:showtoast;success;Saving Successful"
 			}
 		},
 		{
 			"id": "22b",
 			"name": "Planner List",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output":{"if":"||updateTable||","op":"=","value":"1","then":"#task_communicationtable","else":"#workareaAppendix"},
				"prepend": [
							"<div id='task_communicationtable' class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'><div><b>Planner</b></div>",
							"<div><input type='hidden' id='22b_id'/>",
							"<span>People</span><input type='text' id='22b_people' maxlength='60' class='mr-2'/>",
							"<span>Date From</span><input type='date' id='22b_datefrom' class='mr-2'/>",
							"<span>Date To</span><input type='date' id='22b_dateto' class='mr-2'/>",
							"<span>Plan</span><input type='text' id='22b_communication' maxlength='300' class='mr-2'/>",
							"<span>Status</span><select id='22b_status' class='mr-2'><option value='0'>0-Planned</option><option value='1'>1-Completed</option></select>",
							"<button class='button ml-2' onclick='Eirene.runStmt(&apos;22b1sv-22b&apos;,{ID:$(&apos;#22b_id&apos;).val(),taskid:&apos;||TID||&apos;,TID:&apos;||TID||&apos;,people:$(&apos;#22b_people&apos;).val(),communication:$(&apos;#22b_communication&apos;).val(),status:$(&apos;#22b_status&apos;).val(),datefrom:$(&apos;#22b_datefrom&apos;).val(),dateto:$(&apos;#22b_dateto&apos;).val(),updateTable:1})'>Save</button></div>"
						],
 				"append":"</div>", 				
 				"tbl": "nbbi_communication",
 				"fld": "people,DATE_FORMAT(datefrom,'%d-%M-%Y'),DATE_FORMAT(dateto,'%d-%M-%Y'),communication,status",								
 				"whr": "taskid='||TID||'", 	
				"srt":"datefrom",
 				"appendoutput":{"if":"||updateTable||","op":"=","value":"1","then":"0","else":"1"},
 				"header": "People,From Date,To Date,Plans,Status,",
 				"functionfield": [
 					{
 						"type": "group",
 						"caption": "Function",
 						"grp": [{
 								"type": "icon",
 								"class": "icon mif-pencil",
 								"title": "Edit Record",
 								"onclick": "$('#22b_id').val('<id>');$('#22b_people').val('<people>');$('#22b_communication').val('<communication>');$('#22b_status').val('<status>');$('#22b_datefrom').val('<datefrom>');$('#22b_dateto').val('<dateto>');"
 							},
 							{
 								"type": "icon",
 								"class": "icon mif-cross",
 								"title": "Delete Record",
 								"onclick": "Eirene.runStmt('22b1dt-22b',{ID:'<id>',TID:'||TID||',updateTable:'1',confirmBeforeProcess:'Confirm delete. You will not be able to recover data.'})"
 							}
 						]
 					}
 				]
 			}
 		},
 		{
			"id":"22blst",
			"name":"Get Planner List",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table",
				"tbl":"nbbi_communication a",
				"join":"INNER JOIN nbbi_tasks c ON a.taskid=c.id",
				"fld":"c.task,a.datefrom,a.dateto,a.people,a.communication",
				"datefield":"a.datefrom,a.dateto",
				"header":"Task,From Date,To Date,People,Plans",
				"functionfield":[
					{
						"name":"35plnchk",
						"type":"switch",
						"value":"<a.status>",
						"onchange":"let status=0;if($(this).prop('checked')){status=1;}Eirene.runStmt('22b1sv',{status:status,ID:'<a.id>'})",						
						"title":"Save",
						"dataon":"Done",
						"dataoff":"Plan"
					},
					{						
						"type": "icon",
						"class":"mif-pencil",
						"caption":"Edit",
						"onclick":"Eirene.runStmt('22b1gt',{ID:'<a.id>'})"
					},{						
						"type": "icon",
						"class":"mif-cross",
						"caption":"Del",
						"onclick":"Eirene.currentelem=$(this).parent().parent();Eirene.runStmt('22b1dt',{ID:'<a.id>'})"
					}
				],
				"whr":[
					"a.recordstatus=1",
					{"if":"||fromdate||","op":"!=","value":"BLANK","andif":"||todate||","andop":"!=","andvalue":"BLANK","then":" and DATE(a.datefrom) between '||fromdate||' and '||todate||'","else":" and a.status =0"}
				],
				"srt":"a.datefrom",
				"onsuccess":"cmd:dom,fun:function;convertSelect;#workareaTablebox"
			}
		},{
			"id":"22bflt",
			"name":"Planner Filter",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"res",
				"value":"",
				"elem":{
					"outputto":"html",
					"output":"#workareaFilter1",
					"elem":[
						{
							"name":"f1",
							"id":"22bflt-f1",
							"label":"From",
							"class":"mr-2",
							"type":"datepicker"							
						},{
							"name":"f2",
							"id":"22bflt-f2",
							"label":"To",
							"class":"mr-2",
							"type":"datepicker"							
						},
						{
							"name": "f4",
							"type": "button",
							"value": "Get",
							"onclick": "Eirene.runStmt('22blst',{fromdate:$('#22bflt-f1').val(),todate:$('#22bflt-f2').val()})"
						}
					]
				}
			}
		},
		{
			"id":"23fcnt",
			"name":"Featured Content",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"","appendoutput":1,
				"value":"",
				"elem":{
					"parent": "div",
					"style":"padding:20px 10px;background-color:#eef5f9;border-radius:10px",
 					"output": "#workareaAppendix","appendoutput":1,
 					"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,title FROM nbbi_journal where taskid='||TID||' UNION SELECT id,checklistname FROM nbbi_checklist where taskid='||TID||'",
							"label":"Featured Content 1",
							"onchange":"Eirene.runStmt('23fcsv',{taskid:'||TID||',contentnumber:'content1',contentvalue:$('#23_f1').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,title FROM nbbi_journal where taskid='||TID||' UNION SELECT id,checklistname FROM nbbi_checklist where taskid='||TID||'",
							"label":"Featured Content 2",
							"onchange":"Eirene.runStmt('23fcsv',{taskid:'||TID||',contentnumber:'content2',contentvalue:$('#23_f2').val()});"							
						},{
							"name": "f3",
							"id": "23_f3",
							"type": "select",
							"selectedvalue":"SELECT featuredcontent3 FROM nbbi_tasks where id='||TID||'",
							"option":"SELECT '','' UNION SELECT id,title FROM nbbi_journal where taskid='||TID||' UNION SELECT id,checklistname FROM nbbi_checklist where taskid='||TID||'",
							"label":"Featured Content 3",
							"onchange":"Eirene.runStmt('23fcsv',{taskid:'||TID||',contentnumber:'content3',contentvalue:$('#23_f3').val()});"							
						}
					]
				}
			}
		},{
			"id":"23fcsv",
			"name":"Save Featured Content Task",
			"sql":{
				"action":"Save Table",
				"outputto":"php","output":"res",
				"command":"update",
				"tbl":"nbbi_tasks",
				"fld":{"case":"||contentnumber||","content1":"featuredcontent1","content2":"featuredcontent2","content3":"featuredcontent3"},
				"fldtype":"u",
				"whr":"id='||taskid||'",
				"value":"||contentvalue||",
				"onsuccess":"cmd:dom,fun:showtoast;success;Saving Successful",
				"onfailure":"cmd:dom,fun:showtoast;alert;Saving Failed"
			}
		},
 		{
 			"id": "23",
 			"name": "Sub Task List",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "#workareaAppendix",
 				"prepend": "<div class='mt-4' style='padding:20px 10px;background-color:#eef5f9;border-radius:10px;'><div><span class='mif-plus mr-2 fg-blue' onclick='showForm(&apos;nbbi_tasks 1&apos;);$(&apos;#taskid&apos;).val(&apos;||TID||&apos;)'></span> Sub Task</div>",
 				"append":"</div>",
				"formname": "task",
 				"appendoutput":1,
 				"tbl": "nbbi_tasks a",
 				"join": "INNER JOIN eirene_users b ON a.assignedto=b.id",
 				"fld": "CONCAT('<a onclick=\\\"Eirene.runStmt(&apos;23fcnt-23-20-21-22-22a-22b-33tbl-34tbl&apos;,{TID:&apos;',a.id,'&apos;})\\\">',a.task,'</a>')as task,b.fullname,a.beginningdate,a.enddate",
 				"whr": "a.taskid='||TID||'",
 				"srt": "a.enddate",
 				"header": "Task,Assigned To,Beginning Date,End Date",
 				"functionfield": [
					{
						"prepend":true,
						"type":"select",
						"option":"SELECT id,projectname FROM nbbi_project where assignedto='||userid||' and recordstatus=1",
						"caption":"Project",
						"value":"<a.department>",
						"onchange":"Eirene.runStmt('1tksav',{department:$(this).val(),ID:'<a.id>'})"
					},{
						"type":"select",
						"option":"1:Created,2:In Progress,3:Done,4:Archived",
						"caption":"Status",
						"value":"<a.status>",
						"onchange":"Eirene.runStmt('1tksav',{status:$(this).val(),ID:'<a.id>'})"
					},
					{
 					"type": "group",
 					"caption": "Function",
 					"grp": [
 						{
 							"type": "icon",
 							"class": "icon mif-pencil",
 							"title": "Edit Record",
 							"onclick": "edit('task','<a.id>',true)"
 						},
 						{
 							"type": "icon",
 							"class": "icon mif-cross",
 							"title": "Delete Record",
 							"onclick": "Eirene.runStmt2('1tkdel','ID','<a.id>')"
 						},
						{
							"type": "icon",
							"class": "icon mif-printer mr-2",
							"title": "Print",
							"onclick": "Eirene.runStmt('34trep',{taskid:'<a.id>'})"
						}
 					]
 				}]
 			}

 		},
 		 		
 		{
 			"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":"26cflt",
			"name":"Course Allotment Filter",
			"sql":{
				"action":"Return",
				"outputto":"php",
				"output":"res",
				"elem": [
					{
						"parent": "div",
						"output": "#workareaFilter",						
						"elem": [{
							"name": "f1",
							"type": "buttonspan",
							"icon": "mif-plus fg-red",
							"value": "",
							"onclick": "showForm('nbbi_courseallotment 1')",
							"title": "Add Course Allotment"
						}, {
							"name": "f2",
							"type": "button",
							"value": "Course Allotments",
							"onclick": "Eirene.runStmt('26calt',{mode:$('#26caf4').val(),term:'',faculty:'',academicyear:''})",
							"title": "Course Allotments"
						}]
					},{
						"parent": "div",
						"output": "#workareaFilter1",						
						"elem": [{
							"name": "f1",
							"id":"26caf1",
							"label":"Faculty",
							"type": "select",
							"option": "select '','' UNION select id,fullname FROM online_course_users where linked_to_institution='NBBI' and isfaculty=1 and status=1"
						}, {
							"name": "f2",
							"id":"26caf2",
							"label":"Academic year",
							"type": "text",
							"value": ""							
						}, {
							"name": "f3",
							"id":"26caf3",
							"label":"Term",
							"type": "select",
							"option": ",1,2,3"							
						}, {
							"name": "f4",
							"id":"26caf4",
							"label":"Mode",
							"type": "select",
							"option": ",Residential,Online"							
						}, {
							"name": "f5",							
							"type": "button",
							"value": "Search",
							"class":"ml-2",
							"onclick":"Eirene.runStmt('26calt',{mode:$('#26caf4').val(),term:$('#26caf3').val(),faculty:$('#26caf1').val(),academicyear:$('#26caf2').val()})"
						}, {
							"name": "f6",							
							"type": "button",
							"value": "Print",
							"class":"ml-2",
							"onclick":"Eirene.runStmt('26capr',{mode:$('#26caf4').val(),term:$('#26caf3').val(),faculty:$('#26caf1').val(),facultyname:$('#26caf1 option:selected').text(),academicyear:$('#26caf2').val()})"
						}, {
							"name": "f7",							
							"type": "button",
							"value": "Email",
							"class":"ml-2",
							"onclick":"showDialog('Send Email',$('#f7-hiddendiv').html(),'warning',[{caption: 'Email',cls: 'js-dialog-close alert',onclick: function(){Eirene.runStmt('26cael',{emailto:$('input[name=f7-text]')[1].value,mode:$('#26caf4').val(),term:$('#26caf3').val(),faculty:$('#26caf1').val(),facultyname:$('#26caf1 option:selected').text(),academicyear:$('#26caf2').val()});}}])",
							"append":"<div id='f7-hiddendiv' style='display:none;'>Enter Email ID<input class='ml-2' type='text' name ='f7-text'></div>"
						}]
					}
				],
				"onsuccess":"cmd:dom,fun:show;#workareaFilter;slow-cmd:dom,fun:show;#workareaFilter1;slow-cmd:dom,fun:empty;#workareaAppendix;slow"				
			}
		},
 		{
 			"id": "26calt",
 			"name": "Get Course Allotment List",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "table",
 				"tbl": "nbbi_courseallotment a",
				"fld":"b.titleprint,a.program,a.mode,a.term,a.credit,a.academicyear,c.fullname",
				"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,Year,Faculty",
				"whr":[
					"a.recordstatus=1",
					{"if":"||faculty||","op":"!=","value":"BLANK","then":"and a.facultyid='||faculty||'"},
					{"if":"||academicyear||","op":"!=","value":"BLANK","then":"and a.academicyear='||academicyear||'"},
					{"if":"||term||","op":"!=","value":"BLANK","then":"and a.term='||term||'"},
					{"if":"||mode||","op":"!=","value":"BLANK","then":"and a.mode='||mode||'"}
				],				
				"functionfield": [{
 					"type": "group",
 					"caption": "Function",
 					"grp": [{
 							"type": "icon",
 							"class": "icon mif-pencil",
 							"title": "Edit Record",
 							"onclick": "edit('courseallotment','<a.id>',true)",
 							"caption": "Edit"
 						},
 						{
 							"type": "icon",
 							"class": "icon mif-cross",
 							"title": "Delete Record",
 							"onclick": "Eirene.runStmt2('26cadt','ID','<a.id>')",
 							"caption": "DeleteRecord"
 						}
 					]
 				}]				
 			}
 		},{
			"id": "26capr",
 			"name": "Get PDF 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,a.program,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||'"
					},{
						"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'><div style='font-family:&apos;Times New Roman&apos;;font-size:11pt;margin: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>(||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||","op":"=","value":"Residential","then":"Registrar","else":"Online Coordinator"},
							"</b><br><span>NBBI</span><span style='margin-left:12.5cm'>NBBI Faculty</span></div></div>"						
						]
					}
				]
			}
		},{
			"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||","op":"=","value":"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",
				"formname": "online_course",
				"fld": "a.title,c.fullname,a.programlinked,(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"
				],
				"whr": "a.status=1 and a.institute='NBBI'",
				"merge": {
					"sqlid": "27btn",
					"node": "elem"
				},
				"header": "Title,Author,Program,Lesson Count",
				"functionfield":[
					{
						"type": "icon",
						"class": "icon mif-pencil ml-2",
						"onclick": "edit('online_course','<a.id>',true);"
					}
				],
				"elem": {
					"output": "#workareaFilter",
					"parent": "div",
					"elem": [{
							"name": "f1",
							"value": "Active",
							"onclick": "Eirene.runStmt('27lt',{filtertable:'f1'});$('#flt_s').val(1);$('#flt_rs').val(1);",
							"whr": "a.status=1 and a.institute='NBBI'"
						},
						{
							"name": "f2",
							"value": "Inactive",
							"onclick": "Eirene.runStmt('27lt',{filtertable:'f2'});$('#flt_s').val(0);$('#flt_rs').val(1);",
							"whr": "a.status=0 and a.institute='NBBI'"
						},
						{
							"name": "f3",
							"onclick": "Eirene.runStmt('27lt',{filtertable:'f3'});$('#flt_s').val(0);$('#flt_rs').val(0);",
							"value": "Deleted",
							"whr": "a.recordstatus=0 and a.institute='NBBI'"
						},
						{
							"name": "f4",
							"displaynone": 1,
							"whr": "a.authorid='||auth||' and a.institute='NBBI' and a.recordstatus=||rs|| and a.status=||s||"
						}
					]
				},
				"onsuccess": "cmd:dom,fun:show;#workareaFilter;fast"
			}
		}, {
			"id": "27flt",
			"name": "Course List Filter",
			"sql": {
				"action": "Return",
				"outputto": "php",
				"output": "demo",
				"value": "",
				"elem": {
					"output": "#workareaFilter1",
					"parent": "div",
					"elem": [{
							"name": "f1",
							"type": "select",
							"id": "flt_onlineauthor",
							"option": "SELECT id,authorname FROM online_author where recordstatus=1 and linked_to_institution='NBBI'"
						},
						{
							"name": "f2",
							"type": "button",
							"value": "Get",
							"onclick": "Eirene.runStmt('27lt',{filtertable:'f4',auth:$('#flt_onlineauthor').val(),rs:$('#flt_rs').val(),s:$('#flt_s').val()})"
						},
						{
							"name": "f3",
							"type": "hidden",
							"id": "flt_rs",
							"value": "1"
						},
						{
							"name": "f4",
							"type": "hidden",
							"id": "flt_s",
							"value": "1"
						}
					]
				},
				"onsuccess": "cmd:dom,fun:show;#workareaFilter1;fast"
			}
		},{
			"id":"28sv",
			"name":"Save Faculty Attendance",
			"sql":{
				"action":"IF",
				"outputto":"php",
				"output":"res",
				"validate":"eirene_users",
				"tbl":"eirene_meta",
				"fld":"pdata",
				"whr":"pname='Timetable'",
				"value":"Normal",
				"then":"28svp1",
				"else":"28svp2"
			}
		},{
			"id":"28svp1",
			"name":"Get Period Number-Normal",
			"sql":{
				"action":"Get Value",
				"outputto":"php",
				"output":"period",
				"tbl":"eirene_users",
				"fld":"(CASE when now() between time('08:30:00') and time('09:20:00') then 1 when now() between time('09:20:01') and time('10:10:00') then 2 when now() between time('11:20:00') and time('12:10:00') then 3 when now() between time('12:10:01') and time('13:00:00') then 4  else 5  end) period",
				"limit":"1",
				"onsuccess":"28sv2"
			}
		},{
			"id":"28svp2",
			"name":"Get Period Number-Normal",
			"sql":{
				"action":"Get Value",
				"outputto":"php",
				"output":"period",
				"tbl":"eirene_users",
				"fld":"(CASE when now() between time('09:00:00') and time('09:45:00') then 1 when now() between time('09:45:01') and time('10:30:00') then 2 when now() between time('11:30:00') and time('12:15:00') then 3 when now() between time('12:15:01') and time('13:00:00') then 4  else 5  end) period",
				"limit":"1",
				"onsuccess":"28sv2"
			}
		},{
			"id":"28sv2",
			"name":"Save Faculty Attendance-Normal and Winter",
			"sql":{
				"action":"Save Row",
				"outputto":"php",
				"output":"res",
				"command":"insert",
				"tbl":"nbbi_facultyattendance",
				"fld":"classname,classyear,period",
				"fldtype":"s,n,n",
				"value":"||classname||,||classyear||,||GET_period||",				
				"onsuccess":"28sv3-cmd:dom,fun:showMessage;#workareaTablebox;Success;success;Saving Successful",
				"onfailure":"cmd:dom,fun:showMessage;#workareaTablebox;alert;Failed;Saving Failed"
			}			
		},{
			"id":"28sv3",
			"name":"Save Latest Period Number-Normal and Winter",
			"sql":{
				"action":"Save Row",
				"outputto":"php",
				"output":"res",
				"command":"insertorupdate",
				"tbl":"eirene_meta",
				"fld":"pname,pdata,ptype,poption,pluginid",
				"fldtype":"s,s,s,s,u",
				"value":"Period,||GET_period||,Text,,||pluginid||",
				"whr":"pname='Period' and pluginid='||pluginid||'"				
			}			
		},{
			"id":"28lt",
			"name":"Faculty Attendance Live Sheet",
			"sql":{
				"action":"Get Matrix",
				"outputto":"html",
				"output":"#workareaTablebox",
				"tbl":"nbbi_facultyattendance a",
				"fld":"a.classname,a.classyear,b.fullname",
				"join":"INNER JOIN eirene_users b ON a.createdby=b.id",
				"matrixtableclass": "eirene-table dataTable",
				"whr":[
					"a.recordstatus=1",
					"and DATE(a.createdon)='||attendancedate||'",
					"and a.period=||period||"
				],
				"col":"classyear",
				"row":"classname",
				"val":"fullname",
				"onsuccess":"cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:show;#workareaFilter1",
				"onfailure":"cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:show;#workareaFilter1"
			}
		},{
			"id":"28lt2",
			"name":"Faculty Attendance Day Sheet",
			"sql":{
				"action":"Get Matrix",
				"outputto":"html",
				"output":"#workareaTablebox",
				"tbl":"nbbi_facultyattendance a",
				"fld":"a.period,CONCAT(a.classname,' ',a.classyear) as val,b.fullname",
				"join":"INNER JOIN eirene_users b ON a.createdby=b.id",
				"matrixtableclass": "eirene-table dataTable",
				"whr":[
					"a.recordstatus=1",
					{"if":"||attendancedate||","op":"=","value":"BLANK","then":"and DATE(a.createdon)=CURRENT_DATE()","else":"and DATE(a.createdon)='||attendancedate||'"}
				],
				"col":"fullname",
				"row":"period",
				"val":"val",
				"srt":"a.period",
				"onsuccess":"cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:show;#workareaFilter1",
				"onfailure":"cmd:dom,fun:show;#workareaFilter-cmd:dom,fun:show;#workareaFilter1"
			}
		},{
			"id":"28ltbt",
			"name":"Button For 28LT",
			"sql":{
				"action":"Return",
				"outputto":"php",
				"output":"res",
				"elem":{
					"outputto":"html",
					"output":"#workareaFilter",
					"elem":[
						{
							"name":"28ltbt-f1",
							"type":"button",
							"value":"Teacher's Location (Live)",
							"onclick":"Eirene.runStmt('28lt',{attendancedate:formatDate(),period:1});$('#28ltft-f2').attr('onclick',$('#28ltft-f2').attr('onclick').replace('28lt2','28lt'));"
						},{
							"name":"28ltbt-f2",
							"type":"button",
							"value":"Teacher's Location (Day)",
							"onclick":"Eirene.runStmt('28lt2',{attendancedate:formatDate()});$('#28ltft-f2').attr('onclick',$('#28ltft-f2').attr('onclick').replace('28lt','28lt2'));"
						}
					]
				}
			}
		},{
			"id":"28ltft",
			"name":"Filter for Teacher's Location (Live)",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"res",
				"elem":{
					"outputto":"html",
					"output":"#workareaFilter1",
					"elem":[
						{
							"name":"28ltft-f0",
							"id":"28ltbt-f0",
							"type":"select",
							"label":"Period",
							"option":",1,2,3,4,5"							
						},{
							"name":"28ltft-f1",
							"id":"28ltft-f1",
							"type":"datepicker",
							"label":"Date"
						},{
							"name":"28ltft-f2",
							"id":"28ltft-f2",
							"type":"button",
							"class":"ml-2",
							"value":"Search",
							"onclick":"Eirene.runStmt('28lt',{attendancedate:$('#28ltft-f1').val(),period:$('#28ltbt-f0').val()})"
						}
					]
				}
			}
		},{
			"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 pluginid='||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=\\\"padding:10px;color:white;\\\" class=\\\"fg-blue-hover\\\" onclick=\\\"Eirene.runStmt(&apos;34trep&apos;,{taskid:&apos;',a.id,'&apos;})\\\"><h3 style=\\\"margin-top:250px;\\\" class=\\\"font-Ubuntu-Bold\\\">',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||","op":"=","value":"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||","op":"=","value":"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":"Christian Leadership I,Old Testament Survey,Introduction to Bible Characters,Foundation of Christian Faith,Christian Leadership II,New Testament Survey,History of Christianity,Homiletics,Christian Leadership III,Church Planting and Church Growth,Life and Ministry of Paul,Pastoral Care and Pastoral Ministry)",
												"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":"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',{subject:$('#31fb2').val(),type:$('#31fb1').val(),pluginid:&apos;||PLUGINID||&apos;});"
											}
										]
									},{
										"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":"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||","op":"=","value":"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":"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('31ccle')"
							},{
								"name":"31b3",								
								"type":"button",
								"value":"Mark List",
								"onclick":"Eirene.runStmt('31sf3')"
							}
						]
					},{
						"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",
				"matrixtableclass":"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",
						"tbl":"nbbi_cclmark",
						"fld":"subject,type,mark",
						"srt":"subject,type",
						"class":"eirene-table dataTable",
						"header":"Subject,Exam Type,Mark Obtained",
						"union":"SELECT subject,'Total' as type,if(SUM(mark)<40,CONCAT('<span class=\\\"fg-red\\\">',SUM(mark),'</span>'),SUM(mark)) FROM nbbi_cclmark WHERE rollno=||rollno|| Group by subject",
						"whr":"rollno=||rollno||",
						"row":"subject",
						"col":"type",
						"val":"mark",
						"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",
				"fld":"a.rollno,b.stuname,a.subject,a.type,a.mark",
				"srt":"a.rollno",
				"header":"Roll No.,Name,Subject,Exam Type,Mark Obtained",
				"whr":"subject='||subject||' and 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",
				"hiddencols":"5",
				"functionfield":[
					{							
						"type": "link",
						"class": "",
						"value": "<count(*)>",
						"onclick": "Eirene.runStmt('31ccl',{subject:'||subject||',type:'||type||',rollno:<a.rollno>})",
						"caption":"MarkCount"
					}					
				],
				"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 Term I Result",
			"sql":{
				"action":"Get Matrix",	
				"outputto":"html",
				"output":"#workareaTablebox",
				"class":"eirene-table dataTable",
				"tbl":"nbbi_cclmark a",
				"fld":"a.rollno,b.stuname,a.subject,IF(SUM(a.mark)<40,CONCAT('<span class=\\\"fg-red\\\">',SUM(a.mark),'</span>'),SUM(a.mark)) as mark",
				"join":"INNER JOIN nbbi_cclstudent b ON a.rollno=b.rollno",				
				"header":"Roll No,Stu Name,Subject,Mark",
				"whr":"subject IN ('Christian Leadership I','Old Testament Survey','Foundation of Christian Faith','Introduction to Bible Characters')",
				"srt":"a.rollno,subject,type",
				"grp":"a.rollno,b.stuname,a.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":"32tem1",
			"name":"Report Template List",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table",
				"tbl":"nbbi_reporttemplate",
				"fld":"templatename,color1,color2,color3",
				"functionfield":[
					{
						"type": "icon",
						"class": "icon mif-pencil mr-2",
						"title": "Edit Record",
						"onclick": "edit('reporttemplate','<id>',true)"
					},{
						"type": "icon",
						"class": "icon mif-cross",
						"title": "Delete Record",
						"onclick": "Eirene.runStmt2('32tem3','ID','<id>')",
						"caption": "DeleteRecord"
					}
				],
				"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||",
						"op":"=",
						"value":"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":"33sv",
			"name":"Save Checklist",
			"sql":{
				"action":"Save Row","outputto":"php","output":"res",
				"command":"insertorupdate",
				"tbl":"nbbi_checklist","fld":"checklistname,remark,link,taskid",
				"fldtype":"s,s,g,u",
				"value":"||name||,||remark||,||link||,||taskid||",
				"whr":"id='||id||'",
				"onsuccess":"cmd:dom,fun:showtoast;success;Saving Successful",
				"onfailure":"cmd:dom,fun:showtoast;alert;Saving Failed"				
			}
		},{
			"id":"33del",
			"name":"Delete Checklist",
			"sql":{
				"action":"Delete Row Permanently","outputto":"php","output":"res",				
				"tbl":"nbbi_checklist",
				"whr":"id='||ID||'",
				"onsuccess":"cmd:dom,fun:showtoast;success;Delete Successful",
				"onfailure":"cmd:dom,fun:showtoast;alert;Delete Failed"				
			}
		},{
			"id":"33tbl",
			"name":"Checklist Table",
			"sql":{
				"action":"Get Table","outputto":"html",
				"output": {"if":"||updateTable||","op":"=","value":"1","then":"#task_checklisttable","else":"#workareaAppendix"},
				"prepend": [
					"<div id='task_checklisttable' class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'><div><b>Checklist</b></div>",
					"<div><span>Checklist Name</span><input type='hidden' id='33_id'/><input type='text' id='33_name' class='ml-2 mr-2'/><span>Remark</span><input type='text' class='ml-2 mr-2' id='33_remark'/><span>Link</span><input type='text'  class='ml-2 mr-2' id='33_link'/><button class='button ml-2' onclick='Eirene.runStmt(&apos;33sv-33tbl&apos;,{id:$(&apos;#33_id&apos;).val(),taskid:&apos;||TID||&apos;,TID:&apos;||TID||&apos;,name:$(&apos;#33_name&apos;).val(),link:$(&apos;#33_link&apos;).val(),remark:$(&apos;#33_remark&apos;).val(),updateTable:&apos;1&apos;})'>Save</button></div>"
				],
				"appendoutput":{"if":"||updateTable||","op":"=","value":"1","then":false,"else":true},
				"tbl":"nbbi_checklist",
				"fld":"checklistname,remark",
				"header":"Name,Remark",
				"functionfield":[
					{
						"if": "link!=''",
						"type": "googlelink",
						"href": "<link>",
						"value": "Link",
						"target": "_blank",							
						"caption":"Link"
					},{
						"type": "icon",
						"class": "icon mif-pencil",
						"title": "Edit Record",
						"onclick": "$('#33_id').val('<id>');$('#33_name').val('<checklistname>');$('#33_remark').val('<remark>');$('#33_link').val('<link>')",
						"caption":"Edit"
					},
					{
						"type": "icon",
						"class": "icon mif-cross",
						"title": "DelRecord",
						"onclick": "Eirene.runStmt2('33del','ID','<id>')",
						"caption":"DeleteRecord"
					}
				],
				"whr":"taskid='||TID||'"							
			}
		},{
			"id":"34tbl",
			"name":"Task Report Element",
			"sql":{
				"action":"Get Table","outputto":"html",
				"output": {"if":"||updateTable||","op":"=","value":"1","then":"#task_reportelemtable","else":"#workareaAppendix"},
				"prepend": [
					"<div id='task_reportelemtable' class='mt-4 border border-radius-8' style='padding:20px 10px;background-color:#eef5f9;'>",
					"<div><b>Task Report Element</b></div>",
					"<div><span>Report Item Name</span><input type='hidden' id='34_id'/>",					
					"<select id='34_item' onchange='if($(this).val()==\\\"Image Gallery\\\"){$(\\\"#34_other\\\").val(\\\"columns:1,imgid:1\\\")}else if($(this).val()==\\\"Image\\\"){$(\\\"#34_other\\\").val(\\\"imgid:1\\\")}' value='' class='ml-2 mr-2'><option value='Featured Image'>Featured Image</option><option value='Title'>Title</option><option value='Heading'>Heading</option><option value='Text Block'>Text Block</option><option value='Featured Content and Description'>Featured Content and Description</option><option value='Featured Post'>Featured Post</option><option value='Finance'>Finance</option><option value='Image'>Image</option><option value='Image Gallery'>Image Gallery</option><option value='Journals'>Journals</option><option value='Checklist'>Checklist</option><option value='PDF'>PDF</option></select>",					
					"<span>Order</span><input type='text' id='34_order' class='ml-2 mr-2'/>",
					"<span>Class</span><input type='text' id='34_class' class='ml-2 mr-2'/>",
					"<span>Style</span><input type='text' id='34_style' class='ml-2 mr-2'/>",
					"<span>Other Attrib</span><input type='text' id='34_other' class='ml-2 mr-2'/>",
					"<button class='button ml-2' onclick='Eirene.runStmt(&apos;34sv-34tbl&apos;,{ID:$(&apos;#34_id&apos;).val(),taskid:&apos;||TID||&apos;,TID:&apos;||TID||&apos;,item:$(&apos;#34_item&apos;).val(),order:$(&apos;#34_order&apos;).val(),class:$(&apos;#34_class&apos;).val(),style:$(&apos;#34_style&apos;).val(),other:$(&apos;#34_other&apos;).val(),updateTable:&apos;1&apos;})'>Save</button>",
					"</div>"
				],
				"appendoutput":{"if":"||updateTable||","op":"=","value":"1","then":false,"else":true},
				"tbl":"nbbi_taskreportelem",
				"fld":"item,porder",
				"header":"Item,Order",
				"functionfield":[
					{
						"type": "icon",
						"class": "icon mif-pencil",
						"title": "Edit Record",
						"onclick": "$('#34_id').val('<id>');$('#34_item').val('<item>');$('#34_order').val('<porder>');$('#34_class').val('<class>');$('#34_style').val('<style>');$('#34_other').val('<otherjson>')",
						"caption":"Edit"
					},
					{
						"type": "icon",
						"class": "icon mif-cross",
						"title": "Delete Record",
						"onclick": "Eirene.runStmt2('34dt','ID','<id>')",
						"caption":"DeleteRecord"
					}
				],
				"whr":"taskid='||TID||'",
				"srt":"porder"
			}
		},{
			"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||","op":">","value":"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":"Print Task Report",
			"sql":{
				"action":"MULTISTMT",
				"outputto":"php",
				"output":"res",
				"validate":"none",
				"multistmt":[
					{
						"action":"Get Row","outputto":"php","output":"template",
						"tbl":"nbbi_reporttemplate",
						"fld":"color1,color2,color3",
						"whr":[
							{"if":"||templateid||","op":"!=","value":"BLANK","then":"id='||templateid||'","else":"id='||GET_taskrow_template||'"}
						]
					}				
				]
			}
		},{
			"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":
							{"outputto":"php","output":"res","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('1svtmp-34trep',{taskid:'||taskid||',templateid:$(this).val()})"},
									{"name":"r-1","id":"r-1","class":"mr-2","label":"Background colour","type":"text","value":"||GET_taskrow_pagebackgroundcolor||","onblur":"Eirene.runStmt('1svbg',{taskid:'||taskid||',bg:$(this).val()});$('#printarea').css('background-color',$(this).val())"},
									{"name":"r-2","id":"r-2","class":"mr-2","label":"Images in Columns","type":"select","option":"1,2,3,4","selectedvalue":"||GET_taskrow_imagecolumn1||","onchange":"Eirene.runStmt('1svcol-34trep',{taskid:'||taskid||',imgcol:$(this).val()});"},
									{"name":"r-3","id":"r-3","class":"ml-2","label":"Images Count","type":"number","value":"||GET_taskrow_imagecount||","onchange":"Eirene.runStmt('1svcnt-34trep',{taskid:'||taskid||',imgcnt:$(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) from nbbi_links where taskid='||taskid||' and linktype='Featured Image1' LIMIT 1"}},
							"<div>",
							"<img src='||GET_featuredimage1||'",
							{"if":"||class||","op":"!=","value":"BLANK","then":" class='||class||'"},
							{"if":"||style||","op":"!=","value":"BLANK","then":" style='||style||'","else":" style='width:100%;'"},
							"></div>"
					],
					"Title":[
							"<div",
							{"if":"||class||","op":"!=","value":"BLANK","then":" class='||class||'","else":" class='font-Ubuntu-Bold'"},
							{"if":"||style||","op":"!=","value":"BLANK","then":" style='||style||'","else":" style='color:white;margin-top:-100px;margin-left:20px;font-size:25pt'"},
							">||GET_taskrow_task||</div>"
					],
					"Heading":[
							"<h3",
							{"if":"||class||","op":"!=","value":"BLANK","then":" class='||class||'","else":" class='font-Ubuntu-Bold'"},
							{"if":"||style||","op":"!=","value":"BLANK","then":" style='||style||'","else":" style='color:black;margin-top:20px'"},
							">||otherjson||</h3>"
					],
					"Text_Block":[							
							"<div",
							{"if":"||class||","op":"!=","value":"BLANK","then":" class='p-2 ||class||'","else":" class='p-2 font-Ubuntu-Regular'"},
							{"if":"||style||","op":"!=","value":"BLANK","then":" style='background-color:||GET_template_color1||;||style||'","else":" style='background-color:||GET_template_color1||;color:black;margin-left:20px;font-size:11pt'"},
							">||otherjson||</div>"
					],
					"Featured_Content_and_Description":[
						{"sqlstatement":{"featuredimage2":"SELECT CONCAT('http://drive.google.com/uc?export=view&id=',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;margin-top:50px;padding:0.5cm;",
						{"if":"||style||","op":"!=","value":"BLANK","then":"||style||"},
						"'",
						{"if":"||class||","op":"!=","value":"BLANK","then":" class='||class||'"},
						">",
							"<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'>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%;'>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%;'>03<h4>||GET_featuredcontent3_title||</h4><br><div style='font-size:10pt'>||GET_featuredcontent3_remark||</div> </td></tr></table></div>",
					"Finance":[
						{"call":"34tre4"},
						{"globalvalue":{"a":"{||otherjson||}"}},
						"<div",
						{"if":"||style||","op":"!=","value":"BLANK","then":" style='margin-top:30px;||style||'","else":" style='margin-top:30px;'"},
						{"if":"||class||","op":"!=","value":"BLANK","then":" class='||class||'"},
						"><h3>",
						{"if":"||heading||","op":"!=","value":"BLANK","then":"||heading||","else":"Payment"},
						"</h3>",
						"||GET_paymenttable||</div>"
					],
					"Image":[
						{"globalvalue":{"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;'>",
						"<img ",
						{"if":"||style||","op":"!=","value":"BLANK","then":" style='||style||'"},
						{"if":"||class||","op":"!=","value":"BLANK","then":" class='||class||'"},
						"src='||GET_imgsrc||'/></div>"
					],
					"Image_Gallery":[
						{"call":"34tre3"},
						"<div style='margin-top:30px;'>||GET_taskimages||</div>"
					],
					"Journals":[
						{"call":"34tre6"},
						{"globalvalue":{"a":"{||otherjson||}"}},
						"<div style='margin-top:30px;",
						{"if":"||style||","op":"!=","value":"BLANK","then":"||style||"},
						{"if":"||class||","op":"!=","value":"BLANK","then":" class='||class||'"},
						"'><h3>",
						{"if":"||heading||","op":"!=","value":"BLANK","then":"||heading||","else":"Journal"},
						"</h3>||GET_journal||</div>"
					],
					"Checklist":[
						{"call":"34tre5"},
						{"globalvalue":{"a":"{||otherjson||}"}},
						"<div style='margin-top:30px;",
						{"if":"||style||","op":"!=","value":"BLANK","then":"||style||"},
						{"if":"||class||","op":"!=","value":"BLANK","then":" class='||class||'"},
						"'><h3>",
						{"if":"||heading||","op":"!=","value":"BLANK","then":"||heading||","else":"Checklist"},
						"</h3>||GET_checklist||</div>"
					],
					"PDF":[
						{"call":"34tre7"},
						{"globalvalue":{"a":"{||otherjson||}"}},
						"<div style='margin-top:30px;",
						{"if":"||style||","op":"!=","value":"BLANK","then":"||style||"},
						{"if":"||class||","op":"!=","value":"BLANK","then":" class='||class||'"},
						"'><h3>",
						{"if":"||heading||","op":"!=","value":"BLANK","then":"||heading||","else":"PDF Document"},
						"</h3>||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",
					{"globalvalue":{"a":"{||otherjson||}"}}
				],
				"fld": "CONCAT('http://drive.google.com/uc?export=view&id=',link) lnk",
				"whr":[
					"taskid='||taskid||' and linktype ='Image'",
					{"if":"||imgid||","op":"!=","value":"BLANK","then":" and porder IN (||imgid||)"}
				],							
				"parent":"div style='display:flex;flex-flow:row wrap'",
				"template":["<div style='width:",
							{"if":"||columns||","op":"=","value":"BLANK","then":{"globalvalue":{"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 src='||lnk||' style='width:100%;'></div>"
				]
			}
		},
		{
			"id":"34tre4",
			"name":"Payment Table",
			"sql":{
				"action": "Get Table",
				"outputto": "php",
				"output": "paymenttable",				
				"tbl": "nbbi_payments a",
				"join": "INNER JOIN nbbi_contacts b ON a.contactid=b.id",
				"fld":["DATE_FORMAT(a.paymentdate,'%d-%m-%Y')",
						"a.purpose",
						"a.paymentmode as mode",
						"a.amount",
						"IF(a.bill !='',CONCAT('<a target=_blank href=http://drive.google.com/uc?export=view&id=',a.bill,'>Link</a>'),'')",
						"IF(a.pconfirmationlink !='',CONCAT('<a target=_blank href=http://drive.google.com/uc?export=view&id=',a.pconfirmationlink,'>Link</a>'),'')"								
				],						
				"whr": "a.taskid='||taskid||'",
				"srt": "a.createdon",
				"vsum":"4",
				"header": "Date,Purpose,Mode,Amount,Bill,Payment Confirmation"
			}
		},{
			"id":"34tre5",
			"name":"Checklist Table",
			"sql":{
				"action":"Get Table",						
				"outputto":"php",
				"output":"checklist",						
				"tbl":"nbbi_checklist",						
				"fld":"checklistname,remark",
				"header":"Item,Remark",
				"whr":[
					"recordstatus=1",
					"and taskid='||taskid||'"
				]						
			}
		},{
			"id":"34tre6",
			"name":"Journal Table",
			"sql":{
				"action":"Get Table",						
				"outputto":"php",
				"output":"journal",				
				"tbl":"nbbi_journal a",						
				"fld":"DATE_FORMAT(a.jdate,'%d-%m-%Y')as journaldate,a.title,a.remark",
				"header":"Date,Title,Remark",
				"whr":[
					"a.recordstatus=1 and a.jdate >'2020-01-01'",
					"and a.taskid='||taskid||'"
				],
				"srt":"a.jdate"
			}
		},{
			"id":"34tre7",
			"name":"PDF document",
			"sql":{
				"action": "Get Table",
				"outputto": "php",
				"output": "pdfdocument",					
				"tbl": "nbbi_links",
				"fld": "lname,linktype,remark",
				"functionfield": [{
					"if": "link!=''",
					"type": "googlelink",
					"href": "<link>",
					"value": "Link",
					"target": "_blank",							
					"caption":"lnk"
				}],
				"whr": "taskid='||taskid||' and linktype='PDF'",
				"srt": "createdon",
				"header": "Name,Type,Remark,Task Link"						
			}
		},{
			"id":"35lt",
			"name":"Project List",
			"sql":{
				"action":"Get Table",
				"outputto":"html","output":"table",
				"tbl":"nbbi_project a",
				"join":[
					"INNER JOIN eirene_users b ON a.assignedto=b.id",
					"LEFT JOIN nbbi_tasks c ON c.department=a.id",
					"LEFT JOIN (select f.id,count(*) as plancnt from nbbi_communication d inner join nbbi_tasks e ON d.taskid=e.id INNER JOIN nbbi_project f ON e.department=f.id where d.status=0 group by f.projectname) g ON g.id=a.id"
				],				
				"fld":"a.projectname,b.fullname,CONCAT('<a href=\\\"#\\\" onclick=\\\"Eirene.runStmt(&apos;35tsk&apos;,{includesubtask:1,project:&apos;',a.id,'&apos;})\\\">',count(*),'</a>') as cnt,CONCAT('<a href=\\\"#\\\" onclick=\\\"Eirene.runStmt(&apos;35pln&apos;,{project:&apos;',a.id,'&apos;})\\\">',g.plancnt,'</a>') as plncnt",
				"grp":"a.projectname,b.fullname",
				"functionfield":[
					{
 						"type": "group",
 						"caption": "Function",
						"grp":[
							{
								"type":"icon",
								"class":"mif-pencil mr-2",
								"onclick":"edit('nbbiproject','<a.id>',true)"								
							},{
								"type":"icon",
								"class":"mif-cross",
								"onclick":"Eirene.runStmt2('35dt','ID','<a.id>')"								
							}
						]
					}
				],
				"header":"Project,Assigned To,Active Tasks,Active Plan",
				"whr":"a.recordstatus=1 and c.status<3"
			}
		},{
			"id":"35pln",
			"name":"Plan List",
			"sql":{
				"action":"Get Table","output":"#workareaAppendix",
				"tbl":"nbbi_communication d",
				"fld":"e.task,d.people,d.communication,d.datefrom,d.dateto",
				"join":[
					"inner join nbbi_tasks e ON d.taskid=e.id",
					"INNER JOIN nbbi_project 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='||project||'",
				"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":" Project",
								"onclick":"showForm('nbbi_project 1')"
							}
						]
					}
				],
				"onsuccess":"cmd:dom,fun:show;#workareaFilter1"
			}
		},{
 			"id": "35tsk",
 			"name": "Task List linked to Project",
 			"sql": {
 				"action": "Get Table",
 				"outputto": "html",
 				"output": "#workareaAppendix",
 				"formname": "task",
 				"tbl": "nbbi_tasks a",
 				"join": [
					"INNER JOIN eirene_users b ON a.assignedto=b.id"					
				],
 				"fld": "CONCAT('<a onclick=\\\"Eirene.runStmt(&apos;23fcnt-23-20-21-22-22a-22b-33tbl-34tbl-36chkm&apos;,{TID:&apos;',a.id,'&apos;})\\\">',a.task,'</a>')as task,b.fullname,a.beginningdate,a.enddate,a.status",
 				"whr":[
					"a.recordstatus=1 and (a.createdby='||userid||' or a.assignedto='||userid||')",
					{"if":"||includesubtask||","op":"=","value":"BLANK","then":"and a.taskid IS NULL"},
					{"if":"||project||","op":"!=","value":"BLANK","then":"and a.department='||project||'"},
					{"if": "||assignedto||","op": "!=","value": "BLANK","then": "and a.assignedto ='||assignedto||'"},
					{"if": "||task||","op": "!=","value": "BLANK","then": "and a.task like '%||task||%'"},
					{"if": "||status||","op": "!=","value": "BLANK","then": "and a.status ='||status||'","else":" and a.status<=3"},
					{"if": "||dtf||","op": "!=","value": "BLANK","and": "||dtt||","andop": "!=","andvalue": "BLANK","then": " and a.beginningdate>='||dtf||' and a.beginningdate<='||dtt||'"},
					{"if": "||dtf||","op": "!=","value": "BLANK","and": "||dtt||","andop": "=","andvalue": "BLANK","then": " and a.beginningdate='||dtf||'"}
				],
 				"srt": "a.enddate",
 				"header": "Task,Assigned To,Beginning Date,End Date,Status",
				"onsuccess":"cmd:dom,fun:show;#workareaAppendix-cmd:dom,fun:function;datatable;#workareaAppendix"
 		
			}
		},{
			"id":"36chkm",
			"name":"Checklist Matrix",
			"sql":{
				"action":"Get Matrix",
				"outputto":"html","output": "#workareaAppendix",
 				"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",
				"matrixtableclass":"eirene-table dataTable",
				"whr":"c.id='||TID||'",
				"srt":"a.createdon",
				"col":"checklistname","row":"task","val":"rem"				
			}
		}
	]
 }