Minor Fixes : ps

This commit is contained in:
VE10-Sanjeev 2024-03-27 19:21:27 +05:30
parent 43d27d1654
commit d52795eb11
25 changed files with 401 additions and 515 deletions

View File

@ -730,6 +730,7 @@ class ApiIntegration extends ResourceController
$extensive_correspondence = ""; $extensive_correspondence = "";
$invoice_id = ""; $invoice_id = "";
if (count($records) > 0 && !empty($wordpress_order_id)) { if (count($records) > 0 && !empty($wordpress_order_id)) {
if($records['status'] == 'completed' || $records['status'] == 'processing'){
$where = ['wp_api_order_id' => $wordpress_order_id, 'isactive' => 1]; $where = ['wp_api_order_id' => $wordpress_order_id, 'isactive' => 1];
$invoice_details = $api_model->setTable('invoice')->where($where)->first(); $invoice_details = $api_model->setTable('invoice')->where($where)->first();
if (isset($invoice_details['invoice_id']) && $invoice_details['invoice_id'] != "") { if (isset($invoice_details['invoice_id']) && $invoice_details['invoice_id'] != "") {
@ -796,6 +797,28 @@ class ApiIntegration extends ResourceController
$subtotal = (float)$lineitems_subtotal + (float)$records['shipping_total']; $subtotal = (float)$lineitems_subtotal + (float)$records['shipping_total'];
$tax = $lineitems_tax + (float)$records['shipping_tax']; $tax = $lineitems_tax + (float)$records['shipping_tax'];
$total = ($lineitems_total)+(float)$records['shipping_total'] + (float)$records['shipping_tax']; $total = ($lineitems_total)+(float)$records['shipping_total'] + (float)$records['shipping_tax'];
$final_status = '';
switch ($records['status']) {
case 'completed':
case 'processing':
$final_status = 'Approved';
break;
case 'refunded':
$final_status = 'Refunded';
break;
case 'failed':
case 'cancelled':
$final_status = 'Cancelled';
break;
case 'checkout-draft':
case 'pending':
case 'on-hold':
$final_status = 'Inprogress';
break;
default:
$final_status = 'Inprogress';
}
$invoice_data['invoice_id']=$invoice_id; $invoice_data['invoice_id']=$invoice_id;
@ -811,7 +834,7 @@ class ApiIntegration extends ResourceController
$invoice_data['payment_status']=$records['status']; $invoice_data['payment_status']=$records['status'];
$invoice_data['order_number']=$records['order_key']; $invoice_data['order_number']=$records['order_key'];
$invoice_data['payment_method']=$records['payment_method_title']; $invoice_data['payment_method']=$records['payment_method_title'];
$invoice_data['status']='Approved'; $invoice_data['status']=$final_status;
$invoice_data['event_id']=NULL; $invoice_data['event_id']=NULL;
$invoice_data['business_id']=$this->global_variable_business_id; $invoice_data['business_id']=$this->global_variable_business_id;
$invoice_data['shipping_address']=$shipping_addr; $invoice_data['shipping_address']=$shipping_addr;
@ -922,7 +945,7 @@ class ApiIntegration extends ResourceController
// return $element['category_name'] === 'Membership' && $element['sku'] === $skuId; // return $element['category_name'] === 'Membership' && $element['sku'] === $skuId;
// }); // });
$result_book_category = array_filter($get_book_category, function ($element) use ($skuId) { $result_book_category = array_filter($get_book_category, function ($element) use ($skuId) {
return $element['category_name'] === 'Membership' && $element['sku'] === $skuId; return strtolower($element['category_name']) === strtolower('Membership') && $element['sku'] === $skuId;
}); });
$fromDate = NULL; $fromDate = NULL;
$toDate = NULL; $toDate = NULL;
@ -1088,6 +1111,10 @@ class ApiIntegration extends ResourceController
// $this->logger->error("Api SaveSalesDetails : Err = Invoice items (Shipping) Data Not Found"); // $this->logger->error("Api SaveSalesDetails : Err = Invoice items (Shipping) Data Not Found");
// } // }
$response = ['status' => 200, 'message' => $basic_message ,'indetails' => $extensive_correspondence]; $response = ['status' => 200, 'message' => $basic_message ,'indetails' => $extensive_correspondence];
}else{
$this->logger->error("Api SaveSalesDetails : Err = Because Status from Request is ".$records['status']);
$response = ['status' => 204, 'message' => 'Data No Found Because Status from Request is '.$records['status']];
}
} }
else { else {
$this->logger->error("Api SaveSalesDetails : Err = Data Not Found"); $this->logger->error("Api SaveSalesDetails : Err = Data Not Found");

View File

@ -65,13 +65,7 @@ abstract class BaseController extends Controller
echo "This is a command-line request."; echo "This is a command-line request.";
// echo $requestedRoute; // echo $requestedRoute;
} else { } else {
if ($requestedRoute !== '/login' && $requestedRoute !== '/authenticate' && $requestedRoute !== '/auth_confirm_mail' && $requestedRoute !== '/auth_reset_password' && $requestedRoute !== 'auth_reset_password_save' && $uri->getSegment(1) != 'getExpCustomerDetail'&& $uri->getSegment(1) != 'download_invoice_pdf') {
if ($uri->getSegment(1) != 'getExpCustomerDetail'&& $uri->getSegment(1) != 'download_invoice_pdf') {
$this->authData = $this->session_log();
}
$routesArr = ['login', 'authenticate', 'auth_confirm_mail', 'auth_reset_password', 'auth_reset_password_save'];
if (!in_array($requestedRoute, $routesArr)) {
$this->authData = $this->session_log(); $this->authData = $this->session_log();
} }
} }
@ -111,7 +105,7 @@ abstract class BaseController extends Controller
$details = $auth_model->getheringDetailsForHeader($session_uid); $details = $auth_model->getheringDetailsForHeader($session_uid);
// $data['company_name'] = $details[0]['site_name']; // $data['company_name'] = $details[0]['site_name'];
$data['company_name'] = $details[0]['company_name']; $data['company_name'] = $details[0]['company_name'] ? $details[0]['company_name'] : "ABD";
$data['company_short_name'] = $details[0]['site_short_name']; $data['company_short_name'] = $details[0]['site_short_name'];
$data['company_address'] = $details[0]['company_address']; $data['company_address'] = $details[0]['company_address'];
$data['company_mobile_no'] = $details[0]['company_mobile_no']; $data['company_mobile_no'] = $details[0]['company_mobile_no'];

View File

@ -924,32 +924,28 @@ $encodedUrl = urlencode($url);
} }
public function expired_customer_report() public function expired_customer_report()
{ {
$model = new InvoiceModel();
if($this->request->getmethod() == 'get') if($this->request->getmethod() == 'get')
{ {
$model = new InvoiceModel();
$data['expired_customers'] = $model->getExpiredCustomers(); $data['expired_customers'] = $model->getExpiredCustomers();
$data['selected_data'] = ""; $data['selected_data'] = "";
$this->logger->info("'Membership Renewals Report'");
$data['page_name'] = 'Membership Renewals Report';
$this->render_page('report_expired_customers', $data);
} }
else else
{ {
$dateParts = explode(' - ', $this->request->getVar('date') ); $dateParts = explode(' - ', $this->request->getVar('date') );
$fromDate = $dateParts[0]; $fromDate = $dateParts[0];
$toDate = $dateParts[1]; $toDate = $dateParts[1];
$dateTime = \DateTime::createFromFormat('d/m/Y', $fromDate); $dateTime = \DateTime::createFromFormat('d/m/Y', $fromDate);
$dateTime1 = \DateTime::createFromFormat('d/m/Y', $toDate); $dateTime1 = \DateTime::createFromFormat('d/m/Y', $toDate);
$model = new InvoiceModel(); $model = new InvoiceModel();
$data['expired_customers'] = $model->getExpiredCustomers( $dateTime->format('Y-m-d') , $dateTime1->format('Y-m-d') ); $data['expired_customers'] = $model->getExpiredCustomers( $dateTime->format('Y-m-d') , $dateTime1->format('Y-m-d') );
$data['selected_data'] = $this->request->getVar('date'); $data['selected_data'] = $this->request->getVar('date');
$this->logger->info("Itemwise Report "); $this->logger->info("Itemwise Report ");
}
$this->logger->info("'Membership Renewals Report'"); $this->logger->info("'Membership Renewals Report'");
$data['page_name'] = 'Membership Renewals Report'; $data['page_name'] = 'Membership Renewals Report';
$this->render_page('report_expired_customers', $data); $this->render_page('report_expired_customers', $data);
}
} }
public function itemwise_report() public function itemwise_report()

