File: /var/www/nclive/wp-content/plugins/nc_plugin/nc_exams.php
<?php
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
// $keys = parse_url($actual_link); // parse the url //$path = explode("/", $keys['path']); // splitting the path // $url_slug = $filterUrl[4];
$url_slug = basename($actual_link);
global $wpdb;
$TT_EXAM = "sp_exam";
$TT_EXAM_LINKS = "sp_exam_links";
$TT_EXAM_CATEGORY = "sp_exam_category";
$TT_EXAM_ENTITY = "sp_exam_entity";
$TT_QUALIFICATION = "sp_qualification";
$TT_EXAM_PATTERN = "sp_exam_pattern";
$TT_EXAM_UPLOADS = "sp_exam_uploads";
$TT_EXAM_CUTOFF = "sp_exam_cutoff";
$TT_PHYSICAL_ELIGIBILITY = "sp_physical_eligibility";
$TT_VACANCY_DETAIL = "sp_vacancy_detail";
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
/*********** query to get data as per url slug for notification ***********/
$getExam = $wpdb->get_row("SELECT e.exam_id, e.exam_name, e.post_name, e.exam_year, e.exam_summary, e.url_slug,e.qualification_id, e.qualification_desc, e.age_to, e.age_from, e.age_desc, e.fee, e.fee_desc, e.physical, e.total_vacancy, e.total_time, e.total_marks, e.negative_marking, e.other_info_tabname, e.exam_mode, e.other_info, e.sp_exam_id, e.off_web_link, e.important_notes, c.img_icon FROM $TT_EXAM as e LEFT JOIN $TT_EXAM_CATEGORY as c ON c.cat_id=e.cat_id WHERE e.status!='0' and e.url_slug='$url_slug'");
if ($getExam) {
$examId = $getExam->exam_id;
$qualiId = $getExam->qualification_id;
$ageto = $getExam->age_to;
$agefrom = $getExam->age_from;
$fee = $getExam->fee;
if ($ageto != '0' && $agefrom != '0') {
$age = $ageto . ' - ' . $agefrom . ' Years';
} else if ($ageto != '0' && $agefrom == '0') {
$age = 'Min ' . $ageto . ' Years';
} else if ($ageto == '0' && $agefrom != '0') {
$age = 'Max ' . $agefrom . ' Years';
} else {
$age = '';
}
if ($fee != '') {
$fees = '₹. ' . $fee . '/-';
} else {
$fees = '';
}
/*********** query to show link and entity and important date and links * ***********/
$linksData = $wpdb->get_results("SELECT l.exam_id, l.entity_id, l.display_text, l.display_text_dates, l.description, l.links, l.date_type, l.date, n.name FROM $TT_EXAM_LINKS as l LEFT JOIN $TT_EXAM_ENTITY as n ON n.id=l.entity_id WHERE n.status!='0' and exam_id='$examId' order by n.display_order asc");
/*********** query to show qualification data ***********/
$quali_name = $wpdb->get_var("SELECT quali_name FROM $TT_QUALIFICATION WHERE status!='0' and qualification_id='$qualiId'");
/*********** Post Wise Vacancy Detail ***********/
$getPostVacancy = $wpdb->get_results("SELECT type_name, gen, obc, sc, st, ebc, wbc, total_vac, age_limit, eligibility FROM $TT_VACANCY_DETAIL WHERE exam_id='$examId'");
$postCount = $wpdb->num_rows;
?>
<!-- EXAM DETAILS HEADER PAGE SECTION -->
<!-- Preload the LCP image with a high fetchpriority so it starts loading with the stylesheet. -->
<link rel="preload" fetchpriority="high" as="image" href="/images/exam-detail-banner.webp" type="image/webp">
<section class="ExamDetailsHeaderPage">
<div class="ExamDetailsHeaderPagebg"></div>
<div class="container">
<div class="row">
<div class="col-md-9 col-sm-9 col-xs-12">
<div class="ExamDetailsHeaderFlex">
<?php if ($getExam->img_icon != '') { ?>
<img src="/images/<?php echo $getExam->img_icon; ?>" width="95" height="95" alt="<?php echo $getExam->exam_name; ?>">
<?php } ?>
<div class="ExamDetailsHeaderDetails">
<h2><span>Exam Name:-</span><?php echo $getExam->exam_name; ?> </h2>
<?php if ($getExam->total_vacancy != '') { ?>
<h2><span>Total no. of Vacancies:-</span> <?php echo $getExam->total_vacancy; ?></h2>
<?php } ?>
<p><span>Exam Summary</span> <?php echo $getExam->exam_summary; ?> </p>
</div>
</div>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<h4>
<span>Share this link via</span>
<a name="fb_share" type="button" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $actual_link; ?>" aria-label="Facebook Share"><i class="fab fa-facebook-f" style="background: #1674ea;"></i></a>
<a href="http://twitter.com/share?text=Visit the link &u=<?php echo $actual_link; ?>" aria-label="Facebook Share"><i class="fab fa-twitter" style="background: #1c9cea;"></i></a>
<!-- <a name="fb_share" type="button" href="https://www.facebook.com/sharer.php?href=rt&t=123"><i class="fab fa-facebook-f" style="background: #1674ea;"></i></a> -->
<a href="https://wa.me/?text=<?php echo $actual_link; ?>%0A%0AUpdates%20for%20Govt%20Central%20%26%20State%20Level%20Exams:%0A%0AJoin%20Our%20Channel%0Ahttps://whatsapp.com/channel/0029VacCcxmLdQeYGD28oS3u" target="_blank">
<i class="fab fa-whatsapp" style="background: #25d366;"></i>
</a>
</h4>
</div>
</div>
</div>
</section>
<!-- END EXAM DEATILS HEADER PAGE SECTION -->
<!-- EXAM DETAILS PAGE SECTION -->
<section class="ExamDetailsPageSection">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="EligibilityBox">
<h4>Eligibility / Fee Structure</h4>
<ul id="custom-scroll">
<li>
<i class="far fa-user"></i>
<h5>
Age Criteria
<b><i class="fa fa-user-edit"></i> <?php echo $age; ?></b>
<span><?php echo $getExam->age_desc; ?></span>
</h5>
</li>
<li>
<i class="fa fa-graduation-cap"></i>
<h5>
Qualifications
<b><i class="fa fa-user-graduate"></i> <?php echo $quali_name; ?></b>
<span><?php echo $getExam->qualification_desc; ?></span>
</h5>
</li>
<li>
<i class="fa fa-rupee-sign"></i>
<h5>
Fee
<b><i class="fa fa-money-bill"></i> <?php echo $fees; ?></b>
<span><?php echo $getExam->fee_desc; ?></span>
</h5>
</li>
</ul>
</div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="ImportantDatesBox">
<h3>Important Dates</h3>
<ul id="custom-scroll">
<?php foreach ($linksData as $link) {
if ($link->date_type == 'FT') {
$split_date = preg_split('/,+/', $link->date);
$date1 = $split_date[0];
$startDate = date('j M Y', strtotime($date1));
$date2 = $split_date[1];
$endDate = date('j M Y', strtotime($date2));
$datetype = ' From ' . $startDate . ' To ' . $endDate;
} else if ($link->date_type == 'T') {
$datetype = $link->date;
} else if ($link->date_type == 'N') {
$datetype = date('jS M Y', strtotime($link->date));
}
if ($link->date != '') {
?>
<li>
<i class="fas fa-angle-double-right"></i>
<h4>
<?php if ($link->display_text_dates != '') {
echo $link->name . '<span class="link-name">' . $link->display_text_dates . '</span>';
} else {
echo $link->name;
} ?>
<span> <i class="fas fa-calendar-alt"></i> <?php echo $datetype; ?></span>
</h4>
</li>
<?php }
} ?>
</ul>
</div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="ImportantLinksBox">
<h3>Important Links</h3>
<ul id="custom-scroll">
<?php foreach ($linksData as $links) {
if ($links->links != '') { ?>
<li>
<h4>
<i class="fa fa-file-text "></i> <?php if ($links->display_text != '') {
echo $links->name . '<span class="link-name linktxt">' . $links->display_text . '</span>';
} else {
echo $links->name;
} ?>
</h4>
<a href="<?php echo $links->links; ?>" target="_blank">Click Here</a>
</li>
<?php }
} ?>
<?php if ($getExam->off_web_link != '') { ?>
<li>
<h4><i class="fa fa-file-text"></i> Official Website</h4>
<a href="<?php echo $getExam->off_web_link; ?>" target="_blank">Click Here</a>
</li>
<?php } ?>
<li>
<h4><i class="fab fa-whatsapp"></i> WhatsApp Channel</h4>
<a href="https://whatsapp.com/channel/0029VacCcxmLdQeYGD28oS3u">Click Here</a>
</li>
</ul>
</div>
</div>
<?php if ($getExam->other_info_tabname != '') { ?>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="PostWiseVacancyDetailsBox">
<h4><?php echo $getExam->other_info_tabname; ?></h4>
<div class="table-responsive p-10">
<?php echo $getExam->other_info; ?>
</div>
</div>
</div>
<?php } ?>
<!-- <div class="col-md-12 col-sm-12 col-xs-12">
<img style="width: 100%;height: 190px;margin-top: 2em;background: whitesmoke;" src="https://sarkaripariksha.com/ticket_bck/banners/1672732201-banner.png" alt="">
</div> -->
<?php if ($postCount > 0) { ?>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="PostWiseVacancyDetailsBox">
<h4>Post Wise Vacancy Details</h4>
<div class="table-responsive">
<table border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<th>Post Name</th>
<th>Area</th>
<th>GEN</th>
<th>EWS</th>
<th>OBC</th>
<th>MBC</th>
<th>SC</th>
<th>ST</th>
<th style="width: 3%;">Total Post</th>
<th style="width: 6%;">Age Limit</th>
<th style="width: 10%;">Qualification</th>
</tr>
<?php foreach ($getPostVacancy as $post) { ?>
<tr>
<td colspan="1" rowspan="2"><strong><?php echo $post->type_name; ?></strong></td>
<td><strong>General</strong></td>
<td><strong><?php echo $post->gen; ?></strong></td>
<td><strong><?php echo $post->ebc; ?></strong></td>
<td><strong><?php echo $post->obc; ?></strong></td>
<td><strong><?php echo $post->wbc; ?></strong></td>
<td><strong><?php echo $post->sc; ?></strong></td>
<td><strong><?php echo $post->st; ?></strong></td>
<td><strong><?php echo $post->total_vac; ?></strong></td>
<td colspan="1" rowspan="2"><strong><?php echo $post->age_limit; ?></td>
<td colspan="1" rowspan="2"><strong><?php echo $post->eligibility; ?></strong></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</section>
<section class="ad_horizontal">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12 text-center">
<!-- Display-Horizontal-Full -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-2967295438144070"
data-ad-slot="7766773989"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
</div>
</section>
<style>
.link-name {
display: block !important;
line-height: normal;
/* padding: 4px 10px; */
font-size: 10px;
border-radius: 4px;
margin-right: 10px;
color: #292929 !important;
}
.linktxt {
margin-left: 4em;
}
.p-10 {
padding: 10px !important;
}
</style>
<!-- END EXAM DETAILS PAGE SECTION -->
<?php
} //end of if check for exam data
?>