File: /var/www/vhosts/greenclinic.kz/newsite/wp-content/themes/green-clinic/page-vacancies.php
<?php
$i = 1;
$post_type = 'vacancies';
$myposts = get_posts( [
'posts_per_page' => -1,
'post_type' => $post_type,
] );
?>
<?php get_header(); ?>
<?php get_template_part( 'template-parts/content_header', 'none' ); ?>
<section class="section vacancies_section">
<div class="container">
<div class="vacancies-wrapper block1 visible">
<div class="vacancy__container">
<?php foreach($myposts as $mypost): ?>
<?php
$vac_id = $mypost->ID;
$date = get_field( 'date', $vac_id );
$text = get_field( 'date', $vac_id );
$title = get_the_title( $vac_id )
?>
<div class="vacancy__container-item">
<a href="<?php the_permalink($vac_id) ?>" >
<div class="vacancy__container-item-top">
<h3><?php echo esc_html($title); ?></h3>
<!--<svg class="open-close" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 11.25L9 6.75L4.5 11.25" stroke="#FFCA79" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>-->
</div>
<p>
<?php
// Get the current language
$current_language = wpm_get_language();
// Output the appropriate translation based on the current language
if ($current_language == 'ru') {
echo 'Вакансия опубликована';
} elseif ($current_language == 'kz') {
echo 'Бос жұмыс орны жарияланды';
} else {
echo "The vacancy has been published"; // Default to Russian or the original language
}
?>
<?php echo esc_html($date); ?></p>
<!--<div class="vacancy__container-item-details">
</ul>
</div>-->
</a>
</div>
<?php endforeach; ?>
</div>
<div class="vacancy__form"><?php echo do_shortcode('[contact-form-7 id="bcd0804" title=":ruВакансии:"]'); ?></div>
</div>
</div>
</section>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/5.0.8/jquery.inputmask.min.js" integrity="sha512-efAcjYoYT0sXxQRtxGY37CKYmqsFVOIwMApaEbrxJr4RwqVVGw8o+Lfh/+59TU07+suZn1BWq4fDl5fdgyCNkw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/imask/7.4.0/imask.min.js" integrity="sha512-8DS63sErg9A5zQEiT33fVNawEElUBRoBjCryGeufXJ82dLifenpXQDjbAM8MoTKm5NFZvtrB7DoVhOM8InOgkg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
(function($){
let vacancies = $('.vacancies-wrapper .vacancy__container-item');
$(vacancies).on('click', function(){
let vacanciesItem = $(this).find('.vacancy__container-item-details');
if(vacanciesItem.hasClass('visible')){
$(this).find('svg').removeClass('rotate');
$(vacanciesItem).removeClass('visible');
}else{
$(this).find('svg').addClass('rotate');
$(vacanciesItem).addClass('visible');
}
});
})(jQuery);
</script>
<script>
const vacancyFormSubmitBtn = document.querySelector(
".vacancy__form-submit-btn"
);
const labelSpan = document.getElementById("labelSpan");
// Используем селектор по id, чтобы получить доступ к полю ввода телефонного номера
var phoneInput = document.getElementById("phone-number");
// Создаем маску ввода для телефонного номера с помощью библиотеки imask.js
var phoneMask = IMask(phoneInput, {
mask: "+7 (000) 000-00-00",
lazy: false,
});
if (phoneInput.value[4] === "_") {
phoneInput.value = "Ваш телефон";
}
const formCheckbox = document.querySelector('#check-private input');
formCheckbox.addEventListener('click', function() {
const parentElement = formCheckbox.parentElement;
if (parentElement.classList.contains('checked')) {
parentElement.classList.remove('checked');
} else {
parentElement.classList.add('checked');
}
});
const textToWrap = document.querySelector('.section__znp_check span.wpcf7-list-item-label');
// Создаем новую ссылку
const link = document.createElement('a');
link.href = '/documents-licenses';
link.target = '_blank';
link.innerText = textToWrap.innerHTML.replace('Политики конфиденциальности', '');
textToWrap.innerHTML = '';
textToWrap.appendChild(link);
document.addEventListener('DOMContentLoaded', function() {
const detailsItems = document.querySelectorAll('.vacancy__container-item-details');
detailsItems.forEach((item, index) => {
const height = item.clientHeight;
const style = document.createElement('style');
style.textContent = `
.vacancy__container-item-details-${index + 1}.visible {
height: ${height}px;
}
`;
document.head.appendChild(style);
});
});
</script>
<?php get_template_part( 'blocks/blocks' ); ?>
<?php get_footer(); ?>