Changeset 2467512
- Timestamp:
- 02/03/2021 01:44:32 AM (5 years ago)
- Location:
- ebecas/trunk
- Files:
-
- 9 edited
-
admin/Eit_Ebecas_Settings.php (modified) (2 diffs)
-
eit-ebecas.php (modified) (2 diffs)
-
includes/Eit_Ebecas_Controller.php (modified) (4 diffs)
-
includes/Eit_Ebecas_Email_Verification.php (modified) (5 diffs)
-
includes/css/styles.css (modified) (1 diff)
-
includes/js/scripts.js (modified) (19 diffs)
-
includes/recaptcha/recaptcha.php (modified) (1 diff)
-
public/Eit_Ebecas_Student_Portal.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ebecas/trunk/admin/Eit_Ebecas_Settings.php
r2413660 r2467512 157 157 'default' => 'up', 158 158 ), 159 array( 160 'uid' => EIT_EBECAS_OPTION_PREFIX . 'email_verification', 161 'label' => 'Email Verification', 162 'section' => 'eit_ebecas_other_setting_section', 163 'type' => 'radio', 164 'options' => array( 165 'true' => 'Enable - User must verify their email address to submit application.', 166 'false' => 'Disable - Allow application submission without verifying email address.' 167 ), 168 'default' => 'true', 169 ), 159 170 ); 160 171 foreach ( $fields as $field ) { … … 170 181 public function eit_ebecas_field_callback( $arguments ) { 171 182 $value = get_option( $arguments['uid'] ); // Get the current value, if there is one 172 if ( ! $value ) { // If no value exists173 $value = $arguments['default']; // Set to our default174 }183 // if ( ! $value ) { // If no value exists 184 // // $value = $arguments['default']; // Set to our default 185 // } 175 186 176 187 switch ( $arguments['type'] ) { -
ebecas/trunk/eit-ebecas.php
r2420569 r2467512 5 5 Plugin URI: https://ebecas.com.au/wordpress-plugin 6 6 Description: Using this plugin students can submit online application directly from school/college website. Submitted application with student details along with course and other products will be recorded in eBecas for further processing. 7 Version: 1. 77 Version: 1.8 8 8 Requires at least: 5.3 9 9 Requires PHP: 7.0 … … 40 40 41 41 define( 'EIT_EBECAS_OPTION_PREFIX', 'eit_ebecas_' ); 42 43 define( 'EIT_EBECAS_SHORTCODE', 'eit_ebecas_student_portal' ); 42 44 43 45 define( 'EIT_EBECAS_EMAIL_CODE_LENGTH', 5 ); -
ebecas/trunk/includes/Eit_Ebecas_Controller.php
r2420569 r2467512 28 28 array( 'jquery' ), EIT_EBECAS_VERSION, true ); 29 29 30 $service = Eit_Ebecas_Email_Verification::get_instance(); 30 31 $eit_ebecas = array( 31 32 'ajaxurl' => admin_url( 'admin-ajax.php' ), 32 33 'security' => wp_create_nonce( 'eit_ebecas_security_nounce' ), 34 'email_verification_enabled' => $service->is_enabled() ? Eit_Ebecas_Email_Verification::EMAIL_VERIFICATION_ENABLED : Eit_Ebecas_Email_Verification::EMAIL_VERIFICATION_DISABLED, 33 35 ); 34 36 … … 141 143 $html = '<p>Thank you for applying. We have received your application you will hear from us shortly.</p>' . 142 144 '<p>Below are your application details for future reference.<br/></p>' . 143 '<p>Student ID: ' . $offer['StudentId'] . '</p>' .144 '<p>Application Number: ' . $offer['OfferId'] . '</p>' .145 '<table border="1" ><thead><tr>' .145 '<p>Student ID: ' . $offer['StudentId'] . '<br/>' . 146 'Application Number: ' . $offer['OfferId'] . '</p>' . 147 '<table border="1" class = "eit_ebecas_th_des"><thead><tr>' . 146 148 '<th>Description</th>' . 147 149 '<th>Amount</th>' . … … 204 206 $dob = sanitize_text_field( $_POST["eit_ebecas_dob"] ); 205 207 $mobile = sanitize_text_field( $_POST["eit_ebecas_mobile"] ); 206 $email_code = sanitize_text_field( $_POST["eit_ebecas_email_code"] );207 208 $course = (int) filter_var( $_POST["eit_ebecas_course"], FILTER_SANITIZE_NUMBER_INT ); 208 209 209 if ( empty( $first_name ) || empty( $last_name ) || empty( $email ) || empty($dob) || empty($mobile) || empty( $ email_code ) || empty( $course ) ) {210 if ( empty( $first_name ) || empty( $last_name ) || empty( $email ) || empty($dob) || empty($mobile) || empty( $course ) ) { 210 211 $reg_errors->add( 'field', 'Required form fields are missing.' ); 211 212 } … … 216 217 217 218 // check is email verified if not then don't do anything 219 $email_code = isset( $_POST["eit_ebecas_email_code"] ) ? sanitize_text_field( $_POST["eit_ebecas_email_code"] ) : ''; 218 220 $email_check = apply_filters( 'eit_ebecas_verify_application_code', $email, $email_code ); 219 221 if ( ! $email_check ) { -
ebecas/trunk/includes/Eit_Ebecas_Email_Verification.php
r2413660 r2467512 20 20 add_filter( 'eit_ebecas_send_application_code', 'eit_ebecas_send_application_code', 10, 1 ); 21 21 function eit_ebecas_send_application_code( $email ) { 22 23 $service = Eit_Ebecas_Email_Verification::get_instance(); 24 // if email verification is disabled then don't send verification code. 25 if ( ! $service->is_enabled() ) { 26 return true; 27 } 28 22 29 if ( ! is_email( $email ) ) { 23 30 return false; … … 29 36 } 30 37 31 $service = Eit_Ebecas_Email_Verification::get_instance();32 33 38 // get the blog administrator's email address 34 39 $from_email = $service->get_admin_email(); 35 40 $site_name = strtolower( $_SERVER['SERVER_NAME'] ); 36 41 $code = apply_filters( 'eit_ebecas_get_random_code', EIT_EBECAS_EMAIL_CODE_LENGTH ); 37 38 set_transient( $email, $code, EIT_EBECAS_EMAIL_CODE_EXPIRY_IN_HOUR * HOUR_IN_SECONDS );39 42 40 43 // $headers = "From: $site_name <$from_email>" . "\r\n"; … … 48 51 '</div>'; 49 52 50 return wp_mail( $email, $subject, $message, $headers ); 53 $result = wp_mail( $email, $subject, $message, $headers ); 54 55 if ( $result ) { 56 set_transient( $email, $code, EIT_EBECAS_EMAIL_CODE_EXPIRY_IN_HOUR * HOUR_IN_SECONDS ); 57 } 58 59 return $result; 51 60 } 52 61 53 62 add_filter( 'eit_ebecas_verify_application_code', 'eit_ebecas_verify_application_code', 10, 2 ); 54 63 function eit_ebecas_verify_application_code( $email, $code ) { 64 $service = Eit_Ebecas_Email_Verification::get_instance(); 65 // if email verification is disabled then don't send verification code. 66 if ( ! $service->is_enabled() ) { 67 return true; 68 } 69 55 70 if ( ! is_email( $email ) ) { 56 71 return false; … … 71 86 private static $instance; 72 87 public $admin_email = null; 88 const EMAIL_VERIFICATION_ENABLED = 'true'; 89 const EMAIL_VERIFICATION_DISABLED = 'false'; 73 90 74 91 public static function get_instance() { … … 87 104 return $this->admin_email; 88 105 } 106 107 public function is_enabled() { 108 if ( get_option( EIT_EBECAS_OPTION_PREFIX . 'email_verification' ) === self::EMAIL_VERIFICATION_DISABLED ) { 109 return false; 110 } 111 112 // default is true 113 return true; 114 } 89 115 } 90 116 } -
ebecas/trunk/includes/css/styles.css
r2413660 r2467512 1 /* Product padding */ 1 2 .eit_ebecas_product_padding { 2 padding: 15px 15px 0px 15px; 3 } 3 padding-top: 25px !important; 4 padding-right: 15px !important; 5 padding-bottom: 15px !important; 6 padding-left: 40px !important; 7 } 8 9 /* all placeholder */ 10 #eit_ebecas_form ::placeholder { 11 font-size: small !important; 12 13 } 14 15 /* Product Input */ 16 .eit_ebecas_product_padding input { 17 padding-bottom: 15px !important; 18 } 19 20 /* whole from backgraound */ 21 .bg1 { 22 background-color: #f7f7f7; 23 } 24 25 /* Form */ 26 #eit_ebecas_form { 27 width: 100%; 28 display: -webkit-box; 29 display: -webkit-flex; 30 display: -moz-box; 31 display: -ms-flexbox; 32 display: flex; 33 flex-wrap: wrap; 34 justify-content: space-between; 35 } 36 37 /* First Container */ 38 #container-eit-ebecas_form { 39 width: 100% !important; 40 min-height: 100vh !important; 41 display: flex !important; 42 flex-wrap: wrap !important; 43 justify-content: center !important; 44 align-items: center !important; 45 padding: 15px !important; 46 background: #b4b0b0 !important; 47 48 } 49 50 /* Warp form (2nd div) */ 51 #wrap-eit-ebecas_form { 52 width: 920px; 53 background: #fff; 54 border-radius: 10px; 55 overflow: hidden; 56 padding: 62px 55px 90px 55px; 57 58 } 59 60 /* Form Title */ 61 #eit-ebecas-form-title { 62 display: block; 63 width: 100%; 64 font-size: 39px; 65 color: #333333; 66 line-height: 1.2; 67 text-align: center; 68 padding-bottom: 59px; 69 } 70 71 /* Div to wrap all the input and labels */ 72 .wrap-eit-ebecas-input { 73 width: 100%; 74 position: relative; 75 border: 1px solid #e6e6e6; 76 border-radius: 13px; 77 padding: 10px 30px 9px 22px !important; 78 margin-bottom: 20px; 79 background-color: #f7f7f7; 80 } 81 82 .eit_ebecas_course, 83 .eit_ebecas_insurance, 84 .eit_ebecas_accommodation, 85 .eit_ebecas_arrangement, 86 .eit_ebecas_airport_pickup, 87 .eit_ebecas_airport_dropoff, 88 .eit_ebecas_others { 89 width: 100%; 90 position: relative; 91 border: 1px solid #e6e6e6; 92 border-radius: 13px; 93 padding: 10px 30px 9px 22px; 94 margin-bottom: 20px; 95 background-color: #f7f7f7; 96 } 97 98 .eit_ebecas_email_code { 99 width: 100%; 100 position: relative; 101 border: 1px solid #e6e6e6; 102 border-radius: 13px; 103 padding: 10px 30px 9px 22px; 104 margin-bottom: 20px; 105 background-color: #f7f7f7; 106 } 107 108 .eit_ebecas_others select { 109 height: 100px; 110 } 111 112 #eit_ebecas_country, 113 #eit_ebecas_language, 114 #eit_ebecas_form_field, 115 #eit-location-select { 116 position: relative; 117 border: 1px solid #e6e6e6; 118 border-radius: 13px; 119 padding: 10px 30px 9px 22px; 120 margin-bottom: 20px; 121 background-color: #f7f7f7; 122 width: calc((100% - 30px) / 2); 123 } 124 125 /* Location */ 126 #eit-location-select { 127 margin-left: 30px; 128 } 129 130 /* form Labels */ 131 #eit_ebecas_form label { 132 font-size: 15px !important; 133 color: #393939 !important; 134 line-height: 1.5 !important; 135 font-family: arial, sans-serif !important; 136 font-weight: bold; 137 display: block; 138 } 139 140 /* Placeholder Tag */ 141 #eit_ebecas_form ::placeholder { 142 font-family: arial, sans-serif !important; 143 } 144 145 #eit_ebecas_form p input[type = "text"], [type = "email"] { 146 display: block !important; 147 width: 100% !important; 148 background: transparent !important; 149 font-size: 18px; 150 color: #555555 !important; 151 line-height: 1.2 !important; 152 padding-right: 15px !important; 153 height: 40px !important; 154 border: none !important; 155 } 156 157 158 #eit_ebecas_form p input[type = "email"] { 159 background: transparent !important; 160 } 161 162 .eit-rs1-wrap-input { 163 width: calc((100% - 30px) / 2); 164 } 165 166 .container-eit-form-btn { 167 display: -webkit-box !important; 168 display: -webkit-flex !important; 169 display: -moz-box !important; 170 display: -ms-flexbox !important; 171 display: flex !important; 172 flex-wrap: wrap !important; 173 justify-content: center !important; 174 padding-top: 20px !important; 175 width: 100% !important; 176 } 177 178 .container-eit-form-btn input[type="submit"] { 179 background-color: #1d2fd3 !important; 180 border: none !important; 181 color: white; 182 padding: 15px 32px; 183 text-align: center !important; 184 text-decoration: none; 185 display: inline-block; 186 font-size: 16px; 187 border-radius: 10px; 188 width: 300px !important; 189 190 } 191 192 #eit_ebecas_form select { 193 background: transparent !important; 194 border: 1px solid #f3f3f3 !important; 195 /* height: 3em !important; */ 196 max-width: 100% !important; 197 font-size: medium !important; 198 font-family: arial, sans-serif !important; 199 } 200 201 textarea { 202 display: block; 203 width: 100%; 204 background: transparent; 205 font-size: 18px; 206 color: #555555; 207 line-height: 1.2; 208 padding-right: 15px; 209 } 210 211 table { 212 border-collapse: collapse; 213 border-spacing: 0; 214 width: 100%; 215 border: 1px solid #ddd; 216 } 217 218 tr:nth-child(even) { 219 background-color: #f2f2f2 220 } 221 222 .eit_ebecas_th_des th, 223 .eit_ebecas_th_des td { 224 padding: 0 10px 0 10px !important; 225 } -
ebecas/trunk/includes/js/scripts.js
r2413660 r2467512 223 223 let email = $field_email.val(); 224 224 codeSendStatus = false; 225 226 // check if email verification is enabled if not then don't send verification code. 227 if (eit_ebecas.email_verification_enabled == 'false') { 228 codeSendStatus = true; 229 return codeSendStatus; 230 } 225 231 226 232 if (!email) { … … 267 273 268 274 function emptyAllSections() { 269 $section_insurance. empty();270 $section_accommodation. empty();271 $section_arrangement. empty();272 $section_airport_pickup. empty();273 $section_airport_dropoff. empty();274 $section_others. empty();275 $section_insurance.removeClass('eit_ebecas_insurance').empty(); 276 $section_accommodation.removeClass('eit_ebecas_accommodation').empty(); 277 $section_arrangement.removeClass('eit_ebecas_arrangement').empty(); 278 $section_airport_pickup.removeClass('eit_ebecas_airport_pickup').empty(); 279 $section_airport_dropoff.removeClass('eit_ebecas_airport_dropoff').empty(); 280 $section_others.removeClass('eit_ebecas_others').empty(); 275 281 $section_total.empty(); 276 282 } … … 280 286 $app.init(); 281 287 $app.selection.location_id = null; 282 $section_course.empty(); 288 $section_course.removeClass('eit_ebecas_course').empty(); 289 283 290 emptyAllSections(); 284 291 … … 328 335 $section_course.empty(); 329 336 $app.products.course = courses['Products']; 337 330 338 $section_course.append('<label for="eit_ebecas_course">Select Course <strong>*</strong></label>'); 331 339 … … 336 344 select.append($('<option></option>').attr('value', entry.ProductId).attr('data-faculty-id', entry.FacultyId).text(entry.Name)); 337 345 }) 338 339 $section_course.append(select); 340 346 347 348 $section_course.addClass('eit_ebecas_course').append(select); 349 341 350 // bind course change event 342 351 $field_course = select; … … 387 396 388 397 datePrice.append('<label for="eit_ebecas_course_start_date">Start Date</label>'); 389 let startDateInput = $('<input type="text" name="eit_ebecas_course_start_date" readonly="readonly" />');398 let startDateInput = $('<input type="text" name="eit_ebecas_course_start_date" readonly="readonly" placeholder="Please insert start date."/>'); 390 399 datePrice.append(startDateInput); 391 400 392 401 datePrice.append('<label for="eit_ebecas_course_weeks">Number of Study Weeks</label>'); 393 let weekInput = $('<input type="text" name="eit_ebecas_course_weeks" />');402 let weekInput = $('<input type="text" name="eit_ebecas_course_weeks" placeholder="Please insert number study weeks."/>'); 394 403 datePrice.append(weekInput); 395 404 396 405 datePrice.append('<label for="eit_ebecas_course_end_date">End Date</label>'); 397 let endDateInput = $('<input type="text" name="eit_ebecas_course_end_date" readonly="readonly" />');406 let endDateInput = $('<input type="text" name="eit_ebecas_course_end_date" readonly="readonly" placeholder="Please insert end date."/>'); 398 407 datePrice.append(endDateInput); 399 408 … … 407 416 userInputTimer = setTimeout(function () { 408 417 getEndDateOrWeeks(FACULTY_TYPE_ENDDATE); 409 410 418 endDateInput.prop("disabled", false).css("background-color", "#fff"); 411 419 }, USER_INPUT_TIMER_LIMIT) … … 547 555 function showInsuranceSection(insurance) { 548 556 $app.products.insurance = insurance['Products']; 549 $section_insurance.append('<label for="eit_ebecas_insurance">Select Insurance </label>');557 $section_insurance.append('<label for="eit_ebecas_insurance">Select Insurance Date </label>'); 550 558 551 559 let select = $('<select name="eit_ebecas_insurance" />'); … … 556 564 }) 557 565 558 $section_insurance.a ppend(select);566 $section_insurance.addClass('eit_ebecas_insurance').append(select); 559 567 560 568 // bind insurance change event … … 584 592 585 593 datePrice.append('<label for="eit_ebecas_insurance_start_date">Start Date</label>'); 586 let startDateInput = $('<input type="text" name="eit_ebecas_insurance_start_date" readonly="readonly" />');594 let startDateInput = $('<input type="text" name="eit_ebecas_insurance_start_date" readonly="readonly" placeholder="Please insert start date."/>'); 587 595 datePrice.append(startDateInput); 588 596 589 597 datePrice.append('<label for="eit_ebecas_insurance_end_date">End Date</label>'); 590 let endDateInput = $('<input type="text" name="eit_ebecas_insurance_end_date" readonly="readonly" />');598 let endDateInput = $('<input type="text" name="eit_ebecas_insurance_end_date" readonly="readonly" placeholder="Please insert end date."/>'); 591 599 datePrice.append(endDateInput); 592 600 … … 678 686 }) 679 687 680 $section_accommodation.append(select); 688 $section_accommodation.addClass('eit_ebecas_accommodation').append(select); 689 681 690 682 691 // bind accommodation change event … … 707 716 708 717 datePrice.append('<label for="eit_ebecas_accommodation_start_date">Check-in Date</label>'); 709 let startDateInput = $('<input type="text" name="eit_ebecas_accommodation_start_date" readonly="readonly" />');718 let startDateInput = $('<input type="text" name="eit_ebecas_accommodation_start_date" readonly="readonly" placeholder="Please insert check-in date."/>'); 710 719 datePrice.append(startDateInput); 711 720 712 721 datePrice.append('<label for="eit_ebecas_accommodation_end_date">Check-out Date</label>'); 713 let endDateInput = $('<input type="text" name="eit_ebecas_accommodation_end_date" readonly="readonly"/>');722 let endDateInput = $('<input type="text" name="eit_ebecas_accommodation_end_date" placeholder="Please insert check-out date." readonly="readonly"/>'); 714 723 datePrice.append(endDateInput); 715 724 … … 786 795 }) 787 796 788 $section_arrangement.a ppend(select);797 $section_arrangement.addClass('eit_ebecas_arrangement').append(select); 789 798 790 799 // bind arrangement change event … … 838 847 }) 839 848 840 $section_airport_pickup.a ppend(select);849 $section_airport_pickup.addClass('eit_ebecas_airport_pickup').append(select); 841 850 842 851 // bind course change event … … 856 865 }) 857 866 858 $section_airport_dropoff.a ppend(select);867 $section_airport_dropoff.addClass('eit_ebecas_airport_dropoff').append(select); 859 868 860 869 // bind course change event … … 898 907 899 908 datePrice.append('<label for="eit_ebecas_airport_pickup_start_date">Flight Date</label>'); 900 let startDateInput = $('<input type="text" name="eit_ebecas_airport_pickup_start_date" />');909 let startDateInput = $('<input type="text" name="eit_ebecas_airport_pickup_start_date" placeholder="Please insert your pick up date."/>'); 901 910 datePrice.append(startDateInput); 902 911 903 912 datePrice.append('<label for="eit_ebecas_airport_pickup_flight_time">Flight Time (24-hour format, e.g. 18:30)</label>'); 904 let endDateInput = $('<input type="text" name="eit_ebecas_airport_pickup_flight_time" />');913 let endDateInput = $('<input type="text" name="eit_ebecas_airport_pickup_flight_time" placeholder= "Please insert flight time."/>'); 905 914 datePrice.append(endDateInput); 906 915 907 916 datePrice.append('<label for="eit_ebecas_airport_pickup_flight_name">Flight Name</label>'); 908 datePrice.append($('<input type="text" name="eit_ebecas_airport_pickup_flight_name" maxlength="50" />'));917 datePrice.append($('<input type="text" name="eit_ebecas_airport_pickup_flight_name" maxlength="50" placeholder = "Please insert flight name."/>')); 909 918 910 919 datePrice.append('<label for="eit_ebecas_airport_pickup_flight_from">Flight Coming From</label>'); 911 datePrice.append($('<input type="text" name="eit_ebecas_airport_pickup_flight_from" maxlength="50" />'));920 datePrice.append($('<input type="text" name="eit_ebecas_airport_pickup_flight_from" maxlength="50" placeholder= "Please insert departure location."/>')); 912 921 913 922 datePrice.append('<label for="eit_ebecas_airport_pickup_flight_to">Flight Going To</label>'); 914 datePrice.append($('<input type="text" name="eit_ebecas_airport_pickup_flight_to" maxlength="50" />'));923 datePrice.append($('<input type="text" name="eit_ebecas_airport_pickup_flight_to" maxlength="50" placeholder= "Please insert your destiation location."/>')); 915 924 916 925 datePrice.append('<p id="eit_ebecas_airport_price"></p>'); … … 947 956 948 957 datePrice.append('<label for="eit_ebecas_airport_dropoff_start_date">Flight Date</label>'); 949 let startDateInput = $('<input type="text" name="eit_ebecas_airport_dropoff_start_date" />');958 let startDateInput = $('<input type="text" name="eit_ebecas_airport_dropoff_start_date" placeholder="Please insert drop-off date."/>'); 950 959 datePrice.append(startDateInput); 951 960 952 961 datePrice.append('<label for="eit_ebecas_airport_dropoff_flight_time">Flight Time (24-hour format, e.g. 18:30)</label>'); 953 let endDateInput = $('<input type="text" name="eit_ebecas_airport_dropoff_flight_time" />');962 let endDateInput = $('<input type="text" name="eit_ebecas_airport_dropoff_flight_time" placeholder="Please insert flight time."/>'); 954 963 datePrice.append(endDateInput); 955 964 956 965 datePrice.append('<label for="eit_ebecas_airport_dropoff_flight_name">Flight Name</label>'); 957 datePrice.append($('<input type="text" name="eit_ebecas_airport_dropoff_flight_name" maxlength="50" />'));966 datePrice.append($('<input type="text" name="eit_ebecas_airport_dropoff_flight_name" maxlength="50" placeholder="Please insert flight name."/>')); 958 967 959 968 datePrice.append('<label for="eit_ebecas_airport_dropoff_flight_from">Flight Coming From</label>'); 960 datePrice.append($('<input type="text" name="eit_ebecas_airport_dropoff_flight_from" maxlength="50" />'));969 datePrice.append($('<input type="text" name="eit_ebecas_airport_dropoff_flight_from" maxlength="50" placeholder="Please insert departure location."/>')); 961 970 962 971 datePrice.append('<label for="eit_ebecas_airport_dropoff_flight_to">Flight Going To</label>'); 963 datePrice.append($('<input type="text" name="eit_ebecas_airport_dropoff_flight_to" maxlength="50" />'));972 datePrice.append($('<input type="text" name="eit_ebecas_airport_dropoff_flight_to" maxlength="50" placeholder="Please insert destination location."/>')); 964 973 965 974 datePrice.append('<p id="eit_ebecas_airport_price"></p>'); … … 999 1008 }) 1000 1009 1001 $section_others.a ppend(select);1010 $section_others.addClass('eit_ebecas_others').append(select); 1002 1011 $section_others.append('<div><small>Hold the CTRL or CMD key and click the items in a list to choose them.</small></div>'); 1003 1012 … … 1053 1062 1054 1063 $section_code.empty(); 1064 1055 1065 // show input code - eit_ebecas_email_code 1056 1066 $section_code.append('<label for="eit_ebecas_email_code">Application Code <small>(sent to: ' + email + ' If the e-mail is not in your inbox, please check your junk mail or spam folders.)</small></label>'); 1057 $section_code.append($('<input type="text" name="eit_ebecas_email_code" required/>')); 1067 $section_code.append($('<input type="text" name="eit_ebecas_email_code" placeholder = "Please enter the code." required/>')); 1068 $section_code.addClass('eit_ebecas_email_code'); 1058 1069 } 1059 1070 -
ebecas/trunk/includes/recaptcha/recaptcha.php
r2413660 r2467512 4 4 5 5 function eit_ebecas_recaptcha_enqueue_scripts() { 6 7 // check if the current page/post have application shortcut if yes then load recaptcha 8 // scripts otherwise don't load it 9 global $post; 10 if ( ! is_a( $post, 'WP_Post' ) || ! has_shortcode( $post->post_content, EIT_EBECAS_SHORTCODE ) ) { 11 return; 12 } 13 6 14 $service = Eit_Ebecas_Recaptcha::get_instance(); 7 15 -
ebecas/trunk/public/Eit_Ebecas_Student_Portal.php
r2413660 r2467512 13 13 14 14 public function __construct() { 15 add_shortcode( 'eit_ebecas_student_portal', array( $this, 'do_shortcode' ) );15 add_shortcode( EIT_EBECAS_SHORTCODE, array( $this, 'do_shortcode' ) ); 16 16 // ebecas api service 17 17 $this->eit_ebecas_api = Eit_Ebecas_Api::get_instance(); … … 24 24 array(), 25 25 $atts, 26 'eit_ebecas_student_portal'26 EIT_EBECAS_SHORTCODE 27 27 ); 28 28 … … 144 144 } 145 145 146 $options_markup = '<label for="eit_ebecas_course">Select Course <strong>*</strong></label>';146 $options_markup ='<label for="eit_ebecas_course">Select Course <strong>*</strong></label>'; 147 147 $options_markup .= '<select name="eit_ebecas_course" id="eit_ebecas_course">'; 148 148 $options_markup .= '<option value="">Select a Course</option>'; … … 151 151 } 152 152 $options_markup .= '</select>'; 153 153 154 154 return $options_markup; 155 155 } … … 161 161 $recaptcha = eit_ebecas_recaptcha_get_field(); 162 162 163 $form = '<form action="' . esc_url( $_SERVER['REQUEST_URI'] ) . '" method="post" id="eit_ebecas_form" class="eit_ebecas_form">' 164 . '<p>' 165 . '<label for="eit_ebecas_first_name">First Name <strong>*</strong></label>' 166 . '<input type="text" name="eit_ebecas_first_name" pattern="[a-zA-Z0-9 ]+" value="" maxlength="40" required/>' 167 . '<p>' 168 169 . '<p>' 170 . '<label for="eit_ebecas_last_name">Last Name <strong>*</strong></label>' 171 . '<input type="text" name="eit_ebecas_last_name" pattern="[a-zA-Z0-9 ]+" value="" maxlength="60" required/>' 172 . '<p>' 173 174 . '<p>' 175 . '<label for="eit_ebecas_gender">Gender <strong>*</strong></label>' 176 . '<select name="eit_ebecas_gender" required>' 177 . '<option value="">Select</option>' 178 . '<option value="Male">Male</option>' 179 . '<option value="Female">Female</option>' 180 . '</select>' 181 . '</p>' 182 183 . '<p>' 184 . '<label for="eit_ebecas_dob">Date Of Birth <strong>*</strong></label>' 185 . '<input type="text" name="eit_ebecas_dob" placeholder="DD-MM-YYYY" required/>' 186 . '<p>' 187 188 . '<p>' 189 . '<label for="eit_ebecas_mobile">Mobile Number (Including Country Code) <strong>*</strong></label>' 190 . '<input type="text" name="eit_ebecas_mobile" maxlength="30" required/>' 191 . '<p>' 192 193 . '<p>' 194 . '<label for="eit_ebecas_email">Email <strong>*</strong></label>' 195 . '<input type="email" name="eit_ebecas_email" placeholder="Verification e-mail will be sent" maxlength="50" required/>' 196 . '<p>' 197 198 . '<p id="eit_ebecas_email_code"></p>' 199 200 . '<p>' 201 . '<label for="eit_ebecas_offshore_onshore">Offshore/Onshore <strong>*</strong></label>' 202 . '<select name="eit_ebecas_offshore_onshore" required>' 203 . '<option value="">Select</option>' 204 . '<option value="offshore">Offshore</option>' 205 . '<option value="onshore">Onshore</option>' 206 . '</select>' 207 . '</p>' 208 209 . '<p id="eit_ebecas_country">' . $countrySelect . '</p>' 210 . '<p id="eit_ebecas_language">' . $languageSelect . '</p>' 211 . '<p>' . $locationSelect . '</p>' 212 . '<p id="eit_ebecas_course"></p>' 213 . '<p id="eit_ebecas_insurance"></p>' 214 . '<p id="eit_ebecas_accommodation"></p>' 215 . '<p id="eit_ebecas_arrangement"></p>' 216 . '<p id="eit_ebecas_airport_pickup"></p>' 217 . '<p id="eit_ebecas_airport_dropoff"></p>' 218 . '<p id="eit_ebecas_others"></p>' 219 220 . '<p>' 221 . '<label for="eit_ebecas_application_details">Additional Application Details</label>' 222 . '<textarea name="eit_ebecas_application_details" rows="5"></textarea>' 223 . '<p>' 224 225 . '<p id="eit_ebecas_total"></p>' 226 227 . '<p>' . $recaptcha . '</p>' 228 229 . '<p>' 230 . '<input type="submit" name="eit_ebecas_submit" id="eit_ebecas_submit" value="Submit Application" />' 231 . '<p>' 232 233 . '</form>'; 163 $form = '<div id = "container-eit-ebecas_form">' 164 .'<div id ="wrap-eit-ebecas_form">' 165 .'<form action="' . esc_url( $_SERVER['REQUEST_URI'] ) . '" method="post" id="eit_ebecas_form" class="eit_ebecas_form">' 166 // .'<span id="eit-ebecas-form-title">Application Form</span>' 167 168 .'<p class = "wrap-eit-ebecas-input bg1" >' 169 . '<label for="eit_ebecas_first_name">First Name <strong>*</strong></label>' 170 . '<input type="text" name="eit_ebecas_first_name" pattern="[a-zA-Z0-9 ]+" value="" maxlength="40" placeholder = "Please provide your first name." required/>' 171 .'</p>' 172 173 .'<p class = "wrap-eit-ebecas-input bg1" >' 174 . '<label for="eit_ebecas_last_name">Last Name <strong>*</strong></label>' 175 . '<input type="text" name="eit_ebecas_last_name" pattern="[a-zA-Z0-9 ]+" value="" maxlength="60" placeholder = "Please provide your last name." required/>' 176 .'</p >' 177 178 .'<p class = "wrap-eit-ebecas-input bg1 eit-rs1-wrap-input">' 179 . '<label for="eit_ebecas_gender">Gender <strong>*</strong></label>' 180 . '<select name="eit_ebecas_gender" required>' 181 . '<option value="">Select Gender</option>' 182 . '<option value="Male">Male</option>' 183 . '<option value="Female">Female</option>' 184 . '</select>' 185 .'</p>' 186 187 .'<p class = "wrap-eit-ebecas-input bg1 eit-rs1-wrap-input">' 188 . '<label for="eit_ebecas_dob">Date Of Birth <strong>*</strong></label>' 189 . '<input type="text" name="eit_ebecas_dob" placeholder="DD-MM-YYYY" required/>' 190 .'</p>' 191 192 .'<p class = "wrap-eit-ebecas-input bg1">' 193 . '<label for="eit_ebecas_mobile">Mobile Number (Including Country Code) <strong>*</strong></label>' 194 . '<input type="text" name="eit_ebecas_mobile" maxlength="30" placeholder= "Please provide your mobile number." required/>' 195 .'</p>' 196 197 .'<p class = "wrap-eit-ebecas-input bg1">' 198 . '<label for="eit_ebecas_email">Email <strong>*</strong></label>' 199 . '<input type="email" name="eit_ebecas_email" placeholder="Verification e-mail will be sent" maxlength="50" required/>' 200 .'</p>' 201 202 . '<p id="eit_ebecas_email_code"></p>' 203 204 .'<p class = "wrap-eit-ebecas-input bg1 eit-rs1-wrap-input">' 205 . '<label for="eit_ebecas_offshore_onshore">Offshore/Onshore <strong>*</strong></label>' 206 . '<select name="eit_ebecas_offshore_onshore" required>' 207 . '<option value="">Select</option>' 208 . '<option value="offshore">Offshore</option>' 209 . '<option value="onshore">Onshore</option>' 210 . '</select>' 211 .'</p>' 212 213 . '<p id="eit_ebecas_country">' . $countrySelect . '</p>' 214 215 . '<p id="eit_ebecas_language">' . $languageSelect . '</p>' 216 217 . '<p id="eit-location-select">' . $locationSelect . '</p>' 218 219 . '<p id="eit_ebecas_course"></p>' 220 221 . '<p id="eit_ebecas_insurance"></p>' 222 223 . '<p id="eit_ebecas_accommodation"></p>' 224 225 . '<p id="eit_ebecas_arrangement"></p>' 226 227 . '<p id="eit_ebecas_airport_pickup"></p>' 228 229 . '<p id="eit_ebecas_airport_dropoff"></p>' 230 231 . '<p id="eit_ebecas_others"></p>' 232 233 .'<div class = "wrap-eit-ebecas-input bg1">' 234 . '<label for="eit_ebecas_application_details">Additional Application Details</label>' 235 . '<textarea name="eit_ebecas_application_details" rows="5"></textarea>' 236 .'</div>' 237 238 .'<p id="eit_ebecas_total"></p>' 239 240 .'<p>' . $recaptcha . '</p>' 241 .'<p class="container-eit-form-btn">' 242 .'<input type="submit" name="eit_ebecas_submit" id="eit_ebecas_submit" value="Submit"/>' 243 .'</p>' 244 .'</form>' 245 .'</div>' 246 .'</div>'; 234 247 235 248 echo $form; -
ebecas/trunk/readme.txt
r2420569 r2467512 5 5 Requires at least: 5.3 6 6 Tested up to: 5.5 7 Stable tag: 1. 77 Stable tag: 1.8 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 114 114 == Changelog == 115 115 116 = 1.8 = 117 * UI changes - Changed application form user interface. 118 * Added optional email verification in admin section, now it can be enabled/disabled. 119 * Bug fixed - Recaptcha icon now only display on application form page. 120 116 121 = 1.7 = 117 122 * Bug fixed - Ajax not firing.
Note: See TracChangeset
for help on using the changeset viewer.