Urban Realms Videos

All code and questions for Urban Realms, Forsaken Sanctum, ect...
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Videos

Post by hallsofvallhalla »

it sounds like the same issue missing the '

i know of two people who have installed the code and it worked right out of the box but their environment is the same as mine, doesn't need ' around the variables.
alexrules01
Posts: 175
Joined: Sun Oct 11, 2009 9:33 am

Re: Videos

Post by alexrules01 »

Na I already got the ' in those, well they were already there :P

i thought that might have been the problem, but now I am not sure
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Videos

Post by hallsofvallhalla »

post a screen of the error showing the url.
alexrules01
Posts: 175
Joined: Sun Oct 11, 2009 9:33 am

Re: Videos

Post by alexrules01 »

zolacat999
Posts: 62
Joined: Tue Nov 24, 2009 11:09 pm

Re: Videos

Post by zolacat999 »

WOW just found these didn't know they were here and there great haven't watched them all yet but i've made a start, one problem I had with the source files was the connect.php as it had 'NEWPASSWORD' in the connect.php which for me should be blank but fixed that now
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Videos

Post by hallsofvallhalla »

post your locations.php here
alexrules01
Posts: 175
Joined: Sun Oct 11, 2009 9:33 am

Re: Videos

Post by alexrules01 »

I dont think I have changed the original, I can't remember doing so :P.

Code: Select all

<?php
include_once 'connect.php';
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<title>Urban Realms</title>
</head>
<?php if (isset($_SESSION['player'])) 
  {
    $player=$_SESSION['player'];
    $playerinfo="SELECT * from players where name='$player'";
    $playerinfo2=mysql_query($playerinfo) or die("Could not get user stats");
    $playerinfo3=mysql_fetch_array($playerinfo2);
    
	$skippanel = 0;
	 }
	else
	{
	print "Sorry, not logged in  please <A href='login.php'>Login</a><br>";
 exit;}

 ?>
<body>

<div id="wrapper" align="center">
<table border="1">
<tr><td><img src="images/urban_realms_logo2.png" /></td></tr>
</table>
<table border="1"  background="images/panelback.jpg">
<tr>
<td>
<div id="panelarea">
<?php include_once 'statpanel.php';?>
</div>
</td>
<td>
<div id="locationsarea">
<?php

$bypass = 0;

$tag = $_GET['tag'];
$doctor = $_GET['doctor'];
$sporting = $_GET['sporting'];
$house = $_GET['house'];
$clothing = $_GET['clothing'];
$cafe = $_GET['cafe'];
$farmers = $_GET['farmers'];
$workshop = $_GET['workshop'];
$apparel = $_GET['apparel'];

if(isset($_POST['tag'])){$tag = $_POST['tag'];}
if(isset($_POST['doctor'])){$doctor = $_POST['doctor'];}
if(isset($_POST['sporting'])){$sporting = $_POST['sporting'];}
if(isset($_POST['clothing'])){$clothing = $_POST['clothing'];}
if(isset($_POST['cafe'])){$cafe = $_POST['cafe'];}
if(isset($_POST['farmers'])){$farmers = $_POST['farmers'];}
if(isset($_POST['workshop'])){$workshop = $_POST['workshop'];}
if(isset($_POST['apparel'])){$apparel = $_POST['apparel'];}


$shopinfo="SELECT * from shops where tag='$tag' AND local='$playerinfo3[local]' AND city='$playerinfo3[city]'";
$shopinfo2=mysql_query($shopinfo) or die("This shop does not exist.");
$shopinfo3=mysql_fetch_array($shopinfo2);
/////////////////////////////////Doctor's Office//////////////////
if(isset($doctor))
{
echo "<big><u>Doctor's Office</u></big><br><br>";
	if(isset($_GET['MA']))
	{
	$bypass=1;
	$maxhp = $shopinfo3['level'] * 15;
	
	
	echo "<center><big>This office can heal for a max of " . $maxhp . " Hit Points for the cost of $" . $shopinfo3['price1'] . " per 15hp.</big><br><br>";
	echo "<br><form method='post' action='locations.php?tag=$tag&doctor=1&heal=1'>";
echo "<input type='submit' value='See Doctor'>";
echo "</form>";

	}
/////////////////////////////use doctor/////////////////////
if(isset($_GET['heal']))
	{
	$bypass=1;
	$maxhp = $shopinfo3['level'] * 15;
	 $doctorinfo="SELECT iq,firstaid from players where name='$shopinfo3[pid]'";
    $doctorinfo2=mysql_query($doctorinfo) or die("Could not get user stats");
    $doctorinfo3=mysql_fetch_array($doctorinfo2);
	
	$doctorskill = $doctorinfo3['firstaid'] + $doctorinfo3['iq'];
	$healscore = rand(0,$maxhp);
	$doctorscore = rand(0,$doctorskill);
	if ($healscore > $doctorscore)
	{
	$hpmod = $healscore - $doctorscore;
	$finalhp = $maxhp - $hpmod;
	}
	else
	{
	$finalhp = $maxhp;
	}
	 if($healscore == $maxhp){$finalhp = 0; $crit = 1;}
	 $hpmod = $playerinfo3['maxhpoints'] - $playerinfo3['hpoints'];
	 if ($finalhp > $hpmod){$finalhp = $hpmod;}
	echo  "<center><big>The Doctor has healed you for " . $finalhp . "<br>";
	if ($crit == '1'){echo "The doctor made critical a failure.<br>";}
	$newprice = $finalhp / 15;
	$newprice = (int)$newprice;
	if ($newprice < 1){$newprice = 1;}
	$finalprice =  $newprice * $shopinfo3['price1'];
	echo "For a total cost of $" . $finalprice . ".";
	$updateplayer="Update players set hpoints=hpoints+'$finalhp',cash=cash-'$finalprice'  where name='$playerinfo3[name]'";
		      mysql_query($updateplayer) or die("Could not update player stats");
	$updateshop="Update shops set cash=cash+'$finalprice'  where id='$shopinfo3[id]'";
		      mysql_query($updateshop) or die("Could not update shop stats");		  
	}
///////////////////////////////////////buy medical supplies///////////////
if(isset($_GET['MS']))
	{
	$bypass=1;
	$noitems = 0;
	 echo "<small>";
	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from shopinventory where shid='$shopinfo3[id]'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td><td><img src='images/blank1.png' width='75px'/></td><td><img src='images/blank1.png' width='75px'/></td><td><img src='images/blank1.png' width='35px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$selectbackpack3[value]</td><td><font size='-2'>$$selectbackpack3[buffname]</td><td><font size='-2'>$selectbackpack3[uses]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&shid=$selectbackpack3[shid]&modd=$selectbackpack3[modd]&bought=1&tag=$tag&doctor=1'>Buy</td></tr>";
	   $noitems = 1;
	   }
      print "</table>";
      print "</td></tr></table>";    
      print "</center><center>";
		 echo "</small>";
		if ($noitems == 0){echo "There are no items in this store. Check back later<br>";}
		
	}
	///////////////////////////////////////buy items from doctors office/////////////
