
<?php
$CI =& get_instance();
$_c = strtolower($CI->router->fetch_class());
$_a = strtolower($CI->router->fetch_method());

if($projectID = $this->session->userdata('projectID')) {
	$CI->lang->load('header', $CI->session->userdata('language'));
	$CI->lang->load('project', $CI->session->userdata('language'));
	$CI->load->model('project/projectmain','projmain');
	$CI->load->model('header_model');
	
	$a = $CI->header_model->getVoter();
	$b = $CI->header_model->getCompany();
	$c = $CI->header_model->getDesignation();
	$d = $CI->header_model->getCandidate();
	$e = $CI->header_model->getVote();
	$f = $CI->header_model->getBlock();

	$project = $CI->projmain->getProject($projectID);
	$progress = array(
		'voter' => (($t = $a[0]->totalVoter) ? $t : 0),
		'entity' => (($t = $b[0]->totalCompany) ? $t : 0),
		'designation' => (($t = $c[0]->totalPosition) ? $t : 0),
		'candidate' => (($t = $d[0]->totalCandidate) ? $t : 0),
		'vote' => (($t = $e[0]->totalVote) ? $t : 0),
		'block' => (($t = $f[0]->totalBlock) ? $t : 0)
	);
	unset($a, $b, $c, $d, $e, $f, $t);
	
	?>
	<div class="content-wrapper progress-wrapper">
		<div class="progress">			
			<div class="progress-list">
			<?php
			if($progress) {
				$icon = array( 'voter' => 'fa-users', 'entity' => 'fa-building', 'designation' => 'fa-edit', 'candidate' => 'fa-files-o', 'vote' => 'fa-book', 'block' => 'fa-laptop' );
				$cont = array( 'voter' => "voter", 'entity' => "company", 'designation' => "position", 'candidate' => "candidate", 'vote' => "vote", 'block' => "block" );
				
				foreach($progress as $key=>$value) {
					?>
					<a class="progress-item col-md-2 <?php echo ($_c == $cont[$key]) ? "selected" : NULL; ?>" href="<?php echo base_url() . $cont[$key]; ?>">
						<div class="progress-item-wrap">
							<div class="progress-count"><span class="<?php echo (!$value && $key != 'block') ? "text-red" : NULL; ?>"><?php echo $value; ?></span></div>
							<div class="progress-name"><i class="fa <?php echo $icon[$key]; ?>"></i>&nbsp;<?php echo ucwords(strtolower($key)); ?></div>
							<div class="progress-next"><i class="fa fa-angle-double-right"></i></div>
						</div>
					</a>
					<?php
				}
			}
			?>
			</div>
			
			<div class="progress-project">
			<?php echo $this->lang->line('selDesc'); ?>
			<?php
			if($project) {
				?><br /><a href="<?php echo base_url(); ?>project/detail/<?php echo $project['ID']; ?>"><?php echo $project['title']; ?></a><?php
			} else {
				echo "-";
			}
			?>
			</div>
		</div>
	</div>
	<?php
}
?>







