feat: add analysis tools and dashboard views for intern data tracking and reporting
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
$app = require_once __DIR__ . '/../bootstrap/app.php';
|
||||
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
||||
|
||||
$interns = \App\Models\CareerApplication::where('type', 'internship')
|
||||
->whereIn('id', [18, 19, 20, 22, 23, 25, 27, 28, 31, 32])
|
||||
->with(['journalEntries' => function($q) {
|
||||
$q->orderBy('day_number', 'asc');
|
||||
}])->get();
|
||||
|
||||
$report = [];
|
||||
|
||||
foreach ($interns as $i) {
|
||||
$entries = [];
|
||||
$allText = "";
|
||||
foreach ($i->journalEntries as $e) {
|
||||
$entries[] = [
|
||||
'day' => $e->day_number,
|
||||
'date' => $e->date,
|
||||
'content' => strip_tags($e->content)
|
||||
];
|
||||
$allText .= "\n" . strip_tags($e->content);
|
||||
}
|
||||
|
||||
$report[$i->id] = [
|
||||
'name' => $i->name,
|
||||
'email' => $i->email,
|
||||
'repo' => $i->github_repo,
|
||||
'github_username' => $i->github_username,
|
||||
'start_date' => $i->internship_start_date,
|
||||
'end_date' => $i->internship_end_date,
|
||||
'total_days' => $i->internship_total_days,
|
||||
'filled_days' => count($entries),
|
||||
'entries_sample' => [
|
||||
'first' => $entries[0] ?? null,
|
||||
'middle' => $entries[intval(count($entries)/2)] ?? null,
|
||||
'last' => $entries[count($entries)-1] ?? null,
|
||||
],
|
||||
'full_text_length' => strlen($allText),
|
||||
'all_entries' => $entries
|
||||
];
|
||||
}
|
||||
|
||||
file_put_contents(__DIR__ . '/detailed_intern_analysis.json', json_encode($report, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
||||
echo "Generated detailed analysis for " . count($report) . " active/completed interns.\n";
|
||||
Reference in New Issue
Block a user