if(isset($_GET['bought']))
	{
	$bypass=1;
	$randid = $_GET['randid'];
$shid = $_GET['shid'];
$modd = $_GET['modd'];
$iteminfo="SELECT * from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
	if($playerinfo3['cash'] < $iteminfo3['value'])
	{echo "<center>You Do not have enough Cash for this purchase.";}
else
{		
$SQL = "INSERT into inventory(pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff,buffname,uses) VALUES ('$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$iteminfo3[value]','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]','$iteminfo3[buffname]','$iteminfo3[uses]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from shop inventory");
$updateshop="Update shops set cash=cash+'$iteminfo3[value]' where id='$shopinfo3[id]'";
		      mysql_query($updateshop) or die("Could not update shop stats");
$updateplayer="Update players set cash=cash-'$iteminfo3[value]'  where name='$playerinfo3[name]'";
		      mysql_query($updateplayer) or die("Could not update player stats");	
echo "<center>" . $iteminfo3['name'] . " has been added to your Inventory.";	  

}}
/////////////////////////////////look at items to add to doctors office////
	if(isset($_GET['ai']))
	{
	$bypass=1;
	$noitems = 0;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
 echo "<small>";

	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from inventory where pid='$playerinfo3[name]' AND type='healing'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td><img src='images/blank1.png' width='90px'/></td><td><img src='images/blank1.png' width='30px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$selectbackpack3[buffname]</td><td><font size='-2'>$selectbackpack3[uses]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[modd]&setprice=1&doctor=1&tag=$tag'>Add Item</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "</center>";
		 echo "</small>";
	
}
echo "<center>";
if ($noitems == 0){echo "You have no medical based items to sell.<br>";}
}
/////////////////////////////////////////////set price on item/////////////
if(isset($_GET['setprice']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{

$randid = $_GET['randid'];
$pid = $_GET['pid'];
$modd = $_GET['modd'];
echo "<center><br><br><form method='post' action='locations.php'>";
echo "Price of item  <input type='text' name='price' size='9'>";
echo "<input type='hidden' name='randid' value='$randid'>";
echo "<input type='hidden' name='pid' value='$pid'>";
echo "<input type='hidden' name='modd' value='$modd'>";
echo "<input type='hidden' name='insert' value='1'>";
echo "<input type='hidden' name='doctor' value='1'>";
echo "<input type='hidden' name='tag' value='$tag'>";
echo "<br><br><input type='submit' value='Add Item'>";
echo "</form></big>";

}}


///////////////////////////////////////add item to doctors office/////////////
if(isset($_POST['insert']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
$randid = $_POST['randid'];
$pid = $_POST['pid'];
$modd = $_POST['modd'];
$price = $_POST['price'];

$iteminfo="SELECT * from inventory where pid='$playerinfo3[name]' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
$SQL = "INSERT into shopinventory(shid,pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff,buffname,uses) VALUES ('$shopinfo3[id]','$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$iteminfo3[value]','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]','$iteminfo3[buffname]','$iteminfo3[uses]')"; 
mysql_query($SQL) or die("could not add to house");


$updateback="DELETE from inventory where pid='$pid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from iventory");
echo "<center>" . $iteminfo3[name] . " has been added to your shop.";	  
}
}
///////////////////////////////////doctor main menu////////////////////////
if($bypass != 1)
{ 

echo "<center><big>" . $shopinfo3['greeting'] . "</big><br><br>";

echo "<a href='locations.php?tag=$tag&doctor=1&MA=1'>Medical Attention<br></a>";
echo "<a href='locations.php?tag=$tag&doctor=1&MS=1'>Buy Medical Supplies<br></a>";

if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<br><u>Shop Owner Panel</u><br>";
echo "<a href='locations.php?tag=$tag&doctor=1&ai=1'>Add Items to sell<br></a>";

}
}


echo "<br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Leave'>";
echo "</form></center></big>";
}
/////////////////////////////////Player House//////////////////
if(isset($house))
{
if ($playerinfo3['name'] == $shopinfo3['pid'])
{
if(isset($_GET['rest']))
	{
	$bypass=1;
	$updateplayer="Update players set safe=1 where name='$playerinfo3[name]'";
    mysql_query($updateplayer) or die("Could not update player stats");	
	session_destroy();
    echo "<br><br><big><center>Logged out and resting in your House.<br> As soon as you log back in you will exit your home and no longer be safe.</big>";

	}

if(isset($_GET['store']))
	{
	$bypass=1;
	echo "<small>";

	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from inventory where pid='$playerinfo3[name]'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/><td><img src='images/blank1.png' width='90px'/><td><img src='images/blank1.png' width='30px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$selectbackpack3[buffname]</td><td><font size='-2'>$selectbackpack3[uses]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[modd]&storeitem=1&house=1&tag=$tag'>Store Item</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "</center>";
		 echo "</small>";
	
echo "<center>";
if ($noitems == 0){echo "You have no items in your inventory.<br>";}
	}


if(isset($_GET['takestore']))
	{
	$bypass=1;
	echo "<small>";

	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from houseinventory where pid='$playerinfo3[name]' AND shid='$shopinfo3[id]'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/><td><img src='images/blank1.png' width='90px'/></td><td><img src='images/blank1.png' width='30px'/></td></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$selectbackpack3[buffname]</td><td><font size='-2'>$selectbackpack3[uses]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[modd]&takeitem=1&house=1&tag=$tag'>Store Item</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "</center>";
		 echo "</small>";
	
echo "<center>";
if ($noitems == 0){echo "You have no items in your storage.<br>";}
	}


if(isset($_GET['storeitem']))
	{
	$bypass=1;
$randid = $_GET['randid'];
$pid = $_GET['pid'];
$modd = $_GET['modd'];


$iteminfo="SELECT * from inventory where pid='$playerinfo3[name]' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
$SQL = "INSERT into houseinventory(shid,pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff,buffname,uses) VALUES ('$shopinfo3[id]','$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$iteminfo3[value]','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]','$iteminfo3[buffname]','$iteminfo3[uses]')"; 
mysql_query($SQL) or die("could not add to house");

$updateback="DELETE from inventory where pid='$pid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from iventory");
echo "<center>" . $iteminfo3['name'] . " has been added to your house.";	  
}

if(isset($_GET['takeitem']))
	{
	$bypass=1;
$randid = $_GET['randid'];
$pid = $_GET['pid'];
$modd = $_GET['modd'];


$iteminfo="SELECT * from houseinventory where pid='$pid' AND randid='$randid' AND modd='$modd' AND shid='$shopinfo3[id]'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
$SQL = "INSERT into inventory(pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff,buffname,uses) VALUES ('$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$iteminfo3[value]','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]','$iteminfo3[buffname]','$iteminfo3[uses]')"; 
mysql_query($SQL) or die("could not add to inventory");

$updateback="DELETE from houseinventory where pid='$pid' AND randid='$randid' AND modd='$modd' AND shid='$shopinfo3[id]'";
	  mysql_query( $updateback) or die("Could not delete from iventory");
echo "<center>" . $iteminfo3['name'] . " has been added to your house.";	  
}


if ($bypass != 1)
{
echo "<big><u>" . $shopinfo3['greeting'] ."</u></big><br><br>";
echo "<center><a href='locations.php?tag=$tag&house=1&rest=1'>Logout and Rest<br></a>";
echo "<center><a href='locations.php?tag=$tag&house=1&store=1'>Store Items<br></a>";
echo "<center><a href='locations.php?tag=$tag&house=1&takestore=1'>Take Items from Storage<br></a>";
}}

