<?php
	// Assets::add( 'select2' );
	// Assets::add( 'courses.min.js' );
	// Assets::add( 'courses.css' );
	// AMIB::add_js_translation( trans( 'course.js-msgs' ) );
?>
<?php $__env->startSection( 'head' ); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection( 'content' ); ?>
	<table class="default">
		<thead>
			<tr>
				<th>رتبه</th>
				<th>تراز</th>
				<th>نام و نام خانوادگی</th>
				<?php foreach( $exam->Lessons as $lesson ): ?>
					<th style="writing-mode: sideways-lr;"><?php echo $lesson->name; ?></th>
				<?php endforeach; ?>
			</tr>
		</thead>
		<tbody>
			<?php foreach( $results as $row ): ?>
				<?php $raw_results = @json_decode( $row->pivot->raw_results ); ?>

				<?php if( is_null( $raw_results ) || false == property_exists( $raw_results, 'total_rank' ) ) continue; ?>

				<tr>
					<td><?php echo en2fa( $raw_results->total_rank ); ?></td>
					<td><?php echo en2fa( $raw_results->total_taraz ); ?></td>
					<td><?php echo e($row->full_name); ?></td>
					<?php foreach( $exam->Lessons as $lesson ): ?>
						<td>&lrm;<?php echo en2fa( round( $raw_results->lessons->{$lesson->id}->mark, 2 ) ); ?></td>
					<?php endforeach; ?>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
<?php $__env->stopSection(); ?>