Sign up |
I have two separate records set up, a company profile, and a list of jobs.
The idea is to be able to assign people to specific jobs, at the moment I have a list being generated in the Jobs section via the list field using mySQL query to display a list check-box of the respective employees.
Running through the standard process of the code generator I can get the selected names displayed. However I would like to link in their profile photos into the jobs page as well.
I have tried numerous methods of if statements, arrays and loops but no success just yet.
Is there anyway that you guys could think of that I could query the output of the jobs field with that of the profile pages
Project team (Labels): <?php echo join(', ', $record['project_team:labels']); ?
This is the field that generates the selected names, and seperates them with a comma.
Any suggestions would be greatly appreciated
Ok, I have made some progress, but still no cigar, the code almost works,
the for loop finds the first match fantastically, but doesnt find the rest of the matches in the foreach
Any ideas ?
<?php foreach ($corporatesRecords as $record): ?>
<h3><?php echo htmlencode($record['title']) ?></h3>
<?php $list = join(',', $record['project_team:labels']);
$array = explode(",", $list);
$count = count($array);
$arraynum = 0;
<?php foreach ($eunomix_teamRecords as $et): ?>
<?php for ($offset = 0; $et['name'] == $array[$offset]; $offset++ ): ?>
<?php echo htmlencode($et['name']) ?> <?php echo $offset?><br />
I think I need to see the front end result of this. Failing that, have you tried using showme() on the variables in each stage of the loops to see what exactly is going on with them? The fastest way to find out why something doesn't show up is to check what your variables are set to at the point where they should appear.