else
{
echo "<center>This is " . $shopinfo3['pid'] . "'s House. The Door is locked.<br>";
}
echo "<br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Leave'>";
echo "</form></center></big>";
}


/////////////////////////////////////////////sporting goods//////////////////////////////////////
if(isset($sporting))
{
echo "<big><u>Sporting Goods</u></big><br><br>";
	$maxitems = $shopinfo3['level'] * 10;


///////////////////////////////////////buy weapons///////////////
if(isset($_GET['goods']))
	{
	$bypass=1;
	$noitems = 0;
	echo "<small>";

	  print "<center>";
      print "<table border='1' width='90%' cellspacing='1'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from shopweapons where shid='$shopinfo3[id]'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='1' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td><img src='images/weaponnamepic.png'/></td><td><img src='images/typepic.png'/></td><td><img src='images/speedpic.png'/></td><td><img src='images/accpic.png'/></td><td><img src='images/impactpic.png'/></td><td><img src='images/slice.png' /></td><td><img src='images/elementpic.png'/></td><td><img src='images/firepic.png'/></td><td><img src='images/energypic.png'/></td><td><img src='images/dura.png'/></td><td><img src='images/pricepic.png'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><center><font size='-3'>$selectbackpack3[name]</td><td><center><font size='-3'>$selectbackpack3[type]</td><td><center><font size='-3'>$selectbackpack3[speed]</td><td><center><font size='-3'>$selectbackpack3[accuracy]</td><td><center><font size='-3'>$selectbackpack3[impact]</td><td><center><font size='-3'>$selectbackpack3[slice]</td><td><center><font size='-3'>$selectbackpack3[element]</td><td><center><font size='-3'>$selectbackpack3[fire]</td><td><center><font size='-3'>$selectbackpack3[energy]</td><td><center><font size='-3'>$selectbackpack3[durability]/$selectbackpack3[maxdurability]</td><td><center><font size='-3'>$selectbackpack3[price]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[durability]&bought=1&sporting=1&tag=$tag'>Buy Weapon</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "";
		 echo "</small>";
		if ($noitems == 0){echo "There are no items in this store. Check back later<br>";}
		
	}

///////////////////////////////////////buy weapons from sporting goods/////////////
if(isset($_GET['bought']))
	{
	$bypass=1;
	$randid = $_GET['randid'];
$pid = $_GET['pid'];
$durability = $_GET['modd'];
$price = $_GET['price'];

$iteminfo="SELECT * from shopweapons where shid='$shopinfo3[id]' AND randid='$randid' AND durability='$durability'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
		if($playerinfo3['cash'] < $iteminfo3['price'])
	{echo "<center>You Do not have enough Cash for this purchase.";}
else
{
$SQL = "INSERT into playerweapons(pid,name,description,type,speed,price,accuracy,impact,slice,element,fire,energy,liquid,durability,maxdurability,craftsleft,lastcraft,pic,randid,buff) VALUES ('$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[description]','$iteminfo3[type]','$iteminfo3[speed]','$iteminfo3[price]','$iteminfo3[accuracy]','$iteminfo3[impact]','$iteminfo3[slice]','$iteminfo3[element]','$iteminfo3[fire]','$iteminfo3[energy]','$iteminfo3[liquid]','$iteminfo3[durability]','$iteminfo3[maxdurability]','$iteminfo3[craftsleft]','$iteminfo3[lastcraft]','$iteminfo3[pic]','$randid2','$iteminfo3[buff]')"; mysql_query($SQL) or die("could not add to inventory");

$updateback="DELETE from shopweapons where shid='$shopinfo3[id]' AND randid='$randid' AND durability='$durability'";
	  mysql_query( $updateback) or die("Could not delete from shop");
$updateplayer="Update players set cash=cash-'$iteminfo3[price]'  where name='$playerinfo3[name]'";
		      mysql_query($updateplayer) or die("Could not update player stats");	
echo "<center>" . $iteminfo3['name'] . " has been added to your Inventory.";	
$updateshop="Update shops set cash=cash+'$iteminfo3[price]' where id='$shopinfo3[id]'";
		      mysql_query($updateshop) or die("Could not update shop stats");  
}
}
/////////////////////////////////look at weapons to add to sporting goods////
	if(isset($_GET['addw']))
	{
	$bypass=1;
	$noitems = 0;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
 echo "<small>";

	  print "<center>";
      print "<table border='1' width='90%' cellspacing='1'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from playerweapons where pid='$playerinfo3[name]'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='1' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td><img src='images/weaponnamepic.png'/></td><td><img src='images/typepic.png'/></td><td><img src='images/speedpic.png'/></td><td><img src='images/accpic.png'/></td><td><img src='images/impactpic.png'/></td><td><img src='images/slice.png' /></td><td><img src='images/elementpic.png'/></td><td><img src='images/firepic.png'/></td><td><img src='images/energypic.png'/></td><td><img src='images/dura.png'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><center><font size='-3'>$selectbackpack3[name]</td><td><center><font size='-3'>$selectbackpack3[type]</td><td><center><font size='-3'>$selectbackpack3[speed]</td><td><center><font size='-3'>$selectbackpack3[accuracy]</td><td><center><font size='-3'>$selectbackpack3[impact]</td><td><center><font size='-3'>$selectbackpack3[slice]</td><td><center><font size='-3'>$selectbackpack3[element]</td><td><center><font size='-3'>$selectbackpack3[fire]</td><td><center><font size='-3'>$selectbackpack3[energy]</td><td><center><font size='-3'>$selectbackpack3[durability]/$selectbackpack3[maxdurability]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[durability]&setprice=1&sporting=1&tag=$tag'>Add Weapon</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "</center>";
		 echo "</small>";
	
}
echo "<center>";
if ($noitems == 0){echo "You no have weapons items to sell.<br>";}
}
/////////////////////////////////////////////set price on weapon/////////////
if(isset($_GET['setprice']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{

$randid = $_GET['randid'];
$pid = $_GET['pid'];
$modd = $_GET['modd'];
echo "<center><br><br><form method='post' action='locations.php'>";
echo "Price of item  <input type='text' name='price' size='9'>";
echo "<input type='hidden' name='randid' value='$randid'>";
echo "<input type='hidden' name='pid' value='$pid'>";
echo "<input type='hidden' name='modd' value='$modd'>";
echo "<input type='hidden' name='insert' value='1'>";
echo "<input type='hidden' name='sporting' value='1'>";
echo "<input type='hidden' name='tag' value='$tag'>";
echo "<br><br><input type='submit' value='Add Item'>";
echo "</form></big>";

}}


///////////////////////////////////////add weapon to store/////////////
if(isset($_POST['insert']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
$randid = $_POST['randid'];
$pid = $_POST['pid'];
$durability = $_POST['modd'];
$price = $_POST['price'];

$iteminfo="SELECT * from playerweapons where pid='$playerinfo3[name]' AND randid='$randid' AND durability='$durability'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
$SQL = "INSERT into shopweapons(shid,pid,name,description,type,speed,price,accuracy,impact,slice,element,fire,energy,liquid,durability,maxdurability,craftsleft,lastcraft,pic,seller,randid,buff) VALUES ('$shopinfo3[id]','$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[description]','$iteminfo3[type]','$iteminfo3[speed]','$price','$iteminfo3[accuracy]','$iteminfo3[impact]','$iteminfo3[slice]','$iteminfo3[element]','$iteminfo3[fire]','$iteminfo3[energy]','$iteminfo3[liquid]','$iteminfo3[durability]','$iteminfo3[maxdurability]','$iteminfo3[craftsleft]','$iteminfo3[lastcraft]','$iteminfo3[pic]','$playerinfo3[name]','$randid2','$iteminfo3[buff]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from playerweapons where pid='$pid' AND randid='$randid' AND durability='$durability'";
	  mysql_query( $updateback) or die("Could not delete from iventory");
echo "<center>" . $iteminfo3['name'] . " has been added to your shop.";	  
}
}


if($bypass != 1)
{ 

echo "<center><big>" . $shopinfo3['greeting'] . "</big><br><br>";

echo "<a href='locations.php?tag=$tag&sporting=1&goods=1'>Look at Goods<br></a>";

if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<br><u>Shop Owner Panel</u><br>";
echo "<a href='locations.php?tag=$tag&sporting=1&addw=1'>Add Items to sell<br></a>";

}
}


