diff --git a/assets/js/firebase.js b/assets/js/firebase.js index c8bac09..4eb7d8a 100644 --- a/assets/js/firebase.js +++ b/assets/js/firebase.js @@ -29,17 +29,6 @@ pdfMake.createPdf(DataDef) console.log('Uploaded PDF blob to Firebase Storage!'); getDownloadURL(snapshot.ref).then(async(downloadURL) => { console.log('File available at', downloadURL); - - - function encodeUrl(url) { - // Encode special characters using encodeURIComponent - const encodedUrl = encodeURIComponent(url); - // Replace specific characters with their escaped versions for consistency - return encodedUrl.replace(/\//g, '%2F') - .replace(/\?/g, '%3F') - .replace(/&/g, '%26') - .replace(/=/g, '%3D'); - } var raw = downloadURL; var myHeaders = new Headers(); @@ -66,8 +55,6 @@ pdfMake.createPdf(DataDef) }); }); }; - link.href = "https://wa.me/91"+PhNo+"?text="+ ((((downloadURL).split(':').join('%3A')).split('/',).join('%2F')).split('?').join('%3F')).split('&').join('%26'); - }); } // Initialize the blob and name variables diff --git a/assets/js/printPdf.js b/assets/js/printPdf.js index 4af13c3..0beb9f2 100644 --- a/assets/js/printPdf.js +++ b/assets/js/printPdf.js @@ -530,9 +530,9 @@ function printPdf(e, i) { }, }; - - -let nameO = `${nameval}-${PhNo}/` ; +let d = new Date() +let dateDb = [ d.getDate(),d.getMonth(),d.getFullYear(),d.getHours(),d.getHours(),d.getMinutes()] +let nameO = `${nameval}-${PhNo}//${nameval}-${PhNo}_${dateDb[0]}-${dateDb[1]}-${dateDb[2]}_${dateDb[3]}-${dateDb[4]}` ; if(i === 0 || i===2) { DataDef.content.push(foodTable); nameO += "-Diet"