Editing: poll_vote.php
Kembali
<input type="reset" name="back" id="back" onclick="window.location.replace('.');" value="X" title="Taka Janela" /><br /> <?php $vote = $_REQUEST['vote']; //get content of textfile $filename = "poll_result.txt"; $content = file($filename); //put content in array $array = explode("||", $content[0]); $c1 = $array[0]; $c2 = $array[1]; $c3 = $array[2]; $c4 = $array[3]; $c5 = $array[4]; $c6 = $array[5]; $c7 = $array[6]; $c8 = $array[7]; $c9 = $array[8]; $c10 = $array[9]; $c11 = $array[10]; $c12 = $array[11]; $c13 = $array[12]; $c14 = $array[13]; $c15 = $array[14]; $c16 = $array[15]; $c17 = $array[16]; $c18 = $array[17]; $c19 = $array[18]; $c20 = $array[19]; $c21 = $array[20]; $c22 = $array[21]; $c23 = $array[22]; $c24 = $array[23]; if ($vote == 0) { $c1 = $c1 + 1; } if ($vote == 1) { $c2 = $c2 + 1; } if ($vote == 2) { $c3 = $c3 + 1; } if ($vote == 3) { $c4 = $c4 + 1; } if ($vote == 4) { $c5 = $c55 + 1; } if ($vote == 5) { $c6 = $c6 + 1; } if ($vote == 6) { $c7 = $c7 + 1; } if ($vote == 7) { $c8 = $c8 + 1; } if ($vote == 8) { $c9 = $c9 + 1; } if ($vote == 9) { $c10 = $c10 + 1; } if ($vote == 10) { $c11 = $c11 + 1; } if ($vote == 11) { $c12 = $c12 + 1; } if ($vote == 12) { $c13 = $c13 + 1; } if ($vote == 13) { $c14 = $c14 + 1; } if ($vote == 14) { $c15 = $c15 + 1; } if ($vote == 16) { $c17 = $c17 + 1; } if ($vote == 18) { $c19 = $c19 + 1; } if ($vote == 19) { $c20 = $c20 + 1; } if ($vote == 20) { $c21 = $c21 + 1; } if ($vote == 21) { $c22 = $c22 + 1; } if ($vote == 22) { $c23 = $c23 + 1; } if ($vote == 23) { $c24 = $c24 + 1; } //insert votes to txt file $insertvote = $c1."||".$c2."||".$c3."||".$c4."||".$c5."||".$c6."||".$c7."||".$c8."||".$c9."||".$c10."||".$c11."||".$c12."||".$c13."||".$c14."||".$c15."||".$c16."||".$c17."||".$c18."||".$c19."||".$c20."||".$c21."||".$c22."||".$c23."||".$c24; $fp = fopen($filename,"w"); fputs($fp,$insertvote); fclose($fp); ?> <?php session_start(); if( isset( $_SESSION['counter'] ) ) { $_SESSION['counter'] += 1; $msg = "Ita bo'ot visita ona pagina ne'e dala ". $_SESSION['counter']; echo $msg; return; }else { $_SESSION['counter'] = 1; } $msg = "Ita bo'ot visita ona pagina ne'e dala ". $_SESSION['counter']; ?> <h3>Partido Nebe Sei Hetan Votus Barak Liu? </h3> <table> <tr> <td width="29">1.</td> <td width="82">PMD </td><td width="13">:</td> <td width="10"> </td> <td width="177"><img src="1.gif" width='<?php echo(100*round($c1/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20'> <?php echo(100*round($c1/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>2.</td> <td>PLPA</td><td>:</td> <td> </td> <td><img src="2.gif" width='<?php echo(100*round($c2/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20'> <?php echo(100*round($c2/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>3.</td> <td>PDRT</td> <td>:</td> <td> </td> <td><img src="3.gif" alt="" width='<?php echo(100*round($c3/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c3/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>4.</td> <td>APMT</td> <td>:</td> <td> </td> <td><img src="4.gif" alt="" width='<?php echo(100*round($c4/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c4/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>5.</td> <td>KHUNTO</td> <td>:</td> <td> </td> <td><img src="5.gif" alt="" width='<?php echo(100*round($c5/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c5/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>6.</td> <td>PST</td> <td>:</td> <td> </td> <td><img src="6.gif" alt="" width='<?php echo(100*round($c6/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c6/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>7.</td> <td>PDP</td> <td>:</td> <td> </td> <td><img src="7.gif" alt="" width='<?php echo(100*round($c7/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c7/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>8.</td> <td>CNRT</td> <td>:</td> <td> </td> <td><img src="8.gif" alt="" width='<?php echo(100*round($c8/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c8/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>9.</td> <td>PR</td> <td>:</td> <td> </td> <td><img src="9.gif" alt="" width='<?php echo(100*round($c9/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c9/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>10.</td> <td>UDT</td> <td>:</td> <td> </td> <td><img src="10.gif" alt="" width='<?php echo(100*round($c10/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c10/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>11.</td> <td>PDC</td> <td>:</td> <td> </td> <td><img src="11.gif" alt="" width='<?php echo(100*round($c11/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c11/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>12</td> <td>MLPM</td> <td>:</td> <td> </td> <td><img src="12.gif" alt="" width='<?php echo(100*round($c12/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c12/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>13.</td> <td>PLP</td> <td>:</td> <td> </td> <td><img src="13.gif" alt="" width='<?php echo(100*round($c13/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c13/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>14.</td> <td>PD</td> <td>:</td> <td> </td> <td><img src="14.gif" alt="" width='<?php echo(100*round($c14/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c14/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>15.</td> <td>UNDERTIM</td> <td>:</td> <td> </td> <td><img src="15.gif" alt="" width='<?php echo(100*round($c15/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c15/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>16.</td> <td>PUDD</td> <td>:</td> <td> </td> <td><img src="16.gif" alt="" width='<?php echo(100*round($c16/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c16/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>17.</td> <td>PTD</td> <td>:</td> <td> </td> <td><img src="17.gif" alt="" width='<?php echo(100*round($c17/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c17/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>18.</td> <td>FM</td> <td>:</td> <td> </td> <td><img src="18.gif" alt="" width='<?php echo(100*round($c18/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c18/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>19.</td> <td>PSD</td> <td>:</td> <td> </td> <td><img src="19.gif" alt="" width='<?php echo(100*round($c19/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c19/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>20.</td> <td>CASDTL</td> <td>:</td> <td> </td> <td><img src="20.gif" alt="" width='<?php echo(100*round($c20/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c20/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>21.</td> <td>PDN</td> <td>:</td> <td> </td> <td><img src="21.gif" alt="" width='<?php echo(100*round($c21/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c21/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>22.</td> <td>FRETILIN</td> <td>:</td> <td> </td> <td><img src="22.gif" alt="" width='<?php echo(100*round($c22/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c22/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>23.</td> <td>PV</td> <td>:</td> <td> </td> <td><img src="23.gif" alt="" width='<?php echo(100*round($c23/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c23/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> <tr> <td>24.</td> <td>PDS</td> <td>:</td> <td> </td> <td><img src="24.gif" alt="" width='<?php echo(100*round($c24/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>' height='20' /> <?php echo(100*round($c24/($c24+$c23+$c22+$c21+$c20+$c19+$c18+$c17+$c16+$c15+$c14+$c13+$c12+$c11+$c10+$c9+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1),2)); ?>% </td> </tr> </table>
SIMPAN PERUBAHAN