echo "<br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Leave'>";
echo "</form></center></big>";
}



/////////////////////////////////////////////Clothing Store//////////////////////////////////////
if(isset($clothing))
{
echo "<big><u>Clothing Store</u></big><br><br>";
	$maxitems = $shopinfo3['level'] * 10;


///////////////////////////////////////buy armor///////////////
if(isset($_GET['goods']))
	{
	$bypass=1;
	$noitems = 0;
	echo "<small>";

	  print "<center>";
      print "<table border='1' width='90%' cellspacing='1'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from shoparmor where shid='$shopinfo3[id]'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='1' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td><img src='images/armornamepic.png'/></td><td><img src='images/typepic.png'/></td><td><img src='images/locationpic.png'/></td><td><img src='images/impactpic.png'/></td><td><img src='images/slice.png' /></td><td><img src='images/elementpic.png'/></td><td><img src='images/firepic.png'/></td><td><img src='images/energypic.png'/></td><td><img src='images/dura.png'/></td><td><img src='images/pricepic.png'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><center><font size='-3'>$selectbackpack3[name]</td><td><center><font size='-3'>$selectbackpack3[type]</td><td><center><font size='-3'>$selectbackpack3[location]</td><td><center><font size='-3'>$selectbackpack3[impact]</td><td><center><font size='-3'>$selectbackpack3[slice]</td><td><center><font size='-3'>$selectbackpack3[element]</td><td><center><font size='-3'>$selectbackpack3[fire]</td><td><center><font size='-3'>$selectbackpack3[energy]</td><td><center><font size='-3'>$selectbackpack3[durability]/$selectbackpack3[maxdurability]</td><td><center><font size='-3'>$selectbackpack3[price]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[durability]&bought=1&clothing=1&tag=$tag'>Buy Armor</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "";
		 echo "</small>";
		if ($noitems == 0){echo "There are no items in this store. Check back later<br>";}
		
	}

///////////////////////////////////////buy armor from clothing store/////////////
if(isset($_GET['bought']))
	{
	$bypass=1;
	$randid = $_GET['randid'];
$pid = $_GET['pid'];
$durability = $_GET['modd'];
$price = $_GET['price'];

$iteminfo="SELECT * from shoparmor where shid='$shopinfo3[id]' AND randid='$randid' AND durability='$durability'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
		if($playerinfo3['cash'] < $iteminfo3['price'])
	{echo "<center>You Do not have enough Cash for this purchase.";}
else
{
$SQL = "INSERT into playerarmor(pid,name,description,type,location,price,impact,slice,element,fire,energy,liquid,durability,maxdurability,craftsleft,lastcraft,pic,randid,buff) VALUES ('$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[description]','$iteminfo3[type]','$iteminfo3[location]','$iteminfo3[price]','$iteminfo3[impact]','$iteminfo3[slice]','$iteminfo3[element]','$iteminfo3[fire]','$iteminfo3[energy]','$iteminfo3[liquid]','$iteminfo3[durability]','$iteminfo3[maxdurability]','$iteminfo3[craftsleft]','$iteminfo3[lastcraft]','$iteminfo3[pic]','$randid2','$iteminfo3[buff]')"; mysql_query($SQL) or die("could not add to inventory");

$updateback="DELETE from shoparmor where shid='$shopinfo3[id]' AND randid='$randid' AND durability='$durability'";
	  mysql_query( $updateback) or die("Could not delete from shop");
$updateplayer="Update players set cash=cash-'$iteminfo3[price]'  where name='$playerinfo3[name]'";
		      mysql_query($updateplayer) or die("Could not update player stats");	
echo "<center>" . $iteminfo3['name'] . " has been added to your Inventory.";	
$updateshop="Update shops set cash=cash+'$iteminfo3[price]' where id='$shopinfo3[id]'";
		      mysql_query($updateshop) or die("Could not update shop stats");  
}
}
/////////////////////////////////look at armor to add to clothing store////
	if(isset($_GET['addw']))
	{
	$bypass=1;
	$noitems = 0;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
 echo "<small>";

	  print "<center>";
      print "<table border='1' width='90%' cellspacing='1'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from playerarmor where pid='$playerinfo3[name]'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='1' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td><img src='images/armornamepic.png'/></td><td><img src='images/typepic.png'/></td><td><img src='images/locationpic.png'/></td><td><img src='images/impactpic.png'/></td><td><img src='images/slice.png' /></td><td><img src='images/elementpic.png'/></td><td><img src='images/firepic.png'/></td><td><img src='images/energypic.png'/></td><td><img src='images/dura.png'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><center><font size='-3'>$selectbackpack3[name]</td><td><center><font size='-3'>$selectbackpack3[type]</td><td><center><font size='-3'>$selectbackpack3[location]</td><td><center><font size='-3'>$selectbackpack3[impact]</td><td><center><font size='-3'>$selectbackpack3[slice]</td><td><center><font size='-3'>$selectbackpack3[element]</td><td><center><font size='-3'>$selectbackpack3[fire]</td><td><center><font size='-3'>$selectbackpack3[energy]</td><td><center><font size='-3'>$selectbackpack3[durability]/$selectbackpack3[maxdurability]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[durability]&setprice=1&clothing=1&tag=$tag'>Add Armor</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "</center>";
		 echo "</small>";
	
}
echo "<center>";
if ($noitems == 0){echo "You no have clothing items to sell.<br>";}
}
/////////////////////////////////////////////set price on armor/////////////
if(isset($_GET['setprice']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{

$randid = $_GET['randid'];
$pid = $_GET['pid'];
$modd = $_GET['modd'];
echo "<center><br><br><form method='post' action='locations.php'>";
echo "Price of item  <input type='text' name='price' size='9'>";
echo "<input type='hidden' name='randid' value='$randid'>";
echo "<input type='hidden' name='pid' value='$pid'>";
echo "<input type='hidden' name='modd' value='$modd'>";
echo "<input type='hidden' name='insert' value='1'>";
echo "<input type='hidden' name='clothing' value='1'>";
echo "<input type='hidden' name='tag' value='$tag'>";
echo "<br><br><input type='submit' value='Add Item'>";
echo "</form></big>";

}}


///////////////////////////////////////add armor to store/////////////
if(isset($_POST['insert']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
$randid = $_POST['randid'];
$pid = $_POST['pid'];
$durability = $_POST['modd'];
$price = $_POST['price'];
$iteminfo="SELECT * from playerarmor where pid='$playerinfo3[name]' AND randid='$randid' AND durability='$durability'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
$SQL = "INSERT into shoparmor(shid,pid,name,description,type,location,price,impact,slice,element,fire,energy,liquid,durability,maxdurability,craftsleft,lastcraft,pic,seller,randid,buff) VALUES ('$shopinfo3[id]','$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[description]','$iteminfo3[type]','$iteminfo3[location]','$price','$iteminfo3[impact]','$iteminfo3[slice]','$iteminfo3[element]','$iteminfo3[fire]','$iteminfo3[energy]','$iteminfo3[liquid]','$iteminfo3[durability]','$iteminfo3[maxdurability]','$iteminfo3[craftsleft]','$iteminfo3[lastcraft]','$iteminfo3[pic]','$playerinfo3[name]','$randid2','$iteminfo3[buff]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from playerarmor where pid='$pid' AND randid='$randid' AND durability='$durability'";
	  mysql_query( $updateback) or die("Could not delete from inventory");
echo "<center>" . $iteminfo3['name'] . " has been added to your shop.";	  
}
}


if($bypass != 1)
{ 

echo "<center><big>" . $shopinfo3['greeting'] . "</big><br><br>";

echo "<a href='locations.php?tag=$tag&clothing=1&goods=1'>Look at Goods<br></a>";

if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<br><u>Shop Owner Panel</u><br>";
echo "<a href='locations.php?tag=$tag&clothing=1&addw=1'>Add Items to sell<br></a>";

}
}


