-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.php
173 lines (143 loc) · 4.5 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
/**
* Configuration of Website.
* php version 8.1
*
* @category Configuration
*
* @package None
*
* @author Waqas Ahmad <waqaskanju@gmail.com>
*
* @license http://www.abc.com MIT
*
* @link Adfas
**/
require_once 'sand_box.php';
require_once 'functions.php';
$link=$LINK;
// if user is logged in get his Id otherwise get Id of guest user.
if (isset($_SESSION['user'])) {
$account_id=$_SESSION['user'];
$account_id=Validate_input($account_id);
} else {
$guest=Select_Single_Column_Array_data(
"Id", "employees", "Name", "'Guest'"
);
//add an account
$account_id=$guest[0];
}
//Select school id from setting page of current user.
$selected_school_id_array=Select_Single_Column_Array_data(
"Selected_School_Id", "setting", "User_Id", "$account_id"
);
// As the result is arrray we need only one school.
$selected_school_id=$selected_school_id_array[0];
// Convert school_id to school_name
$school_names=Select_Single_Column_Array_data(
"Name", "schools", "Id", "$selected_school_id"
);
// Select class id from setting page. used at the time of student insertion.
$selected_class_id_array=Select_Single_Column_Array_data(
"Selected_Class_Id", "setting", "User_Id", "$account_id"
);
// As the data is array we need only one class id
$selected_class_id=$selected_class_id_array[0];
// Covert class_id to class_name
$class_names=Select_Single_Column_Array_data(
"Name", "school_classes", "Id", "$selected_class_id"
);
//print_r($class_names);
// Select username array
$user=Select_Single_Column_Array_data(
"Name", "employees", "Id", "$account_id"
);
//Select single username from Array.
$user_name=$user[0];
$designation=Select_Single_Column_Array_data(
"Designation", "employees", "Id", "$account_id"
);
//Permissions
// Student Changes Permission.
$student_changes_mode=Select_Single_Column_Array_data(
"Student_Changes", "setting", "User_Id", "$account_id"
);
$STUDENT_CHANGES=$student_changes_mode[0];
// Batch Marks Changes Permission.
$batch_marks_changes_mode=Select_Single_Column_Array_data(
"Batch_Marks_Changes", "setting", "User_Id", "$account_id"
);
$BATCH_MARKS_CHANGES=$batch_marks_changes_mode[0];
// Single Marks Change Permission.
$single_marks_changes_mode=Select_Single_Column_Array_data(
"Single_Marks_Changes", "setting", "User_Id", "$account_id"
);
$SINGLE_MARKS_CHANGES=$single_marks_changes_mode[0];
// Subject Change Permission.
$subject_changes_mode=Select_Single_Column_Array_data(
"Subject_Changes", "setting", "User_Id", "$account_id"
);
$SUBJECT_CHANGES=$subject_changes_mode[0];
// School Change Permission
$school_changes_mode=Select_Single_Column_Array_data(
"School_Changes", "setting", "User_Id", "$account_id"
);
$SCHOOL_CHANGES=$school_changes_mode[0];
// Marks Lock Changes.
$marks_lock_changes_mode=Select_Single_Column_Array_data(
"Marks_Lock_Changes", "setting", "User_Id", "$account_id"
);
$MARKS_LOCK_CHANGES=$marks_lock_changes_mode[0];
// Permission Changes
$permission_changes_mode=Select_Single_Column_Array_data(
"Permission_Changes", "setting", "User_Id", "$account_id"
);
$PERMISSION_CHANGES=$permission_changes_mode[0];
//Values
$SCHOOL_NAME = $school_names[0];
// 1 Scholl Full Name Abbrevation
// example GHSS Chitor
$msg_value=Select_Single_Column_Array_data(
"Msg", "header_msgs", "Id", "1"
);
$SCHOOL_FULL_NAME_ABV = $msg_value[0];
//2 School Full Name
// Example Government Higher Secondary School
$msg_value=Select_Single_Column_Array_data(
"Msg", "header_msgs", "Id", "2"
);
$SCHOOL_FULL_NAME = $msg_value[0];
//3 School Location
// Chitor Swat
$msg_value=Select_Single_Column_Array_data(
"Msg", "header_msgs", "Id", "3"
);
$SCHOOL_LOCATION = $msg_value[0];
$CLASS_NAME = $class_names[0];
$DESIGNATION=$designation[0];
// 4 Award List Msgs
$msg_value=Select_Single_Column_Array_data(
"Msg", "header_msgs", "Id", "4"
);
$award_list_msg =$msg_value[0];
// 5 Class Result Header
$msg_value=Select_Single_Column_Array_data(
"Msg", "header_msgs", "Id", "5"
);
$class_result_header=$msg_value[0];
// 6 Class wise report header
$msg_value=Select_Single_Column_Array_data(
"Msg", "header_msgs", "Id", "6"
);
$class_wise_report_header=$msg_value[0];
// 7 Header for roll no slip
$msg_value=Select_Single_Column_Array_data(
"Msg", "header_msgs", "Id", "7"
);
$header_for_roll_no_slip=$msg_value[0];
// 8 sub header for roll no slip
$msg_value=Select_Single_Column_Array_data(
"Msg", "header_msgs", "Id", "8"
);
$sub_header_for_roll_no_slip=$msg_value[0];
?>