This commit is contained in:
venkateswaran ubuntu 2023-09-02 18:17:25 +05:30
parent 0c64d022bc
commit 8ecdb842c8
5 changed files with 179 additions and 24 deletions

View File

@ -82,17 +82,26 @@ text-align: center;
<td hidden><?php echo $row['id'];?></td>
<td style="text-align: center;"><?php echo $row['order_id'];?></td>
<td style="text-align: center;"><?php $date = new DateTime($row['created_at']); echo $date->format('M d , Y'); ?></td>
<td style="text-align: center;"><?php $expirydate = new DateTime($row['expiring_date']); echo $expirydate->format('M d , Y'); ?></td>
<td style="text-align: center;"><?php
if($row['running_balance'] + $row['used_points'] == 0)
{
echo '-';
}
else
{
$expirydate = new DateTime($row['expiring_date']); echo $expirydate->format('M d , Y');
}
?></td>
<td style="text-align: center;">
<?php
if($row['running_balance'] + $row['used_points'] == 0)
{
$balance = "- ".$row['credit_points'];
}else{
$balance = "+ ".$row['credit_points'];
}
echo $balance;
?>
<?php
if($row['running_balance'] + $row['used_points'] == 0)
{
$balance = "- ".$row['credit_points'];
}else{
$balance = "+ ".$row['credit_points'];
}
echo $balance;
?>
</td>
<td style="text-align: center;"> <?php echo $row['avaiable_credit'];?> </td>
<td style="text-align: center;"> <?php if($row['remark'] != null && $row['remark'] != ''){ echo $row['remark']; }else{echo "-";};?> </td>
@ -197,19 +206,19 @@ $(document).on('click','.manage-credits',function(){
<option value="">SELECT</option>
<option value="card">Card</option>
<option value="cash">Cash</option>
<option value="cash">Others</option>
<option value="Others">Others</option>
</select>
</div>
<div class="mb-1 mt-2 col-md-12">
<label class="form-label">Remarks</label>
<input type="text" class="form-control" name="remarks" maxlength="30">
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="30">
<span style="color: red;margin-left: 4px;"><i>Remarks must be 30 characters</i></span>
</div>
</div>
<div style="text-align:center;margin-top:30px;"><button type="submit" class="btn btn-primary waves-effect waves-light" id="button">Add</button></div>
</form>
</div>`
$('#myLargeModalLabel').html("Add Credits For "+$('#empName').val()+" ")
$('#myLargeModalLabel').html("Manage Credits For "+$('#empName').val()+" ")
$('#model-table').html(addForm);
$('#bs-example-modal-lg').modal('show');
@ -333,10 +342,34 @@ $(document).on('change','#packs',function(){
$('#datatable-buttons').DataTable({
"order": [[0, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
// "buttons": ['copy', 'csv', 'excel', 'pdf'], // Enable export options
// "language": {
// "search": "Search: " // Customize search label
// }
buttons: [
{
extend: 'pdfHtml5',
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
}
},
{
extend: 'print',
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
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'CMember Name : <?php echo $fname." ".$lname; ?> (Total Credits : <?php echo $avaiable_credit; ?>)', // Set your custom print title here
}
]
});
});
@ -348,6 +381,23 @@ function matchnum(event)
return false;
}
$(document).on('change','.add_or_sub',function(){
var selectedValue = $('input[name="add_or_sub"]:checked').val();
if (selectedValue === 'sub') {
$('#method option[value="card"]').hide();
$('#method option[value="cash"]').hide();
$("#packs option[value='6']").hide();
$("#packs option[value='7']").hide();
$('#remarks').prop('required', true);
} else {
$('#method option[value="card"]').show();
$('#method option[value="cash"]').show();
$('#method option[value="card"]').show();
$('#method option[value="cash"]').show();
$('#remarks').prop('required', false);
}
if($(this).val() == 'sub')
{
$('#button').html('Deduct');

View File

@ -146,10 +146,34 @@ $(document).on('click','.transaction',function(){
$('#datatable-buttons').DataTable({
"order": [[0, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
// "buttons": ['copy', 'csv', 'excel', 'pdf'], // Enable export options
// "language": {
// "search": "Search: " // Customize search label
// }
buttons: [
{
extend: 'pdfHtml5',
title: 'Members', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
}
},
{
extend: 'print',
title: 'Members', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Members', // Set your custom print title here
}
]
});
});

View File

@ -153,7 +153,34 @@ $(document).on('click','.order_details',function(){
$('#datatable-buttons').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
// "buttons": ['copy', 'csv', 'excel', 'pdf'], // Enable export options
buttons: [
{
extend: 'pdfHtml5',
title: 'Transactions', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
}
},
{
extend: 'print',
title: 'Transactions', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Transactions', // Set your custom print title here
}
],
"language": {
"search": "Search: " // Customize search label
},

View File

@ -93,7 +93,34 @@
$('#datatable-buttons').DataTable({
"order": [[0, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
// "buttons": ['copy', 'csv', 'excel', 'pdf'], // Enable export options
buttons: [
{
extend: 'pdfHtml5',
title: 'Users', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
}
},
{
extend: 'print',
title: 'Users', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Users', // Set your custom print title here
}
],
"language": {
"search": "Search: " // Customize search label
}

View File

@ -93,7 +93,34 @@
$('#datatable-buttons').DataTable({
"order": [[0, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
// "buttons": ['copy', 'csv', 'excel', 'pdf'], // Enable export options
buttons: [
{
extend: 'pdfHtml5',
title: 'Users', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
}
},
{
extend: 'print',
title: 'Users', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Users', // Set your custom print title here
}
],
"language": {
"search": "Search: " // Customize search label
}