File: D:/HostingSpaces/SBogers10/promic.komma.pro/wwwroot/app/views/partials/employeesList.php
<?php
// Contains all configuration for employees
include_once $_SERVER['DOCUMENT_ROOT'] . '/app/config/employees.php';
function slugify($text)
{
// replace non letter or digits by -
$text = preg_replace('~[^\pL\d]+~u', '_', $text);
// transliterate
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
// remove unwanted characters
$text = preg_replace('~[^-\w]+~', '', $text);
// trim
$text = trim($text, '-');
// remove duplicate -
$text = preg_replace('~-+~', '-', $text);
// lowercase
$text = strtolower($text);
if (empty($text)) {
return 'n-a';
}
return $text;
}
// Language variable should be set
if(isset($taalVar))
{
$count = 0;
foreach($employees as $key => $employee)
{
$break = false;
// First enter is after 3 employees
if($count == 3) $break = true;
if(($count-3) % 4 == 0) $break = true;
?>
<li <?php if($break){ ?> class="leftSide" <?php } ?> >
<?php if($count == 0){ ?> <div class="shadowMiddle"></div> <?php } ?>
<?php if($break){ ?> <div class="shadow"></div> <?php } ?>
<div class='content' style='background-image: url("/img/employees/<?php echo slugify($employee['first_name']. '_'.$employee['last_name']); ?>.jpg");'></div>
<div class="info">
<span class="name"> <?php echo $employee['first_name']; ?> <?php echo $employee['last_name']; ?></span>
<span class="function">
<?php echo $employee['function']; ?>
<?php if(isset($employee['days_available']) && $employee['days_available'] != '' ){ ?>
<br/>
(<?php echo $employee['days_available']; ?>)
<?php } ?>
</span>
</div>
</li>
<?
$count++;
}
}