/**
  * Executes index action
  *
  */
 public function executeIndex()
 {
     $votazione_id = $this->getRequestParameter('id');
     $this->votazione = OppVotazionePeer::retrieveByPK($votazione_id);
     $this->forward404Unless($this->votazione);
     $this->ramo = $this->votazione->getOppSeduta()->getRamo() == 'C' ? 'Camera' : 'Senato';
     $data = $this->votazione->getOppSeduta()->getData('Y-m-d');
     $this->risultati = $this->votazione->getVotoGruppi($data);
     $this->ribelli = $this->votazione->getVotoRibelli($data);
     $this->getResponse()->setTitle('Votazione ' . $this->ramo . ' ' . $this->votazione->getTitolo() . ' - ' . sfConfig::get('app_main_title'));
     $this->response->addMeta('description', 'Come hanno votato i gruppi, che voto hanno espresso i singoli parlamentari e quali sono stati ribelli al proprio gruppo parlamentare per la votazione ' . $this->ramo . ' ' . $this->votazione->getTitolo(), true);
     $this->processSort();
     $this->votanti = OppVotazioneHasCaricaPeer::getRSAllVotanti($votazione_id, $data);
     $this->votantiComponent = OppVotazioneHasCaricaPeer::getRSAllVotanti($votazione_id, $data);
     $c = new Criteria();
     $c->add(OppVotazioneHasGruppoPeer::VOTAZIONE_ID, $votazione_id);
     $this->voto_gruppi = OppVotazioneHasGruppoPeer::doSelect($c);
     $c = new Criteria();
     $c->add(OppVotazioneHasAttoPeer::VOTAZIONE_ID, $votazione_id);
     $this->voto_atti = OppVotazioneHasAttoPeer::doSelect($c);
     $c = new Criteria();
     $c->add(OppVotazioneHasEmendamentoPeer::VOTAZIONE_ID, $votazione_id);
     $this->voto_ems = OppVotazioneHasEmendamentoPeer::doSelect($c);
 }
/*
 * This file is part of the Openpolis project
 *
 * (c) 2008 Guglielmo Celata <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * Add created_at informations to the sf_tagging table
 * the field takes a value equal to a random timestamp between 3 and 9 hours after
 * the creation of the tagged object's creation date
 *
 */
define('SF_ROOT_DIR', realpath(dirname(__FILE__) . '/..'));
define('SF_APP', 'fe');
define('SF_ENVIRONMENT', 'prod');
define('SF_DEBUG', false);
require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
sfContext::getInstance();
$c = new Criteria();
$c->addJoin(OppVotazionePeer::ID, OppVotazioneHasAttoPeer::VOTAZIONE_ID);
$c->addJoin(OppVotazionePeer::ID, OppVotazioneHasGruppoPeer::VOTAZIONE_ID);
$c->addJoin(OppAttoPeer::ID, OppAttoHasIterPeer::ATTO_ID);
$c->add(OppAttoHasIterPeer::ITER_ID, 16);
$c->add(OppVotazionePeer::FINALE, 1);
$c->add(OppAttoPeer::TIPO_ATTO_ID, 1);
$results = OppVotazioneHasGruppoPeer::doSelect($c);
foreach ($results as $r) {
    echo $r->getGruppoId() . "-" . $r->getVoto() . "\n";
    //.$r->getOppVotazione()->$r->getOppVotazioneHasAtto()->getOppAtto()->getId();
}