View File

@ -86,7 +86,7 @@ class Scheme extends BaseController
$db = db_connect(); $db = db_connect();
$category = $db->table('category') $category = $db->table('category')
->select('id') ->select('id')
->where('name', $category_name) ->where('Lower(name)', strtolower($category_name))
->get() ->get()
->getRow(); ->getRow();
// Check if the category exists // Check if the category exists

View File

@ -154,7 +154,8 @@ class HomeModel extends Model
->groupBy('S.sub_id') ->groupBy('S.sub_id')
->get() ->get()
->getResultArray(); ->getResultArray();
// print_r($membershipList);
// echo $this->db->getLastQuery(); die;
foreach ($membershipList as &$membership) { foreach ($membershipList as &$membership) {
$notifications = $this->getNotifications($membership['customer_id']); $notifications = $this->getNotifications($membership['customer_id']);

View File

@ -104,10 +104,10 @@ public function getSubscriptionInvoiceDetail($where)
$schemes = []; $schemes = [];
$invoiceItems = $this->getInvoiceItems($invoiceId, ''); $invoiceItems = $this->getInvoiceItems($invoiceId, '');
foreach ($invoiceItems as $j => $child) { foreach ($invoiceItems as $j => $child) {
if ($child->category_name == 'Membership') { if (strtolower($child->category_name) == strtolower('Membership')) {
$schemes[] = [ $schemes[] = [
'scheme_name' => $child->title, 'scheme_name' => $child->title,
'scheme_code' => $child->short_code, // Update this line to use the correct property 'scheme_code' => !empty($child->short_code)?$child->short_code:$child->title,
]; ];
} }
} }
@ -503,14 +503,16 @@ public function getExpiredCustomers($f_date = null, $t_date = null)
} }
$result = $query $result = $query
->select('S.customer_id,S.sub_id, S.from_subscription, S.to_subscription, C.first_name, C.last_name, C.email, C.mobile_no, S.scheme_id,books.short_code') ->select('S.customer_id,S.sub_id, S.from_subscription, S.to_subscription, C.first_name, C.last_name, C.email, C.mobile_no, S.scheme_id,B.short_code')
->join('customers as C', 'C.customer_id = S.customer_id', 'left') ->join('customers as C', 'C.customer_id = S.customer_id', 'left')
->join('books', 'books.book_id = S.scheme_id', 'left') ->join('books as B', 'B.book_id = S.scheme_id', 'left')
->where('S.isactive', 1) ->where('S.isactive', 1)
->where('S.to_subscription <=', $now)
->get() ->get()
->getResultArray(); ->getResultArray();
// print_r($result);
// echo "<pre>";
// echo $this->db->getLastQuery();
// echo "</pre>";die;
return $result; return $result;
} }

View File

@ -24,7 +24,7 @@ class SchemeModel extends Model
$builder->join('book_categories', 'book_categories.book_id = books.book_id', 'left'); $builder->join('book_categories', 'book_categories.book_id = books.book_id', 'left');
$builder->join('category', 'category.id = book_categories.category_id', 'left'); $builder->join('category', 'category.id = book_categories.category_id', 'left');
$builder->where('books.business_id', $business_id); $builder->where('books.business_id', $business_id);
$builder->where('category.name', 'membership'); $builder->where('LOWER(category.name)', 'membership');
$builder->where('books.isactive', 1); $builder->where('books.isactive', 1);
$query = $builder->get(); $query = $builder->get();

View File

