bug fixes : ps
This commit is contained in:
parent
d43e57ddda
commit
3358121e4e
@ -127,10 +127,10 @@ class Books extends BaseController
|
||||
// print_r($bookId); print_r($imageData); print_r($category_id);die;
|
||||
|
||||
if ($BooksModel->insert($data)) {
|
||||
session()->setFlashdata('success', 'Book has been added successfully.');
|
||||
session()->setFlashdata('success', 'product successfully created.');
|
||||
$this->logger->info("Books: has been added successfully. Inserted ID = " . $BooksModel->insertID());
|
||||
} else {
|
||||
session()->setFlashdata('error', 'Book could not be added. Please try again..');
|
||||
session()->setFlashdata('error', 'product could not be created. Please try again..');
|
||||
$this->logger->error("Books: Err could not be added. Please try again.");
|
||||
}
|
||||
} else {
|
||||
@ -151,10 +151,10 @@ class Books extends BaseController
|
||||
$BooksModel->db->table('book_categories')->insert(['book_id' => $book_id, 'category_id' => $category_id]);
|
||||
}
|
||||
if ($BooksModel->update($book_id, $data)) {
|
||||
session()->setFlashdata('success', 'Book has been updated successfully.');
|
||||
session()->setFlashdata('success', 'product successfully updated.');
|
||||
$this->logger->info("Books: has been updated successfully. Updated Book ID = " . $book_id);
|
||||
} else {
|
||||
session()->setFlashdata('error', 'Book update failed. Please try again.');
|
||||
session()->setFlashdata('error', 'product updation failed. Please try again.');
|
||||
$this->logger->error("Books: Err Failed to update ID =" . $book_id);
|
||||
}
|
||||
}
|
||||
@ -205,7 +205,7 @@ class Books extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
session()->setFlashdata('success', 'Deleted successfully.');
|
||||
session()->setFlashdata('success', 'product successfully deleted.');
|
||||
$this->logger->info("BOOK: has been Inactived successfully. Inactived ID = " . $id);
|
||||
} else {
|
||||
$this->logger->error("BOOK: Not able to Inactive ID =" . $id);
|
||||
|
||||
@ -109,7 +109,7 @@ class Customer extends BaseController
|
||||
$data['isactive'] = 1;
|
||||
$data['created_by'] = $session_uid;
|
||||
if ($model->insert($data)) {
|
||||
session()->setFlashdata('success', 'Customer has been added successfully.');
|
||||
session()->setFlashdata('success', 'Customer successfully created.');
|
||||
$this->logger->info("Customer : has been added successfully. Inserted ID = " . $model->insertID());
|
||||
$customer_id_for_addresses = $model->insertID();// for Customer ADDRESS Table
|
||||
} else {
|
||||
@ -126,10 +126,10 @@ class Customer extends BaseController
|
||||
$data['updated_by'] = $session_uid;
|
||||
$customer_id_for_addresses = $customer_id; // for Customer ADDRESS Table
|
||||
if ($model->update($customer_id, $data)) {
|
||||
session()->setFlashdata('success', 'Customer has been updated successfully.');
|
||||
session()->setFlashdata('success', 'Customer successfully updated');
|
||||
$this->logger->info("Customer: has been updated successfully. Updated Customer ID = " . $customer_id_for_addresses);
|
||||
} else {
|
||||
session()->setFlashdata('error', 'Customer update failed. Please try again.');
|
||||
session()->setFlashdata('error', 'Customer updation failed. Please try again.');
|
||||
$this->logger->error("Customer: Err Failed to update ID =" . $customer_id_for_addresses);
|
||||
}
|
||||
}
|
||||
@ -248,7 +248,7 @@ class Customer extends BaseController
|
||||
}
|
||||
$CustomerModel->inactiveMissingAddressDetails($where, $shipAddressIds);
|
||||
}
|
||||
session()->setFlashdata('success', 'Deleted successfully.');
|
||||
session()->setFlashdata('success', 'Customer successfully deleted.');
|
||||
$this->logger->info("Customer: has been Inactived successfully. Inactived ID = " . $id);
|
||||
} else {
|
||||
$this->logger->error("Customer: Not able to Inactive ID =" . $id);
|
||||
|
||||
@ -70,7 +70,7 @@ class HomeModel extends Model
|
||||
->where('S.to_subscription >=', $now)
|
||||
->where('S.to_subscription <=', $last30days)
|
||||
// ->where('BC.category_id', 5)
|
||||
->where('LOWER(BC.category_name)', strtolower('Membership'), FALSE)
|
||||
->where('LOWER(CM.name)', strtolower("Membership"))
|
||||
->groupBy('S.sub_id')
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
@ -117,28 +117,6 @@ public function updateData($table, $data, $where)
|
||||
return $query->get()->getResult();
|
||||
}
|
||||
|
||||
public function generate_invoice_pdf($id)
|
||||
{
|
||||
// Load the mPDF library
|
||||
$mpdf = new \Mpdf\Mpdf();
|
||||
|
||||
// Fetch invoice data
|
||||
$invoice = $this->find($id);
|
||||
|
||||
if ($invoice) {
|
||||
// Create the HTML content for the PDF
|
||||
|
||||
// Load HTML content into mPDF
|
||||
$mpdf->WriteHTML($html);
|
||||
|
||||
// Set PDF filename
|
||||
$pdfFileName = 'invoice_' . $invoice->invoice_number . '.pdf';
|
||||
|
||||
// Output the PDF for download
|
||||
$mpdf->Output($pdfFileName, 'D');
|
||||
}
|
||||
}
|
||||
|
||||
public function getInvoiceData($id)
|
||||
{
|
||||
// Fetch invoice data
|
||||
@ -172,21 +150,20 @@ public function updateData($table, $data, $where)
|
||||
}
|
||||
|
||||
|
||||
public function getMembershipListForCustomer($category,$id)
|
||||
public function getMembershipListForCustomer($category, $id)
|
||||
{
|
||||
$data = $this->db->table('subscription as S')
|
||||
->join('customers as C','C.customer_id = S.customer_id','left')
|
||||
->join('customers as C', 'C.customer_id = S.customer_id', 'left')
|
||||
->join('category as CM', 'CM.id = S.scheme_id', 'left')
|
||||
->join('book_categories as BC', 'BC.category_id = S.scheme_id', 'left')
|
||||
->join('books as BK', 'BC.book_id = BK.book_id', 'left')
|
||||
->select('S.customer_id,concat(C.first_name, " ", C.last_name) as customer_name,S.sub_id,S.scheme_id,DATE_FORMAT(S.from_subscription, "%d/%m/%Y") AS formatted_from_subscription,DATE_FORMAT(S.to_subscription, "%d/%m/%Y") AS formatted_to_subscription,S.from_subscription,S.to_subscription,S.created_on,CM.name,BK.title,BK.book_id')
|
||||
->where('LOWER(CM.name)', strtolower("'".$category."'"), FALSE)
|
||||
->select('S.customer_id, CONCAT(C.first_name, " ", C.last_name) as customer_name, S.sub_id, S.scheme_id, DATE_FORMAT(S.from_subscription, "%d/%m/%Y") AS formatted_from_subscription, DATE_FORMAT(S.to_subscription, "%d/%m/%Y") AS formatted_to_subscription, S.from_subscription, S.to_subscription, S.created_on, CM.name, BK.title, BK.book_id')
|
||||
->where('CM.name', strtolower($category))
|
||||
->where('S.customer_id', $id)
|
||||
->groupBy('S.sub_id')
|
||||
->orderBy('S.created_on','ASC')
|
||||
->orderBy('S.created_on', 'ASC')
|
||||
->get()
|
||||
->getResultArray();
|
||||
// print_r($this->db->getLastQuery());die;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" id="submitBtn" type="submit">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
@ -211,6 +211,21 @@ document.addEventListener("DOMContentLoaded", function() {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -32,7 +32,7 @@
|
||||
<h4 class="header-title"><?= $page_name; ?></h4>
|
||||
<p class="sub-header"> </p>
|
||||
|
||||
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_business"; ?>" >
|
||||
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_business"; ?>" id="myForm">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
@ -112,7 +112,7 @@
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit" id="submitBtn">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
@ -125,4 +125,19 @@
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
</div><!-- end row -->
|
||||
</div><!-- end row -->
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title"><?= $page_name; ?></h4>
|
||||
<form class="parsley-examples" action="<?= base_url() . "campaign_creation_insert"; ?>" method="post" enctype="multipart/form-data">
|
||||
<form class="parsley-examples" action="<?= base_url() . "campaign_creation_insert"; ?>" method="post" enctype="multipart/form-data" id="myForm">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
@ -78,7 +78,7 @@
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit" id="submitBtn">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
@ -136,4 +136,19 @@
|
||||
}));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -24,7 +24,8 @@
|
||||
<!-- Customer Details Tab -->
|
||||
<div class="tab-pane fade show active" id="customerDetails" role="tabpanel" aria-labelledby="customerDetails-tab">
|
||||
<!-- Customer details form fields -->
|
||||
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_customer"; ?>" >
|
||||
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_customer"; ?>" id="myForm" name="myForm" >
|
||||
<!-- <img src="<?= base_url()."public/assets/images/plugins/loading.gif" ?>" alt="loader1" style="display:none; height:30px; width:auto;" id="loaderImg"> -->
|
||||
<div class="form-group">
|
||||
|
||||
</div>
|
||||
@ -52,7 +53,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text">+91</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="cmobile" value="<?= isset($customer['mobile_no']) ? $customer['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required pattern="\d*" maxlength="10" />
|
||||
<input type="text" class="form-control" name="cmobile" value="<?= isset($customer['mobile_no']) ? $customer['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required maxlength="10" onkeypress="return restriction(event)" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
</div>
|
||||
@ -249,7 +250,8 @@
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">Submit</button>
|
||||
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" id="submitBtn" type="submit">Submit</button>
|
||||
<!-- <button type="reset" class="btn btn-primary waves-effect mr-1">Reset</button> -->
|
||||
<button type="button" class="btn btn-primary waves-effect mr-1" onclick="refreshPage()">Reset</button>
|
||||
<a href="<?= base_url() . "customer_list"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
|
||||
@ -262,8 +264,11 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <div class="loader" style="display: none;">
|
||||
<img src="<?= base_url()."public/assets/images/plugins/loading.gif" ?>" alt="Loading...">
|
||||
</div> -->
|
||||
</form>
|
||||
|
||||
</div> <!-- end card-body-->
|
||||
|
||||
<div class="tab-pane fade show " id="subscriptionDetails" role="tabpanel" aria-labelledby="subscriptionDetails-tab">
|
||||
@ -508,16 +513,19 @@
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Show the Customer Details tab by default
|
||||
$('#customerDetails-tab').tab('show');
|
||||
|
||||
// Handle tab switching
|
||||
$('#customerTabs a').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
});
|
||||
});
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function validateEmail(email) {
|
||||
@ -537,4 +545,15 @@ function validateEmail(email) {
|
||||
validationMessage.style.color = "red";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function restriction(event) {
|
||||
var charCode = event.which || event.keyCode;
|
||||
if((charCode >= 48 && charCode <= 57)){
|
||||
return true;
|
||||
}else {
|
||||
event.preventDefault(); // Prevent the character from being entered
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -149,7 +149,7 @@
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="save" class="btn btn-success waves-effect waves-light mr-1" type="submit"> Submit </button>
|
||||
<button id="save" class="btn btn-success waves-effect waves-light mr-1" type="submit" id="submitBtn"> Submit </button>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
|
||||
</div>
|
||||
@ -569,6 +569,21 @@ function restriction(event,temporary_flag) {
|
||||
// var selectedOperator = selectElement.value;
|
||||
// }
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -4,13 +4,13 @@
|
||||
<div class="card-body">
|
||||
<h4 class="header-title"><?= $page_name; ?></h4>
|
||||
<p class="sub-header"> </p>
|
||||
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_event"; ?>" >
|
||||
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_event"; ?>" id="myForm">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="ename" class="col-form-label">Events Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="ename" value="<?= isset($event['event_name']) ? $event['event_name'] : '' ?>" placeholder="Event Name" required />
|
||||
<input type="text" class="form-control" name="ename" value="<?= isset($event['event_name']) ? $event['event_name'] : '' ?>" placeholder="Event Name" required />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
@ -29,17 +29,17 @@
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="leftpad" class="col-form-label">Left Pad<span class="text-danger">*</span></label>
|
||||
<input type="number" class="form-control" name="leftpad" placeholder="000" value="<?= isset($event['left_pad']) ? $event['left_pad'] : '' ?>"required >
|
||||
<input type="number" class="form-control" name="leftpad" placeholder="000" value="<?= isset($event['left_pad']) ? $event['left_pad'] : '' ?>" required>
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="id" name="id" placeholder="hidden for scheme id" value="<?= isset($event['id']) ? $event['id'] : '' ?>" />
|
||||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" />
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit" id="submitBtn">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
@ -52,6 +52,19 @@
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div><!-- end row -->
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -4,7 +4,7 @@
|
||||
<div class="card-body">
|
||||
<h4 class="header-title"><?= $page_name; ?></h4>
|
||||
<br>
|
||||
<form method="POST" enctype="multipart/form-data" action="<?= base_url() . "save_invoice"; ?>">
|
||||
<form method="POST" enctype="multipart/form-data" action="<?= base_url() . "save_invoice"; ?>" id="myForm">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
@ -17,6 +17,7 @@
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="invalid-feedback"> Please select customer. </div>
|
||||
<div class="subscribedetails" style="display: none"><div id="schemeName"></div></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
@ -27,70 +28,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php if ($invoice_type === '2') : ?>
|
||||
<div id="subscribedetails" style="display: none">
|
||||
<br/>
|
||||
<div class="form-row">
|
||||
<div class="col-12 border-bottom bg-transparent">
|
||||
<h5 class="header-title mb-2">First Subscription Details</h5>
|
||||
</div>
|
||||
<!-- <div class="col-lg-3 col-sm-6">
|
||||
|
||||
<div class="media mt-2 mb-2">
|
||||
<div class="mr-2 align-self-center">
|
||||
<i class="ri-hashtag h2 m-0 text-muted"></i>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<p class="mb-1">ID No.</p>
|
||||
<h5 class="mt-0">
|
||||
#MN2048
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-lg-6 col-sm-12">
|
||||
|
||||
<div class="media mt-2 mb-2">
|
||||
<div class="mr-2 align-self-center">
|
||||
<i class="ri-shield-star-line h2 m-0 text-muted"></i>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<p class="mb-1">Scheme Name</p>
|
||||
<h5 class="mt-0" id="schemeName"></h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-sm-6">
|
||||
|
||||
<div class="media mt-2 mb-2">
|
||||
<div class="mr-2 align-self-center">
|
||||
<i class="ri-calendar-event-line h2 m-0 text-muted"></i>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<p class="mb-1">From Date</p>
|
||||
<h5 class="mt-0" id="fromDate"> </h5>
|
||||
<!-- <h5 class="mt-0">
|
||||
Apr 16 2020 <small class="text-muted">10:29 PM</small>
|
||||
</h5> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-sm-6">
|
||||
|
||||
<div class="media mt-2 mb-2">
|
||||
<div class="mr-2 align-self-center">
|
||||
<i class="ri-calendar-event-line h2 m-0 text-muted"></i>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<p class="mb-1">To Date</p>
|
||||
<h5 class="mt-0" id="toDate"> </h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="storeBillingAddress"> Billing Address  ( <input type="checkbox" id="editAddressesCheckbox" /> Do you want to edit/change addresses?)</label>
|
||||
@ -332,7 +270,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="status" name="status" value="<?= isset($invoice_details['status']) ? $invoice_details['status'] : '' ?>">
|
||||
<input type="hidden" id="status" name="status" value="<?= isset($invoice_details['status']) ? $invoice_details['status'] : 'Draft' ?>">
|
||||
<input type="hidden" id="hiddenInvoiceId" name="invoice_id" placeholder="hidden for invoice id" value="<?= isset($invoice_details['invoice_id']) ? $invoice_details['invoice_id'] : '' ?>" />
|
||||
<div class="form-group text-right m-b-0">
|
||||
<?php if (!isset($invoice_details['status']) || $invoice_details['status'] !== 'Approved') : ?>
|
||||
@ -344,7 +282,6 @@
|
||||
<button type="button" class="btn btn-primary waves-effect mr-1" name="saveas" value="Approved" id="saveApprovedButton">Save as Approved</button>
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="invoice_type" value="<?php echo ($page_name === 'Add Subscription Invoice Details' || $page_name === 'Edit Subscription Invoice Details') ? '1' : '2'; ?>">
|
||||
<input type="hidden" id="status" name="status" value="<?= isset($invoice_details['status']) ? $invoice_details['status'] : '' ?>">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -716,23 +653,14 @@
|
||||
});
|
||||
}
|
||||
if (cm.length > 0) {
|
||||
$("#subscribedetails").show();
|
||||
$("#schemeName").text(cm[0].title);
|
||||
$("#fromDate").text(cm[0].formatted_from_subscription);
|
||||
$("#toDate").text(cm[0].formatted_to_subscription);
|
||||
// $.each(cm, function(k, v) {});
|
||||
// "formatted_from_subscription": "12/10/2023",
|
||||
// "formatted_to_subscription": "12/11/2023",
|
||||
// "from_subscription": "2023-10-12",
|
||||
// "to_subscription": "2023-11-12",
|
||||
// "title": "First Std Tamil Book",
|
||||
}else{
|
||||
$("#subscribedetails").hide();
|
||||
$("#schemeName").text('');
|
||||
$("#fromDate").text('');
|
||||
$("#toDate").text('');
|
||||
$(".subscribedetails").show(); // Change this line to use the class selector
|
||||
$("#schemeName").text(cm[0].title + " ( From: " + cm[0].formatted_from_subscription + " To: " + cm[0].formatted_to_subscription+" )");
|
||||
} else {
|
||||
$(".subscribedetails").show(); // Change this line to use the class selector
|
||||
$("#schemeName").text("No Earlier Membership found");
|
||||
}
|
||||
|
||||
|
||||
// var address_compare = bill_addr == customer_billing ? customer_billing : bill_addr
|
||||
//
|
||||
if ((bill_addr != "") && (bill_addr != customer_billing)) {
|
||||
@ -886,4 +814,19 @@
|
||||
// Replicate the balance amount value to the paid amount
|
||||
document.getElementById('paidAmount').value = balanceAmount;
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
var status = document.getElementById('status').value;
|
||||
if (form.checkValidity() === false) {
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
if (status == "Draft" ){$('#saveDraftButton').prop('disabled', false);}
|
||||
if (status == "Approved" ){$('#saveapproved').prop('disabled', false);}
|
||||
} else {
|
||||
if (status == "Draft" ){$('#saveDraftButton').prop('disabled', true);}
|
||||
if (status == "Approved" ){$('#saveapproved').prop('disabled', true);}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
</span>
|
||||
</div> -->
|
||||
<div id="mailFormDiv">
|
||||
<form role="form" class="parsley-examples" method="POST" enctype="multipart/form-data" action="<?= base_url() . "mail_custom_notifications"; ?>">
|
||||
<form role="form" class="parsley-examples" method="POST" enctype="multipart/form-data" action="<?= base_url() . "mail_custom_notifications"; ?>" id="myForm2">
|
||||
<div class="form-group row">
|
||||
<label for="recipient" class="col-4 col-form-label">Recipient Email</label>
|
||||
<div class="col-7">
|
||||
@ -266,4 +266,19 @@
|
||||
document.getElementById("group_id").value = "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -4,7 +4,7 @@
|
||||
<div class="card-body">
|
||||
<h4 class="header-title"><?= $page_name; ?></h4>
|
||||
<p class="sub-header"> </p>
|
||||
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_scheme"; ?>">
|
||||
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_scheme"; ?>" id="myForm">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
@ -54,7 +54,7 @@
|
||||
<input type="hidden" id="isactive" name="isactive" placeholder="hidden for isactive" value="<?= isset($scheme['isactive']) ? $scheme['isactive'] : '' ?>" />
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit" id="submitBtn">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
@ -70,4 +70,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end row -->
|
||||
<!-- end row -->
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -237,7 +237,7 @@
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit" id="submitBtn">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
@ -251,4 +251,19 @@
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
<!-- end row -->
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -5,7 +5,7 @@
|
||||
<!-- < -->
|
||||
<p class="sub-header"> </p>
|
||||
<form class="needs-validation" method="POST" enctype="multipart/form-data"
|
||||
action="<?= base_url() . "add_subscription";?>" >
|
||||
action="<?= base_url() . "add_subscription";?>" id="myForm">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
@ -80,7 +80,7 @@
|
||||
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit" id="submitBtn">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
@ -146,4 +146,19 @@ invoiceDateInput.setAttribute("min", minDate);
|
||||
|
||||
// Optional: Set the default value to today's date
|
||||
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
|
||||
if (form.checkValidity() === false) {
|
||||
console.log('clicked but false valid');
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title"><?= $page_name; ?></h4>
|
||||
<form class="parsley-examples" action="<?= base_url() . "template_creation_insert"; ?>" method="post" enctype="multipart/form-data">
|
||||
<form class="parsley-examples" action="<?= base_url() . "template_creation_insert"; ?>" method="post" enctype="multipart/form-data" id="myForm">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
@ -49,7 +49,7 @@
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit" id="submitBtn">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
@ -91,4 +91,16 @@
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
if (form.checkValidity() === false) {
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -130,7 +130,7 @@
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit" id="submitBtn">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
@ -187,3 +187,15 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
if (form.checkValidity() === false) {
|
||||
form.reportValidity(); // Display validation error messages
|
||||
event.preventDefault(); // Prevent form submission if it's not valid
|
||||
$('#submitBtn').prop('disabled', false);
|
||||
} else {
|
||||
$('#submitBtn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user