Quelltext 1 Teil: Phase error?

Beitrag lesen

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<!-- POLLSolved v1.5 - Copyright by www.usolved.net -->

<?

include(dirname(FILE)."/voting/settings/connect.php");

$get_layout=mysql_query("SELECT * FROM $prefix"."_layout"); $aus_layout=mysql_fetch_object($get_layout);

echo "<html>";     echo "<head>";     ?>     <script type="text/javascript">     <!--     function pollarchiv(url)              {               open(url, 'pollarchiv', "toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=0,width=490px,height=360px");               href = url;              }     //-->     </script>     <script type="text/javascript">     <!--     function pollresult(url)              {               open(url, 'pollresult', "toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=0,width=530px,height=360px");               href = url;              }     //-->     </script>     <?     echo "<title>POLLSolved</title>";     echo "<link rel="stylesheet" href="".$file_root."/voting/settings/styles_output.css" type="text/css" />";     echo "</head>";

1.0

//-------------------- Popup Ergebnis ----------------------

$popup_e=$_GET['popup_e'];  if($popup_e=="ok")  {     $font_result="style="font-family: ".$aus_layout->fontface_result."; font-size: ".$aus_layout->size_result."pt; color: ".$aus_layout->color_font_result.";"";     $font_result_u="style="font-family: ".$aus_layout->fontface_result."; font-size: ".$aus_layout->size_result."pt; color: ".$aus_layout->color_font_result."; text-decoration : underline;"";

echo "<body style=&quot;&quot;

if(!empty($aus_layout->color_bgc_result))     echo "background-color:".$aus_layout->color_bgc_result.";";

echo "background-image:url(".$aus_layout->color_bgi_result.");">";

$get_set=mysql_query("SELECT * FROM $prefix"."_settings");         $aus_set=mysql_fetch_object($get_set);

if($aus_set->poll_type=="0")         {         //Anzeige der aktuellen Umfrage         $get_mod_vote_q=mysql_query("SELECT id,question,order_v,date_format(date, '%d.%m.%Y') AS date FROM $prefix"."_questions WHERE active='1' ORDER BY id DESC");         $aus_mod_vote_q=mysql_fetch_object($get_mod_vote_q);         }         else         {         //Anzeige der Umfrage der aktuellen Zeitspanne         $timestamp=time();         $get_mod_vote_q=mysql_query("SELECT id,question,order_v,date_format(date, '%d.%m.%Y') AS date FROM $prefix"."_questions WHERE $timestamp BETWEEN period_from AND period_till");         $aus_mod_vote_q=mysql_fetch_object($get_mod_vote_q);         }

echo "<table><tr><td ".$font_result_u."><b>Frage:</b></td></tr><tr><td ".$font_result."><b>".$aus_mod_vote_q->question."</b></td></tr></table>";

echo "<table><tr><td style="height:10px"></td></tr><tr><td ".$font_result_u."><b>Antworten</b></td><td ".$font_result."> <b>|</b> </td><td ".$font_result_u."><b>Klicks</b></td><td ".$font_result."> <b>|</b> </td><td ".$font_result_u."><b>Diagramm</b></td><td ".$font_result."> <b>|</b> </td><td ".$font_result_u."><b>Prozent</b></td></tr>";   $p="%";   $get_mod_vote_a=mysql_query("SELECT * FROM $prefix"."_answers WHERE pollnr='$aus_mod_vote_q->id' ORDER BY $aus_mod_vote_q->order_v");   while($aus_mod_vote_a=mysql_fetch_object($get_mod_vote_a))   {    $get_mod_vote_a2=mysql_query("SELECT sum(clicks) AS clicks FROM $prefix"."_answers WHERE pollnr='$aus_mod_vote_q->id'");    while($aus_mod_vote_a2=mysql_fetch_object($get_mod_vote_a2))    {

if($aus_mod_vote_a->clicks!=0 || $aus_mod_vote_a2->clicks!=0)     {     $prozent=100/$aus_mod_vote_a2->clicks*$aus_mod_vote_a->clicks;     $prozent=sprintf("%.2f", $prozent);     $p_width=$prozent*2;

echo "<tr><td ".$font_result.">".$aus_mod_vote_a->answer."</td><td ".$font_result."> <b>|</b> </td><td ".$font_result.">".$aus_mod_vote_a->clicks."</td><td ".$font_result."> <b>|</b> </td><td><img src="$aus_layout->dia1" alt="Diagramm" />";     echo "<img width="$p_width" height="12" src="".$file_root."/".$aus_layout->dia2."" alt="Diagramm" />";     echo "<img src="$aus_layout->dia3" alt="Diagramm" /></td><td ".$font_result."> <b>|</b> </td><td ".$font_result.">".$prozent.$p."</td></tr>";     }    $muhmuh=$aus_mod_vote_a2->clicks;    }   }   echo "</table>

<table>   <tr><td style="height:10px"></td></tr>   <tr><td ".$font_result_u."><b>Stimmen:</b></td></tr>   <tr><td ".$font_result.">".$muhmuh."</td></tr><tr><td><br /></td></tr>   <tr><td ".$font_result_u."><b>Start der Umfrage am:</b></td></tr>   <tr><td ".$font_result.">".$aus_mod_vote_q->date."</td></tr>   </table>";

echo "</body></html>";  exit;  }

2.0

//--------------------- Popup Archiv -----------------------

$popup_a=$_GET['popup_a'];  if($popup_a=="ok")  {     $font_archive="style="font-family: ".$aus_layout->fontface_archive."; font-size: ".$aus_layout->size_archive."pt; color: ".$aus_layout->color_font_archive.";"";     $font_archive_u="style="font-family: ".$aus_layout->fontface_archive."; font-size: ".$aus_layout->size_archive."pt; color: ".$aus_layout->color_font_archive.";"";

echo "<body style=&quot;&quot;

if(!empty($aus_layout->color_bgc_archive))     echo "background-color:".$aus_layout->color_bgc_archive.";";

echo "background-image:url(".$aus_layout->color_bgi_archive.");">";

//-------------------------------------------------------------------

$archiv_show=$_GET['archiv_show'];   if($archiv_show=="ok")   {   $archivid=$_GET['archivid'];   $get_mod_vote_q=mysql_query("SELECT id,question,order_v FROM $prefix"."_questions WHERE id='$archivid'");   $aus_mod_vote_q=mysql_fetch_object($get_mod_vote_q);   echo "<table><tr><td ".$font_archive_u."><b>Frage:</b></td></tr><tr><td ".$font_archive."><b>".$aus_mod_vote_q->question."</b></td></tr></table>";

echo "<table>   <tr><td style="height:10px"></td></tr>   <tr><td ".$font_archive_u."><b>Antworten</b></td><td ".$font_archive."> <b>|</b> </td><td ".$font_archive_u."><b>".$font_archive_a."Klicks".$font_archive_b."</b></td><td ".$font_archive."> <b>|</b> </td><td ".$font_archive_u."><b>".$font_archive_a."Diagramm".$font_archive_b."</b></td><td ".$font_archive."> <b>|</b> </td><td ".$font_archive_u."><b>".$font_archive_a."Prozent".$font_archive_b."</b></td></tr>";   $p="%";   $get_mod_vote_a=mysql_query("SELECT * FROM $prefix"."_answers WHERE pollnr='$archivid' ORDER BY $aus_mod_vote_q->order_v");   while($aus_mod_vote_a=mysql_fetch_object($get_mod_vote_a))   {    $get_mod_vote_a2=mysql_query("SELECT sum(clicks) AS clicks FROM $prefix"."_answers WHERE pollnr='$aus_mod_vote_q->id'");    while($aus_mod_vote_a2=mysql_fetch_object($get_mod_vote_a2))    {

if($aus_mod_vote_a->clicks!=0 || $aus_mod_vote_a2->clicks!=0)     {     $prozent=100/$aus_mod_vote_a2->clicks*$aus_mod_vote_a->clicks;     $prozent=sprintf("%.2f", $prozent);     $p_width=$prozent*2;

echo "<tr><td ".$font_archive.">".$aus_mod_vote_a->answer."</td><td ".$font_archive."> <b>|</b> </td><td ".$font_archive.">".$aus_mod_vote_a->clicks."</td><td ".$font_archive."> <b>|</b> </td><td><img src="$aus_layout->dia1" alt="Diagramm" />";     echo "<img width="$p_width" height="12" src="".$file_root."/".$aus_layout->dia2."" alt="Diagramm" />";     echo "<img src="".$file_root."/".$aus_layout->dia3."" alt="Diagramm" /></td><td ".$font_archive."> <b>|</b> </td><td ".$font_archive.">".$prozent.$p."</td></tr>";     }    $muhmuh=$aus_mod_vote_a2->clicks;    }   }   echo "</table>

<table><tr><td style="height:16px"></td></tr><tr><td ".$font_archive."><b>Gesamt:</b> ".$muhmuh." Stimmen</td></tr></table>

<table width="100%">   <tr><td style="height:10px"></td></tr>   <tr><td ".$font_archive."><div style="background-color:".$aus_layout->color_font_archive."; height:1px;"></div>   <br />   <b>«</b> <a href="".$file_root."/poll.php?popup_a=$popup_a" class="output" ".$font_archive.">Zur&uuml;ck</a></td></tr>   </table>";

echo "</body></html>";   exit;   }

//--------- Archiv Auswahl ----------

$get_set=mysql_query("SELECT * FROM $prefix"."_settings");         $aus_set=mysql_fetch_object($get_set);

if($aus_set->poll_type=="0")         {         //Anzeige aller Umfragen der Datenbank         $get_mod_vote_q=mysql_query("SELECT id,question,date_format(date, '%d.%m.%y') AS date FROM $prefix"."_questions ORDER BY id DESC");         }         else         {         //Anzeige der Umfrage der in Frage kommenden Zeitspanne         $timestamp=time();         $get_mod_vote_q=mysql_query("SELECT id,question,date_format(date, '%d.%m.%Y') AS date FROM $prefix"."_questions WHERE period_from<$timestamp ORDER BY id DESC");         }

echo "<table>";   echo "<tr><td ".$font_archive."><b>Auswahl:</b></td></tr>";   echo "<tr><td style="height:10px"></td></tr>";   while($aus_mod_vote_q=mysql_fetch_object($get_mod_vote_q))   {   echo "<tr><td ".$font_archive.">".$aus_mod_vote_q->date."</td><td ".$font_archive."> <b>|</b> </td><td ".$font_archive."><a href="".$file_root."/poll.php?popup_a=ok&amp;archiv_show=ok&amp;archivid=".$aus_mod_vote_q->id."" class="output">".$aus_mod_vote_q->question."</a></td></tr>";   }   echo "</table>";

//-------------------------------------------------------------------

echo "</body></html>";  exit;  }