@ -15,7 +15,7 @@ public function getAllSubscribersWithNames($where)
{ {
$builder = $this->db->table('subscription'); $builder = $this->db->table('subscription');
$builder->select('subscription.*, books.title, books.isactive, CONCAT(customers.first_name, " ", customers.last_name) as customer_name'); $builder->select('subscription.*, books.title,books.short_code, books.isactive, CONCAT(customers.first_name, " ", customers.last_name) as customer_name');
$builder->join('books', 'books.book_id = subscription.scheme_id'); $builder->join('books', 'books.book_id = subscription.scheme_id');
$builder->join('customers', 'customers.customer_id = subscription.customer_id'); $builder->join('customers', 'customers.customer_id = subscription.customer_id');
$builder->where($where); $builder->where($where);

View File

@ -38,7 +38,7 @@
<th>Year Of Release</th> <th>Year Of Release</th>
<th>Price of the Book</th> <th>Price of the Book</th>
<th>Status</th> <th>Status</th>
<th>Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -55,14 +55,14 @@
?> ?>
<tr> <tr>
<td hidden><?php echo $row['book_id']; ?></td> <td hidden><?php echo $row['book_id']; ?></td>
<td><?php echo $row['title']; ?></td> <td data-order="<?= $row['title']; ?>"><?php echo $row['title']; ?></td>
<td><?php echo isset($row['author']) ? $row['author'] : ""; ?></td> <td data-order="<?= $row['author']; ?>"><?php echo isset($row['author']) ? $row['author'] : ""; ?></td>
<td><?php echo $row['category_name']; ?></td> <td data-order="<?= $row['category_name']; ?>"><?php echo $row['category_name']; ?></td>
<td><?php echo $row['language']; ?></td> <td data-order="<?= $row['language']; ?>"><?php echo $row['language']; ?></td>
<td><?php echo $formattedPublicationYear ; ?></td> <td data-order="<?= $formattedPublicationYear; ?>"><?php echo $formattedPublicationYear ; ?></td>
<!-- <td> <span data-plugin="counterup"><?php echo $row['price']; ?></span></td> --> <!-- <td> <span data-plugin="counterup"><?php echo $row['price']; ?></span></td> -->
<td> <?php echo $row['price']; ?></td> <td data-order="<?= $row['price']; ?>"> <?php echo $row['price']; ?></td>
<td> <td data-order="<?= $message; ?>">
<span class="<?php echo $class; ?>"><?php echo $message; ?></span> <span class="<?php echo $class; ?>"><?php echo $message; ?></span>
</td> </td>
<td> <td>
@ -88,9 +88,10 @@
<!-- end row--> <!-- end row-->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_new').DataTable({ $('#scroll-horizontal-datatable_new').DataTable({
"order": [[0, "desc"]] // 4 is the column index of "created_on" in your table "order": [[0, "desc"]],
// Other DataTables configuration options "columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
}); });
}); });
</script> </script>

View File

@ -38,7 +38,7 @@
<th>Created at</th> <th>Created at</th>
<th>Created by</th> <th>Created by</th>
<th>Status</th> <th>Status</th>
<th>Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<?php foreach ($campaign as $c) : <?php foreach ($campaign as $c) :
@ -54,14 +54,14 @@
?> ?>
<tr> <tr>
<td hidden><?= $c['campaign_id']; ?></td> <td hidden><?= $c['campaign_id']; ?></td>
<td><?= $c['campaign_name']; ?></td> <td data-order="<?= $c['campaign_name']; ?>"><?= $c['campaign_name']; ?></td>
<td><?= $c['template_name']; ?></td> <td data-order="<?= $c['template_name']; ?>"><?= $c['template_name']; ?></td>
<td><?= $c['group_name']; ?></td> <td data-order="<?= $c['group_name']; ?>"><?= $c['group_name']; ?></td>
<td><?= $c['customer_group_count']; ?></td> <td data-order="<?= $c['customer_group_count']; ?>"><?= $c['customer_group_count']; ?></td>
<td><?= $scheduled_date." ".$scheduled_time; ?></td> <td><?= $scheduled_date." ".$scheduled_time; ?></td>
<td><?= $c['formatted_created_on']; ?></td> <td data-order="<?= $c['formatted_created_on']; ?>"><?= $c['formatted_created_on']; ?></td>
<td><?= $c['created_by_name']; ?></td> <td data-order="<?= $c['created_by_name']; ?>"><?= $c['created_by_name']; ?></td>
<td><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td> <td data-order="<?= $message; ?>"><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td>
<td> <td>
<a href="<?= base_url()."campaign_creation_form/".$c['campaign_id']; ?>" class="edit-button" title="Click to Edit Campaign" ><i class="ri-pencil-line"></i></a> <a href="<?= base_url()."campaign_creation_form/".$c['campaign_id']; ?>" class="edit-button" title="Click to Edit Campaign" ><i class="ri-pencil-line"></i></a>
<?php if ($c['isactive']) { ?> <a href="<?= base_url() . "campaign_creation_delete/".$c['campaign_id']; ?>" class="delete-button" title="Click to Delete Campaign" ><i class="ri-delete-bin-line"></i></a> <?php } ?> <?php if ($c['isactive']) { ?> <a href="<?= base_url() . "campaign_creation_delete/".$c['campaign_id']; ?>" class="delete-button" title="Click to Delete Campaign" ><i class="ri-delete-bin-line"></i></a> <?php } ?>
@ -78,11 +78,10 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_customer').DataTable({ $('#scroll-horizontal-datatable_customer').DataTable({
"order": [ "order": [ [0, "desc"] ],
[0, "desc"] "columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options
}); });
}); });
</script> </script>

View File

@ -34,7 +34,7 @@
<th>Created at</th> <th>Created at</th>
<th>Created by</th> <th>Created by</th>
<th>Status</th> <th>Status</th>
<th>Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<?php foreach ($customer_group as $group) : <?php foreach ($customer_group as $group) :
@ -47,10 +47,10 @@
} ?> } ?>
<tr> <tr>
<td hidden><?= $group['group_id']; ?></td> <td hidden><?= $group['group_id']; ?></td>
<td><?= $group['group_name']; ?></td> <td data-order="<?= $group['group_name']; ?>"><?= $group['group_name']; ?></td>
<td><?= $group['formatted_created_on']; ?></td> <td data-order="<?= $group['formatted_created_on']; ?>"><?= $group['formatted_created_on']; ?></td>
<td><?= $group['created_by_name']; ?></td> <td data-order="<?= $group['created_by_name']; ?>"><?= $group['created_by_name']; ?></td>
<td><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td> <td data-order="<?= $message; ?>"><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td>
<td> <td>
<a href="<?= base_url() . "view_customer_group/" . $group['group_id']; ?>" class="edit-button" title="Edit" ><i class="ri-pencil-line"></i></a> <a href="<?= base_url() . "view_customer_group/" . $group['group_id']; ?>" class="edit-button" title="Edit" ><i class="ri-pencil-line"></i></a>
<a class="preview-button" title="Customer list" data-toggle="modal" data-target="#scrollable-modal" data-primary-key="<?php echo $group['group_id']; ?>" data-group-name="<?php echo $group['group_name']; ?>"><i class="ri-pages-line"></i></a> <a class="preview-button" title="Customer list" data-toggle="modal" data-target="#scrollable-modal" data-primary-key="<?php echo $group['group_id']; ?>" data-group-name="<?php echo $group['group_name']; ?>"><i class="ri-pages-line"></i></a>
@ -99,9 +99,10 @@
<!-- end row--> <!-- end row-->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_customer').DataTable({ $('#scroll-horizontal-datatable_customer').DataTable({
"order": [[0, "desc"]] // 4 is the column index of "created_on" in your table "order": [ [0, "desc"] ],
// Other DataTables configuration options "columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
}); });
}); });
</script> </script>

View File

