diff --git a/assets/core/scss/components/_table.scss b/assets/core/scss/components/_table.scss
index 9af4c04b11..82594148e3 100644
--- a/assets/core/scss/components/_table.scss
+++ b/assets/core/scss/components/_table.scss
@@ -7,8 +7,6 @@
display: block;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
- border: 1px solid $tutor-border-idle;
- border-radius: $tutor-radius-lg;
table {
min-width: 600px;
}
@@ -41,7 +39,6 @@
td {
padding: $tutor-spacing-5;
vertical-align: middle;
- min-width: 180px;
}
}
}
diff --git a/assets/icons/commission.svg b/assets/icons/commission.svg
new file mode 100644
index 0000000000..1b3fb72e59
--- /dev/null
+++ b/assets/icons/commission.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/icons/fees.svg b/assets/icons/fees.svg
new file mode 100644
index 0000000000..2a329397dd
--- /dev/null
+++ b/assets/icons/fees.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/icons/progress.svg b/assets/icons/progress.svg
new file mode 100644
index 0000000000..eae3c8831e
--- /dev/null
+++ b/assets/icons/progress.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/icons/reload-4.svg b/assets/icons/reload-4.svg
new file mode 100644
index 0000000000..26120d4715
--- /dev/null
+++ b/assets/icons/reload-4.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/sale.svg b/assets/icons/sale.svg
new file mode 100644
index 0000000000..0d5c91cfec
--- /dev/null
+++ b/assets/icons/sale.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/icons/wallet.svg b/assets/icons/wallet.svg
new file mode 100644
index 0000000000..9d559af3f3
--- /dev/null
+++ b/assets/icons/wallet.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/icons/withdraw.svg b/assets/icons/withdraw.svg
new file mode 100644
index 0000000000..d734eeee9d
--- /dev/null
+++ b/assets/icons/withdraw.svg
@@ -0,0 +1,6 @@
+
diff --git a/assets/src/js/frontend/dashboard/pages/instructor/home-charts.ts b/assets/src/js/frontend/dashboard/pages/instructor/home-charts.ts
index 83c919eab8..4c5d1abb95 100644
--- a/assets/src/js/frontend/dashboard/pages/instructor/home-charts.ts
+++ b/assets/src/js/frontend/dashboard/pages/instructor/home-charts.ts
@@ -544,7 +544,7 @@ export const overviewChart = (data: OverviewChartProps) => ({
},
createChartConfig(data: OverviewChartProps, colors: OverviewChartColors): ChartConfiguration<'line'> {
- const dataLength = data.earnings.length;
+ const dataLength = data?.earnings?.length || data?.enrolled?.length;
return {
type: 'line',
diff --git a/assets/src/js/v3/shared/icons/types.ts b/assets/src/js/v3/shared/icons/types.ts
index c17453fac8..4de4aa82c9 100644
--- a/assets/src/js/v3/shared/icons/types.ts
+++ b/assets/src/js/v3/shared/icons/types.ts
@@ -259,6 +259,7 @@ export const icons = [
'profile',
'profileCircle',
'profileCircleFill',
+ 'progress',
'psd',
'publish',
'qa',
@@ -285,6 +286,7 @@ export const icons = [
'reload',
'reload2',
'reload3',
+ 'reload4',
'removeImage',
'report',
'resources',
@@ -361,10 +363,12 @@ export const icons = [
'videoQuality',
'vimeo',
'visited',
+ 'wallet',
'warning',
'weightBox',
'wifi',
'wishlist',
+ 'withdraw',
'x',
'xls',
'xml',
diff --git a/assets/src/scss/frontend/dashboard/_profile.scss b/assets/src/scss/frontend/dashboard/_profile.scss
index 0d49ff00ab..eb62fbf329 100644
--- a/assets/src/scss/frontend/dashboard/_profile.scss
+++ b/assets/src/scss/frontend/dashboard/_profile.scss
@@ -21,7 +21,7 @@
border: 1px solid $tutor-border-idle;
border-radius: $tutor-radius-2xl;
padding: $tutor-spacing-6;
- margin-top: $tutor-spacing-9;
+ margin-top: $tutor-spacing-6;
@include tutor-breakpoint-down(sm) {
margin-top: $tutor-spacing-5;
diff --git a/assets/src/scss/frontend/dashboard/_stat-card.scss b/assets/src/scss/frontend/dashboard/_stat-card.scss
index e89317f32e..791a1985d9 100644
--- a/assets/src/scss/frontend/dashboard/_stat-card.scss
+++ b/assets/src/scss/frontend/dashboard/_stat-card.scss
@@ -92,6 +92,97 @@
}
}
+ &-time-spent {
+ .tutor-stat-card-icon {
+ color: $tutor-text-exception4;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-exception4;
+ }
+ }
+
+ &-courses {
+ .tutor-stat-card-icon {
+ color: $tutor-text-success;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-success;
+ }
+ }
+
+
+ &-students {
+ .tutor-stat-card-icon {
+ color: $tutor-text-brand;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-brand;
+ }
+ }
+
+ &-reviews {
+ .tutor-stat-card-icon {
+ color: $tutor-warning-400;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-warning-400;
+ }
+ }
+
+ &-passed {
+ .tutor-stat-card-icon {
+ color: $tutor-text-brand;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-brand;
+ }
+ }
+
+ &-progress {
+ .tutor-stat-card-icon {
+ color: $tutor-exception-5;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-exception-5;
+ }
+ }
+
+ &-completed {
+ .tutor-stat-card-icon {
+ color: $tutor-text-success;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-success;
+ }
+ }
+
+ &-qa {
+ .tutor-stat-card-icon {
+ color: $tutor-exception-2;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-exception-2;
+ }
+ }
+
+ &-book-2 {
+ .tutor-stat-card-icon {
+ color: $tutor-exception-1;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-exception-1;
+ }
+ }
+
&-exception1 {
.tutor-stat-card-icon {
color: $tutor-exception-1;
@@ -132,4 +223,64 @@
color: $tutor-text-exception5;
}
}
+
+ &-earning {
+ .tutor-stat-card-icon {
+ color: $tutor-text-success;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-success;
+ }
+ }
+
+ &-wallet {
+ .tutor-stat-card-icon {
+ color: $tutor-text-brand;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-brand;
+ }
+ }
+
+ &-withdraw {
+ .tutor-stat-card-icon {
+ color: $tutor-text-exception5;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-exception5;
+ }
+ }
+
+ &-sale {
+ .tutor-stat-card-icon {
+ color: $tutor-text-exception1;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-exception1;
+ }
+ }
+
+ &-commission {
+ .tutor-stat-card-icon {
+ color: $tutor-text-exception2;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-exception2;
+ }
+ }
+
+ &-fees {
+ .tutor-stat-card-icon {
+ color: $tutor-text-exception4;
+ }
+
+ .tutor-stat-card-value {
+ color: $tutor-text-exception4;
+ }
+ }
}
diff --git a/classes/Icon.php b/classes/Icon.php
index 82b12f2f07..9941d3690f 100644
--- a/classes/Icon.php
+++ b/classes/Icon.php
@@ -91,6 +91,7 @@ final class Icon {
const CODING = 'coding';
const COLLAPSED = 'collapsed';
const COLOR_OPTION = 'color-option';
+ const COMMISSION = 'commission';
const COMMAND = 'command';
const COMMENTS = 'comments';
const COMPLETED = 'completed';
@@ -158,6 +159,7 @@ final class Icon {
const EYE = 'eye';
const EYE_LINE = 'eye-line';
const FACEBOOK = 'facebook';
+ const FEES = 'fees';
const FEATHER = 'feather';
const FILE = 'file';
const FILE_ATTACHEMENT = 'file-attachement';
@@ -275,6 +277,7 @@ final class Icon {
const PROFILE = 'profile';
const PROFILE_CIRCLE = 'profile-circle';
const PROFILE_CIRCLE_FILL = 'profile-circle-fill';
+ const PROGRESS = 'progress';
const PSD = 'psd';
const PUBLISH = 'publish';
const QA = 'qa';
@@ -301,11 +304,13 @@ final class Icon {
const RELOAD = 'reload';
const RELOAD_2 = 'reload-2';
const RELOAD_3 = 'reload-3';
+ const RELOAD_4 = 'reload-4';
const REMOVE_IMAGE = 'remove-image';
const REPORT = 'report';
const RESOURCES = 'resources';
const ROTATE = 'rotate';
const RTF = 'rtf';
+ const SALE = 'sale';
const SALE_TYPE = 'sale-type';
const SAVE = 'save';
const SEARCH = 'search';
@@ -377,10 +382,12 @@ final class Icon {
const VIDEO_QUALITY = 'video-quality';
const VIMEO = 'vimeo';
const VISITED = 'visited';
+ const WALLET = 'wallet';
const WARNING = 'warning';
const WEIGHT_BOX = 'weight-box';
const WIFI = 'wifi';
const WISHLIST = 'wishlist';
+ const WITHDRAW = 'withdraw';
const X = 'x';
const XLS = 'xls';
const XML = 'xml';
diff --git a/classes/Utils.php b/classes/Utils.php
index 5a2f9a0697..990667c181 100644
--- a/classes/Utils.php
+++ b/classes/Utils.php
@@ -13,13 +13,13 @@
use Tutor\Ecommerce\Tax;
use Tutor\Cache\TutorCache;
use Tutor\Models\QuizModel;
+use Tutor\Helpers\UrlHelper;
use Tutor\Helpers\HttpHelper;
use Tutor\Models\CourseModel;
use Tutor\Ecommerce\Ecommerce;
use Tutor\Helpers\QueryHelper;
use Tutor\Traits\JsonResponse;
use Tutor\Helpers\DateTimeHelper;
-use Tutor\Helpers\UrlHelper;
if ( ! defined( 'ABSPATH' ) ) {
exit;
@@ -3510,11 +3510,11 @@ public function get_students_by_instructor( int $instructor_id, int $offset, int
$students = $wpdb->get_results(
$wpdb->prepare(
"SELECT COUNT(enrollment.post_author) AS course_taken, user.*, (SELECT post_date FROM {$wpdb->posts} WHERE post_author = user.ID LIMIT 1) AS enroll_date
- FROM {$wpdb->posts} enrollment
- INNER JOIN {$wpdb->posts} AS course
- ON enrollment.post_parent=course.ID
- INNER JOIN {$wpdb->users} AS user
- ON user.ID = enrollment.post_author
+ FROM {$wpdb->posts} enrollment
+ INNER JOIN {$wpdb->posts} AS course
+ ON enrollment.post_parent=course.ID
+ INNER JOIN {$wpdb->users} AS user
+ ON user.ID = enrollment.post_author
WHERE course.post_type = %s
AND course.post_status IN ({$post_status})
AND enrollment.post_type = %s
@@ -3523,11 +3523,9 @@ public function get_students_by_instructor( int $instructor_id, int $offset, int
{$course_query}
{$date_query}
AND ( user.display_name LIKE %s OR user.user_nicename LIKE %s OR user.user_email = %s OR user.user_login LIKE %s )
-
GROUP BY enrollment.post_author
ORDER BY {$order_by} {$order}
- LIMIT %d, %d
- ",
+ LIMIT %d, %d",
$course_post_type,
'tutor_enrolled',
'completed',
@@ -3556,9 +3554,7 @@ public function get_students_by_instructor( int $instructor_id, int $offset, int
{$course_query}
{$date_query}
GROUP BY enrollment.post_author
- ORDER BY {$order_by} {$order}
-
- ",
+ ORDER BY {$order_by} {$order}",
$course_post_type,
'tutor_enrolled',
'completed',
@@ -9546,7 +9542,7 @@ public function should_show_dicussion_menu(): bool {
*/
public function default_menus(): array {
$items = array(
- 'index' => array(
+ 'index' => array(
'title' => __( 'Home', 'tutor' ),
'icon' => Icon::HOME,
),
@@ -10742,28 +10738,31 @@ public function build_term_tree( $terms, $parent = 0 ) {
* Render SVG icon
*
* @since 3.7.0
+ * @since 4.0.0 added $return parameter.
*
* @param string $name Icon name.
* @param integer $width Icon width.
* @param integer $height Icon height.
* @param array $attributes Custom attributes.
+ * @param bool $return Whether to return the SVG markup instead of echoing it.
+ * Default false (echo).
*
- * @return void
+ * @return string|null Returns the SVG markup when `$return` is true, otherwise null.
*/
- public function render_svg_icon( $name, $width = 16, $height = 16, $attributes = array() ) {
+ public function render_svg_icon( $name, $width = 16, $height = 16, $attributes = array(), $return = false ): ?string {
$icon_path = tutor()->path . 'assets/icons/' . $name . '.svg';
if ( ! file_exists( $icon_path ) ) {
- return;
+ return null;
}
$svg = file_get_contents( $icon_path );
if ( ! $svg ) {
- return;
+ return null;
}
preg_match( '/