feat: implement quick approval dashboard for intern reports with filtered views and modal navigation
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$json = file_get_contents(__DIR__ . '/intern_data.json');
|
||||
$interns = json_decode($json, true);
|
||||
|
||||
$report = "";
|
||||
foreach ($interns as $intern) {
|
||||
$report .= "========================================\n";
|
||||
$report .= "NAME: " . $intern['name'] . "\n";
|
||||
$report .= "Email: " . $intern['email'] . "\n";
|
||||
$report .= "GitHub Repo: " . ($intern['github_repo'] ?: 'NONE') . "\n";
|
||||
$report .= "Start: " . $intern['internship_start_date'] . " | End: " . $intern['internship_end_date'] . "\n";
|
||||
$report .= "Total Journal Entries: " . count($intern['journal_entries']) . "\n";
|
||||
|
||||
foreach ($intern['journal_entries'] as $entry) {
|
||||
$report .= "--- Date: " . $entry['date'] . " | Day: " . $entry['day_number'] . " | Retroactive: " . ($entry['is_retroactive'] ? 'YES' : 'NO') . " | Approved: " . ($entry['supervisor_approved'] ? 'YES' : 'NO') . "\n";
|
||||
$report .= strip_tags($entry['content']) . "\n";
|
||||
}
|
||||
$report .= "\n\n";
|
||||
}
|
||||
|
||||
file_put_contents(__DIR__ . '/detailed_report.txt', $report);
|
||||
echo "Written to scratch/detailed_report.txt\n";
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
$app = require_once __DIR__ . '/../bootstrap/app.php';
|
||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
||||
$kernel->bootstrap();
|
||||
|
||||
$interns = \App\Models\CareerApplication::where('status', 'accepted')
|
||||
->with(['journalEntries' => function($q) {
|
||||
$q->orderBy('date', 'asc');
|
||||
}])
|
||||
->get();
|
||||
|
||||
$data = [];
|
||||
foreach ($interns as $intern) {
|
||||
$entries = [];
|
||||
foreach ($intern->journalEntries as $entry) {
|
||||
$entries[] = [
|
||||
'day_number' => $entry->day_number,
|
||||
'date' => $entry->date,
|
||||
'content' => $entry->content,
|
||||
'is_retroactive' => $entry->is_retroactive,
|
||||
'supervisor_approved' => $entry->supervisor_approved,
|
||||
'unit_approved' => $entry->unit_approved,
|
||||
];
|
||||
}
|
||||
$data[] = [
|
||||
'id' => $intern->id,
|
||||
'name' => $intern->name,
|
||||
'email' => $intern->email,
|
||||
'github_username' => $intern->github_username,
|
||||
'github_repo' => $intern->github_repo,
|
||||
'internship_start_date' => $intern->internship_start_date,
|
||||
'internship_end_date' => $intern->internship_end_date,
|
||||
'journal_entries' => $entries,
|
||||
];
|
||||
}
|
||||
|
||||
file_put_contents(__DIR__ . '/intern_data.json', json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
||||
echo "Done! Saved to scratch/intern_data.json\n";
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
$json = file_get_contents(__DIR__ . '/intern_data.json');
|
||||
$interns = json_decode($json, true);
|
||||
|
||||
foreach ($interns as $intern) {
|
||||
echo "========================================\n";
|
||||
echo "NAME: " . $intern['name'] . "\n";
|
||||
echo "Email: " . $intern['email'] . "\n";
|
||||
echo "GitHub Repo: " . ($intern['github_repo'] ?: 'NONE') . "\n";
|
||||
echo "Start: " . $intern['internship_start_date'] . " | End: " . $intern['internship_end_date'] . "\n";
|
||||
echo "Total Journal Entries: " . count($intern['journal_entries']) . "\n";
|
||||
|
||||
// Group journal entries by week or get recent ones
|
||||
// Let's filter entries for "this week" (2026-07-10 to 2026-07-17)
|
||||
$this_week_entries = [];
|
||||
foreach ($intern['journal_entries'] as $entry) {
|
||||
if ($entry['date'] >= '2026-07-10' && $entry['date'] <= '2026-07-17') {
|
||||
$this_week_entries[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
echo "This Week's Entries (" . count($this_week_entries) . "):\n";
|
||||
foreach ($this_week_entries as $entry) {
|
||||
echo " - Date: " . $entry['date'] . " | Day: " . $entry['day_number'] . " | Retroactive: " . ($entry['is_retroactive'] ? 'YES' : 'NO') . "\n";
|
||||
// Show first 200 chars of content
|
||||
$text = trim(strip_tags($entry['content']));
|
||||
$text = str_replace(["\r", "\n", "\t"], ' ', $text);
|
||||
$text = preg_replace('/\s+/', ' ', $text);
|
||||
echo " Content: " . mb_substr($text, 0, 150) . "...\n";
|
||||
}
|
||||
|
||||
// Also list all entries briefly to understand overall progress
|
||||
echo "All Entries dates: ";
|
||||
$dates = [];
|
||||
foreach ($intern['journal_entries'] as $entry) {
|
||||
$dates[] = $entry['date'] . ($entry['is_retroactive'] ? '(R)' : '');
|
||||
}
|
||||
echo implode(', ', $dates) . "\n";
|
||||
}
|
||||
Reference in New Issue
Block a user