@ -34,16 +34,16 @@
<th>Mobile Number</th> <th>Mobile Number</th>
<th>Email</th> <th>Email</th>
<th>Mode</th> <th>Mode</th>
<th>Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<?php foreach ($customer as $value) :?> <?php foreach ($customer as $value) :?>
<tr> <tr>
<td hidden><?$value['customer_id'];?></td> <td hidden><?$value['customer_id'];?></td>
<td><?= $value['first_name'].' '.$value['last_name'] ; ?></td> <td data-order="<?= $value['first_name']; ?>"><?= $value['first_name'].' '.$value['last_name'] ; ?></td>
<td><?= $value['mobile_no']; ?></td> <td data-order="<?= $value['mobile_no']; ?>"><?= $value['mobile_no']; ?></td>
<td><?= $value['email']; ?></td> <td data-order="<?= $value['email']; ?>"><?= $value['email']; ?></td>
<td><?= $value['mode']; ?></td> <td data-order="<?= $value['mode']; ?>"><?= $value['mode']; ?></td>
<td> <td>
<a href="<?= "new_customer/" . $value['customer_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a> <a href="<?= "new_customer/" . $value['customer_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
<a href="<?= "delete_customer/" . $value['customer_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a> <a href="<?= "delete_customer/" . $value['customer_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
@ -61,9 +61,10 @@
<!-- end row--> <!-- end row-->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_customer').DataTable({ $('#scroll-horizontal-datatable_customer').DataTable({
"order": [[0, "desc"]] // 4 is the column index of "created_on" in your table "order": [[0, "desc"]],
// Other DataTables configuration options "columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
}); });
}); });
</script> </script>

View File

