diff --git a/app/Models/HomeModel.php b/app/Models/HomeModel.php index 92421c95..c00cdca7 100644 --- a/app/Models/HomeModel.php +++ b/app/Models/HomeModel.php @@ -61,6 +61,7 @@ class HomeModel extends Model { $query = $this->db->table('subscription AS S') ->select('S.business_id,BK.title as name,BK.book_id as id,S.scheme_id,LEFT(BK.title, 1) AS first_letter,COUNT(S.customer_id) AS count,BI.wp_img_url') + ->select('COUNT(S.customer_id) AS overall,COUNT(IF(S.isactive = 0, S.customer_id, NULL)) AS nonrenewal,COUNT(IF(S.isactive = 1, S.customer_id, NULL)) AS renewal') ->join('customers AS C', 'C.customer_id = S.customer_id AND C.isactive = 1', 'left') ->join('books AS BK', 'BK.book_id = S.scheme_id', 'left') ->join('book_categories AS BC', 'BC.book_id = S.scheme_id AND BC.isactive = 1', 'left') diff --git a/app/Views/dashboard.php b/app/Views/dashboard.php index 525d213e..1d2ef1da 100644 --- a/app/Views/dashboard.php +++ b/app/Views/dashboard.php @@ -48,19 +48,19 @@
+ = $a['count']; ?> Subscribers +
- = $a['count']; ?> Subscribers -
-= $a['name']; ?>
+| # | -Name | -Scheme Name | -Expiring In | -
|---|
| # | +Name | +Scheme Name | +Expiring In | +
|---|---|---|---|
| = ++$tempinx; ?> | -
- = $e['customer_name']; ?>- = $e['customer_mobile']; ?> - |
- = $e['title']; ?> | -= $daysincountstring; ?> = $e['to_subscription_date_format']; ?> |
- = ++$tempinx; ?> | +
+ = $e['customer_name']; ?>+ = $e['customer_mobile']; ?> + |
+ = $e['title']; ?> | += $daysincountstring; ?> = $e['to_subscription_date_format']; ?> |
+
+
+
-
-
| = $b['title']; ?>
-
- - = $b['author']; ?> - - - -- = $b['publisher']; ?> - - - -- = $b['publication_date_format']; ?> - - - |
- - - = str_replace(',', '', $splitted[$i]); ?> - - | -
| = $b['title']; ?>
+
+ + = $b['author']; ?> + + + ++ = $b['publisher']; ?> + + + ++ = $b['publication_date_format']; ?> + + + |
+ + + = str_replace(',', '', $splitted[$i]); ?> + + | +