_e('Revenue', 'gdlr-lms'); ?> </th> <th><?php _e('My Earning', 'gdlr-lms'); ?> </th> </tr> <?php $temp_sql = "SELECT course_id, SUM(price) AS revenue FROM " . $wpdb->prefix . "gdlrpayment "; $temp_sql .= "WHERE price != 0 AND payment_status = 'paid' AND author_id=" . $current_user->ID . " "; $temp_sql .= "AND payment_date >= cast('" . $start_date . "' as DATETIME) "; $temp_sql .= "AND payment_date <= cast('" . $end_date . "' as DATETIME) "; $temp_sql .= "GROUP BY course_id"; $sum_price = 0; $results = $wpdb->get_results($temp_sql); foreach ($results as $result) { $sum_price += floatval($result->revenue); echo '<tr>'; echo '<td>' . get_the_title($result->course_id) . '</td>'; echo '<td>' . gdlr_lms_money_format(number_format_i18n($result->revenue, 2)) . '</td>'; echo '<td>' . gdlr_lms_money_format(number_format_i18n(floatval($result->revenue) * floatval($commission_rate) / 100, 2)) . '</td>'; echo '</tr>'; } echo '<tr class="with-top-divider">'; echo '<td>' . __('Total', 'gdlr-lms') . '</td>'; echo '<td>' . gdlr_lms_money_format(number_format_i18n($sum_price, 2)) . '</td>'; echo '<td>' . gdlr_lms_money_format(number_format_i18n($sum_price * floatval($commission_rate) / 100, 2)) . '</td>'; echo '</tr>'; ?> </table>
function gdlr_lms_commission_option() { global $wpdb, $gdlr_lms_option; $gdlr_lms_option['default-instructor-commission'] = empty($gdlr_lms_option['default-instructor-commission']) ? 100 : $gdlr_lms_option['default-instructor-commission']; $gdlr_lms_commission = get_option('gdlr-lms-commission', array()); if (!empty($_GET['author_id']) && !empty($_GET['commission_rate'])) { $gdlr_lms_commission[$_GET['author_id']] = $_GET['commission_rate']; update_option('gdlr-lms-commission', $gdlr_lms_commission); } ?> <div class="wrap"> <h2><?php _e('Instructor Commission', 'gdlr-lms'); ?> </h2> <!-- query form --> <table class="gdlr-lms-table"> <tr> <th class="gdlr-left-aligned"><?php _e('Instructor', 'gdlr-lms'); ?> </th> <th><?php _e('Revenue', 'gdlr-lms'); ?> </th> <th><?php _e('Commission (%)', 'gdlr-lms'); ?> </th> <th><?php _e('Action', 'gdlr-lms'); ?> </th> </tr> <?php $instructors = array(); $instructors_list = get_users(array('role' => 'instructor')); foreach ($instructors_list as $instructor) { $instructors[$instructor->ID] = $instructor->ID; } $temp_sql = "SELECT author_id, SUM(price) AS revenue FROM " . $wpdb->prefix . "gdlrpayment "; $temp_sql .= "WHERE price != 0 AND payment_status = 'paid' "; $temp_sql .= "GROUP BY author_id"; $results = $wpdb->get_results($temp_sql); foreach ($results as $result) { $commission_rate = empty($gdlr_lms_commission[$result->author_id]) ? $gdlr_lms_option['default-instructor-commission'] : $gdlr_lms_commission[$result->author_id]; echo '<tr>'; echo '<td class="gdlr-left-aligned">' . get_user_meta($result->author_id, 'first_name', true) . ' ' . get_user_meta($result->author_id, 'last_name', true) . '</td>'; echo '<td>' . gdlr_lms_money_format(number_format_i18n($result->revenue, 2)) . '</td>'; echo '<td>' . $commission_rate . '%</td>'; echo '<td>'; echo '<a data-rel="gdlr-lms-lightbox" data-lb-open="commission-rate">' . __('Change % Rate', 'gdlr-lms') . '</a>'; echo gdlr_lms_lightbox_commission_form($commission_rate, $result->author_id); echo '</td>'; echo '</tr>'; unset($instructors[$result->author_id]); } foreach ($instructors as $instructor_id) { $commission_rate = empty($gdlr_lms_commission[$instructor_id]) ? $gdlr_lms_option['default-instructor-commission'] : $gdlr_lms_commission[$instructor_id]; echo '<tr>'; echo '<td class="gdlr-left-aligned">' . get_user_meta($instructor_id, 'first_name', true) . ' ' . get_user_meta($instructor_id, 'last_name', true) . '</td>'; echo '<td>' . gdlr_lms_money_format(number_format_i18n(0, 2)) . '</td>'; echo '<td>' . $commission_rate . '%</td>'; echo '<td>'; echo '<a data-rel="gdlr-lms-lightbox" data-lb-open="commission-rate">' . __('Change % Rate', 'gdlr-lms') . '</a>'; echo gdlr_lms_lightbox_commission_form($commission_rate, $instructor_id); echo '</td>'; echo '</tr>'; } ?> </table> </div> <?php }
function gdlr_lms_transaction_option() { ?> <div class="wrap"> <h2><?php _e('Transaction List', 'gdlr-lms'); ?> </h2> <form class="gdlr-lms-transaction-form" method="GET" action=""> <div class="gdlr-lms-transaction-form-row"> <span class="gdlr-lms-head"><?php _e('Search transaction by :', 'gdlr-lms'); ?> </span> <div class="gdlr-combobox-wrapper"> <select name="selector" > <option value="name" <?php echo !empty($_GET['selector']) && $_GET['selector'] == 'name' ? 'selected' : ''; ?> ><?php _e('Name', 'gdlr-lms'); ?> </option> <option value="code" <?php echo !empty($_GET['selector']) && $_GET['selector'] == 'code' ? 'selected' : ''; ?> ><?php _e('Code', 'gdlr-lms'); ?> </option> </select> </div> <div class="clear"></div> </div> <div class="gdlr-lms-transaction-form-row"> <span class="gdlr-lms-head"><?php _e('Keywords :', 'gdlr-lms'); ?> </span> <input type="text" name="keywords" value="<?php echo !empty($_GET['keywords']) ? $_GET['keywords'] : ''; ?> " /> <input type="hidden" name="page" value="lms-transaction" /> <input type="submit" value="<?php _e('Search!', 'gdlr-lms'); ?> " /> <div class="clear"></div> </div> </form> <table class="gdlr-lms-table"> <tr> <th><?php _e('ID', 'gdlr-lms'); ?> </th> <th><?php _e('Name', 'gdlr-lms'); ?> </th> <th><?php _e('Course', 'gdlr-lms'); ?> </th> <th><?php _e('Type', 'gdlr-lms'); ?> </th> <th><?php _e('Price', 'gdlr-lms'); ?> </th> <th><?php _e('Status', 'gdlr-lms'); ?> </th> <th><?php _e('Code', 'gdlr-lms'); ?> </th> <th><?php _e('Booked/Paid Date', 'gdlr-lms'); ?> </th> </tr> <?php global $wpdb; $temp_sql = "SELECT id, course_id, student_id, payment_info, payment_status, payment_date, price "; $temp_sql .= "FROM " . $wpdb->prefix . "gdlrpayment "; $temp_sql .= "WHERE price != 0 "; if (!empty($_GET['selector']) && !empty($_GET['keywords'])) { if ($_GET['selector'] == 'name') { $user_array = array(0); $users = new WP_User_Query(array('meta_query' => array('relation' => 'OR', array('key' => 'first_name', 'value' => $_GET['keywords'], 'compare' => 'LIKE'), array('key' => 'last_name', 'value' => $_GET['keywords'], 'compare' => 'LIKE')))); $users_found = $users->get_results(); foreach ($users_found as $user) { if (!in_array($user->ID, $user_array)) { $user_array[] = $user->ID; } } $users = new WP_User_Query(array('search' => '*' . esc_attr($_GET['keywords']) . '*', 'search_columns' => array('user_login', 'user_nicename'))); $users_found = $users->get_results(); foreach ($users_found as $user) { if (!in_array($user->ID, $user_array)) { $user_array[] = $user->ID; } } $temp_sql .= 'AND student_id IN (' . implode(",", $user_array) . ') '; } else { if ($_GET['selector'] == 'code') { $temp_sql .= 'AND payment_info LIKE \'%' . $_GET['keywords'] . '%\' '; } } } $temp_sql .= "ORDER BY id desc"; $results = $wpdb->get_results($temp_sql); // handle pagination global $gdlr_lms_option; $record_num = count($results); $current_page = empty($_GET['paged']) ? 1 : intval($_GET['paged']); $record_per_page = empty($gdlr_lms_option['transaction-record']) ? 30 : intval($gdlr_lms_option['transaction-record']); $max_num_page = ceil($record_num / $record_per_page); for ($i = $record_per_page * ($current_page - 1); $i < $record_num && $i < $record_per_page * $current_page; $i++) { $result = $results[$i]; $course_val = gdlr_lms_decode_preventslashes(get_post_meta($result->course_id, 'gdlr-lms-course-settings', true)); $course_options = empty($course_val) ? array() : json_decode($course_val, true); $payment_info = unserialize($result->payment_info); $payment_info['code'] = empty($payment_info['code']) ? '' : $payment_info['code']; $student_info = get_userdata($result->student_id); echo '<tr>'; echo '<td>' . $result->id . '</td>'; echo '<td class="evidence-of-payment-name">'; echo $student_info->first_name . ' ' . $student_info->last_name; echo '<div class="evidence-of-payment-name-hover" >'; foreach ($payment_info as $key => $value) { echo '<div class="evidence-of-payment-info">'; echo '<span class="head">' . $key . ' :</span>'; if ($key == 'price') { echo '<span class="tail">' . gdlr_lms_money_format($value) . '</span>'; } else { echo '<span class="tail">' . $value . '</span>'; } echo '</div>'; } echo '</div>'; // evd-of-payment-name-hover echo '</td>'; // evd-of-payment-name echo '<td>' . $course_options['course-code'] . $result->course_id . '</td>'; echo '<td>'; echo $course_options['online-course'] == 'enable' ? __('Online', 'gdlr-lms') : __('Onsite', 'gdlr-lms'); echo '</td>'; echo '<td>' . gdlr_lms_money_format(number_format_i18n($result->price, 2)) . '</td>'; echo '<td>' . $result->payment_status . '</td>'; echo '<td>' . $payment_info['code'] . '</td>'; echo '<td>' . gdlr_lms_date_format($result->payment_date) . '</td>'; echo '</tr>'; } ?> </table> <?php // print pagination if ($max_num_page > 1) { $page_var = $_GET; echo '<div class="gdlr-lms-pagination">'; if ($current_page > 1) { $page_var['paged'] = intval($current_page) - 1; echo '<a class="prev page-numbers" href="' . esc_url(add_query_arg($page_var)) . '" >'; echo __('‹ Previous', 'gdlr-lms') . '</a>'; } for ($i = 1; $i <= $max_num_page; $i++) { $page_var['paged'] = $i; if ($i == $current_page) { echo '<span class="page-numbers current" href="' . esc_url(add_query_arg($page_var)) . '" >' . $i . '</span>'; } else { echo '<a class="page-numbers" href="' . esc_url(add_query_arg($page_var)) . '" >' . $i . '</a>'; } } if ($current_page < $max_num_page) { $page_var['paged'] = intval($current_page) + 1; echo '<a class="next page-numbers" href="' . esc_url(add_query_arg($page_var)) . '" >'; echo __('Next ›', 'gdlr-lms') . '</a>'; } echo '</div>'; } ?> </div> <?php }
function gdlr_lms_payment_evidence_option() { global $wpdb; $temp_sql = "SELECT id, course_id, student_id, payment_info, payment_date, attachment FROM " . $wpdb->prefix . "gdlrpayment "; $temp_sql .= "WHERE payment_status = 'submitted'"; $results = $wpdb->get_results($temp_sql); ?> <div class="wrap"> <h2><?php _e('Evidence Of Payment', 'gdlr-lms'); ?> </h2> <?php if (empty($results)) { echo '<div style="margin-top: 20px;">' . __('No record found', 'gdlr-lms') . '</div>'; return; } ?> <table class="gdlr-lms-table"> <tr> <th><?php _e('Name', 'gdlr-lms'); ?> </th> <th><?php _e('Course', 'gdlr-lms'); ?> </th> <th><?php _e('Code', 'gdlr-lms'); ?> </th> <th><?php _e('Submitted Date', 'gdlr-lms'); ?> </th> <th><?php _e('Total Price', 'gdlr-lms'); ?> </th> <th><?php _e('View Attachment', 'gdlr-lms'); ?> </th> </tr> <?php foreach ($results as $result) { $payment_info = unserialize($result->payment_info); $payment_info['code'] = empty($payment_info['code']) ? '' : $payment_info['code']; $student_info = get_userdata($result->student_id); echo '<tr>'; echo '<td class="evidence-of-payment-name">'; echo $student_info->first_name . ' ' . $student_info->last_name; echo '<div class="evidence-of-payment-name-hover" >'; foreach ($payment_info as $key => $value) { echo '<div class="evidence-of-payment-info">'; echo '<span class="head">' . $key . ' :</span>'; if ($key == 'price') { echo '<span class="tail">' . gdlr_lms_money_format($value) . '</span>'; } else { echo '<span class="tail">' . $value . '</span>'; } echo '</div>'; } echo '</div>'; // evd-of-payment-name-hover echo '</td>'; // evd-of-payment-name echo '<td>' . $result->course_id . '</td>'; echo '<td>' . $payment_info['code'] . '</td>'; echo '<td>' . gdlr_lms_date_format($result->payment_date) . '</td>'; echo '<td>' . gdlr_lms_money_format($payment_info['price']) . '</td>'; echo '<td>'; echo '<a data-rel="gdlr-lms-lightbox" data-lb-open="evidence-validation" >' . __('View Attachment', 'gdlr-lms') . '</a>'; gdlr_lms_lightbox_evidence_form($result, $payment_info); echo '</td>'; echo '</tr>'; } ?> </table> </div> <?php }
function gdlr_lms_statement_option() { $year = empty($_GET['year']) ? date('Y') : $_GET['year']; $start_date = empty($_GET['start-date']) ? date('Y-m-01') : $_GET['start-date']; $end_date = empty($_GET['end-date']) ? date('Y-m-t') : $_GET['end-date']; $_GET['type'] = empty($_GET['type']) ? 'course' : $_GET['type']; ?> <div class="wrap"> <h2><?php _e('Statement', 'gdlr-lms'); ?> </h2> <!-- changing section --> <div class="gdlr-lms-statement-button-wrapper"> <a class="gdlr-lms-statement-button" href="<?php echo esc_url(add_query_arg(array('type' => 'overall', 'page' => 'lms-statement'))); ?> ">Overall</a> <a class="gdlr-lms-statement-button" href="<?php echo esc_url(add_query_arg(array('type' => 'course', 'page' => 'lms-statement'))); ?> ">Course</a> <a class="gdlr-lms-statement-button" href="<?php echo esc_url(add_query_arg(array('type' => 'instructor', 'page' => 'lms-statement'))); ?> ">Instructor</a> </div> <!-- form filter --> <?php if ($_GET['type'] == 'overall') { ?> <form class="gdlr-lms-statement-form" method="GET" action=""> <span class="gdlr-lms-head"><?php _e('Select Year :', 'gdlr-lms'); ?> </span> <div class="gdlr-combobox-wrapper"> <select name="year" > <option value="2014" <?php echo $year == '2014' ? 'selected' : ''; ?> >2014</option> <option value="2015" <?php echo $year == '2015' ? 'selected' : ''; ?> >2015</option> <option value="2016" <?php echo $year == '2016' ? 'selected' : ''; ?> >2016</option> <option value="2017" <?php echo $year == '2017' ? 'selected' : ''; ?> >2017</option> </select> <input type="hidden" name="page" value="lms-statement" /> </div> <div class="clear"></div> </form> <?php } else { ?> <form class="gdlr-lms-statement-form" method="GET" action=""> <span class="gdlr-lms-head"><?php _e('Filter :', 'gdlr-lms'); ?> </span> <input type="text" name="start-date" class="gdlr-lms-date-picker" placeholder="<?php _e('Start Date', 'gdlr-lms'); ?> " value="<?php echo $start_date; ?> " /> <i class="fa fa-calendar icon-calendar"></i> <i class="fa fa-long-arrow-right icon-long-arrow-right"></i> <input type="text" name="end-date" class="gdlr-lms-date-picker" placeholder="<?php _e('End Date', 'gdlr-lms'); ?> " value="<?php echo $end_date; ?> " /> <i class="fa fa-calendar icon-calendar"></i> <input type="hidden" name="page" value="lms-statement" /> <input type="submit" value="<?php _e('Filter!', 'gdlr-lms'); ?> " /> </form> <?php } ?> <!-- query form --> <table class="gdlr-lms-table"> <tr> <?php if ($_GET['type'] == 'overall') { ?> <th class="gdlr-left-aligned"><?php _e('Instructor', 'gdlr-lms'); ?> </th> <th><?php _e('Revenue', 'gdlr-lms'); ?> </th> <?php } else { if ($_GET['type'] == 'course') { ?> <th class="gdlr-left-aligned"><?php _e('Course', 'gdlr-lms'); ?> </th> <th><?php _e('Revenue', 'gdlr-lms'); ?> </th> <?php } else { ?> <th class="gdlr-left-aligned"><?php _e('Instructor', 'gdlr-lms'); ?> </th> <th><?php _e('Course', 'gdlr-lms'); ?> </th> <th><?php _e('Revenue', 'gdlr-lms'); ?> </th> <th><?php _e('Commission (%)', 'gdlr-lms'); ?> </th> <th><?php _e('Earning', 'gdlr-lms'); ?> </th> <?php } } ?> </tr> <?php global $wpdb, $gdlr_lms_option; $gdlr_lms_commission = get_option('gdlr-lms-commission', array()); $gdlr_lms_option['default-instructor-commission'] = empty($gdlr_lms_option['default-instructor-commission']) ? 100 : $gdlr_lms_option['default-instructor-commission']; if ($_GET['type'] == 'overall') { $temp_sql = "SELECT MONTH(payment_date) as month, SUM(price) as revenue FROM " . $wpdb->prefix . "gdlrpayment "; $temp_sql .= "WHERE price != 0 AND payment_status = 'paid' "; $temp_sql .= "AND payment_date >= cast('" . $start_date . '-01-01' . "' as DATETIME) "; $temp_sql .= "AND payment_date <= cast('" . $year . '-12-31' . "' as DATETIME) "; $temp_sql .= "GROUP BY month"; } else { if ($_GET['type'] == 'course') { $temp_sql = "SELECT course_id, SUM(price) AS revenue FROM " . $wpdb->prefix . "gdlrpayment "; $temp_sql .= "WHERE price != 0 AND payment_status = 'paid' "; $temp_sql .= "AND payment_date >= cast('" . $start_date . "' as DATETIME) "; $temp_sql .= "AND payment_date <= cast('" . $end_date . "' as DATETIME) "; $temp_sql .= "GROUP BY course_id"; } else { $temp_sql = "SELECT author_id, COUNT(DISTINCT course_id) AS course_num, SUM(price) AS revenue FROM " . $wpdb->prefix . "gdlrpayment "; $temp_sql .= "WHERE price != 0 AND payment_status = 'paid' "; $temp_sql .= "AND payment_date >= cast('" . $start_date . "' as DATETIME) "; $temp_sql .= "AND payment_date <= cast('" . $end_date . "' as DATETIME) "; $temp_sql .= "GROUP BY author_id"; } } $sum_revenue = 0; $results = $wpdb->get_results($temp_sql); foreach ($results as $result) { echo '<tr>'; if ($_GET['type'] == 'overall') { echo '<td class="gdlr-left-aligned">' . date_i18n("F", mktime(0, 0, 0, $result->month, 10)) . '</td>'; } else { if ($_GET['type'] == 'course') { echo '<td class="gdlr-left-aligned">' . get_the_title($result->course_id) . '</td>'; } else { echo '<td class="gdlr-left-aligned">' . get_user_meta($result->author_id, 'first_name', true) . ' ' . get_user_meta($result->author_id, 'last_name', true) . '</td>'; echo '<td>' . $result->course_num . '</td>'; } } echo '<td>' . gdlr_lms_money_format(number_format_i18n($result->revenue, 2)) . '</td>'; if ($_GET['type'] == 'instructor') { $commission_rate = empty($gdlr_lms_commission[$result->author_id]) ? $gdlr_lms_option['default-instructor-commission'] : $gdlr_lms_commission[$result->author_id]; echo '<td>' . $commission_rate . '%</td>'; echo '<td>' . gdlr_lms_money_format(number_format_i18n(floatval($result->revenue) * floatval($commission_rate) / 100, 2)) . '</td>'; } echo '</tr>'; $sum_revenue += floatval($result->revenue); } echo '<tr>'; echo '<td class="gdlr-left-aligned gdlr-top-border">' . __('Total', 'gdlr-lms') . '</td>'; echo $_GET['type'] == 'instructor' ? '<td class="gdlr-top-border"></td>' : ''; echo '<td class="gdlr-top-border">' . gdlr_lms_money_format(number_format_i18n($sum_revenue, 2)) . '</td>'; echo '</tr>'; ?> </table> </div> <?php }
function gdlr_lms_print_course_price($course_options) { echo '<div class="gdlr-lms-course-price">'; echo '<span class="head">' . __('Price', 'gdlr-lms') . '</span>'; if (!empty($course_options['allow-non-member']) && $course_options['allow-non-member'] == 'enable' && (empty($course_options['online-course']) || $course_options['online-course'] == 'enable')) { echo '<span class="price">' . __('Free', 'gdlr-lms') . '</span>'; } else { if (!empty($course_options['price']) && empty($course_options['discount-price'])) { echo '<span class="price">' . gdlr_lms_money_format($course_options['price']) . '</span>'; } else { if (!empty($course_options['discount-price'])) { echo '<span class="price with-discount">' . gdlr_lms_money_format($course_options['price']) . '</span>'; echo '<span class="discount-price">' . gdlr_lms_money_format($course_options['discount-price']) . '</span>'; } else { echo '<span class="price">' . __('Free', 'gdlr-lms') . '</span>'; } } } echo '</div>'; }
function gdlr_lms_purchase_lightbox_form($course_option, $type, $fix_val = array(), $close = 'close') { global $current_user, $lms_paypal, $lms_money_format, $gdlr_lms_option; if (!empty($fix_val)) { $disabled = 'disabled'; $fix_val['amount'] = intval($fix_val['amount']); $fix_val['form-class'] = 'gdlr-check-form'; $fix_val['return'] = get_permalink($fix_val['course-id']); } else { $user_info = get_userdata($current_user->data->ID); $user_meta = get_user_meta($current_user->data->ID); $disabled = ''; $fix_val = array('id' => '', 'title' => get_the_title(), 'first_name' => $user_meta['first_name'][0], 'last_name' => $user_meta['last_name'][0], 'email' => $user_info->data->user_email, 'phone' => empty($user_meta['phone']) ? '' : $user_meta['phone'][0], 'address' => empty($user_meta['address']) ? '' : $user_meta['address'][0], 'additional_note' => '', 'amount' => 1, 'form-class' => '', 'course-id' => get_the_ID(), 'return' => get_permalink()); } ?> <div class="gdlr-lms-lightbox-container <?php echo $type; ?> -form"> <?php if ($close == 'close') { echo '<div class="gdlr-lms-lightbox-close"><i class="fa fa-remove icon-remove"></i></div>'; } else { if ($close != 'none') { echo '<div class="gdlr-lms-lightbox-back gdlr-lms-button cyan" data-rel="gdlr-lms-lightbox3" data-lb-open="' . $close . '"><i class="fa fa-arrow-left icon-arrow-left"></i></div>'; } } ?> <h3 class="gdlr-lms-lightbox-title"><?php echo $fix_val['title']; ?> </h3> <form class="gdlr-lms-form gdlr-lms-lightbox-form <?php echo $fix_val['form-class']; ?> " method="post" <?php if ($type == 'buy') { echo 'action="' . $lms_paypal['url'] . '"'; } ?> data-ajax="<?php echo admin_url('admin-ajax.php'); ?> ?lang=<?php echo substr(get_locale(), 0, 2); ?> "> <p class="gdlr-lms-half-left"> <span><?php _e('Name', 'gdlr-lms'); ?> </span> <input type="text" name="first_name" value="<?php echo $fix_val['first_name']; ?> " <?php echo $disabled; ?> /> </p> <p class="gdlr-lms-half-right"> <span><?php _e('Lastname', 'gdlr-lms'); ?> </span> <input type="text" name="last_name" value="<?php echo $fix_val['last_name']; ?> " <?php echo $disabled; ?> /> </p> <div class="clear"></div> <p class="gdlr-lms-half-left"> <span><?php _e('Email', 'gdlr-lms'); ?> </span> <input type="text" name="email" value="<?php echo $fix_val['email']; ?> " <?php echo $disabled; ?> /> </p> <p class="gdlr-lms-half-right"> <span><?php _e('Phone', 'gdlr-lms'); ?> </span> <input type="text" name="phone" value="<?php echo $fix_val['phone']; ?> " <?php echo $disabled; ?> /> </p> <div class="clear"></div> <p class="gdlr-lms-half-left"> <span><?php _e('Address', 'gdlr-lms'); ?> </span> <textarea name="address" <?php echo $disabled; ?> ><?php echo $fix_val['address']; ?> </textarea> </p> <p class="gdlr-lms-half-right"> <span><?php _e('Additional Note', 'gdlr-lms'); ?> </span> <textarea name="additional-note" <?php echo $disabled; ?> ><?php echo $fix_val['additional_note']; ?> </textarea> </p> <div class="clear"></div> <p class="gdlr-lms-half-left"> <span><?php _e('Amount', 'gdlr-lms'); ?> </span> <?php $amount_disabled = $disabled == 'disabled' || $course_option['online-course'] == 'enable' ? 'disabled' : ''; ?> <input type="text" name="quantity" value="<?php echo $fix_val['amount']; ?> " <?php echo $amount_disabled; ?> /> </p> <?php $price = empty($course_option['discount-price']) ? $course_option['price'] : $course_option['discount-price']; $price = floatval($price); ?> <p class="gdlr-lms-half-right"> <span><?php _e('Total Price', 'gdlr-lms'); ?> </span> <input type="text" class="price-display" value="<?php echo gdlr_lms_money_format($price * $fix_val['amount']); ?> " disabled /> <input type="hidden" class="price" name="price" value="<?php echo $price * $fix_val['amount']; ?> " /> <input type="hidden" class="price-one" name="amount" value="<?php echo $price; ?> " /> <input type="hidden" class="format" value="<?php echo $lms_money_format; ?> " /> </p> <div class="clear"></div> <?php if ($type == "buy") { if (empty($gdlr_lms_option['instant-payment-method'])) { $gdlr_lms_option['instant-payment-method'] = array('paypal', 'stripe', 'paymill', 'authorize'); } if (sizeof($gdlr_lms_option['instant-payment-method']) > 1) { echo '<div class="gdlr-payment-method" >'; foreach ($gdlr_lms_option['instant-payment-method'] as $key => $payment_method) { echo '<label ' . ($key == 0 ? 'class="gdlr-active"' : '') . ' >'; echo '<input type="radio" name="payment-method" value="' . $payment_method . '" ' . ($key == 0 ? 'checked' : '') . ' />'; echo '<img src="' . plugins_url('../images/' . $payment_method . '.png', __FILE__) . '" alt="" />'; echo '</label>'; } echo '<div class="clear"></div>'; echo '</div>'; } else { echo '<input type="hidden" name="payment-method" value="' . $gdlr_lms_option['instant-payment-method'][0] . '" />'; } } ?> <p> <div class="gdlr-lms-notice"><?php _e('notice', 'gdlr-lms'); ?> </div> <div class="gdlr-lms-loading"><?php _e('loading', 'gdlr-lms'); ?> </div> <input type="hidden" name="rememberme" value="forever" /> <input type="hidden" name="course_id" value="<?php echo $fix_val['course-id']; ?> " /> <input type="hidden" name="course_code" value="<?php echo $course_option['course-code']; ?> " /> <input type="hidden" name="student_id" value="<?php echo $current_user->data->ID; ?> " /> <input type="hidden" name="action" value="<?php echo empty($fix_val['form-class']) ? 'gdlr_lms_form_purchase' : 'gdlr_lms_form_price_validate'; ?> " /> <input type="hidden" name="action_type" value="<?php echo $type; ?> " /> <input type="hidden" name="charset" value="utf-8"> <?php if ($type == "buy") { ?> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="return" value="<?php echo $fix_val['return']; ?> "> <input type="hidden" name="invoice" value="<?php echo $fix_val['id']; ?> "> <input type="hidden" name="business" value="<?php echo $lms_paypal['recipient']; ?> "> <input type="hidden" name="item_name" value="<?php echo esc_attr($fix_val['title']); ?> " /> <input type="hidden" name="currency_code" value="<?php echo $lms_paypal['currency_code']; ?> " /> <?php } ?> <?php wp_nonce_field('gdlr_lms_purchase_form', 'gdlr_lms_purchase_form'); ?> <input type="submit" class="gdlr-lms-button" value="<?php echo $type == 'book' ? __('Book Now!', 'gdlr-lms') : __('Pay Now!', 'gdlr-lms'); ?> " /> </p> </form> </div> <?php }