echo "<br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Leave'>";
echo "</form></center></big>";
}


/////////////////////////////////Cafe//////////////////
if(isset($cafe))
{
echo "<big><u>Cafe</u></big><br><br>";


///////////////////////////////////////buy food///////////////
if(isset($_GET['MS']))
	{
	$bypass=1;
	$noitems = 0;
	 echo "<small>";
	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from shopinventory where shid='$shopinfo3[id]' AND type='food'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td><td><img src='images/blank1.png' width='75px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$$selectbackpack3[value]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&shid=$selectbackpack3[shid]&modd=$selectbackpack3[modd]&bought=1&tag=$tag&cafe=1'>Buy</td></tr>";
	   $noitems = 1;
	   }
      print "</table>";
      print "</td></tr></table>";    
      print "</center><center>";
		 echo "</small>";
		if ($noitems == 0){echo "There are no items in this store. Check back later<br>";}
		
	}
	///////////////////////////////////////buy items from cafe/////////////
if(isset($_GET['bought']))
	{
	$bypass=1;
	$randid = $_GET['randid'];
$shid = $_GET['shid'];
$modd = $_GET['modd'];
$iteminfo="SELECT * from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
	if($playerinfo3['cash'] < $iteminfo3['value'])
	{echo "<center>You Do not have enough Cash for this purchase.";}
else
{		
$SQL = "INSERT into inventory(pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff) VALUES ('$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$iteminfo3[value]','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from shop inventory");
$updateshop="Update shops set cash=cash+'$iteminfo3[value]' where id='$shopinfo3[id]'";
		      mysql_query($updateshop) or die("Could not update shop stats");
$updateplayer="Update players set cash=cash-'$iteminfo3[value]'  where name='$playerinfo3[name]'";
		      mysql_query($updateplayer) or die("Could not update player stats");	
echo "<center>" . $iteminfo3['name'] . " has been added to your Inventory.";	  

}}
alexrules01
Posts: 175
Joined: Sun Oct 11, 2009 9:33 am

Re: Videos

Post by alexrules01 »

Code: Select all

/////////////////////////////////look at items to add to cafe////
	if(isset($_GET['ai']))
	{
	$bypass=1;
	$noitems = 0;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
 echo "<small>";

	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from inventory where pid='$playerinfo3[name]' AND type='food'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[modd]&setprice=1&cafe=1&tag=$tag'>Add Item</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "</center>";
		 echo "</small>";
	
}
echo "<center>";
if ($noitems == 0){echo "You have no food to sell.<br>";}
}
/////////////////////////////////////////////set price on item/////////////
if(isset($_GET['setprice']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{

$randid = $_GET['randid'];
$pid = $_GET['pid'];
$modd = $_GET['modd'];
echo "<center><br><br><form method='post' action='locations.php'>";
echo "Price of food  <input type='text' name='price' size='9'>";
echo "<input type='hidden' name='randid' value='$randid'>";
echo "<input type='hidden' name='pid' value='$pid'>";
echo "<input type='hidden' name='modd' value='$modd'>";
echo "<input type='hidden' name='insert' value='1'>";
echo "<input type='hidden' name='cafe' value='1'>";
echo "<input type='hidden' name='tag' value='$tag'>";
echo "<br><br><input type='submit' value='Add Item'>";
echo "</form></big>";

}}


///////////////////////////////////////add item to cafe/////////////
if(isset($_POST['insert']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
$randid = $_POST['randid'];
$pid = $_POST['pid'];
$modd = $_POST['modd'];
$price = $_POST['price'];

$iteminfo="SELECT * from inventory where pid='$playerinfo3[name]' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
$SQL = "INSERT into shopinventory(shid,pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff) VALUES ('$shopinfo3[id]','$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$price','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from inventory where pid='$pid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from iventory");
echo "<center>" . $iteminfo3['name'] . " has been added to your cafe.";	  
}
}

