Dashboard - Copy this React, Tailwind Component to your project
I have this code but the problem is it is not showing show entries as expected also search is showing below both filters so need professional look after login function doGet() { return HtmlService.createHtmlOutputFromFile('index'); } // Function to validate user credentials function validateUser(username, password) { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Users'); var data = sheet.getDataRange().getValues(); // Find the user row for (var i = 1; i < data.length; i++) { // Start from 1 to skip headers if (data[i][0] === username && data[i][1] === password) { return username; // Return username if valid } } return null; // Return null if invalid } // Function to get data for a specific user function getDataForUser(username) { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1'); var data = sheet.getDataRange().getValues(); // Assuming first row is headers var headers = data[0]; // Find the index of the username column var usernameColIndex = headers.indexOf('username'); // Replace with actual header name if available // Filter rows for the specific user var userData = data.slice(1).filter(function(row) { return row[usernameColIndex] === username; }); // Define relevant columns based on your titles var relevantColumns = [ { title: "Order No", index: 1 }, { title: "Order Date", index: 2 }, { title: "Party", index: 3 }, { title: "Catalogue", index: 4 }, { title: "Fabric", index: 5 }, { title: "Item", index: 6 }, { title: "Images", index: 19}, { title: "Quantity", index: 8 }, { title: "Dispatched", index: 12 }, { title: "Promised Delivery Date", index: 15 }, { title: "Delivery Date", index: 16 }, { title: "Invoice", index: 20 } ]; // Extract only the relevant columns userData = userData.map(function(row) { return relevantColumns.map(function(col) { return row[col.index]; }); }); // Convert userData to JSON return JSON.stringify(userData); } // Function to handle user logout function logout() { // You may need to handle session invalidation here // For example, clearing any session data if used return; }
