Query('SELECT polid, pol_text, pol_date FROM tblpol WHERE pol_date <= \'' . date('Y-m-d') . '\' ORDER BY pol_date DESC', $resultPol); if($resultPol->RowCount() > 0) { $bPol = true; if($objPol = $resultPol->FetchObject()) { $strPolText = $objPol->pol_text; $nPolID = $objPol->polid; //Insert new vote { if(isset($_POST['POL_VOTE_SUBMIT'])) { if(!isset($_POST['pol_vote'])) { $strPolError = 'Geen stem uitgebracht'; } else { //Check if already has been voted $resultPolVote = new CMysqlResult(); $cdc->Query('SELECT \'true\' AS found FROM tblpol_entry WHERE pol_entry_pol = \'' . $nPolID . '\' AND pol_entry_address = \'' . $_SERVER['REMOTE_ADDR'] . '\'', $resultPolVote); if($resultPolVote->RowCount() == 0) { //Check if statementid is within pol $nSubmitVote = $_POST['pol_vote']; $resultPol = new CMysqlResult(); $cdc->Query('SELECT \'true\' AS found FROM tblpol_statement WHERE pol_statement_pol = \'' . $nPolID . '\' AND pol_statementid = \'' . $nSubmitVote . '\'', $resultPol); if($resultPol->RowCount() == 0) { $nSubmitVote = 'null'; } if($nSubmitVote == 'null') { $cdc->SingleQuery('INSERT INTO tblpol_entry (pol_entry_address, pol_entry_pol, pol_entry_statement) VALUES (\'' . $_SERVER['REMOTE_ADDR'] . '\', \'' . $nPolID . '\', null)'); } else { $cdc->SingleQuery('INSERT INTO tblpol_entry (pol_entry_address, pol_entry_pol, pol_entry_statement) VALUES (\'' . $_SERVER['REMOTE_ADDR'] . '\', \'' . $nPolID . '\', \'' . $nSubmitVote . '\')'); } } header('Location: home.php'); } } //} Insert new vote $resultPolVote = new CMysqlResult(); $cdc->Query('SELECT \'true\' AS found FROM tblpol_entry WHERE pol_entry_address = \'' . $_SERVER['REMOTE_ADDR'] . '\' AND pol_entry_pol = \'' . $nPolID . '\'', $resultPolVote); if($resultPolVote->RowCount() == 0) { $bVote = false; } $resultPolStatement = new CMysqlResult(); if($bVote == true) $cdc->Query('SELECT pol_statementid, pol_statement_text,count(*) AS VOTE_COUNT FROM tblpol_statement, tblpol_entry WHERE pol_statement_pol = \'' . $objPol->polid . '\' AND pol_entry_statement = pol_statementid GROUP BY pol_statementid ORDER BY VOTE_COUNT DESC', $resultPolStatement); else $cdc->Query('SELECT pol_statementid, pol_statement_text FROM tblpol_statement WHERE pol_statement_pol = \'' . $objPol->polid . '\'', $resultPolStatement); $strPolQuery = ''; $nPolStatementCount = 0; while($objPolStatement = $resultPolStatement->FetchObject()) { if($strPolQuery == '') $strPolQuery .= 'pol_statementid != \'' . $objPolStatement->pol_statementid . '\' AND '; else $strPolQuery .= 'pol_statementid != \'' . $objPolStatement->pol_statementid . '\' AND '; $strPolStatementText[$nPolStatementCount] = $objPolStatement->pol_statement_text; $strPolStatementID[$nPolStatementCount] = $objPolStatement->pol_statementid; $nPolStatementCount++; } $resultPollNull = new CMysqlResult(); $cdc->Query('SELECT pol_statementid, pol_statement_text FROM tblpol_statement WHERE ' . $strPolQuery .' pol_statement_pol = \'' . $nPolID . '\'', $resultPollNull); while($objPollNull = $resultPollNull->FetchObject()) { $strPolStatementText[$nPolStatementCount] = $objPollNull->pol_statement_text; $strPolStatementID[$nPolStatementCount] = $objPollNull->pol_statementid; $nPolStatementCount++; } } } else { $bPol = false; } //} Get current pol //Get pol vote status { if($bPol == true) { $resultPolVote = new CMysqlResult(); $cdc->Query('SELECT \'true\' AS found FROM tblpol_entry WHERE pol_entry_address = \'' . $_SERVER['REMOTE_ADDR'] . '\' AND pol_entry_pol = \'' . $nPolID . '\'', $resultPolVote); if($resultPolVote->RowCount() == 0) { $bVote = false; } } //} Get pol vote status //Get pol value status { if($bPol == true && $bVote == true) { $nPolStatementMax = 0; $nPolEntryTotal = 0; for($nLoopPol = 0; $nLoopPol < $nPolStatementCount; $nLoopPol++) { $resultCount = new CMysqlResult(); $cdc->Query('SELECT count(*) AS countpol FROM tblpol_entry WHERE pol_entry_statement = \'' . $strPolStatementID[$nLoopPol] . '\'', $resultCount); if($objCount = $resultCount->FetchObject()) { $nPolStatementValue[$nLoopPol] = $objCount->countpol; $nPolEntryTotal += $objCount->countpol; } else { $nPolStatementValue[$nLoopPol] = 0; } } for($nLoopPol = 0; $nLoopPol < $nPolStatementCount; $nLoopPol++) { if($nPolEntryTotal != 0) { $nPolStatementValue[$nLoopPol] = round(($nPolStatementValue[$nLoopPol] / $nPolEntryTotal) * 100); } else { $nPolStatementValue[$nLoopPol] = 0; } if($nPolStatementValue[$nLoopPol] > $nPolStatementMax) $nPolStatementMax = $nPolStatementValue[$nLoopPol]; } } //} Get pol value status //}} END POLL //AGENDA {{ $strAgendaText = null; $strAgendaDate = null; $bAgendaDescription = null; $nAgendaID = null; $nAgendaCount = 0; $resultAgenda = new CMysqlResult(); $cdc->Query('SELECT agendaid, agenda_date, agenda_title, agenda_description FROM agenda WHERE agenda_date >= \'' . date('Y-m-d') . '\' order by agenda_date LIMIT 0, 5', $resultAgenda); while($objAgenda = $resultAgenda->FetchObject()) { $nAgendaID[$nAgendaCount] = $objAgenda->agendaid; $strAgendaText[$nAgendaCount] = $objAgenda->agenda_title; $strAgendaDate[$nAgendaCount] = $objAgenda->agenda_date; if(strlen($objAgenda->agenda_description) == 0) { $bAgendaDescription[$nAgendaCount] = false; } else { $bAgendaDescription[$nAgendaCount] = true; } $nAgendaCount++; } //}} AGENDA //NEWS ITEM {{ $nNewsID = null; $strNewsDate = null; $strNewsTitel = null; $strNewsText = null; $strNewsPicture = null; $nNewsCount = 0; $resultNews = new CMysqlResult(); $cdc->Query('SELECT newsid, news_picture, news_date, news_titel, news_text FROM tblnews ORDER BY news_date DESC', $resultNews); while($objNews = $resultNews->FetchObject()) { $strNewsID[$nNewsCount] = $objNews->newsid; $strNewsDate[$nNewsCount] = $objNews->news_date; $strNewsTitel[$nNewsCount] = $objNews->news_titel; $strNewsText[$nNewsCount] = $objNews->news_text; $strNewsPicture[$nNewsCount] = $objNews->news_picture; $nNewsCount++; } //}} NEWS ITEM //Mailinglist {{ $conMailinglistEmail = new FormControlText('mailinglist_address', 'E-Mail', 20, 128, true); $conMailinglistEmail->SetMessageMandatory('Niet ingevuld'); $conMailinglistEmail->SetMessageMax('Te veel karakters gebruikt'); $conMailinglistEmail->AddFilter(new FilterEmail('Ongeldig E-Mail adres')); $conMailinglistEmail->AddFilter(new FilterHTML('Bevat HTML code')); $conMailinglistEmail->SetStyleSheet('vendetta_textbox','vendetta_textbox_error'); $formMailinglist = new CForm('mailinglist'); $formMailinglist->AddControl($conMailinglistEmail); $formMailinglist->Filter(); if($formMailinglist->GetState() == FORM_STATE_OK) { $resultMailFound = new CMysqlResult(); $cdc->Query('SELECT \'true\' AS found FROM tblmail_list WHERE emailaddress = \'' . $conMailinglistEmail->GetData() . '\'', $resultMailFound); if($resultMailFound->RowCount() == 0) { $cdc->SingleQuery('INSERT INTO tblmail_list (emailaddress) VALUES (\'' . $conMailinglistEmail->GetData() . '\')'); } $bMailinglistAdd=true; } //}} Mailinglist ?> The Vendetta
Agenda


Informatie



'); } ?>
Totaal overzicht