<?php
/*=====================================================================+
|| # HaddoCMS based HoloCMS - Website and Content Management System
|+=====================================================================+
|| # Copyright © 2008 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|+===================================================+
|| # HoloCMS is provided "as is" and comes without
|| # warrenty of any kind. HoloCMS is free software!
|+=====================================================================+
|| # HaddoCMS v2.0 by Raikas77
|| # www.sciax2.it/forum/development/haddocms-v2-build-2100-a-535753.html
|+=====================================================================*/

include('../core.php');

if(!isset($_GET['step']) OR $_GET['step'] == "1"){
?>
<img src="/images/quiz_step_1.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=2&ajax=true')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "2"){
?>
<img src="/images/quiz_step_2.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=1&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=3&ajax=true')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "3"){
?>
<img src="/images/quiz_step_3.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=2&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=4&ajax=true')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "4"){
?>
<img src="/images/quiz_step_4.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=3&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=5&ajax=true')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "5"){
?>
<img src="/images/quiz_step_5.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=4&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=6&ajax=true')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "6"){
?>
<img src="/images/quiz_step_6.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=5&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=7&ajax=true')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "7"){
?>
<img src="/images/quiz_step_7.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=6&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=8&ajax=true')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "8"){
?>
<img src="/images/quiz_step_8.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=7&ajax=true')" class="quiz_button_backin"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=9&ajax=true')" class="quiz_button_start"></a>
<?php
}elseif($_GET['step'] == "9"){
?>
<input id="option_1" type="radio" name="options" value="1" checked="true" class="inputradio">
<input id="option_2" type="radio" name="options" value="2" class="inputradio">
<input id="option_3" type="radio" name="options" value="3" class="inputradio">
<img id="radio_1" src="/images/quiz_radio_b.png" onclick="radio_select('1')" class="radio" style="position:absolute;margin-top:126px;margin-left:28px;z-index:50000;">
<img id="radio_2" src="/images/quiz_radio_a.png" onclick="radio_select('2')" class="radio" style="position:absolute;margin-top:164px;margin-left:28px;z-index:50000;">
<img id="radio_3" src="/images/quiz_radio_a.png" onclick="radio_select('3')" class="radio" style="position:absolute;margin-top:202px;margin-left:28px;z-index:50000;">
<img src="/images/quiz_step_9.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=8&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=10&ajax=true','1')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "10"){
?>
<input id="option_1" type="radio" name="options" value="1" checked="true" class="inputradio">
<input id="option_2" type="radio" name="options" value="2" class="inputradio">
<input id="option_3" type="radio" name="options" value="3" class="inputradio">
<img id="radio_1" src="/images/quiz_radio_b.png" onclick="radio_select('1')" class="radio" style="position:absolute;margin-top:126px;margin-left:28px;z-index:50000;">
<img id="radio_2" src="/images/quiz_radio_a.png" onclick="radio_select('2')" class="radio" style="position:absolute;margin-top:176px;margin-left:28px;z-index:50000;">
<img id="radio_3" src="/images/quiz_radio_a.png" onclick="radio_select('3')" class="radio" style="position:absolute;margin-top:226px;margin-left:28px;z-index:50000;">
<img src="/images/quiz_step_10.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=9&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=11&ajax=true','2')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "11"){
?>
<input id="option_1" type="radio" name="options" value="1" checked="true" class="inputradio">
<input id="option_2" type="radio" name="options" value="2" class="inputradio">
<input id="option_3" type="radio" name="options" value="3" class="inputradio">
<img id="radio_1" src="/images/quiz_radio_b.png" onclick="radio_select('1')" class="radio" style="position:absolute;margin-top:102px;margin-left:28px;z-index:50000;">
<img id="radio_2" src="/images/quiz_radio_a.png" onclick="radio_select('2')" class="radio" style="position:absolute;margin-top:140px;margin-left:28px;z-index:50000;">
<img id="radio_3" src="/images/quiz_radio_a.png" onclick="radio_select('3')" class="radio" style="position:absolute;margin-top:190px;margin-left:28px;z-index:50000;">
<img src="/images/quiz_step_11.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=10&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=12&ajax=true','3')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "12"){
?>
<input id="option_1" type="radio" name="options" value="1" checked="true" class="inputradio">
<input id="option_2" type="radio" name="options" value="2" class="inputradio">
<input id="option_3" type="radio" name="options" value="3" class="inputradio">
<img id="radio_1" src="/images/quiz_radio_b.png" onclick="radio_select('1')" class="radio" style="position:absolute;margin-top:114px;margin-left:28px;z-index:50000;">
<img id="radio_2" src="/images/quiz_radio_a.png" onclick="radio_select('2')" class="radio" style="position:absolute;margin-top:140px;margin-left:28px;z-index:50000;">
<img id="radio_3" src="/images/quiz_radio_a.png" onclick="radio_select('3')" class="radio" style="position:absolute;margin-top:166px;margin-left:28px;z-index:50000;">
<img src="/images/quiz_step_12.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=11&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=13&ajax=true','4')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "13"){
?>
<input id="option_1" type="radio" name="options" value="1" checked="true" class="inputradio">
<input id="option_2" type="radio" name="options" value="2" class="inputradio">
<input id="option_3" type="radio" name="options" value="3" class="inputradio">
<img id="radio_1" src="/images/quiz_radio_b.png" onclick="radio_select('1')" class="radio" style="position:absolute;margin-top:139px;margin-left:28px;z-index:50000;">
<img id="radio_2" src="/images/quiz_radio_a.png" onclick="radio_select('2')" class="radio" style="position:absolute;margin-top:177px;margin-left:28px;z-index:50000;">
<img id="radio_3" src="/images/quiz_radio_a.png" onclick="radio_select('3')" class="radio" style="position:absolute;margin-top:215px;margin-left:28px;z-index:50000;">
<img src="/images/quiz_step_13.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=12&ajax=true')" class="quiz_button_back"></a>
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=14&ajax=true','5')" class="quiz_button_next"></a>
<?php
}elseif($_GET['step'] == "14"){
$success = 0;
if($_SESSION['quiz']['1'] == "2"){
$success++;
}
if($_SESSION['quiz']['2'] == "1"){
$success++;
}
if($_SESSION['quiz']['3'] == "2"){
$success++;
}
if($_SESSION['quiz']['4'] == "3"){
$success++;
}
if($_SESSION['quiz']['5'] == "1"){
$success++;
}
if($success < 5){
?>
<font style="position:absolute;font-weight:bold;margin-top:60px;margin-left:120px;font-size:17px;"><?php echo $success; ?> su 5! Oops, riprova piu' tardi!</font>
<img src="/images/quiz_step_14.png">
<a href="javascript:void(0)" onclick="Load('ajax/ajax.quiz.php?step=results&ajax=true')" class="quiz_button_results"></a>
<a href="javascript:void(0)" onclick="close_quiz()" class="quiz_button_exit"></a>
<?php
}else{
mysql_query("UPDATE users SET quiz = '1' WHERE id = '".$myrow['id']."'");
$bitchx = mysql_query("SELECT * FROM user_badges WHERE badge_id = 'ACH_SafetyQuizGraduate1' AND user_id = '". $myrow['id'] ."'");
$trax = mysql_fetch_assoc($bitchx);
if($trax['badge_id'] == 'ACH_SafetyQuizGraduate1'){
}
else{

mysql_query("INSERT INTO user_badges (user_id, badge_id, badge_slot) VALUES ('".$myrow['id']."','ACH_SafetyQuizGraduate1','0')") or die(mysql_error());
mysql_query("UPDATE users SET vip_points = vip_points + 15 WHERE username = '".$myrow['username']."'");
SendMUS(updatepoints, $my_id);
}

?>

<img src="/images/quiz_step_15.png">
<a href="javascript:void(0)" onclick="close_quiz();document.getElementById('quiz').style.display='none';" class="quiz_button_exit"></a>
<?php
}
?>
<?php
}elseif($_GET['step'] == "results"){
?>
<img src="/images/quiz_results_top.png">
<div style="height:320px;overflow-x:hidden; overflow-y:scroll;">

<?php if($_SESSION['quiz']['1'] != "2"){?><img src="/images/quiz_results_1.png"><?php } ?>
<?php if($_SESSION['quiz']['1'] != "1"){?><img src="/images/quiz_results_2.png"><?php } ?>
<?php if($_SESSION['quiz']['1'] != "2"){?><img src="/images/quiz_results_3.png"><?php } ?>
<?php if($_SESSION['quiz']['1'] != "3"){?><img src="/images/quiz_results_4.png"><?php } ?>
<?php if($_SESSION['quiz']['1'] != "1"){?><img src="/images/quiz_results_5.png"><?php } ?>
</div>
<a href="javascript:void(0)" onclick="close_quiz()" class="quiz_button_exit"></a>
<?php
}
?>
<img src="/images/quiz_step_1.png" style="display:none">
<img src="/images/quiz_step_2.png" style="display:none">
<img src="/images/quiz_step_3.png" style="display:none">
<img src="/images/quiz_step_4.png" style="display:none">
<img src="/images/quiz_step_6.png" style="display:none">
<img src="/images/quiz_step_7.png" style="display:none">
<img src="/images/quiz_step_9.png" style="display:none">
<img src="/images/quiz_step_10.png" style="display:none">
<img src="/images/quiz_step_11.png" style="display:none">
<img src="/images/quiz_step_12.png" style="display:none">
<img src="/images/quiz_step_13.png" style="display:none">
<img src="/images/quiz_step_14.png" style="display:none">
<img src="/images/quiz_step_15.png" style="display:none">