scheme members list with overll,renew,and not renewed : ps

This commit is contained in:
VE10-Sanjeev 2024-01-04 19:47:45 +05:30
parent 96cea2ac3d
commit ae98fd368c
2 changed files with 164 additions and 105 deletions

View File

@ -61,6 +61,7 @@ class HomeModel extends Model
{ {
$query = $this->db->table('subscription AS S') $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('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('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('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') ->join('book_categories AS BC', 'BC.book_id = S.scheme_id AND BC.isactive = 1', 'left')

View File

@ -58,7 +58,7 @@
</div> </div>
<div class="text-success"> <div class="text-success">
<span> MTD : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Monthly Invoice Raised" data-plugin="counterup"><?= $invoice['month']; ?></span></span> <span> MTD : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Monthly Invoice Raised" data-plugin="counterup"><?= $invoice['month']; ?></span></span>
<span class="float-right" > YTD : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Yearly Invoice Raised" data-plugin="counterup"><?= $invoice['year']; ?></span></span> <span class="float-right"> YTD : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Yearly Invoice Raised" data-plugin="counterup"><?= $invoice['year']; ?></span></span>
</div> </div>
</div><!-- end min-height--> </div><!-- end min-height-->
</div> <!-- end card-body--> </div> <!-- end card-body-->
@ -73,8 +73,7 @@
<?php foreach ($active_schemes as $i => $a) : ?> <?php foreach ($active_schemes as $i => $a) : ?>
<div class="media"> <div class="media">
<?php if (!empty($a['wp_img_url'])) { ?> <?php if (!empty($a['wp_img_url'])) { ?>
<img src="<?= $a['wp_img_url']; ?>" alt="table-user" <img src="<?= $a['wp_img_url']; ?>" alt="table-user" class="mr-3 rounded avatar-md">
class="mr-3 rounded avatar-md">
<?php } else { ?> <?php } else { ?>
<div class="avatar-md mr-3"> <div class="avatar-md mr-3">
<div class="avatar-title bg-light rounded text-body font-20 font-weight-semibold"> <div class="avatar-title bg-light rounded text-body font-20 font-weight-semibold">
@ -124,6 +123,64 @@
</div><!-- end col --> </div><!-- end col -->
</div> </div>
<?php
$class = ['card bg-info border-info', 'card bg-success border-success', 'card bg-warning border-warning', 'card bg-pink border-pink'];
foreach ($active_schemes as $i => $a) :
$color = $class[$i % 4];
?>
<div class="<?= $color; ?>">
<div class="card-body">
<div class="row">
<div class="col-md-4" style="margin-left: 58px;">
<div class="row align-items-center text-center">
<!-- <div class="col-6 ">
<h1 class="display-1"><i class="fe-layers text-white"></i></h1>
wi wi-barometer
</div> -->
<!-- <div class="col-6">
<div class="text-white">
<p><?= $a['name']; ?></p>
</div>
</div> -->
<div class="text-white">
<h3 class="my-3"><i class="fe-layers text-white"></i></h3>
<p><?= $a['name']; ?></p>
</div>
</div><!-- End row -->
</div>
<div class="col-md-6">
<div class="row">
<div class="col-4 text-center">
<h4 class="text-white mt-0">Members - OverAll </h4>
<h3 class="my-3"><i class="fe-user-check text-white"></i></h3>
<!-- fe-layers -->
<h4 class="text-white mb-0"><?= $a['overall']; ?></h4>
</div>
<div class="col-4 text-center">
<h4 class="text-white mt-0">Members - Renewal </h4>
<h3 class="my-3"><i class="fe-user-plus text-white"></i></h3>
<!-- fe-check -->
<h4 class="text-white mb-0"><?= $a['renewal']; ?></h4>
</div>
<div class="col-4 text-center">
<h4 class="text-white mt-0">Members - NonRenewal </h4>
<h3 class="my-3"><i class="fe-user-minus text-white"></i></h3>
<!-- fe-x -->
<h4 class="text-white mb-0"><?= $a['nonrenewal']; ?></h4>
</div>
</div><!-- end row -->
</div>
</div><!-- end row -->
</div>
</div><!-- cardbox -->
<?php endforeach; ?>
<!-- END Weather WIDGET 1 -->
<div class="row"> <div class="row">
<div class="col-xl-4 col-lg-6"> <div class="col-xl-4 col-lg-6">
<div class="card"> <div class="card">
@ -147,8 +204,8 @@
// print "</pre>"; // print "</pre>";
$tempinx = 0; $tempinx = 0;
foreach ($expiring_membership as $e) : foreach ($expiring_membership as $e) :
$daysincount = (int)$e['countdays'] ; $daysincount = (int)$e['countdays'];
$daysincountstring = ($daysincount == 0 ? 'Today' : ($daysincount == 1 ? 'Tomorrow' : $daysincount.' days')); $daysincountstring = ($daysincount == 0 ? 'Today' : ($daysincount == 1 ? 'Tomorrow' : $daysincount . ' days'));
?> ?>
<tr> <tr>
<!-- <td><?= $e['sub_id']; ?></td> --> <!-- <td><?= $e['sub_id']; ?></td> -->
@ -218,7 +275,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php if (count($book_published['book_published']) > 0) : foreach ($book_published['book_published'] as $b) :?> <?php if (count($book_published['book_published']) > 0) : foreach ($book_published['book_published'] as $b) : ?>
<tr> <tr>
<td><?= $b['title']; ?> <td><?= $b['title']; ?>
<?php if (!empty($b['author'])) { ?> <?php if (!empty($b['author'])) { ?>
@ -240,17 +297,18 @@
<td> <td>
<?php // echo $b['categories']; <?php // echo $b['categories'];
$splitted = explode(', ', $b['categories']); $splitted = explode(', ', $b['categories']);
if(!empty($splitted)){ if (!empty($splitted)) {
// print_r($splitted); // print_r($splitted);
for ($i = 0; $i < count($splitted); $i++) { for ($i = 0; $i < count($splitted); $i++) {
if($splitted[$i] !== ''){ ?> if ($splitted[$i] !== '') { ?>
<span class="badge badge-success badge-pill mr-1"><?= str_replace(',', '', $splitted[$i]); ?></span> <span class="badge badge-success badge-pill mr-1"><?= str_replace(',', '', $splitted[$i]); ?></span>
<?php } <?php }
} }
} ?> } ?>
</td> </td>
</tr> </tr>
<?php endforeach;endif; ?> <?php endforeach;
endif; ?>
<!-- <tr> <!-- <tr>
<td>First std English <td>First std English
<p class="text-muted mb-0"> <p class="text-muted mb-0">