Ejemplo n.º 1
0
          });
          FB.Event.subscribe('auth.login', function(resp) {
              window.location = 'http://wdb.ugr.es/~jifernandez/index_iconos.php';
          });
        };
        (function(d){
           var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
           js = d.createElement('script'); js.id = id; js.async = true;
           js.src = "//connect.facebook.net/en_US/all.js";
           d.getElementsByTagName('head')[0].appendChild(js);
         }(document));
</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<?php 
$votaciones = get_users_all_votes_count($bd, $year);
$codigo_sql1 = "SELECT id,name,display_function FROM CATEGORIES_YEAR,CATEGORIES WHERE CATEGORIES_YEAR.category_id=CATEGORIES.id AND CATEGORIES_YEAR.year=" . $year;
$consulta1 = $bd->prepare($codigo_sql1);
$consulta1->execute();
?>
<!-- Inicio menu -->
<?php 
try {
    include "index_menu.php";
} catch (Exception $e) {
    print_r($e);
}
?>
<!-- Fin menu -->
<div style="float:right;width:79%;">
<?php 
<?php

require './vendor/autoload.php';
include 'utilidades.php';
//$bd = new PDO('sqlite:db/oscars.sqlite');
$dbopts = parse_url(getenv('DATABASE_URL'));
$app = new Silex\Application();
$app->register(new Herrera\Pdo\PdoServiceProvider(), array('pdo.dsn' => 'pgsql:dbname=' . ltrim($dbopts["path"], '/') . ';host=' . $dbopts["host"], 'pdo.port' => $dbopts["port"], 'pdo.username' => $dbopts["user"], 'pdo.password' => $dbopts["pass"]));
$bd = $app['pdo'];
echo get_users_all_votes_count($bd, $_POST["year"]);