This commit is contained in:
misya 2025-07-04 10:46:07 +08:00
parent 6ad2f11e9e
commit 100a4adff6
3 changed files with 9 additions and 17 deletions

View File

@ -1,14 +1,7 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using PSTW_CentralSystem.DBContext; using PSTW_CentralSystem.DBContext;
//using PSTW_CentralSystem.Areas.MMS.Models;
//using System.IO;
//using System.Linq;
using PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator; using PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator;
using QuestPDF.Fluent; using QuestPDF.Fluent;
//using System.Threading.Tasks;
//using System.Threading;
//using System.Collections.Generic;
//using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using MySqlConnector; using MySqlConnector;

View File

@ -1,16 +1,13 @@
using QuestPDF.Fluent; using QuestPDF.Fluent;
using QuestPDF.Infrastructure; using QuestPDF.Infrastructure;
using QuestPDF.Helpers; using QuestPDF.Helpers;
using Google.Protobuf.WellKnownTypes;
using PSTW_CentralSystem.Models;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator
{ {
public class TarBallPDF(string stateName, string stationID, string locationName, public class TarBallPDF(string stateName, string stationID, string locationName,
string longitude, string latitude, DateTime dateSample, TimeSpan timeSample, string longitude, string latitude, DateTime dateSample, TimeSpan timeSample, string classifyID,
string classifyID, bool tarBallYes, bool tarBallNo, bool isSand, bool isNonSandy, bool tarBallYes, bool tarBallNo, bool isSand, bool isNonSandy, bool isCoquina,
bool isCoquina, string photoPath1, string photoPath2, string photoPath3, string photoPath4, string photoPath1, string photoPath2, string photoPath3, string photoPath4,
string? photoPath5, string? photoPath6, string? photoPath7, string? photoPath8, string? photoPath5, string? photoPath6, string? photoPath7, string? photoPath8,
string? optionalName1, string? optionalName2, string? optionalName3, string? optionalName4, string? optionalName1, string? optionalName2, string? optionalName3, string? optionalName4,
string firstSampler, string fullName, string levelName string firstSampler, string fullName, string levelName

View File

@ -190,7 +190,7 @@
// Populate the table with initial data // Populate the table with initial data
this.updateDataTable(this.sortedFilteredData); this.updateDataTable(this.sortedFilteredData);
//auto-filtering //auto-filtering => search bar
$('#tarballTable_filter input').on('keyup', function () { $('#tarballTable_filter input').on('keyup', function () {
self.dataTable.search(this.value).draw(); self.dataTable.search(this.value).draw();
}); });
@ -210,12 +210,14 @@
}); });
}, },
watch: { watch: {
//runs on auto when month/year dropdowns changed
sortedFilteredData(newData) { sortedFilteredData(newData) {
// Automatically update DataTables whenever the filtered data changes //1. UPDATE THE TABLE: take the new filtered list (newData) and put it in the table
this.updateDataTable(newData); this.updateDataTable(newData);
//trigger search function after updating data(?) //2. CLEAR THE SEARCH BOX: if table exist, clear anything typed in the search bar
//Like pressing 'clear' on a calculator after getting new numbers
if(this.dataTable) { if(this.dataTable) {
this.dataTable.search('').draw(); this.dataTable.search('').draw(); //empty the search box
} }
} }
} }