Issues Fixes : ps

This commit is contained in:
VE10-Sanjeev 2023-12-20 14:48:10 +05:30
parent 9ae0afd089
commit 015047d086
7 changed files with 35 additions and 12 deletions

View File

@ -388,8 +388,9 @@ class ApiIntegration extends ResourceController
$this->logger->info("Api SaveBookDetails : ".$extensive_correspondence);
$master_categories = $api_model->getData('category', ['isactive' => 1]);
$this->logger->info("Api SaveBookDetails : total master categories count = ".count($master_categories));
$where = ['book_id' => (int)$last_insert_book_id, 'isactive' => 1 ];
$where = ['book_categories.book_id' => (int)$last_insert_book_id, 'book_categories.isactive' => 1 ];
$existing_categories = $api_model->getExistingBookCategories($where);
$this->logger->info("Api SaveBookDetails : existing book categories records => ".json_encode($existing_categories));
$this->logger->info("Api SaveBookDetails : existing book categories count = ".count($existing_categories)." Book_id = ".$last_insert_book_id);
$request_categories = (array)$categories;
$filtering_existing_categories_wpApiId = [];

View File

@ -113,7 +113,7 @@ class ApiIntegrationModel extends Model
public function getExistingBookCategories($where){
$query = $this->db->table('book_categories')
->join('category', 'category.id = book_categories.category_id', 'left')
->select('category.*,book_categories.book_id,book_categories.category_id as book_categories_id');
->select('category.*,book_categories.book_id,book_categories.category_id as book_categories_id, book_categories.isactive as book_categories_isactive');
$query->where($where);
return $query->get()->getResult();
}

View File

@ -93,15 +93,14 @@ class HomeModel extends Model
}
public function book_published_list(){
$now = date('Y-m-d');
$oneMonthAgo = date('Y-m-d', strtotime($now . ' -1 month'));
$oneMonthAgo = date('Y-m-d', strtotime(' -30 days'));
return $this->db->table('books as B')
->select("B.book_id, B.title, B.created_on, B.publisher, B.author, B.publication_date, DATE_FORMAT(B.publication_date, '%d/%m/%Y') as publication_date_format, GROUP_CONCAT(CM.name, ',') as categories")
->join('book_categories as BC', 'BC.book_id = B.book_id and BC.isactive = 1', 'left')
->join('category as CM', 'BC.category_id = CM.id', 'left')
->where('B.created_on >=', $oneMonthAgo)
->where('B.created_on <=', $now)
->where('B.created_on <= CURDATE() + INTERVAL 1 DAY')
->where('B.isactive', 1)
->orderBy('B.publication_date', 'DESC')
->groupBy('B.book_id')

View File

@ -42,9 +42,9 @@
</div>
<div class="form-group col-md-6">
<label for="bmail" class="col-form-label">Email<span class="text-danger">*</span></label>
<input type="email" class="form-control" name="bmail" value="<?= isset($businesses['email']) ? $businesses['email'] : '' ?>" placeholder="Email" required onchange="checkExistingEmail(this.value)"/>
<div class="invalid-feedback"> Please provide. </div>
<input type="email" class="form-control" id="bmail" name="bmail" placeholder="Email" value="<?= isset($businesses['email']) ? $businesses['email'] : '' ?>" required onkeyup="validateEmail(this.value)" onchange="checkExistingEmail(this.value)" />
<span id="emailValidationMessage"></span>
<div class="invalid-feedback"> Please provide. </div>
</div>
</div>
<div class="form-row">
@ -82,7 +82,7 @@
<div class="invalid-feedback"> Please provide. </div>
</div>
<div class="form-group col-md-12">
<label for="bterms" class="col-form-label">Terms & Condition<span class="text-danger">*</span></label>
<label for="bterms" class="col-form-label">Terms & Condition</label>
<textarea class="form-control" id="terms" name="bterms" rows="5" cols="50"></textarea>
</div>

View File

@ -54,7 +54,7 @@
</div>
<div class="form-group col-md-4">
<label for="dob" class="col-form-label">Date Of Birth</label>
<input type="date" class="form-control" name="dob" value="<?= isset($customer['date_of_birth']) ? $customer['date_of_birth'] : '' ?>" placeholder="Date Of Birth" />
<input type="date" class="form-control" name="dob" value="<?= isset($customer['date_of_birth']) ? $customer['date_of_birth'] : '' ?>" max="<?= date('Y-m-d', strtotime('-18 years')); ?>" placeholder="Date Of Birth" />
</div>
</div>

View File

@ -80,12 +80,12 @@
<div class="form-row">
<div class="form-group col-md-4">
<label for="invoiceDate">Invoice Date<span class="text-danger"> *</span></label>
<input type="date" class="form-control" id="invoiceDate" name="invoice_date" value="<?= isset($invoice_details['invoice_date']) ? $invoice_details['invoice_date'] : '' ?>" required>
<input type="date" class="form-control" id="invoiceDate" name="invoice_date" value="<?= isset($invoice_details['invoice_date']) ? $invoice_details['invoice_date'] : '' ?>" max="<?= date('Y-m-d'); ?>" required>
</div>
<?php if ($invoice_type === '2') : ?>
<div class="form-group col-md-4">
<label for="fromsubcription">From Subcription<span class="text-danger"> *</span></label>
<input type="date" class="form-control" id="fromsubcription" name="from_subscription" value="<?= isset($invoice_item_details[0]['from_subscription']) ? $invoice_item_details[0]['from_subscription'] : '' ?>" required onchange="updateToDateMinDate(this.value)">
<input type="date" class="form-control" id="fromsubcription" name="from_subscription" value="<?= isset($invoice_item_details[0]['from_subscription']) ? $invoice_item_details[0]['from_subscription'] : '' ?>" required min="<?= date('Y-m-d'); ?>" onchange="updateToDateMinDate(this.value)">
</div>
<div class="form-group col-md-4">
<label for="tosubcription">To Subcription<span class="text-danger"> *</span></label>
@ -755,6 +755,27 @@
const toDateInput = document.getElementById('tosubcription');
toDateInput.min = fromDateValue;
}
// function updateToDateMinDate(fromDateValue) {
// const toDateInput = document.getElementById('tosubcription');
// // Convert fromDateValue to a Date object
// const fromDate = new Date(fromDateValue);
// // Set the min attribute of 'tosubcription' input
// toDateInput.min = fromDateValue;
// // Calculate the date 1 year from the selected date
// const maxDate = new Date(fromDate);
// maxDate.setFullYear(fromDate.getFullYear() + 1);
// // Format the max date as 'YYYY-MM-DD' (the format used by the 'date' input)
// const formattedMaxDate = maxDate.toISOString().split('T')[0];
// // Set the max attribute and default value of 'tosubcription' input
// toDateInput.max = formattedMaxDate;
// toDateInput.value = formattedMaxDate;
// }
</script>
<script>

View File

@ -44,7 +44,8 @@
<th>Count</th>
<th>OT Charges</th>
<th>Total</th>
<th>payment</th>
<th>Status</th>
<th>Payment</th>
</tr>
</thead>
@ -62,6 +63,7 @@
<td><?php echo $row->item_count;?></td>
<td><?php echo '₹' . number_format($row->shipping_charge, 2, '.', ','); ?></td>
<td><?php echo '₹' . number_format($row->total_amount, 2, '.', ','); ?></td>
<td><?php echo $row->status;?></td>
<td><?php echo $row->payment_method;?></td>
</tr>
<?php } ?>