Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <br></form></center><script>
- var adverts=[], adindex, adids=[], adxi=0;
- var adx = [
- ["doodleracead", "http://web.xat.com/games_chat.php"],
- ["snakeracead", "http://web.xat.com/games_chat.php"],
- ["matchracead", "http://web.xat.com/games_chat.php"],
- ["spacewarad", "http://web.xat.com/games_chat.php"]
- ];
- adx = [
- ["xatAd", "http://rxat.ro/powers"]
- ];
- $(document).ready(function() { adinit(); });
- function readCookie(name) {
- var nameEQ = name + "=";
- var ca = document.cookie.split(";");
- for(var i=0;i < ca.length;i++) {
- var c = ca[i];
- while (c.charAt(0)==" ") c = c.substring(1,c.length);
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
- }
- return null;
- }
- function adreadCookie(name) {
- var lang;
- lang = readCookie("lang");
- if(lang.length!=2) lang = readCookie("Language");
- lang = lang.replace(new RegExp( "[^a-z]", "g" ), "");
- if(lang.length!=2) return null;
- return lang;
- }
- function adinit()
- {
- adindex=0;
- var c = new Date();
- c = parseInt((c.getTime() + 30000) / 60000);
- $.getJSON("http://xat.com/json/adverts.php?c="+c, function(o) {
- if(o) o = o[adreadCookie("Language")];
- if(o) adverts = scramble(o);
- adx = scramble(adx);
- adnew();
- setInterval(function() { adnew(); }, 60000);
- });
- }
- function scramble(o)
- {
- for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
- return o;
- }
- function GoAd(n) {
- window.location = adx[n][1];
- }
- function adnew()
- {
- var i, s;
- for(i=0; i<adids.length; i++)
- {
- var j = adindex>>1;
- if((adindex&1)==0 && adverts[j] && adverts[j]["group"])
- s='<a href="http://xat.com/'+adverts[j]["group"]+'"><img border="0" src="http://'+adverts[j]["adimg"]+'" width="728" height="90" /></a>';
- else
- {
- j = adxi % adx.length;
- s='<div onmousedown="GoAd('+j+');"><embed wmode="transparent" src="http://xat.com/images/ads/'+adx[j][0]+'.swf?b9" quality="high" flashvars="" width="728" height="90" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" /></div>';
- adxi++;
- }
- $(adids[i]).html(s);
- adindex++;
- if(adindex >= (adverts.length*2)) adindex=parseInt(Math.random() * 2);
- }
- }
- </script>
- <script>
- adids.push("#"+"GoAd2_1337414215");
- </script>
- <div id="GoAd2_1337414215" align="center" style="width:728;height:90"><div onmousedown="GoAd(0);"><embed wmode="transparent" src="http://xat.com/web_gear/flash/xatAd.swf?b9" quality="high" flashvars="" width="728" height="90" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash"></div></div>
- </td>
- </center>
- <?php
- include('nav.php');
- if(!isset($config->complete))
- {
- return include $pages['home'];
- }
- if(!$core->auth)
- {
- return include $pages['login'];
- }
- $loginid = $core->user['id'];
- $userxats = $core->user['xats'];
- $userpass = $core->user['password'];
- $query = $mysql->fetch_array("SELECT * FROM games WHERE cost!=0 ORDER BY id DESC");
- $powers = array();
- foreach($query as $p){
- if($p['cost'] != 0) $games[$p['id']] = array("id" => $p['id'], "cost" => $p['cost'], "limited" => $p['limited'],"amount" => $p['amount'],"name" => $p['name'],"grupal" => $p['grupal'],"description" => $p['description'],"news" => $p['news'],"dx" => $p['dx'],"shortabout" => $p['shortabout']);
- }
- $loginid = $core->user['id'];
- $userxats = $core->user['xats'];
- $userpass = $core->user['password'];
- $query = $mysql->fetch_array("SELECT * FROM epic WHERE cost!=0 ORDER BY id DESC");
- $powers = array();
- foreach($query as $p){
- if($p['cost'] != 0) $epic[$p['id']] = array("id" => $p['id'], "cost" => $p['cost'], "limited" => $p['limited'],"amount" => $p['amount'],"name" => $p['name'],"grupal" => $p['grupal'],"description" => $p['description'],"news" => $p['news'],"dx" => $p['dx'],"shortabout" => $p['shortabout']);
- }
- $loginid = $core->user['id'];
- $userxats = $core->user['xats'];
- $userpass = $core->user['password'];
- $query = $mysql->fetch_array("SELECT * FROM powers WHERE cost!=0 ORDER BY id DESC");
- $powers = array();
- foreach($query as $p){
- if($p['cost'] != 0) $powers[$p['id']] = array("id" => $p['id'], "cost" => $p['cost'], "limited" => $p['limited'],"amount" => $p['amount'],"name" => $p['name'],"grupal" => $p['grupal'],"description" => $p['description'],"news" => $p['news'],"dx" => $p['dx'],"shortabout" => $p['shortabout']);
- }
- function error($error){
- die($error);
- }
- if(isset($_POST['success'])){
- if(!isset($_POST['chk'])) error("Daca vrei sa cumperi ceva ce trebuie pentru a selecta puterea dorita și apoi cumpara");
- $valor = $_POST['chk'];
- $input = "";
- $total = "";
- $update = "";
- echo '<center><img src="cache/gif/load.gif" /></center>';
- $userpowers = array();
- $check = $mysql->query("SELECT * FROM userpowers WHERE userid='{$loginid}'");
- foreach($check as $u) $userpowers[$u['powerid']] = array("powerid" => $u['powerid'], "count" => $u['count']);
- foreach ($valor as $key=>$id) {
- $amount = $_POST[$id];
- if($amount ==0) $amount = 1;
- if(!isset($powers[$id])) echo "puterea pe care doriți sa cumparati nu exista {$id}";
- if($powers[$id]['limited'] == 1){
- if($amount <= $powers[$id]['amount']){
- $update .= "UPDATE powers SET amount=amount-{$amount} WHERE id='{$id}';";
- } else {
- }
- }
- if(array_key_exists($id, $userpowers)){
- $update .= "UPDATE userpowers SET count=count+{$amount} WHERE powerid='{$id}' AND userid='{$loginid}';";
- }else{
- $input .= "('{$loginid}','{$id}','{$amount}'),";
- }
- $precio = (int) $powers[$id]['cost'] * $amount;
- $total+= $precio;
- }
- if($total > $userxats) error("Nu au suficienti xats pentru a cumpar");
- $set = substr($input, 0, -1);
- if($input != "") $mysql->query("INSERT INTO userpowers (userid,powerid,count) VALUES {$set};");
- if($update != "") $mysql->query($update);
- $mysql->query("UPDATE users SET xats=xats-{$total} WHERE id='{$loginid}';");
- echo $core->refreshLogin();
- error('<div style="padding-left:33%;font-size:25px;"><b>Succes!,redirectionare ...</b> <img src="http://www.elmiroir.com/img/Succes.png" title="Verificated user"style="height:25px;width:25px;"></div>');
- }
- ?>
- <script>
- function selectAll(x) {
- for(var i=0,l=x.form.length; i<l; i++)
- if(x.form[i].type == 'checkbox' && x.form[i].name != 'sAll')
- x.form[i].checked=x.form[i].checked?false:true
- }
- function check(id){
- $(":checkbox[value="+id+"]").attr("checked","true");
- }
- function Generic(id,name,k2dt)
- {
- //alert(id+name+k2);
- //name ='';
- if(name=='null') name='';
- var sp = k2dt.split(";");
- var k2 = sp[0];
- var dt = sp[1];
- if(name!='') // reg user?
- {
- // divId=document.getElementById("tForm");
- // if(divId) divId.style.display="block";
- divId=document.getElementById("tForm");
- if(divId)
- {
- divId.YourEmail.value = name;
- divId.l_k2.value = k2;
- divId.l_dt.value = dt;
- }
- }
- /*
- else
- {
- divId=document.getElementById("tForm");
- if(divId) divId.style.display="none";
- divId=document.getElementById("Register");
- if(divId) divId.innerHTML =
- 'Sorry you must be a registered user to buy powers.';
- }
- */
- }
- //-->
- </script>
- <style>
- </script>
- <link href="http://xat.com/favicon.ico" rel="shortcut icon" type="image/x-icon">
- <link rel="dns-prefetch" href="//www.xatech.com">
- <link rel="stylesheet" type="text/css" href="http://xat.com/css/bootstrap.min.css?v=YY6vE">
- <link rel="stylesheet" type="text/css" href="http://xat.com/css/bootstrap-responsive.min.css?v=YY6vE">
- <link rel="stylesheet" type="text/css" href="http://xat.com/css/animate.css?v=YY6vE">
- <link rel="stylesheet" type="text/css" href="http://xat.com/css/main.css?v=YY6vE">
- <link rel="stylesheet" type="text/css" href="http://xat.com/css/cookiecuttr.css?v=YY6vE">
- <link rel="stylesheet" type="text/css" href="http://xat.com/css/classic.css?v=YY6vE">
- <script src="http://xat.com/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js?v=YY6vE"></script>
- </head>
- <body>
- <style/>
- <style>
- table.xtable {
- border-width: 0px;
- border-spacing: 0px;
- border-style: none;
- border-color: gray;
- border-collapse: collapse;
- background-color: white;
- }
- table.xtable th {
- background-color:#ffffff;
- border-width: 1px;
- padding: 1px;
- border-style: solid;
- border-color: gray;
- }
- table.xtable td {
- border-width: 1px;
- padding: 1px;
- border-style: solid;
- border-color: gray;
- }
- </style>
- <form action="" method="post">
- <center>
- <div style="width:85%;text-align:left;">
- <h1>Cumpara puteri</h1>
- <li>Puteti folosi xats pentru a cumpara puteri si abilitati speciale pentru chat-ul xat.</li>
- <h2>Reguli:</h2>
- <li>Trebuie sa se <a href="terms">respecte termenii</a></li>
- <li><strong>Puterile functiona doar daca sunteti abonat (avea zile)</strong></li>
- <li>Mai multe puteri vor fi adaugate mai târziu</li>
- <li>Puterile pot fi retrase de la vânzare (așa ca grabește-a și cumpara acum!)</li>
- <li>Pretul puterilor se va schimba mai mult sau mai putin în functie de cerere</li>
- <li>Alti utilizatori pot vedea ce puteri aveti pornite</li>
- <li>Puterile poate fi activate sau dezactivate individual</li>
- <li>Puterile pot fi comercializate cu alti utilizatori</li>
- <li>Puterile stau cu tine pâna când le comercializezi</li>
- <li>Fiecare putere are un smiley. Numai utilizatorii cu acea putere poate utiliza smiley-ul</li>
- <li><strong>Va rugam sa cititi descriere puterilor (verificati cu mouse-ul descrierea)</strong></li>
- </div><br>
- <table border="1" class="xtable" width="86%">
- <tbody>
- <tr>
- <th>Putere</th>
- <td></td>
- <th>Smilie</th>
- <th></th>
- <th>Pret</th>
- <th>Cantitate</th>
- <th>sau verifica</th>
- <th>Descriere<font color="red">(Va rugam sa cititi cu atentie!)</font></th>
- </tr>
- </tbody>
- <tbody>
- <tr><td colspan="9"><b data-localize=buy.powers>Puteri</b></td></tr>
- <?php
- $costotal = 0;
- foreach($powers as $power)
- {
- $id = $power['id'];
- if($power["grupal"] == 1) $color = "f0fff0";
- else $color = "ffffff";
- $costotal+= $power["cost"];
- $cost = $power["cost"];
- $char = "{$power['shortabout']}";
- $input = '<input type="text" name="'.$id.'" onchange="check('.$id.')" size="3" style="width:70%" value="0" id="buy" />';
- $check = '<input type="checkbox" style="width: 30px; height: 14px;"" name="chk[]" value="'.$id.'" id="buy" />';
- if($power["limited"] == 1) $color = "ffffff";
- if($power["limited"] == 1)
- {
- if($power['amount'] > 0){
- $cost = $cost;
- $char = "{$power['amount']} puteri disponibile!";
- }else{
- $cost = "";
- $char = "{$power['shortabout']} <i>Indisponibila,</i> <i>incercati</i> <p><a href=/Trade>comertul</a>!";
- $input = "";
- $check = "";
- }
- }
- echo'
- <tr style="background-color:#'.$color.'">
- <td>'.$char.'</td>
- <td>'.$power['news'].'</td>
- <td><img width="30" height="30" src="/images/smw/'.$power['name'].'.png" /> ('.$power["name"].')</td>
- <td>'.$power['dx'].'</td>
- <td>'.$cost.'</td>
- <td>'.$input.'</td>
- <td><center>' .$check. '</center></td>
- <td>'.$power['description'].'See <a href="/powinfo2?power='.$power['name'].'">wiki for details</a></td>
- </tr>';
- }
- ?> <td colspan="9"><b data-localize="buy.games">Jocuri</b><br><span data-localize="buy.canplay">Cu aceste puteri puteti lansa și controla jocurile.</span></td>
- <?php
- $costotal = 0;
- foreach($games as $power)
- {
- $id = $power['id'];
- if($power["grupal"] == 1) $color = "f0fff0";
- else $color = "ffffff";
- $costotal+= $power["cost"];
- $cost = $power["cost"];
- $char = "Puterea {$power['name']} disponibila";
- $input = '<input type="text" name="'.$id.'" onchange="check('.$id.')" size="3" style="width:50%" value="0" id="buy" />';
- $check = '<input type="checkbox" style="width: 20px; height: 14px;"" name="chk[]" value="'.$id.'" id="buy" />';
- if($power["limited"] == 1) $color = "ffffff";
- if($power["limited"] == 1)
- {
- if($power["grupal"] == 1) $color = "D6FCDA";
- else $color = "ffffff";
- if($power['amount'] > 0){
- $cost = $cost;
- $char = "{$power['amount']} puteri disponibile!";
- }else{
- $cost = "";
- $char = "{$power['shortabout']} <i>Indisponibila</i> <i>incercati</i><p> <a href=/Trade>comertul</a>!";
- $input = "";
- $check = "";
- }
- }
- echo'
- <tr style="background-color:#'.$color.'">
- <td>'.$char.'</td>
- <td>'.$power['news'].'</td>
- <td><img width="30" height="30" src="/images/smw/'.$power['name'].'.png" /> ('.$power["name"].')</td>
- <td>'.$power['dx'].'</td>
- <td>'.$cost.'</td>
- <td>'.$input.'</td>
- <td><center>' .$check. '</center></td>
- <td>'.$power['description'].'</td>
- </tr>';
- }
- ?>
- <tr><td colspan="9"><span data-localize="buy.epicdesc"><b>Puterile Epice</b><p> sunt rare, deoarece acestea sunt foarte scumpe, o mare parte a aparitiilor lor vin din raritatea lor. Ele sunt o recompensa pentru comercianti care și-au facut averile și un obiectiv pentru altii sa depuna eforturi.</span></td></tr>
- <?php
- $costotal = 0;
- foreach($epic as $power)
- {
- $id = $power['id'];
- if($power["grupal"] == 1) $color = "f0fff0";
- else $color = "ffffff";
- $costotal+= $power["cost"];
- $cost = $power["cost"];
- $char = "{$power['shortabout']}";
- $input = '<input type="text" name="'.$id.'" onchange="check('.$id.')" size="3" style="width:70%" value="0" id="buy" />';
- $check = '<input type="checkbox" style="width: 30px; height: 14px;"" name="chk[]" value="'.$id.'" id="buy" />';
- if($power["limited"] == 1) $color = "ffffff";
- if($power["limited"] == 1)
- {
- if($power['amount'] > 0){
- $cost = $cost;
- $char = "{$power['amount']} puteri disponibile!";
- }else{
- $cost = "";
- $char = "{$power['shortabout']} <i>Indisponibila,</i> <i>incercati</i> <p><a href=/Trade>comertul</a>!";
- $input = "";
- $check = "";
- }
- }
- echo'
- <tr style="background-color:#'.$color.'">
- <td>'.$char.'</td>
- <td>'.$power['news'].'</td>
- <td><img width="30" height="30" src="/images/smw/'.$power['name'].'.png" /> ('.$power["name"].')</td>
- <td>'.$power['dx'].'</td>
- <td>'.$cost.'</td>
- <td>'.$input.'</td>
- <td><center>' .$check. '</center></td>
- <td>'.$power['description'].'</td>
- </tr>';
- }
- ?>
- </tbody>
- </table>
- <div style="width:90%;text-align:left;">
- <p> <br> <font color="black" type="bold" <?php
- if($core->auth)
- {
- $username = $core->user['username'];
- $id = $core->user['id'];
- print '<b><font color="black"><font size="2"><div><font size="5">Information account</font><p><br><br> <b>Cumperi powers de pe contul:</b> <font color="red"><b>'.$username.' ('.$id.')</b></font></b>';
- } else {
- print '';
- }
- ?></tr><br>
- <tr> <?php
- if($core->auth)
- {
- $xats = $core->user['xats'];
- $days = $core->user['days'];
- print '<b><font color="black"><font size="2"> <b>Contul dumneavoastra este de:</b> <font color="red"><b>'.$xats.' xats </b></font></b>';
- } else {
- print '';
- }
- ?></tr><br>
- <tr> <?php
- if($core->auth)
- {
- $connectedlast = $core->user['connectedlast'];
- print '<b><font color="black"><font size="2"> <b>IP Addres:</b> <font color="red"><b>'.$connectedlast.' </b></font></b>';
- } else {
- print '';
- }
- ?> </font>
- <br>
- <p>
- <label>
- <input class="xcheck" type="checkbox" name="agree" value="ON">
- <span data-localize=buy.iagree>Am citit și sunt de acord cu regulile și <a href="#">termenii</a></span>
- </label>
- </p>
- <div><p><button name="success" type="submit" class="btn"><i class="icon-shopping-cart"></i> <span data-localize="buy.buypow">Cumpara</span></button>
- <p><button name="sAll" onclick="selectAll(this)" type="button" class="btn"><i class="icon-check"></i> <span data-localize="buy.markallp">Mark All Powers</span></button> <span data-localize="buy.chkforall">(Check all available powers</span>)</p></div>
- <br><br><br>
- <br></form></center><script>
- var adverts=[], adindex, adids=[], adxi=0;
- var adx = [
- ["doodleracead", "http://web.xat.com/games_chat.php"],
- ["snakeracead", "http://web.xat.com/games_chat.php"],
- ["matchracead", "http://web.xat.com/games_chat.php"],
- ["spacewarad", "http://web.xat.com/games_chat.php"]
- ];
- adx = [
- ["xatAd", "http://rxat.ro/powers"]
- ];
- $(document).ready(function() { adinit(); });
- function readCookie(name) {
- var nameEQ = name + "=";
- var ca = document.cookie.split(";");
- for(var i=0;i < ca.length;i++) {
- var c = ca[i];
- while (c.charAt(0)==" ") c = c.substring(1,c.length);
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
- }
- return null;
- }
- function adreadCookie(name) {
- var lang;
- lang = readCookie("lang");
- if(lang.length!=2) lang = readCookie("Language");
- lang = lang.replace(new RegExp( "[^a-z]", "g" ), "");
- if(lang.length!=2) return null;
- return lang;
- }
- function adinit()
- {
- adindex=0;
- var c = new Date();
- c = parseInt((c.getTime() + 30000) / 60000);
- $.getJSON("http://xat.com/json/adverts.php?c="+c, function(o) {
- if(o) o = o[adreadCookie("Language")];
- if(o) adverts = scramble(o);
- adx = scramble(adx);
- adnew();
- setInterval(function() { adnew(); }, 60000);
- });
- }
- function scramble(o)
- {
- for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
- return o;
- }
- function GoAd(n) {
- window.location = adx[n][1];
- }
- function adnew()
- {
- var i, s;
- for(i=0; i<adids.length; i++)
- {
- var j = adindex>>1;
- if((adindex&1)==0 && adverts[j] && adverts[j]["group"])
- s='<a href="http://xat.com/'+adverts[j]["group"]+'"><img border="0" src="http://'+adverts[j]["adimg"]+'" width="728" height="90" /></a>';
- else
- {
- j = adxi % adx.length;
- s='<div onmousedown="GoAd('+j+');"><embed wmode="transparent" src="http://xat.com/images/ads/'+adx[j][0]+'.swf?b9" quality="high" flashvars="" width="728" height="90" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" /></div>';
- adxi++;
- }
- $(adids[i]).html(s);
- adindex++;
- if(adindex >= (adverts.length*2)) adindex=parseInt(Math.random() * 2);
- }
- }
- </script>
- <script>
- adids.push("#"+"GoAd2_1337414215");
- </script>
- <div id="GoAd2_1337414215" align="center" style="width:728;height:90"><div onmousedown="GoAd(0);"><embed wmode="transparent" src="http://xat.com/web_gear/flash/xatAd.swf?b9" quality="high" flashvars="" width="728" height="90" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash"></div></div>
- </td>
- </center>
- <span style="margin-left: 2px;"><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
- <script type="text/javascript" src="http://arrow.scrolltotop.com/arrow79.js"></script></span>
- </center><br><br><br>
- </form>
- <?php include('foot.php');?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement