Templates - Country - State-wise Salary Score
<?php
use App\Models\Location;
/**
* Fetch country & states
*/
$country = Location::activeCountry('IN');
$states = $country->states();
/**
* Base average monthly salary range (INR)
*/
$avgSalaryRange = [30000, 50000];
/**
* State-wise salary score (unique & realistic)
* 50 = national average
*/
$stateSalaryScore = [
'Andhra Pradesh' => 58,
'Arunachal Pradesh' => 55,
'Assam' => 52,
'Bihar' => 45,
'Chhattisgarh' => 48,
'Goa' => 70,
'Gujarat' => 65,
'Haryana' => 68,
'Himachal Pradesh' => 60,
'Jharkhand' => 46,
'Karnataka' => 75,
'Kerala' => 62,
'Madhya Pradesh' => 50,
'Maharashtra' => 78,
'Manipur' => 53,
'Meghalaya' => 54,
'Mizoram' => 56,
'Nagaland' => 55,
'Odisha' => 49,
'Punjab' => 64,
'Rajasthan' => 51,
'Sikkim' => 63,
'Tamil Nadu' => 72,
'Telangana' => 74,
'Tripura' => 47,
'Uttar Pradesh' => 52,
'Uttarakhand' => 61,
'West Bengal' => 57,
'Delhi' => 80,
'Jammu & Kashmir' => 59,
];
/**
* Convert monthly salary to LPA
*/
function toLPA($monthly)
{
return round(($monthly * 12) / 100000, 2);
}
?>
<?= template()->layout('frontend/layout') ?>
<?= template()->push('meta') ?>
<title><?= $template->title ?></title>
<meta name="description" content="<?= $template->title ?>">
<?= template()->endPush() ?>
<div class="container">
<article>
<h1 class="card-header m-0 pl-0 pr-0 fw-900">
<?= $template->title ?> <?= $country->name ?>
</h1>
<p>Country-specific template content would go here.</p>
</article>
<h2 class="card-header m-0 pl-0 pr-0 fw-900">
State-wise Apprentice Salary (LPA)
</h2>
<!-- STATE SALARY TABLE -->
<table class="table tables-1">
<thead>
<tr>
<th>State</th>
<th class="text-right">Salary Range (LPA)</th>
</tr>
</thead>
<tbody>
<?php foreach ($states as $state): ?>
<?php
$score = $stateSalaryScore[$state->name] ?? 50;
$minMonthly = $avgSalaryRange[0] * ($score / 50);
$maxMonthly = $avgSalaryRange[1] * ($score / 50);
$minLPA = toLPA($minMonthly);
$maxLPA = toLPA($maxMonthly);
?>
<tr>
<td>
<a href="<?= route()->url('frontend.templates.location', [
'templateId' => $template->id,
'locationId' => $state->id
]) ?>">
<?= $state->name ?>
</a>
</td>
<td class="text-right">
₹<?= $minLPA ?> LPA – ₹<?= $maxLPA ?> LPA
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<!-- LISTINGS BY TAGS -->
<h2 class="card-header m-0 pl-0 pr-0 fw-900">Listings by Tags</h2>
<?= template()->include('frontend/custom/jobs/partials/recommended-listings', [
'recommendedListings' => App\Models\Listing::withTagsIntersect(['apprentice', 'bank-jobs'], 5),
]) ?>
<!-- RECOMMENDED LISTINGS -->
<h2 class="card-header m-0 pl-0 pr-0 fw-900">Recommended Listings</h2>
<?= template()->include('frontend/custom/jobs/partials/similar-listings', [
'recommendedListings' => $template->recommendedListings(5, true)
]) ?>
</div>
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.