Guest User

Script itemshop buy

a guest
Apr 28th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.35 KB | None | 0 0
  1. <div id="main_content_item">
  2.     <div id="main_content_item_title">
  3.       <p class="textstyle_main_content_item_title">ItemShop-Cumpara</p>
  4. </div>
  5.  
  6. <center>
  7. <?PHP
  8.  
  9.  if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
  10.  
  11.     if(isset($_GET['id']) && checkInt($_GET['id'])) {
  12.    
  13.      $sqlCmd="SELECT vnum, preis, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2 FROM ".SQL_HP_DB.".is_items WHERE id='".$_GET['id']."' LIMIT 1";
  14.       $sqlQry=mysql_query($sqlCmd,$sqlHp);
  15.       if(mysql_num_rows($sqlQry)==1) {
  16.      
  17.         $getItem=mysql_fetch_object($sqlQry);
  18.         if($_SESSION['user_coins']>=$getItem->preis) {
  19.      
  20.           $getGroesse = compareItems($getItem->vnum);
  21.           $belPos = checkPos($_SESSION['user_id']);
  22.           $possiblePos = findPos($belPos['islager'],$getGroesse['groesse']);
  23.           if(!empty($possiblePos)) {
  24.          
  25.             $sqlCmd="UPDATE account.account SET coins=coins-".$getItem->preis." WHERE id='".$_SESSION['user_id']."' LIMIT 1";
  26.             $sqlQry=mysql_query($sqlCmd,$sqlServ);
  27.             $sqlLog="INSERT INTO ".SQL_HP_DB.".is_log (account_id,vnum,preis,zeitpunkt) VALUES ('".$_SESSION['user_id']."','".$getItem->vnum."','".$getItem->preis."','".$sqlZeit."')";
  28.             $qryLog=mysql_query($sqlLog,$sqlHp);
  29.             $sqlItem="INSERT INTO player.item
  30.             (owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)
  31.             VALUES
  32.             ('".$_SESSION['user_id']."','MALL','".$possiblePos[0]."','1','".$getItem->vnum."','".$getItem->attrtype0."', '".$getItem->attrvalue0."', '".$getItem->attrtype1."', '".$getItem->attrvalue1."', '".$getItem->attrtype2."', '".$getItem->attrvalue2."', '".$getItem->attrtype3."', '".$getItem->attrvalue3."', '".$getItem->attrtype4."', '".$getItem->attrvalue4."', '".$getItem->attrtype5."', '".$getItem->attrvalue5."', '".$getItem->attrtype6."', '".$getItem->attrvalue6."', '".$getItem->socket0."', '".$getItem->socket1."', '".$getItem->socket2."')";
  33.             $qryItem=mysql_query($sqlItem,$sqlServ) or die(mysql_error());
  34.             echo'<center><font color="green"><br>Achizitionarea de succes!</font> <br><br>Dacă nu ati primit itemul dorit contactati un administrator!</center><br>';
  35.            
  36.           }
  37.           else {
  38.             echo'<font color="red"><br>Nu este suficient spatiu în depozit!<br></font>';
  39.           }
  40.          
  41.         }
  42.         else {
  43.           echo'<center>
  44.   <font color="red"><br>Achizitionarea a esuat!</font> <br><br> Îmi pare rău, dar nu aveti destule monede dragon!</center><br><br>';
  45.         }
  46.       }
  47.       else {
  48.         echo'<font color="red"><br>Obiectul specificat nu există!<br></font><br>';
  49.       }
  50.     }
  51.     else {
  52.       echo'<font color="red"><br>Acest lucru nu este un obiect valid!</font><br><br>';
  53.     }
  54.     echo'<p><a href="javascript:history.back()">înapoi</a></p>';
  55.   }
  56.   else {
  57.     echo'<meta http-equiv="refresh" content="1; URL=index.php?s=nincsbelepve"> ';
  58.   }
  59. ?>
  60. </center>
  61.  
  62. <div style="clear: both"></div>
  63. </div>
  64. <div class="bottom"></div>
Advertisement
Add Comment
Please, Sign In to add comment