array('La pasta Napoletana nei ristoranti di tutta Europa', 'area riservata', 'invia', 'seleziona', 'vincitori quiz', 'tel', 7), 'eng' => array('Neapolitan pasta throughout Europe', 'restricted area', 'submit', 'select', 'quiz winners', 'ph', 7.5)); $tquiz = array('ita' => array('Benvenuto nel nostro quiz!', 'Se risponderai correttamente alle domande del quiz, avrai diritto ad un fantastico omaggio che potrai ritirare in uno dei ristornati del tuo paese che aderiscono a Pasta!
', 'Scegli dunque il paese in cui giocare', 'Vincitori del paese', 'pagine', 'data', 'codice', 'stato', 'ritirato', 'segna come ritirato', 'stampa questa pagina e porta il coupon presso
uno dei ristoranti del tuo paese nel quale potrai
ritirare l\'omaggio', 'data', 'paese', 'codice', 'giochi per'), 'eng' => array('Welcome to our quiz!', 'If you answer the questions in the quiz correctly, you will be entitled to a fantastic free gift, to be collected at one of the restaurants in your country participating in the Pasta! promotion.', 'Choose the country you want to play in', 'country winner in', 'pages', 'date', 'code', 'status', 'collected', 'mark as collected', 'print this page and take the coupon to one of
the restaurants in your country where you can
collect your free gift', 'date', 'country', 'code', 'now playing for')); $sl = ''; $pag = 'index.php'; $query = mysql_fetch_array(mysql_query("SELECT conta FROM contatore WHERE id=1", $db)); $nd = 4; if (isset($_POST['quiz'])&&$_POST['quiz']=='ok') { if (substr($_SERVER['HTTP_REFERER'], 0, strpos($_SERVER['HTTP_REFERER'],'?'))=='http://'.$HTTP_SERVER_VARS['HTTP_HOST'].dirname($HTTP_SERVER_VARS['PHP_SELF']).$sl.$pag) { $tot = 0; foreach ($_POST as $key => $value) { if ($value>0) { $q_id = substr($key, 2); $query = mysql_fetch_array(mysql_query("SELECT risp FROM q_dom WHERE id=".$q_id, $db)); if ($value==$query['risp']) $tot++; } } $risp = ($tot==$nd)?'ok':'ko'; $_SESSION['quiz_ok'] = $risp; if ($tot==$nd) setcookie('quiz_cook', $risp, mktime(0,0,0,12,31,2006)); } header ("Location: http://".$HTTP_SERVER_VARS['HTTP_HOST'].dirname($HTTP_SERVER_VARS['PHP_SELF']).$sl.$pag.'?id='.$id.'&lg='.$lg.'&az='.$az); exit; } if (isset($_POST['login'])) { $log = trim($_POST['login']); $psw = trim($_POST['psw']); if ($log&&$psw) { if ($query = mysql_fetch_array(mysql_query("SELECT id FROM paesi WHERE login='".$log."' AND psw='".$psw."'", $db))) $_SESSION['logged'] = $query['id']; } header ("Location: http://".$HTTP_SERVER_VARS['HTTP_HOST'].dirname($HTTP_SERVER_VARS['PHP_SELF']).$sl.$pag.'?id='.$id.'&lg='.$lg.($az?'&az='.$az:'')); exit; } if (isset($_POST['wn'])) { mysql_query("UPDATE winners SET ok=1 WHERE id=".$_POST['wn'], $db); header ("Location: http://".$HTTP_SERVER_VARS['HTTP_HOST'].dirname($HTTP_SERVER_VARS['PHP_SELF']).$sl.$pag.'?id='.$id.'&lg='.$lg.'&lim='.$_GET['lim']); exit; } if (isset($_POST['logout']) && $_POST['logout']=='ok') { unset($_SESSION['logged']); if ($id==999) $id = 1; header ("Location: http://".$HTTP_SERVER_VARS['HTTP_HOST'].dirname($HTTP_SERVER_VARS['PHP_SELF']).$sl.$pag.'?id='.$id.'&lg='.$lg.($az?'&az='.$az:'')); exit; } if (!isset($_SESSION['counter'])) { $_SESSION['counter'] = $query['conta']+1; mysql_query("UPDATE contatore SET conta=".$_SESSION['counter']." WHERE id=1", $db); } else $_SESSION['counter'] = $query['conta']; $query = mysql_fetch_array(mysql_query("SELECT rif FROM nav WHERE id='$id'", $db)); $id2 = $query['rif']?$query['rif']:$id; $siz = @getimagesize('images/tit_'.$id2.'_'.$lg.'.gif'); if ($query = mysql_fetch_array(mysql_query("SELECT $lg FROM txts WHERE rif='".$id2."_".$id."'", $db))) $txt = $query[$lg]; else { if ($query=mysql_fetch_array(mysql_query("SELECT id FROM nav WHERE rif=".$id." AND ord=1", $db))) $id = $query['id']; $txt = ($query = mysql_fetch_array(mysql_query("SELECT $lg FROM txts WHERE rif='".$id2."_".$id."'", $db)))?$query[$lg]:''; } ?> <?php echo $glob[$lg][0]; ?>
'; ?>
    '; } elseif ($txt=='_5_') { ////////////////// Ristoranti Menu $querydb = mysql_query("SELECT id, $lg FROM paesi ORDER BY $lg", $db); echo '
    '; } elseif ($id2==3) { ////////////////// Ricette Menu $querydb = mysql_query("SELECT id, $lg FROM nav WHERE rif=$id2 ORDER BY ord", $db); echo '
    '; } else { ////////////////// Menu $ismen = true; $querydb = mysql_query("SELECT id, $lg FROM nav WHERE rif=$id2 ORDER BY ord", $db); if (mysql_num_rows($querydb)) while($query=mysql_fetch_array($querydb)) echo '
  • '.$query[$lg].'
  • '; else echo '  '; } }?>
'; } ?>
'; } else { $querydb = mysql_query("SELECT * FROM risto WHERE co=$az ORDER BY ord", $db); $i = 1; $align = array('right', 'left'); while($query=mysql_fetch_array($querydb)){ echo '
'; if (file_exists('images/risto/rist_'.$query['id'].'.jpg')) echo ''; echo ''.$query['nome'].'
'; echo $query['add'].' - '.$query['city'].'
'; if ($query['tel']) echo $glob[$lg][5].'. '.$query['tel'].'
'; if ($query['fax']) echo 'fax. '.$query['fax'].'
'; if ($query['mail']) echo 'mail. '.$query['mail'].'
'; if ($query['web']) echo 'web. '.$query['web'].'
'; echo '
'; } } } elseif ($txt=='_4_') { ////////////////// Aziende testo if ($query = mysql_fetch_array(mysql_query("SELECT * FROM aziende WHERE id=".$az, $db))) { echo ''.$query['nome'].'

'; echo ''; echo $query['add'].'
'; echo $query['city'].' ('.$query['prov'].') - '.$query['cap'].'
'; echo $glob[$lg][5].'. '.$query['tel'].'
'; echo 'fax. '.$query['fax'].'
'; if ($query['mail']) echo 'mail. '.$query['mail'].'
'; if ($query['web']) echo 'web. '.$query['web'].'

'; } else { $querydb = mysql_query("SELECT id, nome, tip FROM aziende ORDER BY tip, ord", $db); echo ''; } } elseif ($txt=='_3_') { ////////////////// Ricette testo $querydb = mysql_query("SELECT id, $lg FROM nav WHERE rif=$id2 ORDER BY ord", $db); echo '
    '; while($query=mysql_fetch_array($querydb)) echo '
  • '.$query[$lg].'
  • '; echo '
'; /* } elseif ($txt=='_7_') { ////////////////// Quiz if (isset($_SESSION['quiz_ok']) && ($_SESSION['quiz_ok']=='ok')) { ////////////////// Quiz - ok $nums = range(48, 57); $abc = array_merge($nums, range(65, 90), range(97, 122)); do { $cod = ''; for ($i=0;$i<10;$i++) { if ($i%3==0) $cod .= chr($nums[rand(0, count($nums)-1)]); else $cod .= chr($abc[rand(0, count($abc)-1)]); } } while ($query = mysql_fetch_array(mysql_query("SELECT id FROM winners WHERE cod='".$cod."'", $db))); $query = mysql_fetch_array(mysql_query("SELECT $lg FROM paesi WHERE id=".$az, $db)); $co = $query[$lg]; $data = date('Y-m-d H:i:s'); echo '

'.$tquiz[$lg][10].'

'.$tquiz[$lg][11].': '.date('d/m/Y H:i:s').'
'.$tquiz[$lg][12].': '.$co.'
'.$tquiz[$lg][13].': '.$cod.'

'; mysql_query("INSERT INTO winners (data, cod, paese) VALUES ('".date('Y-m-d H:i:s')."', '".$cod."', ".$az.")", $db); unset($_SESSION['quiz_ok']); } elseif (isset($HTTP_COOKIE_VARS["quiz_cook"])) { echo '
'; } else { ////////////////// Quiz - ko if ($az) { if (isset($_SESSION['quiz_ok']) && ($_SESSION['quiz_ok']=='ko')) { echo '
'; unset($_SESSION['quiz_ok']); } else { ////////////////// Quiz - domande $query = mysql_fetch_array(mysql_query("SELECT $lg FROM paesi WHERE id=".$az, $db)); echo $tquiz[$lg][14].': '.$query[$lg].'
'; $query = mysql_fetch_array(mysql_query("SELECT COUNT(id) AS num FROM q_dom", $db)); $q_ids = range(1, $query['num']); shuffle($q_ids); array_splice($q_ids, $nd); echo '
'; echo ''; for ($i=0;$i'; $query=mysql_fetch_array(mysql_query("SELECT id, $lg FROM q_dom WHERE id=".$q_ids[$i], $db)); echo ''; } echo '
'.$query[$lg].'

'; $rispdb = mysql_query("SELECT id, $lg FROM q_risp WHERE rif=".$q_ids[$i], $db); $j = 0; $q_risp = array(); while($risp=mysql_fetch_array($rispdb)) $q_risp[] = $risp; shuffle($q_risp); for ($j=0;$j
'; } echo '
'.$glob[$lg][2].'
'; } } else { echo ''.$tquiz[$lg][0].'
'.$tquiz[$lg][1]; echo '
'; echo $tquiz[$lg][2].': '; echo '

'; } } */ } elseif ($id2==1) { ////////////////// Home echo '
'; echo '
'.$txt.'
'; } elseif ($id2==999) { ////////////////// winners $lim = isset($_GET['lim'])?$_GET['lim']:0; $query = mysql_fetch_array(mysql_query("SELECT $lg FROM paesi WHERE id=".$_SESSION['logged'], $db)); echo $tquiz[$lg][3].': '.$query[$lg].' '; $query = mysql_fetch_array(mysql_query("SELECT COUNT(id) AS tot FROM winners WHERE paese=".$_SESSION['logged'], $db)); $num = 8; $lim1 = $lim/$num; $tot = ceil($query['tot']/$num); if ($tot>1) { echo ' -- '.$tquiz[$lg][4].': '; $htm = ''; for ($i=0;$i<$tot;$i++) $htm .= ' '.($i+1).' - '; echo rtrim($htm, ' -'); } echo '

'; $querydb = mysql_query("SELECT id, ok, data, cod FROM winners WHERE paese=".$_SESSION['logged']." ORDER BY data DESC LIMIT ".$lim.", ".$num, $db); if (mysql_num_rows($querydb)) { echo ''; echo ''; while ($query=mysql_fetch_array($querydb)) { echo ''; echo ''; echo ''; } echo '
'.$tquiz[$lg][5].''.$tquiz[$lg][6].''.$tquiz[$lg][7].'
'.substr($query['data'], 8, 2).'/'.substr($query['data'], 5, 2).'/'.substr($query['data'], 0, 4).' - '.substr($query['data'], 11).''.$query['cod'].''.($query['ok']?$tquiz[$lg][8]:'
').'
'; } else echo 'ko'; } else echo $txt; ?>
'; } */?>
info - credits
'; ?>
'.$glob[$lg][4].'
'; echo '
'; echo '
'; } else { echo $glob[$lg][1]; echo '

login

password
'; }?>