This commit is contained in:
venkateswaran ubuntu 2023-09-04 12:30:30 +05:30
parent d29dc0e51f
commit fc8e736a31
3 changed files with 50 additions and 24 deletions

View File

@ -194,11 +194,11 @@ $(document).on('click','.manage-credits',function(){
<div id="count_hide_show" class="mb-1 mt-2"></div>
<div class="mb-1 mt-2 col-md-4">
<label class="form-label">Credit Points<span style="color: red;margin-left: 4px;">*</label>
<input type="number" class="form-control" min="1" name="credit_points" id="credit" required value="1" onkeypress = "return matchnum(event)">
<input type="number" class="form-control" min="1" name="credit_points" id="credit" required value="1" onkeypress = "return matchnum(event)">
</div>
<div class="mb-1 mt-2 col-md-4">
<label class="form-label">Cost($)<span style="color: red;margin-left: 4px;">*</label>
<input type="text" class="form-control" name="cost" id="cost" readonly required value="${res.OnePackValue[0]['value']}">
<input type="number" class="form-control" name="cost" id="cost" onkeypress = "return matchnum(event)" readonly required value="${res.OnePackValue[0]['value']}">
</div>
<div class="mb-1 mt-2 col-md-4">
<label class="form-label">Transaction Method<span style="color: red;margin-left: 4px;">*</label>
@ -209,8 +209,8 @@ $(document).on('click','.manage-credits',function(){
</select>
</div>
<div class="mb-1 mt-2 col-md-12">
<label class="form-label">Remarks</label>
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="30">
<label for="remarks" class="form-label">Remarks<span style="color: red;margin-left: 4px;">*</span></label>
<input type="text" class="form-control" id="remarks" name="remarks" required maxlength="30">
<span style="color: red;margin-left: 4px;"><i>Remarks must be 30 characters</i></span>
</div>
</div>
@ -237,6 +237,19 @@ $(document).on('click','.manage-credits',function(){
}
});
$('#method').on('click', function(){
if($(this).val() == 'Others')
{
$('#remarks').prop('required', true);
$('label[for="remarks"]').html('Remarks<span style="color: red;margin-left: 4px;">*</span>');
}
else
{
$('#remarks').prop('required', false);
$('label[for="remarks"]').text('Remarks');
}
});
$('#credit').on('click', function(){
if($('#packs').val() == 'CreditPoints')
@ -348,7 +361,9 @@ $(document).on('change','#packs',function(){
title: 'Member Name : <?php echo $fname." ".$lname; ?> (Total Credits : <?php echo $avaiable_credit; ?>)', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
doc.content[1].table.body.forEach(function(row) {
row.splice(0, 1); // Remove the first column (ID column)
});
}
},
{
@ -356,18 +371,24 @@ $(document).on('change','#packs',function(){
title: 'Member Name : <?php echo $fname." ".$lname; ?> (Total Credits : <?php echo $avaiable_credit; ?>)', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
$(win.document.body).find('table').find('th:first, td:first').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Member Name : <?php echo $fname." ".$lname; ?> (Total Credits : <?php echo $avaiable_credit; ?>)', // Set your custom print title here
exportOptions: {
columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}
]
});
@ -398,7 +419,9 @@ $(document).on('change','.add_or_sub',function(){
$("#credit").val("1"); // Reset Credit to 1 (you can set it to any default value)
$("#cost").val($("#costHidden").val());
$('#credit').prop('readonly', false);
$('#cost').prop('readonly', false);
$('.changeClass').removeClass('col-md-8').addClass('col-md-12');
$('label[for="remarks"]').html('Remarks<span style="color: red;margin-left: 4px;">*</span>');
} else {
$("#packs").val("CreditPoints");
$('#method option[value="card"]').show();
@ -407,6 +430,7 @@ $(document).on('change','.add_or_sub',function(){
$("#packs option[value='7']").show();
$('#remarks').prop('required', false);
$("#cost").val($("#costHidden").val());
$('label[for="remarks"]').text('Remarks');
if(packSel == 'CreditPoints'){
$('#count_hide_show').hide();
}
@ -429,20 +453,6 @@ $(document).on('change','.add_or_sub',function(){
</script>
<!-- <script>
$('#packs').on('change', function () {
// Get the selected value of the dropdown
var selectedValue = $(this).val();
alert(selectedValue)
if(selectedValue == 'CreditPoints'){
$('#count_hide_show').hide();
}
else
{
$('#count_hide_show').show();
}
});
</script> -->

View File

@ -159,7 +159,9 @@ $(document).on('click','.order_details',function(){
title: 'Transactions', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
doc.content[1].table.body.forEach(function(row) {
row.splice(0, 1); // Remove the first column (ID column)
});
}
},
{
@ -167,18 +169,24 @@ $(document).on('click','.order_details',function(){
title: 'Transactions', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
$(win.document.body).find('table').find('th:first, td:first').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Transactions', // Set your custom print title here
exportOptions: {
columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}
],
"language": {

View File

@ -99,7 +99,9 @@
title: 'Users', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
doc.content[1].table.body.forEach(function(row) {
row.splice(0, 1); // Remove the first column (ID column)
});
}
},
{
@ -107,18 +109,24 @@
title: 'Users', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
$(win.document.body).find('table').find('th:first, td:first').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Users', // Set your custom print title here
exportOptions: {
columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}
],
"language": {