Initial commit for new repo
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m4s

This commit is contained in:
dhanabalan
2025-12-16 17:05:04 +05:30
commit 3f0d529640
862 changed files with 141157 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<div class="sticky top-0 z-20 bg-white dark:bg-gray-900 px-2 py-2 shadow-sm" x-data="sidebarSearch()">
<x-filament::input.wrapper class="relative">
<x-filament::input
type="text"
placeholder="Search…"
x-ref="search"
x-on:input.debounce.300ms="filterItems($event.target.value)"
x-on:keydown.escape="clearSearch"
class="w-full rounded border px-2 py-1 text-sm"
/>
</x-filament::input.wrapper>
<script>
document.addEventListener('alpine:init', () => {
Alpine.data('sidebarSearch', () => ({
init() {
this.$refs.search.value = ''
},
filterItems(searchTerm) {
const groups = document.querySelectorAll('.fi-sidebar-nav-groups .fi-sidebar-group')
searchTerm = searchTerm.toLowerCase()
groups.forEach(group => {
const groupButton = group.querySelector('.fi-sidebar-group-button')
const groupText = (groupButton?.textContent || '').toLowerCase()
const items = group.querySelectorAll('.fi-sidebar-item')
let hasVisibleItems = false
const groupMatches = groupText.includes(searchTerm)
items.forEach(item => {
const itemText = item.textContent.toLowerCase()
const isVisible = itemText.includes(searchTerm) || groupMatches
item.style.display = isVisible ? '' : 'none'
if (isVisible) hasVisibleItems = true
})
group.style.display = (hasVisibleItems || groupMatches) ? '' : 'none'
})
},
clearSearch() {
this.$refs.search.value = ''
this.filterItems('')
},
}))
})
</script>
</div>

View File

@@ -0,0 +1,170 @@
{{-- <input
type="file"
id="folderPicker"
webkitdirectory
directory
multiple
style="display:none"
/>
<script>
function openFolderPicker() {
const input = document.getElementById('folderPicker');
input.value = ''; // reset
input.click(); // open system folder dialog
input.onchange = function(event) {
const files = event.target.files;
console.log("Files selected:", files);
alert(`${files.length} files selected`);
};
}
</script> --}}
<!-- Hidden input for folder picker -->
{{-- <input
type="file"
id="folderPicker"
webkitdirectory
directory
multiple
accept=".txt"
style="display:none"
/>
<script>
function openFolderPicker() {
const input = document.getElementById('folderPicker');
input.value = '';
input.click();
input.onchange = function(event) {
const files = Array.from(event.target.files);
const txtFiles = files.filter(f => f.name.endsWith('.txt'));
if (txtFiles.length === 0) {
alert("No .txt files found in selected folder!");
return;
}
txtFiles.forEach(file => {
const reader = new FileReader();
reader.onload = function(e) {
const content = e.target.result;
console.log("File:", file.name, "Content:", content);
alert(`File: ${file.name}\nContent:\n${content}`);
};
reader.readAsText(file);
});
};
}
</script> --}}
<!-- Hidden file input -->
{{-- <input type="file" id="fileInput" style="display:none" />
<script>
function openFileDialog() {
const input = document.getElementById('fileInput');
input.value = ''; // reset
input.click(); // open system file dialog
input.onchange = function(event) {
const file = event.target.files[0]; // get selected file
if (!file) {
alert("No file selected!");
return;
}
const reader = new FileReader();
reader.onload = function(e) {
const content = e.target.result;
console.log("File content:", content);
// Show content in page (or Filament modal)
alert(`File: ${file.name}\n\nContent:\n${content}`);
};
reader.onerror = function() {
alert("Failed to read file!");
};
reader.readAsText(file); // read as text
};
}
</script> --}}
<!-- Hidden file input -->
<input type="file" id="fileInput" style="display:none" />
<script>
function openFileDialog() {
const input = document.getElementById('fileInput');
input.value = '';
input.click();
input.onchange = function(event) {
const file = event.target.files[0];
if (!file) {
alert("No file selected!");
return;
}
const reader = new FileReader();
reader.onload = function(e) {
const content = e.target.result;
// Split file lines into array
const lines = content.split(/\r?\n/).map(l => l.trim());
const payload = {
name: lines[0] ?? '',
identification1: lines[1] ?? '',
identification2: lines[2] ?? '',
identification3: lines[3] ?? '',
contact_number: lines[4] ?? '',
alternate_number: lines[5] ?? '',
};
console.log("Payload to send:", payload);
// Send to backend
fetch("{{ route('file.store') }}", {
method: "POST",
headers: {
"X-CSRF-TOKEN": "{{ csrf_token() }}",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
})
.then(res => res.json())
.then(data => {
if (data.success) {
alert("DriverMaster record saved successfully!");
} else {
alert("Failed to save record.");
}
})
.catch(err => {
console.error(err);
alert("Error saving record.");
});
};
reader.onerror = function() {
alert("Failed to read file!");
};
reader.readAsText(file);
};
}
</script>

View File

@@ -0,0 +1,31 @@
{{-- @if ($getState())
<div class="p-4 text-center">
<img src="{{ $getState() }}"
onerror="this.onerror=null; this.src='{{ asset('images/not-found.png') }}'"
class="rounded shadow mx-auto"
style="width: 400px; height: 400px; object-fit: contain;" />
</div>
@else
<div class="p-4 text-center">
<img src="{{ asset('images/not-found.png') }}"
class="rounded shadow mx-auto"
style="width: 400px; height: 400px; object-fit: contain;" />
</div>
@endif --}}
@if ($getState())
<div class="p-4 text-center">
<img src="{{ $getState() }}?v={{ time() }}"
onerror="this.onerror=null; this.src='{{ asset('images/not-found.png') }}'"
class="rounded shadow mx-auto"
style="width: 200px; height: 200px; object-fit: contain;" />
</div>
@else
<div class="p-4 text-center">
<img src="{{ asset('images/not-found.png') }}"
class="rounded shadow mx-auto"
style="width: 200px; height: 200px; object-fit: contain;" />
</div>
@endif

View File

@@ -0,0 +1,42 @@
{{-- @if ($getState())
<div class="p-4 text-center">
<img src="{{ $getState() }}"
class="rounded shadow mx-auto"
style="width: 400px; height: 400px; object-fit: contain;" />
</div>
@endif --}}
{{-- @if (!empty($image))
<div class="mt-2">
<img src="{{ $image }}" alt="Part Validation Error Image" style="width: 200px; height: auto;">
</div>
@endif --}}
{{-- @if (!empty($part_validation1_error_image))
<div class="mt-2">
<img src="{{ $image }}" alt="Part Validation Error Image" style="width: 200px; height: auto;">
</div>
@else
<div class="mt-2">
<img src="{{ asset('images/not-found.png') }}" alt="Image Not Found" style="width: 200px; height: auto;">
</div>
@endif --}}
@if ($getState())
<div class="p-4 text-center">
<img src="{{ $getState() }}?v={{ time() }}"
onerror="this.onerror=null; this.src='{{ asset('images/not-found.png') }}'"
class="rounded shadow mx-auto"
style="width: 200px; height: 200px; object-fit: contain;" />
</div>
@endif
{{-- @else
<img src="{{ asset('images/not-found.png') }}" style="width: 200px; height: auto;">
@endif --}}