<?php
$all = mysql_query("SELECT * FROM `pytox_ting` ORDER BY `id`") or die(mysql_error());
?>
<i>PyCo = PyCoins</i>
<br />
Der er ialt&nbsp;
<?php
if (mysql_num_rows($all) == 0) {
print "ingen ejede ting.";
} else if (mysql_num_rows($all) == 1) {
print "en ejet ting.";
} else if (mysql_num_rows($all) >= 2) {
print mysql_num_rows($all)." ejede ting.";
} else {
print "ERROR!";
}
?>
<br />
<br />
<table class="blackborder" cellpadding="3" cellspacing="1">
<?php

$perlinje = 4;

	for ($i = 0;$i <= mysql_num_rows($all);$i = $i+$perlinje) {
?>
 <tr><!--start-->
<?php
//print "Stadium 1|-";


$inry = "SELECT * FROM `pytox_ting` ORDER BY `id` ASC LIMIT ".$i.", ".$perlinje;
$query['tagwall'] = mysql_query($inry) or die(mysql_error());

while ($tag = mysql_fetch_array($query['tagwall'])) {

//print "Stadium 2|-";

if ($u == 0) {
$u = 1;
$bgcolor = "#CCC";
$color = "#000";
} else if ($u == 1) {
$u = 0;
$bgcolor = "#FFF";
$color = "#000";
} else {
$u = 1;
$bgcolor = "#CCC";
$color = "#000";
}

//print "<strong>".$tag[id]."</strong>";

$thinginfo = mysql_query("SELECT * FROM `pytox_tingdb` WHERE `id` LIKE '{$tag[thingid]}' LIMIT 1") or die(mysql_error());
while ($info = mysql_fetch_array($thinginfo)) {
//print "Stadium 3|-";
?>
  <td style="background-color:<?=$bgcolor?>;color:<?=$color?>" align="center" valign="top">
<img src="<?=$info[image]?>" style="border:1px solid #000;" alt="<?=$info[name]?>" title="<?=$info[name]?>"  />
<br />
<strong>Navn</strong>: <?=$info[name]?>
<br />
<strong>Ting-id</strong>: <?=$tag[id]?>
<br />
<strong>Værdi</strong>: <?=$info[price]?> PyCo
<br />
<?php
$resale = $tag[bought]/2;
$resaleprint = settype($resale, 'integer');
?>
<strong>Gensalgsværdi</strong>: <?=round($resale)?> PyCo
<br />
<?php
$owner = mysql_query("SELECT * FROM `pytox_community` WHERE `id` LIKE '{$tag[owner]}' LIMIT 1") or die(mysql_error());
while ($ejer = mysql_fetch_array($owner)) {
print "<strong>Ejer</strong>: <a href=\"?site=Com.users&amp;userid=".$ejer[id]."\">".$ejer[bruger]."</a>";
?>
<br />
<strong>På lager</strong>: <?=$info[instore]?>
<?php
} //slutter $ejer
} //slutter $info
?>
  </td>
<?php

}//slutter $tag
print "</tr>";
	}//slutter for-statement
?>
</table>