 			<div class="navbar navbar-fixed-top">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="<?php echo base_url(); ?>">E-Voting Musyda PDPM Kab. Pekalongan </a>
                </div>
                <div class="navbar-collapse collapse navbar-responsive-collapse">

                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="javascript:void(0)">Assalamu'alaikum, <?php echo $this->session->userdata('username') ; ?> </a></li>
                        <li><a href="javascript:void(0)"></a></li>
                    </ul>
                </div>
            </div>

			<?php echo form_open('vote/pilih', ' class="form-horizontal"'); ?>
			<script>
				var _pemilih = 0;				
			</script>

            <div class="navbar-default navbar-static-side" role="navigation">
                <div class="sidebar-collapse">
                    <ul class="nav"  id="side-menu">
                        						
							<div align="center">
								<img src="<?php echo base_url(); ?>/dist/img/logo.png" class="logo-pilih"/>
							
							<div class='label label-primary' align='center'> Daftar Calon Dipilih</div> </div>
							<br> <br>
							<ol id="pilihan">
							</ol>
							</div>
							<div align="center">
								<div data-toggle="modal" data-target=".btnReset"class="btn btn-info  btn-xs">Reset</div>
								<div id="piliha" data-toggle="modal" data-target=".btnPilih" class="btn btn-success btn-xs disabled">Submit</div>
								<div data-toggle="modal" data-target=".btnGolput" class="btn btn-danger  btn-xs">Cancel</div>
							</div>

                    </ul>
                    <!-- /#side-menu -->
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        
        
        
<div id="page-wrapper">
    <div class="row">
    	
        <div class="col-lg-20 pilih isi" align="Center">

			
		<?php foreach($calon->result_array() as $c) { ?>
            <div class="col-lg-4">
              
               <div class="bs-component">
                    <div class="list-group">
                        <div class="row-content">
						<div class="list-group-item" id="btn<?php echo $c['id'] ?>">
						   
                    <div class="row-thumbnail" height="100" width="100" > 
                       
                              <img style="width: 30%; height: 30%" align="left" class="square"  src="<?php echo base_url(); ?>dist/img/<?php echo $c['foto'] ?>" alt="icon"  > 
								</div> 
							
                        	<div><pre><h2><b><?php echo $c['id'] ?></b></h2><h3><div class='label label-primary' id="pilih<?php echo $c['id']?>" ><?php  echo  $c['nama']?></pre></div> 
                            </div>
                        </div>
						
                    </div>
                </div>
                <script>
                $(document).ready(function(){
                    var pi<?php echo $c['id'] ?> = 0;
                    $("#btn<?php echo $c['id'] ?>").click(function(){
							if(pi<?php echo $c['id'] ?>==0){
								if(_pemilih>8){ //Ganti untuk membatasi jumlah yang dipilih (rumus: jumlah -1)
									alert("Anda sudah memilih 9 Formatur silahkan hapus salah satu jika ingin mengganti pilihan, Terimakasih");
								} else {
									$("#pilih<?php echo $c['id'] ?>").attr("class", "label label-warning");
									$("ol").append("<li id='pil<?php echo $c["id"] ?>'><?php echo "<input type='hidden' name='pilih[]' value='".$c['id']."'/>".$c['nama'] ?></li>");
									pi<?php echo $c['id'] ?> = 1;
									_pemilih = _pemilih+1;
									if(_pemilih==9){ //jumlah dipilih
										$("#piliha").attr("class", "btn btn-success btn-xs");
									} else {
										$("#piliha").attr("class", "btn btn-success btn-xs disabled");								
									}
								}
								
							} else {
								$("#pilih<?php echo $c['id'] ?>").attr("class", "label label-primary");
								$("#pil<?php echo $c['id'] ?>").remove();
								pi<?php echo $c['id'] ?> = 0;
								_pemilih = _pemilih-1;
								if(_pemilih==9){ //jumlah formatur dipilih
									$("#piliha").attr("class", "btn btn-success btn-xs");
								} else {
									$("#piliha").attr("class", "btn btn-success btn-xs disabled");
								}
							}
                    });
                });
                </script>
            </div>  
        <?php } ?>
            
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
</div>
<!-- /#page-wrapper -->

	<div class="modal fade btnPilih" tabindex="-1" role="dialog" aria-hidden="true" align="center">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">Tentukan Pilihan</h4>
				</div>

				<div class="modal-body">
					<div class="form-group">
						<p>Apakah sudah yakin dengan pilihan anda ? Jika Sudah Yakin, Silahkan Klik "OK", </p>
						<button type="button" class="btn btn-primary" data-dismiss="modal">Kembali</button>
						<button type="submit" class="btn btn-success">OK</button>
					</div>
				</div>

			</div>
		</div>
	</div>

    <?php echo form_close(); ?>
	
		<div class="modal fade btnGolput" tabindex="-1" role="dialog" aria-hidden="true" align="center">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
						</button>
						<h4 class="modal-title" id="myModalLabel">Ingin Keluar ?</h4>
					</div>

					<div class="modal-body">
						<div class="form-group">
							<p>Yakin ingin keluar ? Pilihan Anda akan kami hapus.</p>
							<div class="btn btn-primary" data-dismiss="modal">Close</div>
							<a href="<?php echo site_url().'/vote/pilihNo'; ?>" class="btn btn-success">Keluar Tanpa Memilih</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	
		<div class="modal fade btnReset" tabindex="-1" role="dialog" aria-hidden="true" align="center">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
						</button>
						<h4 class="modal-title" id="myModalLabel">Ingin Reset ?</h4>
					</div>

					<div class="modal-body">
						<div class="form-group">
							<p>Yakin ingin reset Pilihan anda ? Pilihan Anda akan kami Reset.</p>
							<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
							<button type="submit" id="reset" class="btn btn-success" data-dismiss="modal">Reset</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	

		<script>
		$(document).ready(function(){
			$("#reset").click(function(){
				$("#pilihan").empty();
				location.reload();
			});
		});
		</script>		

    </body>
</html>
                