Template - Final Country Page
<?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' => 585,
'Arunachal Pradesh' => 552,
'Assam' => 528,
'Bihar' => 452,
'Chhattisgarh' => 486,
'Goa' => 702,
'Gujarat' => 662,
'Haryana' => 688,
'Himachal Pradesh' => 604,
'Jharkhand' => 468,
'Karnataka' => 756,
'Kerala' => 628,
'Madhya Pradesh' => 504,
'Maharashtra' => 785,
'Manipur' => 536,
'Meghalaya' => 542,
'Mizoram' => 558,
'Nagaland' => 548,
'Odisha' => 498,
'Punjab' => 648,
'Rajasthan' => 512,
'Sikkim' => 638,
'Tamil Nadu' => 724,
'Telangana' => 748,
'Tripura' => 472,
'Uttar Pradesh' => 526,
'Uttarakhand' => 614,
'West Bengal' => 574,
'Delhi' => 812,
'Jammu & Kashmir' => 596,
];
/**
* Convert monthly salary to LPA
*/
function toLPA($monthly)
{
return round(($monthly * 12) / 100000, 2);
}
?>
<?= template()->layout('frontend/layout') ?>
<?= template()->push('meta') ?>
<title>Government Jobs (<?= date('F Y') ?></title>
<meta name="description" content="Government Jobs (<?= date('F Y')?>)">
<?= template()->endPush() ?>
<div class="container">
<article>
<h1 class="card-header m-0 pl-0 pr-0 fw-900">
Government Jobs (<?= date('F Y') ?>)
</h1>
<p>Get latest government job notifications.</p>
</article>
<h2 class="card-header m-0 pl-0 pr-0 fw-900">
State-wise Apprentice Salary
</h2>
<!-- STATE SALARY TABLE -->
<table class="table tables-1">
<thead>
<tr>
<th>State</th>
<th class="text-right">Salary Range</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->generateSlug(),
'locationId' => $state->generateSlug('name'),
]) ?>">
<?= $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>
<?php
/*
Reference:
<?= $country->name ?>
*/
?>
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.