@ -5,9 +5,10 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="dropdown float-right"> <div class="dropdown float-right">
<a href="#" class="dropdown-toggle arrow-none card-drop" data-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-dots-horizontal"></i> <i class="mdi mdi-dots-horizontal"></i>
</a> <!-- <a href="#" class="dropdown-toggle arrow-none card-drop" data-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-dots-horizontal"></i>
</a> -->
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<!-- item--> <!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Action</a> <a href="javascript:void(0);" class="dropdown-item">Action</a>
@ -40,209 +41,90 @@
</div> </div>
<br> <br>
<div class="text-success"> <div class="text-success">
<span class="float-left"> MTD : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Monthly Invoice Raised" data-plugin="counterup"><?= $invoice['month']['count']; ?></span>-₹<?= $invoice['month']['total_amount']; ?></span> <span class="float-left"> MTD :
<span class="float-right"> YTD : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Yearly Invoice Raised" data-plugin="counterup"><?= $invoice['year']['count']; ?></span>-₹<?= $invoice['year']['total_amount']; ?></span> <span data-toggle="tooltip" data-placement="bottom" data-original-title="Monthly Invoice Raised" data-plugin="counterup"><?= $invoice['month']['count']; ?></span>
<span data-toggle="tooltip" data-placement="bottom" data-original-title="Monthly Invoice Total Amount">- <?= $invoice['month']['total_amount']; ?></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']['count']; ?></span>
<span data-toggle="tooltip" data-placement="bottom" data-original-title="Yearly Invoice Total Amount">- <?= $invoice['year']['total_amount']; ?></span>
</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div><!-- end col --> </div><!-- end col -->
<?php if (!empty($active_schemes) && isset($active_schemes[0])) : ?> <?php
if (!empty($active_schemes)) {
foreach ($active_schemes as $a) {
?>
<div class="col-xl-4 col-md-6"> <div class="col-xl-4 col-md-6">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<?php $firstScheme = $active_schemes[0]; ?>
<div class="dropdown float-right"> <div class="dropdown float-right">
<a href="#" class="dropdown-toggle arrow-none card-drop" data-toggle="dropdown" aria-expanded="false"> <a href="#" class="dropdown-toggle arrow-none card-drop" data-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-dots-horizontal"></i> <i class="mdi mdi-dots-horizontal"></i>
</a> </a>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<!-- item--> <!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Action</a> <!-- <a href="javascript:void(0);" class="dropdown-item">Action</a> -->
<!-- item--> <!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Another action</a> <!-- <a href="javascript:void(0);" class="dropdown-item">Another action</a> -->
<!-- item--> <!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Something else</a> <!-- <a href="javascript:void(0);" class="dropdown-item">Something else</a> -->
<!-- item--> <!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Separated link</a> <!-- <a href="javascript:void(0);" class="dropdown-item">Separated link</a> -->
<center><i><?= $a['name']; ?></i></center>
</div> </div>
</div> </div>
<h4 class="header-title mt-0"><?= $firstScheme['short_code']; ?></h4> <h4 class="header-title mt-0"><?= $a['short_code']; ?></h4>
<div class="mt-3"> <div class="mt-3">
<div class="media"> <div class="media">
<div dir="ltr"> <div dir="ltr">
<!-- <h3 class="my-2 py-1"><span data-plugin="counterup"><?= $firstScheme['activeoverall']; ?></span></h3> --> <!-- <h3 class="my-2 py-1"><span data-plugin="counterup"><?= $a['activeoverall']; ?></span></h3> -->
<!-- <input data-plugin="knob" data-width="64" data-height="64" data-fgColor="#675db7" <!-- <input data-plugin="knob" data-width="64" data-height="64" data-fgColor="#675db7"
data-bgColor="#e8e7f4" value="" data-bgColor="#e8e7f4" value=""
data-skin="tron" data-angleOffset="" data-readOnly=true data-skin="tron" data-angleOffset="" data-readOnly=true
data-thickness=".15" style="font: bold 18px Arial;"/> --> data-thickness=".15" style="font: bold 18px Arial;"/> -->
</div> </div>
<div class="media-body text-center align-self-center"> <!-- <div class="avatar-md mr-3">
<h3 class="mt-0 mb-1"><?= $firstScheme['activeoverall']; ?></h3>
<p class="text-muted mb-0">Total Subscriber</p>
</div>
</div>
<br>
<div class="text-success">
<span class="float-left"> New : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Monthly Invoice Raised" data-plugin="counterup"><?= $firstScheme['nonrenewal']; ?></span><br></span>
<span class="float-right">Renewed: <span data-toggle="tooltip" data-placement="bottom" data-original-title="Yearly Invoice Raised" data-plugin="counterup"><?= $firstScheme['renewal']; ?></span><br></span>
</div>
</div>
</div>
</div>
</div><!-- end col -->
<?php endif; ?>
<?php if (!empty($active_schemes) && isset($active_schemes[1])) : ?>
<div class="col-xl-4 col-md-6">
<div class="card">
<div class="card-body">
<?php $firstScheme = $active_schemes[1]; ?>
<div class="dropdown float-right">
<a href="#" class="dropdown-toggle arrow-none card-drop" data-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-dots-horizontal"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Action</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Another action</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Something else</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Separated link</a>
</div>
</div>
<h4 class="header-title mt-0"><?= $firstScheme['short_code']; ?></h4>
<div class="mt-3">
<div class="media">
<div dir="ltr">
</div>
<div class="media-body text-center align-self-center">
<h3 class="mt-0 mb-1"><?= $firstScheme['activeoverall']; ?></h3>
<p class="text-muted mb-0">Total Subscriber</p>
</div>
</div>
<br>
<div class="text-success">
<span class="float-left"> New : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Monthly Invoice Raised" data-plugin="counterup"><?= $firstScheme['nonrenewal']; ?></span><br></span>
<span class="float-right">Renewed: <span data-toggle="tooltip" data-placement="bottom" data-original-title="Yearly Invoice Raised" data-plugin="counterup"><?= $firstScheme['renewal']; ?></span><br></span>
</div>
</div>
</div>
</div>
</div><!-- end col -->
<?php endif; ?>
<?php if (!empty($active_schemes) && isset($active_schemes[9])) : ?>
<div class="col-lg-4">
<div class="card">
<div class="card-body" style="width:119%;">
<div class="media">
<?php $firstScheme = $active_schemes[2]; ?>
<div class="avatar-md mr-3">
<div> <div>
<?php if (!empty($firstScheme['wp_img_url'])) { ?> <?php if (!empty($a['wp_img_url'])) { ?>
<img src="<?= $firstScheme['wp_img_url']; ?>" alt="table-user" class="mr-3 rounded avatar-md"> <img src="<?= $a['wp_img_url']; ?>" alt="table-user" class="mr-3 rounded avatar-md">
<?php } else { ?> <?php } else { ?>
<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">
<?= $firstScheme['first_letter']; ?> <?= $a['first_letter']; ?>
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
</div> </div> -->
<div class="media-body"> <!-- <div class="media-body">
<h5 class="my-1"><a href="javascript:void(0);" class="text-dark"><?= $firstScheme['short_code']; ?></a></h5> <h5 class="my-1"><a href="javascript:void(0);" class="text-dark"><?= $a['short_code']; ?></a></h5>
<p class="text-muted mb-0"> <p class="text-muted mb-0">
</p> </p>
</div> </div> -->
</div>
<hr>
<div class="text-muted">
<div class="row">
<div class="col-sm-4 col-6">
<div>
<p class="mb-0">Total Subscribers</p>
<h5 class="mb-sm-0"><?= $firstScheme['activeoverall']; ?></h5>
</div>
</div>
<div class="col-sm-4 col-6">
<div>
<p class="mb-0">New Subscribers</p>
<h5 class="mb-sm-0"><?= $firstScheme['nonrenewal']; ?></h5>
</div>
</div>
<div class="col-sm-4 col-6">
<div class="mt-3 mt-sm-0">
<p class="mb-0">Renewed</p>
<h5 class="mb-0"><?= $firstScheme['renewal']; ?> </h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if (!empty($active_schemes) && isset($active_schemes[2])) : ?>
<div class="col-xl-4 col-md-6">
<div class="card">
<div class="card-body">
<?php $firstScheme = $active_schemes[2]; ?>
<div class="dropdown float-right">
<a href="#" class="dropdown-toggle arrow-none card-drop" data-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-dots-horizontal"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Action</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Another action</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Something else</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item">Separated link</a>
</div>
</div>
<h4 class="header-title mt-0"><?= $firstScheme['short_code']; ?></h4>
<div class="mt-3">
<div class="media">
<div dir="ltr">
<!-- <h3 class="my-2 py-1"><span data-plugin="counterup"><?= $firstScheme['activeoverall']; ?></span></h3> -->
<!-- <input data-plugin="knob" data-width="64" data-height="64" data-fgColor="#675db7"
data-bgColor="#e8e7f4" value=""
data-skin="tron" data-angleOffset="" data-readOnly=true
data-thickness=".15" style="font: bold 18px Arial;"/> -->
</div>
<div class="media-body text-center align-self-center"> <div class="media-body text-center align-self-center">
<h3 class="mt-0 mb-1"><?= $firstScheme['activeoverall']; ?></h3> <h3 class="mt-0 mb-1"><?= $a['activeoverall']; ?></h3>
<p class="text-muted mb-0">Total Subscriber</p> <p class="text-muted mb-0">Total Subscriber</p>
</div> </div>
</div> </div>
<br> <br>
<div class="text-success"> <div class="text-success">
<span class="float-left"> New : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Monthly Invoice Raised" data-plugin="counterup"><?= $firstScheme['nonrenewal']; ?></span><br></span> <span class="float-left"> New : <span data-toggle="tooltip" data-placement="bottom" data-original-title="Active New Subscriber" data-plugin="counterup"><?= $a['nonrenewal']; ?></span><br></span>
<span class="float-right">Renewed: <span data-toggle="tooltip" data-placement="bottom" data-original-title="Yearly Invoice Raised" data-plugin="counterup"><?= $firstScheme['renewal']; ?></span><br></span> <span class="float-right"> Renewed: <span data-toggle="tooltip" data-placement="bottom" data-original-title="Active Re-Newed Subscriber" data-plugin="counterup"><?= $a['renewal']; ?></span><br></span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div><!-- end col --> </div><!-- end col -->
<?php endif; ?> <?php
}
}
?>
</div> </div>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
@ -264,11 +146,9 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php print_r($expiring_membership);
// print "<pre>";
// print_r($expiring_membership);
// print "</pre>";
$tempinx = 0; $tempinx = 0;
if(!empty($expiring_membership)):
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'));
@ -288,7 +168,11 @@
?> ?>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; else : ?>
<tr>
<td colspan="7"><center>No data found</center></td>
</tr>
<?php endif; ?>
</tbody> </tbody>
</table> </table>
</div> <!-- end table-responsive--> </div> <!-- end table-responsive-->

View File

@ -34,13 +34,13 @@
<tr> <tr>
<th hidden ></th> <th hidden ></th>
<th>Event Name</th> <th>Event Name</th>
<th>Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<?php foreach ($event as $value) :?> <?php foreach ($event as $value) :?>
<tr> <tr>
<td hidden><?= $value['event_id']; ?></td> <td hidden><?= $value['event_id']; ?></td>
<td><?= $value['event_name']; ?></td> <td data-order="<?= $value['event_name']; ?>"><?= $value['event_name']; ?></td>
<td> <td>
<div class="custom-control custom-switch"> <div class="custom-control custom-switch">
<input type="radio" class="custom-control-input" name="is_the_default" value="<?= $value['event_id'] ?>" id="<?= $value['event_id'] ?>" <?= $value['is_the_default'] ? "checked" : ""; ?> > <input type="radio" class="custom-control-input" name="is_the_default" value="<?= $value['event_id'] ?>" id="<?= $value['event_id'] ?>" <?= $value['is_the_default'] ? "checked" : ""; ?> >
@ -59,8 +59,10 @@
</div><!-- end row--> </div><!-- end row-->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
var table = $('#basic-datatable_new').DataTable({ var table = $('#basic-datatable_new').DataTable({
"order": [[0, "dsc"]] // Sort by the first (index 0) column (id) in ascending order "order": [[0, "dsc"]], // Sort by the first (index 0) column (id) in ascending order
"columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
}); });
}); });

