{
	"pluginname": "OnlineCourse",
	"systemplugin": "0",
	"version": "1.51",
	"icon": "mif-books fg-green",
	"validationtable":"online_course_users",
	"initialstmt":"54stm1-lstft1-lstcr-23",
	"iswebsite":1,
	"table_def": [{
			"name": "online_course",
			"saveid":"1sv","getid":"1gt","delid":"1dt",
			"joindef":{
				"online_course_users":"online_course.authorid=online_course_users.id",
				"online_lesson":"online_lesson.courseid=online_course.id"
			},
			"form":{
				"0":{
				"title":"Course","type": "Inline","icon": "mif-dashboard",				
				"fields":"*"
				},
				"1":{
				"title":"Add Course","type": "Inline","icon": "mif-dashboard",				
				"fields":"*","datacollapsed":false
				}
			},
			"list":{
				"1lt": {
					"name": "courseList","getform":"online_course 1",
					"filter":"title,authorid,institute",
					"fld": "a.title,c.fullname,count(d.id)",
					"tbl": "online_course a","usejoin":"online_course_users c,online_lesson d",					
					"defaultwhr":"a.recordstatus=1 and a.status=1 and d.status=1 and d.recordstatus=1",					
					"header": "Title,Author,Lesson Count",
					"grp":"a.title,c.fullname",
					"includeeditdelete":true,
					"script":[
						"$('#workareaTablebox').show();"
					]
				}
			},
			"fields": [
				{"name": "title varchar(300) NOT NULL","label":"Course Title","required":true,"filterop":"like"},
				{"name": "coursecode varchar(10) DISTINCT","label":"Course Code","required":true,"saveif":[{"sqlstatement":{"acnt":"SELECT count(*) FROM online_course where coursecode='||coursecode||' and id!='||id||'"}},{"if":"||acnt|| = 0","errormsg":"Duplicate Course Code"}]},
				{"name": "titleprint varchar(300) NOT NULL","label":"Course Title Print","required":true},
				{"name": "subtitle varchar(300) NOT NULL","label":"Course Sub Title","required":true},
				{"name": "description varchar(500)","label":"Course Description","fieldtype":"textarea","required":true},
				{"name": "price int NOT NULL DEFAULT 0","label":"Price","required":true},
				{"name": "department varchar(20)","label":"Department","fieldtype":"select","option":"TE,LT,MED,CC","required":true},
				{"name": "programlinked varchar(50)","label":"Program Linked","fieldtype":"select","option":"None,Bachelor of Theology,Master of Divinity,Master of Theology,Diploma in Theology,Certificate in Theology","required":true},
				{"name": "timeneeded varchar(100)","label":"Time Needed"},
				{"name": "credit tinyint NOT NULL","label":"Course Credit","fieldtype": "select","option": "0,1,2,3,4"},
				{"name": "goals varchar(2000)","label":"Goals","fieldtype":"textarea","required":true},
				{"name": "connexionmodel varchar(100)","label":"ConneXion Model","required":true},
				{"name": "image_path varchar(300)","fieldtype":"file","file":{"maxsize":"300kb","filetype":"jpg,jpeg,png"},"label":"Image Path","required":true},
				{"name": "fastforward tinyint NOT NULL DEFAULT 0","label":"Fast Forward"},
				{"name": "expirydate date NOT NULL","label":"Expiry Date"},
				{"name": "status tinyint NOT NULL DEFAULT 1","label":"Course Status","fieldtype":"select","option":"1:Active,0:Inactive"},
				{"name": "authorid varchar(36)","label":"Author ID","fieldtype":"select","option":"SELECT id,fullname FROM online_course_users where status=1 and isfaculty=1","required":true},
				{"name": "owner varchar(36)","label":"Owner ID","fieldtype":"select","option":"SELECT id,fullname FROM online_course_users where status=1 and isfaculty=1","required":true},
				{"name": "language varchar(15) NOT NULL DEFAULT 'English'","label":"Language","fieldtype":"select","option":"English,Hindi,Malayalam,Tamil","required":true},
				{"name": "institute varchar(10) NOT NULL DEFAULT 'NBBI'","label":"Institute","fieldtype":"select","option":"NBBI,NIBS,NIBI","required":true}
			]
		}, {
			"name": "online_course_user_tracker",
			"saveid":"ocutsv","getid":"ocutgt","delid":"ocutdt",
			"fields": [
			{"name": "sessionid varchar(36) NOT NULL","label":"Session ID","default":{"insert":"||PHPSESSID||"}},
			{"name": "ip char(13)","label":"IP","default":{"insert":"||IP||"}},
			{"name": "city varchar(30)","label":"City","default":{"insert":"||CITY||"}},
			{"name": "region varchar(30)","label":"Region","default":{"insert":"||REGION||"}},
			{"name": "country varchar(30)","label":"Country","default":{"insert":"||COUNTRY||"}},
			{"name": "useragent varchar(150)","label":"User Agent","default":{"insert":"||USERAGENT||"}},
			{"name": "status tinyint NOT NULL DEFAULT 1","label":"Status","default":{"insert":"1"}}
		]
		},
		{
			"name": "online_course_orders",
			"saveid":"ocosv","getid":"ocogt","delid":"ocodt","getform":"ocogf1 0",
			"form":{
				"0":{"title":"Donate","icon":"mif-delicious","type":"Inline","fields":"fullname,amount,remark,email,mobile"}
			},
			"fld": "",
				"fldtype": "s,n,s,s,s,u",
				"value": "||PHPUNIQID||,||DONAMOUNT||,||DONREMARK||,||DONEMAIL||,||DONMOBILE||,d474e1f0-388b-11eb-83a2-525400a09ba1",
			"fields": [
				{"name": "fullname char(30)","label":"Name","required":true},
				{"name": "orderid char(13)","label":"Order ID","default":{"insert":"||PHPUNIQID||"}},
				{"name": "amount int NOT NULL","label":"Amount","required":true}, 
				{"name": "referenceid varchar(12)","label":"Reference ID"},
				{"name": "txstatus varchar(9)","label":"Status"},
				{"name": "paymentmode varchar(25)","label":"Payment Mode"},
				{"name": "txmsg varchar(100)","label":"Message"},
				{"name": "txtime varchar(10)","label":"Time"},
				{"name": "remark varchar(100)","label":"Purpose"},
				{"name": "email varchar(50)","label":"Email","required":true},
				{"name": "mobile varchar(10)","label":"Mobile No.","required":true}
			]
		},
		{
			"name": "online_course_mycourse",
			"saveid":"ocmsv","getid":"ocmgt","delid":"ocmdt",
			"list":{
				"stulst":{
					"name": "studentsForACourse",
					"action": "Get Table",
					"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
					"outputto": "html",
					"output": "appendix",
					"datefield": "a.createdon",
					"prepend": "<h3>Students List</h3>",
					"fld": "b.fullname,a.createdon,'||GET_lessoncnt||' as lessoncnt",
					"tbl": "online_course_mycourse a",
					"join": [
						"INNER JOIN online_course_users b ON a.createdby=b.id",
						"INNER JOIN online_lesson c ON a.courseid=c.courseid"					
					],
					"includeeditdelete":true,
					"lateradditioninjoin":"INNER JOIN online_course_read_tracker d ON c.id=d.onlinecourse_lessonid AND a.createdby = d.createdby",
					"whr": "a.courseid='||COURSEID||' and c.status=1 and a.recordstatus=1",
					"srt": "b.fullname",
					"grp": "b.fullname,a.createdon",
					"header": "Name,Subscribed On,Total Lessons"			
				}
			},
			"fields": [
				{"name": "courseid uniqueidentifier NOT NULL","label":"Course ID"}, 
				{"name": "expirydate date","label":"Expiry Date"}, 
				{"name": "lastreadpage char(36)","label":"Last Read Page"}, 
				{"name": "iscompleted tinyint NOT NULL DEFAULT 0","label":"Is Completed"}, 
				{"name": "marks_obtained tinyint NOT NULL DEFAULT 0","label":"Marks Obtained"}, 
				{"name": "date_completed date","label":"Date Completed"}, 
				{"name": "status tinyint","label":"Status","default":{"insert":"1"}}, 
				{"name": "orderid uniqueidentifier","label":"Order ID"}, 
				{"name": "amount int","label":"Amount","default":{"insert":"SELECT price FROM online_course WHERE id='||COURSEID||'"}}
			]
		},
		{
			"name": "online_course_questions",
			"saveid":"oqsv","getid":"oqgt","delid":"oqdt",
			"joindef":{
				"online_lesson":"online_lesson.id=online_course_questions.lessonid",
				"online_answers":"online_answers.questionid=online_course_questions.id"
			},
			"list":{
				"queans":{
					"name":"Question Answer Template",
					"action":"Get HTML",
					"output":"#questionanswer",
					"tbl":"online_course_questions a",
					"fld":"a.id as questionid,a.question,a.details,b.fullname",
					"join":"INNER JOIN online_course_users b ON a.createdby = b.id",
					"parent":"",
					"defaultwhr":"a.recordstatus=1 and a.question !=''",
					"prepend":[
						"<div style=' margin: 20px auto; background: #ffffff; padding: 20px; border: 1px solid #ddd; border-radius: 8px;'>",
							"<!-- Forum Header -->",
							"<div class='eirene-bg-lightblue' style='color: white; text-align: center; padding: 15px 0;'>",
								"<h3 style='margin: 0;'>Question and Answer Forum</h3>",
							"</div>",
							"<h4 class='eirene-fg-lightblue' style='text-align: center;'>Post a New Question</h4>",
							"<form>",
								"<div style='margin-bottom: 15px;'>",
									"<label for='question-title' style='font-weight: bold;'>Question Title:</label><br>",
									"<input type='text' id='questiontxt' name='question-title' placeholder='Enter your question title here...' style='width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px;'>",
								"</div>",
								"<div style='margin-bottom: 15px;'>",
									"<label for='question-details' style='font-weight: bold;'>Question Details:</label><br>",
									"<textarea id='question-details' name='question-details' placeholder='Write your question details here...' style='width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; height: 100px;'></textarea>",
								"</div>",
								"<div style='text-align: center;'>",
									"<button type='button' class='eirene-bg-lightblue' style='color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px;' onclick='if(!$(&apos;#questiontxt&apos;).val()){showToast(&apos;Question is empty&apos;,&apos;alert&apos;,5000);return false;}if(!$(&apos;#question-details&apos;).val()){showToast(&apos;Question Detail is empty&apos;,&apos;alert&apos;,5000);return false;}Eirene.runStmt(&apos;oqsv&apos;,{lessonid:&apos;||lessonid||&apos;,question:$(&apos;#questiontxt&apos;).val(),details:$(&apos;#question-details&apos;).val(),confirmBeforeProcess:&apos;:Confirm to save Question&apos;})'>Submit Question</button>",
								"</div>",															
							"</form>",
							"<div>",
								"<h2 class='eirene-fg-lightblue' style=' text-align: center;'>Previously Asked Questions</h2>"
					],
					"append":"</div></div>",
					"template":[
						"<!-- Question Block -->",
						"<div style='margin-bottom: 20px; padding: 15px; border: 1px solid #ddd; border-radius: 4px; background: #fafafa;'>",
							"<h5 style='margin-top: 0;'>||question||</h5>",
							"<div>||details||</div>",
							"<div style='color:gray;'>Question asked by ||fullname||<br>------------</div>",
							"<!--<p style='margin: 10px 0;'>Asked by: User | <span style='color: #999;'>3 days ago</span></p>-->",
							{"run":{"action":"Get HTML","outputto":"php","output":"ans","tbl":"online_answers a","join":"LEFT JOIN online_course_users b ON a.createdby=b.id","fld":"answer,b.fullname","whr":"questionid='||questionid||'","template":"<!--<div>Answered by ||fullname||</div>--> ------------------<br><div style='margin-bottom:10px'>||answer||</div>"}},
							"<div style='margin-bottom: 10px;'>||ans||</div>",
							"<!-- Answer Form for Each Question -->",
							"<form>",
								"<textarea id='answertxt||questionid||' placeholder='Write your answer here...' style='width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; height: 70px;'></textarea>",
								"<div style='text-align: right; margin-top: 10px;'>",
									"<button type='button' onclick='if(!$(&apos;#answertxt||questionid||&apos;).val()){showToast(&apos;Answer is empty&apos;,&apos;alert&apos;,5000);return false;}Eirene.runStmt(&apos;oasv&apos;,{questionid:&apos;||questionid||&apos;,answer:$(&apos;#answertxt||questionid||&apos;).val(),confirmBeforeProcess:&apos;:Confirm to save Answer&apos;})' class='eirene-bg-lightblue' style='color: white; padding: 8px 15px; border: none; border-radius: 4px; cursor: pointer;'>Submit Answer</button>",
								"</div>",
							"</form>",
						"</div>"						
					],
					"srt":"a.createdon desc"
				}				
			},
			"fields": [
				{"name": "lessonid uniqueidentifier NOT NULL","label":"Lesson ID"}, 				
				{"name": "question varchar(200) NOT NULL","label":"Question"}, 
				{"name": "details varchar(500) NOT NULL","label":"Details"}, 
				{"name": "questionscore int NOT NULL DEFAULT 0","label":"Que Score"}, 
				{"name": "answer varchar(1500)","label":"Answer"}, 
				{"name": "answerscore int NOT NULL DEFAULT 0","label":"Ans Score"},
				{"name": "status tinyint NOT NULL DEFAULT 1","label":"Status"}
			]
		},
		{
			"name":"online_answers",
			"saveid":"oasv","getid":"oagt","delid":"oadt",
			"fields":[
				{"name": "questionid char(36) NOT NULL","label":"Question ID"}, 
				{"name": "answer varchar(1500) NOT NULL","label":"Answer"}, 
				{"name": "answerscore int NOT NULL DEFAULT 0","label":"Ans Score"}
			]
		},
		{
			"name": "online_course_fees",
			"fields": [
				{"name": "orderid uniqueidentifier NOT NULL"},
				{"name": "amount int NOT NULL"},
				{"name": "referenceid varchar(20)"},
				{"name": "txstatus varchar(20)"},
				{"name": "paymode varchar(20)"},
				{"name": "txmsg varchar(50)"},
				{"name": "txtime varchar(15)"}
			]
		},
		{
			"name": "online_applyforcourse",
			"fields": [{
				"name": "dob",
				"type": "date",
				"other": "NOT NULL"
			}, {
				"name": "father",
				"type": "varchar(20)",
				"other": "NOT NULL"
			}, {
				"name": "spouse",
				"type": "varchar(20)"
			}, {
				"name": "permadd",
				"type": "varchar(500)",
				"other": "NOT NULL"
			}, {
				"name": "coradd",
				"type": "varchar(200)",
				"other": "NOT NULL"
			}, {
				"name": "course",
				"type": "varchar(10)",
				"other": "NOT NULL"
			}, {
				"name": "church",
				"type": "varchar(200)",
				"other": "NOT NULL"
			}, {
				"name": "gadget",
				"type": "varchar(11)",
				"other": "NOT NULL"
			}, {
				"name": "xnyears",
				"type": "tinyint",
				"other": "NOT NULL"
			}, {
				"name": "pastor",
				"type": "varchar(20)",
				"other": "NOT NULL"
			}, {
				"name": "pastorcontact",
				"type": "varchar(22)",
				"other": "NOT NULL"
			}, {
				"name": "sponsor",
				"type": "tinyint",
				"other": "NOT NULL"
			}, {
				"name": "fee",
				"type": "varchar(20)"
			}, {
				"name": "status",
				"type": "varchar(20)",
				"other": "DEFAULT 'draft'"
			}, {
				"name": "gender",
				"type": "char(1)",
				"other": "NOT NULL"
			}, {
				"name": "prgtype",
				"type": "varchar(20)",
				"other": "DEFAULT 'draft'"
			}, {
				"name": "college",
				"type": "varchar(40)"
			}, {
				"name": "candidatephoto_path",
				"type": "varchar(200)"
			}, {
				"name": "educert_path",
				"type": "varchar(200)"
			}, {
				"name": "pastorrecommendation_path",
				"type": "varchar(200)"
			}, {
				"name": "pay_orderid",
				"type": "char(13)",
				"other": "DEFAULT ''"
			}, {
				"name": "pay_status",
				"type": "tinyint",
				"other": "DEFAULT 0"
			}, {
				"name": "medium",
				"type": "varchar(20)"
			}, {
				"name": "sign",
				"type": "varchar(4000)"
			}, {
				"name": "state",
				"type": "varchar(25)"
			}, {
				"name": "pin",
				"type": "int"
			}, {
				"name": "mothertongue",
				"type": "varchar(20)"
			}]
		}, {
			"name": "online_author",
			"fields": [
				{"name": "authorname varchar(50) NOT NULL"},
				{"name": "description varchar(500) NOT NULL"},
				{"name": "image_path varchar(300)"},
				{"name": "linked_to_institution varchar(10)"},
				{"name": "status tinyint NOT NULL DEFAULT 1"},
				{"name": "owner uniqueidentifier"}
			]
		}, {
			"name": "online_lesson",
			"saveid":"olsv","getid":"olgt","delid":"oldt",
			"joindef":{
				"online_course":"online_course.id=online_lesson.courseid"
			},
			"form":{
				"0":{"title":"Lesson","icon":"mif-books","type":"1 Column","fields":"*"},
				"1":{"title":"Lesson","icon":"mif-books","type":"Horizontal","fields":"lesson_no,title,type,options,status,material","datacollapsed":false}
			},
			"list":{
				"lsnlt":{
					"action": "Get Table","filter":"a.courseid,a.title,a.status,b.coursecode,b.programlinked,b.status,a.type",				
					"fld": "b.title as coursetitle,a.title,a.lesson_no,a.type",
					"tbl": "online_lesson a","usejoin":"online_course b",					
					"srt":"a.lesson_no","getform":"||thistbl|| 0",					
					"includeeditdelete":true,
					"header":"Course,Title,Lesson No,Type"					
				},
				"ollt":{
					"fld":"lesson_no,lesson_order,title,type,status"
				},
				"olaslt":{
					"tbl":"online_lesson a","includeeditdelete":true,"getform":"online_lesson 0",
					"name":"Assignment List","usejoin":"online_course b","filter":"b.title",
					"fld":"b.title,a.title as lessontitle",
					"functionfield":[
						{"name":"olasltbtn","type":"button","value":"Student List","onclick":"Eirene.runStmt('asglt1',{lessonid:'<a.id>'})","caption":"Function"}
					],
					"header":"Course,Assignment Title",
					"defaultwhr":"a.type='Assignment' and b.recordstatus=1 and b.status=1 and a.status=1 and a.recordstatus=1"
				},
				"olgf":{
					"action":"GetForm","getform":"online_lesson 1"
				},
				"oln":{
					"action":"Return",
					"outputto":"php",
					"value":[
						{"sqlstatement":{"lessonno":"select count(*)+1 FROM online_lesson WHERE courseid='||courseid||' and status=1 and recordstatus=1"}},
						{"call":"olsv","courseid":"||courseid||","lesson_no":"||lessonno||","lesson_order":"||lessonno||","title":"New Lesson","type":"Reading"}
					]
				}
			},
			"fields": [
				{"name": "courseid uniqueidentifier NOT NULL","label":"Course","fieldtype":"lookup","lookup":{"sqlid":"ocllku","fld":"id,title", "tbl":"online_course","whr":"recordstatus=1 and title like '%||searchtext||%'"}},
				{"name": "lesson_no tinyint NOT NULL","label":"Lesson Number"},
				{"name": "lesson_order tinyint NOT NULL DEFAULT 1","label":"Lesson Order"},
				{"name": "title varchar(500) NOT NULL","label":"Lesson Title","filterop":"like"},
				{"name": "type varchar(30) NOT NULL","label":"Lesson Type","fieldtype":"select","option":"Reading,Assignment,Discussion"},
				{"name": "material varchar(7000) NOT NULL","label":"Content","fieldtype":"texteditor"},
				{"name": "options varchar(1000)","label":"Options"},
				{"name": "status tinyint NOT NULL DEFAULT 1","fieldtype":"select","option":"0:InActive,1:Active","label":"Lesson Status"},
				{"name": "launchdate datetime","label":"Launch Date"},
				{"name": "expirydate datetime","label":"Expiry Date"}
			]
		}, {
			"name": "online_course_read_tracker",
			"saveid":"ocrtsv","getid":"ocrtgt","delpermanentid":"ocrtdt",			
			"joindef":{
				"online_course_users":"||thistbl||.createdby=online_course_users.id"
			},
			"form":{
				"0":{"title":"Document Upload","icon":"mif-delicious","type":"Inline",
					"fields":"document","getformvalue":"||notes_readtrackerid||",
					"datacollapsed":false,
					"default":[						
						{"name":"uploaddate","fieldtype":"hidden","value":"CURDATE()"}
					]
				}				
			},
			"list":{
				"asgnlt":{
					"tbl":"online_course_read_tracker a",
					"usejoin":"online_course_users b",
					"datatable":true,
					"fld":"b.fullname,a.uploaddate,CONCAT('<a target=_BLANK href=',a.document,'>Link</a>')as link,a.mark",
					"header":"Name,Upload Date,Document Link,Mark",
					"srt":"a.uploaddate DESC",
					"editablefields":"a.mark",
					"whr":"a.document is not null and a.onlinecourse_lessonid='||LESSONID||' and b.recordstatus=1 and year(a.modifiedon)=year(CURDATE())"					
				},
				"asglt1":{
					"tbl":"online_course_read_tracker a","output":"#workareaAppendix",
					"usejoin":"online_course_users b",
					"datatable":true,"getform":"online_course_read_tracker 0",
					"fld":"b.fullname,a.uploaddate,CONCAT('<a target=_BLANK href=',a.document,'>Link</a>')as link,a.mark",
					"header":"Name,Upload Date,Document Link,Mark",
					"srt":"a.uploaddate DESC",
					"editablefields":"a.mark",
					"whr":"a.onlinecourse_lessonid='||lessonid||' and b.recordstatus=1",
					"includeeditdelete":true,
					"onsuccess":"cmd:dom,fun:#workareaAppendix;show"
				}
			},
			"fields": [
			{"name": "mycourseid uniqueidentifier NOT NULL","label":"MyCourse ID"}, 
			{"name": "onlinecourse_lessonid varchar(36) NOT NULL","label":"Lesson ID"}, 
			{"name": "read_status tinyint NOT NULL","label":"Read Status"}, 
			{"name": "notes varchar(2000) NOT NULL","label":"Notes"}, 
			{"name": "lesson_color_codings varchar(1000) NOT NULL","label":"Lesson Colour Code"},
			{"name": "mark tinyint NOT NULL DEFAULT 0","fieldtype":"text","label":"Mark"},
			{"name": "responses varchar(8000)","fieldtype":"textarea","label":"Responses"},
			{"name": "document varchar(300)","fieldtype":"file","label":"Documents (PDF)","file":{"maxsize":"20mb","filetype":"pdf"}},
			{"name": "uploaddate date","label":"Upload Date","fieldtype":"hidden"}
		]
		},
		{
			"name": "online_course_resources",
			"saveid":"ocrsv","getid":"ocrgt","delid":"ocrdt",
			"form":{
				"0":{
					"title":"Resource","type": "Inline","icon": "mif-dashboard","fields":"*"
				},
				"1":{
					"title":"Resource","type": "Inline","icon": "mif-dashboard","fields":"documentname,link",
					"default":[
						{"name":"lessonid","value":"||LESSONID||","fieldtype":"hidden"}
					]
				}
			},
			"list":{
				"ocrlt":{
					"name":"Resource List(All)",
					"action":"Get HTML",
					"tbl":"online_course_resources",
					"fld":"documentname,link",
					"defaultwhr":"recordstatus=1 and status=1",
					"template":"<div style='display:inline'><div style='width:70%'>||documentname||</div><div style='width:25%'><a href='||link||'>link</a></div></div>"
				},
				"ocrlt1":{
					"name":"Resource List(Faculty-Editable)",
					"action":"Get Table","getform":"||thistbl|| 1",
					"includeeditdelete":true,
					"tbl":"online_course_resources",
					"staticwhr":[
						"recordstatus=1 and status=1",						
					],
					"fld":"documentname,IF(link != '',CONCAT('<a href=',link,' target=_BLANK>Link</a>'),'') as link",
					"header":"Document name,Link"					
				}
			},
			"fields": [
				{"name": "lessonid varchar(36) NOT NULL","required":true,"label":"Lesson Id","fieldtype":"lookup","lookup":{"sqlid":"ocrlk","fld":"title","tbl":"online_lesson"}}, 
				{"name": "documentname varchar(200) NOT NULL","required":true,"label":"Document Name"}, 
				{"name": "link varchar(500) NOT NULL","required":true,"fieldtype":"file","label":"Document","file":{"maxsize":"21mb","filetype":"pdf,png,jpg,jpeg"}}, 
				{"name": "status tinyint NOT NULL DEFAULT 1","label":"Document Status"}
			]
		},
		{
			"name": "online_course_users",
			"saveid":"ocusv","getid":"ocugt","delid":"ocudt","getform":"ocugf 0",
			"form":{
				"0":{"title":"Users","name":"For Students","icon":"mif-delicious","type":"Inline","fields":"emailid,fullname,linked_to_institution,linked_to_program,educationmode,district,state,phoneno,alternate_phoneno,whatsappno,recommendedby,gender"},
				"1":{"title":"Users","name":"For Admins","icon":"mif-delicious","type":"Inline","fields":"*"},
				"2":{"title":"Create Account","name":"For Creating Account","icon":"mif-delicious","type":"Inline","fields":"emailid,fullname,phoneno,gender,pass","datacollapsed":false},
				"3":{"title":"User Account","name":"For Display User Information","icon":"mif-delicious","type":"2 Columns","datacollapsed":false,"getformvalue":"||userid||","clearButton":false,
					"fields":[
						{"name":"emailid","fieldtype":"readonly","label":"Email"},
						"fullname",
						{"name":"rollno","fieldtype":"readonly","label":"Roll No"},
						{"name":"linked_to_program","fieldtype":"readonly","label":"Program"},
						"phoneno,educationmode,district,state,alternate_phoneno,whatsappno,gender,imagepath",
						{"name":"pass","fieldtype":"password","label":"Password"}
					]
				}
			},
			"list":{
				"ocult":{
					"name":"User List for Admin",
					"fld":"fullname,rollno,linked_to_institution,linked_to_program,district,state,phoneno,status",
					"getform":"||thistbl|| 1","filter":"linked_to_institution,state,fullname",
					"includeeditdelete":true,
					"editablefields":"rollno,linked_to_program,status",
					"srt":"createdon desc",
					"defaultwhr":"status=1 and recordstatus=1"
					
				},
				"ocuf3":{
					"action":"GetForm",
					"output":"#workareaTablebox",
					"getform":"online_course_users 3"
				}
			},
			"fields": [
				{"name": "emailid varchar(200) UNIQUE NOT NULL","label":"Email","required":true,"saveif":[{"sqlstatement":{"usrcnt":"select count(*) FROM online_course_users WHERE emailid='||thisvalue||' and id != '||id||'"}},{"if":"||usrcnt|| = 0","errormsg":"EmailID already exists"}]},
				{"name": "fullname varchar(100) NOT NULL","label":"Full Name","required":true,"filterop":"like"},
				{"name": "rollno varchar(10) NOT NULL","label":"Roll Number"},
				{"name": "linked_to_institution varchar(10)","label":"Institution","fieldtype":"select","option":"NBBI,NIBS"},
				{"name": "linked_to_program varchar(30)","label":"Program","fieldtype":"select","option":"None,Bachelor of Theology,Master of Divinity"},
				{"name": "educationmode varchar(11)","label":"Mode of Education","fieldtype":"select","option":"Online,Residential"},
				{"name": "district varchar(30)","label":"District"},
				{"name": "state varchar(30)","label":"State","fieldtype":"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"},
				{"name": "phoneno char(10)","label":"Phone Number","required":true},
				{"name": "alternate_phoneno char(10)","label":"Alternate Phone Number"},
				{"name": "whatsappno char(15)","label":"WhatsApp Number"},
				{"name": "recommendedby varchar(50)","label":"Recommended By"},
				{"name": "pass varchar(20) NOT NULL","label":"Password","default":{"insert":"password"},"required":true},
				{"name": "status tinyint NOT NULL DEFAULT 1","fieldtype":"select","option":"1:Active,0:Inactive","label":"Status"},
				{"name": "gender enum('Male','Female')","label":"Gender"},
				{"name": "isfaculty tinyint NOT NULL DEFAULT 0","label":"Is Faculty","fieldtype":"select","option":"0:No,1:Yes"},
				{"name": "admissionform varchar(150)","fieldtype":"file","label":"Admission Form","file":{"maxsize":"1mb","filetype":".pdf","directory":"online"}},
				{"name": "educert1 varchar(150)","fieldtype":"file","label":"Education Certificate 1","file":{"maxsize":"1mb","filetype":".jpg,.png,.pdf","directory":"online"}},
				{"name": "educert2 varchar(150)","fieldtype":"file","label":"Education Certificate 2","file":{"maxsize":"1mb","filetype":".jpg,.png,.pdf","directory":"online"}},
				{"name": "recommendation varchar(150)","fieldtype":"file","label":"Recommendation Certificate","file":{"maxsize":"2mb","filetype":".jpg,.png,.pdf","directory":"online"}},
				{"name": "baptismcert varchar(150)"	,"fieldtype":"file","label":"Baptism Certificate","file":{"maxsize":"1mb","filetype":".jpg,.png,.pdf","directory":"online"}},
				{"name": "admissionyear SMALLINT NOT NULL DEFAULT 0","label":"Admission Year","fieldtype":"number"},
				{"name": "imagepath varchar(150)","fieldtype":"file","label":"Your Photograph","file":{"maxsize":"1mb","filetype":".jpg,.png","directory":"online"}}
			]
		}

	],
	"sqlcommands_oninstall": [],
	"form": [
		{
			"name": "Online_Course",
			"formtype": "Horizontal",
			"title": "Online Course",
			"icon": "mif-books fg-green",
			"saveButton": "true",
			"savecustomid": 44,
			"getrecordcustomid": 46,
			"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": "online_author1",
			"formtype": "Default",
			"title": "Online Course Author",
			"icon": "mif-user fg-white",
			"saveButton": "true",
			"savecustomid": "svAuth",
			"getrecordcustomid": "geAuth",
			"cancelButton": "true",
			"flex_row": "true",
			"flex_justify": "start",
			"width": "400px",
			"field": [{
					"name": "authorname",
					"label": "Author Name",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"maxlength": "50"
				},
				{
					"name": "description",
					"label": "Description",
					"fieldtype": "s",
					"type": "textarea",
					"required": "Yes",
					"maxlength": "500"
				}, {
					"name": "linked_to_institution",
					"label": "Institution",
					"fieldtype": "s",
					"type": "select",
					"option": "Select,NIBS,NBBI,NIBI,Other",
					"required": "Yes"
				}, {
					"name": "image_path",
					"label": "Image Path",
					"fieldtype": "s",
					"type": "file",
					"required": "Yes",
					"maxlength": "300",
					"uploadstmt": "5"
				},
				{
					"name": "owner",
					"label": "Owner",
					"fieldtype": "u",
					"type": "select",
					"required": "Yes",
					"option": "SELECT id,fullname FROM online_course_users WHERE isfaculty=1"
				}
			]
		}, {
			"name": "Online Course Users",
			"formtype": "Horizontal",
			"title": "Online Course Users",
			"icon": "mif-user",
			"saveButton": true,
			"savecustomid": 45,
			"getrecordcustomid": 47,
			"cancelButton": "true",
			"flex_row": "true",
			"flex_justify": "start",
			"field": [{
					"name": "emailid",
					"label": "Email",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"allownull": "0",
					"maxlength": "200",
					"readonly": 1
				}, {
					"name": "pass",
					"label": "Password",
					"fieldtype": "s",
					"type": "password",
					"required": "Yes",
					"allownull": "0",
					"maxlength": "20"
				},
				{
					"name": "fullname",
					"label": "Full Name",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"allownull": "0",
					"maxlength": "100"
				},
				{
					"name": "gender",
					"label": "Gender",
					"fieldtype": "s",
					"type": "select",
					"option": "Male,Female",
					"required": "Yes",
					"allownull": "0"
				},
				{
					"name": "linked_to_institution",
					"label": "Linked to Institution",
					"fieldtype": "s",
					"type": "select",
					"option": ":Select,NIBS,NBBI,NIBI,Other",
					"allownull": "1",
					"required": "Yes"
				},
				{
					"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",
					"required": "Yes"
				}, {
					"name": "educationmode",
					"label": "Education Mode",
					"fieldtype": "s",
					"type": "select",
					"option": "Online,Residential",
					"allownull": "0",
					"required": "Yes"
				},
				{
					"name": "district",
					"label": "District",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"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",
					"required": "Yes",
					"allownull": "1"
				},
				{
					"name": "phoneno",
					"label": "Phone No (10 digit only)",
					"fieldtype": "s",
					"type": "text",
					"required": "Yes",
					"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_apply",
			"formtype": "Default",
			"title": "Application For a Course",
			"icon": "mif-user",
			"saveButton": true,
			"savecustomid": "52save",
			"getrecordcustomid": "52get",
			"cancelButton": "true",
			"flex_row": "true",
			"flex_justify": "start",
			"field": [{
				"name": "prgtype",
				"label": "Mode of Study",
				"fieldtype": "s",
				"type": "select",
				"option": "Residential,Online",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "college",
				"label": "Select your college",
				"fieldtype": "s",
				"type": "select",
				"option": "NIBS:New India Bible Seminary; Paippad,NBBI:Nav Bharat Bible Institute; Purnia",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "gender",
				"label": "Gender",
				"fieldtype": "s",
				"type": "select",
				"option": "M:Male,F:Female",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "dob",
				"label": "Date of birth",
				"fieldtype": "d",
				"type": "datepicker",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "father",
				"label": "Father's Name",
				"fieldtype": "s",
				"type": "text",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "spouse",
				"label": "Spouse's Name (if married)",
				"fieldtype": "s",
				"type": "text"
			}, {
				"name": "permadd",
				"label": "Permanent Address",
				"fieldtype": "s",
				"type": "textarea",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "coradd",
				"label": "Correspondance Address",
				"fieldtype": "s",
				"type": "textarea",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "state",
				"label": "State",
				"fieldtype": "s",
				"type": "select",
				"option": "||state||",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "pin",
				"label": "PIN Code",
				"fieldtype": "n",
				"type": "number",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "mothertongue",
				"label": "Mother Tongue",
				"fieldtype": "s",
				"type": "text",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "course",
				"label": "Course Opting for",
				"fieldtype": "s",
				"type": "select",
				"option": "CTh:Certificate in Theology,DTh:Diploma in Theology,BTh:Bachelor of Theology,MDiv:Master in Divinity",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "medium",
				"label": "Medium of Learning",
				"fieldtype": "s",
				"type": "select",
				"option": "Eng:English,Hin:Hindi,Tamil:Tamil,Mal:Malayalam",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "gadget",
				"label": "Gadget you will use for E-Learning",
				"fieldtype": "s",
				"type": "select",
				"option": "None,Smart Phone,Tablet,Laptop,Desktop",
				"allownull": "0"
			}, {
				"name": "xnyears",
				"label": "How long have you been a Christian (in years)",
				"fieldtype": "s",
				"type": "number",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "church",
				"label": "Church affiliated with",
				"fieldtype": "s",
				"type": "text",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "pastor",
				"label": "Pastor's Name",
				"fieldtype": "s",
				"type": "text",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "pastorcontact",
				"label": "Pastor's Contact Number",
				"fieldtype": "s",
				"type": "text",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "sponsor",
				"label": "Do you have a Sponsor",
				"fieldtype": "n",
				"type": "select",
				"option": "0:No,1:Yes",
				"required": "Yes",
				"allownull": "0"
			}, {
				"name": "fee",
				"label": "If no sponsor, then, who will pay your fees",
				"fieldtype": "s",
				"type": "text"
			}, {
				"name": "candidatephoto_path",
				"label": "Candidate Passport Photo",
				"fieldtype": "s",
				"type": "file",
				"allownull": "0"
			}, {
				"name": "educert_path",
				"label": "Candidate Highest Education Certificate",
				"fieldtype": "s",
				"type": "file",
				"allownull": "0"
			}, {
				"name": "pastorrecommendation_path",
				"label": "Attach Pastor's Recommendation",
				"fieldtype": "s",
				"type": "file",
				"allownull": "0"
			}, {
				"name": "sign",
				"label": "Candidate Signature",
				"fieldtype": "s",
				"type": "signature"
			}, {
				"name": "status",
				"label": "Status",
				"fieldtype": "s",
				"type": "hidden"
			}]
		}
	],
	"form_html": "",
	"navbutton": [{
		"customid": "1",
		"caption": "Course",
		"icon": "mif-books fg-green",
		"btntype": "ribbon-button",
		"btngroup": "Online Course",
		"btntab": "Online Education",
		"btnorder": "1",
		"onclick": "initializePlugin();"
	}],
	"script": "",
	"formbuttons": [{
			"name": "addCourse",
			"icon": "mif-plus fg-red",
			"onclick": "showNewForm('online_course')"
		}, {
			"name": "listCourse",
			"caption": "Courses",
			"icon": "mif-books fg-red",
			"onclick": "listCourses()"
		},
		{
			"name": "activeCourse",
			"caption": "Course",
			"icon": "mif-books fg-green",
			"onclick": "Eirene.runStmt('1lt')"
		}, {
			"name": "activeAuthor",
			"caption": "Author",
			"icon": "mif-user fg-green",
			"onclick": "Eirene.runStmt('atlst-autbtn-autflt')"
		},
		{
			"name": "activeLesson",
			"caption": "Lesson",
			"icon": "mif-file-text",
			"onclick": "Eirene.runStmt('lsnlt')"
		}, {
			"name": "activeUsers",
			"caption": "Users",
			"icon": "mif-user",
			"onclick": "Eirene.runStmt('ocult')"
		}, {
			"name": "activeassign",
			"caption": "Assignment",
			"icon": "mif-user",
			"onclick": "Eirene.runStmt('olaslt')"
		}, {
			"name": "activemark",
			"caption": "Mark",
			"icon": "mif-user",
			"onclick": "Eirene.runStmt('omklt1')"
		}, {
			"name": "Payments",
			"caption": "Payments",
			"icon": "mif-user",
			"onclick": "Eirene.runStmt('paymts-payflt')"
		}, {
			"name": "Course Subscriptions",
			"caption": "Subscriptions",
			"icon": "mif-user",
			"onclick": "Eirene.runStmt('crssub-subflt')"
		}, {
			"name": "Course Applications",
			"caption": "Course Applications",
			"icon": "mif-user",
			"onclick": "Eirene.runStmt('1CrApL')"
		}
	],
	"others": {
		"permission": "public",
		"menu": [{
				"caption": "Courses",
				"captioncls":"",
				"icon": "mif-book-reference",				
				"customid": "1",
				"onclick": "Eirene.runStmt(&apos;lstcr&apos;,{program:&apos;&apos;,institute:&apos;&apos;,search:&apos;&apos;})"

			},
			{
				"caption": "My Courses",
				"captioncls":"",
				"icon": "mif-books",				
				"customid": "2",
				"onclick": "if(!Eirene.userid){Eirene.runStmt(&apos;1lgn&apos;);}else{Eirene.runStmt(&apos;lstcr&apos;,{mycourse:1,program:&apos;&apos;,institute:&apos;&apos;,search:&apos;&apos;})}"
			},
			{
				"caption": "My Test",
				"customid":3,
				"captioncls":"",
				"icon": "mif-open-book",				
				"onclick": ""
			},
			{
				"caption": "Login",
				"captioncls": "loginbtn",
				"icon": "mif-switch onlinecourselogin-appbar",				
				"customid": "4",
				"onclick": "if(!Eirene.userid){Eirene.runStmt(&apos;1lgn&apos;);}else{$(&apos;#workareaFilter&apos;).hide();Eirene.runStmt(&apos;21a&apos;);}"						
			},{
				"caption": "Marks",
				"captioncls": "markbtn",
				"icon": "mif-calendar onlinecourselogin-appbar",				
				"customid": "5",
				"onclick": "if(!Eirene.userid){Eirene.runStmt(&apos;1lgn&apos;);}else{$(&apos;#workareaFilter&apos;).hide();Eirene.runStmt(&apos;omklt&apos;);}"						
			},{
				"caption": "Q&A",
				"captioncls": "QAbtn",
				"icon": "mif-calendar onlinecourselogin-appbar",				
				"customid": "6",
				"onclick": "if(!Eirene.userid){Eirene.runStmt(&apos;1lgn&apos;);}else{$(&apos;#workareaFilter&apos;).hide();Eirene.runStmt(&apos;queans&apos;,{varqueans_output:&apos;#workareaTablebox&apos;});}"						
			},
			{
				"caption": "Login History",
				"captioncls":"",
				"icon": "mif-key",				
				"customid": "7",
				"onclick": "if(!Eirene.userid){Eirene.runStmt(&apos;1lgn&apos;);}else{Eirene.runStmt(\\\"24\\\");}"
			},
			{
				"caption": "Author",
				"captioncls":"",
				"icon": "mif-user",				
				"customid": "8",
				"onclick": "Eirene.runStmt(\\\"chkfac-26\\\")"
			}
		]
	},
	"sqlstatement": [
		{
			"id":"1lgn",
			"name":"Login Form",
			"sql":{
				"action":"Return",
				"outputto":"php","output":"res",
				"value":"",
				"elem":{
					"output":"#workareaTablebox",					
					"elem":[{
						"name":"loginform",
						"type":"messagebox",
						"mode":"info","title":"Login",
						"content":[						
							{
								"name": "loginform_userid",
								"id": "loginform_userid",
								"label": "Email","labelclass":"cell-2","class":"cell-8",
								"type":"text"
							},
							{"name":"onlf_a","type":"div","value":""},
							{
								"name": "loginform_pass",
								"id": "loginform_pass",
								"label": "Password","labelclass":"cell-2","class":"cell-8",
								"type":"password"
							},
							{"name":"onlf_b","type":"div","style":"height:30px;","value":""},						
							{
								"name":"onlfbtn1",
								"type":"button",
								"value": "Login",
								"onclick": "let user=$('#loginform_userid').val();let pass=$('#loginform_pass').val();Eirene.runStmt('7',{USERNAME:user,PASS:pass});",
								"class": "button primary"
							},
							{
								"name":"onlfbtn2",
								"type":"button",
								"value": "Sign Up",
								"onclick": "Eirene.runStmt('1sgnup');",
								"class": "button secondary"							
							},
							{
								"name":"onlfbtn3",
								"type":"button",
								"value": "Forgot Password",
								"onclick": "var email=$('#loginform_userid').val();if(!email){showToast('Email is blank','alert',5000);return false;}Eirene.runStmt('fgpass',{email:email})",
								"class": "button secondary"
							}
						]
					}]
				}
			}
		},
		{
			"id":"1sgnup",
			"name":"Signup Form",
			"sql":{
				"action":"GetForm",
				"output":"#workareaTablebox",
				"getform":"online_course_users 2"			
			}
		},{
			"id":"addcr",
			"name":"Add Course Form",
			"sql":{
				"action":"GetForm",
				"output":"#workareaTablebox",
				"getform":"online_course 1"
			}
		},
		{
			"id": "1CrApL",
			"name": "Course Application List",
			"sql": {
				"action": "Get Table",
				"formname": "online_course_apply",
				"outputto": "html",
				"output": "table",
				"tbl": "online_applyforcourse a",
				"fld": "b.fullname,a.course,a.college,a.createdon,a.status",
				"join": "INNER JOIN online_course_users b ON a.createdby=b.id",
				"srt": "a.createdon DESC",
				"whr":[
					"a.recordstatus=1",
					{"if":"||status|| != BLANK","then":" and a.status=||status||"}
				],
				"elem": {
					"output": "#workareaFilter",
					"parent": "div",
					"elem": [{
							"name": "f1",
							"value": "Draft",
							"onclick": "Eirene.runStmt('1CrApL',{status:'draft'})"							
						},
						{
							"name": "f2",
							"value": "Submitted",
							"onclick": "Eirene.runStmt('1CrApL',{status:'submitted'})"							
						},
						{
							"name": "f3",
							"value": "Fee Paid",
							"onclick": "Eirene.runStmt('1CrApL',{status='Fee Paid'})"
						}
					]
				},
				"functionfield": [{
					"name": "f4",
					"type": "icon",
					"class": "icon mif-pencil",
					"onclick": "edit('online_course_apply','<a.id>',true)",
					"caption": "Edit"
				}],
				"onsuccess": "cmd:dom,fun:show;#workareaFilter;fast",
				"header": "Title,Author,Price,Lesson Count"
			}
		},
		{
			"id": "5",
			"name": "studentsForACourse",
			"sql": {
				"action": "Get Table",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "#workareaAppendix",
				"fld": "b.fullname,a.createdon",
				"tbl": "online_course_mycourse a",
				"join": "INNER JOIN online_course_users b ON a.createdby=b.id",
				"whr": "a.expirydate>='||TODAY||' and a.courseid='||COURSEID||'",
				"srt": "b.fullname",
				"header": "Name,Subscribed On",
				"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast-cmd:dom,fun:function;datatable;#workareaAppendix"
			}
		}, {
			"id": "6",
			"name": "coursetitle",
			"sql": {
				"action": "Get Row",
				"validate": "online_course_users",
				"fld": "title,fastforward",
				"tbl": "online_course",
				"whr": "id='||COURSEID||'",
				"header": "Title,Fastforward"
			}
		}, {
			"id": "7",
			"name": "LogIn",
			"sql": {
				"action": "Return",	"validate": "none",
				"outputto": "php","output":"res",					
				"value":[					
					{"sqlstatement":{
						"usertbl":"SELECT a.id,a.id as userid,a.fullname,a.isfaculty,linked_to_institution as institution FROM online_course_users a WHERE a.emailid='||USERNAME||' and a.pass='||PASS||' AND a.status=1",
						"logout":"UPDATE online_course_user_tracker SET status=0 WHERE createdby='||usertbl_userid||' AND status=1"						
					}},					
					{"if":"||usertbl_id|| = BLANK","then":[
						{"script":["animateElem($('#workareaTablebox'),'horizontal',false,1000);"]},
						{"cookie":[{"name":"userid","value":"","time":"0"}]},
						{"domoutput":"showtoast;alert;User credential mismatch"},
						{"abort":true}
					]},
					{"sqlstatement":{"a":"INSERT INTO online_course_user_tracker (id,status,sessionid,createdby,ip,city,region,country,useragent) values (UUID(),1,'||PHPSESSID||','||usertbl_userid||','||IP||','||CITY||','||REGION||','||COUNTRY||','||USERAGENT||')"}},					
					{"if": "||usertbl_isfaculty|| = 1","then":{"call":"51fFrm"}},
					{"sqlstatement":{
							"crcnt":"SELECT count(*) FROM online_course_mycourse WHERE createdby='||usertbl_userid||' and expirydate>=NOW()",
							"usrcnt":"SELECT count(*) FROM online_course_user_tracker where status=1"
						}
					},					
					{"cookie":[{"name":"userid","value":"||usertbl_userid||","time":"1 week"}]},
					{"cookie":[{"name":"isfaculty","value":"||usertbl_isfaculty||","time":"1 week"}]},
					{"script":[						
						"$('.loginbtn').text('Logout');",						
						"$('.mycoursecount').text('||usrcnt||');",
						"$('#payfeeli').show('slow');",
						"$('#onlinecourseloginForm').hide('slow');",
						"$('#applyforcourse').show('slow');",
						"Eirene.userinfo={id:'||usertbl_id||',userid:'||usertbl_userid||',fullname:'||usertbl_fullname||',isfaculty:||usertbl_isfaculty||,institute:'||institute||'};",
						"myOnlineCourse.userid='||usertbl_userid||';",
						"Eirene.userid='||usertbl_userid||';",
						"Eirene.addedvariables.isfaculty='||usertbl_isfaculty||';",
						"myOnlineCourse.username='||usertbl_fullname||';",
						"myOnlineCourse.isfaculty='||usertbl_isfaculty||';",
						"myOnlineCourse.institute='||usertbl_institution||';",
						"Eirene.runStmt('lstft1');",						
						"$('#usernamediv').html('||usertbl_fullname||');",
						"$('.username').html(' <span onclick=Eirene.runStmt(&apos;ocuf3&apos;)>||usertbl_fullname||</span>');",
						"showMessage('Login Success','You have successfully logged in.','info','#workareaTablebox');"
					]}				
				]
			}
		}, {
			"id": "9",
			"name": "getLessons",
			"sql": {
				"action": "Get Rows",
				"validate": "online_course_users",
				"fld": "a.lesson_no,a.title,a.type,a.material,a.options,||FASTFORWARD||,a.id,b.notes,b.responses,a.lesson_order",
				"tbl": "online_lesson a",
				"join": "LEFT JOIN (SELECT read_status,onlinecourse_lessonid,notes,responses FROM online_course_read_tracker WHERE onlinecourse_userid='||USERID||') b ON a.id=onlinecourse_lessonid",
				"whr": "a.courseid='||COURSEID||' and a.status=1 and (a.launchdate<=now() or a.launchdate is null)",
				"srt": "a.lesson_no,a.lesson_order",
				"header": "Lesson No.,Title,Type,Material,Option,Fastforward,ID,Notes,Response,Order"
			}
		}, {
			"id": "11",
			"name": "getResourceStudent",
			"sql": {
				"action": "Get HTML",
				"parent": "ol class='onlineCoursePage'",
				"validate": "online_course_users",
				"outputto": "php",
				"output": "resource",
				"template": "<li><a href='||link||' target='_blank'>||documentname||</a></li>",				
				"fld": "id,documentname,link",
				"tbl": "online_course_resources",
				"whr": "lessonid='||LESSONID||' and status=1",
				"prepend":[
					{"if":"||rowsCount|| > 0","then":
					"<h3 class='onlineCoursePage'>Resources</h3>"
					}
				],
				"onsuccess": "cmd:dom,fun:assignvariable;Eirene.additionalresource;online_course_resourcesection",
				"header": "ID,Document Name,Link"
			}
		}, {
			"id": "11a",
			"name": "getResourceFaculty",
			"sql": {
				"action": "Get HTML",
				"parent": "ol class='onlineCoursePage'",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "php",
				"output": "resource",
				"template": "<li><a href='||link||' target='_blank' >||documentname||</a><span class='fg-red ml-2' onclick='removeLessonResource(\\\"||id||\\\",\\\"||link||\\\",$(this))'>X</span><span class='ml-2 fg-blue' style=\\\"cursor: pointer\\\" onclick=\\\"copy('||link||')\\\">Copy Path</span><span class='ml-2 fg-teal' onclick='changeLessonResourceLinkText(\\\"||id||\\\",$(this))'>Change Text</span></li>",
				"fld": "id,documentname,link",
				"tbl": "online_course_resources",
				"whr": "lessonid='||LESSONID||' and status=1",
				"prepend1": "<form id='onlinecourse_lesson_resource_uploadform' method='post' style='display:none' enctype='multipart/form-data'><div class='d-flex'><input type='hidden' name='lessonid' value='||GET_lesson_id||' /><input type='hidden' name='createdby' value='||USERID||' /><input name='uploadfile[]' type='file' data-role='file' data-mode='drop' multiple/><button type='button' class='button uploadprogress' id='onlinecourse_bulk_upload_btn' onclick='$(this).hide();let form = $(\\\"#onlinecourse_lesson_resource_uploadform\\\");let formData = new FormData(form[0]);callAjax({stmt:34,userid:\\\"||USERID||\\\",pluginid:\\\"||PLUGINID||\\\",LESSONID:\\\"||GET_lesson_id||\\\",elemname:\\\"link\\\",formname:\\\"onlinecourse_lesson_addresourceForm\\\",silent:true},processAfterBulkUploadFile,formData)'>Upload</button></div></form><h3>Additional Resources</h3>",
				"onsuccess": "cmd:dom,fun:assignvariable;Eirene.additionalresource;online_course_resourcesection",
				"header": "ID,Document Name,Link"
			}
		}, {
			"id": "11a1",
			"name": "getResourceFaculty",
			"sql": {
				"action": "Get HTML",
				"parent": "ol class='onlineCoursePage'",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "online_course_resourcesection",
				"template": "<li><a href='||link||' target='_blank'>||documentname||</a><span class='fg-red ml-2'>X</span><span class='ml-2 fg-blue' style=\\\"cursor: pointer\\\" onclick=\\\"copy('||link||')\\\">Copy Path</span><span class='ml-2 fg-teal' onclick='changeLessonResourceLinkText(\\\"||id||\\\",$(this))'>Change Text</span></li>",
				"fld": "id,documentname,link",
				"tbl": "online_course_resources",
				"whr": "lessonid='||LESSONID||' and status=1",
				"prepend": "<form id='onlinecourse_lesson_resource_uploadform' method='post' enctype='multipart/form-data'><div class='d-flex'><input type='hidden' name='lessonid' value='||LESSONID||' /><input type='hidden' name='createdby' value='||USERID||' /><input name='uploadfile[]' type='file' data-role='file' data-mode='drop' multiple/><button type='button' class='button uploadprogress' id='onlinecourse_bulk_upload_btn' onclick='$(this).hide();let form = $(\\\"#onlinecourse_lesson_resource_uploadform\\\");let formData = new FormData(form[0]);callAjax({stmt:34,userid:\\\"||USERID||\\\",pluginid:\\\"||PLUGINID||\\\",LESSONID:\\\"||LESSONID||\\\",elemname:\\\"link\\\",formname:\\\"onlinecourse_lesson_addresourceForm\\\",silent:true},processAfterBulkUploadFile,formData)' >Upload</button></div></form><h3>Additional Resources</h3>",
				"onsuccess": "cmd:dom,fun:assignvariable;Eirene.additionalresource;online_course_resourcesection",
				"header": "ID,Document Name,Link"
			}
		}, {
			"id": "12",
			"name": "deleteResource",
			"sql": {
				"action": "Delete Row Permanently",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"tbl": "online_course_resources",
				"whr": "id='||ID||'",
				"onsuccess": "rmfile"
			}
		}, {
			"id": "rmfile",
			"name": "DeleteFile",
			"sql": {
				"action": "Remove File",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"path": "||PATH||"
			}
		}, {
			"id": "lstft1",
			"name": "List Course Filter",
			"sql": {
				"action": "Return",
				"outputto": "php","output": "res",
				"validate": "none",
				"value": "",
				"elem": {
					"output": "#workareaFilter",
					"parent": "div",
					"class": "row",
					"elem": [{
							"name": "f1",
							"type": "select",
							"class": "cell metro-input",
							"id": "onlinecourse_programlist",
							"placeholder":"Select Course",
							"addemptyvalue":true,
							"option": "SELECT DISTINCT programlinked FROM online_course"
						},
						{
							"name": "f2",
							"type": "select",
							"class": "cell metro-input",
							"placeholder":"Select Institute",
							"id": "onlinecourse_institutelist",
							"addemptyvalue":true,
							"option": "SELECT DISTINCT institute FROM online_course"
						},
						{
							"name": "f3",
							"type": "text",
							"class": "cell metro-input",
							"id": "onlinecourse_searchcoursetxt",
							"placeholder": "Search Text"
						},
						{
							"name": "f4",
							"type": "button",
							"class": "mif-search metro-input",
							"style": "width:40px",
							"caption": "",
							"onclick": "Eirene.runStmt('lstcr',{program:$('#onlinecourse_programlist').val(),institute:$('#onlinecourse_institutelist').val(),search:$('#onlinecourse_searchcoursetxt').val()})"
						}
					]
				},
				"onsuccess": "cmd:dom,fun:show;#workareaFilter;fast"
			}
		}, {
			"id": "lstcr",
			"name": "List Course",
			"sql": {
				"action": "Return",
				"validate": "none",
				"output": "res",
				"outputto": "php",				
				"value": "",
				"prerun":[
					{"sqlstatement":{
						"loggedin":"SELECT COUNT(*) FROM online_course_user_tracker WHERE sessionid='||PHPSESSID||' and status=1"						
					}},					
					{"if":"||loggedin|| = 0","then":{"call":"lstcr1"},
						"else":[
							{"if":"||isfaculty|| = 1 and ||mycourse|| = 1","then":[{"call":"lstcr2-15adcr"},{"abort":true}]},
							{"if":"||isfaculty|| = 1 and ||mycourse|| != 1","then":[{"call":"lstcr3"},{"abort":true}]},
							{"if":"||isfaculty|| != 1 and ||mycourse|| = 1","then":[{"call":"lstcr2"},{"abort":true}]},				
							{"if":"||isfaculty|| != 1 and ||mycourse|| = BLANK","then":[{"call":"lstcr3"}]}					
						]
					}
				]				
			}
		}, {
			"id": "lstcr1",
			"name": "List All Courses (Not Loggedin)",
			"sql": {
				"action": "Get HTML",
				"validate": "none",
				"outputto": "html",
				"output": "table",
				"datefield": "a.expirydate",
				"fld": "a.title,a.image_path,b.fullname,a.description,a.id,b.imagepath as author_image,a.price,a.timeneeded,a.credit,a.goals,a.connexionmodel,'' as mycourseid,a.programlinked,-1 as status,0 as per,a.owner",
				"tbl": "online_course a",
				"join": [
					"INNER JOIN online_course_users b ON a.authorid=b.id"					
				],
				"whr": [
					"a.status=1 and a.recordstatus=1",
					{
						"if": "||program|| != BLANK",
						"then": "and a.programlinked='||program||'"
					},
					{
						"if": "||institute|| != BLANK",
						"then": "and a.institute='||institute||'"
					},
					{
						"if": "||search|| != BLANK",
						"then": "and a.title like '%||search||%'"
					}
				],
				"limit": "400",
				"merge": "15temp"
			}

		}, {
			"id": "lstcr2",
			"name": "List Subscribed Courses (Loggedin)",
			"sql": {
				"action": "Get HTML",
				"validate": "none",
				"outputto": "html",
				"output": "table",
				"datefield": "a.expirydate",
				"fld": "a.title,a.image_path,b.fullname,a.description,b.imagepath as author_image,a.id,a.price,a.timeneeded,a.credit,a.goals,a.connexionmodel,c.id as mycourseid,a.programlinked,c.status as status,'' as per,a.owner",
				"tbl": "online_course a",
				"join": [
					"INNER JOIN online_course_users b ON a.authorid=b.id",					
					"INNER JOIN online_course_mycourse c ON c.courseid=a.id"
				],
				"whr": [
					"a.status=1 and a.recordstatus=1 and c.createdby='||userid||' and c.status=1 and c.recordstatus=1"
				],
				"srt":"c.createdon desc",
				"limit": "400",
				"merge": "15temp"
			}

		}, {
			"id": "lstcr3",
			"name": "List Non Subscribed Courses",
			"sql": {
				"action": "Get HTML",
				"validate": "none",
				"outputto": "html",	"output":"#workareaTablebox",			
				"datefield": "a.expirydate",
				"fld": "a.title,a.image_path,b.fullname,a.description,a.id,b.imagepath as author_image,a.price,a.timeneeded,a.credit,a.goals,a.connexionmodel,c.id as mycourseid,a.programlinked,0 as status,0 as per,a.owner",
				"tbl": "online_course a",
				"join": [
					"LEFT JOIN (SELECT * FROM online_course_mycourse where createdby='||userid||' and status=1 and expirydate>=NOW() and recordstatus=1) c on c.courseid=a.id",
					"INNER JOIN online_course_users b ON a.authorid=b.id"					
				],
				"whr": [
					"c.id IS NULL and a.status=1 and a.recordstatus=1",
					{
						"if": "||program|| != BLANK",
						"then": "and a.programlinked='||program||'"
					},
					{
						"if": "||institute|| != BLANK",
						"then": "and a.institute='||institute||'"
					},
					{
						"if": "||search|| != BLANK",
						"then": "and a.title like '%||search||%'"
					}
				],
				"limit": "400",
				"merge": "15temp"
			}

		},  {
			"id": "15adcr",
			"name": "Add Course Button",
			"sql": {
				"action": "Return",
				"validate": "online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "prependtable",
				"value": "<button class='button secondary' onclick='Eirene.runStmt(&apos;addcr&apos;)'>Add course</button>"
			}
		}, {
			"id": "15temp",
			"name": "Course Card Template",
			"sql": {
				"parent": "div class='d-flex flex-justify-start flex-wrap w-100'",
				"template": [
					"<div userid='||userid||' ownerid='||owner||' id='course-||id||' class='cell-fs-full cell-sm-full cell-md-half cell-lg-one-third cell-xl-quarter p-2'><div><div style='border-radius:3px;' class='card image-header'>",
					"<div class='card-header fg-white' style='background-image: url(||image_path||)'>",
					"<div style='background:rgba(10,10,10,0.3);'>||title||",
					{
						"if": "||userid|| = ||owner||",
						"then": [														
							"<span class='mif-users fg-blue ml-2' title='Student List' onclick='Eirene.runStmt(\\\"lescnt-stulst\\\",{COURSEID:\\\"||id||\\\"})'></span>"
						]
					},
					{
						"if": "||status|| > 0 and ||mycourseid|| != BLANK",
						"then": "<span class='fg-pink mif-cross' title='Delete' onclick='showDialog(\\\"Heads Up!\\\",\\\"You are unsubscribing a course. This process is irreversible. You cannot undo this action. Confirm if you are deleting this course from your subscription list.\\\",\\\"Info\\\",[{caption:\\\"Delete My Course\\\",cls:\\\"js-dialog-close alert\\\",onclick: function(){Eirene.runStmt(\\\"ocmdt\\\",{ID:\\\"||mycourseid||\\\"});$(\\\"#course-||id||\\\").hide();}}])'></span>"
					},
					"</div>",
					"</div>",
					"<div data-role='progress' style='margin-top:-5px;' data-value='||per||' data-small='true' title='||per||%'></div>",
					"<div class='card-content p-2'>",
					"<div class='d-flex flex-justify-around'><span class='border-bottom bd-cyan fg-cyan-hover borderBottomTransform fromLeft' onclick='$(this).parent().parent().find(\\\".content\\\").hide();$(this).parent().parent().find(\\\".onlinecourse_summary\\\").show();'>Summary</span><span class='border-bottom bd-cyan fg-cyan-hover borderBottomTransform fromLeft' onclick='$(this).parent().parent().find(\\\".content\\\").hide();$(this).parent().parent().find(\\\".onlinecourse_detail\\\").show();'>Details</span><span class='border-bottom bd-cyan fg-cyan-hover borderBottomTransform fromLeft' onclick='$(this).parent().parent().find(\\\".content\\\").hide();$(this).parent().parent().find(\\\".onlinecourse_goals\\\").show();'>Goals</span></div>",
					"<div class='onlinecourse_summary content'>||description||</div>",
					"<div class='onlinecourse_detail content' style='display:none'>",
					"<span style='width:200px'><b>Author: </b></span><img src='||author_image||' class='avatar'/><span class='ml-2'>||fullname||</span><br/>",
					"<span style='width:200px'><b>Price: </b></span> &#x20b9;||price||<br/>",
					"<span style='width:200px'><b>Course for: </b></span>||programlinked||<br/>",
					"<span style='width:200px'><b>Time Needed: </b></span>||timeneeded||<br/>",
					"<span style='width:200px'><b>Credit: </b></span>||credit||<br/>",
					"<span style='width:200px'><b>Connexion Model Focus: </b></span>||connexionmodel||<br/>",
					"<span style='width:200px'><b>Expiry Date: </b></span>||expirydate||<br/>",
					"</div>",
					"<div class='onlinecourse_goals content' style='display:none'>||goals||</div>",
					"</div>",
					"<div class='card-footer'>",
					"<button class='button secondary' onclick='",
					{
						"if": "||status|| = -1",
						"then": "showOnlineCourseLoginPageIfNotLoggedIn();'>Login"
					},
					{
						"if": "||status|| > 0",
						"then": "myOnlineCourse.currentcourseid=&apos;||id||&apos;;Eirene.runStmt(\\\"rc\\\",{COURSEID:\\\"||id||\\\"})'>Read"
					},
					{
						"if": "||status|| = 0 and ||price|| > 0",
						"then": "myOnlineCourse.currentcourseid=&apos;||id||&apos;;Eirene.runStmt(\\\"35chk\\\",{courseid:\\\"||id||\\\"});'><span class=\\\"mif-cart\\\"></span> Add to cart"
					},
					{
						"if": "||status|| = 0 and ||price|| = 0",
						"then": "if(!myOnlineCourse.userid){showOnlineCourseLoginPageIfNotLoggedIn();return false;}myOnlineCourse.currentcourseid=&apos;||id||&apos;;Eirene.runStmt(\\\"35chk\\\",{courseid:\\\"||id||\\\"});'>Subscribe For Free"
					},
					"</button></div>",
					"</div></div>",
					"</div>"
				]
			}
		}, {
			"id": "16",
			"name": "iscoursesubscribed",
			"sql": {
				"action": "Get Value",
				"validate": "online_course_users",
				"fld": "count(id)",
				"tbl": "online_course_mycourse",
				"whr": "courseid='||COURSEID||' AND expirydate>='||TODAY||' and createdby='||USERID||'",
				"header": "Count"
			}
		}, {
			"id": "17",
			"name": "balance",
			"sql": {
				"action": "Get Value",
				"validate": "online_course_users",
				"fld": "balance",
				"tbl": "online_course_user_wallet",
				"whr": "userid='||USERID||'",
				"srt": "rowno DESC",
				"limit": "1",
				"header": "Count"
			}
		}, {
			"id": "18",
			"name": "piechart",
			"sql": {
				"action": "Get Rows",
				"validate": "online_course_users",
				"fld": "responses as key1, ((count(id) *100)/(SELECT count(id) FROM online_course_read_tracker WHERE onlinecourse_lessonid='||LESSONID||'))as val1",
				"tbl": "online_course_read_tracker",
				"whr": "onlinecourse_lessonid='||LESSONID||'",
				"grp": "responses",
				"srt": "responses",
				"header": "Count"
			}
		}, {
			"id": "19",
			"name": "getDiscussion",
			"sql": {
				"action": "Get Table",
				"validate": "online_course_users",
				"fld": "d.fullname,a.responses",
				"tbl": "online_course_read_tracker a",
				"join": "INNER JOIN online_lesson b ON a.onlinecourse_lessonid=b.id INNER JOIN (SELECT distinct courseid from online_course_mycourse where expirydate>='||TODAY||') c ON b.courseid=c.courseid INNER JOIN online_course_users d ON a.createdby=d.id",
				"whr": "a.onlinecourse_lessonid='||LESSONID||'",
				"header": "Name,Responses"
			}
		}, {
			"id": "21a",
			"name": "Logout",
			"sql": {
				"action": "Return",
				"output": "res",
				"outputto": "php",
				"validate":"none",
				"appendoutput":true,
				"value":[
					{"sqlstatement":{
							"A":"UPDATE online_course_user_tracker SET status= 0 WHERE createdby='||userid||' and status=1"}},
					{"cookie":[
						{"name":"userid","value":"-","time":"-300"},
						{"name":"isfaculty","value":"-","time":"-300"},
						{"name":"PHPSESSID","value":"-","time":"-300"},
						{"name":"MyCourseID","value":"-","time":"-300"},
						{"name":"CourseID","value":"-","time":"-300"},
						{"name":"IsFacultyForCourse","value":"-","time":"-300"}
					]}				
				],
				"script":[
					"Eirene.activeFormObj=[];",
					"Eirene.userinfo={};",
					"Eirene.userid='';",
					"$('#workareaFilter').html('');",
					"$('#workareaAppendix').html('');",
					"showMessage('Logout','You are successfully Logged out!','#26c6da','#workareaTablebox');",					
					"$('.loginbtn').text('Login');",
					"$('#usernamediv').html('');",
					"$('.username').html('Guest');",
					"$('#applyforcourse').html('');"
				]				
			}
		}, {
			"id": "23",
			"name": "getActiveUserCount",
			"sql": {
				"action": "Get Value",
				"output": "#online_course_usercount",
				"validate": "none",
				"tbl": "online_course_user_tracker",
				"fld": "count(*)",
				"whr": "status=1"
			}
		}, {
			"id": "24",
			"name": "getLoginHistory",
			"sql": {
				"action": "Get Table",
				"output": "table",
				"validate": "online_course_users",
				"fld": "DATE_FORMAT(createdon,'%d-%m-%Y'),DATE_FORMAT(createdon,'%H:%i:%s'),DATE_FORMAT(modifiedon,'%H:%i:%s')",
				"tbl": "online_course_user_tracker",
				"whr": "createdby='||USERID||'",
				"srt": "createdon DESC",
				"limit": "30",
				"header": "Date,Start Time,End Time"
			}
		}, {
			"id": "25",
			"name": "getLoginHistory",
			"sql": {
				"action": "Get Table",
				"output": "table",
				"validate": "online_course_users",
				"fld": "a.fullname,a.linked_to_institution,b.region,b.country",
				"tbl": "online_course_user_tracker b",
				"join": "LEFT JOIN online_course_users a ON b.createdby=a.id",
				"whr": "b.status=1",
				"srt": "a.fullname",
				"limit": "2000",
				"header": "Name,Institute,Region,Country"
			}
		}, {
			"id": "autlst",
			"name": "AuthorListStudent",
			"sql": {
				"action": "Get HTML",
				"output": "table",
				"validate": "none",
				"parent": "div",
				"template": "<div class='d-flex flex-justify-start mt-2 fontColorBGCombination'><div class='d-flex-column'><div><img src='||image_path||' style='width:120px;height:130px'></div><div class='m-2'>||authorname||</div></div><div class='m-2'>||description||</div></div>",
				"fld": "authorname,description,image_path",
				"tbl": "online_author",
				"whr": "status=1",
				"srt": "authorname",
				"limit": "2000"
			}
		}, {
			"id": "autlt1",
			"name": "AuthorListFaculty",
			"sql": {
				"action": "Get HTML",
				"output": "table",
				"validate": "online_course_users status=1 and isfaculty=1",
				"parent": "div",
				
				"template": "<div><div><img src='||image_path||' style='border-radius:50%;width:200px'></div></div>",
				"fld": "a.authorname,a.description,a.image_path,b.id,a.id as authorid",
				"tbl": "online_author a",
				"join": "LEFT JOIN online_course_users b ON a.owner=b.id",
				"whr": "a.status=1",
				"srt": "authorname",
				"limit": "2000"
			}
		}, {
			"id": "26",
			"name": "authorlist IF",
			"sql": {
				"action": "Return",
				"outputto":"php",
				"value":[
					{"if":"||IsFaculty|| = 1","then":{"call":"chkfa1-26a"},"else":{"call":"aud1"}}
				],
				"validate": "none"				
			}
		},{
			"id": "chkfac",
			"name": "IsFaculty",
			"sql": {
				"action": "Get Value",
				"validate": "eirene_users,online_course_users",
				"output": "IsFaculty",
				"tbl": "online_course_users",
				"fld": "count(*)",
				"whr": "status=1 and isfaculty=1 and id='||USERID||'"
			}
		}, {
			"id": "28",
			"name": "saveReadTracker",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users",
				"outputto": "html",
				"output": "res",
				"command": "insertorupdate",
				"tbl": "online_course_read_tracker",
				"fld": "onlinecourse_userid,onlinecourse_lessonid,read_status,notes,responses",
				"value": "||USERID||,||LESSONID||,||READSTATUS||,||NOTES||,||RESPONSES||",
				"fldtype": "u,u,n,s,s",
				"whr": "createdby='||USERID||' and onlinecourse_lessonid='||LESSONID||'"
			}
		}, {
			"id": "31",
			"name": "ChangeResourseLinkText",
			"sql": {
				"action": "Save Table",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "res",
				"command": "update",
				"tbl": "online_course_resources",
				"fld": "documentname",
				"value": "||DOCNAME||",
				"fldtype": "s",
				"whr": "id='||ID||'"
			}
		}, {
			"id": "31a",
			"name": "GetLessonIDFromResourceID",
			"sql": {
				"action": "Get Value",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "php",
				"output": "lesson_id",
				"tbl": "online_course_resources",
				"fld": "lessonid",
				"whr": "id='||ID||'"
			}
		}, {
			"id": "32",
			"name": "saveLessonResourcePage",
			"sql": {
				"action": "Save Table",
				"validate": "eirene_users",
				"outputto": "html",
				"output": "res",
				"command": "insert",
				"tbl": "online_course_resources",
				"fld": "documentname,lessonid,link",
				"fldtype": "s,u,s",
				"value": "||DOCNAME||,||LESSONID||,||LINK||"
			}
		}, {
			"id": "33",
			"name": "uploadCourseBanner",
			"sql": {
				"action": "Upload File",
				"validate": "online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "upload",
				"directory": "",
				"maxsize": "100kb",
				"filetype": "jpg,jpeg,png",
				"path": "resource/media/",
				"onsuccess": "cmd:dom,elem:a,fun:showtoast;success;Upload Successful-cmd:dom,elem:input[name=||elemname||],fun:val,val:||GET_uploadedfilename||",
				"onfailure": "cmd:dom,fun:showtoast;alert;Upload Failed"
			}
		}, {
			"id": "34",
			"name": "bulkFileUpload",
			"sql": {
				"action": "Bulk File Upload",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "res",
				"directory": "onlinecourse",
				"maxsize": "40mb",
				"filetype": "jpg,jpeg,png,mp3,mp4,ppt,docx,pdf",
				"path": "resource/media/",
				"saveindb": true,
				"tbl": "online_course_resources",
				"fld": "documentname,lessonid,link,createdby",
				"fldtype": "s,u,s,u",
				"value": "||FILENAME||,||LESSONID||,||LINK||,||USERID||",
				"onsuccess": "11a1"
			}
		}, {
			"id": "35",
			"name": "myCart",
			"sql": {
				"action": "Get HTML",
				"outputto": "html",
				"output": "table",
				"validate": "online_course_users",
				"tbl": "online_course_mycourse a",
				"join": "INNER JOIN online_course b ON a.courseid=b.id",
				"whr": "a.status=0 and a.recordstatus=1 and a.createdby='||USERID||' and a.expirydate>='||TODAY||'",
				"fld": "b.title,b.price,b.image_path,a.id",
				"parent": "div class=\\\"d-flex onlineCoursePage\\\"",
				"template": "<div class=\\\"d-flex-column ml-3\\\"><div><img style=\\\"width:120;height:100\\\" src=\\\"||image_path||\\\"></div><div>Rs. ||price||<span class=\\\"ml-10 mif-cross fg-red\\\" onclick=\\\"deleteCart('||id||')\\\"></span></div></div>"
			}
		}, {
			"id": "35chk",
			"name": "addToCartIF",
			"sql": {
				"action": "Return",
				"outputto": "php",
				"output": "res",
				"validate": "online_course_users",
				"value":[
					{"sqlstatement":{
						"IsFaculty":"SELECT isfaculty FROM online_course_users WHERE id='||userid||' and recordstatus=1",
						"issubscribed":"SELECT COUNT(*) FROM online_course_mycourse WHERE courseid='||courseid||' and createdby='||USERID||' and recordstatus=1"
						}
					},
					{"if":"||issubscribed|| > 0","then":[
							{"domoutput":"showtoast;alert;Course is already subscribed"},
							{"abort":true}
						]
					},
					{"if":"||IsFaculty|| = 1",
						"then":[
							{"call":"ocmsv","recordstatus":1,"status":1,"whr":"courseid='||courseid||' and createdby='||USERID||'","onsuccess": "cmd:dom,fun:showmessage;#workareaTablebox;Course Subscribed Successfully;success;Course Subscribed Successfully. The subscribed course can be accessed in 'My Courses' section."}							
						],
						"else":[
							{"sqlstatement":{"price":"select price from online_course where id='||COURSEID||'"}},
							{"if":"||price|| > 0","then":{"call":"35a"},
								"else":[
									{"call":"ocmsv","recordstatus":1,"status":1,"whr":"courseid='||courseid||' and createdby='||USERID||'","onsuccess": "cmd:dom,fun:showmessage;#workareaTablebox;Course Subscribed Successfully;success;Course Subscribed Successfully. The subscribed course can be accessed in 'My Courses' section."}
								]
							}							
						]
					}					
				]				
			}
		}, {
			"id": "35chk2",
			"name": "addToCartIF",
			"sql": {
				"action": "Return",
				"outputto": "php",
				"output": "res",
				"validate": "online_course_users",
				"value":[
					{"sqlstatement":{"a":"select price from online_course where id='||COURSEID||'"}},
					{"if":"||a|| > 0","then":{"call":"35a"},"else":{"call":"35g"}}
				]				
			}
		}, {
			"id": "35a",
			"name": "addToCart",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users",
				"command": "insertorupdate",
				"tbl": "online_course_mycourse",
				"fld": "courseid,createdby,modifiedby,status,expirydate,amount",
				"fldtype": "u,u,u,n,n,n",
				"seperator": ";",
				"value": "||COURSEID||;||USERID||;||USERID||;0;ADDDATE(CURDATE(), INTERVAL 1 YEAR);(SELECT price FROM online_course WHERE id='||COURSEID||')",
				"whr": "createdby='||USERID||' and courseid='||COURSEID||'"
			}
		}, {
			"id": "35b",
			"name": "deleteFromCart",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users",
				"command": "update",
				"tbl": "online_course_mycourse",
				"fld": "recordstatus",
				"value": "0",
				"fldtype": "n",
				"whr": "id='||ID||'"
			}
		}, {
			"id": "35c",
			"name": "addToOrders",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users",
				"command": "insert",
				"tbl": "online_course_orders",
				"fld": "orderid,createdby,amount,remark",
				"fldtype": "s,u,n,s",
				"value": "||PHPUNIQID||,||USERID||,(SELECT sum(amount) FROM online_course_mycourse WHERE createdby='||USERID||' and status=0 and recordstatus=1 and expirydate>'||TODAY||'),||REMARK||"
			}
		}, {
			"id": "35cSlf",
			"name": "addToOrders",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users",
				"command": "insert",
				"tbl": "online_course_orders",
				"fld": "orderid,createdby,amount,remark",
				"fldtype": "s,u,n,s",
				"value": "||PHPUNIQID||,||USERID||,||AMOUNT||,||REMARK||"
			}
		}, {
			"id": "35c1",
			"name": "addOrderIdtoMyCourse",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users",
				"command": "update",
				"tbl": "online_course_mycourse",
				"fld": "orderid",
				"fldtype": "n",
				"whr": "createdby='||USERID||' and status=0 and recordstatus=1 and expirydate>='||TODAY||'",
				"value": "(SELECT orderid FROM online_course_orders WHERE id='||LASTINSERTID||')"
			}
		}, {
			"id": "35c2",
			"name": "deleteNullOrders",
			"sql": {
				"action": "Run",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users",
				"stmt": "DELETE FROM online_course_orders WHERE txmsg is null and createdby='||USERID||'"
			}
		}, {
			"id": "35d",
			"name": "cartSummary",
			"sql": {
				"action": "Get Value",
				"outputto": "html",
				"output": "prependfilter",
				"validate": "online_course_users",
				"tbl": "online_course_mycourse",
				"fld": "sum(amount)",
				"whr": "createdby='||USERID||' and status=0 and recordstatus=1 and expirydate>=NOW()",
				"prepend": "<div class=\\\"clear onlineCoursePage\\\"><div class=\\\"place-right\\\"><span>Amount: Rs. </span>",
				"append": " <div class=\\\"button secondary place-right ml-4\\\" onclick=\\\"let data={stmt:'35c-35c1-35f',userid:'||USERID||',pluginid:'||PLUGINID||',REMARK:'||INSTITUTE||/ Course Subscription Fee',silent:true};callAjax(data);\\\">Pay</div></div></div>"
			}
		}, {
			"id": "35e",
			"name": "cartCount",
			"sql": {
				"action": "Get Value",
				"outputto": "html",
				"output": ".mycartcount",
				"validate": "online_course_users",
				"tbl": "online_course_mycourse",
				"fld": "count(*)",
				"whr": "createdby='||USERID||' and status=0 and recordstatus=1 and expirydate>='||TODAY||'"
			}
		}, {
			"id": "35f",
			"name": "confirmPay",
			"sql": {
				"action": "Get HTML",
				"outputto": "html",
				"output": "filter",
				"validate": "online_course_users",
				"tbl": "online_course_orders a",
				"fld": "a.orderid,a.amount,b.fullname,b.emailid,b.phoneno",
				"join": "INNER JOIN online_course_users b ON a.createdby=b.id",
				"whr": "a.orderid=(SELECT orderid FROM online_course_mycourse WHERE status=0 and recordstatus=1 and createdby='||USERID||' GROUP BY orderid)",
				"parent": "form id=\\\"redirectform\\\" method=\\\"post\\\" action=\\\"https://www.cashfree.com/checkout/post/submit\\\"",
				"template": "<input type=\\\"hidden\\\" name=\\\"appId\\\" value=\\\"57711cc1b8bf221207f425c3d11775\\\"/><input type=\\\"hidden\\\" name=\\\"customerEmail\\\" value=\\\"||emailid||\\\"/><input type=\\\"hidden\\\" name=\\\"customerName\\\" value=\\\"||fullname||\\\"/><input type=\\\"hidden\\\" name=\\\"customerPhone\\\" value=\\\"||phoneno||\\\"/><input type=\\\"hidden\\\" name=\\\"paymentModes\\\" value=\\\"\\\"/><input type=\\\"hidden\\\" name=\\\"notifyUrl\\\" value=\\\"https://onlinecourse.niea.in/index.php\\\"><input type=\\\"hidden\\\" name=\\\"orderAmount\\\" value=\\\"||amount||\\\"/><input type=\\\"hidden\\\" name=\\\"orderCurrency\\\" value=\\\"INR\\\"/><input type=\\\"hidden\\\" name=\\\"orderId\\\" value=\\\"||orderid||\\\"/><input type=\\\"hidden\\\" name=\\\"orderNote\\\" value=\\\"Course Subscription\\\"/><input type=\\\"hidden\\\" name=\\\"returnUrl\\\" value=\\\"https://onlinecourse.niea.in/index.php\\\"/><input type=\\\"hidden\\\" name=\\\"signature\\\" value=\\\"||SIGNATURE||\\\"/><button class=\\\"button secondary\\\">Confirm Payment of Rs. ||amount||</button>"
			}
		}, {
			"id": "35f1",
			"name": "confirmPayAnyAmount",
			"sql": {
				"action": "Get HTML",
				"outputto": "html",
				"output": "#workareaTablebox",
				"validate": "online_course_users",
				"tbl": "online_course_orders a",
				"fld": "a.orderid,a.amount,b.fullname,b.emailid as email,b.phoneno as mobile",
				"join": "INNER JOIN online_course_users b ON a.createdby=b.id",
				"whr": "a.orderid='||PREVIOUS_PHPUNIQID||'",
				"parent": "form id=\\\"redirectform\\\" method=\\\"post\\\" action=\\\"https://www.cashfree.com/checkout/post/submit\\\"",
				"template":[
					"<input type=\\\"hidden\\\" name=\\\"appId\\\" value=\\\"57711cc1b8bf221207f425c3d11775\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"customerEmail\\\" value=\\\"||email||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"customerName\\\" value=\\\"||fullname||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"customerPhone\\\" value=\\\"||mobile||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"paymentModes\\\" value=\\\"\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"notifyUrl\\\" value=\\\"https://onlinecourse.niea.in/index.php\\\">",
					"<input type=\\\"hidden\\\" name=\\\"orderAmount\\\" value=\\\"||amount||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"orderCurrency\\\" value=\\\"INR\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"orderId\\\" value=\\\"||orderid||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"orderNote\\\" value=\\\"Course Subscription\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"returnUrl\\\" value=\\\"https://onlinecourse.niea.in/index.php\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"signature\\\" value=\\\"SIGNATURE_CASHFREE\\\"/>",
					"<button class=\\\"button secondary\\\">Confirm Payment of Rs. ||amount||</button>"
				]
			}
		}, {
			"id": "35fdon",
			"name": "confirmPayDonation",
			"sql": {
				"action": "Get HTML",
				"outputto": "html",
				"output": "#workareaTablebox",
				"validate": "none",
				"tbl": "online_course_orders",
				"fld": "orderid,amount,fullname,email,mobile",
				"whr": "orderid='||PREVIOUS_PHPUNIQID||'",
				"returnurl": "https://onlinecourse.niea.in/donate.php",
				"parent": "form id=\\\"redirectform\\\" method=\\\"post\\\" action=\\\"https://www.cashfree.com/checkout/post/submit\\\"",
				"ordernote": "Donation",
				"template": [
					"<input type=\\\"hidden\\\" name=\\\"appId\\\" value=\\\"57711cc1b8bf221207f425c3d11775\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"customerEmail\\\" value=\\\"||email||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"customerName\\\" value=\\\"||fullname||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"customerPhone\\\" value=\\\"||mobile||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"paymentModes\\\" value=\\\"\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"notifyUrl\\\" value=\\\"https://onlinecourse.niea.in/index.php\\\">",
					"<input type=\\\"hidden\\\" name=\\\"orderAmount\\\" value=\\\"||amount||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"orderCurrency\\\" value=\\\"INR\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"orderId\\\" value=\\\"||orderid||\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"orderNote\\\" value=\\\"Donation\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"returnUrl\\\" value=\\\"https://onlinecourse.niea.in/donate.php\\\"/>",
					"<input type=\\\"hidden\\\" name=\\\"signature\\\" value=\\\"SIGNATURE_CASHFREE\\\"/>",
					"<button class=\\\"button secondary\\\">Confirm Payment of Rs. ||amount||</button>"
				]				
			}
		}, {
			"id": "35g",
			"name": "subscribeForFree",
			"sql": {
				"action": "Return",
				"outputto": "php",
				"output": "subscription",
				"validate": "online_course_users",
				"value":"",
				"postrun":[
					{"call":"ocmsv","whr":"courseid='||courseid||' and createdby='||USERID||'"}
				],				
				"onsuccess": "cmd:dom,fun:showmessage;#workareaTablebox;Course Subscribed Successfully;success;Course Subscribed Successfully. The subscribed course can be accessed in 'My Courses' section.",
				"onfailure": "cmd:dom,fun:showmessage;#workareaTablebox;Try Again;warning;Course Subscription Failed."
			}
		}, {
			"id": "36lst",
			"name": "lessonlistStudent",
			"sql": {
				"action": "Get HTML",
				"validate": "online_course_users",
				"outputto": "php",
				"output": "lessonlist",
				"tbl": "online_lesson b",
				"fld": "a.read_status,b.id,b.lesson_no,b.lesson_order,b.title,b.type,a.dt",
				"join": "LEFT JOIN (SELECT read_status,onlinecourse_lessonid,DATE_FORMAT(modifiedon,'Last read: %d-%m-%Y') as dt FROM online_course_read_tracker WHERE createdby='||USERID||' ) a  ON a.onlinecourse_lessonid=b.id",
				"whr": "b.courseid='||COURSEID||' and b.recordstatus=1 and b.status=1 and b.type<>'Announcement'",
				"srt": "b.lesson_no,b.lesson_order",
				"parent": "div class='lessonlist pl-12 pt-2 pb-8' ",
				"template": [
					"<div style='overflow:hidden;' ",
					 "class='border bd-gray bd-blue-hover d-flex p-2 bg-lightBlue-hover' ",
					 "id='||id||'  read='||read_status||' ",
					 "onclick='",
					 {"if":"||IsFacultyForCourse|| != 1","then":"Eirene.currentpageno=&apos;||id||&apos;;if(Eirene.allownextpage==false && Eirene.allowpreviouspage==false){Metro.toast.create(&apos;Cannot jump page.&apos;,null,5000,&apos;alert&apos;);return false;}"},
					 "stopAloud();Eirene.runStmt(&apos;readpg&apos;,{COURSEID:&apos;||COURSEID||&apos;,LESSONID:&apos;||id||&apos;,inbackground:true});$(&apos;#lessonlist&apos;).hide();$(&apos;#lessonpage&apos;).show();$(&apos;#tabpg2&apos;).addClass(&apos;active&apos;);$(&apos;#tabpg1&apos;).removeClass(&apos;active&apos;);'>",
					"<span class='mif-",
					{
						"case": "||type||",
						"Assignment": "description",
						"Reading": "file-text",
						"Discussion": "qa",
						"Test": "pencil",
						"Announcement": "bell",
						"Multiple Option Question": "question",
						"slider": "equalizer"
					},
					"ml-2'></span>",
					"<span style='margin-left:10px'>||title||</span>",
					"<span class='fg-gray ml-auto font-small'>||dt||</span>",
					"</div><script>stopAloud();</script>"
				],
				"prepend": "<h3>Lesson Plan</h3>"							
			}
		}, {
			"id": "36lt+",
			"name": "lessonlistFaculty",
			"sql": {
				"action": "Get HTML",
				"validate": "online_course_users status=1 and isfaculty=1",
				"outputto": "php",
				"output": "lessonlist",
				"tbl": "online_lesson b",
				"fld": "a.read_status,b.id,b.lesson_no,b.lesson_order,b.title,b.type,a.dt",
				"join": "LEFT JOIN (SELECT read_status,onlinecourse_lessonid,DATE_FORMAT(modifiedon,'Last read: %d-%m-%Y') as dt FROM online_course_read_tracker WHERE createdby='||USERID||' ) a  ON a.onlinecourse_lessonid=b.id",
				"whr": "b.courseid='||COURSEID||' and b.recordstatus=1",
				"srt": "b.lesson_no,b.lesson_order",
				"parent": "div class='sortable-list lessonlist pl-12 pt-2 pb-8'",
				"template": [
					"<div style='overflow:hidden;' ",
					"onclick='stopAloud();Eirene.runStmt(&apos;readpg&apos;,{COURSEID:&apos;||COURSEID||&apos;,LESSONID:&apos;||id||&apos;,inbackground:true});$(&apos;#lessonlist&apos;).hide();$(&apos;#lessonpage&apos;).show();$(&apos;#tabpg2&apos;).addClass(&apos;active&apos;);$(&apos;#tabpg1&apos;).removeClass(&apos;active&apos;);' ",
					"class='sortable-item lesson border bd-gray bd-blue-hover d-flex p-2 bg-lightBlue-hover' ",
					"id='||id||' read='||read_status||'>",					
					"<span class='mif-",
					{
						"case": "||type||",
						"Assignment": "description",
						"Reading": "file-text",
						"Discussion": "qa",
						"Test": "pencil",
						"Announcement": "bell",
						"Multiple Option Question": "question",
						"slider": "equalizer"
					},
					" ml-2 mr-2'></span>",
					"<span>||title||</span>",
					"<span class='fg-gray ml-auto font-small'>||dt||</span>",					
					"</div>"
				],				
				"prepend":[
					"<h3>Lesson Plan</h3>"					
				],
				"append":[
					"<div onclick='Eirene.runStmt(&apos;oln-rc&apos;,{COURSEID:&apos;||COURSEID||&apos;});'><span class='mif-plus'></span></div>"					
				],
				"script":[
					"$(document).ready(function () {",
						"$('.sortable-list').draggableSort({",
							"placeholderClass: 'custom-placeholder', /* Customize placeholder class*/",
							"draggingClass: 'custom-dragging',       /* Customize dragging class*/",
							"onSortEnd: function (sortedItems) {",
								"let sno=0;$('.lessonlist .lesson').each(function () {let id=$(this).attr('id');sno++;Eirene.runStmt('olsv',{id:id,lesson_no:sno,inbackground:true,varolsv_onsuccess:'',varolsv_onfailure:''})});",
							"}",
						"});",
					"});"
				]
			}
		}, {
			"id": "36l2",
			"name": "GetLessonStudent",
			"sql": {
				"action": "Get Row",
				"validate": "online_course_users",
				"outputto": "php",
				"output": "lesson",
				"tbl": "online_lesson b",
				"fld":"a.read_status,b.lesson_no,b.lesson_order,b.title,b.id,b.type,b.material,b.options,b.launchdate,a.mark,b.status as lessonstatus,b.expirydate,a.id as readtrackid",							
				"join": "LEFT JOIN (SELECT read_status,onlinecourse_lessonid,mark,id FROM online_course_read_tracker WHERE createdby='||USERID||' ) a  ON a.onlinecourse_lessonid=b.id",
				"whr": "b.id='||LESSONID||' and (b.launchdate is null or b.launchdate<=Now())",
				"limit": "1",
				"onsuccess":"36RS2-36RS"
			}
		}, {
			"id": "36l3",
			"name": "GetLessonFaculty",
			"sql": {
				"action": "Get Row",
				"validate": "online_course_users status=1 and isfaculty=1",
				"outputto": "php",
				"output": "lesson",
				"tbl": "online_lesson b",
				"fld": "a.read_status,b.lesson_no,b.lesson_order,b.title,b.id,b.type,b.material,b.options,b.launchdate,a.mark,b.status as lessonstatus,b.expirydate,a.id as readtrackid,REPLACE(b.launchdate,' ','T') as launchdt,REPLACE(b.expirydate,' ','T') as expirydt",
				"join": "LEFT JOIN (SELECT read_status,onlinecourse_lessonid,mark,id FROM online_course_read_tracker WHERE createdby='||USERID||' ) a  ON a.onlinecourse_lessonid=b.id",
				"whr": "b.id='||LESSONID||'",
				"srt": "b.lesson_no,b.lesson_order"
			}
		}, {
			"id": "36not",
			"name": "GetNotesAndResponse",
			"sql": {
				"action": "Get Row",
				"validate": "online_course_users",
				"outputto": "html",
				"output": "notes",
				"tbl": "online_course_read_tracker",
				"fld": "notes,responses,mark,read_status",
				"whr": "createdby='||USERID||' and onlinecourse_lessonid='||GET_lesson_id||'",
				"limit": "1"
			}
		}, {
			"id": "36RS2",
			"name": "GetMyCourseID",
			"sql": {
				"action": "Get Value",
				"validate": "online_course_users",
				"outputto": "html",
				"output": "MyCourseID",
				"tbl": "online_course_mycourse",
				"fld": "id",
				"whr": "createdby='||USERID||' and courseid='||COURSEID||' and status=1",
				"onsuccess": "cmd:dom,fun:assignvariable;Eirene.mycourseid;||GET_MyCourseID||"
			}
		}, {
			"id": "36RS",
			"name": "SaveReadStatus",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users",
				"outputto": "html",
				"output": "res",
				"command": "insertorupdate",
				"tbl": "online_course_read_tracker",
				"fld": "mycourseid,read_status,onlinecourse_lessonid,modifiedon",
				"fldtype": "u,n,u,n",
				"value": "||GET_MyCourseID||,1,||GET_lesson_id||,CURRENT_TIMESTAMP",
				"whr": "createdby='||USERID||' and onlinecourse_lessonid='||GET_lesson_id||'"
			}
		}, {
			"id": "37",
			"name": "uploadAssignment",
			"sql": {
				"action": "Upload File",
				"validate": "eirene_users,online_course_users",
				"outputto": "html",
				"output": "upload",
				"directory": "assignment",
				"maxsize": "15mb",
				"filetype": "pdf,doc,docx,jpg,jpge,png",
				"path": "resource/media/",
				"onsuccess": "39new-cmd:dom,elem:a,fun:showtoast;success;Upload Successful",
				"onfailure": "cmd:dom,fun:showtoast;alert;Upload Failed"
			}
		}, {
			"id": "37a",
			"name": "uploadDiscussion",
			"sql": {
				"action": "Upload File",
				"validate": "online_course_users",
				"outputto": "html",
				"output": "upload",
				"directory": "discussion",
				"maxsize": "200kb",
				"filetype": "jpg,jpeg,png",
				"path": "resource/media/",
				"onsuccess": "39ss-cmd:dom,fun:showtoast;success;Upload Successful",
				"onfailure": "cmd:dom,fun:showtoast;alert;Upload Failed"
			}
		}, {
			"id": "38",
			"name": "saveNotes",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users",
				"outputto": "html",
				"output": "res",
				"command": "update",
				"tbl": "online_course_read_tracker",
				"fld": "notes",
				"fldtype": "s",
				"value": "||NOTES||",
				"whr": "mycourseid='||mycourseid||' and onlinecourse_lessonid='||LESSONID||'"
			}
		}, {
			"id": "39",
			"name": "saveResponses",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users",
				"outputto": "html",
				"output": "res",
				"command": "update",
				"tbl": "online_course_read_tracker",
				"fld": "responses",
				"fldtype": "s",
				"value": "||RESPONSES||",
				"whr": "createdby='||USERID||' and onlinecourse_lessonid='||LESSONID||'"
			}
		}, {
			"id": "39s",
			"name": "saveResponses",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users",
				"outputto": "php",
				"output": "res",
				"command": "update",
				"tbl": "online_course_read_tracker",
				"fld": "responses",
				"fldtype": "s",
				"value": "||GET_uploadedfilename||",
				"whr": "createdby='||USERID||' and onlinecourse_lessonid='||GET_lesson_id||'",
				"onsuccess":"cmd:dom,fun:showtoast;success;saving Successful"
				
			}
		},{
			"id": "39new",
			"name": "saveResponses",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users",
				"outputto": "php",
				"output": "res",
				"command": "update",
				"tbl": "online_course_read_tracker",
				"fld": "responses",
				"fldtype": "s",
				"value": "||GET_uploadedfilename||",
				"whr": "createdby='||USERID||' and onlinecourse_lessonid='||LESSONID||'",
				"onsuccess":"cmd:dom,fun:showtoast;success;saving Successful"
				
			}
		}, {
			"id": "39ss",
			"name": "saveResponses",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users",
				"outputto": "php",
				"output": "res",
				"command": "update",
				"tbl": "online_course_read_tracker",
				"fld": "responses",
				"fldtype": "s",
				"value": "<a target=\\\"_blank\\\" href=\\\"||GET_uploadedfilename||\\\">Uploaded File</a>",
				"whr": "createdby='||USERID||' and onlinecourse_lessonid='||LESSONID||'"
			}
		}, {
			"id": "40",
			"name": "saveLesson",
			"sql": {
				"action": "Save Table",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "res",
				"command": "insertorupdate",
				"tbl": "online_lesson",
				"fld": "courseid,lesson_no,lesson_order,title,type,material,options,launchdate,status,expirydate",
				"fldtype": "u,n,n,s,s,s,s,dt,n,dt",
				"value": "||COURSEID||,||LESSON_NO||,1,||TITLE||,||TYPE||,||MATERIAL||,||OPTIONS||,||LAUNCHDATE||,||LESSONSTATUS||,||EXPIRYDATE||",
				"whr": "id='||ID||'",
				"onsuccess": "facis-admis-48ltif-cmd:dom,fun:html;#lesson_savestatus;Saving Successful-cmd:dom,fun:showtoast;success;Saving Successful"
			}
		}, {
			"id": "41",
			"name": "LessonReorder",
			"sql": {
				"action": "Save Table",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "res",
				"command": "update",
				"tbl": "online_lesson",
				"fld": "lesson_no",
				"fldtype": "n",
				"whr": "courseid='||COURSEID||' and lesson_no>||NEWPOS|| and id!='||LESSONID||'",
				"value": "lesson_no+1",
				"onsuccess": "41a"
			}
		}, {
			"id": "41a",
			"name": "LessonReorder",
			"sql": {
				"action": "Save Table",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "res",
				"command": "update",
				"tbl": "online_lesson",
				"fld": "lesson_no",
				"fldtype": "n",
				"whr": "id='||LESSONID||'",
				"value": "||NEWPOS|| + 1"
			}
		}, {
			"id": "41b",
			"name": "LessonReorder",
			"sql": {
				"action": "Save Table",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "res",
				"command": "update",
				"tbl": "online_lesson",
				"fld": "lesson_no",
				"fldtype": "n",
				"whr": "courseid='||COURSEID||' and lesson_no<=||NEWPOS||+1 and id!='||LESSONID||'",
				"value": "lesson_no-1",
				"onsuccess": "41a"
			}
		}, {
			"id": "43",
			"name": "getViewRights",
			"sql": {
				"action": "Get Value",
				"validate": "online_course_users",
				"outputto": "html",
				"output": "viewrights",
				"tbl": "permission",
				"fld": "view_rights",
				"whr": "id='||PLUGINID||'"
			}
		}, {
			"id": 44,
			"name": "saveCourse",
			"sql": {
				"action": "Save Table",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "res",
				"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||",
				"onsuccess": "cmd:dom,fun:showtoast;success;Saving Successful",
				"onfailure": "cmd:dom,fun:showtoast;alert;Saving Failed"
			}
		}, {
			"id": "45",
			"name": "saveCourseUsers",
			"sql": {
				"action": "Save Table",
				"validate": "none",
				"outputto": "html",
				"output": "res",
				"command": "insertorupdate",
				"tbl": "online_course_users",
				"fld": "emailid,fullname,gender,linked_to_institution,linked_to_program,educationmode,district,state,phoneno,alternate_phoneno,whatsappno,recommendedby,pass",
				"fldtype": "s,s,s,s,s,s,s,s,s,s,s,s,s",
				"value": "||emailid||,||fullname||,||gender||,||linked_to_institution||,||linked_to_program||,||educationmode||,||district||,||state||,||phoneno||,||alternate_phoneno||,||whatsappno||,||recommendedby||,||pass||",
				"whr": "id='||ID||'",
				"onfailure": "cmd:dom,fun:showtoast;alert;Saving failed",
				"onsuccess": "cmd:dom,fun:showtoast;success;Saving Successful"
			}
		}, {
			"id": "46",
			"name": "getCourse",
			"sql": {
				"action": "Get Row",
				"validate": "eirene_users,online_course_users",
				"outputto": "html",
				"output": "edit",
				"tbl": "online_course",
				"fld": "id,title,titleprint,subtitle,description,price,department,programlinked,timeneeded,credit,goals,connexionmodel,image_path,authorid,fastforward,owner,language,institute",
				"whr": "id='||ID||'",
				"jsfunction": "edit1"
			}
		}, {
			"id": "47",
			"name": "getCourseUser",
			"sql": {
				"action": "Get Row",
				"validate": "eirene_users,online_course_users",
				"outputto": "html",
				"output": "edit",
				"tbl": "online_course_users",
				"fld": "id,emailid,fullname,gender,linked_to_institution,linked_to_program,educationmode,district,state,phoneno,alternate_phoneno,whatsappno,recommendedby,pass,admissionyear",
				"whr": "id='||ID||'",
				"jsfunction": "edit1"
			}
		}, {
			"id": "48ltif",
			"name": "getLessonListIF1",
			"sql": {
				"action": "Return","outputto":"php",
				"validate": "online_course_users",
				"output": "res",
				"value":[
					{"if":"||IsFaculty|| = 1","then":{"call":"36lt+"},"else":{"call":"36lst"}}
				]				
			}
		}, {
			"id": "facis",
			"name": "IsFaculty",
			"sql": {
				"action": "Return",
				"validate": "eirene_users,online_course_users",
				"outputto": "php",
				"output": "IsFaculty",
				"value":"||isfaculty||",
				"onsuccess": "cmd:dom,fun:assignvariable;Eirene.iscoursefaculty;||IsFaculty||"
			}
		}, {
			"id": "isfac",
			"name": "IsFaculty",
			"sql": {
				"action": "Get Value",
				"validate": "none",
				"outputto": "php",
				"output": "IsFaculty",
				"tbl": "online_course_users a",
				"join": "INNER JOIN online_author b ON a.id=b.owner",
				"fld": "count(*)",
				"whr": "a.id='||USERID||'"
			}
		}, {
			"id": "facis2",
			"name": "IsFaculty",
			"sql": {
				"action": "Get Value",
				"validate": "none",
				"output": "IsFaculty",
				"tbl": "online_course_users",
				"fld": "count(*)",
				"whr": "status=1 and isfaculty=1 and id='||USERID||'"
			}
		}, {
			"id": "admis",
			"name": "IsAdmin",
			"sql": {
				"action": "Get Value",
				"validate": "eirene_users,online_course_users",
				"outputto": "php",
				"output": "IsAdmin",
				"tbl": "eirene_users",
				"fld": "count(*)",
				"whr": "status=1 and id='||USERID||'"
			}
		}, {
			"id": "delcrs",
			"name": "DeleteCourse",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users isfaculty=1 and status=1",
				"output": "res",
				"command": "update",
				"tbl": "online_course",
				"fld": "status,recordstatus",
				"value": "0,0",
				"fldtype": "n,n",
				"whr": "id='||COURSEID||'",
				"onsuccess":"cmd:dom,fun:showtoast;success;Deleting Successful",
				"onfailure":"cmd:dom,fun:showtoast;warning;Deleting failed"
				
			}
		}, {
			"id": "fgpass",
			"name": "ForgotPassword1",
			"sql": {
				"action": "Get Row",
				"validate": "none",
				"outputto": "php",
				"output": "userdtls",
				"tbl": "online_course_users",
				"fld": "emailid,fullname,pass",
				"whr": "emailid='||email||'",
				"onsuccess": "fgpas2"
			}
		}, {
			"id": "fgpas2",
			"name": "ForgotPassword2",
			"sql": {
				"action": "Send Email",
				"validate": "none",
				"outputto": "html",
				"output": "res",				
				"to": "||userdtls_emailid||:||userdtls_fullname||",
				"subject": "Forgot password request",
				"content": "Dear ||userdtls_fullname||,<br><br>A forgot password request is initiated by you. Your password is: ||userdtls_pass|| . If you have not initiated this request, then please visit the website and change your password immediately. For any assistance please feel free to reachout to NIEA Online faculties.<br><br>With kind regards,<br><b>NIEA Online Team</b>"
			}
		},    {
			"id": "Asslt",
			"name": "AssigSubmittedBy",
			"sql": {
				"action": "Get Table",
				"validate": "online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "appendix",
				"fld": "e.fullname,a.createdon,a.modifiedon,CONCAT('<input title=''Mark'' onblur=''Eirene.runStmt(\\\"testMk-getdtl-asmmrk\\\",{ID:\\\"',a.id,'\\\",MARK:$(this).val(),TYPE:\\\"Assignment\\\"})'' value=''',a.mark,'''>'),CONCAT('<a href=''#'' title=''Return Assignment'' onclick=''runStmt(\\\"tesret-getdtl-asmret\\\",true,{ID:\\\"',a.id,'\\\",TYPE:\\\"Assignment\\\"});$(this).parent().parent().hide();''>Return Assignment</a>'),CONCAT('<a href=''#'' title=''Delete'' onclick=''runStmt(\\\"tesdel-getdtl-asmdel\\\",true,{ID:\\\"',a.id,'\\\",TYPE:\\\"Assignment\\\"});$(this).parent().parent().hide();''>X</a>'),CONCAT('<a href=\\\"',a.responses,'\\\" target=\\\"_blank\\\">Link</a>') as link",
				"tbl": "online_course_read_tracker a",
				"join": "INNER JOIN online_lesson b ON a.onlinecourse_lessonid=b.id INNER JOIN online_course c ON b.courseid=c.id INNER JOIN online_course_mycourse d ON c.id=d.courseid AND a.createdby=d.createdby INNER JOIN online_course_users e ON d.createdby=e.id",
				"whr": "b.type='Assignment' AND d.expirydate>='||TODAY||' and (a.responses is not null and a.responses!='') and a.onlinecourse_lessonid='||GET_lesson_id||'",
				"header": "Student Name,Submitted on1,Submitted on2,Mark,Return Assignment,Delete Assignment,View Assignment"
			}
		}, {
			"id": "lescnt",
			"name": "LessonCount",
			"sql": {
				"action": "Get Value",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "lessoncnt",
				"tbl": "online_lesson",
				"fld": "count(*)",
				"whr": "courseid='||COURSEID||' and status=1"
			}
		}, {
			"id": "fcinfo",
			"name": "Faculty Information",
			"sql": {
				"action": "Get Table",
				"validate": "online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "appendix",
				"prepend": "<h3>Summary</h3>",
				"tbl": "online_course a",
				"fld": "a.title,CONCAT('<div style=''text-decoration:underline'' onclick=''Eirene.runStmt(\\\"lescnt-stulst\\\",{COURSEID:\\\"',a.id,'\\\"})''>',count(*),'</div>'),(SELECT count(*) FROM online_lesson WHERE courseid=a.id and status=1)",
				"join": "INNER JOIN online_course_mycourse b ON a.id=b.courseid",
				"whr": "b.expirydate>=NOW() and a.owner='||USERID||'",
				"grp": "a.title",
				"header": "Course,Student Count,Lesson Count"
			}
		}, {
			"id": "svAuth",
			"name": "saveAuthor",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users,online_author1",
				"command": "insertorupdate",
				"tbl": "online_author",
				"fld": "authorname,description,linked_to_institution,image_path,owner",
				"fldtype": "s,s,s,s,u",
				"value": "||authorname||,||description||,||linked_to_institution||,||image_path||,||owner||",
				"whr": "id='||ID||'",
				"onsuccess": "cmd:dom,fun:showtoast;success;Saving Successful",
				"onfailure": "cmd:dom,fun:showtoast;alert;Saving Failed"
			}
		}, {
			"id": "geAuth",
			"name": "getRecord",
			"sql": {
				"action": "Get Row",
				"outputto": "html",
				"validate": "online_course_users,online_author1",
				"output": "edit",
				"tbl": "online_author",
				"fld": "id,authorname,description,linked_to_institution,image_path,owner",
				"whr": "id='||ID||'",
				"jsfunction": "edit1"
			}
		}, {
			"id": "imgaut",
			"name": "uploadAuthorImage",
			"sql": {
				"action": "Upload File",
				"validate": "online_course_users status=1 and isfaculty=1",
				"outputto": "html",
				"output": "upload",
				"directory": "",
				"maxsize": "100kb",
				"filetype": "jpg,jpeg,png",
				"path": "resource/media/",
				"onsuccess": "cmd:dom,fun:showtoast;success;Upload Successful-cmd:dom,elem:input[name=||elemname||],fun:val,val:||GET_uploadedfilename||",
				"onfailure": "cmd:dom,fun:showtoast;alert;Upload Failed"
			}
		}, {
			"id": "conmrk",
			"name": "InternalConsolidateMarklist",
			"sql": {
				"action": "Get Matrix",
				"validate": "online_course_users status=1 and isfaculty=1",
				"output": "appendix",
				"tbl": "online_course_mycourse a",
				"fld": "b.title,d.fullname,c.mark",
				"join": "RIGHT JOIN online_lesson b ON a.courseid=b.courseid INNER JOIN online_course_read_tracker c ON c.onlinecourse_lessonid=b.id INNER JOIN online_course_users d ON c.createdby=d.id",
				"whr": "a.courseid='||COURSEID||' and a.expirydate>=NOW() and (b.type='Test' or b.type='Assignment')",
				"srt": "b.lesson_no",
				"row": "fullname",
				"col": "title",
				"val": "mark",
				"horizontalsum": 1
			}
		},  {
			"id": "paymts",
			"name": "getPaymentsDetails",
			"sql": {
				"action": "Get Table",
				"tbl": "online_course_users a",
				"join": "INNER JOIN online_course_orders b ON b.createdby=a.id",
				"fld": "b.createdon,a.fullname,b.orderid,b.referenceid,b.remark,b.txstatus,b.paymentmode,b.txmsg,b.amount",
				"whr": [
					"a.recordstatus=1",					
					" and b.amount is not null",
					" and b.amount>0 and b.referenceid is not null",
					{"if": "||df|| != BLANK and ||dt|| != BLANK","then": " and DATE(b.createdon)>='||df||' and DATE(b.createdon)<='||dt||'"},
					{"if": "||df|| != BLANK and ||dt|| = BLANK","then": " and DATE(b.createdon)='||df||'"}
				],
				"srt": "b.createdon DESC",
				"header": "Date,Fullname,OrderID,ReferenceID,Remark,Status,PayMode,Message,Amount",
				"merge": {
					"sqlid": "payflt",
					"node": "elem"
				}
			}
		}, {
			"id": "payflt",
			"name": "Payment Filter",
			"sql": {
				"action": "Return",
				"outputto": "php",
				"output": "demo",
				"value": "",
				"elem": {
					"output": "#workareaFilter",
					"parent": "div",
					"elem": [{
							"name": "f1",
							"type": "datepicker",
							"class": "mr-2",
							"label": "Date From",
							"id": "paydtfrm"
						},
						{
							"name": "f2",
							"type": "datepicker",
							"class": "mr-2",
							"label": "Date To",
							"id": "paydtto"
						},
						{
							"name": "f3",
							"type": "button",
							"class": "button secondary ani-hover-float",
							"value": "Get",
							"onclick": "Eirene.runStmt('paymts',{df:$('#paydtfrm').val(),dt:$('#paydtto').val()})"
						}						
					]
				},
				"onsuccess": "cmd:dom,fun:show;#workareaFilter;fast"
			}
		}, {
			"id": "delles",
			"name": "Delete Lesson",
			"sql": {
				"action": "Delete Row Permanently",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "php",
				"output": "dellesson",
				"tbl": "online_lesson",
				"whr": "id='||LESSONID||'",
				"onsuccess": "deltrk"
			}
		}, {
			"id": "deltrk",
			"name": "Delete Read Tracker",
			"sql": {
				"action": "Delete Row Permanently",
				"validate": "eirene_users,online_course_users status=1 and isfaculty=1",
				"outputto": "php",
				"output": "dellesson",
				"tbl": "online_course_read_tracker",
				"whr": "onlinecourse_lessonid='||LESSONID||'"
			}
		}, {
			"id": "rslso",
			"name": "Reset Lesson Order",
			"sql": {
				"action": "Run",
				"validate": "online_course_users",
				"stmt": "SET @pos := 0;UPDATE online_lesson SET lesson_no = ( SELECT @pos := @pos + 1 ) WHERE courseid='||COURSEID||' ORDER BY lesson_no"
			}
		}, {
			"id": "unans",
			"name": "Unanswered Question List",
			"sql": {
				"action": "Get HTML",
				"validate": "online_course_users",
				"output": "appendix",
				"tbl": "online_course_questions a",
				"join": "INNER JOIN online_lesson b ON a.lessonid=b.id INNER JOIN online_course_users c ON a.createdby=c.id",
				"whr": "b.courseid='||COURSEID||' and (a.answer is null or a.answer ='')",
				"fld": "a.id,c.fullname,a.question,b.title",
				"parent": "div class='d-flex-column'",
				"template": "<div class='mt-2'>||question||<span class='ml-2'>[||title||]</span><span class='ml-3'>- by ||fullname||</span><span class=\\\"ml-2 fg-red\\\" onclick=\\\"Eirene.runStmt('delque',{ID:'||id||'});$(this).parent().parent().hide();\\\">X</span></div><div><textarea maxlength='1500' onblur='runStmt(\\\"savean\\\",true,{ID:\\\"||id||\\\",ANS:$(this).val()});'></textarea></div>"
			}
		}, {
			"id": "crssub",
			"name": "getCourseSubscription",
			"sql": {
				"action": "Get Table",
				"outputto": "html",
				"tbl": "online_course_mycourse a",
				"datefield": "a.createdon,a.expirydate",
				"join": "INNER JOIN online_course c ON a.courseid=c.id INNER JOIN online_course_users b ON a.createdby=b.id",
				"fld": "b.fullname,b.emailid,c.title,a.createdon,a.expirydate,a.amount,a.status",
				"whr":[
					"a.iscompleted=0",
					{"if":"||stunm|| != BLANK","then":" and b.fullname like '%||stunm||%'"}
				],
				"srt": "b.fullname",
				"header": "Name,Email,Course,Subscribed on,Expiry Date,Amount,Status",
				"merge": {
					"sqlid": "subflt",
					"node": "elem"
				}
			}
		}, {
			"id": "subflt",
			"name": "Subscription Filter",
			"sql": {
				"action": "Return",
				"outputto": "php",
				"output": "demo",
				"value": "",
				"elem": {
					"output": "#workareaFilter",
					"parent": "div",
					"elem": [{
							"name": "f1",
							"id": "substunm",
							"placeholder": "Student Name",
							"type": "text",
							"class": "mr-2"
						},
						{
							"name": "f2",
							"type": "button",
							"class": "button secondary",
							"value": "Get",
							"onclick": "Eirene.runStmt('crssub',{stunm:$('#substunm').val()})"
						}
					]
				},
				"onsuccess": "cmd:dom,fun:show;#workareaFilter;fast"
			}
		}, {
			"id": "mycrtg",
			"name": "MyCourseToggleStatus",
			"sql": {
				"action": "Save Table",
				"validate": "eirene_users status>=1",
				"outputto": "html",
				"output": "res",
				"command": "update",
				"tbl": "online_course_mycourse",
				"fld": "status",
				"fldtype": "n",
				"value": "CASE WHEN status=1 THEN 0 WHEN status=0 THEN 1 END",
				"whr": "id='||ID||'",
				"onsuccess": "cmd:dom,fun:showtoast;success;Status change successful",
				"onfailure": "cmd:dom,fun:showtoast;alert;Status change failed"
			}
		}, {
			"id": "delmy1",
			"name": "Delete MyCourse",
			"sql": {
				"action": "Delete Row Permanently",
				"tbl": "online_course_mycourse",
				"whr": "id='||ID||' and iscompleted=0",
				"onfailure": "cmd:dom,fun:showtoast;alert;Deleting failed. If course is completed, this record cannot be deleted. Please try again.",
				"onsuccess": "delmy2"
			}
		}, {
			"id": "delmy2",
			"name": "Delete Read Tracker",
			"sql": {
				"action": "Delete Row Permanently",
				"outputo": "html",
				"output": "res",
				"tbl": "online_course_read_tracker",
				"fld": "courseid",
				"whr": "mycourseid='||ID||'"
			}
		}, {
			"id": "anncnt",
			"name": "New Announcement Count",
			"sql": {
				"action": "Get Value",
				"validate": "none",
				"outputo": "html",
				"output": "announcementcount",
				"tbl": "online_lesson",
				"fld": "count(*)",
				"whr": "type='Announcement' and createdon>=ADDDATE(NOW(),INTERVAL -30 DAY)",
				"onsuccess": "cmd:dom,fun:html;.myannouncementcount;||GET_announcementcount||"
			}
		},     {
			"id": "c-ins1",
			"name": "Pie Chart Institute Wise Data",
			"sql": {
				"action": "Get Chart",
				"validate": "online_course_users status=1",
				"outputto": "html",
				"title": "Institute Wise Student Count",
				"output": "chart",
				"type": "pie",
				"elem": "",
				"label": "linked_to_institution",
				"value": "cnt",
				"tbl": "online_course_users",
				"fld": "linked_to_institution,count(*) as cnt",
				"whr": "status=1",
				"grp": "linked_to_institution",
				"srt": "linked_to_institution"
			}
		}, {
			"id": "49reau",
			"name": "RecordAudio",
			"sql": {
				"action": "Upload File",
				"validate": "online_course_users status=1",
				"outputto": "html",
				"output": "upload",
				"directory": "",
				"maxsize": "20mb",
				"filetype": "mp3,mpeg,mpeg-3,ogg,wav",
				"path": "resource/media/",
				"onsuccess": "cmd:dom,fun:showtoast;success;Upload successful-cmd:dom,elem:current,fun:attr,val:val,val1:||GET_uploadedfilename||-saveTestTemporarily()"
			}
		}, {
			"id": "35don",
			"name": "addToOrders",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "none",
				"command": "insert",
				"tbl": "online_course_orders",
				"fld": "orderid,amount,remark,email,mobile,createdby",
				"fldtype": "s,n,s,s,s,u",
				"value": "||PHPUNIQID||,||DONAMOUNT||,||DONREMARK||,||DONEMAIL||,||DONMOBILE||,d474e1f0-388b-11eb-83a2-525400a09ba1",
				"onsuccess": "35fdon"
			}
		}, {
			"id": "50upim",
			"name": "uploadUserDocuments",
			"sql": {
				"action": "Upload File",
				"validate": "online_course_users status=1",
				"outputto": "php",
				"output": "upload",
				"directory": "",
				"maxsize": "5mb",
				"filetype": "jpg,jpeg,png,pdf,doc,docx",
				"path": "resource/media/",
				"onsuccess": "cmd:dom,fun:showtoast;success;Upload Successful-cmd:dom,elem:input[name=||elemname||],fun:val,val:||GET_uploadedfilename||",
				"onfailure": "cmd:dom,fun:showtoast;alert;Upload Failed"
			}
		}, {
			"id": "51fFrm",
			"name": "Get Form Faculty",
			"sql": {
				"action": "Get Form",
				"validate": "none",
				"outputto": "html",
				"output": "form",
				"formlist": "Online Course Users,online_course_apply,Online_Course,online_author1",
				"jsfunction": "initializePlugin1"
			}
		}, {
			"id": "52save",
			"name": "Save-ApplyForCourse",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users status>0,eirene_users status>0",
				"outputto": "php",
				"output": "res",
				"command": "insertorupdate",
				"tbl": "online_applyforcourse",
				"fld": "dob,gender,church,father,spouse,permadd,coradd,course,gadget,xnyears,pastor,pastorcontact,sponsor,fee,prgtype,college,candidatephoto_path,educert_path,pastorrecommendation_path,medium,sign,state,pin,mothertongue",
				"fldtype": "d,s,s,s,s,s,s,s,s,n,s,s,n,s,s,s,s,s,s,s,s,s,n,s",
				"value": "||dob||,||gender||,||church||,||father||,||spouse||,||permadd||,||coradd||,||course||,||gadget||,||xnyears||,||pastor||,||pastorcontact||,||sponsor||,||fee||,||prgtype||,||college||,||candidatephoto_path||,||educert_path||,||pastorrecommendation_path||,||medium||,||sign||,||state||,||pin||,||mothertongue||",
				"whr": "id='||ID||'",
				"onsuccess": "cmd:dom,fun:showtoast;success;Application saved successfully-52tbl",
				"onfailure": "cmd:dom,fun:showtoast;alert;Application saving failed"
			}
		}, {
			"id": "52get",
			"name": "Get-ApplyForCourse",
			"sql": {
				"action": "Get Row",
				"validate": "online_course_users status>0,eirene_users status>0",
				"outputto": "html",
				"output": "edit",
				"tbl": "online_applyforcourse",
				"fld": "id,dob,gender,church,father,spouse,permadd,coradd,course,gadget,xnyears,pastor,pastorcontact,sponsor,fee,prgtype,college,candidatephoto_path,educert_path,pastorrecommendation_path,medium,sign,status,modifiedon,state,pin,mothertongue",
				"datefield": "modifiedon",
				"whr": "id='||ID||'",
				"jsfunction": "edit1"
			}
		}, {
			"id": "52prn",
			"name": "PrintApplication-EvokeJSFunciton",
			"sql": {
				"action": "Return",
				"outputto": "php",
				"output": "demo",
				"value": "",
				"validate": "online_course_users status>0",
				"jsfunction": "printApplication"
			}
		}, {
			"id": "52tbl",
			"name": "Get Application List",
			"sql": {
				"action": "Get Table",
				"validate": "online_course_users status>0",
				"outputto": "html",
				"output": "table",
				"tbl": "online_applyforcourse",
				"fld": "course,college,createdon,status,IF(status='draft',concat('<span class=\\\"mif-cross fg-red\\\" onclick=\\\"Eirene.runStmt(&apos;52del&apos;,{id:&apos;',id,'&apos;})\\\"></span>','<span class=\\\"mif-pencil fg-blue ml-2\\\" onclick=\\\"edit(&apos;online_course_apply&apos;,&apos;',id,'&apos;)\\\"></span>'),''),IF(status='draft' AND candidatephoto_path!='' AND educert_path!='' AND pastorrecommendation_path!='',CONCAT('<span class=\\\"fg-blue\\\" onclick=\\\"Eirene.runStmt(&apos;52sub&apos;,{id:&apos;',id,'&apos;','})\\\">Submit</span>'),''),IF(pay_status=0 AND status='submitted',IF(college='NBBI' AND course='MDiv',CONCAT('<button class=\\\"button primary\\\" onclick=\\\"Eirene.runStmt(&apos;52pr3&apos;,{institute:myOnlineCourse.institute,id:&apos;',id,'&apos;})\\\">Pay 300</button>'),CONCAT('<button class=\\\"button primary\\\" onclick=\\\"Eirene.runStmt(&apos;52pr2&apos;,{institute:myOnlineCourse.institute,id:&apos;',id,'&apos;})\\\">Pay 200</button>')),''),IF(pay_status=1,CONCAT('<button class=\\\"button secondary\\\" onclick=\\\"Eirene.runStmt(&apos;52get-52prn&apos;,{ID:&apos;',id,'&apos;})\\\">Print</button>'),'')",
				"header": "Course,College,Date of Application,Status,,",
				"whr": "createdby='||userid||'",
				"prepend": "<button class='button secondary' onclick='showWindow(\\\"online_course_apply\\\")'>New Application</button><span class=\\\"mif-refresh win-shadow rounded p-3 ml-2\\\" onclick=\\\"Eirene.runStmt(&apos;52tbl&apos;)\\\"></span>"
			}
		}, {
			"id": "52del",
			"name": "Delete Draft Application",
			"sql": {
				"action": "Delete Row Permanently",
				"validate": "online_course_users status>0",
				"outputto": "php",
				"output": "res",
				"tbl": "online_applyforcourse",
				"whr": "id='||id||' and status='draft'",
				"onsuccess": "cmd:dom,fun:showtoast;success;Row deleted successfully",
				"onfailure": "cmd:dom,fun:showtoast;alert;Row deletion failed"
			}
		}, {
			"id": "52sub",
			"name": "Submit Draft Application",
			"sql": {
				"action": "Save Table",
				"validate": "online_course_users status>0",
				"outputto": "php",
				"output": "res",
				"command": "update",
				"tbl": "online_applyforcourse",
				"fld": "status",
				"fldtype": "s",
				"value": "submitted",
				"whr": "id='||id||' and status='draft'",
				"onsuccess": "cmd:dom,fun:showtoast;success;Application successfully submitted-52tbl",
				"onfailure": "cmd:dom,fun:showtoast;alert;Application submission failed"
			}
		}, {
			"id": "52pr2",
			"name": "NBBI Pay Reg Fee 200",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users",
				"command": "insert",
				"tbl": "online_course_orders",
				"fld": "orderid,createdby,amount,remark",
				"fldtype": "s,u,n,s",
				"value": "||PHPUNIQID||,||USERID||,200,||institute||/Course Application Fee",
				"onsuccess": "52ord"
			}
		}, {
			"id": "52pr3",
			"name": "NBBI Pay Reg Fee 300",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users",
				"command": "insert",
				"tbl": "online_course_orders",
				"fld": "orderid,createdby,amount,remark",
				"fldtype": "s,u,n,s",
				"value": "||PHPUNIQID||,||USERID||,300,||institute||/Course Application Fee",
				"onsuccess": "52ord"
			}
		}, {
			"id": "52ord",
			"name": "Update Table with OrderId",
			"sql": {
				"action": "Save Table",
				"outputto": "html",
				"output": "res",
				"validate": "online_course_users",
				"command": "update",
				"tbl": "online_applyforcourse",
				"fld": "pay_orderid",
				"fldtype": "s",
				"value": "||PREVIOUS_PHPUNIQID||",
				"onsuccess": "52conp"
			}
		}, {
			"id": "52conp",
			"name": "confirmPay",
			"sql": {
				"action": "Get HTML",
				"outputto": "html",
				"output": "#workareaTablebox",
				"validate": "online_course_users",
				"tbl": "online_course_orders a",
				"fld": "a.orderid,a.amount,b.fullname,b.emailid,b.phoneno",
				"join": "INNER JOIN online_course_users b ON a.createdby=b.id",
				"whr": "a.orderid='||PREVIOUS_PHPUNIQID||'",
				"parent": "form id=\\\"redirectform\\\" method=\\\"post\\\" action=\\\"https://www.cashfree.com/checkout/post/submit\\\"",
				"template": "<input type=\\\"hidden\\\" name=\\\"appId\\\" value=\\\"57711cc1b8bf221207f425c3d11775\\\"/><input type=\\\"hidden\\\" name=\\\"customerEmail\\\" value=\\\"||emailid||\\\"/><input type=\\\"hidden\\\" name=\\\"customerName\\\" value=\\\"||fullname||\\\"/><input type=\\\"hidden\\\" name=\\\"customerPhone\\\" value=\\\"||phoneno||\\\"/><input type=\\\"hidden\\\" name=\\\"paymentModes\\\" value=\\\"\\\"/><input type=\\\"hidden\\\" name=\\\"notifyUrl\\\" value=\\\"https://onlinecourse.niea.in/index.php\\\"><input type=\\\"hidden\\\" name=\\\"orderAmount\\\" value=\\\"||amount||\\\"/><input type=\\\"hidden\\\" name=\\\"orderCurrency\\\" value=\\\"INR\\\"/><input type=\\\"hidden\\\" name=\\\"orderId\\\" value=\\\"||orderid||\\\"/><input type=\\\"hidden\\\" name=\\\"orderNote\\\" value=\\\"Course Subscription\\\"/><input type=\\\"hidden\\\" name=\\\"returnUrl\\\" value=\\\"https://onlinecourse.niea.in/index.php\\\"/><input type=\\\"hidden\\\" name=\\\"signature\\\" value=\\\"||SIGNATURE||\\\"/><button class=\\\"button secondary\\\">Confirm Payment of Rs. ||amount||</button>"
			}
		}, {
			"id": "52upd",
			"name": "Update - Payment Status",
			"sql": {
				"action": "Run",
				"validate": "online_course_users",
				"stmt": "UPDATE online_applyforcourse a INNER JOIN online_course_orders b ON a.pay_orderid=b.orderid SET a.pay_status=1,a.status='Fee Paid' WHERE b.txstatus='SUCCESS'"
			}
		},{
			"id":"53cru",
			"name":"Create User",
			"sql":{
				"action":"Return",
				"outputto":"html","output":"#workareaTablebox",
				"value":[
					{"sqlstatement":{"a":"SELECT count(*) FROM online_course_users WHERE emailid = '||email||'"}},
					{"if":"||email|| = BLANK","then":[{"domoutput":"showtoast;alert;Email is empty"},"DO_NOT_PROCEED"]},
					{"if":"||name|| = BLANK","then":[{"domoutput":"showtoast;alert;Name is empty"},"DO_NOT_PROCEED"]},
					{"if":"||mobileno|| = BLANK","then":[{"domoutput":"showtoast;alert;Mobile No. is empty"},"DO_NOT_PROCEED"]},
					{"if":"||a|| > 0",
						"then":"Account already exists!",
						"else":[
							{"call":"ocusv","emailid":"||email||","fullname":"||name||","phoneno":"||mobileno||"},
							{"if":"||lastsavingsuccess|| != BLANK",
								"then":"User Account Successfully Created. Login with your email id.",
								"else":"Saving Not Successful. Please contact NBBI office."}
						]
					}
				]				
			}
		},    {
			"id": "54stm1",
			"name": "Get Menu (Not Logged in)",
			"sql": {
			"action": "MULTISTMT",
			"validate": "none",
			"multistmt": [{
			"action": "Get Value",
			"name": "Check Maintanence",
			"outputto": "php",
			"output": "chk",
			"tbl": "eirene_plugin",
			"fld": "maintanence",
			"whr": "id='||pluginid||'",
			"value": "1"
			},
			{
			"runif":"||chk|| = 1",
			"action": "Return",
			"name": "Maintanence Message",
			"validate": "none",
			"outputto": "html",
			"output": "#workareaTablebox",
			"value": "<table class='m-5'><tr ><td class='p-10'><span class='mif-tools mif-5x fg-blue'></span></td><td class='p-10'><h1 class='mb-5'>Maintenance Mode!</h1>This site is currently under maintenance. We apologize for the inconvenience caused to you.  We're doing our best to get things back to working. In case of emergency, please feel free to contact The Team.</td></tr></table>",
			"onsuccess": "DO_NOT_PROCEED"
			},
			{
			"action": "Get Form",
			"outputto": "html",
			"output": "form",
			"formlist": "Online Course Users,online_course_apply",
			"jsfunction1": "initializePlugin1"
			
			},{
			"action":"Get HTML",
			"outputto":"html",
			"output":"#side-menu",
			"tbl":"eirene_plugin",
			"fld":"JSON_EXTRACT(others,'$.menu')",
			"whr":"id='||PLUGINID||'",
			"convertDataSourceToJson":1,"prepend":"<ul>","append":"</ul>",
			"template":"<li id='mnu_||PLUGINID||_||customid||' caption='||caption||' customid='||customid||' onclick='$(&apos;#pagetitle&apos;).text($(this).attr(&apos;caption&apos;));' pluginid='||pluginid||'><a href='#' onclick='||onclick||'><span class='icon'><span class='||icon||'></span></span><span class='caption ||captioncls||'>||caption||</span></a></li>"			
			}
			]
			}
		}, {
			"id": "readpg",
			"name": "Read Lesson",
			"sql": {				
				"action": "Return",
				"output": "exp",
				"outputto": "php",				
				"value": [
					{"cookie":{"name":"lessonid","value":"||LESSONID||"}},
					{"if":"||IsFacultyForCourse|| = 1",
						"then":[
							{"call":"ocrlt1","lessonid":"||LESSONID||","name":"Get Resource","prepend":"<h3>Resource</h3>","output":"resource","outputto":"php"}
						],
						"else":[
							{"call":"11","name":"Get Resource"}							
						]
					},
					{"call":"ocrtsv","onsuccess":"","onfailure":"","onlinecourse_lessonid":"||LESSONID||","readstatus":"1","whr":"createdby='||userid||' and onlinecourse_lessonid='||LESSONID||'"},
					{"sqlstatement":{
						"lesson":"SELECT a.read_status,b.lesson_no,b.lesson_order,b.title,b.id,b.type,b.material,b.options,b.launchdate,a.mark,b.status as lessonstatus,b.expirydate,a.id as readtrackid FROM online_lesson b INNER JOIN online_course c ON b.courseid=c.id LEFT JOIN (SELECT read_status,onlinecourse_lessonid,mark,id FROM online_course_read_tracker WHERE createdby='||USERID||' and onlinecourse_lessonid='||LESSONID||' LIMIT 1 ) a  ON a.onlinecourse_lessonid=b.id WHERE b.id='||LESSONID||' and (b.status=1 or c.authorid='||USERID||' or c.owner='||USERID||')",
						"notes":"SELECT id as readtrackerid,notes,responses,mark,read_status,document from online_course_read_tracker WHERE createdby='||USERID||' and onlinecourse_lessonid='||LESSONID||'"
					}},					
					{"call":"23","name":"Get Active User Count"},
					{"case":"||lesson_type||",
						"Reading":{"call":"rc1"},
						"Assignment":{"call":"rc1"},
						"Assignment1":{"if":"||IsFacultyForCourse|| = 1","then":{"call":"as2"},"else":{"call":"as1"}},
						"Discussion":{"call":"disslt-dssn"}
					}
				],				
				"script":[
					"try{Eirene.allowpreviouspage;true;",					
					"Eirene.allownextpage=true;",
					"readPDF('#lessonpage');",
					"}catch(ex){",
					"}"
				]				
			}			
		},
		{
			"id":"dssn",
			"name":"Discussion Display",			
			"sql":{
				"action":"Return","validate":"online_course_users",
				"output":"#online_course_lessonpage",
				"value":"<div id='charcounter'></div><textarea data-role='textarea' data-chars-counter-template='You entered $1/8000 chars' data-chars-counter='#charcounter' name='response-discussion' maxlength='8000' style='width:100%'  class='online_course_response discussionSubmit' style='border:1px solid gray!important;' id='discussion_textarea'></textarea><div class='mt-2 uploadDiscussionImage' style='display:none'><div><b>Upload Image (jpg, png) max 200kb</b> (You can compress your file <a target='_blank' href='https://www.imgonline.com.ua/eng/compress-image-size.php'>here</a>)</div><form id='form-discussion' method='post' enctype='multipart/form-data'><div class='d-flex'><input type='hidden' name='action' value='Upload File'><input name='uploadfile' onchange='checkFileSize(this,\\\"200kb\\\")' type='file' class='w-100-fs w-100-sm w-50-lg'><button type='button' class='primary ml-2' onclick='let form = $(\\\"#form-discussion\\\");let formData = new FormData(form[0]);callAjax({stmt:\\\"37a\\\",userid:Eirene.userinfo.userid,pluginid:Eirene.activePluginId,LESSONID:myOnlineCourse.lessonid,elemname:\\\"response-discussion\\\",formname:\\\"form-discussion\\\",silent:true},\\\"\\\",formData)'>Upload</button><button type='button' class='button secondary ml-2' onclick='$(\\\".discussionSubmit\\\").show();$(\\\".uploadDiscussionImage\\\").hide();'>Type Text</button> </div></form></div><div class='discussionSubmit' style='margin-top:60px'><button class='button secondary mt-2' onclick='$(\\\".discussionSubmit\\\").hide();$(\\\".uploadDiscussionImage\\\").show();'>Upload Image</button> <button class='button primary mt-2 ml-2' onclick='if(!myOnlineCourse.newresponse)return false; Eirene.runStmt(39,{RESPONSES:myOnlineCourse.newresponse,LESSONID:myOnlineCourse.lessonid});$(this).hide();Eirene.allownextpage=true;'>Submit</button></div><h3 class='mt-2'>Discussions</h3><div class='mt-2'>||discussion||</div>",
				"onsuccess":"cmd:dom,fun:val;#discussion_textarea;||notes_responses||"
			}
		},{
			"id": "as1",
			"name": "Assignment Read- Student",
			"sql": {
				"action": "Return",
				"validate": "eirene_users,online_course_users",
				"outputto": "html",
				"output": "#online_course_lessonpage",
				"value": "<div id='lessonpage1'>||GET_lesson_title||</div><div id='lessonpage2'>||GET_lesson_material||</div><div id='lessonpage3'><form id='form' ><input type='file' id='uploadfile' name='uploadfile'><button type='button' onclick='let form = $(&apos;#form&apos;);let formData = new FormData(form[0]);callAjax({stmt:&apos;37&apos;,LESSONID:myOnlineCourse.lessonid,userid:Eirene.userinfo.userid,pluginid:Eirene.activePluginId,elemname:&apos;appointmentdoc&apos;,formname:&apos;form&apos;,silent:true},&apos;&apos;,formData)'>Upload</button></form></div><br>"
			}
		},		
		{
			"id": "rc1",
			"name": "ReadCourse Read",
			"sql": {
				"action": "Return",
				"validate": "eirene_users,online_course_users",
				"outputto": "html",
				"output": "#lessonpage",
				"prepend":[
					"<div style='display:inline;'>",
					{"if":"||IsFacultyForCourse|| = 1",
						"then":[
							"<button class='no-print button secondary rounded shadowed' onclick='Eirene.runStmt(&apos;olgf&apos;,{LESSONID:&apos;||LESSONID||&apos;,ID:&apos;||LESSONID||&apos;,varolgf_getformvalue:&apos;||LESSONID||&apos;,formname:&apos;editlesson&apos;,varolgf_output:&apos;#editlessonForm&apos;});$(&apos;#editlessonForm&apos;).show();$(&apos;#lessonpage&apos;).hide();$(&apos;#tabpg5&apos;).addClass(&apos;active&apos;);$(&apos;#tabpg2&apos;).removeClass(&apos;active&apos;);'>Edit</button>",
							"<button class='no-print button secondary rounded shadowed' onclick='Eirene.runStmt(&apos;oldt&apos;,{ID:&apos;||LESSONID||&apos;,confirmBeforeProcess:&apos;Heads Up! <br>You are deleting a record!&apos;})'>Delete</button>"
						]
					},					
					"</div>"					
				],
				"value":[
					"<div id='lessontitle'><h3>||lesson_title||</h3></div>",
					"<div id='lessonpage1'>||lesson_material||</div>",
					"<div><p>||resource||</p></div>",
					{"if":"||lesson_type|| = Assignment",
						"then":[
							{"run":{"action":"GetForm","outputto":"php","output":"uploadfrm","getform":"online_course_read_tracker 0"}},
							"||uploadfrm||"
						]						
					},
					{"if":"||lesson_type|| = Assignment and ||IsFacultyForCourse|| = 1",
						"then":[
							{"call":"asgnlt","outputto":"php","output":"assignmentlist"},
							"||assignmentlist||"
						]
					},
					"<script>$('#lessonpage1').children().each(function() {",
					"  if ($(this).html().trim() === '' || $(this).html().trim() === '<br>') {",
						"$(this).remove();",
						"}",
					"});</script>"
				]
			}
		},		
		{
			"customid": "atlst",
			"name": "activeAuthor",
			"sql": {
				"action": "Get Table",
				"formname": "online_author",
				"fld": "b.fullname,b.linked_to_institution",
				"tbl": "online_author a",
				"join": ["LEFT JOIN online_course_users b ON b.id=a.owner",
							"LEFT JOIN online_course c ON c.authorid=b.id"
						],
				"whr":[					
					"b.status=1 and c.status=1 and b.isfaculty=1",
					{"if":"||st|| = Active","then":" and a.status=1 and a.recordstatus=1"},
					{"if":"||st|| = Inactive","then":" and a.status=0 and a.recordstatus=1"},
					{"if":"||st|| = Deleted","then":" and a.recordstatus=0"},
					{"if":"||inst|| != BLANK","then":" and b.linked_to_institution='||inst||'"}
				],
				"grp": "b.fullname,b.linked_to_institution",
				"srt": "b.fullname",
				"header": "Author Name,Institute",
				"merge": {
					"sqlid": "autbtn",
					"node": "elem"
				},
				"functionfield": [{
						"type": "link",
						"value": "<count(*)>",
						"caption": "Course Count",
						"title": "Course Count",
						"onclick": "Eirene.runStmt('ccd',{ID:'<b.id>'})"
					},
					{
						"type": "group",
						"caption": "Function",
						"grp": [{
								"type": "icon",
								"if": "a.status=1",
								"class": "icon mif-cancel mr-2",
								"title": "Suspend Author",
								"onclick": "Eirene.runStmt('atsup',{ID:'<a.id>'})"
							},
							{
								"type": "icon",
								"if": "a.status=0",
								"class": "icon mif-done mr-2",
								"title": "Activate Author",
								"onclick": "Eirene.runStmt('atact',{ID:'<a.id>'})"
							},
							{
								"type": "icon",
								"if": "a.recordstatus=0",
								"class": "icon mif-undo mr-2",
								"title": "Restore Deleted Record",
								"onclick": "Eirene.runStmt('atres',{ID:'<a.id>'})"
							},
							{
								"type": "icon",
								"if": "a.recordstatus=1",
								"class": "icon mif-cross mr-2",
								"title": "Delete Record",
								"onclick": "Eirene.runStmt2('atdel','ID','<a.id>')"
							},
							{
								"if":"a.status=0",
								"type": "icon",
								"class": "icon mif-redo",
								"title": "Restore",
								"onclick": "Eirene.runStmt('atsup1',{ID:'<a.id>'})"
							},
							{
								"type": "icon",
								"class": "icon mif-pencil",
								"title": "Edit Record",
								"onclick": "edit('online_author','<a.id>',true)"
							}
						]
					}
				]
			}
		}, 
		
		
		{
			"id": "autbtn",
			"name": "Author buttons",
			"sql": {
				"action": "Return",
				"outputto": "php",
				"output": "demo",
				"value": "",
				"elem": {
					"output": "#workareaFilter",
					"parent": "div",
					"elem": [{
							"name": "f1",
							"type": "buttonspan",
							"class": "mif-plus fg-red",
							"value": "",
							"onclick": "showWindowInDialog('online_author')"
						},
						{
							"name": "f2",
							"value": "Active",
							"onclick": "Eirene.runStmt('atlst',{st:'Active'})"							
						},
						{
							"name": "f3",
							"value": "Inactive",
							"onclick": "Eirene.runStmt('atlst',{st:'Inactive'})"							
						},
						{
							"name": "f4",
							"value": "Deleted",
							"onclick": "Eirene.runStmt('atlst',{st:'Deleted'})"							
						}
					]
				},
				"onsuccess": "cmd:dom,fun:show;#workareaFilter;fast"
			}
		}, {
			"id": "autflt",
			"name": "Author buttons",
			"sql": {
				"action": "Return",
				"outputto": "php",
				"output": "demo",
				"value": "",
				"elem": {
					"output": "#workareaFilter1",
					"parent": "div",
					"elem": [{
							"name": "f6",
							"id": "autfltinst",
							"type": "select",
							"option": "SELECT DISTINCT linked_to_institution FROM online_author WHERE status=1"
						},
						{
							"name": "f7",
							"type": "button",
							"value": "Get",
							"class": "button secondary",
							"onclick": "Eirene.runStmt('atlst',{inst:$('#autfltinst').val()})"
						}
					]
				},
				"onsuccess": "cmd:dom,fun:show;#workareaFilter1;fast"
			}
		}, {
			"id": "atsup",
			"name": "Suspend User",
			"sql": {
				"action": "Save Row",
				"outputto": "php",
				"output": "res",
				"tbl": "online_author",
				"fld": "status",
				"value": "0",
				"fldtype": "n",
				"command": "update",
				"whr": "id='||ID||'",
				"onsuccess": "cmd:dom,fun:showtoast;success;User is Suspended",
				"onfailure": "cmd:dom,fun:showtoast;alert;User Suspension Failed."
			}
		},
		{
			"id": "atsup1",
			"name": "Suspend User",
			"sql": {
				"action": "Save Row",
				"outputto": "php",
				"output": "res",
				"tbl": "online_author",
				"fld": "status",
				"value": "1",
				"fldtype": "n",
				"command": "update",
				"whr": "id='||ID||'",
				"onsuccess": "cmd:dom,fun:showtoast;success;Restored",
				"onfailure": "cmd:dom,fun:showtoast;alert;User restore  failed ."
			}
		},
		{
			"id": "ccd",
			"name": "courseList",
			"sql": {
				"action": "Get Table",
				"formname": "online_course",
				"output": "#workareaAppendix",
				"fld": "a.title,c.fullname,a.price,(SELECT count(*) 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 c.id='||ID||'",
				"merge": {
					"sqlid": "1btn",
					"node": "elem"
				},
				"header": "Title,Author,Price,Lesson Count",
				"functionfield": [{
						"type": "group",
						"caption": "Function",
						"grp": [{
								"type": "link",
								"caption": "Get Course Attendance",
								"title": "Get Course Attendance",
								"onclick": "getAttendanceForCourse('<a.id>')",
								"value": "Get Attendance"
							},
							{
								"type": "icon",
								"if": "a.status=1 or a.status=2",
								"class": "icon mif-cancel ml-2",
								"title": "Suspend",
								"onclick": "Eirene.runStmt('1sup',{ID:'<a.id>'})"
							},
							{
								"type": "icon",
								"if": "a.status=0",
								"class": "icon mif-done ml-2",
								"title": "Activate",
								"onclick": "Eirene.runStmt('1act',{ID:'<a.id>'})"
							},
							{
								"type": "icon",
								"if": "a.recordstatus=0",
								"class": "icon mif-undo ml-2",
								"title": "Restore Deleted Record",
								"onclick": "Eirene.runStmt('1res',{ID:'<a.id>'})"
							},
							{
								"type": "icon",
								"if": "a.status=0 and a.recordstatus=1",
								"class": "icon mif-cross ml-2",
								"title": "Delete Record",
								"onclick": "Eirene.runStmt2('1del','ID','<a.id>')"
							},
							{
								"type": "span",
								"if": "a.status>=0",
								"class": "ml-2",
								"onclick": "Eirene.runStmt('5',{COURSEID:'<a.id>'})",
								"value": "<b.subscribers>"
							},
							{
								"type": "icon",
								"class": "icon mif-pencil ml-2",
								"onclick": "edit('online_course','<a.id>',true);"
							}
						]
					}

				],
				"onsuccess": "cmd:dom,fun:show;#workareaAppendix;fast"
			}
		},

		{
			"id": "atact",
			"name": "Activate User",
			"sql": {
				"action": "Save Row",
				"outputto": "php",
				"output": "res",
				"tbl": "online_author",
				"fld": "status",
				"value": "1",
				"fldtype": "n",
				"command": "update",
				"whr": "id='||ID||'",
				"onsuccess": "cmd:dom,fun:showtoast;success;User is Activated",
				"onfailure": "cmd:dom,fun:showtoast;alert;User Activation Failed."
			}
		}, {
			"id": "atdel",
			"name": "Delete Record",
			"sql": {
				"action": "Save Row",
				"outputto": "php",
				"output": "res",
				"tbl": "online_author",
				"fld": "recordstatus",
				"value": "0",
				"fldtype": "s",
				"command": "update",
				"whr": "id='||ID||'",
				"onsuccess": "cmd:dom,fun:showtoast;success;Record Deletion Successful",
				"onfailure": "cmd:dom,fun:showtoast;alert;Record Deletion Failed"
			}
		}, {
			"id": "atres",
			"name": "Restore Deleted Record",
			"sql": {
				"action": "Save Row",
				"outputto": "php",
				"output": "res",
				"tbl": "online_author",
				"fld": "recordstatus",
				"value": "1",
				"fldtype": "s",
				"command": "update",
				"whr": "id='||ID||'",
				"onsuccess": "cmd:dom,fun:showtoast;success;Record Restoration Successful",
				"onfailure": "cmd:dom,fun:showtoast;alert;Record Restoration Failed"
			}
		},			    
		{
			"id": "rc",
			"name": "Read Course",
			"sql": {
				"action": "Return",
				"output": "#workareaTablebox",
				"validate":"online_course_users",
				"prerun":[					
					{"sqlstatement":{						
						"MyCourseID":"SELECT id FROM online_course_mycourse WHERE courseid='||COURSEID||' and expirydate>CURDATE() and createdby='||USERID||'"
						}
					},
					{"cookie":{"name":"MyCourseID","value":"||MyCourseID||","time":"0"}},
					{"cookie":{"name":"CourseID","value":"||COURSEID||","time":"0"}},
					{"cookie":{"name":"IsFacultyForCourse","value":"SELECT COUNT(*) FROM online_course WHERE id='||COURSEID||' and (authorid='||USERID||' or owner='||USERID||')","time":"0"}},					
					{"if":"||isfaculty|| = 1","then":{"call":"36lt+-23"},"else":{"call":"36lst-23"}},
					{"localvalue":{"toolbar":[
						"<div class='clear'>",
							"<div class='place-left d-flex'>",
								"<span class='mif-chevron-left' ",
									"onclick='$(&apos;#online_course_lessonlist&apos;).toggle(&apos;slow&apos;);if($(this).attr(&apos;class&apos;)==&apos;mif-chevron-left&apos;){$(this).attr(&apos;class&apos;,&apos;mif-chevron-right&apos;);}else{$(this).attr(&apos;class&apos;,&apos;mif-chevron-left&apos;);}'>",
								"</span>",
								"<span class='mif-chevron-thin-left' title='Previous' onclick='getPreviousPage()'></span>",
								"<span class='mif-enlarge2' title='Full Screen' ",
									"onclick='if($(this).attr(&apos;class&apos;)==&apos;mif-enlarge2&apos;){$(this).attr(&apos;class&apos;,&apos;mif-shrink2&apos;);$(&apos;#workareaFilter&apos;).css({&apos;position&apos;:&apos;fixed&apos;,&apos;height&apos;:&apos;100vh&apos;,&apos;width&apos;:&apos;100%&apos;,&apos;top&apos;:&apos;0&apos;,&apos;left&apos;:&apos;0&apos;,&apos;z-index&apos;:&apos;4&apos;});}else{$(this).attr(&apos;class&apos;,&apos;mif-enlarge2&apos;);$(&apos;#workareaFilter&apos;).css({&apos;position&apos;:&apos;relative&apos;,&apos;width&apos;:&apos;100%&apos;,&apos;height&apos;:&apos;&apos;,&apos;top&apos;:&apos;0&apos;,&apos;left&apos;:&apos;0&apos;,&apos;z-index&apos;:&apos;0&apos;});}'>",
								"</span>",
								"<span class='mif-play playBtn ml-2' title='Read Aloud' onclick='if($(&apos;.playBtn&apos;).hasClass(&apos;mif-play&apos;)){$(&apos;.playBtn&apos;).removeClass(&apos;mif-play&apos;);$(&apos;.playBtn&apos;).addClass(&apos;mif-pause&apos;);readAloud(&apos;lessonpage&apos;);}else{pauseAloud();$(&apos;.playBtn&apos;).removeClass(&apos;mif-pause&apos;);$(&apos;.playBtn&apos;).addClass(&apos;mif-play&apos;);}'></span>",										
								"<span class='mif-stop  ml-2' title='Stop' onclick='stopAloud();$(&apos;.playBtn&apos;).removeClass(&apos;mif-pause&apos;);$(&apos;.playBtn&apos;).addClass(&apos;mif-play&apos;);'></span>",
								"<span class='ml-2'><select id='speechsynthesis_voices' style='width:150px' onchange='Eirene.voice=$(this).val()'></select></span>",
								"<span class='mif-printer ml-2' title='Print' onclick='printHTML(&apos;lessonpage&apos;)'></span>",
								"<span class='ml-2'><b>||COURSETITLE||</b></span>",
							"</div>",
							"<div class='place-right d-flex'>",
								"<span class='mif-chevron-thin-right' title='Next' onclick='getNextPage()'></span>",
								"<span class='mif-chevron-right' onclick='$(&apos;#online_course_lessonnotes&apos;).toggle(&apos;slow&apos;);if($(this).attr(&apos;class&apos;)==&apos;mif-chevron-right&apos;){$(this).attr(&apos;class&apos;,&apos;mif-chevron-left&apos;);}else{$(this).attr(&apos;class&apos;,&apos;mif-chevron-right&apos;);}'></span>",
							"</div>",
						"</div>"
					]}}
				],
				"value":[
							 {"cookie":{"name":"COURSETITLE","value":"SELECT title FROM online_course WHERE id='||COURSEID||'","time":"0"}},							 
							 "<div  class='w-100 p-2 border-radius-3 win-shadow'>",
								"||toolbar||",
								"<div>",
									"<ul data-role='tabs' data-expand='true' id='tabul'>",
										"<li id='tabpg1'><a href='#lessonlist'><span class='mif-list'></span> Lesson Plan</a></li>",
										"<li id='tabpg2'><a href='#lessonpage'><span class='mif-open-book'></span> Lesson</a></li>",										
										{"if":"||IsFacultyForCourse|| = 1","then":"<li id='tabpg5'><a href='#editlessonForm'><span class='mif-pencil'></span> Edit</a></li>"},
									"</ul>",
									"<div class='border bd-default no-border-top p-2'>",
										"<div id='lessonlist'>||lessonlist||</div>",
										"<div id='lessonpage'></div>",										
										{"if":"||IsFacultyForCourse|| = 1","then":"<div id='editlessonForm'></div>"},
									"</div>",
								"</div>",							 
							 "||toolbar||",
							 "</div>",
							 "<div id='online_course_lessonnotes'><textarea style='width:100%;height:100%' class='onlineCoursePage' onblur='if($(this).val()==Eirene.notes)return false;Eirene.runStmt(38,{NOTES:$(this).val(),LESSONID:myOnlineCourse.lessonid,mycourseid:Eirene.mycourseid});'></textarea></div>"
						],
				"jsfunction":"$('#lessonlist')[0].scrollIntoView({behavior: 'smooth'});stopAloud();",
				"onsuccess":[
					"cmd:dom,fun:show;#workareaFilter;slow-cmd:dom,fun:toggleclass;#workareaFilter;mb&dash&4-cmd:dom,fun:toggleclass;#workareaFilter;pl&dash&2-cmd:dom,fun:toggleclass;#workareaFilter;p&dash&4"
					
				]
			}
		},
		{
			"id": "aud1",
			"name": "Author List",
			"sql": {
				"action": "Get HTML",
				"outputto": "html",
				"validate":"online_course_users",
				"output": "table",
				"appendoutput": true,
				"fld": "a.fullname,b.description,b.image_path,b.id as aid,a.id as authorid",
				"tbl": "online_course_users a",
				"join": "INNER JOIN online_author b ON b.owner=a.id",
				"parent": "table",
				"template": [
								"<TR><TD style='text-align:left;'> </TD><TD style='text-align:left;'><img align='center' src='||image_path||' style='border-radius:50%;width:600px'></TD><TD style='text-align:justify;padding:20px;vertical-align:top;'><div style='color:#1C81D9'><b>||fullname||</b>&nbsp;&nbsp;",
								{
								"if": "||USERID|| = ||authorid||",
								"then":	"<button onclick='edit(&apos;online_author1&apos;,&apos;||aid||&apos;,true)'>Edit</button>"
								},
								"</div><div style='color:BLACK'><br>||description||</div></TD></TR><TR></TR>"
							],
				"onsuccess": "cmd:dom,fun:show;#workareaTablebox;slow"			
			}
		},
		{
			"id": "chkfa1",
			"name": "IsFaculty",
			"sql": {
				"action": "Get Value",
				"validate": "eirene_users,online_course_users,online_author",
				"output": "exist",
				"tbl": "online_author",
				"fld": "count(*)",
				"whr": "owner='||USERID||'"
			}
		},
				
		{
			"id": "aud",
			"name": "Author List",
			"sql": {
				"action": "Get HTML",
				"outputto": "html",
				"validate":"online_course_users",
				"output": "table",
				"appendoutput": true,
				"fld": "a.fullname,b.description,b.image_path,b.id",
				"tbl": "online_course_users a",
				"join": "INNER JOIN online_author b ON b.owner=a.id",
				"parent": "table",
				"template": "<TR><TD style='text-align:left;'> </TD><TD style='text-align:left;'><img align='center' src='||image_path||' style='border-radius:50%;width:600px'></TD><TD style='text-align:justify;padding:20px;vertical-align:top;'><div style='color:#1C81D9'><b>||fullname||</b></div><div style='color:BLACK'><br>||description||</div></TD></TR><TR></TR>",
				"onsuccess": "cmd:dom,fun:show;#workareaTablebox;slow",
				"prepend":"<button onclick='showWindowInDialog(&apos;online_author1&apos;)'>Add Author</button><br>"			
			
			}
		},		
		{
			"id":"omklt",
			"name":"Mark List",
			"sql":{
				"action":"Get Table",
				"class":"table denimBlueTable",
				"prerun":[
					{"sqlstatement":{"rollno":"SELECT rollno FROM online_course_users WHERE id='||USERID||'"}}
				],
				"tbl":"nbbi_onlinemark a",
				"output":"#workareaTablebox",
				"join":"INNER JOIN online_course b ON b.id=a.subjectid",
				"fld":"b.titleprint,a.test1,a.test2,a.test3,a.drta,a.assignment,a.readingreport,if(a.isinternalpass=0,CONCAT('<span class=fg-red>',a.internaltotal,'</span>'),a.internaltotal) as internaltotal,if(a.isexternalpass=0,CONCAT('<span class=fg-red>',a.finalexam,'</span>'),a.finalexam) finalexam,if(a.ispass=0,CONCAT('<span class=fg-red>',a.total,'</span>'),a.total) total",
				"whr":"a.rollno='||rollno||'",
				"header":"Subject,CT1,CT2,CT3,DRT,AM1,AM2,In,Ex,Tot",
				"datatable":false
			}
		},
		{
			"id":"omklt1",
			"name":"Mark List",
			"sql":{
				"action":"Get Table",				
				"getform":"nbbi_onlinemark 0","filter":"a.rollno,a.subjectid",
				"tbl":"nbbi_onlinemark a",
				"output":"#workareaTablebox",
				"join":"INNER JOIN online_course b ON b.id=a.subjectid",
				"fld":"a.rollno,b.titleprint,a.test1,a.test2,a.test3,a.drta,a.assignment,a.readingreport,if(a.isinternalpass=0,CONCAT('<span class=fg-red>',a.internaltotal,'</span>'),a.internaltotal) as internaltotal,if(a.isexternalpass=0,CONCAT('<span class=fg-red>',a.finalexam,'</span>'),a.finalexam) finalexam,if(a.ispass=0,CONCAT('<span class=fg-red>',a.total,'</span>'),a.total) total",				
				"header":"RollNo,Subject,CT1,CT2,CT3,DRT,AM1,AM2,In,Ex,Tot",
				"includeeditdelete":true
			}
		}
	]
}