\doxysection{resultado.\+php}
\hypertarget{resultado_8php_source}{}\label{resultado_8php_source}\index{api/resultado.php@{api/resultado.php}}
\mbox{\hyperlink{resultado_8php}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00001}00001\ <?php}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00002}00002\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00029}00029\ \textcolor{keyword}{function}\ \mbox{\hyperlink{resultado_8php_a77579dd3c8c70636aee682f7df35d678}{displayTable}}()}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00030}00030\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00031}00031\ \ \ \ \ echo(\textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00032}00032\ \textcolor{stringliteral}{\ \ \ \ <div>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00033}00033\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ <h1>\ Resultado\ das\ eleições</h1>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00034}00034\ \textcolor{stringliteral}{\ \ \ \ "{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00035}00035\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00036}00036\ \ \ \ \ \textcolor{comment}{//\ Desenha\ a\ tabela\ de\ vereadores}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00037}00037\ \ \ \ \ \mbox{\hyperlink{resultado_8php_af5c7d70303979e32c6f2293c49a294a9}{tabelaVereadores}}();}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00038}00038\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00039}00039\ \ \ \ \ \textcolor{comment}{//\ Desenha\ a\ tabela\ de\ prefeitos\ e\ vice-\/prefeitos}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00040}00040\ \ \ \ \ \mbox{\hyperlink{resultado_8php_aaf6b242c30844a32d1fb7666fba064a7}{tabelaPrefeitos}}();}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00041}00041\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00042}00042\ \ \ \ \ \textcolor{comment}{//\ Insere\ o\ botão\ que\ reinicia\ a\ eleição}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00043}00043\ \ \ \ \ \mbox{\hyperlink{resultado_8php_a71317e1b97053d8ddb50818a56802d7c}{botaoReiniciar}}();}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00044}00044\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00045}00045\ \ \ \ \ echo(\textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00046}00046\ \textcolor{stringliteral}{\ \ \ \ </div>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00047}00047\ \textcolor{stringliteral}{\ \ \ \ "{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00048}00048\ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00049}00049\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00057}00057\ \textcolor{keyword}{function}\ \mbox{\hyperlink{resultado_8php_af5c7d70303979e32c6f2293c49a294a9}{tabelaVereadores}}()}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00058}00058\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00059}00059\ \ \ \ \ \textcolor{comment}{//\ Conecta\ com\ o\ banco\ de\ dados}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00060}00060\ \ \ \ \ require(\textcolor{stringliteral}{'connect.php'});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00061}00061\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00062}00062\ \ \ \ \ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}-\/>set\_charset(\textcolor{stringliteral}{"{}utf8mb4"{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00063}00063\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00064}00064\ \ \ \ \ \textcolor{comment}{//\ Executa\ a\ query\ para\ obter\ os\ resultados\ das\ eleições\ para\ vereador}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00065}00065\ \ \ \ \ \$vereadores\ =\ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}-\/>query(}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00066}00066\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}SELECT\ *}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00067}00067\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ FROM\ \`{}Candidato`}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00068}00068\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ WHERE\ \`{}titulo`\ =\ 'vereador'}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00069}00069\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ ORDER\ BY\ \`{}votos`\ DESC,\ nome\ ASC"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00070}00070\ \ \ \ \ );}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00071}00071\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00072}00072\ \ \ \ \ \textcolor{comment}{//\ Retorna\ erro\ em\ caso\ de\ falha\ na\ query}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00073}00073\ \ \ \ \ \textcolor{keywordflow}{if}\ (!\$vereadores)\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00074}00074\ \ \ \ \ \ \ \ \ http\_response\_code(500);}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00075}00075\ \ \ \ \ \ \ \ \ die(\textcolor{stringliteral}{"{}Erro\ ao\ obter\ vereadores."{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00076}00076\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00077}00077\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00078}00078\ \ \ \ \ \textcolor{comment}{//\ Executa\ a\ query\ para\ obter\ o\ número\ de\ votos\ do\ vereador\ mais\ votado}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00079}00079\ \ \ \ \ \$max\_votos\_vereador\ =\ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}-\/>query(}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00080}00080\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}SELECT\ max(votos)}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00081}00081\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ FROM\ \`{}Candidato`}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00082}00082\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ WHERE\ \`{}titulo`\ =\ 'vereador'"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00083}00083\ \ \ \ \ );}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00084}00084\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00085}00085\ \ \ \ \ \textcolor{comment}{//\ Retorna\ erro\ em\ caso\ de\ falha\ na\ query}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00086}00086\ \ \ \ \ \textcolor{keywordflow}{if}\ (!\$max\_votos\_vereador)\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00087}00087\ \ \ \ \ \ \ \ \ http\_response\_code(500);}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00088}00088\ \ \ \ \ \ \ \ \ die(\textcolor{stringliteral}{"{}Erro\ ao\ obter\ número\ de\ votos\ do\ vereador\ mais\ votado."{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00089}00089\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00090}00090\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00091}00091\ \ \ \ \ \textcolor{comment}{//\ Número\ de\ votos\ do\ vereador\ mais\ votado}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00092}00092\ \ \ \ \ \$max\_votos\_vereador\ =\ intval(\$max\_votos\_vereador-\/>fetch\_row()[0]);}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00093}00093\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00094}00094\ \ \ \ \ \textcolor{comment}{//\ Cabeçalho\ da\ tabela}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00095}00095\ \ \ \ \ echo\ (\textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00096}00096\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ <table>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00097}00097\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ <tr>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00098}00098\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th\ colspan=\(\backslash\)"{}4\(\backslash\)"{}>Vereador</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00099}00099\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ </tr>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00100}00100\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ <tr>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00101}00101\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Numero</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00102}00102\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Nome</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00103}00103\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Partido</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00104}00104\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Votos</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00105}00105\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ </tr>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00106}00106\ \textcolor{stringliteral}{\ \ \ \ "{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00107}00107\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00108}00108\ \ \ \ \ \textcolor{comment}{//\ Insere\ os\ vereadores\ na\ tabela}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00109}00109\ \ \ \ \ \textcolor{keywordflow}{while}\ (\$row\ =\ \$vereadores-\/>fetch\_assoc())\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00110}00110\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (intval(\$row[\textcolor{stringliteral}{'votos'}])\ ==\ \$max\_votos\_vereador\ and\ \$max\_votos\_vereador\ !=\ 0)\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00111}00111\ \ \ \ \ \ \ \ \ \ \ \ \ \$tr\ =\ \textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00112}00112\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ <tr\ class=\(\backslash\)"{}vencedor\(\backslash\)"{}>"{}};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00113}00113\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00114}00114\ \ \ \ \ \ \ \ \ \ \ \ \ \$tr\ =\ \textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00115}00115\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ <tr>"{}};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00116}00116\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00117}00117\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00118}00118\ \ \ \ \ \ \ \ \ \$tr\ .=\ sprintf(}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00119}00119\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00120}00120\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00121}00121\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00122}00122\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00123}00123\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00124}00124\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ </tr>"{}},}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00125}00125\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[\textcolor{stringliteral}{'numero'}],}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00126}00126\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[\textcolor{stringliteral}{'nome'}],}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00127}00127\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[\textcolor{stringliteral}{'partido'}],}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00128}00128\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[\textcolor{stringliteral}{'votos'}]}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00129}00129\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00130}00130\ \ \ \ \ \ \ \ \ echo(\$tr);}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00131}00131\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00132}00132\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00133}00133\ \ \ \ \ echo(\textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00134}00134\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ </table>"{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00135}00135\ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00136}00136\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00137}00137\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00145}00145\ \textcolor{keyword}{function}\ \mbox{\hyperlink{resultado_8php_aaf6b242c30844a32d1fb7666fba064a7}{tabelaPrefeitos}}()}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00146}00146\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00147}00147\ \ \ \ \ \textcolor{comment}{//\ Conecta\ com\ o\ banco\ de\ dados}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00148}00148\ \ \ \ \ require(\textcolor{stringliteral}{'connect.php'});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00149}00149\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00150}00150\ \ \ \ \ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}-\/>set\_charset(\textcolor{stringliteral}{"{}utf8mb4"{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00151}00151\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00152}00152\ \ \ \ \ \ \textcolor{comment}{//\ Executa\ a\ query\ para\ obter\ os\ resultados\ das\ eleições\ para\ prefeito}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00153}00153\ \ \ \ \ \$prefeitos\ =\ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}-\/>query(}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00154}00154\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}SELECT\ *}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00155}00155\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ FROM\ \`{}Candidato`\ INNER\ JOIN\ \`{}Vice`\ USING\ (numero)}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00156}00156\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ WHERE\ \`{}titulo`\ =\ 'prefeito'}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00157}00157\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ ORDER\ BY\ \`{}votos`\ DESC,\ Candidato.nome\ ASC"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00158}00158\ \ \ \ \ );}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00159}00159\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00160}00160\ \ \ \ \ \textcolor{comment}{//\ Retorna\ erro\ em\ caso\ de\ falha\ na\ query}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00161}00161\ \ \ \ \ \textcolor{keywordflow}{if}\ (!\$prefeitos)\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00162}00162\ \ \ \ \ \ \ \ \ http\_response\_code(500);}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00163}00163\ \ \ \ \ \ \ \ \ die(\textcolor{stringliteral}{"{}Erro\ ao\ obter\ prefeitos."{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00164}00164\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00165}00165\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00166}00166\ \ \ \ \ \textcolor{comment}{//\ Executa\ a\ query\ para\ obter\ o\ número\ de\ votos\ do\ prefeito\ mais\ votado}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00167}00167\ \ \ \ \ \$max\_votos\_prefeito\ =\ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}-\/>query(}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00168}00168\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}SELECT\ max(votos)}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00169}00169\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ FROM\ \`{}Candidato`}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00170}00170\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ WHERE\ \`{}titulo`\ =\ 'prefeito'"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00171}00171\ \ \ \ \ );}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00172}00172\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00173}00173\ \ \ \ \ \textcolor{comment}{//\ Retorna\ erro\ em\ caso\ de\ falha\ na\ query}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00174}00174\ \ \ \ \ \textcolor{keywordflow}{if}\ (!\$max\_votos\_prefeito)\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00175}00175\ \ \ \ \ \ \ \ \ http\_response\_code(500);}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00176}00176\ \ \ \ \ \ \ \ \ die(\textcolor{stringliteral}{"{}Erro\ ao\ obter\ número\ de\ votos\ do\ prefeito\ mais\ votado."{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00177}00177\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00178}00178\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00179}00179\ \ \ \ \ \textcolor{comment}{//\ Número\ de\ votos\ do\ prefeito\ mais\ votado}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00180}00180\ \ \ \ \ \$max\_votos\_prefeito\ =\ intval(\$max\_votos\_prefeito-\/>fetch\_row()[0]);}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00181}00181\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00182}00182\ \ \ \ \ \textcolor{comment}{//\ Cabeçalho\ da\ tabela}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00183}00183\ \ \ \ \ echo\ (\textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00184}00184\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ <table>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00185}00185\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ <tr>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00186}00186\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th\ colspan=\(\backslash\)"{}3\(\backslash\)"{}>Prefeito</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00187}00187\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th\ colspan=\(\backslash\)"{}2\(\backslash\)"{}>Vice-\/prefeito</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00188}00188\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ </tr>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00189}00189\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ <tr>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00190}00190\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Numero</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00191}00191\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Nome</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00192}00192\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Partido</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00193}00193\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Nome</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00194}00194\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Partido</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00195}00195\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <th>Votos</th>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00196}00196\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ </tr>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00197}00197\ \textcolor{stringliteral}{\ \ \ \ "{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00198}00198\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00199}00199\ \ \ \ \ \textcolor{comment}{//\ Insere\ os\ vereadores\ na\ tabela}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00200}00200\ \ \ \ \ \textcolor{keywordflow}{while}\ (\$row\ =\ \$prefeitos-\/>fetch\_row())\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00201}00201\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (intval(\$row[5])\ ==\ \$max\_votos\_prefeito\ and\ \$max\_votos\_prefeito\ !=\ 0)\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00202}00202\ \ \ \ \ \ \ \ \ \ \ \ \ \$tr\ =\ \textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00203}00203\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ <tr\ class=\(\backslash\)"{}vencedor\(\backslash\)"{}>"{}};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00204}00204\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00205}00205\ \ \ \ \ \ \ \ \ \ \ \ \ \$tr\ =\ \textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00206}00206\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ <tr>"{}};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00207}00207\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00208}00208\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00209}00209\ \ \ \ \ \ \ \ \ \$tr\ .=\ sprintf(}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00210}00210\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00211}00211\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00212}00212\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00213}00213\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00214}00214\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00215}00215\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00216}00216\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <td>\%s</td>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00217}00217\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ </tr>"{}},}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00218}00218\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[0],}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00219}00219\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[1],}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00220}00220\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[3],}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00221}00221\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[6],}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00222}00222\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[7],}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00223}00223\ \ \ \ \ \ \ \ \ \ \ \ \ \$row[5]}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00224}00224\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00225}00225\ \ \ \ \ \ \ \ \ echo(\$tr);}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00226}00226\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00227}00227\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00228}00228\ \ \ \ \ echo(\textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00229}00229\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ </table>"{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00230}00230\ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00231}\mbox{\hyperlink{resultado_8php_a71317e1b97053d8ddb50818a56802d7c}{00231}}\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00235}00235\ \textcolor{keyword}{function}\ \mbox{\hyperlink{resultado_8php_a71317e1b97053d8ddb50818a56802d7c}{botaoReiniciar}}()}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00236}00236\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00237}00237\ \ \ \ \ echo(\textcolor{stringliteral}{"{}}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00238}00238\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ <a\ href=\(\backslash\)"{}./reiniciar.php\(\backslash\)"{}>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00239}00239\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ \ \ \ \ <button>Reiniciar\ Eleição</button>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00240}00240\ \textcolor{stringliteral}{\ \ \ \ \ \ \ \ </a>}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00241}00241\ \textcolor{stringliteral}{\ \ \ \ "{}});}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00242}00242\ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00243}00243\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00244}00244\ ?>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00245}00245\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00246}00246\ <!DOCTYPE\ html>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00247}00247\ <html\ lang=\textcolor{stringliteral}{"{}pt-\/BR"{}}>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00248}00248\ \ \ \ \ <head>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00249}00249\ \ \ \ \ \ \ \ \ <meta\ charset=\textcolor{stringliteral}{"{}UTF-\/8"{}}\ />}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00250}00250\ \ \ \ \ \ \ \ \ <title>Resultado</title>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00251}00251\ \ \ \ \ \ \ \ \ <style>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00252}00252\ \ \ \ \ \ \ \ \ \ \ \ \ body\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00253}00253\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ background-\/color:\ lightgray;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00254}00254\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00255}00255\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00256}00256\ \ \ \ \ \ \ \ \ \ \ \ \ h1\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00257}00257\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ text-\/align:\ center;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00258}00258\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00259}00259\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00260}00260\ \ \ \ \ \ \ \ \ \ \ \ \ div\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00261}00261\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ margin-\/left:\ \textcolor{keyword}{auto};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00262}00262\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ margin-\/right:\ \textcolor{keyword}{auto};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00263}00263\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ width:\ fit-\/content;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00264}00264\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00265}00265\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00266}00266\ \ \ \ \ \ \ \ \ \ \ \ \ table\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00267}00267\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ margin-\/left:\ \textcolor{keyword}{auto};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00268}00268\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ margin-\/right:\ \textcolor{keyword}{auto};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00269}00269\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ margin-\/top:\ 40px;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00270}00270\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ width:\ 100\%;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00271}00271\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00272}00272\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00273}00273\ \ \ \ \ \ \ \ \ \ \ \ \ table,\ th,\ td\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00274}00274\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ border:\ 1px\ solid;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00275}00275\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00276}00276\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00277}00277\ \ \ \ \ \ \ \ \ \ \ \ \ .vencedor\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00278}00278\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ background-\/color:\ lightgreen;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00279}00279\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00280}00280\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00281}00281\ \ \ \ \ \ \ \ \ \ \ \ \ a\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00282}00282\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ margin-\/left:\ \textcolor{keyword}{auto};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00283}00283\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ margin-\/right:\ \textcolor{keyword}{auto};}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00284}00284\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ display:\ table;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00285}00285\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00286}00286\ }
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00287}00287\ \ \ \ \ \ \ \ \ \ \ \ \ button\ \{}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00288}00288\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ margin-\/top:\ 40px;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00289}00289\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ font-\/size:\ 18px;}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00290}00290\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00291}00291\ \ \ \ \ \ \ \ \ </style>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00292}00292\ \ \ \ \ </head>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00293}00293\ \ \ \ \ <body>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00294}00294\ \ \ \ \ \ \ \ \ <?php\ \mbox{\hyperlink{resultado_8php_a77579dd3c8c70636aee682f7df35d678}{displayTable}}();\ ?>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00295}00295\ \ \ \ \ </body>}
\DoxyCodeLine{\Hypertarget{resultado_8php_source_l00296}00296\ </html>}

\end{DoxyCode}