View File

@ -60,7 +60,7 @@
<th>Customer Name</th> <th>Customer Name</th>
<th>Status</th> <th>Status</th>
<th>Total</th> <th>Total</th>
<th align="center">Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -167,11 +167,10 @@
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_wrapper').DataTable({ $('#scroll-horizontal-datatable_wrapper').DataTable({
"order": [ "order": [ [0, "desc"] ], // 4 is the column index of "created_on" in your table
[0, "desc"] "columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options
}); });
}); });
</script> </script>

View File

@ -96,7 +96,7 @@
<th>Customer Name</th> <th>Customer Name</th>
<th>Status</th> <th>Status</th>
<th>Total</th> <th>Total</th>
<th align="center">Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -187,10 +187,10 @@
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_wrapper').DataTable({ $('#scroll-horizontal-datatable_wrapper').DataTable({
"order": [ "order": [ [0, "desc"] ],
[0, "desc"] "columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options // Other DataTables configuration options
}); });
}); });

View File

@ -1,4 +1,3 @@
<!-- start page title --> <!-- start page title -->
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
@ -11,7 +10,7 @@
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
<div class="col-md-7"> <div class="col-md-7">
<input class="form-control input-daterange-datepicker" type="text" name="date" value="<?php echo $selected_data; ?>"/> <input class="form-control input-daterange-datepicker" type="text" name="date" value="<?php echo $selected_data; ?>" />
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<button type="submit" class="btn btn-primary">Generate Report</button> <button type="submit" class="btn btn-primary">Generate Report</button>
@ -23,26 +22,24 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
<table id="datatable-buttons" class="table table-striped nowrap w-100"> <table id="datatable-buttons" class="table table-striped nowrap w-100">
<thead> <thead>
<tr> <tr>
<th hidden>id</th> <th hidden>id</th>
<th>Member Name</th> <th>Member Name</th>
<th>Mobile Number</th> <th>Mobile Number</th>
<th>Email</th> <th>Email</th>
<th>Scheme Code</th> <th>Scheme Code</th>
<th>From Subscription</th> <th>From Subscription</th>
<th>To Subscription</th> <th>To Subscription</th>
</tr> </tr>
</thead> </thead>
<tbody>
<?php foreach ($expired_customers as $row) { ?>
<tbody>
<?php foreach ($expired_customers as $row) { ?>
<tr> <tr>
<td hidden><?php echo $row["sub_id"]; ?></td> <td hidden><?php echo $row["sub_id"]; ?></td>
<td><?= $row['first_name'] . ' ' . $row['last_name'] ?></td> <td><?= $row['first_name'] . ' ' . $row['last_name'] ?></td>
@ -54,24 +51,25 @@
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> <!-- end card body--> </div> <!-- end card body-->
</div> <!-- end card --> </div> <!-- end card -->
</div><!-- end col--> </div><!-- end col-->
</div> </div>
<!-- end row--> <!-- end row-->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var table = $('#datatable-buttons').DataTable({ var table = $('#datatable-buttons').DataTable({
"order": [[0, 'desc']], "order": [
[0, 'desc']
],
"dom": 'Bfrtip', "dom": 'Bfrtip',
buttons: [ buttons: [{
{
extend: 'print', extend: 'print',
title: 'Expired Invoice Report', title: 'Expired Invoice Report',
text: 'Print', text: 'Print',
@ -89,34 +87,37 @@ $(document).ready(function() {
} }
} }
], ],
columnDefs: [ columnDefs: [{
{ type: 'date', targets: [1,2,3,4,5,6], orderable: false } type: 'date',
targets: [1, 2, 3, 4, 5, 6],
orderable: false
}
// Specify the column index for date sorting and disable sorting // Specify the column index for date sorting and disable sorting
] ]
}); });
// Add date range filter and dropdowns // Add date range filter and dropdowns
$('#datatable-buttons thead tr').clone(true).appendTo('#datatable-buttons thead'); $('#datatable-buttons thead tr').clone(true).appendTo('#datatable-buttons thead');
$('#datatable-buttons thead tr:eq(1) th').each(function (i) { $('#datatable-buttons thead tr:eq(1) th').each(function(i) {
var title = $(this).text(); var title = $(this).text();
// For non-"Invoice Date" columns, add a dropdown // For non-"Invoice Date" columns, add a dropdown
var uniqueValues = table.column(i).data().unique().sort(); var uniqueValues = table.column(i).data().unique().sort();
var select = $('<select class="form-control form-control-sm"><option value="">Search ' + title + '</option></select>') var select = $('<select class="form-control form-control-sm"><option value="">Search ' + title + '</option></select>')
.appendTo($(this).empty()) .appendTo($(this).empty())
.on('change', function () { .on('change', function() {
var val = $.fn.dataTable.util.escapeRegex($(this).val()); var val = $.fn.dataTable.util.escapeRegex($(this).val());
table.column(i) table.column(i)
.search(val ? '^' + val + '$' : '', true, false) .search(val ? '^' + val + '$' : '', true, false)
.draw(); .draw();
}); });
uniqueValues.each(function (d, j) { uniqueValues.each(function(d, j) {
select.append('<option value="' + d + '">' + d + '</option>'); select.append('<option value="' + d + '">' + d + '</option>');
}); });
$('input', this).on('keyup change', function () { $('input', this).on('keyup change', function() {
if (table.column(i).search() !== this.value) { if (table.column(i).search() !== this.value) {
table table
.column(i) .column(i)
@ -124,18 +125,18 @@ $('#datatable-buttons thead tr:eq(1) th').each(function (i) {
.draw(); .draw();
} }
}); });
}); });
// Add date range filter for "Invoice Date" column // Add date range filter for "Invoice Date" column
moment.updateLocale('en', { moment.updateLocale('en', {
longDateFormat: { longDateFormat: {
L: 'DD/MM/YYYY', L: 'DD/MM/YYYY',
// LTS: 'h:mm:ss A', // LTS: 'h:mm:ss A',
// LTS: 'h:mm A', // LTS: 'h:mm A',
} }
}); });
$(document).ready(function () { $(document).ready(function() {
var $select_data = '<?php echo $selected_data; ?>'; var $select_data = '<?php echo $selected_data; ?>';
var dateRangeFilter = $('input.input-daterange-datepicker') var dateRangeFilter = $('input.input-daterange-datepicker')
@ -152,17 +153,17 @@ $(document).ready(function () {
'This Month': [moment().startOf('month'), moment().endOf('month')] 'This Month': [moment().startOf('month'), moment().endOf('month')]
} }
}) })
.on('apply.daterangepicker', function (ev, picker) { .on('apply.daterangepicker', function(ev, picker) {
var formattedStartDate = picker.startDate.format('DD/MM/YYYY'); var formattedStartDate = picker.startDate.format('DD/MM/YYYY');
var formattedEndDate = picker.endDate.format('DD/MM/YYYY'); var formattedEndDate = picker.endDate.format('DD/MM/YYYY');
var selectedDateRange = formattedStartDate + ' - ' + formattedEndDate; var selectedDateRange = formattedStartDate + ' - ' + formattedEndDate;
$(this).val(selectedDateRange); $(this).val(selectedDateRange);
}) })
.on('cancel.daterangepicker', function () { .on('cancel.daterangepicker', function() {
$(this).val(''); $(this).val('');
}); });
$('.today-btn').on('click', function () { $('.today-btn').on('click', function() {
var today = moment(); var today = moment();
dateRangeFilter.data('daterangepicker').setStartDate(today); dateRangeFilter.data('daterangepicker').setStartDate(today);
dateRangeFilter.data('daterangepicker').setEndDate(today); dateRangeFilter.data('daterangepicker').setEndDate(today);
@ -174,10 +175,6 @@ $(document).ready(function () {
if ($select_data === '') { if ($select_data === '') {
$('.today-btn').trigger('click'); $('.today-btn').trigger('click');
} }
});
}); });
});
</script> </script>

View File

@ -65,7 +65,7 @@
<td><?php echo $row->invoice_number; ?></td> <td><?php echo $row->invoice_number; ?></td>
<td><?php echo $row->formatted_invoice_date; ?></td> <td><?php echo $row->formatted_invoice_date; ?></td>
<td><?php echo $row->first_name . " " . $row->last_name; ?></td> <td><?php echo $row->first_name . " " . $row->last_name; ?></td>
<td><?php echo $row->tax . '%'; ?></td> <td><?php echo $row->tax ? $row->tax . '%' : '0%'; ?></td>
<td><?php echo '₹' . number_format($row->discount, 2, '.', ','); ?></td> <td><?php echo '₹' . number_format($row->discount, 2, '.', ','); ?></td>
<td><?php echo $row->item_count; ?></td> <td><?php echo $row->item_count; ?></td>
<td><?php echo '₹' . number_format($row->shipping_charge, 2, '.', ','); ?></td> <td><?php echo '₹' . number_format($row->shipping_charge, 2, '.', ','); ?></td>

View File

@ -35,7 +35,7 @@
<th>Price</th> <th>Price</th>
<th>Duration</th> <th>Duration</th>
<th hidden>Category</th> <th hidden>Category</th>
<th>Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<?php foreach ($scheme as $row) : ?> <?php foreach ($scheme as $row) : ?>
@ -61,11 +61,10 @@
</div><!-- end row--> </div><!-- end row-->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_scheme').DataTable({ $('#scroll-horizontal-datatable_scheme').DataTable({
"order": [ "order": [ [0, "desc"] ],
[0, "desc"] "columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options
}); });
}); });
</script> </script>

