<!DOCTYPE html>
<html>
  <head>
    <title>Job Applicants Report</title>
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.9.1/build/cssreset/cssreset-min.css">
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.9.1/build/cssbase/cssbase-min.css">
    <style type="text/css">
      #page {
        width: 1200px;
        margin: 30px auto;
      }
      .job-applicants {
        width: 100%;
      }
      .job-name {
        text-align: center;
      }
      .applicant-name {
        width: 150px;
      }
    </style>
  </head>
  <body>
    <div id="page">
      <table class="job-applicants">
        <thead>
          <tr>
            <th>Job</th>
            <th>Applicant Name</th>
            <th>Email Address</th>
            <th>Website</th>
            <th>Skills</th>
            <th>Cover Letter Paragraph</th>
          </tr>
        </thead>

		
	    <tbody>
<?php $__currentLoopData = $jobs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $job): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
		  <!-- <?php echo e($job->name); ?> -->
		  <tr>
            <td rowspan="<?php echo e($job->skill_count); ?>" class="job-name"><?php echo e($job->name); ?></td><?php $__currentLoopData = $job->applicants; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $applicant): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(!($loop->first)): ?>
		  <tr><?php endif; ?>		  
			<td rowspan="<?php echo e(sizeof($applicant->skills)); ?>" class="applicant-name"><?php echo e($applicant->name); ?></td>
            <td rowspan="<?php echo e(sizeof($applicant->skills)); ?>"><a href="mailto:<?php echo e($applicant->email); ?>"><?php echo e($applicant->email); ?></a></td>
            <td rowspan="<?php echo e(sizeof($applicant->skills)); ?>"><a href="<?php echo e($applicant->website); ?>"><?php echo e(preg_replace('/.*\/\/(.*)/', '$1', $applicant->website)); ?></td>
            <td><?php echo e($applicant->skills[0]->name); ?></td>
            <td rowspan="<?php echo e(sizeof($applicant->skills)); ?>"><?php echo e($applicant->cover_letter); ?></td>
          </tr>
<?php for($z = 1; $z<sizeof($applicant->skills); $z++): ?>
			<tr>
			  <td><?php echo e($applicant->skills[$z]->name); ?></td>
			</tr>
<?php endfor; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>		  <!-- <?php echo e($job->name); ?> -->
			
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
		
        </tbody>

		
        <tfooter>
          <tr>
            <td colspan="6"><?php echo e($applicant_count); ?> Applicants, <?php echo e($unique_skills_count); ?> Unique Skills</td>
          </tr>
        </tfooter>
      </table>
    </div>
  </body>
</html>

