Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Apache
: 172.26.7.228 | : 18.116.13.192
Cant Read [ /etc/named.conf ]
5.6.40-24+ubuntu18.04.1+deb.sury.org+1
www-data
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
var /
www /
oasis /
src /
[ HOME SHELL ]
Name
Size
Permission
Action
system
[ DIR ]
drwxr-xr-x
CIEAttendanceNotEligible.php
3.28
KB
-rw-rw-r--
CIEpendingList.php
5.85
KB
-rw-rw-r--
Dispatch_ans_script_setup.php
5.84
KB
-rwxr-xr-x
Dispatch_ans_script_setup_qp.p...
5.18
KB
-rwxr-xr-x
DisplayPrintApplication_ru.php
65.63
KB
-rw-rw-r--
ECHblk.php
14.61
KB
-rwxr-xr-x
ECHblk_15042021.php
11.68
KB
-rwxr-xr-x
FormulaEvaluate.php
14.15
KB
-rwxr-xr-x
MarkEntry-Setup.php
30.6
KB
-rw-rw-r--
MarkEntry-Setup_bf_gcg.php
22.89
KB
-rwxr-xr-x
MarkEntry-Setupx.php
30.61
KB
-rwxr-xr-x
SelectSubjType.php
3.05
KB
-rw-rw-r--
SubjectType.php
3.62
KB
-rw-rw-r--
TarkaFormatStyles.php
15.37
KB
-rwxr-xr-x
UpdateCollDet.php
2.03
KB
-rwxr-xr-x
absentAndMalReportPdf.php
8.25
KB
-rw-rw-r--
absentEntryYearModewise.php
991
B
-rw-rw-r--
absent_entry_setup.php
8.13
KB
-rwxr-xr-x
absent_entry_setupQp.php
11.36
KB
-rwxr-xr-x
ack_adm_application.php
103.36
KB
-rwxr-xr-x
ack_adm_application.php.orig
58.73
KB
-rwxr-xr-x
ack_admentry_application.php
59.63
KB
-rwxr-xr-x
ack_exam_app_form.php
20.27
KB
-rwxr-xr-x
ack_exam_app_form_bulk.php
12.71
KB
-rwxr-xr-x
ack_report.php
3.69
KB
-rwxr-xr-x
ack_rv_rt_application.php
9.34
KB
-rwxr-xr-x
actClass.php
6.21
KB
-rwxr-xr-x
adm_delete_data.php
5.58
KB
-rwxr-xr-x
admapprove.php
10.33
KB
-rwxr-xr-x
admapprove_kus.php
9.28
KB
-rwxr-xr-x
admissionHallTicket.php
4.43
KB
-rw-r--r--
admission_entry_status.php
2.73
KB
-rwxr-xr-x
admissionapplist.php
5.06
KB
-rwxr-xr-x
admlist.php
13.87
KB
-rwxr-xr-x
admstuddate.php
6.06
KB
-rwxr-xr-x
admuploadexsheet.php
20.48
KB
-rwxr-xr-x
affliation_fee.php
5.04
KB
-rwxrwxrwx
approve.php
41.53
KB
-rwxr-xr-x
approve_kus.php
24.12
KB
-rwxr-xr-x
assignUserMenu.php
13.66
KB
-rw-rw-r--
attCisshortList_sjbit.php
11.91
KB
-rw-r--r--
attEntTeachWise.php
2.07
KB
-rw-rw-r--
attEntryDaywise.php
26.9
KB
-rw-rw-r--
attTeachSum.php
3.63
KB
-rw-r--r--
attendEntry.php
5.32
KB
-rw-rw-r--
attendance.php
17.09
KB
-rwxr-xr-x
attendanceReportForm.php
6.36
KB
-rw-rw-r--
attendance_freez.php
8.51
KB
-rwxr-xr-x
attendance_freez_mth.php
8.24
KB
-rwxr-xr-x
attendanceentrydaywise.php
11.36
KB
-rw-r--r--
attendenceshort.php
7.58
KB
-rw-rw-r--
attshort.php
6.29
KB
-rwxr-xr-x
atttechblp.php
2.48
KB
-rw-r--r--
auto-complete.php
4.89
KB
-rwxr-xr-x
backup.php
4.12
KB
-rwxr-xr-x
backup_1.php
7.85
KB
-rwxr-xr-x
backup_restore.php
8.14
KB
-rwxr-xr-x
backupandrestore.php
10.18
KB
-rwxr-xr-x
backupold.php
2.73
KB
-rwxr-xr-x
bill_details.php
14.21
KB
-rw-rw-r--
board.php
4
KB
-rwxr-xr-x
bundle_dispatch.php
3.2
KB
-rwxr-xr-x
bundle_rec_ack.php
4.67
KB
-rwxr-xr-x
cManualMailer.php
2.54
KB
-rwxr-xr-x
caccesscontext.php
1.28
KB
-rwxr-xr-x
candidate-entry.php
50.68
KB
-rwxr-xr-x
cappcontext.php
2.71
KB
-rwxr-xr-x
challan_entries.php
15.05
KB
-rwxr-xr-x
challan_preparation.php
11.29
KB
-rwxr-xr-x
changeDegree.php
1.56
KB
-rwxr-xr-x
changeMobile.php
2.13
KB
-rwxr-xr-x
cmailer.php
6.83
KB
-rwxr-xr-x
cntDeclaration.php
4.23
KB
-rwxr-xr-x
coll_exam_app_form.php
3.29
KB
-rwxr-xr-x
collbankdet.php
1.9
KB
-rwxr-xr-x
colldesp_ack.php
4.03
KB
-rw-rw-r--
college.php
5.39
KB
-rwxr-xr-x
college_approve.php
5.59
KB
-rwxr-xr-x
college_degree_status.php
5.65
KB
-rwxr-xr-x
collegewisedownload.php
9.46
KB
-rw-rw-r--
colltransfer.php
6.83
KB
-rw-rw-r--
connect.php
2.58
KB
-rwxr-xr-x
convdet.php
8.02
KB
-rwxr-xr-x
convo.php
8.14
KB
-rw-rw-r--
copoMarksList.php
1.27
KB
-rw-rw-r--
copomarksentry.php
10.46
KB
-rw-r--r--
copomarksexternal.php
23.05
KB
-rw-r--r--
coporeport.php
4.56
KB
-rw-r--r--
courserep.php
1.68
KB
-rw-r--r--
coutput.php
1.84
KB
-rwxr-xr-x
createAdmission.php
14.91
KB
-rwxr-xr-x
create_all_grid_files.php
8.57
KB
-rwxr-xr-x
create_all_grid_group_files.ph...
9.94
KB
-rwxr-xr-x
create_all_popup_files.php
5.93
KB
-rwxr-xr-x
create_all_schema_files.php
4.31
KB
-rwxr-xr-x
create_all_views.php
16.52
KB
-rwxr-xr-x
create_html_files.php
52.03
KB
-rwxr-xr-x
create_html_files_without_tab....
44.49
KB
-rwxr-xr-x
create_module_meta_columns.php
5.16
KB
-rwxr-xr-x
createattclass.php
6.99
KB
-rw-rw-r--
createclassattend.php
22.03
KB
-rw-r--r--
crequestbroker.php
2.49
KB
-rwxr-xr-x
csessions.php
548
B
-rwxr-xr-x
cuser.php
3.53
KB
-rwxr-xr-x
custom_mregistry.php
122
B
-rwxr-xr-x
datadictionary.php
3.96
KB
-rwxr-xr-x
daterange.php
6.67
KB
-rwxr-xr-x
degree.php
8.28
KB
-rwxr-xr-x
degree_SujectReport.php
893
B
-rw-rw-r--
degstudymat.php
6.51
KB
-rwxr-xr-x
degstudymatdet.php
6.27
KB
-rwxr-xr-x
degwiseIAreport.php
2.95
KB
-rw-rw-r--
display_details_in_grid.php
107.2
KB
-rw-rw-r--
display_details_in_grid_bf_231...
111.76
KB
-rwxr-xr-x
display_details_in_grid_custom...
2.72
KB
-rwxr-xr-x
display_details_in_grid_studta...
96.56
KB
-rwxr-xr-x
display_details_in_grid_withde...
97.45
KB
-rwxr-xr-x
doc_verify.php
7.52
KB
-rwxr-xr-x
download_misc_files.php
5.19
KB
-rwxr-xr-x
download_misc_files_bcu_comm.p...
4.19
KB
-rwxr-xr-x
download_photo.php
35.98
KB
-rwxr-xr-x
download_photo_pgadm_photos.ph...
4.73
KB
-rw-rw-r--
download_upload.php
3.86
KB
-rwxr-xr-x
dynamicmastersdetails.php
117.45
KB
-rwxr-xr-x
dynamicmastersdetails_one.php
119.36
KB
-rwxr-xr-x
editstddet.php
7.01
KB
-rw-rw-r--
enableStudReg.php
7.65
KB
-rwxr-xr-x
entregupd.php
1.91
KB
-rw-rw-r--
entryexitevents.php
3.09
KB
-rwxr-xr-x
error_log.php
749
B
-rwxr-xr-x
examappfeereport.php
2.12
KB
-rw-rw-r--
execute_query.php
2.5
KB
-rwxr-xr-x
export_import_setup.php
7.62
KB
-rwxr-xr-x
export_import_utility.php
2.67
KB
-rwxr-xr-x
feepaidreports.php
2.77
KB
-rwxr-xr-x
format.php
7.43
KB
-rwxr-xr-x
freeze_Ad_Cl_Me.php
6.64
KB
-rwxr-xr-x
freeze_module_at_admin_college...
10.48
KB
-rwxr-xr-x
freeze_module_at_admin_college...
9.35
KB
-rwxr-xr-x
freeze_module_at_university_co...
7.45
KB
-rwxr-xr-x
freezeiaprici.php
10.87
KB
-rwxr-xr-x
general_report_format.php
11
KB
-rwxr-xr-x
getAutoCompleteFromFrameWork.p...
2.97
KB
-rwxr-xr-x
getDegreeAndSem.php
4.32
KB
-rw-rw-r--
getMessages.php
11.39
KB
-rwxr-xr-x
getTestTotalMarksReport.php
11.96
KB
-rw-rw-r--
getdata.php
39.06
KB
-rwxrwxrwx
getdataold.php
29.62
KB
-rwxr-xr-x
getfeeinformation.php
7.26
KB
-rwxr-xr-x
getmoduledetails.php
23.77
KB
-rwxr-xr-x
getnumword.php
7.45
KB
-rwxr-xr-x
getreportdetails.php
3.21
KB
-rwxr-xr-x
getreportfilefordisplay.php
1.37
KB
-rwxr-xr-x
getsearchcondition.php
1.3
KB
-rwxr-xr-x
ggridmodel.php
9.27
KB
-rwxr-xr-x
golden_palm_payslip.php
12.48
KB
-rwxr-xr-x
helptext.php
5.38
KB
-rwxr-xr-x
htblk.php
6.13
KB
-rwxr-xr-x
ia_room_allotment_datewise.php
12.13
KB
-rwxr-xr-x
iaabsententry.php
3.1
KB
-rw-r--r--
iamarks.php
7.68
KB
-rw-r--r--
iaroomdeclaration.php
2.6
KB
-rwxr-xr-x
iasectionwise.php
30.09
KB
-rw-r--r--
iasectionwisenew.php
35.77
KB
-rw-r--r--
iatimetable.php
7.61
KB
-rw-r--r--
identifyCoMarksNew.php
2.6
KB
-rw-rw-r--
identify_transactions.php
6.4
KB
-rwxr-xr-x
import_marks.php
4.11
KB
-rwxr-xr-x
invigilatorDairyRoomWise.php
6.07
KB
-rw-rw-r--
json.php
34.52
KB
-rwxr-xr-x
lateralentry.php
2.39
KB
-rwxr-xr-x
login.php
8.88
KB
-rwxr-xr-x
login_old.php
3.15
KB
-rwxr-xr-x
marksEntryExt.php
9.11
KB
-rwxr-xr-x
marksentryext.php
13.1
KB
-rw-rw-r--
marksentryquestionwise.php
41.93
KB
-rw-rw-r--
message_board.php
4.67
KB
-rwxr-xr-x
messagetext.php
1.68
KB
-rwxr-xr-x
module_setup.php
2.48
KB
-rwxr-xr-x
mregistry.php
155.51
KB
-rwxr-xr-x
mregistry18.06.2021.php
99.46
KB
-rwxr-xr-x
mregistry_14092024.php
150.27
KB
-rw-rw-r--
mrn_approval.php
9
KB
-rwxr-xr-x
oldqnpaper.php
4.44
KB
-rw-rw-r--
pendingcie.php
4.21
KB
-rw-rw-r--
picharttesting.php
24.76
KB
-rw-r--r--
pmarks.php
5.97
KB
-rw-rw-r--
post.php
6
KB
-rwxr-xr-x
practicalMarks.php
8.67
KB
-rw-rw-r--
prbillreport.php
5.07
KB
-rw-r--r--
prientCodeStikers.php
6.35
KB
-rw-r--r--
principalFreeze.php
6.92
KB
-rw-rw-r--
principalfreezingsubject.php
1.9
KB
-rw-rw-r--
printAdmRegn.php
13.13
KB
-rwxr-xr-x
printApp_ru.php
1.12
KB
-rw-rw-r--
printMarkListDetailsWisenew_sj...
14.42
KB
-rw-r--r--
qnwiseMarksStats.php
6.14
KB
-rw-rw-r--
qnwisemarksentrynew.php
18.61
KB
-rw-rw-r--
qpSummaryReport.php
1.03
KB
-rw-rw-r--
receive_rv_rt_application.php
8.33
KB
-rwxr-xr-x
receive_teach_trans.php
2.49
KB
-rw-rw-r--
receive_teach_transfer.js
5.06
KB
-rw-rw-r--
remunerationEntry.php
7.14
KB
-rw-rw-r--
repeateriamarksentry.php
4.86
KB
-rw-rw-r--
report_bulk_applications.php
19.42
KB
-rwxr-xr-x
report_iamarks_pending.php
12.04
KB
-rwxr-xr-x
report_ra_invigilator_dairy.ph...
22.93
KB
-rwxr-xr-x
report_ra_qp_wise_student_coun...
8.54
KB
-rwxr-xr-x
report_setup.php
25.12
KB
-rwxr-xr-x
report_tool.php
73.03
KB
-rwxr-xr-x
resetPasswordUser.php
2.69
KB
-rw-rw-r--
result.php
5.06
KB
-rwxr-xr-x
revaluation.php
16.66
KB
-rwxr-xr-x
revaluation_oldtype.php
8.45
KB
-rwxr-xr-x
revaluation_withdegree.php
16.77
KB
-rwxr-xr-x
roomAllotment.php
37.45
KB
-rw-rw-r--
room_allotment.php
9.14
KB
-rwxr-xr-x
room_allotment_datewise.php
26.07
KB
-rwxr-xr-x
room_allotment_datewise_bf_rcu...
16.97
KB
-rwxr-xr-x
room_allotment_datewise_stph.p...
21.57
KB
-rwxr-xr-x
room_allotment_datewise_stph_n...
29.01
KB
-rwxr-xr-x
room_allotment_shifiting.php
3.34
KB
-rwxr-xr-x
roomallotmentExcel.php
8.23
KB
-rw-rw-r--
roomallotmentqpwise.php
10.22
KB
-rw-rw-r--
roomallotmentqpwisenew.php
13.92
KB
-rw-rw-r--
roomcreationnew.php
2.81
KB
-rw-rw-r--
roomdeclaration.php
2.2
KB
-rwxr-xr-x
roomdeclaration_stph.php
2.51
KB
-rwxr-xr-x
roomwiseinvigilatorsEntry.php
9.86
KB
-rw-rw-r--
rvdates.php
6.46
KB
-rw-rw-r--
rvrt_ack_exam_app.php
6
KB
-rw-rw-r--
rvrt_report.php
1.92
KB
-rw-rw-r--
savePassword.php
1.14
KB
-rw-rw-r--
saveclsdets.php
1.91
KB
-rw-rw-r--
savesspdetails.php
9.93
KB
-rw-rw-r--
sectionwisepermission.php
5.67
KB
-rwxr-xr-x
sendLoginPassword.php
3.09
KB
-rwxr-xr-x
sendsmsapi.php
814
B
-rwxr-xr-x
sendusrandpws.php
1002
B
-rwxr-xr-x
serchbygrid.php
822
B
-rwxr-xr-x
shortLists.php
1.65
KB
-rw-rw-r--
std_register_det.php
3.56
KB
-rw-rw-r--
stringspliter.php
693
B
-rwxr-xr-x
studSubIdent.php
11.23
KB
-rw-r--r--
stud_name_doc_upload.php
1.24
KB
-rw-rw-r--
stud_wise_report.php
3.02
KB
-rw-rw-r--
student.php
58.23
KB
-rwxr-xr-x
student_entry.php
61.39
KB
-rwxr-xr-x
student_entry_kswu.php
51.23
KB
-rwxr-xr-x
student_entry_nitte.php
88.09
KB
-rw-rw-r--
student_entry_rur.php
74.42
KB
-rw-rw-r--
student_entry_vku.php
66.58
KB
-rwxr-xr-x
student_rur.php
64.37
KB
-rw-rw-r--
student_vku.php
57.95
KB
-rwxr-xr-x
studentfeesandattiashortagedat...
11.38
KB
-rw-rw-r--
studentportal_remove.php
6.18
KB
-rwxr-xr-x
studentreport.php
15.37
KB
-rw-rw-r--
studnamecorr.php
6.69
KB
-rw-rw-r--
subIAMarksEntry.php
11.14
KB
-rw-rw-r--
subblock.php
6.12
KB
-rwxr-xr-x
subdet.php
9.61
KB
-rw-rw-r--
subjReg.php
12.04
KB
-rw-r--r--
subjectList_display.php
11.7
KB
-rwxr-xr-x
subject_freshExam.php
33.18
KB
-rwxr-xr-x
subject_freshExam_rcub.php
28.33
KB
-rwxr-xr-x
subjectfreez.php
13.02
KB
-rwxr-xr-x
subjectwise_freezing_sectionwi...
12.43
KB
-rwxr-xr-x
subshort.php
8.97
KB
-rw-rw-r--
system_utility.php
1.84
KB
-rwxr-xr-x
systemsetup.php
80.41
KB
-rwxr-xr-x
teachFreeze.php
8.17
KB
-rw-r--r--
teachOficerEntry.php
11.46
KB
-rwxr-xr-x
teachers.php
19.76
KB
-rwxr-xr-x
theoryMarksEntry.php
4.89
KB
-rw-rw-r--
thvalmarks.php
2.72
KB
-rw-r--r--
time_table_degreewise.php
5
KB
-rwxrwxrwx
transaction-series.php
4.86
KB
-rwxr-xr-x
updateSection.php
4.74
KB
-rwxr-xr-x
update_defined_flag.php
3.41
KB
-rwxr-xr-x
updatecopo.php
9.34
KB
-rw-r--r--
updatedegreegroup.php
3.21
KB
-rw-rw-r--
updateexamcnt.php
2.92
KB
-rwxr-xr-x
updatefreshexam.php
1.33
KB
-rw-rw-r--
updatestudentsem.php
2.03
KB
-rw-rw-r--
updatetimetable.php
9.14
KB
-rw-r--r--
updateuvcms.php
2.37
KB
-rw-rw-r--
updmarks.php
22.24
KB
-rw-r--r--
updnemp.php
1.78
KB
-rw-r--r--
upload_doc_demo.php
84
B
-rw-rw-r--
upload_studentPhoto.php
10.81
KB
-rwxr-xr-x
upload_studentPhoto_before_dow...
8.02
KB
-rwxr-xr-x
uploadcopo.php
7.89
KB
-rw-r--r--
uploadmoduledetails.php
39.65
KB
-rwxr-xr-x
uploadteacherattendance.php
5.23
KB
-rw-r--r--
userpasswordreset.php
754
B
-rw-rw-r--
usersetup.php
24.46
KB
-rwxr-xr-x
usersetupNew.php
12.76
KB
-rw-r--r--
usersubj_identification.php
5.15
KB
-rwxr-xr-x
viewNotifications.php
1.21
KB
-rw-rw-r--
view_ledger.php
3.64
KB
-rwxrwxrwx
yearmode.php
1.83
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : systemsetup.php
<?php function getModuleType($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $sql_query="select internal_code,value as type from s_ref_type where type='module_type' and active=1 order by 2"; $lobj_rs = $aobj_context->mobj_db->GetAll($sql_query); $arr[0]=$lobj_rs; $sql_query_menu="select internal_code,value as type from s_ref_type where type='sub_menu' and active=1 order by 2"; $lobj_rs_menu = $aobj_context->mobj_db->GetAll($sql_query_menu); $arr[1]=$lobj_rs_menu; include_once("getmoduledetails.php"); $arr['links_data']= getLinks($aobj_context,"General Master Setup"); if(count($lobj_rs) != 0) print_r($aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success")); else print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure")); return; } function getAutoIncrementSourceFields($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $schema_code=$aobj_context->mobj_data["schema_code"]; $sql_query="select su.internal_code,su.name as value from s_user_schema_elements su inner join s_ref_type st on st.internal_code=data_type inner join s_ref_type st1 on st1.internal_code=data_type where su.ref_s_user_schema_code={$schema_code} and st1.value='Date'"; $lobj_rs = $aobj_context->mobj_db->GetAll($sql_query); if(count($lobj_rs) != 0) print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success")); else print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure")); return; } function pupulateSystemMenu($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $get_all_menus="select * from system_menu where active=1 order by sequence"; $lobj_get_all_menus = $aobj_context->mobj_db->GetAll($get_all_menus); $html=""; session_start(); $user_id=$_SESSION['user_id']; $user_name=$_SESSION['usr'] ; $college_code=$_SESSION['collcode']; $fsnglent = $_SESSION['FSNGLENT']; $get_user_right="select ss.internal_code as user_id,user_type,value from s_sysdb ss inner join s_ref_type sr on sr.internal_code=user_type where ss.internal_code=".$_SESSION['user_id']; $lobj_get_user_right = $aobj_context->mobj_db->GetRow($get_user_right); foreach( $lobj_get_all_menus as $menu_key=>$menu_val) { $type=$menu_val['id']; $id=$menu_val['id']; if($fsnglent == 'T') { $markscol = " and s.display_module_name NOT IN ('I.A. Mark Entry - 1','I.A. Mark Entry - 2')"; } else $markscol = "and s.display_module_name NOT IN ('I.A. Mark Entry')"; // if($lobj_get_user_right['user_type']== 52 && strtolower($user_name)!='kusddecnv') { $sql_query="select internal_code,menu_name,menu_function,id from system_menu where active=1 and system_menu='T' order by ifnull(sequence,1),menu_name"; $lstr_qry = "select s.internal_code,ifnull(display_module_name,module_name) as module_name, ifnull(display_module_name,module_name) as display_module_name,t.value, is_menu_only,if(is_menu_only=1,menu_function,'') as menu_function ,IFNULL(main_menu,'0') as main_menu_id, REPLACE(module_name,' ','~') as r_module_name, IFNULL(mm.value,concat('z',display_module_name)) as main_menu_val from s_user_schema s inner join s_ref_type t on t.internal_code=module_type left join s_ref_type mm on mm.internal_code=main_menu where display_module_name is not null and t.value='{$type}' and s.active=1 group by s.internal_code order by ifnull(s.sequence,0),main_menu_val,ifnull(display_module_name,module_name)"; } else if(($lobj_get_user_right['user_type']== 14 || $lobj_get_user_right['user_type']== 40) && $lobj_get_user_right['user_type']!= 52) { $sql_query="select internal_code,menu_name,menu_function,id from system_menu where active=1 and system_menu='F' order by ifnull(sequence,1),menu_name"; $lstr_qry = "select s.internal_code,ifnull(display_module_name,module_name) as module_name, ifnull(display_module_name,module_name) as display_module_name,t.value, is_menu_only,if(is_menu_only=1,menu_function,'') as menu_function ,IFNULL(main_menu,'0') as main_menu_id, REPLACE(module_name,' ','~') as r_module_name, IFNULL(mm.value,concat('z',display_module_name)) as main_menu_val from s_user_schema s inner join s_ref_type t on t.internal_code=module_type left join s_ref_type mm on mm.internal_code=main_menu where display_module_name is not null and t.value='{$type}' and s.active=1 {$markscol} group by s.internal_code order by ifnull(s.sequence,0),main_menu_val,ifnull(display_module_name,module_name)"; //var_dump($lstr_qry); } else if($lobj_get_user_right['value']=='University' && $lobj_get_user_right['user_type']!= 52) { $sql_query="select internal_code,menu_name,menu_function,id from system_menu where active=1 and system_menu='U' order by ifnull(sequence,1),menu_name"; $lstr_qry = "select s.internal_code,ifnull(display_module_name,module_name) as module_name, ifnull(display_module_name,module_name) as display_module_name,t.value, is_menu_only,if(is_menu_only=1,menu_function,'') as menu_function ,IFNULL(main_menu,'0') as main_menu_id, REPLACE(module_name,' ','~') as r_module_name, IFNULL(mm.value,concat('z',display_module_name)) as main_menu_val from s_user_schema s inner join s_ref_type t on t.internal_code=module_type left join s_ref_type mm on mm.internal_code=main_menu where display_module_name is not null and t.value='{$type}' and s.active=1 {$markscol} group by s.internal_code order by ifnull(s.sequence,0),main_menu_val,ifnull(display_module_name,module_name)"; } else if($lobj_get_user_right['user_type']== 17) { $sql_query="select s.internal_code,s.menu_name,s.menu_function,s.id from system_menu s inner join s_ref_type st on st.value=s.id and st.type='module_type' inner join s_user_schema us on us.module_type=st.internal_code inner join user_rights ur on ur.module_id=us.internal_code where s.active=1 and ur.is_view=1 and system_menu='F' and ref_s_sysdb_code={$user_id} and college_code='{$college_code}' group by s.internal_code order by ifnull(s.sequence,1),s.menu_name"; $lstr_qry = "select s.internal_code,ifnull(display_module_name,module_name) as module_name, ifnull(display_module_name,module_name) as display_module_name, t.value,is_menu_only,if(is_menu_only=1,menu_function,'') as menu_function ,IFNULL(main_menu,'0') as main_menu_id, REPLACE(module_name,' ','~') as r_module_name, IFNULL(mm.value,concat('z',display_module_name)) as main_menu_val from s_user_schema s inner join s_ref_type t on t.internal_code=module_type left join s_ref_type mm on mm.internal_code=main_menu inner join user_rights ur on ur.module_id=s.internal_code where module_name is not null and t.value='{$type}' and (is_view=1 or is_add=1 or is_edit=1 or is_del=1) and ref_s_sysdb_code={$user_id} and college_code='{$college_code}' and s.active=1 {$markscol} group by s.internal_code order by ifnull(s.sequence,0),main_menu_val,ifnull(display_module_name,module_name)"; // var_dump($sql_query, $lstr_qry);die(); } else if(strtolower($user_name)=='vkuadmin'|| strtolower($user_name)=='bcuadmin' || strtolower($user_name)=='bnuadmin' || strtolower($user_name)=='kusadmin' || strtolower($user_name)=='acug' || strtolower($user_name)=='acpg' || strtolower($user_name)=='kiran' || strtolower($user_name)=='harini') { $sql_query="select internal_code,menu_name,menu_function,id from system_menu where active=1 and system_menu='T' order by ifnull(sequence,1),menu_name"; $cnd = "and main_menu ='65'"; if(strtolower($user_name)=='acug' || strtolower($user_name)=='acpg') { $cnd = "and main_menu ='68'"; } $lstr_qry = "select s.internal_code,ifnull(display_module_name,module_name) as module_name, ifnull(display_module_name,module_name) as display_module_name,t.value, is_menu_only,if(is_menu_only=1,menu_function,'') as menu_function ,IFNULL(main_menu,'0') as main_menu_id, REPLACE(module_name,' ','~') as r_module_name, IFNULL(mm.value,concat('z',display_module_name)) as main_menu_val from s_user_schema s inner join s_ref_type t on t.internal_code=module_type left join s_ref_type mm on mm.internal_code=main_menu where display_module_name is not null and t.value='{$type}' and s.active=1 {$cnd} group by s.internal_code order by ifnull(s.sequence,0),main_menu_val,ifnull(display_module_name,module_name)"; }else if(strtolower($user_name)=='kuscnv') { $sql_query="select internal_code,menu_name,menu_function,id from system_menu where active=1 and system_menu='T' and menu_name <> 'Online Services' order by ifnull(sequence,1),menu_name"; $lstr_qry = "select s.internal_code,ifnull(display_module_name,module_name) as module_name, ifnull(display_module_name,module_name) as display_module_name,t.value, is_menu_only,if(is_menu_only=1,menu_function,'') as menu_function ,IFNULL(main_menu,'0') as main_menu_id, REPLACE(module_name,' ','~') as r_module_name, IFNULL(mm.value,concat('z',display_module_name)) as main_menu_val from s_user_schema s inner join s_ref_type t on t.internal_code=module_type left join s_ref_type mm on mm.internal_code=main_menu where display_module_name is not null and t.value='{$type}' and s.active=1 and s.module_name = 'Tatkal Roport' group by s.internal_code order by ifnull(s.sequence,0),main_menu_val,ifnull(display_module_name,module_name)"; //var_dump($lstr_qry); } else if(strtolower($user_name)=='kusddecnv') { $sql_query="select internal_code,menu_name,menu_function,id from system_menu where active=1 and system_menu='T' and menu_name <> 'Online Services' order by ifnull(sequence,1),menu_name "; $lstr_qry = "select s.internal_code,ifnull(display_module_name,module_name) as module_name, ifnull(display_module_name,module_name) as display_module_name,t.value, is_menu_only,if(is_menu_only=1,menu_function,'') as menu_function ,IFNULL(main_menu,'0') as main_menu_id, REPLACE(module_name,' ','~') as r_module_name, IFNULL(mm.value,concat('z',display_module_name)) as main_menu_val from s_user_schema s inner join s_ref_type t on t.internal_code=module_type left join s_ref_type mm on mm.internal_code=main_menu where display_module_name is not null and t.value='{$type}' and s.active=1 and s.module_name = 'Tatkal Roport' group by s.internal_code order by ifnull(s.sequence,0),main_menu_val,ifnull(display_module_name,module_name)"; //var_dump($lstr_qry); } else if(strtolower($user_name)=='cityoffice' || strtolower($user_name)=='brp' || strtolower($user_name)=='sahyadri') { $sql_query="select internal_code,menu_name,menu_function,id from system_menu where active=1 and system_menu='T' and menu_name <> 'Online Services' order by ifnull(sequence,1),menu_name "; $lstr_qry = "select s.internal_code,ifnull(display_module_name,module_name) as module_name, ifnull(display_module_name,module_name) as display_module_name,t.value, is_menu_only,if(is_menu_only=1,menu_function,'') as menu_function ,IFNULL(main_menu,'0') as main_menu_id, REPLACE(module_name,' ','~') as r_module_name, IFNULL(mm.value,concat('z',display_module_name)) as main_menu_val from s_user_schema s inner join s_ref_type t on t.internal_code=module_type left join s_ref_type mm on mm.internal_code=main_menu where display_module_name is not null and t.value='{$type}' and s.active=1 and (s.module_name = 'Bundle Status' or s.module_name = 'Bundle Receive') group by s.internal_code order by ifnull(s.sequence,0),main_menu_val,ifnull(display_module_name,module_name)"; } // var_dump($lstr_qry); // die(); $lobj_rs = $aobj_context->mobj_db->GetAll($lstr_qry); $lobj_rs_data = $aobj_context->mobj_db->GetAll($sql_query); $html.="\n\n\n\n\n\n\n\n\n\n\n<div id='tarka_main_menu_{$id}' class='hidden'> \n"; $html.="<ul> \n"; $main_menu_id= $lobj_rs[0]['main_menu_id']; $main_menu_val= $lobj_rs[0]['main_menu_val']; $i=0; for($m=0;$m<count($lobj_rs);$m++) { $r_module_name=$lobj_rs[$m]['r_module_name']; $dis_module_name=$lobj_rs[$m]['display_module_name']; $int_code=$lobj_rs[$m]['internal_code']; $call_mod=""; $call_mod=($lobj_rs[$m]['is_menu_only']=='0')?" getModulesDetails('{$r_module_name}',{$int_code},'Add','{$dis_module_name}') ":$lobj_rs[$m]['menu_function']; if($i==0) { if($main_menu_id>0) { $html.="<li><a href='#' >{$lobj_rs[$m]['main_menu_val']}</a> \n"; $html.="<ul> \n"; $html.="<li><a href='#' onclick=\"{$call_mod};\" >{$lobj_rs[$m]['module_name']} </a> </li>\n"; } else { $html.="<li><a href='#' onclick=\"{$call_mod};\" >{$lobj_rs[$m]['module_name']} </a> </li> \n"; } $main_menu_id = $lobj_rs[$m]['main_menu_id']; $main_menu_val = $lobj_rs[$m]['main_menu_val']; $i++; continue; } else { if($main_menu_id==$lobj_rs[$m]['main_menu_id'] && $lobj_rs[$m]['main_menu_id']>0) { $html.="<li><a href='#' onclick=\"{$call_mod};\" >{$lobj_rs[$m]['module_name']} </a> </li>\n"; $main_menu_id = $lobj_rs[$m]['main_menu_id']; $main_menu_val = $lobj_rs[$m]['main_menu_val']; } else if($main_menu_id<>$lobj_rs[$m]['main_menu_id'] && $lobj_rs[$m]['main_menu_id']>0) { if($lobj_rs[$m-1]['main_menu_id']>0) { $html.="</ul> \n"; $html.="</li> \n"; } $html.="\t <li><a href='#'>{$lobj_rs[$m]['main_menu_val']}</a> \n"; $html.="<ul> \n"; $html.="<li><a href='#' onclick=\"{$call_mod};\" >{$lobj_rs[$m]['module_name']}</a> </li>\n"; } else { if($lobj_rs[$m-1]['main_menu_id']>0) { $html.="</ul> \n"; $html.="</li> \n"; } $html.=" \t <li><a href='#' onclick=\"{$call_mod};\" >{$lobj_rs[$m]['module_name']}</a> </li>\n"; } $main_menu_id = $lobj_rs[$m]['main_menu_id']; $main_menu_val = $lobj_rs[$m]['main_menu_val']; } } if($lobj_rs[$m-1]['main_menu_id']>0) { $html.="</ul> \n"; $html.="</li> \n"; } $html.="</ul> \n"; $html.="</div> \n"; } $arr['login_cnt'] = $_SESSION['login_cnt']; $arr['details'] = $lobj_rs_data; $arr['html'] = $html; if(count($lobj_rs_data) != 0) print_r($aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success")); else print_r($aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure")); return; } function GetUserSchemaParentGroup($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $schema_name =($aobj_context->mobj_data["schema_name"]); $get_details="select internal_code,name as user_schema from s_user_schema_group where ref_s_user_schema_code={$schema_name} order by name"; $lobj_details = $aobj_context->mobj_db->getAll($get_details); $arr['parent_group']=$lobj_details; if( $lobj_details) echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); else echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure"); } function insertUserSchemaMaster($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $internal_code=$aobj_context->mobj_data["internal_code"]; $active=$aobj_context->mobj_data["active"]; $create_table=$aobj_context->mobj_data["create_table"]; $module_name=addslashes(trim($aobj_context->mobj_data["module_name"])); $user_schema_js_path=addslashes(trim($aobj_context->mobj_data["user_schema_js_path"])); $user_schema_grid_default_rows=addslashes(trim($aobj_context->mobj_data["user_schema_grid_default_rows"])); $user_schema_display_module_name=addslashes(trim($aobj_context->mobj_data["user_schema_display_module_name"])); $grid_custom_links=addslashes(trim($aobj_context->mobj_data["grid_custom_links"])); $is_menu_only=addslashes(trim($aobj_context->mobj_data["is_menu_only"])); $module_function_name=addslashes(trim($aobj_context->mobj_data["module_function_name"])); $module_type=$aobj_context->mobj_data["module_type"]; $main_menu=$aobj_context->mobj_data["main_menu"]; $module_grid_type=$aobj_context->mobj_data["module_grid_type"]; $grid_user_schema_coloum_names=$aobj_context->mobj_data["grid_user_schema_coloum_names"]; $grid_user_schema_grid_query=$aobj_context->mobj_data["grid_user_schema_grid_query"]; $grid_user_schema_coloum_models=$aobj_context->mobj_data["grid_user_schema_coloum_models"]; $is_save=addslashes(trim($aobj_context->mobj_data["is_save"])); $is_clear=addslashes(trim($aobj_context->mobj_data["is_clear"])); $is_download=addslashes(trim($aobj_context->mobj_data["is_download"])); $is_view=addslashes(trim($aobj_context->mobj_data["is_view"])); $is_generate=addslashes(trim($aobj_context->mobj_data["is_generate"])); $custom_links=(trim($aobj_context->mobj_data["custom_links"])); $display_type=$aobj_context->mobj_data["display_type"]; $get_module_type="select value from s_ref_type where internal_code=$module_type"; $lobj_module_type = $aobj_context->mobj_db->GetRow($get_module_type); $mod_type=$lobj_module_type['value']; if($internal_code==0) { $get_data="select count(*) as module_count from s_user_schema where module_name='".$module_name."' and module_type='".$module_type."'"; $lobj_rs = $aobj_context->mobj_db->GetRow($get_data); if($lobj_rs['module_count']==0) { $lstr_qry = "insert into s_user_schema( module_name, display_module_name, module_type, is_menu_only, menu_function, active,main_menu,display_type, include_save,include_clear, include_download,include_view, include_generate,grid_type,custom_links,s_col_names,s_col_model,s_grid_query,s_grid_custom_links,grid_default_rows,js_path) values ( '{$module_name}','{$user_schema_display_module_name}','{$module_type}', '{$is_menu_only}', '{$module_function_name}', '{$active}', '{$main_menu}', '{$display_type}', '{$is_save}', '{$is_clear}', '{$is_download}', '{$is_view}', '{$is_generate}', '{$module_grid_type}', \"{$custom_links}\", \"{$grid_user_schema_coloum_names}\", \"{$grid_user_schema_coloum_models}\", \"{$grid_user_schema_grid_query}\", \"{$grid_custom_links}\", \"{$user_schema_grid_default_rows}\", '{$user_schema_js_path}')"; $lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry); $last_inserted_id = $aobj_context->mobj_db->Insert_ID(); $get_admin_id="select * from s_sysdb where sysusr='admin'"; $lobj_get_admin_id = $aobj_context->mobj_db->getRow($get_admin_id); $insert_new_user="insert into user_rights( ref_s_sysdb_code, module_type, module_id, is_view, is_add, is_edit, is_del) values ( '{$lobj_get_admin_id[internal_code]}', '{$module_type}', '{$last_inserted_id}', '1', '1', '1', '1' )"; $lobj_insert_user = $aobj_context->mobj_db->Execute($insert_new_user); if($mod_type=='Reports') { $main_src_obj=(explode("/",$_SERVER["REQUEST_URI"])); $main_src=$main_src_obj[1]; $report_storage_path=$_SERVER["DOCUMENT_ROOT"]."/".$main_src."/Report_details/report_result_".$last_inserted_id.".php"; $report_format_path=$_SERVER["DOCUMENT_ROOT"]."/".$main_src."/src/general_report_format.php"; file_put_contents($report_storage_path,file_get_contents($report_format_path)); } if($create_table==1 && $mod_type!='Reports' && $is_menu_only=='0') { $create_table="CREATE TABLE module_".$last_inserted_id. "( internal_code bigint(20) unsigned NOT NULL auto_increment, ref_s_user_schema_code bigint(20), created_by int(11) default NULL, created_date datetime default NULL, modified_by int(11) default NULL, modified_date datetime default NULL, PRIMARY KEY (internal_code) ) engine INNODB "; $lobj_rs = $aobj_context->mobj_db->Execute($create_table); $create_details_table="CREATE TABLE module_".$last_inserted_id."_details". "( internal_code bigint(20) unsigned NOT NULL auto_increment, ref_s_user_schema_code bigint(20) , ref_s_module_code int(11) default NULL, ref_s_user_schema_group_code int(11) default NULL, ref_s_user_schema_elements_code int(11) default NULL, value text collate latin1_general_ci, ref_ref_s_user_schema_code int(11) default NULL, created_by int(11) default NULL, created_date datetime default NULL, modified_by int(11) default NULL, modified_date datetime default NULL, PRIMARY KEY (internal_code), KEY NewIndex1 (ref_s_user_schema_code), KEY NewIndex2 (ref_s_module_code), KEY NewIndex3 (ref_s_user_schema_group_code), KEY NewIndex4 (ref_s_user_schema_elements_code) ) engine INNODB"; $lobj_rs = $aobj_context->mobj_db->Execute($create_details_table); } if($lobj_rs) { $rdata = "Module Inserted Successfully."; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); return $rdata; } else { $rdata = "insertion Failed."; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure")); return $rdata; } } else { $rdata = "Module Name Already Exstis!"; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); return $rdata; } } else { $lstr_qry = "update s_user_schema set module_name='".$module_name."', module_type='".$module_type."',display_module_name='".$user_schema_display_module_name."', main_menu= '{$main_menu}', display_type= '".$display_type."', active= {$active} ,is_menu_only='{$is_menu_only}', menu_function= '{$module_function_name}', include_save= '".$is_save."',include_clear= '".$is_clear."', include_download= '".$is_download."',include_view= '".$is_view."', include_generate = '".$is_generate."', custom_links= \"{$custom_links}\", grid_type= '{$module_grid_type}', s_col_names= \"{$grid_user_schema_coloum_names}\", s_col_model= \"{$grid_user_schema_coloum_models}\", s_grid_query= \"{$grid_user_schema_grid_query}\" , s_grid_custom_links= \"{$grid_custom_links}\", grid_default_rows = \"{$user_schema_grid_default_rows}\", js_path= '{$user_schema_js_path}' where internal_code ={$internal_code}"; $lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry); if($lobj_rs) { $rdata = "Updated Successfully."; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); return; } else { $rdata = "Udatation Failed."; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure")); } } } function GetSchemaDetailsForUpdate($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $internal_code = $aobj_context->mobj_data["internal_code"]; $get_data="select internal_code, module_name, display_module_name, module_type,is_menu_only,ifnull(menu_function,'') as menu_function,main_menu ,display_type, active,include_save,include_clear,include_download,include_view, s_col_names,s_col_model,s_grid_query,grid_type, include_generate,include_close,custom_links, s_grid_custom_links,js_path,grid_default_rows from s_user_schema where internal_code='".$internal_code."'"; $lobj_rs = $aobj_context->mobj_db->GetRow($get_data); if(count($lobj_rs) > 0) echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success"); else echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure"); return; } function getModuleNameForGroups($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $get_module_name="select internal_code,module_name as user_schema from s_user_schema where is_menu_only=0 and active =1 order by module_name"; $lobj_rs = $aobj_context->mobj_db->GetAll($get_module_name); if(count($lobj_rs) != 0) print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success")); else print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure")); return; } function forInsertuserschemagroup($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $internal_code=$aobj_context->mobj_data["internal_code"]; $group_order_by=$aobj_context->mobj_data["user_schema_group_order_by"]; $grid_default_rows=$aobj_context->mobj_data["user_schema_group_grid_default_rows"]; $grid_default_rows= (empty($grid_default_rows))?0:$grid_default_rows; if($internal_code==0) { $get_data="select count(*) as group_schema_count from s_user_schema_group where name='". $aobj_context->mobj_data["user_schema_group_name"] ."'"." and ref_s_user_schema_code=".$aobj_context->mobj_data["group_user_schema"]; $lobj_rs = $aobj_context->mobj_db->GetRow($get_data); if($lobj_rs['group_schema_count']==0) { $lstr_qry = "insert into s_user_schema_group( ref_s_user_schema_code, name,parent_group_code,sequence,multiple,is_grid_edit,inline_div,col_name,col_model,grid_edit_query,custom_links,on_click_event,group_order_by,group_default_rows) values ( '" . addslashes($aobj_context->mobj_data["group_user_schema"]) ."','" . addslashes($aobj_context->mobj_data["user_schema_group_name"])."','" . addslashes($aobj_context->mobj_data["user_schema_parent_group"])."','" . addslashes($aobj_context->mobj_data["sequence"])."','" . addslashes($aobj_context->mobj_data["is_multiple_user_schema_group"])."','" . addslashes($aobj_context->mobj_data["is_grid_edit_user_schema_group"])."','" . addslashes($aobj_context->mobj_data["is_inline_div_user_schema_group"])."',\"" . addslashes($aobj_context->mobj_data["user_schema_coloum_names"])."\",\"" . addslashes($aobj_context->mobj_data["user_schema_coloum_models"])."\",\"" . addslashes($aobj_context->mobj_data["user_schema_grid_query"])."\",\"" . addslashes($aobj_context->mobj_data["user_schema_group_custom_links"])."\",\"" . addslashes($aobj_context->mobj_data["user_schema_group_onclick"])."\", '{$group_order_by}',{$grid_default_rows})"; $lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry); $last_inserted_id = $aobj_context->mobj_db->Insert_ID(); if($aobj_context->mobj_data["is_multiple_user_schema_group"]==1) { $qry="select CONCAT('user_schema_',ms.INTERNAL_CODE,'_group_',msg.internal_code) as group_table_name, CONCAT('user_schema_',ms.INTERNAL_CODE,'_entry_',msg.internal_code) as entry_table_name from s_user_schema_group msg inner join s_user_schema ms on ms.internal_code=msg.ref_s_user_schema_code where msg.internal_code=$last_inserted_id"; $lobj_rs = $aobj_context->mobj_db->GetRow($qry); $create_table="CREATE TABLE ". $lobj_rs['group_table_name']. "( internal_code bigint(20) unsigned NOT NULL auto_increment, ref_s_user_schema_code bigint(20), ref_s_user_schema_group_code bigint(20), ref_s_ref_data_code bigint(20), created_by int(11) default NULL, created_date datetime default NULL, modified_by int(11) default NULL, modified_date datetime default NULL, PRIMARY KEY (internal_code), KEY `ref_s_ref_data_code` (`ref_s_ref_data_code`) ) engine INNODB"; $lobj_create_table = $aobj_context->mobj_db->Execute($create_table); $create_entry_table="CREATE TABLE {$lobj_rs['entry_table_name']} ( internal_code bigint(20) unsigned NOT NULL auto_increment, login_cnt int(11), group_int_code int(11) default 0, ref_s_user_schema_code bigint(20), ref_s_user_schema_group_code bigint(20), ref_s_ref_data_code bigint(20), created_by int(11) default NULL, created_date datetime default NULL, modified_by int(11) default NULL, modified_date datetime default NULL, PRIMARY KEY (internal_code), KEY `login_cnt` (`login_cnt`), KEY `group_int_code` (`group_int_code`), KEY `ref_s_ref_data_code` (`ref_s_ref_data_code`) ) engine INNODB"; $lobj_create_entry_table = $aobj_context->mobj_db->Execute($create_entry_table); } $get_module_type="select module_type from s_user_schema where internal_code=".$aobj_context->mobj_data["group_user_schema"]; $lobj_get_module_type = $aobj_context->mobj_db->getRow($get_module_type); $module_type=$lobj_get_module_type["module_type"]; $module_id=$aobj_context->mobj_data["group_user_schema"]."_".$last_inserted_id; $insert_rights="insert into user_rights( ref_s_sysdb_code, module_type, module_id, is_view, is_add, is_edit, is_del) values (1,{$module_type},'{$module_id}',1,1,1,1)"; $lobj_insert_rights = $aobj_context->mobj_db->Execute($insert_rights); if($lobj_rs) { $rdata = "Group Name inserted successfully."; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); return $rdata; } else { $rdata = "insertion Failed."; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure")); return $rdata; } } else { $rdata = "Group Name Already Exstis!"; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); return $rdata; } } else { $group_table="select internal_code,ref_s_user_schema_code,multiple, concat('user_schema_',ref_s_user_schema_code,'_group_',internal_code) as table_name from s_user_schema_group where internal_code=".$internal_code; $lobj_rs_row = $aobj_context->mobj_db->GetRow($group_table); if($aobj_context->mobj_data["is_multiple_user_schema_group"]==0) { $drop_non_multiple="drop table if EXISTS user_schema_".$aobj_context->mobj_data["group_user_schema"]."_group_".$aobj_context->mobj_data["internal_code"]; $drop_obj=$aobj_context->mobj_db->Execute($drop_non_multiple); } else if($lobj_rs_row["multiple"]==0 && $aobj_context->mobj_data["is_multiple_user_schema_group"]==1) { $create_table="CREATE TABLE user_schema_".$aobj_context->mobj_data["group_user_schema"]."_group_".$internal_code. "( internal_code bigint(20) unsigned NOT NULL auto_increment, ref_s_user_schema_code bigint(20), ref_s_user_schema_group_code bigint(20), ref_s_ref_data_code bigint(20), created_by int(11) default NULL, created_date datetime default NULL, modified_by int(11) default NULL, modified_date datetime default NULL, PRIMARY KEY (internal_code) )"; $lobj_create_table = $aobj_context->mobj_db->Execute($create_table); $create_entry_table="CREATE TABLE ". $lobj_rs['entry_table_name']. "( internal_code bigint(20) unsigned NOT NULL auto_increment, login_cnt int(11), group_int_code int(11) default 0, ref_s_user_schema_code bigint(20), ref_s_user_schema_group_code bigint(20), ref_s_ref_data_code bigint(20), created_by int(11) default NULL, created_date datetime default NULL, modified_by int(11) default NULL, modified_date datetime default NULL, PRIMARY KEY (internal_code), KEY `login_cnt` (`login_cnt`), KEY `group_int_code` (`group_int_code`) ) "; $lobj_create_entry_table = $aobj_context->mobj_db->Execute($create_entry_table); } $lstr_qry = "update s_user_schema_group set ref_s_user_schema_code='".trim($aobj_context->mobj_data["group_user_schema"]) ."',". "name='".$aobj_context->mobj_data["user_schema_group_name"] ."',". "parent_group_code='".$aobj_context->mobj_data["user_schema_parent_group"] ."',". "multiple='".$aobj_context->mobj_data["is_multiple_user_schema_group"] ."', sequence=".trim($aobj_context->mobj_data["sequence"]) .", is_grid_edit=".trim($aobj_context->mobj_data["is_grid_edit_user_schema_group"]) .", inline_div=".trim($aobj_context->mobj_data["is_inline_div_user_schema_group"]) .", col_name=\"".trim($aobj_context->mobj_data["user_schema_coloum_names"]) ."\", col_model=\"".trim($aobj_context->mobj_data["user_schema_coloum_models"]) ."\", grid_edit_query=\"".trim($aobj_context->mobj_data["user_schema_grid_query"]) ."\", custom_links=\"".trim($aobj_context->mobj_data["user_schema_group_custom_links"]) ."\", on_click_event=\"".trim($aobj_context->mobj_data["user_schema_group_onclick"]) ."\", group_order_by='{$group_order_by}', group_default_rows={$grid_default_rows} where internal_code =".$aobj_context->mobj_data["internal_code"]; $lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry); if($lobj_rs) { $rdata = "Updated Successfully."; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); return; } else { $rdata = "Udatation Failed."; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure")); } } } function GetUserSchemaGroupDetailsForUpdate($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $internal_code = $aobj_context->mobj_data["internal_code"]; $qry="select * from s_user_schema_group where internal_code=$internal_code"; $lobj_rs = $aobj_context->mobj_db->GetRow($qry); if(count($lobj_rs) != 0) echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success"); else echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure"); return; } function getUserSchemaElementType($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $sql_query="select internal_code, type,value from s_ref_type where type in('data_type','element_type') order by type,value"; $lobj_rs = $aobj_context->mobj_db->GetAll($sql_query); if(count($lobj_rs) != 0) print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success")); else print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure")); return; } function getUserSchemaElementReferenceData($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $module_name=$aobj_context->mobj_data["module_name"]; $qry=" select internal_code,module_name from s_user_schema where is_menu_only=0 and active =1 order by module_name"; $lobj_rs = $aobj_context->mobj_db->GetAll($qry); //echo $qry; print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success")); return $lobj_rs; } function getUserSchemaGroup($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $sql_query="select internal_code,name as user_schema_group from s_user_schema_group where ref_s_user_schema_code=".$aobj_context->mobj_data["elemenmt_user_schema"]." order by name"; $lobj_rs = $aobj_context->mobj_db->GetAll($sql_query); $select_max_seq="select round(ifnull(max(sequence),0)+1) as sequence from s_user_schema_elements where ref_s_user_schema_code=".$aobj_context->mobj_data["elemenmt_user_schema"]; $lobj_select_max_seq = $aobj_context->mobj_db->GetRow($select_max_seq); $sequence= $lobj_select_max_seq['sequence']; $arr[0]=$lobj_rs; $arr[1]=$sequence; if(count($lobj_rs) != 0) print_r($aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success")); else print_r($aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure")); return; } function GetUserSchemaElementDetailsForUpdate($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $internal_code = $aobj_context->mobj_data["internal_code"]; $qry="select * from s_user_schema_elements where internal_code=$internal_code"; $lobj_rs = $aobj_context->mobj_db->GetRow($qry); if(count($lobj_rs) != 0) echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success"); else echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure"); return; } function getLinkedModules($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $schema_code = $aobj_context->mobj_data["schema_code"]; $qry="select internal_code,name as value from s_user_schema_elements where ref_module_code>0 and ref_s_user_schema_code=$schema_code"; $lobj_rs = $aobj_context->mobj_db->GetAll($qry); if(count($lobj_rs) != 0) echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success"); else echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure"); return; } function getSourceFields($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $element_code = $aobj_context->mobj_data["element_code"]; $qry="select internal_code,name as value from s_user_schema_elements where ref_s_user_schema_code=(select ref_module_code from s_user_schema_elements where internal_code=$element_code )"; $lobj_rs = $aobj_context->mobj_db->GetAll($qry); if(count($lobj_rs) != 0) echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success"); else echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure"); return; } function insertUserSchemaElements($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $internal_code=$aobj_context->mobj_data["internal_code"]; $name =$aobj_context->mobj_data["user_schema_element_name"]; $group_id =$aobj_context->mobj_data["elemenmt_user_schema_group"]; $system_name =$aobj_context->mobj_data["user_schema_system_name"]; $schema_id =$aobj_context->mobj_data["elemenmt_user_schema"]; $include_in_pop_up =$aobj_context->mobj_data["include_in_pop_up"]; $on_enter =stripslashes($aobj_context->mobj_data["on_enter"]); $on_exit =stripslashes($aobj_context->mobj_data["on_exit"]); $ref_module_code_ref_field_const = ($aobj_context->mobj_data["ref_module_code_ref_field_const"]); $ref_module_code_ref_field_on = ($aobj_context->mobj_data["ref_module_code_ref_field_on"]); $ref_module_code_ref_field = ($aobj_context->mobj_data["ref_module_code_ref_field"]); $include_in_grid = ($aobj_context->mobj_data["include_in_grid"]); $is_key_field = ($aobj_context->mobj_data["is_key_field"]); $is_lov = ($aobj_context->mobj_data["is_lov"]); $is_populate_lov = ($aobj_context->mobj_data["is_populate_lov"]); $text_area_rows = ($aobj_context->mobj_data["user_schema_element_text_area_rows"]); $text_area_rows=empty($text_area_rows)?2:$text_area_rows; $grid_width = ($aobj_context->mobj_data["user_schema_element_grid_width"]); if(empty($grid_width)) $grid_width = 0; $is_unique =$aobj_context->mobj_data["is_unique"]; $select_max_seq="select round(ifnull(max(sequence),0)+1) as sequence from s_user_schema_elements where ref_s_user_schema_code=".$aobj_context->mobj_data["elemenmt_user_schema"]." and ref_s_user_schema_group_code=".$aobj_context->mobj_data["elemenmt_user_schema_group"]; $lobj_select_max_seq = $aobj_context->mobj_db->GetRow($select_max_seq); $max_seq=$lobj_select_max_seq["sequence"]; $get_multiple_group="select multiple from s_user_schema_group where internal_code=".$aobj_context->mobj_data["elemenmt_user_schema_group"]; $lobj_multiple_group = $aobj_context->mobj_db->GetRow($get_multiple_group); if(!empty($lobj_multiple_group)) $is_multiple_group=$lobj_multiple_group['multiple']; else $is_multiple_group=0; $get_group_multiple="select count(*) as count from s_user_schema_group where internal_code=".$aobj_context->mobj_data["elemenmt_user_schema_group"]." and (multiple=1 or parent_group_code<>0) "; $lobj_get_group_multiple = $aobj_context->mobj_db->GetRow($get_group_multiple); if($internal_code==0) { $get_data="select count(*) as element_count from s_user_schema_elements where ref_s_user_schema_code={$schema_id} and system_name='{$system_name}'"; $lobj_rs = $aobj_context->mobj_db->GetRow($get_data); if($lobj_rs['element_count']==0) { $select_id="select value from s_ref_type where internal_code=".addslashes($aobj_context->mobj_data["meta_type"]); $lobj_select_id = $aobj_context->mobj_db->GetRow($select_id); $insert_linked_table="select ref_module_code from s_user_schema_elements where internal_code={$schema_id}"; $lobj_inked_table = $aobj_context->mobj_db->GetRow($insert_linked_table); if(!empty($lobj_inked_table)) $lobj_inked_table_id=$lobj_inked_table['ref_module_code']; else $lobj_inked_table_id='0'; $lstr_qry = "insert into s_user_schema_elements( ref_s_user_schema_code, name, system_name, data_type, sequence, field_position, ref_s_user_schema_group_code, description, default_value, optional, decimals, list_of_values, ref_module_code, ref_module_code_ref_field, ref_module_code_ref_field_on, ref_module_code_ref_field_const, s_ref_type_meta, is_multiple_group, linked_field, linked_field_table, source_field, suffix, width, padding, is_visible, is_ref_module_code_lov, populate_lov, conditional_display, is_read_only, is_unique, include_in_popup, include_in_grid, is_key_field, on_enter, on_exit, grid_width, text_area_rows ) values ( '". addslashes($aobj_context->mobj_data["elemenmt_user_schema"]) ."','" . addslashes($aobj_context->mobj_data["user_schema_element_name"])."','" . addslashes($aobj_context->mobj_data["user_schema_system_name"])."','" . addslashes($aobj_context->mobj_data["user_schema_element_type"])."','" . addslashes($aobj_context->mobj_data["user_schema_element_sequence"])."','" . addslashes($aobj_context->mobj_data["user_schema_element_field_position"])."','" . addslashes($aobj_context->mobj_data["elemenmt_user_schema_group"])."','" . addslashes($aobj_context->mobj_data["user_schema_element_description"])."','" . addslashes($aobj_context->mobj_data["user_schema_element_default_value"])."'," . addslashes($aobj_context->mobj_data["is_user_schema_element_optional"])."," . addslashes($aobj_context->mobj_data["decimal"]).",'" . addslashes($aobj_context->mobj_data["lov"])."'," . addslashes($aobj_context->mobj_data["ref_module_code"]).", '{$ref_module_code_ref_field}',{$ref_module_code_ref_field_on},'{$ref_module_code_ref_field_const}'," . addslashes($aobj_context->mobj_data["meta_type"])."," . $is_multiple_group.",'" . addslashes($aobj_context->mobj_data["linked_field"])."','" . $lobj_inked_table_id."','" . addslashes($aobj_context->mobj_data["source_fields"])."','" . addslashes($aobj_context->mobj_data["suffix"])."','" . addslashes($aobj_context->mobj_data["width"])."','" . addslashes($aobj_context->mobj_data["padding"])."','" . addslashes($aobj_context->mobj_data["is_visible"])."','" . addslashes($aobj_context->mobj_data["is_lov"])."','" . addslashes($aobj_context->mobj_data["is_populate_lov"])."','" . addslashes($aobj_context->mobj_data["user_schema_element_conditional_display"])."','" . addslashes($aobj_context->mobj_data["is_read_only"]) ."',{$is_unique},'{$include_in_pop_up}','{$include_in_grid}', '{$is_key_field}','{$on_enter}','{$on_exit}','{$grid_width}',{$text_area_rows})"; $lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry); UpdateDbField($aobj_context,$schema_id); $select_max_seq="select round(ifnull(max(sequence),0)+1) as sequence from s_user_schema_elements where ref_s_user_schema_code=".$aobj_context->mobj_data["elemenmt_user_schema"]." and ref_s_user_schema_group_code=".$aobj_context->mobj_data["elemenmt_user_schema_group"]; $lobj_select_max_seq = $aobj_context->mobj_db->GetRow($select_max_seq); $max_seq=$lobj_select_max_seq["sequence"]; $last_inserted_id = $aobj_context->mobj_db->Insert_ID(); //to check whether elements belongs to multiple group $decml = $aobj_context->mobj_data["decimal"]+12; $is_visible=$aobj_context->mobj_data["is_visible"]; $is_group="select if(multiple=1,CONCAT('user_schema_',sus.INTERNAL_CODE,'_group_',susg.internal_code), CONCAT('user_schema_',sus.INTERNAL_CODE,'_group_',susg.parent_group_code)) as table_name, case when s.value='Text' then 'varchar(500)' when s.value='List Of Values' then 'varchar(50)' when s.value='Reference Data' then 'int(11)' when s.value ='Number' and {$decml}>12 then 'decimal(".$decml.",".$aobj_context->mobj_data["decimal"].")' when s.value ='Number' and {$decml}=12 then 'int(11)' when s.value ='Date' then 'date' when s.value='Month' then 'int(6)' when s.value='Image' then 'varchar(250)' else 'text' end as data_type from s_user_schema_elements suse inner join s_user_schema_group susg on susg.internal_code=suse.ref_s_user_schema_group_code inner join s_user_schema sus on sus.internal_code=susg.ref_s_user_schema_code inner join s_ref_type s1 on s1.internal_code=suse.s_ref_type_meta and s1.value='Meta' left join s_ref_type s on s.internal_code=suse.data_type where suse.internal_code=". $last_inserted_id ." and ((multiple=1) or (multiple=0 and parent_group_code<>0) )"; $lobj_rs_group = $aobj_context->mobj_db->GetRow($is_group); // if count of Group is greater than one the alter the table if(count($lobj_rs_group['table_name'])>0) { $table_count="show tables like '".$lobj_rs_group['table_name']."'"; $lobj_rs_table_count = $aobj_context->mobj_db->GetRow($table_count); if(count($lobj_rs_table_count)>0) { $ref_s_user_schema_group_code=$aobj_context->mobj_data["elemenmt_user_schema_group"]; // it will insert into corresponding filds $getafterId="select max(suse.internal_code) as max_id from s_user_schema_elements suse inner join s_user_schema_group sg on sg.internal_code=suse.ref_s_user_schema_group_code inner join s_ref_type t on t.internal_code=suse.s_ref_type_meta where suse.ref_s_user_schema_code={$aobj_context->mobj_data["elemenmt_user_schema"]} and suse.internal_code<{$last_inserted_id} and sg.internal_code={$group_id} and t.value='meta' and (sg.internal_code={$ref_s_user_schema_group_code} or sg.parent_group_code={$ref_s_user_schema_group_code})"; $lobj_getafterId = $aobj_context->mobj_db->GetRow($getafterId); $after=(!is_null($lobj_getafterId['max_id']))?"u_".$aobj_context->mobj_data["elemenmt_user_schema"]."_g_".$aobj_context->mobj_data["elemenmt_user_schema_group"]."_ele_".$lobj_getafterId["max_id"]:" ref_s_ref_data_code"; foreach ($lobj_rs_table_count as $key=>$value) { $select_db_field="select db_field from s_user_schema_elements where internal_code={$last_inserted_id} "; $lobj_select_db_field = $aobj_context->mobj_db->GetRow($select_db_field); $field_id=$lobj_select_db_field['db_field']; $alter_qr="alter table ". $value ." add {$field_id} ".$lobj_rs_group['data_type']." after " .$after ; $lobj_rs = $aobj_context->mobj_db->Execute($alter_qr); // for Inserting Entry Group Table STARTS $group_entry_table=str_ireplace("group","entry",$value); $alter_e_qr="alter table ". $group_entry_table ." add {$field_id} ".$lobj_rs_group['data_type']." after " .$after ; $lobj_alter_e_qr = $aobj_context->mobj_db->Execute($alter_e_qr); // for Inserting Entry Group Table ENDS if($is_unique=='1') { $create_idx="CREATE UNIQUE INDEX indx_{$field_id} ON {$value}(ref_s_ref_data_code,{$field_id}) "; //echo $create_idx; $lobj_create_idx = $aobj_context->mobj_db->Execute($create_idx); } } } } //to check element belong to meta if($lobj_select_id['value']=='Meta' && $lobj_get_group_multiple['count']==0) { $is_group="select CONCAT('module_',sus.INTERNAL_CODE) as table_name, case when s.value='Text' then 'varchar(500)' when s.value='List Of Values' then 'varchar(50)' when s.value='Reference Data' then 'int(11)' when s.value ='Number' and {$decml}>12 then 'decimal(".$decml.",".$aobj_context->mobj_data["decimal"].")' when s.value ='Number' and {$decml}=12 then 'int(11)' when s.value ='Date' then 'date' when s.value='Month' then 'int(6)' when s.value='Image' then 'varchar(250)' else 'text' end as data_type from s_user_schema_elements suse inner join s_user_schema sus on sus.internal_code=suse.ref_s_user_schema_code left join s_ref_type s on s.internal_code=suse.data_type inner join s_ref_type s1 on s1.internal_code=suse.s_ref_type_meta where suse.internal_code=". $last_inserted_id ." and s1.value='Meta'"; $lobj_rs_group = $aobj_context->mobj_db->GetRow($is_group); //echo 'count'.count($lobj_rs_group['table_name']); // if count of Group is greater than one the alter the table if(count($lobj_rs_group['table_name'])>0) { // it will insert into corresponding filds $getafterId="select max(s.internal_code) as max_id from s_user_schema_elements s inner join s_ref_type t on t.internal_code=s_ref_type_meta where ref_s_user_schema_code={$aobj_context->mobj_data["elemenmt_user_schema"]} and s.internal_code<{$last_inserted_id} and is_multiple_group=0 and t.value='meta'"; $lobj_getafterId = $aobj_context->mobj_db->GetRow($getafterId); $after=(!is_null($lobj_getafterId['max_id']))?"m_".$aobj_context->mobj_data["elemenmt_user_schema"]."_ele_".$lobj_getafterId["max_id"]:" ref_s_user_schema_code"; $table_count="show tables like '".$lobj_rs_group['table_name']."'"; $lobj_rs_table_count = $aobj_context->mobj_db->GetRow($table_count); if(count($lobj_rs_table_count)>0) { foreach ($lobj_rs_table_count as $key=>$value) { $meta_field_id="m_".$aobj_context->mobj_data["elemenmt_user_schema"]."_ele_".$last_inserted_id; $alter_qr="alter table ". $value ." add {$meta_field_id} ".$lobj_rs_group['data_type'] ." after ".$after; $lobj_rs = $aobj_context->mobj_db->Execute($alter_qr); if($is_unique=='1') { $create_idx="CREATE UNIQUE INDEX indx_{$meta_field_id} ON {$value}({$meta_field_id}) "; $lobj_create_idx = $aobj_context->mobj_db->Execute($create_idx); } } } } } //to create the file for each group //include(dirname(__FILE__)."\create_file.php"); $aobj_context->mobj_data["schema_id"]=$schema_id; include(dirname(__FILE__)."/create_all_grid_files.php"); populateAllGridFiles($aobj_context); include(dirname(__FILE__)."/create_module_meta_columns.php"); createModuleMetaColumns($aobj_context); //include(dirname(__FILE__)."\create_group_file.php"); include_once(dirname(__FILE__)."/create_all_grid_group_files.php"); populateAllGridGroupFiles($aobj_context); include(dirname(__FILE__)."/create_html_files.php"); CreateModuleHtmlFiles($aobj_context); include(dirname(__FILE__)."/create_all_popup_files.php"); populateAllPopupGridFiles($aobj_context); include(dirname(__FILE__)."/create_all_views.php"); CreateView($aobj_context); include(dirname(__FILE__)."/update_defined_flag.php"); UpdateDefinedFlag($aobj_context); fclose($handle); if($lobj_rs) { $rdata[0] = "Element Name inserted successfully."; $rdata[1] = $max_seq; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); return $rdata; } else { $rdata[0] = "insertion Failed."; $rdata[1] = $max_seq; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure")); return $rdata; } } else { $rdata[0] = "System Name Already Exstis!"; $rdata[1] = $max_seq; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); return $rdata; } } else { //to updATE THE s_group_table $decml = $aobj_context->mobj_data["decimal"]+12; $update_field="select CONCAT('user_schema_',sus.INTERNAL_CODE,'_group_',susg.internal_code) as table_name,concat('u_',sus.internal_code,'_g_',susg.internal_code,'_ele_',suse.internal_code) as field_name, case when s.value='Text' then 'varchar(500)' when s.value='List Of Values' then 'varchar(50)' when s.value='Reference Data' then 'int(11)' when s.value ='Number' and {$decml}>12 then 'decimal(".$decml.",".$aobj_context->mobj_data["decimal"].")' when s.value ='Number' and {$decml}=12 then 'int(11)' when s.value ='Date' then 'date' when s.value='Month' then 'int(6)' when s.value='Image' then 'varchar(250)' else 'text' end as data_type,s.internal_code as data_type_code,susg.internal_code as group_code from s_user_schema_elements suse inner join s_user_schema_group susg on susg.internal_code=suse.ref_s_user_schema_group_code inner join s_user_schema sus on sus.internal_code=susg.ref_s_user_schema_code left join s_ref_type s on s.internal_code=suse.data_type where suse.internal_code=".$aobj_context->mobj_data["internal_code"]." and multiple=1"; $lobj_rs_alter_field = $aobj_context->mobj_db->GetRow($update_field); // to make is unique to set for group elemens if unique=1 if($is_unique=='1') { $alt_drop_indx="ALTER TABLE ". $lobj_rs_alter_field["table_name"]." drop INDEX indx_".$lobj_rs_alter_field["field_name"]; $lobj_alt_drop_indx = $aobj_context->mobj_db->Execute($alt_drop_indx); $alt_add_indx="ALTER TABLE ". $lobj_rs_alter_field["table_name"]." add UNIQUE INDEX indx_".$lobj_rs_alter_field["field_name"] ."(ref_s_ref_data_code,".$lobj_rs_alter_field["field_name"].")"; $lobj_alt_add_indx = $aobj_context->mobj_db->Execute($alt_add_indx); } // to check updated group name is same as db group name and data type has been changed if($lobj_rs_alter_field["group_code"]==$aobj_context->mobj_data["elemenmt_user_schema_group"] && $lobj_rs_alter_field["data_type_code"]!=$aobj_context->mobj_data["user_schema_element_type"] ) { $table_count="show tables like '".$lobj_rs_alter_field['table_name']."'"; $lobj_rs_table_count = $aobj_context->mobj_db->GetRow($table_count); if(count($lobj_rs_table_count)>0) { $desc_qry="desc ". $lobj_rs_alter_field['table_name']; //echo $desc_qry; $obj_desc=$aobj_context->mobj_db->GetAll($desc_qry); foreach ($obj_desc as $key=>$value) //to check whether table has secific fied name if($value['Field']==$lobj_rs_alter_field["field_name"]) { $get_data_type="select case when s.value='Text' then 'varchar(500)' when s.value='List Of Values' then 'varchar(50)' when s.value='Reference Data' then 'int(11)' when s.value ='Number' and {$decml}>12 then 'decimal(".$decml.",".$aobj_context->mobj_data["decimal"].")' when s.value ='Number' and {$decml}=12 then 'int(11)' when s.value ='Date' then 'date' when s.value='Month' then 'int(6)' when s.value='Image' then 'varchar(250)' else 'text' end as data_type from s_ref_type s where internal_code=".$aobj_context->mobj_data["user_schema_element_type"]; //echo $get_data_type; $get_data_type_for_update=$aobj_context->mobj_db->GetRow($get_data_type); $update_field_row="alter table ".$lobj_rs_alter_field["table_name"]." change ".$lobj_rs_alter_field["field_name"]." ". $lobj_rs_alter_field["field_name"]." ".$get_data_type_for_update["data_type"]; $lobj_rs = $aobj_context->mobj_db->Execute($update_field_row); // for Inserting Entry Group Table STARTS $entry_group_table=str_ireplace("group","entry",$lobj_rs_alter_field["table_name"]); $update_entry_field_row="alter table {$entry_group_table} change ".$lobj_rs_alter_field["field_name"]." ". $lobj_rs_alter_field["field_name"]." ".$get_data_type_for_update["data_type"]; $lobj_update_entry_field_row = $aobj_context->mobj_db->Execute($update_entry_field_row); // for Inserting Entry Group Table ENDS $alt_drop_indx="ALTER TABLE ". $lobj_rs_alter_field["table_name"]." drop INDEX indx_".$lobj_rs_alter_field["field_name"]; $lobj_alt_drop_indx = $aobj_context->mobj_db->Execute($alt_drop_indx); if($is_unique=='1') { $alt_add_indx="ALTER TABLE ". $lobj_rs_alter_field["table_name"]." add UNIQUE INDEX indx_".$lobj_rs_alter_field["field_name"] ."(ref_s_ref_data_code,".$lobj_rs_alter_field["field_name"].")"; $lobj_alt_add_indx = $aobj_context->mobj_db->Execute($alt_add_indx); } } } } // If users changes the Exsting Multi Group to None else if($aobj_context->mobj_data["elemenmt_user_schema_group"]==0 && $lobj_rs_alter_field["group_code"]>0) { if(count($lobj_rs_alter_field['table_name'])>0) { $table_count="show tables like '".$lobj_rs_alter_field['table_name']."'"; $lobj_rs_table_count = $aobj_context->mobj_db->GetRow($table_count); if(count($lobj_rs_table_count)>0) { foreach ($lobj_rs_table_count as $key=>$value) { $alter_qr="alter table ". $value ." drop ".$lobj_rs_alter_field['field_name'] ; $lobj_rs_drop = $aobj_context->mobj_db->Execute($alter_qr); $alt_drop_indx="ALTER TABLE ". $value." drop INDEX indx_".$lobj_rs_alter_field["field_name"]; $lobj_alt_drop_indx = $aobj_context->mobj_db->Execute($alt_drop_indx); if($is_unique=='1') { $alt_add_indx="ALTER TABLE ". $value." add UNIQUE INDEX indx_".$lobj_rs_alter_field["field_name"] ."(ref_s_ref_data_code,".$lobj_rs_alter_field["field_name"].")"; $lobj_alt_add_indx = $aobj_context->mobj_db->Execute($alt_add_indx); } } } } }//if user changs one group name to other grup name need to delete the exsting group field and insert new field in selected group else if($aobj_context->mobj_data["elemenmt_user_schema_group"]!= $lobj_rs_alter_field["group_code"] && $aobj_context->mobj_data["elemenmt_user_schema_group"]!=0) { if(count($lobj_rs_alter_field['table_name'])>0) { $table_count="show tables like '".$lobj_rs_alter_field['table_name']."'"; $lobj_rs_table_count = $aobj_context->mobj_db->GetRow($table_count); if(count($lobj_rs_table_count)>0) { foreach ($lobj_rs_table_count as $key=>$value) $alter_qr="alter table ". $value ." drop ".$lobj_rs_alter_field['field_name'] ; $lobj_rs_drop = $aobj_context->mobj_db->Execute($alter_qr); $alt_drop_indx="ALTER TABLE ". $value." drop INDEX indx_".$lobj_rs_alter_field["field_name"]; $lobj_alt_drop_indx = $aobj_context->mobj_db->Execute($alt_drop_indx); if($is_unique=='1') { $alt_add_indx="ALTER TABLE ". $value." add UNIQUE INDEX indx_".$lobj_rs_alter_field["field_name"]."(ref_s_ref_data_code,".$lobj_rs_alter_field["field_name"].")"; $lobj_alt_add_indx = $aobj_context->mobj_db->Execute($alt_add_indx); } } } //to get new grup name $new_group_qry="select concat('user_schema_',ref_s_user_schema_code,'_group_',internal_code) as table_name from s_user_schema_group where multiple=1 and internal_code=".$aobj_context->mobj_data["elemenmt_user_schema_group"]; $get_new_group_qry=$aobj_context->mobj_db->GetRow($new_group_qry); //to get new data type for that element $get_data_type="select case when s.value='Text' then 'varchar(500)' when s.value='List Of Values' then 'varchar(50)' when s.value='Reference Data' then 'int(11)' when s.value ='Number' and {$decml}>12 then 'decimal(".$decml.",".$aobj_context->mobj_data["decimal"].")' when s.value ='Number' and {$decml}=12 then 'int(11)' when s.value ='Date' then 'date' when s.value='Month' then 'int(6)' when s.value='Image' then 'varchar(250)' else 'text' end as data_type from s_ref_type s where internal_code=".$aobj_context->mobj_data["user_schema_element_type"]; //echo $get_data_type; $get_data_type_for_update=$aobj_context->mobj_db->GetRow($get_data_type); $getafterId="select max(internal_code) as max_id from s_user_schema_elements where ref_s_user_schema_code={$aobj_context->mobj_data["elemenmt_user_schema"]} and internal_code<".$aobj_context->mobj_data["internal_code"]." and is_multiple_group=1 and ref_s_user_schema_group_code=".$aobj_context->mobj_data["elemenmt_user_schema_group"]; $lobj_getafterId = $aobj_context->mobj_db->GetRow($getafterId); $after=(!is_null($lobj_getafterId['max_id']))?"u_".$aobj_context->mobj_data["elemenmt_user_schema"]."_g_".$aobj_context->mobj_data["elemenmt_user_schema_group"]."_ele_".$lobj_getafterId["max_id"]:" ref_s_ref_data_code"; //to alter the new field name $update_field_row="alter table ".$get_new_group_qry["table_name"]." add u_".$aobj_context->mobj_data["elemenmt_user_schema"]."_g_".$aobj_context->mobj_data["elemenmt_user_schema_group"]."_ele_".$aobj_context->mobj_data["internal_code"]." ".$get_data_type_for_update['data_type'] ." after " .$after; // echo $update_field_row; $alter_lobj_rs = $aobj_context->mobj_db->Execute($update_field_row); $alt_drop_indx="ALTER TABLE ".$get_new_group_qry["table_name"]." drop INDEX indx_u_".$aobj_context->mobj_data["elemenmt_user_schema"]."_g_".$aobj_context->mobj_data["elemenmt_user_schema_group"]."_ele_".$aobj_context->mobj_data["internal_code"]; $lobj_alt_drop_indx = $aobj_context->mobj_db->Execute($alt_drop_indx); if($is_unique=='1') { $f_id=$aobj_context->mobj_data["elemenmt_user_schema"]."_g_".$aobj_context->mobj_data["elemenmt_user_schema_group"]."_ele_".$aobj_context->mobj_data["internal_code"]; $alt_add_indx="ALTER TABLE ". $get_new_group_qry["table_name"]." add UNIQUE INDEX indx_{$f_id} (ref_s_ref_data_code,{$f_id}) "; $lobj_alt_add_indx = $aobj_context->mobj_db->Execute($alt_add_indx); } } $select_id="select value from s_ref_type where internal_code=".addslashes($aobj_context->mobj_data["meta_type"]); $lobj_select_id = $aobj_context->mobj_db->GetRow($select_id); //if users updates Type from Meta to Users then drop the Exsting Meta Field from Corresponing Table if($lobj_select_id['value']=='User') { $is_group="select CONCAT('module_',sus.INTERNAL_CODE) as table_name,CONCAT('m_',sus.INTERNAL_CODE,'_ele_',".$aobj_context->mobj_data["internal_code"].") as field_name, case when s.value='Text' then 'varchar(500)' when s.value='List Of Values' then 'varchar(50)' when s.value='Reference Data' then 'int(11)' when s.value ='Number' and {$decml}>12 then 'decimal(".$decml.",".$aobj_context->mobj_data["decimal"].")' when s.value ='Number' and {$decml}=12 then 'int(11)' when s.value ='Date' then 'date' when s.value='Month' then 'int(6)' when s.value='Image' then 'varchar(250)' else 'text' end as data_type from s_user_schema_elements suse inner join s_user_schema sus on sus.internal_code=suse.ref_s_user_schema_code left join s_ref_type s on s.internal_code=suse.data_type inner join s_ref_type s1 on s1.internal_code=suse.s_ref_type_meta where suse.internal_code=". $aobj_context->mobj_data["internal_code"] ." and s1.value='Meta'"; //echo $is_group; $lobj_rs_group = $aobj_context->mobj_db->GetRow($is_group); //echo $is_group; //echo 'count'.count($lobj_rs_group['table_name']); // if count of Group is greater than one the alter the table if(!empty($lobj_rs_group['table_name'])) { $table_count="show tables like '".$lobj_rs_group['table_name']."'"; $lobj_rs_table_count = $aobj_context->mobj_db->GetRow($table_count); if(!empty($lobj_rs_table_count)) { foreach ($lobj_rs_table_count as $key=>$value) $alter_qr="alter table ". $value ." drop ".$lobj_rs_group['field_name'] ; $lobj_rs_drop = $aobj_context->mobj_db->Execute($alter_qr); $alt_drop_indx="ALTER TABLE ". $value." drop INDEX indx_".$lobj_rs_group["field_name"]; $lobj_alt_drop_indx = $aobj_context->mobj_db->Execute($alt_drop_indx); if($is_unique=='1') { $alt_add_indx="ALTER TABLE ". $value." add UNIQUE INDEX indx_".$lobj_rs_group["field_name"]."(".$lobj_rs_group["field_name"].")"; $lobj_alt_add_indx = $aobj_context->mobj_db->Execute($alt_add_indx); } } } } //if users updates Type from Users to Meta need to insert new column in field if($lobj_select_id['value']=='Meta' && $lobj_get_group_multiple['count']==0) { $is_group="select CONCAT('module_',sus.INTERNAL_CODE) as table_name,CONCAT('m_',sus.INTERNAL_CODE,'_ele_',".$aobj_context->mobj_data["internal_code"].") as field_name, case when s.value='Text' then 'varchar(500)' when s.value='List Of Values' then 'varchar(50)' when s.value='Reference Data' then 'int(11)' when s.value ='Number' and {$decml}>12 then 'decimal(".$decml.",".$aobj_context->mobj_data["decimal"].")' when s.value ='Number' and {$decml}=12 then 'int(11)' when s.value ='Date' then 'date' when s.value='Month' then 'int(6)' when s.value='Image' then 'varchar(250)' else 'text' end as data_type from s_user_schema_elements suse inner join s_user_schema sus on sus.internal_code=suse.ref_s_user_schema_code left join s_ref_type s on s.internal_code=suse.data_type inner join s_ref_type s1 on s1.internal_code=suse.s_ref_type_meta where suse.internal_code=". $aobj_context->mobj_data["internal_code"] ." and s1.value='User'"; //echo $is_group; $lobj_rs_group = $aobj_context->mobj_db->GetRow($is_group); if(!empty($lobj_rs_group['table_name'])) { $table_count="show tables like '".$lobj_rs_group['table_name']."'"; $lobj_rs_table_count = $aobj_context->mobj_db->GetRow($table_count); if(!empty($lobj_rs_table_count)) { $getafterId="select max(s.internal_code) as max_id from s_user_schema_elements s inner join s_ref_type t on t.internal_code=s_ref_type_meta where ref_s_user_schema_code={$aobj_context->mobj_data["elemenmt_user_schema"]} and s.internal_code<". $aobj_context->mobj_data["internal_code"]." and is_multiple_group=0 and t.value='meta'"; $lobj_getafterId = $aobj_context->mobj_db->GetRow($getafterId); $after=(!is_null($lobj_getafterId['max_id']))?"m_".$aobj_context->mobj_data["elemenmt_user_schema"]."_ele_".$lobj_getafterId["max_id"]:" ref_s_user_schema_code"; foreach ($lobj_rs_table_count as $key=>$value) $alter_qr="alter table ". $value ." add ".$lobj_rs_group['field_name']." ".$lobj_rs_group['data_type'] ." after ".$after ; $lobj_rs_drop = $aobj_context->mobj_db->Execute($alter_qr); } } } $decml = $aobj_context->mobj_data["decimal"]+12; //if element type is META and user changes data type from int->date etc....need to alter the table by droping the exsting field and insert new field $check_data_type="select is_unique,data_type,s.value,concat('module_',ref_s_user_schema_code) as table_name, concat('m_',ref_s_user_schema_code,'_ele_',suse.internal_code) as field_name,data_type from s_user_schema_elements suse inner join s_ref_type s on s.internal_code=s_ref_type_meta where suse.internal_code=".$aobj_context->mobj_data["internal_code"]; $lobj_check_data_type = $aobj_context->mobj_db->GetRow($check_data_type); if(($lobj_check_data_type['value']=='Meta' && $lobj_check_data_type['data_type'] != $aobj_context->mobj_data["user_schema_element_type"]) || ($lobj_check_data_type['is_unique'] != $aobj_context->mobj_data["is_unique"]) ) { $table_count="show tables like '".$lobj_check_data_type['table_name']."'"; $lobj_rs_table_count = $aobj_context->mobj_db->GetRow($table_count); if(count($lobj_rs_table_count)>0) { $desc_qry="desc ". $lobj_check_data_type['table_name']; //echo $desc_qry; $obj_desc=$aobj_context->mobj_db->GetAll($desc_qry); foreach ($obj_desc as $key=>$value) { //to check whether table has secific fied name if($value['Field']==$lobj_check_data_type["field_name"]) { $get_data_type="select case when s.value='Text' then 'varchar(500)' when s.value='List Of Values' then 'varchar(50)' when s.value='Reference Data' then 'int(11)' when s.value ='Number' and {$decml}>12 then 'decimal(".$decml.",".$aobj_context->mobj_data["decimal"].")' when s.value ='Number' and {$decml}=12 then 'int(11)' when s.value ='Date' then 'date' when s.value='Month' then 'int(6)' when s.value='Image' then 'varchar(250)' else 'text' end as data_type from s_ref_type s where internal_code=".$aobj_context->mobj_data["user_schema_element_type"]; //echo $get_data_type; $get_data_type_for_update=$aobj_context->mobj_db->GetRow($get_data_type); $update_field_row="alter table ".$lobj_check_data_type["table_name"]." change ".$lobj_check_data_type["field_name"]." ". $lobj_check_data_type["field_name"]." ".$get_data_type_for_update["data_type"]; $lobj_rs = $aobj_context->mobj_db->Execute($update_field_row); $alt_drop_indx="ALTER TABLE ".$lobj_check_data_type["table_name"]." drop INDEX indx_".$lobj_check_data_type["field_name"]; $lobj_alt_drop_indx = $aobj_context->mobj_db->Execute($alt_drop_indx); if($is_unique=='1') { $alt_add_indx="ALTER TABLE ". $lobj_check_data_type["table_name"]." add UNIQUE INDEX indx_".$lobj_check_data_type["field_name"] ."(".$lobj_check_data_type["field_name"].")"; $lobj_alt_add_indx = $aobj_context->mobj_db->Execute($alt_add_indx); } } } } } //to insert the linked fields table id $insert_linked_table="select ref_module_code from s_user_schema_elements where internal_code=".$aobj_context->mobj_data["linked_field"]; $lobj_inked_table = $aobj_context->mobj_db->GetRow($insert_linked_table); if(!empty($lobj_inked_table)) $lobj_inked_table_id=$insert_linked_table['ref_module_code']; else $lobj_inked_table_id=0; $lstr_qry = "update s_user_schema_elements set ref_s_user_schema_code='". trim($aobj_context->mobj_data["elemenmt_user_schema"]) ."',". "name='".stripcslashes($aobj_context->mobj_data["user_schema_element_name"]) ."',". "system_name='".stripcslashes($aobj_context->mobj_data["user_schema_system_name"]) ."',". "data_type='".addslashes($aobj_context->mobj_data["user_schema_element_type"]) ."',". "sequence='".addslashes($aobj_context->mobj_data["user_schema_element_sequence"]) ."',". "field_position='".addslashes($aobj_context->mobj_data["user_schema_element_field_position"]) ."',". "ref_s_user_schema_group_code='".addslashes($aobj_context->mobj_data["elemenmt_user_schema_group"]) ."',". "description='".addslashes($aobj_context->mobj_data["user_schema_element_description"]) ."',". "default_value='".addslashes($aobj_context->mobj_data["user_schema_element_default_value"]) ."',". "optional='".$aobj_context->mobj_data["is_user_schema_element_optional"] ."', list_of_values='".addslashes($aobj_context->mobj_data["lov"])."', linked_field='".addslashes($aobj_context->mobj_data["linked_field"])."', source_field='".addslashes($aobj_context->mobj_data["source_fields"])."', suffix='".addslashes($aobj_context->mobj_data["suffix"])."', width='".addslashes($aobj_context->mobj_data["width"])."', padding='".addslashes($aobj_context->mobj_data["padding"])."', is_read_only='".addslashes($aobj_context->mobj_data["is_read_only"])."', is_unique={$is_unique},include_in_popup={$include_in_pop_up}, linked_field_table='".$lobj_inked_table_id."', is_visible='".$aobj_context->mobj_data["is_visible"]."', is_ref_module_code_lov='".$aobj_context->mobj_data["is_lov"]."', populate_lov='".$aobj_context->mobj_data["is_populate_lov"]."', conditional_display='".$aobj_context->mobj_data["user_schema_element_conditional_display"]."', on_enter='{$on_enter}',on_exit='{$on_exit}',is_key_field={$is_key_field},include_in_grid={$include_in_grid}, ref_module_code_ref_field='{$ref_module_code_ref_field}', ref_module_code_ref_field_on='{$ref_module_code_ref_field_on}', ref_module_code_ref_field_const='{$ref_module_code_ref_field_const}', decimals =". addslashes($aobj_context->mobj_data["decimal"]).",ref_module_code=". addslashes($aobj_context->mobj_data["ref_module_code"]).", s_ref_type_meta=".addslashes($aobj_context->mobj_data["meta_type"]).", is_multiple_group={$is_multiple_group}".", grid_width={$grid_width},text_area_rows={$text_area_rows} where internal_code =".$aobj_context->mobj_data["internal_code"]; $lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry); // to update the db_value dec-1-2008 $update_db_value=" update s_user_schema_elements suse, (select suse.internal_code as db_field_ic_code, case when t.value in('User','Meta') and ref_s_user_schema_group_code>0 and (is_multiple_group=1 or ug.parent_group_code<>0) then if(suse.is_multiple_group=1, concat('u_',suse.ref_s_user_schema_code,'_g_',ref_s_user_schema_group_code,'_ele_',suse.internal_code), concat('u_',suse.ref_s_user_schema_code,'_g_',ug.parent_group_code,'_ele_',suse.internal_code) ) when t.value='Meta' and ref_s_user_schema_group_code=0 then concat('m_',suse.ref_s_user_schema_code,'_ele_',suse.internal_code) when t.value='Meta' and ref_s_user_schema_group_code>0 and is_multiple_group=0 then concat('m_',suse.ref_s_user_schema_code,'_ele_',suse.internal_code) else '' end as db_fields_s_user_schema_elements from s_user_schema_elements suse left join s_user_schema_group ug on ug.internal_code=ref_s_user_schema_group_code inner join s_ref_type t on t.internal_code=s_ref_type_meta where suse.ref_s_user_schema_code={$schema_id} ) a set db_field=db_fields_s_user_schema_elements where db_field_ic_code=suse.internal_code"; $lobj_rs_update_db_value = $aobj_context->mobj_db->Execute($update_db_value); } $aobj_context->mobj_data["schema_id"]=$schema_id; include_once(dirname(__FILE__)."/create_all_grid_files.php"); populateAllGridFiles($aobj_context); include(dirname(__FILE__)."/create_module_meta_columns.php"); createModuleMetaColumns($aobj_context); include(dirname(__FILE__)."/create_all_grid_group_files.php"); populateAllGridGroupFiles($aobj_context); include(dirname(__FILE__)."/create_html_files.php"); CreateModuleHtmlFiles($aobj_context); include(dirname(__FILE__)."/create_all_popup_files.php"); populateAllPopupGridFiles($aobj_context); include(dirname(__FILE__)."/update_defined_flag.php"); UpdateDefinedFlag($aobj_context); if($lobj_rs) { $rdata[0] = "Updated Successfully."; $rdata[1] = $max_seq; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); return; } else { $rdata[0] = "Udatation Failed."; $rdata[1] = $max_seq; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure")); } } function UpdateDbField($aobj_context,$schema_id) { $update_db_value=" update s_user_schema_elements suse, (select suse.internal_code as db_field_ic_code, case when t.value in('User','Meta') and ref_s_user_schema_group_code>0 and (is_multiple_group=1 or ug.parent_group_code<>0) then if(suse.is_multiple_group=1, concat('u_',suse.ref_s_user_schema_code,'_g_',ref_s_user_schema_group_code,'_ele_',suse.internal_code), concat('u_',suse.ref_s_user_schema_code,'_g_',ug.parent_group_code,'_ele_',suse.internal_code) ) when t.value='Meta' and ref_s_user_schema_group_code=0 then concat('m_',suse.ref_s_user_schema_code,'_ele_',suse.internal_code) when t.value='Meta' and ref_s_user_schema_group_code>0 and is_multiple_group=0 then concat('m_',suse.ref_s_user_schema_code,'_ele_',suse.internal_code) else '' end as db_fields_s_user_schema_elements from s_user_schema_elements suse left join s_user_schema_group ug on ug.internal_code=ref_s_user_schema_group_code inner join s_ref_type t on t.internal_code=s_ref_type_meta where suse.ref_s_user_schema_code={$schema_id} ) a set db_field=db_fields_s_user_schema_elements where db_field_ic_code=suse.internal_code"; $lobj_rs_update_db_value = $aobj_context->mobj_db->Execute($update_db_value); } function updateUserSchemaElementDbField($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $update_db_value=" update s_user_schema_elements suse, (select suse.internal_code as db_field_ic_code, case when t.value in('User','Meta') and ref_s_user_schema_group_code>0 and (is_multiple_group=1 or ug.parent_group_code<>0) then if(suse.is_multiple_group=1, concat('u_',suse.ref_s_user_schema_code,'_g_',ref_s_user_schema_group_code,'_ele_',suse.internal_code), concat('u_',suse.ref_s_user_schema_code,'_g_',ug.parent_group_code,'_ele_',suse.internal_code) ) when t.value='Meta' and ref_s_user_schema_group_code=0 then concat('m_',suse.ref_s_user_schema_code,'_ele_',suse.internal_code) when t.value='Meta' and ref_s_user_schema_group_code>0 and is_multiple_group=0 then concat('m_',suse.ref_s_user_schema_code,'_ele_',suse.internal_code) else '' end as db_fields_s_user_schema_elements from s_user_schema_elements suse left join s_user_schema_group ug on ug.internal_code=ref_s_user_schema_group_code inner join s_ref_type t on t.internal_code=s_ref_type_meta #where suse.ref_s_user_schema_code={$schema_id} ) a set db_field=db_fields_s_user_schema_elements where db_field_ic_code=suse.internal_code"; $lobj_rs_update_db_value = $aobj_context->mobj_db->Execute($update_db_value); $rdata = "Udatation Done."; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"Success")); } function GetUserSchemaElementsRefModuleFilterDetails($aobj_context) { $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $schema_id=$aobj_context->mobj_data["schema_id"]; $ref_module_code =$aobj_context->mobj_data["ref_module_code"]; $select_ref_module_field_names="select internal_code,name from s_user_schema_elements where ref_s_user_schema_code={$ref_module_code}"; $lobj_select_ref_module_field_names = $aobj_context->mobj_db->GetAll($select_ref_module_field_names); $select_schema_field_names="select internal_code,name from s_user_schema_elements where ref_s_user_schema_code={$schema_id}"; $lobj_select_schema_field_names = $aobj_context->mobj_db->GetAll($select_schema_field_names); $rdata['ref_module_fields']=$lobj_select_ref_module_field_names; $rdata['schema_fields']=$lobj_select_schema_field_names; print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success")); } ?>
Close