View File

@ -41,15 +41,12 @@
<th>Invoice Date</th> <th>Invoice Date</th>
<th>Total</th> <th>Total</th>
<th>Status</th> <th>Status</th>
<th align="center">Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
// print_r($invoice);
foreach ($invoice as $row) : foreach ($invoice as $row) :
$invoice_date = date('d/m/Y', strtotime($row['invoice_date'])); $invoice_date = date('d/m/Y', strtotime($row['invoice_date']));
$from_date = date('d/m/Y', strtotime($row['from_subscription'])); $from_date = date('d/m/Y', strtotime($row['from_subscription']));
@ -78,20 +75,16 @@
} }
?> ?>
<tr> <tr>
<td hidden><?= $row['invoice_id'] ?></td> <td hidden><?= $row['invoice_date'] ?></td>
<td><?= $row['customer_name']; ?></td> <td data-order="<?= $row['customer_name']; ?>"><?= $row['customer_name']; ?></td>
<td><?= $from_date; ?></td> <td data-order="<?= strtotime($row['from_subscription']); ?>"><?= $from_date; ?></td>
<td><?= $to_date; ?></td> <td data-order="<?= strtotime($row['to_subscription']); ?>"><?= $to_date; ?></td>
<td><?= $row['scheme_code']; ?></td> <td data-order="<?= $row['scheme_code']; ?>"><?= $row['scheme_code']; ?></td>
<td><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td> <td data-order="<?= $message; ?>"><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td>
<td><?= $row['invoice_number']; ?></td> <td data-order="<?= $row['invoice_number']; ?>"><?= $row['invoice_number']; ?></td>
<td><?= $invoice_date; ?></td> <td data-order="<?= strtotime($row['invoice_date']); ?>"><?= $invoice_date; ?></td>
<td><?= "" . $row['total_amount']; ?></td> <td data-order="<?= $row['total_amount']; ?>"><?= "" . $row['total_amount']; ?></td>
<td><?= $row['status']; ?></td> <td data-order="<?= $row['status']; ?>"><?= $row['status']; ?></td>
<td> <td>
<a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp; <a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>&nbsp; <a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>&nbsp;
@ -101,7 +94,7 @@
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div>
<!-- Scheme List Modal --> <!-- Scheme List Modal -->
<!-- Create a modal for scheme selection --> <!-- Create a modal for scheme selection -->
<div class="modal fade" id="printAddressesModal" tabindex="-1" role="dialog" aria-labelledby="printAddressesModalLabel" aria-hidden="true"> <div class="modal fade" id="printAddressesModal" tabindex="-1" role="dialog" aria-labelledby="printAddressesModalLabel" aria-hidden="true">
@ -178,18 +171,17 @@
</div><!-- end col--> </div><!-- end col-->
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_subcription').DataTable({ $('#scroll-horizontal-datatable_subcription').DataTable({
"order": [ "order": [ [0, "desc"] ],
[0, "desc"] "columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
] // 0 is the column index
}); });
}); });
</script> </script>

View File