///////////////////////////////////////cook food/////////////
if(isset($_GET['cf']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<center><u>Select a Recipe</u><br>";
$recipeinfo="SELECT * from recipes where level<='$playerinfo3[cooking]' AND type='cooking'";
      $recipeinfo2=mysql_query($recipeinfo) or die("could not get recipes");
     while($recipeinfo3=mysql_fetch_array($recipeinfo2))
      {
	  echo "<a href='crafting.php?tag=$tag&type=cooking&recipe=$recipeinfo3[name]'>$recipeinfo3[name]<br></a>";
	  }
	  
	  
	  
	  
	  }}

///////////////////////////////////cafe main menu////////////////////////
if($bypass != 1)
{ 

echo "<center><big>" . $shopinfo3['greeting'] . "</big><br><br>";

echo "<a href='locations.php?tag=$tag&cafe=1&MS=1'>Browse Menu<br></a>";

if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<br><u>Shop Owner Panel</u><br>";
echo "<a href='locations.php?tag=$tag&cafe=1&ai=1'>Add Food to Menu<br></a>";
echo "<a href='locations.php?tag=$tag&cafe=1&cf=1'>Cook Food<br></a>";

}
}


echo "<br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Leave'>";
echo "</form></center></big>";
}


/////////////////////////////////Farmers Market//////////////////
if(isset($farmers))
{
echo "<big><u>Farmers Market</u></big><br><br>";


///////////////////////////////////////buy market goods///////////////
if(isset($_GET['MS']))
	{
	$bypass=1;
	$noitems = 0;
	 echo "<small>";
	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from shopinventory where shid='$shopinfo3[id]' AND type='plant'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td><img src='images/blank1.png' width='90px'/></td><td><img src='images/blank1.png' width='30px'/></td><td><td><img src='images/blank1.png' width='75px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$selectbackpack3[value]</td><td><font size='-2'>$selectbackpack3[buffname]</td><td><font size='-2'>$selectbackpack3[uses]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&shid=$selectbackpack3[shid]&modd=$selectbackpack3[modd]&bought=1&tag=$tag&farmers=1'>Buy</td></tr>";
	   $noitems = 1;
	   }
      print "</table>";
      print "</td></tr></table>";    
      print "</center><center>";
		 echo "</small>";
		if ($noitems == 0){echo "There are no items in this store. Check back later<br>";}
		
	}
	///////////////////////////////////////buy items from market/////////////
if(isset($_GET['bought']))
	{
	$bypass=1;
	$randid = $_GET['randid'];
$shid = $_GET['shid'];
$modd = $_GET['modd'];
$iteminfo="SELECT * from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
	if($playerinfo3['cash'] < $iteminfo3['value'])
	{echo "<center>You Do not have enough Cash for this purchase.";}
else
{		
$SQL = "INSERT into inventory(pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff,buffname,uses) VALUES ('$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$iteminfo3[value]','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]','$iteminfo3[buffname]','$iteminfo3[uses]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from shop inventory");
$updateshop="Update shops set cash=cash+'$iteminfo3[value]' where id='$shopinfo3[id]'";
		      mysql_query($updateshop) or die("Could not update shop stats");
$updateplayer="Update players set cash=cash-'$iteminfo3[value]'  where name='$playerinfo3[name]'";
		      mysql_query($updateplayer) or die("Could not update player stats");	
echo "<center>" . $iteminfo3['name'] . " has been added to your Inventory.";	  

}}
/////////////////////////////////look at items to add to market////
	if(isset($_GET['ai']))
	{
	$bypass=1;
	$noitems = 0;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
 echo "<small>";

	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from inventory where pid='$playerinfo3[name]' AND type='plant'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td><img src='images/blank1.png' width='90px'/></td><td><img src='images/blank1.png' width='30px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$selectbackpack3[buffname]</td><td><font size='-2'>$selectbackpack3[uses]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[modd]&setprice=1&farmers=1&tag=$tag'>Add Item</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "</center>";
		 echo "</small>";
	
}
echo "<center>";
if ($noitems == 0){echo "You have no plants to sell.<br>";}
}
/////////////////////////////////////////////set price on item/////////////
if(isset($_GET['setprice']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{

$randid = $_GET['randid'];
$pid = $_GET['pid'];
$modd = $_GET['modd'];
echo "<center><br><br><form method='post' action='locations.php'>";
echo "Price of food  <input type='text' name='price' size='9'>";
echo "<input type='hidden' name='randid' value='$randid'>";
echo "<input type='hidden' name='pid' value='$pid'>";
echo "<input type='hidden' name='modd' value='$modd'>";
echo "<input type='hidden' name='insert' value='1'>";
echo "<input type='hidden' name='farmers' value='1'>";
echo "<input type='hidden' name='tag' value='$tag'>";
echo "<br><br><input type='submit' value='Add Item'>";
echo "</form></big>";

}}


///////////////////////////////////////add item to market/////////////
if(isset($_POST['insert']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
$randid = $_POST['randid'];
$pid = $_POST['pid'];
$modd = $_POST['modd'];
$price = $_POST['price'];

$iteminfo="SELECT * from inventory where pid='$playerinfo3[name]' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
$SQL = "INSERT into shopinventory(shid,pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff,buffname,uses) VALUES ('$shopinfo3[id]','$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$price','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]','$iteminfo3[buffname]','$iteminfo3[uses]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from inventory where pid='$pid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from iventory");
echo "<center>" . $iteminfo3['name'] . " has been added to your Market.";	  
}
}
///////////////////////////////////Market main menu////////////////////////
if($bypass != 1)
{ 

echo "<center><big>" . $shopinfo3['greeting'] . "</big><br><br>";

echo "<a href='locations.php?tag=$tag&farmers=1&MS=1'>Browse Goods<br></a>";

if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<br><u>Shop Owner Panel</u><br>";
echo "<a href='locations.php?tag=$tag&farmers=1&ai=1'>Add items to Makrket<br></a>";

}
}
echo "<br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Leave'>";
echo "</form></center></big>";
}




