<body>
	<div class="headerprm" <?php if(!empty($warna))echo 'style="background-color:'.$warna.';"' ?>> 
		<div class="row text-center">
			<div class="col-lg-12">
				<p><br></p>
				<p><b><?=$subjudul?></b></p>
				<p><b>PERIODE <?=$periode?> </b></p>
			</div>
		</div>
	</div>
	<div class="content">
		<div class="container">
			<div class="row">
                <div class="col-lg-12">
                    <h2 class="page-header"></h2>
                </div>
                <?php
					foreach ($query->result() as $row) {
						if(empty($row->photo)) {
							$photo = "default.gif";
						} else {
							$photo = $row->photo;
						}
						echo'
							<div class="col-lg-4 col-sm-6 text-center">
								<div class="grid">
									<figure class="effect-zoe">
										<img src="'.site_url('/assets/img/photo/'.$photo).'" alt="img1" class="img-responsive img-thumbnail"/>
										<figcaption>
											<h2 style="font-size:20px;">'.$row->nama_calon.'</h2>
											<p class="icon-links">
												<a href="#vote-'.$row->id_calon.'" data-toggle="modal" data-id="'.$row->id_calon.'"><span class="icon-heart" ></span></a>
												<a href="#visimisi-'.$row->id_calon.'" data-toggle="modal" data-id="'.$row->id_calon.'"><span class="icon-eye"></span></a>
											</p>
										</figcaption>           
									</figure>
								</div>
							</div>
						';
					}
                ?>
            </div>
            <hr>
        </div>
    </div>
    <?php
        if(isset($query)) {
            foreach($query->result_array() as $row1) {
                if(empty($row1['photo'])) {
                    $photo1 = "default.gif";
                } else {
                    $photo1 = $row1['photo'];
				}
				?>
					<div class="modal fade" id="visimisi-<?php echo $row1['id_calon'] ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header" <?php if(!empty($warna))echo 'style="background-color:'.$warna.';"' ?>>
									<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									<h4 class="modal-title text-center" id="myModalLabel"><?php if(!empty($judulmodal))echo $judulmodal; ?></h4>
								</div>
								<div class="modal-body">
									<ul class="media-list">
										<li class="media">
											<a class="pull-right" href="#">
												<img class="media-object img-rounded" src="<?php echo base_url('/assets/img/photo/'.$photo1); ?>" style="width: 125px; height: 150px;">
											</a>
											<div class="media-body">
												<h4 class="media-heading"><?php echo strtoupper($row1['nama_calon']) ?></h4>
											</div>
										</li>
									</ul>
									<hr>
									<h1 class="text-center">Visi</h1>
									<?php echo $row1['visi'] ?>
									<h1 class="text-center">Misi</h1>
									<?php echo $row1['misi'] ?>
								</div>
								<div class="modal-footer">
									<?php if(!empty($subjudulmodal))echo $subjudulmodal; ?>
								</div>          
							</div>
						</div>
					</div>
					<div id="vote-<?php echo $row1['id_calon'] ?>" class="modal">
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header" <?php if(!empty($warna))echo 'style="background-color:'.$warna.';"' ?>>
									<a href="#" data-dismiss="modal" aria-hidden="true" class="close">×</a>
									<h3>Konfirmasi</h3>
								</div>
								<div class="modal-body">
									<p>Apakah anda yakin akan memilih : <strong><?php echo strtoupper($row1['nama_calon']); ?></strong> ?</p>
								</div>
								<div class="modal-footer">
									<button type="button" class="btn btn-danger" data-dismiss="modal">TIDAK</button>
									<a href="<?php echo base_url(); ?>user/home_user/vote/<?php echo $row1['id_calon'] ?>" type="button" class="btn btn-success">YA</a>
								</div>
							</div>
						</div>
					</div>
				<?php
			}
		}
	?>