@ -310,10 +310,7 @@
<div class="row"> <div class="row">
<div class="col-md-5"> <div class="col-md-5">
<img src="<?= $favicon; ?>" alt="company fav icon for footer" width="25" height="25"> <img src="<?= $favicon; ?>" alt="company fav icon for footer" width="25" height="25">
<!-- <script>document.write(new Date().getFullYear())</script> &copy; <?= $company_name; ?> --> 2023 - <script> document.write(new Date().getFullYear()) </script> &copy; <?= "<a href=".$footer_about." target='_blank' >".$company_name."</a>"; ?>
<script>
document.write(new Date().getFullYear())
</script> &copy; <?= "<a href=".$footer_about." target='_blank' >".$company_name."</a>"; ?>
<!-- <p> <?= date('Y') ?> &copy; <?= $company_name; ?>.</p> <!-- <p> <?= date('Y') ?> &copy; <?= $company_name; ?>.</p>
<p> <?= date('Y') ?> &copy; <?= $company_name; ?>. Page rendered in {elapsed_time} seconds</p> --> <p> <?= date('Y') ?> &copy; <?= $company_name; ?>. Page rendered in {elapsed_time} seconds</p> -->

View File

@ -133,20 +133,13 @@
</li> </li>
<?php endif; ?> <?php endif; ?>
<?php if ($loggedin_person_role !== 'sadmin') : ?> <?php if ($loggedin_person_role !== 'sadmin') : ?>
<!-- <li>
<a href="<?= base_url()."invoice_list"; ?>">
<i class="fe-file-text"></i>
<span> Sales </span>
</a>
</li> -->
<li> <li>
<a href="#reportLayouts" data-toggle="collapse"> <a href="#salesLayouts" data-toggle="collapse">
<i class="ri-file-chart-fill"></i> <i class="ri-file-chart-fill"></i>
<span> Sales </span> <span> Sales </span>
<span class="menu-arrow"></span> <span class="menu-arrow"></span>
</a> </a>
<div class="collapse" id="reportLayouts"> <div class="collapse" id="salesLayouts">
<ul class="nav-second-level"> <ul class="nav-second-level">
<li> <li>
<a href="<?= base_url()."invoice_list"; ?>">Online Sales</a> <a href="<?= base_url()."invoice_list"; ?>">Online Sales</a>

View File

@ -35,7 +35,7 @@
<th>Created at</th> <th>Created at</th>
<th>Created by</th> <th>Created by</th>
<th>Status</th> <th>Status</th>
<th>Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
<?php foreach ($template as $temp) : <?php foreach ($template as $temp) :
@ -48,11 +48,11 @@
} ?> } ?>
<tr> <tr>
<td hidden><?= $temp['template_id']; ?></td> <td hidden><?= $temp['template_id']; ?></td>
<td><?= $temp['template_name']; ?></td> <td data-order="<?= $temp['template_name']; ?>"><?= $temp['template_name']; ?></td>
<td><?= $temp['mode']; ?></td> <td data-order="<?= $temp['mode']; ?>"><?= $temp['mode']; ?></td>
<td><?= $temp['formatted_created_on']; ?></td> <td data-order="<?= $temp['formatted_created_on']; ?>"><?= $temp['formatted_created_on']; ?></td>
<td><?= $temp['created_by_name']; ?></td> <td data-order="<?= $temp['created_by_name']; ?>"><?= $temp['created_by_name']; ?></td>
<td><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td> <td data-order="<?= $message; ?>"><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td>
<td> <td>
<a href="<?= base_url()."template_creation_form/".$temp['template_id']; ?>" class="edit-button" title="Click to Edit Template" ><i class="ri-pencil-line"></i></a> <a href="<?= base_url()."template_creation_form/".$temp['template_id']; ?>" class="edit-button" title="Click to Edit Template" ><i class="ri-pencil-line"></i></a>
<?php if ($temp['isactive']) { ?> <a href="<?php echo "template_creation_delete/".$temp['template_id']; ?>" class="delete-button" title="Click to Delete Template" ><i class="ri-delete-bin-line"></i></a> <?php } ?> <?php if ($temp['isactive']) { ?> <a href="<?php echo "template_creation_delete/".$temp['template_id']; ?>" class="delete-button" title="Click to Delete Template" ><i class="ri-delete-bin-line"></i></a> <?php } ?>
@ -69,11 +69,10 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_customer').DataTable({ $('#scroll-horizontal-datatable_customer').DataTable({
"order": [ "order": [ [0, "desc"] ],
[0, "desc"] "columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options
}); });
}); });
</script> </script>

View File

@ -38,7 +38,7 @@
<th>Role</th> <th>Role</th>
<?php if($session_role === 'sadmin'){ ?> <th>Company</th> <?php } ?> <?php if($session_role === 'sadmin'){ ?> <th>Company</th> <?php } ?>
<th>Status</th> <th>Status</th>
<th>Action</th> <th align="center" id="action-column">Action</th>
</tr> </tr>
</thead> </thead>
@ -63,11 +63,11 @@
?> ?>
<tr> <tr>
<td hidden><?= $row['user_id'] ?></td> <td hidden><?= $row['user_id'] ?></td>
<td><?php echo $row['first_name'].' '.$row['last_name'] ; ?></td> <td data-order="<?= $row['first_name']; ?>" ><?php echo $row['first_name'].' '.$row['last_name'] ; ?></td>
<td><?php echo $row['email'] ; ?></td> <td data-order="<?= $row['email'] ; ?>"><?php echo $row['email'] ; ?></td>
<td><?php echo $row['mobile_no'] ; ?></td> <td data-order="<?= $row['mobile_no']; ?>"><?php echo $row['mobile_no'] ; ?></td>
<td><?php echo $row['role'] ; ?></td> <td data-order="<?= $row['role']; ?>"><?php echo $row['role'] ; ?></td>
<?php if($session_role === 'sadmin'){ ?> <td><?php echo $row['company_name'] ; ?></td> <?php } ?> <?php if($session_role === 'sadmin'){ ?> <td data-order="<?= $row['company_name']; ?>"><?php echo $row['company_name'] ; ?></td> <?php } ?>
<td> <td>
<span class="<?php echo $class; ?>"><?php echo $message; ?></span> <span class="<?php echo $class; ?>"><?php echo $message; ?></span>
</td> </td>
@ -89,8 +89,10 @@
<!-- end row--> <!-- end row-->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_user').DataTable({ $('#scroll-horizontal-datatable_user').DataTable({
"order": [[0, "desc"]] // 4 is the column index of "created_on" in your table "order": [[0, "desc"]],
"columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
// Other DataTables configuration options // Other DataTables configuration options
}); });
}); });