PluginProbe
School Management System – WPSchoolPress / 2.2.43
School Management System – WPSchoolPress v2.2.43
2.2.48 2.2.47 2.2.46 2.2.45 2.2.44 2.2.43 2.2.42 2.2.41 2.2.40 2.2.39 2.2.38 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 All 103 releases
wpschoolpress / includes / wpsp-studentProfile.php

wpsp-studentProfile.php in School Management System – WPSchoolPress 2.2.43, at includes/wpsp-studentProfile.php

719 lines 47.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (!defined( 'ABSPATH' ) ) exit('No Such File');
2
3 $student_table = $wpdb->prefix."wpsp_student";
4 $class_table = $wpdb->prefix."wpsp_class";
5 $users_table = $wpdb->prefix."users";
6 $sid = intval($_GET['id']);
7 $edit = true;
8 $msg = '';
9 $student_index = '';
10 if( isset($_GET['edit']) && sanitize_text_field($_GET['edit'])=='true' && ($current_user_role=='administrator' || $current_user_role=='teacher' ) && (isset( $_POST['sedit_nonce'] ) && wp_verify_nonce( sanitize_text_field($_POST['sedit_nonce']), 'StudentEdit' ) ) ) {
11 ob_start();
12 wpsp_UpdateStudent();
13 }
14 //$stinfo = $wpdb->get_row("select * from $student_table where wp_usr_id='".esc_sql($sid)."'");
15 $stinfo = $wpdb->get_row($wpdb->prepare("SELECT * FROM $student_table WHERE wp_usr_id = %d",$sid));
16 // print_r($stinfo);
17 if( !empty( $stinfo ) ) {
18 $student_index = $stinfo->sid;
19 $loc_avatar=get_user_meta($sid,'simple_local_avatar',true);
20 $img_url= $loc_avatar ? $loc_avatar['full'] : WPSP_PLUGIN_URL.'img/default_avtar.jpg';
21 $parentid = intval($stinfo->parent_wp_usr_id);
22 if( !empty( $parentid ) ) {
23 $parentInfo = get_user_by( 'id', $parentid );
24 $parentEmail = isset( $parentInfo->data->user_email ) ? sanitize_text_field($parentInfo->data->user_email) : '';
25 //Update Parent Profile Picture
26 $parent_loc_avatar=get_user_meta($parentid,'simple_local_avatar',true);
27 $parent_img_url= $parent_loc_avatar ? sanitize_text_field($parent_loc_avatar['full']) : WPSP_PLUGIN_URL.'img/default_avtar.jpg';
28 }
29 ?>
30
31 <div id="formresponse"></div>
32
33 <form name="StudentEditForm" id="StudentEditForm" method="post" enctype="multipart/form-data" novalidate="novalidate">
34 <div class="wpsp-col-xs-12">
35 <div class="wpsp-card">
36 <div class="wpsp-card-head">
37 <h3 class="wpsp-card-title"><?php echo esc_html__( 'Personal Details', 'wpschoolpress' ); ?></h3>
38 </div>
39 <div class="wpsp-card-body">
40 <?php wp_nonce_field( 'StudentRegister', 'sregister_nonce', '', true ) ?>
41
42 <div class="wpsp-row">
43 <?php
44 do_action('wpsp_before_student_personal_detail_fields');
45 /*Required field Hook*/
46 $is_required_item = apply_filters('wpsp_student_personal_is_required',array());
47 ?>
48 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
49 <div class="wpsp-form-group">
50 <label class="wpsp-label displaypicture">
51 <?php esc_html_e("Profile Image","wpschoolpress");?></label>
52 <div class="wpsp-profileUp">
53 <img src="<?php echo esc_url($img_url);?>" id="img_preview" onchange="imagePreview(this);" height="150px" width="150px" class="wpsp-upAvatar" />
54 <div class="wpsp-upload-button"><i class="fa fa-camera"></i>
55 <input name="displaypicture" class="wpsp-file-upload upload" id="displaypicture" type="file" accept="image/jpg, image/jpeg" />
56 </div>
57 </div>
58 <p class="wpsp-form-notes">* <?php echo esc_html("Only JPEG and JPG supported, * Max 3 MB Upload","wpschoolpress");?> </p>
59 <label id="displaypicture-error" class="error" for="displaypicture" style="display: none;"><?php echo esc_html("Please Upload Profile Image","wpschoolpress");?></label>
60 <p id="test" style="color:red" class="validation-error-displaypicture"></p>
61 </div>
62 </div>
63 <input type="hidden" id="studID" name="wp_usr_id" value="<?php echo esc_attr($sid);?>">
64 <input type="hidden" name="parentid" value="<?php echo esc_attr($stinfo->parent_wp_usr_id);?>">
65 <div class="wpsp-col-lg-3 wpsp-col-md-3 wpsp-col-sm-12 wpsp-col-xs-12">
66 <div class="wpsp-form-group">
67 <label class="wpsp-label" for="gender">
68 <?php esc_html_e("Gender","wpschoolpress");?></label>
69 <div class="wpsp-radio-inline">
70 <div class="wpsp-radio">
71 <input type="radio" name="s_gender" <?php if(strtolower($stinfo->s_gender)=='male') echo "checked"?> value="Male" checked="checked">
72 <label for="Male"><?php echo esc_html_e("Male","wpschoolpress");?></label>
73 </div>
74 <div class="wpsp-radio">
75 <input type="radio" name="s_gender" <?php if(strtolower($stinfo->s_gender)=='female') echo "checked"; ?> value="Female">
76 <label for="Female"><?php echo esc_html_e("Female","wpschoolpress");?></label>
77 </div>
78 <div class="wpsp-radio">
79 <input type="radio" name="s_gender" <?php if(strtolower($stinfo->s_gender)=='other') echo "checked"; ?> value="other">
80 <label for="other"><?php echo esc_html_e("Other","wpschoolpress");?></label>
81 </div>
82 </div>
83 </div>
84 </div>
85 <div class="clearfix wpsp-ipad-show"></div>
86 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
87 <div class="wpsp-form-group">
88 <?php
89 /*Check Required Field*/
90 if(isset($is_required_item['s_fname'])){
91 $is_required = esc_html($is_required_item['s_fname']);
92 }else{
93 $is_required = true;
94 }
95 ?>
96 <label class="wpsp-label" for="firstname">
97 <?php esc_html_e("First Name","wpschoolpress"); ?>
98 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
99 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="firstname" value="<?php echo !empty( $stinfo->s_fname ) ? esc_attr($stinfo->s_fname) : esc_attr($stinfo->s_fname); ?>" name="s_fname">
100 <?php wp_nonce_field( 'StudentEdit', 'sedit_nonce', '', true ) ?>
101 <input type="hidden" id="studID" name="wp_usr_id" value="<?php echo esc_attr($sid);?>">
102 </div>
103 </div>
104 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
105 <div class="wpsp-form-group">
106 <?php
107 /*Check Required Field*/
108 if(isset($is_required_item['middlename'])){
109 $is_required = esc_html($is_required_item['middlename'],"wpschoolpress");
110 }else{
111 $is_required = false;
112 }
113 ?>
114 <label class="wpsp-label" for="middlename"><?php esc_html_e("Middle Name","wpschoolpress");?>
115 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
116 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" value="<?php echo !empty( $stinfo->s_mname ) ? esc_attr($stinfo->s_mname) : esc_attr($stinfo->s_mname); ?>" id="middlename" name="s_mname">
117 </div>
118 </div>
119 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
120 <div class="wpsp-form-group">
121 <?php
122 /*Check Required Field*/
123 if(isset($is_required_item['s_lname'])){
124 $is_required = esc_html($is_required_item['s_lname'],"wpschoolpress");
125 }else{
126 $is_required = true;
127 }
128
129 ?>
130 <label class="wpsp-label" for="lastname"><?php esc_html_e("Last Name","wpschoolpress");?><span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
131 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="lastname" value="<?php echo !empty( $stinfo->s_lname ) ? esc_attr($stinfo->s_lname) : esc_attr($stinfo->s_lname); ?>" name="s_lname" required="required">
132 </div>
133 </div>
134 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
135 <div class="wpsp-form-group">
136 <?php
137 /*Check Required Field*/
138 if(isset($is_required_item['s_dob'])){
139 $is_required = esc_html($is_required_item['s_dob'],"wpschoolpress");
140 }else{
141 $is_required = false;
142 }
143
144 ?>
145 <label class="wpsp-label" for="dateofbirth"><?php esc_html_e("Date of Birth","wpschoolpress"); ?><span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
146 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" value="<?php echo !empty( $stinfo->s_dob ) ? esc_attr(wpsp_ViewDate($stinfo->s_dob)) : ''; ?>" id="Dob" name="s_dob" placeholder="mm/dd/yyyy">
147 </div>
148 </div>
149 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
150 <div class="wpsp-form-group">
151 <label class="wpsp-label" for="bloodgroup">
152 <?php esc_html_e("Blood Group","wpschoolpress");
153 /*Check Required Field*/
154 if(isset($is_required_item['s_bloodgrp'])){
155 $is_required = esc_html($is_required_item['s_bloodgrp'],"wpschoolpress");
156 }else{
157 $is_required = false;
158 }
159
160 ?>
161 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
162 </label>
163 <select class="wpsp-form-control" data-is_required="<?php echo esc_attr($is_required); ?>" id="Bloodgroup" name="s_bloodgrp">
164 <option value=""><?php echo esc_html("Select Blood Group","wpschoolpress");?></option>
165 <option <?php if ($stinfo->s_bloodgrp == 'O+') echo esc_html("selected","wpschoolpress"); ?> value="O+"><?php echo esc_html("O +","wpschoolpress");?></option>
166 <option <?php if ($stinfo->s_bloodgrp == 'O-') echo esc_html("selected","wpschoolpress"); ?> value="O-"><?php echo esc_html("O -","wpschoolpress");?></option>
167 <option <?php if ($stinfo->s_bloodgrp == 'A+') echo esc_html("selected","wpschoolpress"); ?> value="A+"><?php echo esc_html("A +","wpschoolpress");?></option>
168 <option <?php if ($stinfo->s_bloodgrp == 'A-') echo esc_html("selected","wpschoolpress"); ?> value="A-"><?php echo esc_html("A -","wpschoolpress");?></option>
169 <option <?php if ($stinfo->s_bloodgrp == 'B+') echo esc_html("selected","wpschoolpress"); ?> value="B+"><?php echo esc_html("B +","wpschoolpress");?></option>
170 <option <?php if ($stinfo->s_bloodgrp == 'B-') echo esc_html("selected","wpschoolpress"); ?> value="B-"><?php echo esc_html("B -","wpschoolpress");?></option>
171 <option <?php if ($stinfo->s_bloodgrp == 'AB+') echo esc_html("selected","wpschoolpress"); ?> value="AB+"><?php echo esc_html("AB +","wpschoolpress");?></option>
172 <option <?php if ($stinfo->s_bloodgrp == 'AB-') echo esc_html("selected","wpschoolpress"); ?> value="AB-"><?php echo esc_html("AB -","wpschoolpress");?></option>
173 </select>
174 </div>
175 </div>
176 <div class="wpsp-col-lg-3 wpsp-col-md-3 wpsp-col-sm-4 wpsp-col-xs-12">
177 <div class="wpsp-form-group">
178 <label class="wpsp-label" for="s_phone">
179 <?php esc_html_e("Student Phone Number","wpschoolpress");
180 /*Check Required Field*/
181 if(isset($is_required_item['s_phone'])){
182 $is_required = esc_html($is_required_item['s_phone'],"wpschoolpress");
183 }else{
184 $is_required = false;
185 }
186 ?>
187 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
188 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="s_phone" name="s_phone" value="<?php echo esc_attr($stinfo->s_phone);?>" onkeypress='return event.keyCode == 8 || event.keyCode == 46
189 || event.keyCode == 37 || event.keyCode == 39 || event.charCode >= 48 && event.charCode <= 57'>
190 <small><?php esc_html("(Please enter country code with mobile number)","wpschoolpress");?></small>
191 <input type="hidden" name="parentid" id="parentid" value="<?php echo esc_attr($stinfo->parent_wp_usr_id);?>" />
192 </div>
193 </div>
194 <div class="wpsp-col-xs-12">
195 <hr />
196 <h4 class="card-title mt-5"><?php echo esc_html("Address","wpschoolpress");?></h4>
197 </div>
198 <div class="wpsp-col-xs-12">
199 <div class="wpsp-form-group">
200 <?php
201 /*Check Required Field*/
202 if(isset($is_required_item['s_address'])){
203 $is_required = esc_html($is_required_item['s_address'],"wpschoolpress");
204 }else{
205 $is_required = true;
206 }
207 ?>
208 <label class="wpsp-label" for="Address"><?php esc_html_e("Current Address","wpschoolpress"); ?><span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
209 <input type="text" name="s_address" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" rows="4" id="current_address" value="<?php echo esc_attr($stinfo->s_address); ?>" />
210 </div>
211 </div>
212 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
213 <div class="wpsp-form-group ">
214 <?php
215 /*Check Required Field*/
216 if(isset($is_required_item['s_city'])){
217 $is_required = esc_html($is_required_item['s_city'],"wpschoolpress");
218 }else{
219 $is_required = false;
220 }
221 ?>
222 <label class="wpsp-label" for="CityName"><?php esc_html_e("City Name","wpschoolpress");?><span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
223 </label>
224 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="current_city" value="<?php echo esc_attr($stinfo->s_city); ?>" name="s_city">
225 </div>
226 </div>
227 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
228 <div class="wpsp-form-group">
229 <label class="wpsp-label" for="Country"> <?php echo esc_html_e("Country","wpschoolpress");
230 /*Check Required Field*/
231 if(isset($is_required_item['s_country'])){
232 $is_required = esc_html($is_required_item['s_country'],"wpschoolpress");
233 }else{
234 $is_required = false;
235 }
236 ?>
237 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
238 <?php $countrylist = wpsp_county_list(); ?>
239 <select class="wpsp-form-control" data-is_required="<?php echo esc_attr($is_required); ?>" id="current_country" name="s_country">
240 <option value=""><?php echo esc_html("Select Country","wpschoolpress");?></option>
241 <?php foreach ($countrylist as $key => $value) { ?>
242 <option value="<?php echo esc_attr($value); ?>" <?php echo selected($stinfo->s_country, $value); ?>>
243 <?php echo esc_html($value); ?>
244 </option>
245 <?php
246 }
247 ?>
248 </select>
249 </div>
250 </div>
251 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
252 <div class="wpsp-form-group">
253 <?php
254 /*Check Required Field*/
255 if(isset($is_required_item['s_zipcode'])){
256 $is_required = esc_html($is_required_item['s_zipcode'],"wpschoolpress");
257 }else{
258 $is_required = false;
259 }
260 ?>
261 <label class="wpsp-label" for="Zipcode"><?php esc_html_e("Pin Code","wpschoolpress"); ?><span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
262 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="current_pincode" name="s_zipcode" value="<?php echo esc_attr($stinfo->s_zipcode); ?>" data-isrequired="<?php echo esc_attr($data); ?>">
263 </div>
264 </div>
265 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
266 <div class="wpsp-form-group">
267 <input type="checkbox" id="sameas" value="1" onclick="sameAsAbove()">
268 <label for="sameas"> <?php echo esc_html("Same as Above","wpschoolpress");?> </label>
269 </div>
270 </div>
271 <div class="wpsp-col-xs-12">
272 <div class="wpsp-form-group">
273 <div class="wpsp-form-group">
274 <label for="PermanentAddress"><?php esc_html_e("Permanent Address","wpschoolpress");
275 /*Check Required Field*/
276 if(isset($is_required_item['s_paddress'])){
277 $is_required = esc_html($is_required_item['s_paddress'],"wpschoolpress");
278 }else{
279 $is_required = false;
280 }
281 ?>
282 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
283 </label>
284 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" rows="5" id="permanent_address" value="<?php echo esc_attr($stinfo->s_paddress);?>" name="s_paddress">
285 </div>
286 </div>
287 </div>
288 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
289 <div class="wpsp-form-group">
290 <label for="City"><?php esc_html_e("City Name","wpschoolpress");
291 /*Check Required Field*/
292 if(isset($is_required_item['s_pcity'])){
293 $is_required = esc_html($is_required_item['s_pcity'],"wpschoolpress");
294 }else{
295 $is_required = false;
296 }
297 ?>
298 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
299 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="permanent_city" value="<?php echo esc_attr($stinfo ->s_pcity); ?>" name="s_pcity">
300 </div>
301 </div>
302 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
303 <div class="wpsp-form-group">
304 <label for="Country"><?php esc_html_e("Country","wpschoolpress");
305 /*Check Required Field*/
306 if(isset($is_required_item['s_pcountry'])){
307 $is_required = esc_html($is_required_item['s_pcountry'],"wpschoolpress");
308 }else{
309 $is_required = false;
310 }
311 ?>
312 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
313 </label>
314 <?php $countrylist = wpsp_county_list(); ?>
315 <select data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="permanent_country" name="s_pcountry">
316 <option value=""><?php echo esc_html("Select Country","wpschoolpress");?></option>
317 <?php foreach ($countrylist as $key => $value) { ?>
318 <option value="<?php echo esc_attr($value); ?>" <?php echo selected($stinfo->s_pcountry, $value); ?>>
319 <?php echo esc_html($value); ?>
320 </option>
321 <?php
322 }
323 ?>
324 </select>
325 </div>
326 </div>
327 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
328 <div class="wpsp-form-group">
329 <label class="wpsp-label" for="Zipcode"><?php esc_html_e("Pin Code","wpschoolpress");
330 /*Check Required Field*/
331 if(isset($is_required_item['s_pzipcode'])){
332 $is_required = esc_html($is_required_item['s_pzipcode'],"wpschoolpress");
333 }else{
334 $is_required = false;
335 }
336 ?>
337 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
338 </label>
339 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="permanent_pincode" name="s_pzipcode" value="<?php echo esc_attr($stinfo->s_pzipcode);?>" data-isrequired="<?php echo esc_attr($data); ?>">
340
341 </div>
342 </div>
343 <?php
344 do_action( 'wpsp_after_student_personal_detail_fields' );
345 ?>
346 <div class="wpsp-col-xs-12">
347 <button type="submit" class="wpsp-btn wpsp-btn-success" id="studentform"><?php echo esc_html("Next","wpschoolpress");?></button>&nbsp;&nbsp;
348 </div>
349 </div>
350 </div>
351 </div>
352 </div>
353
354
355 <div class="wpsp-col-xs-12">
356 <div class="wpsp-card">
357 <div class="wpsp-card-head">
358 <h3 class="wpsp-card-title"><?php echo esc_html__( 'Parent Detail', 'wpschoolpress' ); ?></h3>
359 </div>
360 <div class="wpsp-card-body">
361 <div class="wpsp-row">
362 <?php
363 do_action('wpsp_before_student_parent_detail_fields');
364 /*Required field Hook*/
365 $is_required_parent = apply_filters('wpsp_student_parent_is_required',array());
366 ?>
367 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
368 <div class="wpsp-form-group">
369 <input type="hidden" id="wpsp_locationginal" value="<?php echo esc_url(admin_url());?>" />
370
371 <div class="wpsp-profileUp">
372 <?php if($parent_img_url == ""){?>
373 <img class="wpsp-upAvatar" id="img_preview1" onchange="imagePreview(this);" src="<?php echo esc_url(plugins_url( 'img/default_avtar.jpg', dirname(__FILE__) ));?>">
374 <!-- <img class="wpsp-upAvatar" id="img_preview1" onchange="imagePreview(this);" src="<?php echo esc_url($parent_img_url);?>"> -->
375 <?php } else {?>
376 <img class="wpsp-upAvatar" id="img_preview1" onchange="imagePreview(this);" src="<?php echo esc_url($parent_img_url);?>">
377 <?php }?>
378 <div class="wpsp-upload-button"><i class="fa fa-camera"></i>
379 <input name="p_displaypicture" class="wpsp-file-upload" id="p_displaypicture" type="file" accept="image/jpg, image/jpeg" />
380 </div>
381 </div>
382 <p class="wpsp-form-notes">* <?php echo esc_html("Only JPEG and JPG supported, * Max 3 MB Upload","wpschoolpress");?> </p>
383 <label id="pdisplaypicture-error" class="error" for="pdisplaypicture" style="display: none;">
384 <?php echo esc_html("Please Upload Profile Image","wpschoolpress");?></label>
385 <p id="test" style="color:red"></p>
386 </div>
387 </div>
388 <div class="wpsp-col-lg-9 wpsp-col-md-8 wpsp-col-sm-12 wpsp-col-xs-12">
389 <div class="wpsp-form-group">
390 <label class="wpsp-label" for="p_gender"><?php esc_html_e("Gender","wpschoolpress");?></label>
391 <div class="wpsp-radio-inline">
392 <div class="wpsp-radio">
393 <input type="radio" name="p_gender" <?php if (strtolower($stinfo->p_gender) == 'male') echo esc_html("checked","wpschoolpress"); ?> value="Male" checked="checked">
394 <label for="Male"><?php echo esc_html_e("Male","wpschoolpress");?></label>
395 </div>
396 <div class="wpsp-radio">
397 <input type="radio" name="p_gender" <?php if (strtolower($stinfo->p_gender) == 'female') echo esc_html("checked","wpschoolpress"); ?> value="Female">
398 <label for="Female"><?php echo esc_html_e("Female","wpschoolpress");?></label>
399 </div>
400 <div class="wpsp-radio">
401 <input type="radio" name="p_gender" <?php if (strtolower($stinfo->p_gender) == 'other') echo esc_html("checked","wpschoolpress"); ?> value="other">
402 <label for="other"><?php echo esc_html_e("Other","wpschoolpress");?></label>
403 </div>
404 </div>
405 </div>
406 </div>
407 <div class="clearfix wpsp-ipad-show"></div>
408 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
409 <div class="wpsp-form-group">
410 <label class="wpsp-label" for="firstname"><?php esc_html_e("First Name","wpschoolpress");
411 /*Check Required Field*/
412 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['p_fname'])){
413 $is_required = esc_html($is_required_parent['p_fname'],"wpschoolpress");
414 }else{
415 $is_required = false;
416 }
417 ?>
418 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
419 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="firstname" value="<?php echo !empty($stinfo->p_fname) ? esc_attr($stinfo->p_fname) : ''; ?>" name="p_fname">
420 </div>
421 </div>
422 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
423 <div class="wpsp-form-group">
424 <label class="wpsp-label" for="middlename"><?php esc_html_e("Middle Name","wpschoolpress");
425 /*Check Required Field*/
426 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['p_mname'])){
427 $is_required = esc_html($is_required_parent['p_mname'],"wpschoolpress");
428 }else{
429 $is_required = false;
430 }
431 ?>
432 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
433 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="middlename" value="<?php echo !empty($stinfo->p_mname) ? esc_attr($stinfo->p_mname) : ''; ?>" name="p_mname">
434 </div>
435 </div>
436 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
437 <div class="wpsp-form-group">
438 <label class="wpsp-label" for="lastname"><?php esc_html_e("Last Name","wpschoolpress");
439 /*Check Required Field*/
440 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['p_lname'])){
441 $is_required = esc_html($is_required_parent['p_lname'],"wpschoolpress");
442 }else{
443 $is_required = false;
444 }
445 ?>
446 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
447 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="lastname" value="<?php echo !empty($stinfo->p_lname) ? esc_attr($stinfo->p_lname) : ''; ?>" name="p_lname">
448 </div>
449 </div>
450
451 <div class="clearfix"></div>
452 <?php // If parent not created then add this fields?>
453 <?php if($stinfo->parent_wp_usr_id == 0){?>
454 <input type="hidden" name="studentprofileparentnew" value="studentprofileparentnew">
455 <div class="wpsp-col-md-3 wpsp-col-sm-4 wpsp-col-xs-12">
456 <div class="wpsp-form-group">
457 <label class="wpsp-label" for="pEmail"><?php esc_html_e("Email Address","wpschoolpress");
458 /*Check Required Field*/
459 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['pEmail'])){
460 $is_required = esc_html($is_required_parent['pEmail'],"wpschoolpress");
461 }else{
462 $is_required = false;
463 }
464 ?>
465 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
466 <input data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control chk-email" id="pEmail" name="pEmail" type="email">
467 </div>
468 </div>
469
470 <div class="wpsp-col-md-3 wpsp-col-sm-4 wpsp-col-xs-12">
471 <div class="wpsp-form-group">
472 <label class="wpsp-label" for="Username"><?php esc_html_e("Username","wpschoolpress");
473 /*Check Required Field*/
474 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['pUsername'])){
475 $is_required = esc_html($is_required_parent['pUsername'],"wpschoolpress");
476 }else{
477 $is_required = false;
478 }
479 ?>
480 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
481 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control chk-username" id="p_username" name="pUsername">
482 </div>
483 </div>
484
485 <div class="wpsp-col-md-3 wpsp-col-sm-4 wpsp-col-xs-12">
486 <div class="wpsp-form-group">
487 <label class="wpsp-label" for="Password"> <?php esc_html_e("Password","wpschoolpress");
488 /*Check Required Field*/
489 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['pPassword'])){
490 $is_required = esc_html($is_required_parent['pPassword'],"wpschoolpress");
491 }else{
492 $is_required = false;
493 }
494 ?>
495 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
496 <input type="password" data-is_required="<?php echo esc_attr($is_required);?>" class="wpsp-form-control" id="p_password" name="pPassword">
497 </div>
498 </div>
499
500 <div class="wpsp-col-md-3 wpsp-col-sm-4 wpsp-col-xs-12">
501 <div class="wpsp-form-group">
502 <label class="wpsp-label" for="ConfirmPassword"><?php esc_html_e("Confirm Password","wpschoolpress");
503 /*Check Required Field*/
504 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['pConfirmPassword'])){
505 $is_required = esc_html($is_required_parent['pConfirmPassword'],"wpschoolpress");
506 }else{
507 $is_required = false;
508 }
509 ?>
510 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
511 <input type="password" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="p_confirmpassword" name="pConfirmPassword">
512 </div>
513 </div>
514 <?php } ?>
515
516 <div class="wpsp-col-md-3 wpsp-col-sm-3 wpsp-col-xs-12">
517 <div class="wpsp-form-group">
518 <label class="wpsp-label" for="p_edu"><?php esc_html_e("Education","wpschoolpress");
519 /*Check Required Field*/
520 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['p_edu'])){
521 $is_required = esc_html($is_required_parent['p_edu'],"wpschoolpress");
522 }else{
523 $is_required = false;
524 }
525 ?>
526 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
527 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" value="<?php echo esc_attr($stinfo->p_edu); ?>" name="p_edu">
528 </div>
529 </div>
530 <div class="wpsp-col-md-3 wpsp-col-sm-3 wpsp-col-xs-12">
531 <div class="wpsp-form-group">
532 <label class="wpsp-label" for="p_profession"><?php esc_html_e("Profession","wpschoolpress");
533 /*Check Required Field*/
534 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['p_profession'])){
535 $is_required = esc_html($is_required_parent['p_profession'],"wpschoolpress");
536 }else{
537 $is_required = false;
538 }
539 ?>
540 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
541 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" name="p_profession" value="<?php echo esc_attr($stinfo->p_profession); ?>">
542 </div>
543 </div>
544 <div class="wpsp-col-lg-3 wpsp-col-md-3 wpsp-col-sm-3 wpsp-col-xs-12">
545 <div class="wpsp-form-group">
546 <label for="phone"><?php esc_html_e("Parent Phone","wpschoolpress");
547 /*Check Required Field*/
548 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['s_p_phone'])){
549 $is_required = esc_html($is_required_parent['s_p_phone'],"wpschoolpress");
550 }else{
551 $is_required = false;
552 }
553 ?>
554 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span></label>
555 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="s_p_phone" value="<?php echo esc_attr($stinfo->p_phone); ?>" name="s_p_phone">
556 </div>
557 </div>
558
559 <div class="wpsp-col-lg-3 wpsp-col-md-3 wpsp-col-sm-3 wpsp-col-xs-12">
560 <div class="wpsp-form-group">
561 <label for="bloodgroup"><?php esc_html_e("Blood Group","wpschoolpress");
562 /*Check Required Field*/
563 if(isset($is_required_parent['section']) && $is_required_parent['section'] == "parent" && isset($is_required_parent['p_bloodgroup'])){
564 $is_required = esc_html($is_required_parent['p_bloodgroup'],"wpschoolpress");
565 }else{
566 $is_required = false;
567 }
568 ?>
569 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
570 </label>
571 <select data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="Bloodgroup" name="p_bloodgrp">
572 <option value=""><?php echo esc_html("Select Blood Group","wpschoolpress");?></option>
573 <option <?php if ($stinfo->p_bloodgrp == 'O+') echo esc_html("selected","wpschoolpress"); ?> value="O+"><?php echo esc_html("O +","wpschoolpress");?></option>
574 <option <?php if ($stinfo->p_bloodgrp == 'O-') echo esc_html("selected","wpschoolpress"); ?> value="O-"><?php echo esc_html("O -","wpschoolpress");?></option>
575 <option <?php if ($stinfo->p_bloodgrp == 'A+') echo esc_html("selected","wpschoolpress"); ?> value="A+"><?php echo esc_html("A +","wpschoolpress");?></option>
576 <option <?php if ($stinfo->p_bloodgrp == 'A-') echo esc_html("selected","wpschoolpress"); ?> value="A-"><?php echo esc_html("A -","wpschoolpress");?></option>
577 <option <?php if ($stinfo->p_bloodgrp == 'B+') echo esc_html("selected","wpschoolpress"); ?> value="B+"><?php echo esc_html("B +","wpschoolpress");?></option>
578 <option <?php if ($stinfo->p_bloodgrp == 'B-') echo esc_html("selected","wpschoolpress"); ?> value="B-"><?php echo esc_html("B -","wpschoolpress");?></option>
579 <option <?php if ($stinfo->p_bloodgrp == 'AB+') echo esc_html("selected","wpschoolpress"); ?> value="AB+"><?php echo esc_html("AB +","wpschoolpress");?></option>
580 <option <?php if ($stinfo->p_bloodgrp == 'AB-') echo esc_html("selected","wpschoolpress"); ?> value="AB-"><?php echo esc_html("AB -","wpschoolpress");?></option>
581 </select>
582 </div>
583 </div>
584 <?php
585 do_action('wpsp_after_student_parent_detail_fields');
586 ?>
587 <div class="wpsp-col-xs-12">
588 <button type="submit" class="wpsp-btn wpsp-btn-success" id="studentform"><?php echo esc_html("Next","wpschoolpress");?></button>&nbsp;&nbsp;
589 </div>
590 </div>
591 </div>
592 </div>
593 </div>
594
595 <div class="wpsp-col-xs-12">
596 <div class="wpsp-card">
597 <div class="wpsp-card-head">
598 <h3 class="wpsp-card-title"><?php echo esc_html__( 'School Details', 'wpschoolpress' ); ?></h3>
599 </div>
600 <div class="wpsp-card-body">
601 <div class="wpsp-row">
602 <?php
603 do_action('wpsp_before_student_school_detail_fields');
604 /*Required field Hook*/
605 $is_required_school = apply_filters('wpsp_student_school_is_required',array());
606 ?>
607 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
608 <div class="wpsp-form-group">
609 <label class="wpsp-label" for="dateofbirth"><?php esc_html_e("Joining Date","wpschoolpress");
610 /*Check Required Field*/
611 if(isset($is_required_school['section']) && $is_required_school['section'] == "school" && isset($is_required_school['s_doj'])){
612 $is_required = esc_html($is_required_school['s_doj'],"wpschoolpress");
613 }else{
614 $is_required = false;
615 }
616 ?>
617 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
618 </label>
619 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control select_date" id="Doj" value="<?php echo !empty( $stinfo->s_doj ) ? esc_attr(wpsp_ViewDate($stinfo->s_doj)) : '' ; ?>" name="s_doj">
620 </div>
621 </div>
622 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
623 <?php
624 $classes = [];
625 $classIDArray = [];
626 $class_table = $wpdb->prefix . "wpsp_class";
627 $class_mapping_table = $wpdb->prefix . "wpsp_class_mapping";
628 $classes = $wpdb->get_results("select cid,c_name from $class_table");
629 ?>
630 <div class="wpsp-form-group">
631 <label class="wpsp-label" for="Class"><?php esc_html_e("Class","wpschoolpress");
632 /*Check Required Field*/
633 if(isset($is_required_school['section']) && $is_required_school['section'] == "school" && isset($is_required_school['Class'])){
634 $is_required = esc_html($is_required_school['Class'],"wpschoolpress");
635 }else{
636 $is_required = true;
637 }
638 ?>
639 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
640 </label>
641 <?php
642
643 if (is_numeric($stinfo->class_id)){
644 $classIDArray[] = $stinfo->class_id;
645 }else{
646 $classIDArray = unserialize($stinfo->class_id);
647 }
648 $prohistory = wpsp_check_pro_version('wpsp_mc_version');
649 $prodisablehistory = ! $prohistory['status'] ? 'notinstalled' : 'installed';
650
651 if( $prodisablehistory == 'installed'){
652 echo '<select data-is_required="'.esc_attr($is_required).'" class="selectpicker wpsp-form-control multiselect student-profile" multiple="multiple" name="Class[]" data-icon-base="fa" data-tick-icon="fa-check" multiple data-live-search="true">';
653 }else{
654 echo '<select data-is_required="'.esc_attr($is_required).'" class="wpsp-form-control" name="Class[]">';
655 echo '<option value="" disabled selected>Select Class</option>';
656 }
657
658 foreach ($classes as $class) {
659 ?>
660 <option value="<?php echo esc_attr($class->cid); ?>" <?php if(!empty($classIDArray)){ if (in_array( $class->cid , $classIDArray )) echo esc_html('selected','wpschoolpress'); }?>>
661 <?php echo esc_html($class->c_name); ?>
662 </option>
663 <?php }?>
664 </select>
665
666 <input type="hidden" name="prev_select_class" value="<?php echo esc_attr($stinfo->class_id);?>">
667 </div>
668 <div class="date-input-block">
669 <table class="table table-bordered" width="100%" cellspacing="0" cellpadding="5">
670 <?php
671 foreach ($classes as $class) {
672 // $class_data = $wpdb->get_results("select * from $class_mapping_table where sid='".esc_sql($student_index)."' AND cid = '".esc_sql($class->cid)."'");
673 $class_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM $class_mapping_table WHERE sid = %d and cid = %d",$student_index,$class->cid));
674 if(!empty($classIDArray)){
675 if (in_array( $class->cid , $classIDArray )){
676 ?>
677 <tr>
678 <td style="border:1px solid;padding:5px;">
679 <strong><?php echo esc_html($class->c_name); ?></strong>
680 </td>
681 <td style="border:1px solid;padding:5px;">
682 <input type='text' class='someclass datepicker' name='Classdata[]' placeholder='yyyy-mm-dd' <?php echo (((isset($class_data[0]->date) && ($class_data[0]->date != ''))) ? 'value="'.esc_attr($class_data[0]->date).'"' : ''); ?>>
683 </td>
684 </tr>
685 <?php }
686 }
687 }?>
688 </table>
689 </div>
690 </div>
691 <div class="wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
692 <div class="wpsp-form-group">
693 <label class="wpsp-label" for="dateofbirth"><?php esc_html_e("Roll Number","wpschoolpress");
694 /*Check Required Field*/
695 if(isset($is_required_school['section']) && $is_required_school['section'] == "school" && isset($is_required_school['s_rollno'])){
696 $is_required = esc_html($is_required_school['s_rollno'],"wpschoolpress");
697 }else{
698 $is_required = true;
699 }
700 ?>
701 <span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span>
702 </label>
703 <input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" class="wpsp-form-control" id="Rollno" value="<?php echo esc_attr($stinfo->s_rollno); ?>" name="s_rollno">
704 </div>
705 </div>
706 <?php
707 do_action('wpsp_after_student_school_detail_fields');
708 ?>
709 </div>
710 <div class="">
711 <button type="submit" class="wpsp-btn wpsp-btn-success" id="studentform"><?php echo esc_html("Update","wpschoolpress");?></button>&nbsp;&nbsp;
712 <a href="<?php echo esc_url(wpsp_admin_url().'sch-student')?>" class="wpsp-btn wpsp-dark-btn"><?php echo esc_html("Back","wpschoolpress");?></a>
713 </div>
714 </div>
715 </div>
716 </div>
717 </form>
718
719 <?php } else { echo esc_html("Soory! No Data retrived!!","wpschoolpress");}?>