<?
session_start();
if(!isset($_SESSION['usuario']))
{
 	echo "<script languaje='JavaScript'>";       
	echo "parent.location.href='login.php'; ";
	echo "</script>";
}
include ("clases/Usuario.class.php"); $obju = new Usuario();
include ("clases/Afiliado.class.php"); $obja = new Afiliado();
include ("clases/Acuerdos.class.php"); $objf = new Acuerdos();
include ("clases/Votos.class.php"); $objv = new Votos();

$idafi = $_REQUEST['ida'];
$idacuerdo = $_REQUEST['idacuerdo'];
if($objv->BuscarPorAfiliado($idacuerdo,$idafi))
{
   $voto = $objv->getvoto();
   if($voto==1){
       $marcacion = "A FAVOR";
   }else{
   			$marcacion = "EN CONTRA";
        }
}
if($objf->BuscarPorCodigo($idacuerdo))
{
    $acuerdo = $objf->getacuerdo();
	$fecha = $objf->getfecha();
}

if($obja->BuscarPorCodigo($idafi))
   {
     $dni = $obja->getdni()."/".$obja->getruc();;
     $nombres = $obja->getnombres();
	 $apellidos = $obja->getapepat()." ".$obja->getapemat();
	 $fechanac = $obja->getfechanac();
	 $lugarnac = $obja->getlugarnac();
	 $ocupacion = $obja->getocupacion();
	 $gradoins = $obja->getgradoins();
	 $estadocivil = $obja->getestadocivil();
	 $fecha_afilia = $obja->getfecha_afilia();
	 $sangre = $obja->getsangre();
	 $foto = $obja->getfoto();
   }
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <!-- This file has been downloaded from Bootsnipp.com. Enjoy! -->
    <title>Simple User Profile  - Bootsnipp.com</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="media/css/bootstrap.css">
	<link rel="stylesheet" href="media/css/bootstrap.min.css">
	<link rel="stylesheet" href="media/css/bootstrap-theme.css">
	<link rel="stylesheet" href="media/css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="media/css/dataTables.bootstrap.min.css">
	<link rel="stylesheet" href="media/css/fixedHeader.bootstrap.min.css">
	<link rel="stylesheet" href="media/css/responsive.bootstrap.min.css">
	 <script src="media/js/jquery-1.10.2.js"></script>
	<script src="media/js/jquery.dataTables.min.js"></script>
	<script src="media/js/dataTables.bootstrap.min.js"></script>
	<script src="media/js/dataTables.fixedHeader.min.js"></script>
	<script src="media/js/dataTables.responsive.min.js"></script>
	<script src="media/js/responsive.bootstrap.min.js"></script>
	
	<script src="media/js/jquery.min.js"></script>
    <script src="media/js/bootstrap.min.js"></script>
	<script>
	   function deacuerdo(f)
	   {
	      f.voto.value=1;
		  f.action = 'VotoController.php';
		  f.submit();
		  return true;
	   }
	   
	   function encontra(f)
	   {
	      f.voto.value=0;
		  f.action = 'VotoController.php';
		  f.submit();
		  return true;
	   }
	</script>
</head>
<body>
<div class="container"> 
          <div class="col-md-12">
        <h4>En hora buena  Sr(a): <?php echo $nombres." ".$apellidos;?>  <a href="contenido.php"  type="button" class="btn btn-sm btn-danger"><i class="glyphicon glyphicon-log-out"></i> Salir</a></h4>
        
		 <div class="row">
		  <div class="form-group">
		    <div class="col-md-10">
			   <h3>Ud. ha emitido su voto correctamente al siguiente acuerdo: </h3>
			</div>
		  </div>
		 </div>
	
<form name="form1" method="post">
                
              <table width="1020" class="table-responsive table-borderd" id="mytable">
                   
                   <thead>
                <th width="75%"><input type="hidden" name="idafiliado" value="<?=$idafi;?>">
                  <input type="hidden" name="voto"></th>
                       <th width="25%"><input type="hidden" name="txtpara" value="R"></th>
                <tbody>
    <?
	 // $lista = $objf->ListarPublicado();
	 // for($i=0;$i<count($lista); $i++)
	  //{
	?>
    <tr>
    <td colspan="2"><h2><?=$acuerdo." (".$fecha.")";?>
    </h2>      </td>
    </tr>
	<tr>
    <td><h4>Su marcacion fue:</h4> <input type="button" name="Submit" value="<?=$marcacion;?>" class="btn btn-info btn-lg" disabled="disabled"></td>
    <td>&nbsp;</td>
	</tr>
   <?// } ?> 
    </tbody>
</table>
</form>

<div class="clearfix"></div>

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



<div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true">
      <div class="modal-dialog">
    <div class="modal-content">
          <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>
        <h4 class="modal-title custom_align" id="Heading">Edit Your Detail</h4>
      </div>
          <div class="modal-body">
          <div class="form-group">
        <input class="form-control " type="text" placeholder="Mohsin">
        </div>
        <div class="form-group">
        
        <input class="form-control " type="text" placeholder="Irshad">
        </div>
        <div class="form-group">
        <textarea rows="2" class="form-control" placeholder="CB 106/107 Street # 11 Wah Cantt Islamabad Pakistan"></textarea>
    
        
        </div>
      </div>
          <div class="modal-footer ">
        <button type="button" class="btn btn-warning btn-lg" style="width: 100%;"><span class="glyphicon glyphicon-ok-sign"></span> Update</button>
      </div>
        </div>
    <!-- /.modal-content --> 
  </div>
      <!-- /.modal-dialog --> 
</div>
    
    
    
    <div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true">
    <script type="text/javascript">
$(document).ready(function() {
    var panels = $('.user-infos');
    var panelsButton = $('.dropdown-user');
    panels.hide();

    //Click dropdown
    panelsButton.click(function() {
        //get data-for attribute
        var dataFor = $(this).attr('data-for');
        var idFor = $(dataFor);

        //current button
        var currentButton = $(this);
        idFor.slideToggle(400, function() {
            //Completed slidetoggle
            if(idFor.is(':visible'))
            {
                currentButton.html('<i class="glyphicon glyphicon-chevron-up text-muted"></i>');
            }
            else
            {
                currentButton.html('<i class="glyphicon glyphicon-chevron-down text-muted"></i>');
            }
        })
    });


    $('[data-toggle="tooltip"]').tooltip();

    $('button').click(function(e) {
        e.preventDefault();
        alert("This is a demo.\n :-)");
    });
});
</script>
</body>
</html>