//////////////////////////////////////////////////////////Workshop//////////////////
if(isset($workshop))
{
echo "<big><u>Workshop</u></big><br><br>";

///////////////////////////////////////buy workshop goods///////////////
if(isset($_GET['MS']))
	{
	$bypass=1;
	$noitems = 0;
	 echo "<small>";
	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from shopinventory where shid='$shopinfo3[id]' AND type='crafting' AND isedible=0";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td><img src='images/blank1.png' width='90px'/></td><td><img src='images/blank1.png' width='30px'/></td><td><td><img src='images/blank1.png' width='75px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$$selectbackpack3[value]</td><td><font size='-2'>$selectbackpack3[buffname]</td><td><font size='-2'>$selectbackpack3[uses]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&shid=$selectbackpack3[shid]&modd=$selectbackpack3[modd]&bought=1&tag=$tag&workshop=1'>Buy</td></tr>";
	   $noitems = 1;
	   }
      print "</table>";
      print "</td></tr></table>";    
      print "</center><center>";
		 echo "</small>";
		if ($noitems == 0){echo "There are no materials in this store. Check back later<br>";}
		
	}
	///////////////////////////////////////buy items from workshop/////////////
if(isset($_GET['bought']))
	{
	$bypass=1;
	$randid = $_GET['randid'];
$shid = $_GET['shid'];
$modd = $_GET['modd'];
$iteminfo="SELECT * from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
	if($playerinfo3[cash] < $iteminfo3[value])
	{echo "<center>You Do not have enough Cash for this purchase.";}
else
{		
$SQL = "INSERT into inventory(pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff,buffname,uses) VALUES ('$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$iteminfo3[value]','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]','$iteminfo3[buffname]','$iteminfo3[uses]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from shop inventory");
$updateshop="Update shops set cash=cash+'$iteminfo3[value]' where id='$shopinfo3[id]'";
		      mysql_query($updateshop) or die("Could not update shop stats");
$updateplayer="Update players set cash=cash-'$iteminfo3[value]'  where name='$playerinfo3[name]'";
		      mysql_query($updateplayer) or die("Could not update player stats");	
echo "<center>" . $iteminfo3['name'] . " has been added to your Inventory.";	  

}}
/////////////////////////////////look at items to add to workshop////
	if(isset($_GET['ai']))
	{
	$bypass=1;
	$noitems = 0;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
 echo "<small>";

	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from inventory where pid='$playerinfo3[name]' AND type='crafting' AND isedible='0'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td><img src='images/blank1.png' width='90px'/></td><td><img src='images/blank1.png' width='30px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$selectbackpack3[buffname]</td><td><font size='-2'>$selectbackpack3[uses]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[modd]&setprice=1&workshop=1&tag=$tag'>Add Item</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "</center>";
		 echo "</small>";
	
}
echo "<center>";
if ($noitems == 0){echo "You have no materials to sell.<br>";}
}
/////////////////////////////////////////////set price on item/////////////
if(isset($_GET['setprice']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{

$randid = $_GET['randid'];
$pid = $_GET['pid'];
$modd = $_GET['modd'];
echo "<center><br><br><form method='post' action='locations.php'>";
echo "Price of material  <input type='text' name='price' size='9'>";
echo "<input type='hidden' name='randid' value='$randid'>";
echo "<input type='hidden' name='pid' value='$pid'>";
echo "<input type='hidden' name='modd' value='$modd'>";
echo "<input type='hidden' name='insert' value='1'>";
echo "<input type='hidden' name='workshop' value='1'>";
echo "<input type='hidden' name='tag' value='$tag'>";
echo "<br><br><input type='submit' value='Add Item'>";
echo "</form></big>";

}}


///////////////////////////////////////add item to workshop/////////////
if(isset($_POST['insert']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
$randid = $_POST['randid'];
$pid = $_POST['pid'];
$modd = $_POST['modd'];
$price = $_POST['price'];

$iteminfo="SELECT * from inventory where pid='$playerinfo3[name]' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
$SQL = "INSERT into shopinventory(shid,pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff,buffname,uses) VALUES ('$shopinfo3[id]','$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$price','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]','$iteminfo3[buffname]','$iteminfo3[uses]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from inventory where pid='$pid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from iventory");
echo "<center>" . $iteminfo3['name'] . " has been added to your Workshop.";	  
}
}



///////////////////////////////////////craft weapon/////////////
if(isset($_GET['cw']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<center><u>Select a Recipe</u><br>";
$recipeinfo="SELECT * from recipes where level<='$playerinfo3[weaponsmith]' AND type='weaponsmith'";
      $recipeinfo2=mysql_query($recipeinfo) or die("could not get recipes");
     while($recipeinfo3=mysql_fetch_array($recipeinfo2))
      {
	  echo "<a href='crafting.php?tag=$tag&type=weaponsmith&recipe=$recipeinfo3[name]'>$recipeinfo3[name]<br></a>";
	  }
	  
	  
	  
	  
	  }}

///////////////////////////////////workshop main menu////////////////////////
if($bypass != 1)
{ 

echo "<center><big>" . $shopinfo3['greeting'] . "</big><br><br>";

echo "<a href='locations.php?tag=$tag&workshop=1&MS=1'>Browse Materials<br></a>";

if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<br><u>Shop Owner Panel</u><br>";
echo "<a href='locations.php?tag=$tag&workshop=1&ai=1'>Add materials to sell<br></a>";
echo "<a href='locations.php?tag=$tag&workshop=1&cw=1'>Craft Weapon<br></a>";

}
}


echo "<br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Leave'>";
echo "</form></center></big>";
}

//////////////////////////////////////////////////////////apparel//////////////////
if(isset($apparel))
{
echo "<big><u>Apparel</u></big><br><br>";

///////////////////////////////////////buy apparel goods///////////////
if(isset($_GET['MS']))
	{
	$bypass=1;
	$noitems = 0;
	 echo "<small>";
	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from shopinventory where shid='$shopinfo3[id]' AND type='crafting' AND isedible=0";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td><td><img src='images/blank1.png' width='75px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><font size='-2'>$$selectbackpack3[value]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&shid=$selectbackpack3[shid]&modd=$selectbackpack3[modd]&bought=1&tag=$tag&apparel=1'>Buy</td></tr>";
	   $noitems = 1;
	   }
      print "</table>";
      print "</td></tr></table>";    
      print "</center><center>";
		 echo "</small>";
		if ($noitems == 0){echo "There are no materials in this store. Check back later<br>";}
		
	}
	///////////////////////////////////////buy items from apparel/////////////
