Plugin Directory

Changeset 2467512


Ignore:
Timestamp:
02/03/2021 01:44:32 AM (5 years ago)
Author:
janorkar
Message:

Committing Version 1.8

Location:
ebecas/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • ebecas/trunk/admin/Eit_Ebecas_Settings.php

    r2413660 r2467512  
    157157                    'default' => 'up',
    158158                ),
     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                ),
    159170            );
    160171            foreach ( $fields as $field ) {
     
    170181        public function eit_ebecas_field_callback( $arguments ) {
    171182            $value = get_option( $arguments['uid'] ); // Get the current value, if there is one
    172             if ( ! $value ) {                   // If no value exists
    173                 $value = $arguments['default']; // Set to our default
    174             }
     183            // if ( ! $value ) {                   // If no value exists
     184            //  // $value = $arguments['default']; // Set to our default
     185            // }
    175186
    176187            switch ( $arguments['type'] ) {
  • ebecas/trunk/eit-ebecas.php

    r2420569 r2467512  
    55Plugin URI: https://ebecas.com.au/wordpress-plugin
    66Description: 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.7
     7Version: 1.8
    88Requires at least: 5.3
    99Requires PHP: 7.0
     
    4040
    4141define( 'EIT_EBECAS_OPTION_PREFIX', 'eit_ebecas_' );
     42
     43define( 'EIT_EBECAS_SHORTCODE', 'eit_ebecas_student_portal' );
    4244
    4345define( 'EIT_EBECAS_EMAIL_CODE_LENGTH', 5 );
  • ebecas/trunk/includes/Eit_Ebecas_Controller.php

    r2420569 r2467512  
    2828        array( 'jquery' ), EIT_EBECAS_VERSION, true );
    2929
     30    $service = Eit_Ebecas_Email_Verification::get_instance();
    3031    $eit_ebecas = array(
    3132        'ajaxurl'  => admin_url( 'admin-ajax.php' ),
    3233        '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,
    3335    );
    3436
     
    141143    $html = '<p>Thank you for applying. We have received your application you will hear from us shortly.</p>' .
    142144            '<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>' .
    146148            '<th>Description</th>' .
    147149            '<th>Amount</th>' .
     
    204206    $dob        = sanitize_text_field( $_POST["eit_ebecas_dob"] );
    205207    $mobile     = sanitize_text_field( $_POST["eit_ebecas_mobile"] );
    206     $email_code = sanitize_text_field( $_POST["eit_ebecas_email_code"] );
    207208    $course     = (int) filter_var( $_POST["eit_ebecas_course"], FILTER_SANITIZE_NUMBER_INT );
    208209
    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 ) ) {
    210211        $reg_errors->add( 'field', 'Required form fields are missing.' );
    211212    }
     
    216217
    217218    // 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"] ) : '';
    218220    $email_check = apply_filters( 'eit_ebecas_verify_application_code', $email, $email_code );
    219221    if ( ! $email_check ) {
  • ebecas/trunk/includes/Eit_Ebecas_Email_Verification.php

    r2413660 r2467512  
    2020add_filter( 'eit_ebecas_send_application_code', 'eit_ebecas_send_application_code', 10, 1 );
    2121function 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
    2229    if ( ! is_email( $email ) ) {
    2330        return false;
     
    2936    }
    3037
    31     $service = Eit_Ebecas_Email_Verification::get_instance();
    32 
    3338    // get the blog administrator's email address
    3439    $from_email = $service->get_admin_email();
    3540    $site_name  = strtolower( $_SERVER['SERVER_NAME'] );
    3641    $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 );
    3942
    4043    // $headers = "From: $site_name <$from_email>" . "\r\n";
     
    4851               '</div>';
    4952
    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;
    5160}
    5261
    5362add_filter( 'eit_ebecas_verify_application_code', 'eit_ebecas_verify_application_code', 10, 2 );
    5463function 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
    5570    if ( ! is_email( $email ) ) {
    5671        return false;
     
    7186        private static $instance;
    7287        public $admin_email = null;
     88        const EMAIL_VERIFICATION_ENABLED = 'true';
     89        const EMAIL_VERIFICATION_DISABLED = 'false';
    7390
    7491        public static function get_instance() {
     
    87104            return $this->admin_email;
    88105        }
     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        }
    89115    }
    90116}
  • ebecas/trunk/includes/css/styles.css

    r2413660 r2467512  
     1/* Product padding */
    12.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
     201textarea {
     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
     211table {
     212    border-collapse: collapse;
     213    border-spacing: 0;
     214    width: 100%;
     215    border: 1px solid #ddd;
     216}
     217
     218tr: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  
    223223        let email = $field_email.val();
    224224        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        }
    225231
    226232        if (!email) {
     
    267273
    268274    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();
    275281        $section_total.empty();
    276282    }
     
    280286        $app.init();
    281287        $app.selection.location_id = null;
    282         $section_course.empty();
     288        $section_course.removeClass('eit_ebecas_course').empty();
     289   
    283290        emptyAllSections();
    284291
     
    328335        $section_course.empty();
    329336        $app.products.course = courses['Products'];
     337     
    330338        $section_course.append('<label for="eit_ebecas_course">Select Course <strong>*</strong></label>');
    331339
     
    336344            select.append($('<option></option>').attr('value', entry.ProductId).attr('data-faculty-id', entry.FacultyId).text(entry.Name));
    337345        })
    338 
    339         $section_course.append(select);
    340 
     346       
     347
     348        $section_course.addClass('eit_ebecas_course').append(select);
     349 
    341350        // bind course change event
    342351        $field_course = select;
     
    387396
    388397        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."/>');
    390399        datePrice.append(startDateInput);
    391400
    392401        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."/>');
    394403        datePrice.append(weekInput);
    395404
    396405        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."/>');
    398407        datePrice.append(endDateInput);
    399408
     
    407416                userInputTimer = setTimeout(function () {
    408417                    getEndDateOrWeeks(FACULTY_TYPE_ENDDATE);
    409 
    410418                    endDateInput.prop("disabled", false).css("background-color", "#fff");
    411419                }, USER_INPUT_TIMER_LIMIT)
     
    547555    function showInsuranceSection(insurance) {
    548556        $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>');
    550558
    551559        let select = $('<select name="eit_ebecas_insurance" />');
     
    556564        })
    557565
    558         $section_insurance.append(select);
     566        $section_insurance.addClass('eit_ebecas_insurance').append(select);
    559567
    560568        // bind insurance change event
     
    584592
    585593        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."/>');
    587595        datePrice.append(startDateInput);
    588596
    589597        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."/>');
    591599        datePrice.append(endDateInput);
    592600
     
    678686        })
    679687
    680         $section_accommodation.append(select);
     688        $section_accommodation.addClass('eit_ebecas_accommodation').append(select);
     689     
    681690
    682691        // bind accommodation change event
     
    707716
    708717        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."/>');
    710719        datePrice.append(startDateInput);
    711720
    712721        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"/>');
    714723        datePrice.append(endDateInput);
    715724
     
    786795        })
    787796
    788         $section_arrangement.append(select);
     797        $section_arrangement.addClass('eit_ebecas_arrangement').append(select);
    789798
    790799        // bind arrangement change event
     
    838847        })
    839848
    840         $section_airport_pickup.append(select);
     849        $section_airport_pickup.addClass('eit_ebecas_airport_pickup').append(select);
    841850
    842851        // bind course change event
     
    856865        })
    857866
    858         $section_airport_dropoff.append(select);
     867        $section_airport_dropoff.addClass('eit_ebecas_airport_dropoff').append(select);
    859868
    860869        // bind course change event
     
    898907
    899908        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."/>');
    901910        datePrice.append(startDateInput);
    902911
    903912        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."/>');
    905914        datePrice.append(endDateInput);
    906915
    907916        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."/>'));
    909918
    910919        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."/>'));
    912921
    913922        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."/>'));
    915924
    916925        datePrice.append('<p id="eit_ebecas_airport_price"></p>');
     
    947956
    948957        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."/>');
    950959        datePrice.append(startDateInput);
    951960
    952961        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."/>');
    954963        datePrice.append(endDateInput);
    955964
    956965        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."/>'));
    958967
    959968        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."/>'));
    961970
    962971        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."/>'));
    964973
    965974        datePrice.append('<p id="eit_ebecas_airport_price"></p>');
     
    9991008        })
    10001009
    1001         $section_others.append(select);
     1010        $section_others.addClass('eit_ebecas_others').append(select);
    10021011        $section_others.append('<div><small>Hold the CTRL or CMD key and click the items in a list to choose them.</small></div>');
    10031012
     
    10531062
    10541063        $section_code.empty();
     1064       
    10551065        // show input code - eit_ebecas_email_code
    10561066        $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');
    10581069    }
    10591070
  • ebecas/trunk/includes/recaptcha/recaptcha.php

    r2413660 r2467512  
    44
    55function 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
    614    $service = Eit_Ebecas_Recaptcha::get_instance();
    715
  • ebecas/trunk/public/Eit_Ebecas_Student_Portal.php

    r2413660 r2467512  
    1313
    1414        public function __construct() {
    15             add_shortcode( 'eit_ebecas_student_portal', array( $this, 'do_shortcode' ) );
     15            add_shortcode( EIT_EBECAS_SHORTCODE, array( $this, 'do_shortcode' ) );
    1616            // ebecas api service
    1717            $this->eit_ebecas_api = Eit_Ebecas_Api::get_instance();
     
    2424                array(),
    2525                $atts,
    26                 'eit_ebecas_student_portal'
     26                EIT_EBECAS_SHORTCODE
    2727            );
    2828
     
    144144            }
    145145
    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>';
    147147            $options_markup .= '<select name="eit_ebecas_course" id="eit_ebecas_course">';
    148148            $options_markup .= '<option value="">Select a Course</option>';
     
    151151            }
    152152            $options_markup .= '</select>';
    153 
     153           
    154154            return $options_markup;
    155155        }
     
    161161            $recaptcha      = eit_ebecas_recaptcha_get_field();
    162162
    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>';
    234247
    235248            echo $form;
  • ebecas/trunk/readme.txt

    r2420569 r2467512  
    55Requires at least: 5.3
    66Tested up to: 5.5
    7 Stable tag: 1.7
     7Stable tag: 1.8
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    114114== Changelog ==
    115115
     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
    116121= 1.7 =
    117122* Bug fixed - Ajax not firing.
Note: See TracChangeset for help on using the changeset viewer.