refactor: fix database structure, migrate uploads to Google Drive, and resolve mail issues

This commit is contained in:
2025-12-31 01:07:21 +05:30
Unverified
parent 9ec4dd02ae
commit d8d4480046
32488 changed files with 3998121 additions and 571 deletions

View File

@@ -13,7 +13,7 @@ $user_initial = strtoupper($current_email[0]);
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
</div>
<h2 class="text-xl font-bold text-white tracking-tight"> <?php echo htmlspecialchars($_ENV['DOMAIN']); ?> Dashboard</h2>
<h2 class="text-xl font-bold text-white tracking-tight"> <?php echo htmlspecialchars($_ENV['APP_NAME']); ?> Dashboard</h2>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -1,48 +0,0 @@
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100%" viewBox="0 0 784 784" enable-background="new 0 0 784 784" xml:space="preserve">
<!-- background unchanged -->
<rect x="0" y="0" width="784" height="784" fill="oklch(92.8% 0.006 264.531)"/>
<!-- scale about center (392,392) then translate to perfectly center the X -->
<g transform="translate(392 392) scale(1.1) translate(-392 -392) translate(-15.953 -35.974)">
<path fill="#000000" opacity="1.000000" stroke="none"
d="
M346.905396,404.021973
C321.318146,357.697021 295.903931,311.698486 270.446228,265.621185
C274.808777,262.688843 279.197601,263.455688 283.187531,262.938385
C313.162109,259.051697 343.178192,255.484833 373.183533,251.836151
C376.812012,251.394913 380.491333,251.270798 384.079376,250.624100
C388.119141,249.896027 389.967407,251.396378 391.303864,255.259979
C398.429047,275.858765 405.832123,296.361420 413.139679,316.897125
C419.220367,333.984985 425.295776,351.074799 431.391998,368.157135
C432.052856,370.008911 432.561920,371.962067 434.656860,373.924866
C438.624664,365.456879 442.508209,357.263794 446.312042,349.033844
C460.494507,318.348389 474.640442,287.646057 488.825104,256.961639
C491.973969,250.150009 492.052216,250.035278 499.556030,251.756332
C515.270935,255.360641 530.952332,259.111267 546.637878,262.841980
C548.069336,263.182434 549.431763,263.812927 551.700928,264.619720
C547.628296,271.228851 543.792847,277.556000 539.858582,283.821075
C511.960510,328.246918 484.099731,372.696442 456.039429,417.019653
C453.297638,421.350555 453.565186,424.419495 456.237244,428.655518
C487.699310,478.531372 518.963013,528.532349 550.256165,578.514709
C551.193665,580.012207 552.739380,581.321716 552.122131,584.069397
C543.992615,585.129333 535.650391,586.229980 527.304504,587.302368
C507.368896,589.864197 487.435760,592.445984 467.493134,594.952148
C457.770020,596.174072 448.002899,597.072449 438.308075,598.478394
C434.924805,598.969055 433.598114,597.803345 432.369934,594.904480
C420.292267,566.397705 408.077820,537.948730 395.924957,509.473694
C391.416168,498.909241 386.997192,488.306335 382.459656,477.754333
C381.768829,476.147736 381.397461,474.172699 379.305511,473.450012
C376.796600,474.112671 376.423767,476.497223 375.559601,478.366852
C357.813995,516.759277 340.017395,555.128845 322.526245,593.637146
C320.345215,598.438904 318.126648,599.511230 313.118866,598.174255
C297.383301,593.972961 281.511292,590.282593 265.691559,586.396545
C263.947418,585.968140 262.098297,585.791138 260.265839,583.832458
C264.526489,576.910034 268.815521,569.848328 273.194244,562.842651
C297.821381,523.441040 322.469696,484.052673 347.111725,444.660370
C350.467682,439.295563 353.749207,433.881561 357.227020,428.596832
C358.606476,426.500610 358.579529,424.815582 357.318298,422.660950
C353.786011,416.626404 350.476105,410.461700 346.905396,404.021973
z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -169,7 +169,6 @@ function validateFile(input) {
const maxSize = 2 * 1024 * 1024; // 2MB
if (file.size > maxSize) {
alert("File is too large! Please select an image under 2MB.");
input.value = "";
labelMain.innerText = "File too large!";
labelSub.innerText = "Please select a file under 2MB";
@@ -201,7 +200,8 @@ function useCurrentLocation() {
function (position) {
const lat = position.coords.latitude;
const lng = position.coords.longitude;
locInput.value = lat + ", " + lng;
const mapsLink = `https://www.google.com/maps?q=${lat},${lng}`;
locInput.value = mapsLink;
},
function (error) {
alert("Unable to retrieve your location.");
@@ -244,22 +244,16 @@ function parseMarkdown(text) {
if (!line) return;
if (/^(\d+\.|[A-Z]).*?:$/.test(line) || line.startsWith("###")) {
let content = line.replace(/^###\s*/, "");
formattedHTML += `<div class="text-white font-bold mt-4 mb-1 text-sm">${content}</div>`;
}
else if (/^[\-\*]\s+/.test(line)) {
} else if (/^[\-\*]\s+/.test(line)) {
let content = line.replace(/^[\-\*]\s+/, "");
formattedHTML += `
<div class="flex items-start ml-2 mb-1">
<span class="text-blue-400 mr-2 mt-1.5 leading-none" style="font-size: 6px;">●</span>
<span class="text-neutral-300 text-sm leading-snug">${content}</span>
</div>`;
}
else {
} else {
formattedHTML += `<div class="text-neutral-300 mb-1 text-sm leading-snug">${line}</div>`;
}
});

View File

@@ -219,7 +219,7 @@ $result = $conn->query($sql);
<td class="px-6 py-4 text-center">
<?php if (!empty($row['image_path'])): ?>
<a href="<?php echo htmlspecialchars($row['image_path']); ?>" target="_blank"
<a href="./core/actions/submit_report.php?view_id=<?php echo htmlspecialchars($row['image_path']); ?>" target="_blank"
class="inline-block p-2 hover:bg-neutral-700 rounded-lg text-neutral-400 transition-colors">
<svg class="h-5 w-5 mx-auto text-violet-400" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
@@ -254,7 +254,7 @@ $result = $conn->query($sql);
<td class="px-6 py-4 text-center">
<button
onclick='askAboutReport(<?= (int)$row["id"] ?>, <?= json_encode($row["title"]) ?>, <?= json_encode($row["category"]) ?>)'
onclick='askAboutReport(<?= (int) $row["id"] ?>, <?= json_encode($row["title"]) ?>, <?= json_encode($row["category"]) ?>)'
class="text-blue-400 hover:text-blue-300 text-xs font-medium flex items-center justify-center gap-1 transition-colors">
Ask Gemini
</button>
@@ -416,19 +416,21 @@ $result = $conn->query($sql);
class="text-red-500">*</span></label>
<div class="flex bg-neutral-900 rounded-lg p-1 border border-neutral-700">
<label class="flex-1 text-center cursor-pointer">
<input type="radio" name="priority" value="Low" class="sr-only peer">
<input type="radio" name="priority" value="Low" class="sr-only peer" checked>
<span
class="block px-2 py-1.5 rounded-md text-sm text-neutral-400 peer-checked:bg-neutral-800 peer-checked:text-green-400 peer-checked:shadow-sm transition-all">Low</span>
class="block px-2 py-1.5 rounded-md text-sm text-neutral-200 peer-checked:bg-neutral-800 peer-checked:text-green-400 peer-checked:shadow-sm transition-all">Low</span>
</label>
<label class="flex-1 text-center cursor-pointer">
<input type="radio" name="priority" value="Medium" class="sr-only peer">
<span
class="block px-2 py-1.5 rounded-md text-sm text-neutral-400 peer-checked:bg-neutral-800 peer-checked:text-white peer-checked:shadow-sm transition-all">Med</span>
class="block px-2 py-1.5 rounded-md text-sm text-neutral-200 peer-checked:bg-neutral-800 peer-checked:text-orange-400 peer-checked:shadow-sm transition-all">Med</span>
</label>
<label class="flex-1 text-center cursor-pointer">
<input type="radio" name="priority" value="High" class="sr-only peer" checked>
<input type="radio" name="priority" value="High" class="sr-only peer">
<span
class="block px-2 py-1.5 rounded-md text-sm text-neutral-400 peer-checked:bg-neutral-800 peer-checked:text-white peer-checked:shadow-sm transition-all">High</span>
class="block px-2 py-1.5 rounded-md text-sm text-neutral-200 peer-checked:bg-neutral-800 peer-checked:text-red-400 peer-checked:shadow-sm transition-all">High</span>
</label>
</div>
</div>