if(isset($_GET['bought']))
	{
	$bypass=1;
	$randid = $_GET['randid'];
$shid = $_GET['shid'];
$modd = $_GET['modd'];
$iteminfo="SELECT * from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
	if($playerinfo3['cash'] < $iteminfo3['value'])
	{echo "<center>You Do not have enough Cash for this purchase.";}
else
{		
$SQL = "INSERT into inventory(pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff) VALUES ('$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$iteminfo3[value]','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from shopinventory where shid='$shid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from shop inventory");
$updateshop="Update shops set cash=cash+'$iteminfo3[value]' where id='$shopinfo3[id]'";
		      mysql_query($updateshop) or die("Could not update shop stats");
$updateplayer="Update players set cash=cash-'$iteminfo3[value]'  where name='$playerinfo3[name]'";
		      mysql_query($updateplayer) or die("Could not update player stats");	
echo "<center>" . $iteminfo3['name'] . " has been added to your Inventory.";	  

}}
/////////////////////////////////look at items to add to apparel////
	if(isset($_GET['ai']))
	{
	$bypass=1;
	$noitems = 0;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
 echo "<small>";

	  print "<center>";
      print "<table border='0' width='90%' cellspacing='10'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='85%'>";
      $selectbackpack="SELECT * from inventory where pid='$playerinfo3[name]' AND type='crafting' AND isedible='0'";
      $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
      print "<table border='0' bordercolor='white' bgcolor='#00000'>";
      print "<tr><td></td><td><img src='images/blank1.png' width='120px'/></td><td><img src='images/blank1.png' width='140px'/></td><td></td></tr>";
      while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
       print "<tr><td><img src='images/materials/$selectbackpack3[pic].png'/></td><td><font size='-2'>$selectbackpack3[name]</td><td><font size='-2'>$selectbackpack3[descript]</td><td><A href='locations.php?randid=$selectbackpack3[randid]&pid=$selectbackpack3[pid]&modd=$selectbackpack3[modd]&setprice=1&apparel=1&tag=$tag'>Add Item</td></tr>";
	   $noitems = 1;
	       }
      print "</table>";
      print "</td></tr></table>";    
      print "</center>";
		 echo "</small>";
	
}
echo "<center>";
if ($noitems == 0){echo "You have no materials to sell.<br>";}
}
/////////////////////////////////////////////set price on item/////////////
if(isset($_GET['setprice']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{

$randid = $_GET['randid'];
$pid = $_GET['pid'];
$modd = $_GET['modd'];
echo "<center><br><br><form method='post' action='locations.php'>";
echo "Price of material  <input type='text' name='price' size='9'>";
echo "<input type='hidden' name='randid' value='$randid'>";
echo "<input type='hidden' name='pid' value='$pid'>";
echo "<input type='hidden' name='modd' value='$modd'>";
echo "<input type='hidden' name='insert' value='1'>";
echo "<input type='hidden' name='apparel' value='1'>";
echo "<input type='hidden' name='tag' value='$tag'>";
echo "<br><br><input type='submit' value='Add Item'>";
echo "</form></big>";

}}


///////////////////////////////////////add item to apparel/////////////
if(isset($_POST['insert']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
$randid = $_POST['randid'];
$pid = $_POST['pid'];
$modd = $_POST['modd'];
$price = $_POST['price'];

$iteminfo="SELECT * from inventory where pid='$playerinfo3[name]' AND randid='$randid' AND modd='$modd'";
    $iteminfo2=mysql_query($iteminfo) or die("Could not get iteminfo");
    $iteminfo3=mysql_fetch_array($iteminfo2);
		$randid2 = rand(1000,999999999);
$SQL = "INSERT into shopinventory(shid,pid,name,descript,value,modtype,modd,randid,pic,isedible,type,buff) VALUES ('$shopinfo3[id]','$playerinfo3[name]','$iteminfo3[name]','$iteminfo3[descript]','$price','$iteminfo3[modtype]','$iteminfo3[modd]','$randid2','$iteminfo3[pic]','$iteminfo3[isedible]','$iteminfo3[type]','$iteminfo3[buff]')"; mysql_query($SQL) or die("could not add to shop");

$updateback="DELETE from inventory where pid='$pid' AND randid='$randid' AND modd='$modd'";
	  mysql_query( $updateback) or die("Could not delete from iventory");
echo "<center>" . $iteminfo3['name'] . " has been added to your Apparel.";	  
}
}



///////////////////////////////////////craft Armor/////////////
if(isset($_GET['cw']))
	{
	$bypass=1;
	if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<center><u>Select a Recipe</u><br>";
$recipeinfo="SELECT * from recipes where level<='$playerinfo3[armorsmith]' AND type='armorsmith'";
      $recipeinfo2=mysql_query($recipeinfo) or die("could not get recipes");
     while($recipeinfo3=mysql_fetch_array($recipeinfo2))
      {
	  echo "<a href='crafting.php?tag=$tag&type=armorsmith&recipe=$recipeinfo3[name]'>$recipeinfo3[name]<br></a>";
	  }
	  
	  
	  
	  
	  }}

///////////////////////////////////Apparel main menu////////////////////////
if($bypass != 1)
{ 

echo "<center><big>" . $shopinfo3['greeting'] . "</big><br><br>";

echo "<a href='locations.php?tag=$tag&apparel=1&MS=1'>Browse Materials<br></a>";

if ($playerinfo3['name'] == $shopinfo3['pid'])
{
echo "<br><u>Shop Owner Panel</u><br>";
echo "<a href='locations.php?tag=$tag&apparel=1&ai=1'>Add materials to sell<br></a>";
echo "<a href='locations.php?tag=$tag&apparel=1&cw=1'>Craft Armor<br></a>";

}
}


echo "<br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Leave'>";
echo "</form></center></big>";
}




echo "</td>";

?>
</td>
<td>
<div id="rpanelarea">
<?php
include_once 'rstatpanel.php';
?>
</div>
</td>
</tr>
</table>
</div>


</body>
</html>
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Videos

Post by hallsofvallhalla »

oh i see the problem

Code: Select all

$tag = $_GET['tag'];
$doctor = $_GET['doctor'];
$sporting = $_GET['sporting'];
$house = $_GET['house'];
$clothing = $_GET['clothing'];
$cafe = $_GET['cafe'];
$farmers = $_GET['farmers'];
$workshop = $_GET['workshop'];
$apparel = $_GET['apparel'];
should be

Code: Select all

if(isset($_GET['tag'])) {$tag = $_GET['tag'];}
if(isset($_GET['doctor'])) {$doctor = $_GET['doctor'];}
if(isset($_GET['sporting'])) {$sporting = $_GET['sporting'];}
if(isset($_GET['house'])) {$house = $_GET['house'];}
......
and so on

i will fix tomorrow and update all code and reupload.
alexrules01
Posts: 175
Joined: Sun Oct 11, 2009 9:33 am

Re: Videos

Post by alexrules01 »

Ahh thanks Halls, that'd be great :D
Post Reply

Return to “Hall's Games”