<?php
defined('BASEPATH') OR exit('No direct script access allowed');

if(!($this->session->userdata('client'))){
 
  redirect ('/Login');



}

$datas=$this->session->userdata('client');
$datas = str_replace(' ', '%20', $datas);
$datas=trim($datas);

?><!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>AdminLTE 3 | User Profile</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <!-- Font Awesome -->
  <link rel="stylesheet"  href="<?php  echo base_url()."assets/"; ?>plugins/fontawesome-free/css/all.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet"  href="<?php  echo base_url()."assets/"; ?>dist/css/adminlte.min.css">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

  <style>
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  border: 1px solid #ddd;
}

th, td {
  text-align: left;
  padding: 16px;
}

tr:nth-child(even) {
  background-color: lightblue;
}
</style>
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
  <!-- Navbar -->
  <nav class="main-header navbar navbar-expand navbar-white navbar-light">
    <!-- Left navbar links -->
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
      </li>
     
    </ul>

    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <!-- Messages Dropdown Menu -->
      <li class="nav-item dropdown">
        <a href="<?php echo base_url()."index.php/Login/Log_Out/";?> " style=" color:white;font-weight:bolder" class="btn btn-info">LOGOUT</a>
      </li>
    </ul>
  </nav>
    </ul>
  </nav>
  <!-- /.navbar -->

  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->

    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="image">
           <img src="<?php  echo base_url()."assets/"; ?>dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
        </div>
        <div class="info">
          <a href="#" class="d-block"></a>
        </div>
      </div>

      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <!-- Add icons to the links using the .nav-icon class
               with font-awesome or any other icon font library -->
          <li class="nav-item has-treeview">
            <a href="<?php echo base_url();?>index.php/Login/show_data/ <?php echo $datas;?>" class="nav-link">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                PROFILE
                
              </p>
            </a>
          </li>
         
          <li class="nav-item">
            <a href="<?php echo base_url();?>index.php/Show_Voting_Data_Client/VotingTitlesDataClient/ <?php echo $datas;?>" class="nav-link">
              <i class="nav-icon far fa-image"></i>
              <p>
                Ballot
              </p>
            </a>
          </li>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <br><br><br>
  <div class="content-wrapper">
    <section class="content-header">
      <div class="container-fluid">

      
        <div class="row"> 
          <?php
                if (isset($data)) 
                { 
            ?>
         <h2 style="color:red;padding-left:30%;font-weight:bolder">WELCOME TO ONLINE VOTING FOR <span style="color:blue"> <?php echo $data[0]->ballot_name ?> </span> <br><br></h2> 
         <?php
                }
            ?>       
        </div> 
        <form action=" " method="POST">
        <div class="row">
        
            <?php
                if (isset($data)) 
                    foreach($data as $row)
                    {
            ?>
                <div class="col-md-4">
                    <!-- Widget: user widget style 1 -->
                    <div class="card card-widget widget-user">
                    <!-- Add the bg color to the header using any of the bg-* classes -->
                    <div class="widget-user-header bg-info">
                        <h1 class="widget-user-username" style="font-weight:900;"><?php echo $row->participant_name ?> </h1>  
                    </div>

                    <div class="widget-user-image">
                    <img class="img-circle elevation-2" src=" <?php echo $row->img_url; ?>" class="rounded"  alt="User Avatar">
                    </div>
                    <div class="card-footer">
                        <div class="row">
                        <div class="col-sm-4 border-right">
                            <div class="description-block">
                            
                            </div>
                            <!-- /.description-block -->
                        </div>
                        <!-- /.col -->
                        <div class="col-sm-4 border-right">
                            <div class="description-block">
                              <h3 class="description-header">Place &nbsp;:- &nbsp;<?php echo $row->place ?></h3> </br>
                            <span class="description-text"> 
                            <!-- <a href="<?php //echo base_url();?>index.php/Update_Voting/vote_update/?participant_name=<?php// echo $row->participant_name;?>&ballot_name=<?php //echo $data[0]->ballot_name ?>"  class="btn btn-primary btn-lg" style="color:white;"> vote </a> -->
                            <input type="hidden" id="ballot_name<?php echo $row->participant_name; ?>" name="" class="vote_link" value="<?php base_url();?>index.php/Update_Voting/vote_update/?participant_name=<?php echo $row->participant_name;?>&ballot_name=<?php echo $data[0]->ballot_name ?>">
							
							
							<input type="radio" id="castvote<?php echo $row->participant_name; ?>" class="castvote" value="<?php echo base_url();?>index.php/Update_Voting/vote_update/?participant_name=<?php echo $row->participant_name;?>&ballot_name=<?php echo $data[0]->ballot_name ?>">
                             </span>
                            </div>
                            <!-- /.description-block -->
                        </div>
                        <!-- /.col -->
                        <div class="col-sm-4">
                            <div class="description-block">
                            
                            </div>
                            <!-- /.description-block -->
                        </div>
                        <!-- /.col -->
                        </div>
                        <!-- /.row -->
                    </div>
                    </div>
                    <!-- /.widget-user -->
                </div>
                  <!-- /.col -->
                  <?php
                      }
                    else
                    { 

                  ?>
                  <h1> No Candidates found </h1>
                  <?php
                    
                    } 

                  ?>     
                </div>
                </form>

                <br>
                <h1 style="color:red"> <marquee behavior="scroll" direction="left"><?php echo "Your ip is being tracked:".$_SERVER['REMOTE_ADDR'] ;?></marquee> </h1>
                <!-- /.row -->
              </div>
            </div>
            <!-- /.widget-user -->
          </div>
          <!-- /.col -->
         
      </div>
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>


  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="float-right d-none d-sm-block">
      <b>Version</b> 3.0.5
    </div>
    <strong>Copyright &copy; 2014-2019 <a href="http://adminlte.io">BEDRE WEB SOLUTIONS</a>.</strong> All rights
    reserved.
  </footer>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script src="<?php  echo base_url()."assets/"; ?>plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="<?php  echo base_url()."assets/"; ?>plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="<?php  echo base_url()."assets/"; ?>dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php  echo base_url()."assets/"; ?>dist/js/demo.js"></script>
<script>
            $(".castvote").click(function () { 
             
				
				 window.location.href=$(this).val();
            }); 
  
</script>
</body>
</html>
