| 1 |
<?php |
| 2 |
if (!defined( 'ABSPATH' ) )exit('No Such File'); |
| 3 |
wpsp_header(); |
| 4 |
?> |
| 5 |
<style> |
| 6 |
.mes-dedeactivate-block{ |
| 7 |
position: relative; |
| 8 |
} |
| 9 |
.mes-dedeactivate-block #message-license-deactivate{ |
| 10 |
position: absolute; |
| 11 |
top: 29px; |
| 12 |
right: 0; |
| 13 |
} |
| 14 |
.mes-dedeactivate-block #multi-license-deactivate{ |
| 15 |
position: absolute; |
| 16 |
top: 29px; |
| 17 |
right: 0; |
| 18 |
} |
| 19 |
.mes-dedeactivate-block #onlinepay-license-deactivate{ |
| 20 |
position: absolute; |
| 21 |
top: 29px; |
| 22 |
right: 0; |
| 23 |
} |
| 24 |
</style> |
| 25 |
<?php |
| 26 |
if( is_user_logged_in() ) { |
| 27 |
global $current_user, $wp_roles, $wpdb; |
| 28 |
$current_user_role=$current_user->roles[0]; |
| 29 |
wpsp_topbar(); |
| 30 |
wpsp_sidebar(); |
| 31 |
wpsp_body_start(); |
| 32 |
//$proversion = wpsp_check_pro_version(); |
| 33 |
$proversion = wpsp_check_pro_version('wpsp_sms_version'); |
| 34 |
$proclass = !$proversion['status'] && isset( $proversion['class'] )? $proversion['class'] : ''; |
| 35 |
$protitle = !$proversion['status'] && isset( $proversion['message'] )? $proversion['message'] : ''; |
| 36 |
$prodisable = !$proversion['status'] ? 'disabled="disabled"' : ''; |
| 37 |
$promessage = wpsp_check_pro_version('wpsp_message_version'); |
| 38 |
$prodisablemessage = !$promessage['status'] ? 'notinstalled' : 'installed'; |
| 39 |
$prohistory = wpsp_check_pro_version('wpsp_mc_version'); |
| 40 |
$prodisablehistory = !$prohistory['status'] ? 'notinstalled' : 'installed'; |
| 41 |
$propayment = wpsp_check_pro_version('pay_WooCommerce'); |
| 42 |
$propayment = !$propayment['status'] ? 'notinstalled' : 'installed'; |
| 43 |
if($current_user_role=='administrator') { |
| 44 |
$ex_field_tbl = $wpdb->prefix."wpsp_mark_fields"; |
| 45 |
$subject_tbl = $wpdb->prefix."wpsp_subject"; |
| 46 |
$class_tbl = $wpdb->prefix."wpsp_class"; |
| 47 |
?> |
| 48 |
<div class="wpsp-card"> |
| 49 |
<?php |
| 50 |
if(isset($_GET['sc'])&& sanitize_text_field($_GET['sc'])=='subField') { |
| 51 |
//Fields Edit Section |
| 52 |
if( isset( $_GET['sid'] ) && intval($_GET['sid'])>0 ) { |
| 53 |
$subject_id = intval($_GET['sid']); |
| 54 |
// $fields = $wpdb->get_results("select f.*,s.sub_name,c.c_name from $ex_field_tbl f LEFT JOIN $subject_tbl s ON s.id=f.subject_id LEFT JOIN $class_tbl c ON c.cid=s.class_id where f.subject_id='".esc_sql($subject_id)."'"); |
| 55 |
$fields = $wpdb->get_results($wpdb->prepare("SELECT f.*,s.sub_name,c.c_name FROM $ex_field_tbl f LEFT JOIN $subject_tbl s ON s.id=f.subject_id LEFT JOIN $class_tbl c ON c.cid=s.class_id WHERE f.subject_id = %d ",$subject_id)); |
| 56 |
?> |
| 57 |
<div class="wpsp-card-body"> |
| 58 |
<div class="wpsp-row"> |
| 59 |
<div class="wpsp-col-md-12 line_box wpsp-col-lg-12"> |
| 60 |
<div class="wpsp-form-group"> |
| 61 |
<div class="wpsp-row"> |
| 62 |
<div class="wpsp-col-md-3"> |
| 63 |
<label class="wpsp-labelMain"><?php esc_html_e( 'Class:', 'wpschoolpress'); ?></label> <?php echo esc_html($fields[0]->c_name);?> |
| 64 |
</div> |
| 65 |
<div class="wpsp-col-md-3"> |
| 66 |
<label class="wpsp-labelMain"><?php esc_html_e( 'Subject:', 'wpschoolpress'); ?></label> <?php echo esc_html($fields[0]->sub_name);?> |
| 67 |
</div> |
| 68 |
</div> |
| 69 |
<?php wp_nonce_field( 'SubjectFields', 'subfields_nonce', '', true ) ?> |
| 70 |
<input type="hidden" id="wpsp_locationginal" value="<?php echo esc_url(admin_url());?>"/> |
| 71 |
</div> |
| 72 |
<div class="wpsp-row"> |
| 73 |
<?php |
| 74 |
if(count($fields)>0){ |
| 75 |
$sno=1; |
| 76 |
foreach($fields as $field){ ?> |
| 77 |
<div class="wpsp-col-sm-6 wpsp-col-md-4"> |
| 78 |
<div class="wpsp-form-group smf-inline-form"> |
| 79 |
<input type="text" id="<?php echo intval($field->field_id);?>SF" value="<?php echo esc_attr($field->field_text);?>" class="wpsp-form-control"> |
| 80 |
<button id="sf_update" class="wpsp-btn wpsp-btn-success SFUpdate" data-id="<?php echo esc_attr(intval($field->field_id));?>"><span class="dashicons dashicons-yes"></span></button> |
| 81 |
<button id="d_teacher" class="wpsp-btn wpsp-btn-danger popclick" data-pop="DeleteModal" data-id="<?php echo esc_attr(intval($field->field_id));?>"><i class="icon wpsp-trash"></i></button> |
| 82 |
</div> |
| 83 |
</div> |
| 84 |
<?php $sno++; } |
| 85 |
}else{ |
| 86 |
echo "<div class='wpsp-col-md-8 wpsp-col-md-offset-4'>".esc_html( 'No data retrived!', 'wpschoolpress')."</div>"; |
| 87 |
} |
| 88 |
?> |
| 89 |
</div> |
| 90 |
<a href="<?php echo esc_url(wpsp_admin_url().'sch-settings&sc=subField');?>" class="wpsp-btn wpsp-dark-btn"><?php esc_html_e( 'Back', 'wpschoolpress'); ?></a> |
| 91 |
</div> |
| 92 |
</div> |
| 93 |
</div> |
| 94 |
<style> |
| 95 |
#AddFieldsButton{display:none} |
| 96 |
</style> |
| 97 |
<?php }else{ |
| 98 |
//Subject Mark Extract fields |
| 99 |
$all_fields = $wpdb->get_results("select mfields.subject_id, GROUP_CONCAT(mfields.field_text) AS fields,class.c_name,subject.sub_name from $ex_field_tbl mfields LEFT JOIN $subject_tbl subject ON subject.id=mfields.subject_id LEFT JOIN $class_tbl class ON class.cid=subject.class_id group by mfields.subject_id"); |
| 100 |
?> |
| 101 |
<div class="wpsp-card-body"> |
| 102 |
<div class="wpsp-row"> |
| 103 |
<div class="wpsp-col-md-12 wpsp-table-responsive"> |
| 104 |
<table id="wpsp_sub_division_table" class="wpsp-table" cellspacing="0" width="100%" style="width:100%"> |
| 105 |
<thead> |
| 106 |
<tr> |
| 107 |
<th class="nosort">#</th> |
| 108 |
<th><?php esc_html_e( 'Class', 'wpschoolpress'); ?></th> |
| 109 |
<th><?php esc_html_e( 'Subject', 'wpschoolpress'); ?></th> |
| 110 |
<th><?php esc_html_e( 'Fields', 'wpschoolpress'); ?></th> |
| 111 |
<th><?php esc_html_e( 'Action', 'wpschoolpress'); ?></th> |
| 112 |
</tr> |
| 113 |
</thead> |
| 114 |
<tbody> |
| 115 |
<?php $sno=1; |
| 116 |
foreach($all_fields as $exfield){ ?> |
| 117 |
<tr> |
| 118 |
<td><?php echo esc_html($sno); ?></td><td><?php echo esc_html($exfield->c_name);?></td><td><?php echo esc_html($exfield->sub_name);?></td><td><?php echo esc_html($exfield->fields);?></td> |
| 119 |
<td> |
| 120 |
<div class="wpsp-action-col"> |
| 121 |
<a href="<?php echo esc_url(wpsp_admin_url().'sch-settings&sc=subField&ac=edit&sid='.esc_attr($exfield->subject_id));?>" title="Edit"><i class="icon wpsp-edit wpsp-edit-icon"></i></a> |
| 122 |
</div> |
| 123 |
</td> |
| 124 |
</tr> |
| 125 |
<?php $sno++; } ?> |
| 126 |
</tbody> |
| 127 |
<tfoot> |
| 128 |
<tr> |
| 129 |
<th>#</th> |
| 130 |
<th><?php esc_html_e( 'Class', 'wpschoolpress'); ?></th> |
| 131 |
<th><?php esc_html_e( 'Subject', 'wpschoolpress'); ?></th> |
| 132 |
<th><?php esc_html_e( 'Fields', 'wpschoolpress'); ?></th> |
| 133 |
<th><?php esc_html_e( 'Action', 'wpschoolpress'); ?></th> |
| 134 |
</tr> |
| 135 |
</tfoot> |
| 136 |
</table> |
| 137 |
</div> |
| 138 |
</div> |
| 139 |
<!--- Add Field Popup --> |
| 140 |
<div class="wpsp-popupMain" id="addFieldModal" > |
| 141 |
<div class="wpsp-overlayer"></div> |
| 142 |
<div class="wpsp-popBody"> |
| 143 |
<div class="wpsp-popInner"> |
| 144 |
<a href="javascript:;" class="wpsp-closePopup"></a> |
| 145 |
<div class="wpsp-panel-heading"> |
| 146 |
<h3 class="wpsp-panel-title"><?php echo esc_html(apply_filters( 'wpsp_subject_mark_field_heading_item',"Add Subject Mark Fields"),"wpschoolpress"); ?></h3> |
| 147 |
</div> |
| 148 |
<div class="wpsp-panel-body"> |
| 149 |
<div class="wpsp-row"> |
| 150 |
<form action="#" method="POST" name="SubFieldsForm" id="SubFieldsForm"> |
| 151 |
<div class="wpsp-col-md-12 line_box"> |
| 152 |
<div class="wpsp-row"> |
| 153 |
<?php |
| 154 |
$item = esc_html(apply_filters( 'wpsp_subject_mark_field_title_item',"Class Name"),"wpschoolpress"); |
| 155 |
$is_required_item = array(); |
| 156 |
?> |
| 157 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-12 wpsp-col-xs-12"> |
| 158 |
<div class="wpsp-form-group"> |
| 159 |
<?php wp_nonce_field( 'SubjectFields', 'subfields_nonce', '', true ) ?> |
| 160 |
<label class="wpsp-label" for="Class"><?php |
| 161 |
esc_html_e("Class","wpschoolpress"); |
| 162 |
/*Check Required Field*/ |
| 163 |
if(isset($is_required_item['ClassID'])){ |
| 164 |
$is_required = esc_html($is_required_item['ClassID'],"wpschoolpress"); |
| 165 |
}else{ |
| 166 |
$is_required = true; |
| 167 |
} |
| 168 |
?> |
| 169 |
<span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span> |
| 170 |
</label> |
| 171 |
<select name="ClassID" data-is_required="<?php echo esc_attr($is_required); ?>" id="SubFieldsClass" class="wpsp-form-control"> |
| 172 |
<option value=""><?php esc_html_e( 'Select Class', 'wpschoolpress' ); ?></option> |
| 173 |
<?php $classes=$wpdb->get_results("select cid,c_name from $class_tbl"); |
| 174 |
foreach($classes as $class){ |
| 175 |
?> |
| 176 |
<option value="<?php echo esc_attr(intval($class->cid));?>"><?php echo esc_html($class->c_name);?></option> |
| 177 |
<?php } ?> |
| 178 |
</select> |
| 179 |
</div> |
| 180 |
</div> |
| 181 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-12 wpsp-col-xs-12"> |
| 182 |
<div class="wpsp-form-group"> |
| 183 |
<label class="wpsp-label" for="Subject"><?php |
| 184 |
esc_html_e("Subject","wpschoolpress"); |
| 185 |
/*Check Required Field*/ |
| 186 |
if(isset($is_required_item['SubjectID'])){ |
| 187 |
$is_required = esc_html($is_required_item['SubjectID'],"wpschoolpress"); |
| 188 |
}else{ |
| 189 |
$is_required = true; |
| 190 |
} |
| 191 |
?> |
| 192 |
<span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span> |
| 193 |
</label> |
| 194 |
<select name="SubjectID" data-is_required="<?php echo esc_attr($is_required); ?>" id="SubFieldSubject" class="wpsp-form-control"> |
| 195 |
<option value=""><?php esc_html_e( 'Select Subject', 'wpschoolpress' ); ?></option> |
| 196 |
</select> |
| 197 |
</div> |
| 198 |
</div> |
| 199 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-12 wpsp-col-xs-12"> |
| 200 |
<div class="wpsp-form-group"> |
| 201 |
<label class="wpsp-label" for="Field"><?php |
| 202 |
esc_html_e("Field","wpschoolpress"); |
| 203 |
/*Check Required Field*/ |
| 204 |
if(isset($is_required_item['FieldName'])){ |
| 205 |
$is_required = esc_html($is_required_item['FieldName'],"wpschoolpress"); |
| 206 |
}else{ |
| 207 |
$is_required = true; |
| 208 |
} |
| 209 |
?> |
| 210 |
<span class="wpsp-required"><?php echo esc_html(($is_required))?"*":""; ?></span> |
| 211 |
</label> |
| 212 |
<input type="text" data-is_required="<?php echo esc_attr($is_required); ?>" name="FieldName" class="wpsp-form-control"> |
| 213 |
</div> |
| 214 |
</div> |
| 215 |
<div class="wpsp-col-md-12"> |
| 216 |
<button type="submit" class="wpsp-btn wpsp-btn-success"><?php echo esc_html(apply_filters( 'wpsp_subject_mark_field_button_submit_text',"Submit"),"wpschoolpress"); ?></button> |
| 217 |
<button type="button" class="wpsp-btn wpsp-dark-btn" data-dismiss="modal"><?php echo esc_html(apply_filters( 'wpsp_subject_mark_field_button_cancel_text',"Cancel"),"wpschoolpress"); ?></button> |
| 218 |
</div> |
| 219 |
</div> |
| 220 |
</div> |
| 221 |
</form> |
| 222 |
</div> |
| 223 |
</div> |
| 224 |
</div> |
| 225 |
</div> |
| 226 |
</div> |
| 227 |
<!-- End popup --> |
| 228 |
</div> |
| 229 |
<?php |
| 230 |
} |
| 231 |
} else if(isset($_GET['sc'])&& sanitize_text_field($_GET['sc'])=='WrkHours') { |
| 232 |
//Class Hours |
| 233 |
if(isset($_POST['AddHours'])){ |
| 234 |
if (!isset($_POST['wps_wrkhrs_nonce']) || !wp_verify_nonce(sanitize_text_field($_POST['wps_wrkhrs_nonce']) , 'WPSwrkhours')){ |
| 235 |
echo "<div class='col-md-12'><div class='alert alert-danger'>".esc_html( 'Unauthorizrd submmison or unknown nonce','wpschoolpress')."</div></div>"; |
| 236 |
} |
| 237 |
wpsp_Authenticate(); |
| 238 |
$workinghour_table = $wpdb->prefix."wpsp_workinghours"; |
| 239 |
if( empty( $_POST['hname'] ) || empty( $_POST['hstart'] ) || empty( $_POST['hend']) || sanitize_text_field($_POST['htype'])=='' ) { |
| 240 |
echo "<div class='col-md-12'><div class='alert alert-danger'>".esc_html( 'Please fill all values.', 'wpschoolpress')."</div></div>"; |
| 241 |
} elseif( strtotime( $_POST['hend'] ) <= strtotime( $_POST['hstart'] ) ) { |
| 242 |
echo "<div class='col-md-12'><div class='alert alert-danger'>".esc_html( 'Invalid Class Time.', 'wpschoolpress')."</div></div>"; |
| 243 |
} else { |
| 244 |
$workinghour_namelist = $wpdb->get_var( $wpdb->prepare( "SELECT count( * ) AS total_hour FROM $workinghour_table WHERE HOUR = %s", $_POST['hname'] ) ); |
| 245 |
if( $workinghour_namelist > 0 ) { |
| 246 |
echo "<div class='col-md-12'><div class='alert alert-danger'>".esc_html( 'Class Hour Name Already exists.', 'wpschoolpress')."</div></div>"; |
| 247 |
} else { |
| 248 |
$workinghour_table_data = array('hour' => sanitize_text_field($_POST['hname']), |
| 249 |
'begintime' => sanitize_text_field( $_POST['hstart'] ), |
| 250 |
'endtime' => sanitize_text_field( $_POST['hend'] ), |
| 251 |
'type' => sanitize_text_field( $_POST['htype'] ) |
| 252 |
); |
| 253 |
$ins=$wpdb->insert( $workinghour_table,$workinghour_table_data); |
| 254 |
} |
| 255 |
} |
| 256 |
} |
| 257 |
if( isset($_GET['ac']) && sanitize_text_field($_GET['ac'])=='DeleteHours' ) { |
| 258 |
$workinghour_table=$wpdb->prefix."wpsp_workinghours"; |
| 259 |
$hid=intval($_GET['hid']); |
| 260 |
$del=$wpdb->delete($workinghour_table,array('id'=>$hid)); |
| 261 |
} |
| 262 |
//Save hours |
| 263 |
?> |
| 264 |
<div class="wpsp-card-body"> |
| 265 |
<form name="working_hour" method="post" action=""> |
| 266 |
<?php wp_nonce_field( 'WPSwrkhours', 'wps_wrkhrs_nonce', '', true ); ?> |
| 267 |
<div class="wpsp-form-group"> |
| 268 |
<h3 class="wpsp-card-title"><?php echo esc_html(apply_filters('wpsp_workinghours_heading_item', 'Class hours'), 'wpschoolpress');?></h3> |
| 269 |
</div> |
| 270 |
<div class="wpsp-row"> |
| 271 |
<?php |
| 272 |
do_action("wpsp_workinghours_before"); |
| 273 |
$item = array(); |
| 274 |
?> |
| 275 |
<div class="wpsp-col-md-4"> |
| 276 |
<div class="wpsp-form-group"> |
| 277 |
<label class="wpsp-label"> |
| 278 |
<?php esc_html_e("Class Hour Name","wpschoolpress"); ?> |
| 279 |
</label> |
| 280 |
<input type="text" name="hname" class="wpsp-form-control"> |
| 281 |
</div> |
| 282 |
</div> |
| 283 |
<div class="wpsp-col-md-2 wpsp-col-sm-6"> |
| 284 |
<div class="wpsp-form-group"> |
| 285 |
<label class="wpsp-label"> |
| 286 |
<?php esc_html_e("From","wpschoolpress"); ?> |
| 287 |
</label> |
| 288 |
<input type="text" name="hstart" class="wpsp-form-control" id="timepicker1"> |
| 289 |
</div> |
| 290 |
</div> |
| 291 |
<div class="wpsp-col-md-2 wpsp-col-sm-6"> |
| 292 |
<div class="wpsp-form-group"> |
| 293 |
<label class="wpsp-label"> |
| 294 |
<?php esc_html_e("To","wpschoolpress"); ?> |
| 295 |
</label> |
| 296 |
<input type="text" name="hend" class="wpsp-form-control" id="wp-end-time" data-provide="timepicker"> |
| 297 |
</div> |
| 298 |
</div> |
| 299 |
<div class="wpsp-col-md-4"> |
| 300 |
<div class="wpsp-form-group"> |
| 301 |
<label class="wpsp-label"> |
| 302 |
<?php esc_html_e("Type","wpschoolpress"); ?> |
| 303 |
</label> |
| 304 |
<select name="htype" class="wpsp-form-control"> |
| 305 |
<option value="1"><?php esc_html_e( 'Teaching', 'wpschoolpress' ); ?></option> |
| 306 |
<option value="0"><?php esc_html_e( 'Break', 'wpschoolpress' ); ?></option> |
| 307 |
</select> |
| 308 |
</div> |
| 309 |
</div> |
| 310 |
<div class="wpsp-col-md-12"> |
| 311 |
<div class="wpsp-form-group"> |
| 312 |
<button type="submit" class="wpsp-btn wpsp-btn-success" name="AddHours" value="AddHours"><i class="fa fa-plus"></i> <?php esc_html_e( 'Add Hour', 'wpschoolpress' ); ?></button> |
| 313 |
</div> |
| 314 |
</div> |
| 315 |
</div> |
| 316 |
<?php do_action("wpsp_workinghours_after"); ?> |
| 317 |
</form> |
| 318 |
<table class="wpsp-table" id="wpsp_class_hours" cellspacing="0" width="100%" style="width:100%"> |
| 319 |
<thead> |
| 320 |
<tr> |
| 321 |
<th><?php esc_html_e( 'Class Hour', 'wpschoolpress' ); ?></th> |
| 322 |
<th><?php esc_html_e( 'Begin Time', 'wpschoolpress' ); ?></th> |
| 323 |
<th><?php esc_html_e( 'End Time', 'wpschoolpress' ); ?></th> |
| 324 |
<th><?php esc_html_e( 'Type', 'wpschoolpress' ); ?></th> |
| 325 |
<th class="nosort"><?php esc_html_e( 'Action', 'wpschoolpress' ); ?></th> |
| 326 |
</tr> |
| 327 |
</thead> |
| 328 |
<tbody> |
| 329 |
<?php |
| 330 |
$htypes=array('Break','Teaching'); |
| 331 |
$workinghour_table=$wpdb->prefix."wpsp_workinghours"; |
| 332 |
$workinghour_list =$wpdb->get_results("SELECT * FROM $workinghour_table") ; |
| 333 |
foreach ($workinghour_list as $single_workinghour) { |
| 334 |
$hourtype=$htypes[$single_workinghour->type]; ?> |
| 335 |
<tr> |
| 336 |
<td><?php echo esc_html(stripslashes( $single_workinghour->hour) ) ?></td> |
| 337 |
<td><?php echo esc_html($single_workinghour->begintime) ?></td> |
| 338 |
<td><?php echo esc_html($single_workinghour->endtime) ?></td> |
| 339 |
<td><?php echo esc_html($hourtype) ?></td> |
| 340 |
<td> |
| 341 |
<div class="wpsp-action-col"> |
| 342 |
<a href="<?php echo esc_url(wpsp_admin_url().'sch-settings&sc=WrkHours&ac=DeleteHours&hid='.esc_attr(intval($single_workinghour->id))); ?>" title="Delete" class="delete"><i class="icon wpsp-trash wpsp-delete-icon"></i></a> |
| 343 |
</div> |
| 344 |
</td> |
| 345 |
</tr> |
| 346 |
<?php } ?> |
| 347 |
</tbody> |
| 348 |
<tfoot> |
| 349 |
<tr> |
| 350 |
<th><?php esc_html_e( 'Class Hour', 'wpschoolpress' ); ?> </th> |
| 351 |
<th><?php esc_html_e( 'Begin Time', 'wpschoolpress' ); ?></th> |
| 352 |
<th><?php esc_html_e( 'End Time', 'wpschoolpress' ); ?></th> |
| 353 |
<th><?php esc_html_e( 'Type', 'wpschoolpress' ); ?></th> |
| 354 |
<th class="nosort"><?php esc_html_e( 'Action', 'wpschoolpress' ); ?></th> |
| 355 |
</tr> |
| 356 |
</tfoot> |
| 357 |
</table> |
| 358 |
</div> |
| 359 |
<?php |
| 360 |
}else{ |
| 361 |
//General Settings |
| 362 |
$wpsp_settings_table = $wpdb->prefix."wpsp_settings"; |
| 363 |
$wpsp_settings_edit = $wpdb->get_results("SELECT * FROM $wpsp_settings_table" ); |
| 364 |
foreach( $wpsp_settings_edit as $sdat ) { |
| 365 |
$settings_data[$sdat->option_name] = $sdat->option_value; |
| 366 |
} |
| 367 |
?> |
| 368 |
<div class="wpsp-card-body"> |
| 369 |
<div class="tabSec wpsp-nav-tabs-custom" id="verticalTab"> |
| 370 |
<div class="tabList"> |
| 371 |
<ul class="wpsp-resp-tabs-list"> |
| 372 |
<li class="wpsp-tabing" title="Info"><?php echo esc_html(apply_filters( 'wpsp_settings_tab_info_heading', 'Info'), 'wpschoolpress' ); ?></li> |
| 373 |
<li class="wpsp-tabing <?php echo esc_attr($proclass); ?>" title="<?php echo esc_attr($protitle);?>" <?php echo esc_html($prodisable); ?> title="An overdose in each drop"><?php echo esc_html(apply_filters( 'wpsp_settings_tab_sms_', 'SMS'), 'wpschoolpress' ); ?></li> |
| 374 |
<li class="wpsp-tabing" title="Licensing"><?php echo esc_html(apply_filters( 'wpsp_settings_tab_info_heading', 'Licensing'), 'wpschoolpress' ); ?></li> |
| 375 |
<?php do_action('wpsp_settings_tabs'); ?> |
| 376 |
</ul> |
| 377 |
</div> |
| 378 |
<div class="wpsp-tabBody wpsp-resp-tabs-container"> |
| 379 |
<div class="wpsp-tabMain"> |
| 380 |
<form name="schinfo_form" id="SettingsInfoForm" class="wpsp-form-horizontal" method="post"> |
| 381 |
<?php wp_nonce_field( 'SettingsFields', 'setingssub_nonce', '', true ) ?> |
| 382 |
<?php do_action('wpsp_before_setting_info'); |
| 383 |
$item = array(); |
| 384 |
?> |
| 385 |
<div class="wpsp-row"> |
| 386 |
<div class="wpsp-form-group"> |
| 387 |
<div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-6 wpsp-col-xs-12"> |
| 388 |
<div class="wpsp-form-group"> |
| 389 |
<label class="wpsp-label"> |
| 390 |
<?php esc_html_e("School Logo","wpschoolpress"); ?> |
| 391 |
</label> |
| 392 |
<div class="wpsp-profileUp"> |
| 393 |
<?php $url = plugins_url( 'img/wpschoolpresslogo.jpg', dirname(__FILE__) ); ?> |
| 394 |
<img src="<?php echo isset( $settings_data['sch_logo'] ) ? esc_url($settings_data['sch_logo']) : esc_url($url);?>" id="img_preview" onchange="imagePreview(this);" height="150px" width="150px" class="wpsp-upAvatar" /> |
| 395 |
<div class="wpsp-upload-button"> |
| 396 |
<i class="fa fa-camera"></i> |
| 397 |
<input type="hidden" name="old_img" id="old_image" value="<?php echo isset( $settings_data['sch_logo'] ) ? esc_attr($settings_data['sch_logo']) : esc_attr($url);?>"> |
| 398 |
<input name="displaypicture" class="wpsp-file-upload" id="displaypicture" type="file" accept="image/jpg, image/jpeg, image/png" > |
| 399 |
</div> |
| 400 |
</div> |
| 401 |
<p class="wpsp-form-notes">* <?php esc_html_e( 'Only JPEG, JPG and PNG supported, * Max 3 MB Upload', 'wpschoolpress' ); ?> </p> |
| 402 |
<label id="displaypicture-error" class="error" for="displaypicture" style="display: none;"><?php esc_html_e( 'Please Upload Profile Image', 'wpschoolpress' ); ?></label> |
| 403 |
<p id="test" style="color:red"></p> |
| 404 |
</div> |
| 405 |
</div> |
| 406 |
<div class="wpsp-col-lg-3 wpsp-col-md-8 wpsp-col-sm-6 wpsp-col-xs-12"> |
| 407 |
<div class="wpsp-form-group"> |
| 408 |
<label class="wpsp-label"><?php |
| 409 |
esc_html_e("School Name","wpschoolpress"); |
| 410 |
?> |
| 411 |
</label> |
| 412 |
<input type="text" name="sch_name" class="wpsp-form-control" value="<?php echo (isset( $settings_data['sch_name'] ) ? esc_attr($settings_data['sch_name']) : '');?>"> |
| 413 |
</div> |
| 414 |
</div> |
| 415 |
<div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-6 wpsp-col-xs-12"> |
| 416 |
<div class="wpsp-form-group"> |
| 417 |
<label class="wpsp-label" for="phone"> |
| 418 |
<?php esc_html_e("Phone","wpschoolpress"); ?> |
| 419 |
</label> |
| 420 |
<input type="text" class="wpsp-form-control" id="phone" name="Phone" placeholder="(XXX)-(XXX)-(XXXX)" value="<?php echo isset( $settings_data['sch_pno'] ) ? esc_attr($settings_data['sch_pno']) : '';?>"> |
| 421 |
</div> |
| 422 |
</div> |
| 423 |
<div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-6 wpsp-col-xs-12"> |
| 424 |
<div class="wpsp-form-group"> |
| 425 |
<label class="wpsp-label" for="phone"> |
| 426 |
<?php esc_html_e("Email Address","wpschoolpress"); ?> |
| 427 |
</label> |
| 428 |
<input type="text" class="wpsp-form-control" id="email" name="email" placeholder="Email" value="<?php echo isset( $settings_data['sch_email'] ) ? esc_attr($settings_data['sch_email']) : '';?>"> |
| 429 |
</div> |
| 430 |
</div> |
| 431 |
<div class="wpsp-col-lg-9 wpsp-col-md-12 wpsp-col-sm-12 wpsp-col-xs-12"> |
| 432 |
<div class="wpsp-form-group"> |
| 433 |
<label class="wpsp-label" for="Address"> |
| 434 |
<?php esc_html_e("Address","wpschoolpress"); ?><!-- <span class="wpsp-required">*</span> --> |
| 435 |
</label> |
| 436 |
<textarea rows="2" cols="45" name="sch_addr" class="wpsp-form-control"><?php echo isset( $settings_data['sch_addr'] ) ? esc_attr($settings_data['sch_addr']) : '';?></textarea> |
| 437 |
</div> |
| 438 |
</div> |
| 439 |
<div class="wpsp-col-lg-3 wpsp-col-md-6 wpsp-col-sm-6 wpsp-col-xs-12"> |
| 440 |
<div class="wpsp-form-group"> |
| 441 |
<label class="wpsp-label"> |
| 442 |
<?php esc_html_e("City","wpschoolpress"); ?> |
| 443 |
</label> |
| 444 |
<input type="text" name="sch_city" class="wpsp-form-control" value="<?php echo isset( $settings_data['sch_city'] ) ? esc_attr($settings_data['sch_city']) : '';?>"> |
| 445 |
</div> |
| 446 |
</div> |
| 447 |
<div class="wpsp-col-lg-3 wpsp-col-md-6 wpsp-col-sm-6 wpsp-col-xs-12"> |
| 448 |
<div class="wpsp-form-group"> |
| 449 |
<label class="wpsp-label"> |
| 450 |
<?php esc_html_e("State","wpschoolpress"); ?> |
| 451 |
</label> |
| 452 |
<input type="text" name="sch_state" class="wpsp-form-control" value="<?php echo isset( $settings_data['sch_state'] ) ? esc_attr($settings_data['sch_state']) : '';?>"> |
| 453 |
</div> |
| 454 |
</div> |
| 455 |
<div class="wpsp-col-lg-3 wpsp-col-md-6 wpsp-col-sm-6 wpsp-col-xs-12"> |
| 456 |
<div class="wpsp-form-group"> |
| 457 |
<label class="wpsp-label" for="Country"> |
| 458 |
<?php esc_html_e("Country","wpschoolpress"); ?> |
| 459 |
</label> |
| 460 |
<select class="wpsp-form-control" id="Country" name="country"> |
| 461 |
<option value=""><?php esc_html_e( 'Select Country', 'wpschoolpress' ); ?></option> |
| 462 |
<?php $country = wpsp_county_list(); |
| 463 |
foreach ($country as $key => $value) {?> |
| 464 |
<option value=<?php echo esc_attr($key);?><?php if($key == $settings_data['sch_country']){ echo ' selected';}?>><?php echo esc_html($value); ?></option> |
| 465 |
<?php } ?> |
| 466 |
</select> |
| 467 |
</div> |
| 468 |
</div> |
| 469 |
<div class="wpsp-col-lg-3 wpsp-col-md-6 wpsp-col-sm-6 wpsp-col-xs-12"> |
| 470 |
<div class="wpsp-form-group"> |
| 471 |
<label class="wpsp-label"> |
| 472 |
<?php esc_html_e("Fax","wpschoolpress"); ?> |
| 473 |
</label> |
| 474 |
<input type="text" name="sch_fax" class="wpsp-form-control" value="<?php echo isset( $settings_data['sch_fax'] ) ? esc_attr($settings_data['sch_fax']) :'';?>"> |
| 475 |
</div> |
| 476 |
</div> |
| 477 |
<div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 478 |
<div class="wpsp-form-group"> |
| 479 |
<label class="wpsp-label"> |
| 480 |
<?php esc_html_e("Website","wpschoolpress"); ?> |
| 481 |
</label> |
| 482 |
<input type="text" name="sch_website" class="wpsp-form-control" value="<?php echo isset( $settings_data['sch_website'] ) ? esc_attr($settings_data['sch_website']) : '';?>"> |
| 483 |
<input type="hidden" name="type" value="info"> |
| 484 |
</div> |
| 485 |
</div> |
| 486 |
<div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 487 |
<div class="wpsp-form-group"> |
| 488 |
<label class="wpsp-label"> |
| 489 |
<?php esc_html_e("Date Format","wpschoolpress"); ?> |
| 490 |
</label> |
| 491 |
<select name="date_format" class="wpsp-form-control"> |
| 492 |
<option value="m/d/Y" <?php echo isset( $settings_data['date_format'] ) && ( $settings_data['date_format']=='m/d/Y')?'selected':''?>><?php esc_html_e( 'mm/dd/yyyy', 'wpschoolpress' ); ?></option> |
| 493 |
<option value="Y-m-d" <?php echo isset( $settings_data['date_format'] ) && ($settings_data['date_format']=='Y-m-d')?'selected':''?> ><?php esc_html_e( 'yyyy-mm-dd', 'wpschoolpress' ); ?></option> |
| 494 |
<option value="d-m-Y" <?php echo isset( $settings_data['date_format'] ) && ($settings_data['date_format']=='d-m-Y')?'selected':''?>><?php esc_html_e( 'dd-mm-yyyy', 'wpschoolpress' ); ?></option> |
| 495 |
</select> |
| 496 |
</div> |
| 497 |
</div> |
| 498 |
<div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 499 |
<div class="wpsp-form-group"> |
| 500 |
<label class="wpsp-label"> |
| 501 |
<?php esc_html_e("Marks Type","wpschoolpress"); ?> |
| 502 |
</label> |
| 503 |
<select name="markstype" class="wpsp-form-control"> |
| 504 |
<option value="Number" <?php echo isset( $settings_data['markstype'] ) && ( $settings_data['markstype']=='Number')?'selected':''?>><?php esc_html_e( 'Number', 'wpschoolpress' ); ?> </option> |
| 505 |
<option value="Grade" <?php echo isset( $settings_data['markstype'] ) && ($settings_data['markstype']=='Grade')?'selected':''?>><?php esc_html_e( 'Grade', 'wpschoolpress' ); ?> </option> |
| 506 |
</select> |
| 507 |
</div> |
| 508 |
</div> |
| 509 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-12 wpsp-col-xs-12"> |
| 510 |
<div class="wpsp-form-group <?php echo esc_attr($proclass); ?>" title="<?php echo esc_attr($protitle);?>" <?php echo esc_attr($prodisable); ?>> |
| 511 |
<label class="wpsp-label"><?php esc_html_e( 'SMS Setting' ,'wpschoolpress'); ?></label> |
| 512 |
<input id="absent_sms_alert" type="checkbox" class="wpsp-checkbox ccheckbox <?php echo esc_attr($proclass); ?> " title="<?php echo esc_attr($protitle);?>" <?php echo esc_html($prodisable); ?> <?php if(isset($settings_data['absent_sms_alert']) && $settings_data['absent_sms_alert']==1) echo "checked"; ?> name="absent_sms_alert" value="1" > |
| 513 |
<label for="absent_sms_alert" class="wpsp-checkbox-label"> <?php esc_html_e( 'Send SMS to parent when student absent','wpschoolpress');?></label> |
| 514 |
<input id="notification_sms_alert" type="checkbox" class="wpsp-checkbox ccheckbox <?php echo esc_attr($proclass); ?>" title="<?php echo esc_attr($protitle);?>" <?php echo esc_html($prodisable); ?> <?php if(isset($settings_data['notification_sms_alert']) && $settings_data['notification_sms_alert']==1) echo "checked"; ?> name="notification_sms_alert" value="1" > |
| 515 |
<label for="notification_sms_alert" class="wpsp-checkbox-label"> <?php esc_html_e( 'Enable SMS Notification','wpschoolpress');?></label> |
| 516 |
</div> |
| 517 |
</div> |
| 518 |
<div class="wpsp-col-md-12 wpsp-col-sm-12 wpsp-col-xs-12"> |
| 519 |
<div class="wpsp-form-group"> |
| 520 |
<button type="submit" class="wpsp-btn wpsp-btn-success" id="setting_submit" name="submit" style="margin-top: 20px;!important" > <?php esc_html_e( 'Save', 'wpschoolpress' ); ?></button> |
| 521 |
</div> |
| 522 |
</div> |
| 523 |
</div> |
| 524 |
</div> |
| 525 |
<?php |
| 526 |
do_action('wpsp_after_setting_info'); |
| 527 |
?> |
| 528 |
</form> |
| 529 |
</div> |
| 530 |
|
| 531 |
<div class="wpsp-tabMain"> |
| 532 |
<?php |
| 533 |
if( isset( $proversion['status'] ) && $proversion['status'] ) { |
| 534 |
do_action( 'wpsp_sms_setting_html', $settings_data ); |
| 535 |
} else { |
| 536 |
echo esc_html( 'Please Purchase This'). '<a href="https://wpschoolpress.com/downloads/sms-add-on-wpschoolpress/" target="_blank">Add-on</a>'; |
| 537 |
} |
| 538 |
?> |
| 539 |
</div> |
| 540 |
|
| 541 |
<div class="wpsp-tabMain"> |
| 542 |
<form name="Settingslicensing" id="Settingslicensing" class="wpsp-form-horizontal" method="post"> |
| 543 |
<?php wp_nonce_field( 'SettingsLisence', 'wps_setlisence_nonce', '', true ) ?> |
| 544 |
<div class="wpsp-row"> |
| 545 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 546 |
<div class="wpsp-form-group"> |
| 547 |
<label class="wpsp-label"> |
| 548 |
<?php do_action('wpsp_before_license'); |
| 549 |
esc_html_e("Import Export","wpschoolpress"); |
| 550 |
?> |
| 551 |
</label> |
| 552 |
<input type="text" name="importexport" class="wpsp-form-control" value="<?php echo isset( $settings_data['importexport'] ) ? esc_attr($settings_data['importexport']) : '';?>"> |
| 553 |
</div> |
| 554 |
</div> |
| 555 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 556 |
<div class="wpsp-form-group"> |
| 557 |
<label class="wpsp-label"> |
| 558 |
<?php esc_html_e("SMS Addons: ","wpschoolpress");?> |
| 559 |
</label> |
| 560 |
<input type="text" name="smsaddons" class="wpsp-form-control" value="<?php echo isset( $settings_data['smsaddons'] ) ? esc_attr($settings_data['smsaddons']) : '';?>"> |
| 561 |
</div> |
| 562 |
</div> |
| 563 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 564 |
<div class="wpsp-form-group"> |
| 565 |
<label class="wpsp-label"><?php esc_html_e("Front End Registration Addons: ","wpschoolpress");?></label> |
| 566 |
<input type="text" name="feraddons" class="wpsp-form-control" value="<?php echo isset( $settings_data['feraddons'] ) ? esc_attr($settings_data['feraddons']) : '';?>"> |
| 567 |
</div> |
| 568 |
</div> |
| 569 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 570 |
<div class="wpsp-form-group mes-dedeactivate-block"> |
| 571 |
<label class="wpsp-label"><?php esc_html_e("Dashboard to Dashboard Message Addons : ","wpschoolpress");?></label> |
| 572 |
<input type="text" name="ddma" class="wpsp-form-control" value="<?php echo isset( $settings_data['ddma'] ) ? esc_attr($settings_data['ddma']) : '';?>"> |
| 573 |
<?php if($prodisablemessage == 'installed'){ ?> |
| 574 |
<button type="button" id="message-license-deactivate" class="wpsp-btn wpsp-btn-denger"><?php echo esc_html("Deactivate","wpschoolpress");?></button> |
| 575 |
<?php } ?> |
| 576 |
</div> |
| 577 |
</div> |
| 578 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 579 |
<div class="wpsp-form-group mes-dedeactivate-block"> |
| 580 |
<label class="wpsp-label"><?php esc_html_e("Multi-class Add-on :","wpschoolpress");?></label> |
| 581 |
<input type="text" name="mcaon" class="wpsp-form-control" value="<?php echo isset( $settings_data['mcaon'] ) ? esc_attr($settings_data['mcaon']) : '';?>"> |
| 582 |
<?php if($prodisablehistory == 'installed'){ ?> |
| 583 |
<button type="button" id="multi-license-deactivate" class="wpsp-btn wpsp-btn-denger"><?php echo esc_html("Deactivate","wpschoolpress");?></button> |
| 584 |
<?php } ?> |
| 585 |
</div> |
| 586 |
</div> |
| 587 |
<!-- Add Payment Lisenece button --> |
| 588 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 589 |
<div class="wpsp-form-group mes-dedeactivate-block"> |
| 590 |
<label class="wpsp-label"><?php esc_html_e("Online Fee Payment Addons :","wpschoolpress");?></label> |
| 591 |
<input type="text" name="onlinepay" class="wpsp-form-control" value="<?php echo isset( $settings_data['onlinepay'] ) ? esc_attr($settings_data['onlinepay']) : '';?>"> |
| 592 |
<?php if($propayment == 'installed'){ ?> |
| 593 |
<?php } ?> |
| 594 |
</div> |
| 595 |
</div> |
| 596 |
<!-- Add Social Media Lisenece button --> |
| 597 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 598 |
<div class="wpsp-form-group mes-dedeactivate-block"> |
| 599 |
<label class="wpsp-label"><?php esc_html_e("Social Posts Addons :","wpschoolpress");?></label> |
| 600 |
<input type="text" name="socialmedia" class="wpsp-form-control" value="<?php echo isset( $settings_data['socialmedia'] ) ? esc_attr($settings_data['socialmedia']) : '';?>"> |
| 601 |
</div> |
| 602 |
</div> |
| 603 |
<!-- Add LMS Lisenece button --> |
| 604 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-4 wpsp-col-xs-12"> |
| 605 |
<div class="wpsp-form-group mes-dedeactivate-block"> |
| 606 |
<label class="wpsp-label"><?php esc_html_e("LMS Addons :","wpschoolpress");?></label> |
| 607 |
<input type="text" name="wpslms" class="wpsp-form-control" value="<?php echo isset( $settings_data['wpslms'] ) ? esc_attr($settings_data['wpslms']) : '';?>"> |
| 608 |
</div> |
| 609 |
</div> |
| 610 |
<?php do_action('wpsp_after_license'); ?> |
| 611 |
<div class="wpsp-col-lg-12 wpsp-col-md-12 wpsp-col-sm-12"> |
| 612 |
<div class="wpsp-form-group"> |
| 613 |
<button type="submit" id="s_save" class="wpsp-btn wpsp-btn-success" name="submit"><?php echo esc_html(apply_filters( 'wpsp_setting_licensig_button_submit_text','Save'),'wpschoolpress');?></button> |
| 614 |
</div> |
| 615 |
</div> |
| 616 |
</div> |
| 617 |
</form> |
| 618 |
</div> |
| 619 |
<?php do_action( 'wpsp_settings_tab_content' ); ?> |
| 620 |
</div> |
| 621 |
</div> |
| 622 |
</div> |
| 623 |
<?php } ?> |
| 624 |
</div> |
| 625 |
<?php } else if($current_user_role=='parent' || $current_user_role=='student') { |
| 626 |
} |
| 627 |
wpsp_body_end(); |
| 628 |
wpsp_footer(); ?> |
| 629 |
<?php |
| 630 |
}else { |
| 631 |
include_once( WPSP_PLUGIN_PATH.'/includes/wpsp-login.php'); |
| 632 |
} |
| 633 |
?> |