

<?php
$abso = str_replace("\\","/", FCPATH);
$virt = str_replace("\\","/", base_url());	
if($summary) {
	?>	
	<div class="summary-wrapper m-1-t p-1" id="summary_wrapper">
		<h3 class="summary-title m-1-b"><?php echo $lines['vote_summary']; ?></h3>
		<div class="row"><div class="col-xs-12 text-red" id="message"></div></div>
		<table class="table summary-table" id="summary_table">
			<thead>
				<tr>
					<th class="col-xs-1 text-center">No.</th>
					<th class="col-xs-4 text-left"><?php echo $lines['line_position']; ?></th>
					<th class="col-xs-7 text-left"><?php echo $lines['line_candidate']; ?></th>
				</tr>
			</thead>
			
			<tbody>
			<?php
			$p = 1;
			foreach($summary as $position=>$candidates) {
				?>
				<tr>
					<td class="col-xs-1 text-center"><?php echo $p; ?></td>
					<td class="col-xs-4 text-left"><?php echo $position; ?></td>
					<td class="col-xs-7 text-left">
					<?php
					if($candidates) {
						echo "<ul class=\"voted-list\">";
						foreach($candidates as $candidate => $value) {
							$image = $virt."dist/img/_sys/user.png";
							if($value['picture'] && file_exists($abso."img/candidate/".$value['picture'])) $image = $virt."img/candidate/".$value['picture'];
							
							echo "<li class=\"voted-item\">";
								echo "<div class=\"voted-img\"><img src=\"".$image."\" class=\"img-responsive-reverse\" /></div>";
								echo "<div class=\"voted-name\">".$candidate." (".$value['companyName'].")</div>";
							echo "</li>";
						}
						echo "</ul>";
					}
					?>
					</td>
					<td class="col-xs-4 text-left"><?php //echo $companyName; ?></td>
				</tr>
				<?php
				$p++;
			}
			?>
			</tbody>
		</table>
	</div>
	<?php
}
?>

<div class="row">
	<div class="col-xs-12 p-xs-0 p-5-x p-1-y text-center"> 
		<button type="button" class="btn btn-danger p-xs-1-x p-xs-0-y p-3-x p-1-y font-18" data-toggle="modal" data-target="#retake_voting_modal">
			<i class="fa fa-reply"></i>&nbsp;&nbsp;<?php echo $this->lang->line('vote_retake'); ?>
		</button>
		<div class="hidden-md hidden-lg hidden-xl p-1-y"></div>
		
		<button type="button" class="btn btn-warning p-xs-1-x p-xs-0-y p-1 font-18" onclick="return loadSegment(2,0);" id="refresh_button">
			<i class="fa fa-refresh"></i>
			<span class="hidden-sm hidden-md hidden-lg hidden-xl">&nbsp;&nbsp;<?php echo $this->lang->line('vote_refresh'); ?></span>
		</button>
		<div class="hidden-md hidden-lg hidden-xl p-1-y"></div>
		
		<button type="button" class="btn btn-primary p-xs-1-x p-xs-0-y p-3-x p-1-y font-18" data-toggle="modal" data-target="#confirm_voting_modal">
			<i class="fa fa-mail-forward"></i>&nbsp;&nbsp;<?php echo $this->lang->line('vote_confirm'); ?>
		</button>
	</div>
</div>















