beste cp
ik heb een vraag ik snap hier even niet veel van.
ik heb een veiling gekregen maar volgens mij mis ik db gegevens.
Zouden jullie even willen helpen.
dit zijn de fout meldingen:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gofie/domains/downup-terror.nl/public_html/markt_gebouwen.php on line 54
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gofie/domains/downup-terror.nl/public_html/markt_gebouwen.php on line 57
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gofie/domains/downup-terror.nl/public_html/markt_gebouwen.php on line 60
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gofie/domains/downup-terror.nl/public_html/markt_gebouwen.php on line 83
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gofie/domains/downup-terror.nl/public_html/markt_gebouwen.php on line 87
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/gofie/domains/downup-terror.nl/public_html/markt_gebouwen.php on line 302
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/gofie/domains/downup-terror.nl/public_html/markt_gebouwen.php on line 302
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/gofie/domains/downup-terror.nl/public_html/markt_gebouwen.php on line 302
<?php
include_once 'includes/config.php';
logincheck();
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='".$data['login']."'");
?>
<div class="contentGreyTitle"><h1>Veiling</h1></div>
<div class="contentText">
<tr>
<table width="100%">
<tr><td class="subtitle">Veiling</td></tr>
<tr>
<td class="maintxt">
<img src="/images/icons/building.png" /><i><b><a href="index-v1.php?p=markt_gebouwen"><b>Bezittingen</a></i></b>
</td>
</tr>
</table>
</br>
<table cellpadding="5" cellspacing="0" width="100%">
<tr class="grey">
<tr>
<td class="container" colspan="4">
<?php
$staten = array(
1 => "Nederland",
2 => "Duitsland",
3 => "Engeland",
4 => "Frankrijk",
5 => "Griekenland",
6 => "Italië",
7 => "België",
);
$gebouwen = array(
"Gevangenis","Ziekenhuis","Bank","shop","luchthaven","garage","sportschool","handdrukken","huwelijk","veiling"
);
$bezitsql = mysql_query("SELECT `land_id`, `winst_hour`, `winst`, `bezit_id` FROM `bezit` WHERE `owner`=".ID." LIMIT 1");
$bezit = mysql_fetch_assoc($bezitsql);
$kfsql = mysql_query("SELECT `land_id`, `winst_hour`, `winst`, `productie`, `prijs`, `kogels` FROM `kf` WHERE `owner`=".ID." LIMIT 1");
$kf = mysql_fetch_assoc($kfsql);
$rldsql = mysql_query("SELECT `land_id`, `winst_hour`, `ramen`, `winst` FROM `rld` WHERE `owner`=".ID." LIMIT 1");
$rld = mysql_fetch_assoc($rldsql);
$bezitt = mysql_query("SELECT `land_id`, `winst_hour`, `winst`, `bezit_id` FROM `bezit` WHERE `owner`=".ID." AND `bezit_id`=".$_POST['gebouw']." LIMIT 1");
$open = true;
if(date('i') == 59 || date('i') == 0){
$open = false;}
$types = array(1 => "hoeren", "eerpunten", "bezittingen", "credits",);
$types2 = array(1 => "Hoeren", "Eerpunten",);
if(isset($_GET['x']) && ctype_digit($_GET['x']) && $_GET['x'] > 0 && $_GET['x'] > 0 && $_GET['x'] < 5)
{
$x = $_GET['x'];
}
else
{
$x = 4;
}
$type = $types[$x];
$type2 = $types2[$x];
$besh = false;
$besh = false;
$s = mysql_query("SELECT `bescherming` FROM `status` WHERE `id`=".ID);
$r = mysql_fetch_assoc($s);
$bescherming = $r['bescherming'];
$s = mysql_query("SELECT `registerDate` FROM `[users]` WHERE `id`=".ID);
$r = mysql_fetch_assoc($s);
$rTime = strtotime($r['registerDate']);
$rDiff = time() - $rTime;
if($rDiff < (60*60*24*2) && $bescherming == 0){
$besh = true;
}
$sql = mysql_query("SELECT MIN(`id`) AS `min` FROM `markt_bezit`");
$res = mysql_fetch_assoc($sql);
$min = $res['min'];
$sql = mysql_query("SELECT MAX(`id`) AS `max` FROM `markt_bezit`");
$res = mysql_fetch_assoc($sql);
if(mysql_num_rows($sql) == 0){
$min = 0;
$max = 0;
} else {
$max = $res['max'];
}
$this_h = mysql_query("SELECT `id` FROM `markt_bezit` WHERE `uur`=1");
$this_hour = mysql_num_rows($this_h);
$numAdd = mysql_query("SELECT `id` FROM `markt_bezit` WHERE `type`='3' AND `user_id`=".ID);
$numAdd = mysql_num_rows($numAdd);
if(count($_POST) > 0){
$key = array_search("Bieden", $_POST);
$arr = explode("_", $key);
if(count($arr) == 3){
$land_id = $arr[2];
$bezit_id = $arr[1];
}
if(isset($_POST['bod_'.$bezit_id.'_'.$land_id])){
if(!ctype_digit($bezit_id)){
$msg = bad("Je hebt op een ongeldig item geboden!");
} elseif($__dona == 0){
$msg_m = bad("Je moet minimaal <b><span class=donator>donateur</span> </b> zijn om op de markt te kunnen handelen!<br><a href=?=creditshop>Klik hier om <b><span class=donator>donateur</span></b> te worden.");
} elseif($data['username'] == $naam){
$msg = bad("Je kan niet op je eigen ".strtolower($type)." bieden!");
} elseif(!isset($_POST['bod_'.$bezit_id.'_'.$land_id])){
$msg = bad("Je hebt geen bod ingevoerd!");
} elseif($besh){
$msg = bad("Je staat nog onder bescherming!");
} elseif(!$open){
$msg = bad("De markt is gesloten! Alle transacties worden nu afgehandeld!");
} else {
$bod = $_POST['bod_'.$bezit_id.'_'.$land_id];
$owner = getowner($bezit_id, $land_id);
$data = mysql_query("SELECT `bieder`, `bied_bod`, `high_bod` FROM `markt_bezit` WHERE `land_id`=".$land_id." AND `bezit_id`=".$bezit_id." LIMIT 1");
$data = mysql_fetch_assoc($data);
$fam_bieder = getFam($data['bieder']);
if(getFamPoses($bezit_id, $famID) >= 2 && (($fam_bieder != $famID) && $famID != 0)){
$msg = bad("Je familie heeft al 2 <b>".$gebouwen[$bezit_id]."!</b><br> Let op: biedingen op de markt tellen ook mee!");
} elseif(hasPoses($bezit_id) > 0){
$msg = bad("Je hebt al een <b>".$gebouwen[$bezit_id]."!</b><br> Let op: biedingen op de markt tellen ook mee!");
} elseif($__dona == 0){
$msg_m = bad("Je moet minimaal <b><span class=donator>donateur</span> </b> zijn om op de markt te kunnen handelen!<br><a href=?=creditshop>Klik hier om <b><span class=donator>donateur</span></b> te worden.");
} elseif(!ctype_digit($bod) || strlen($bod) > 10){
$msg = bad("Je hebt een ongeldig bod ingevoerd!");
} elseif($owner == ID){
$msg = bad("Je kan niet op je eigen gebouw bieden!");
} elseif($data['bieder'] == ID){
$msg = bad("Je bent al de hoogste bieder op dit gebouw!");
} elseif($bod > $bank){
$msg = bad("Je hebt niet genoeg geld op je bank staan om hierop te kunnen bieden!");
} elseif($bod < ($data['bied_bod'] + 5000)){
$msg = bad("Je moet <b>minimaal \$5,000</b> overbieden!");
} else {
if($bod < $data['high_bod']){
$add = $bod - $data['bied_bod'];
$msg = bad("Er is al hoger geboden dan jouw bod! Bied nog een keer!");
mysql_query("UPDATE `markt_bezit` SET `bied_bod`=`bied_bod`+".$add." WHERE `land_id`=".$land_id." AND `bezit_id`=".$bezit_id." LIMIT 1");
} else {
mysql_query("UPDATE `[users]` SET `cash`=`cash`-".$bod." WHERE `id`=".ID);
mysql_query("UPDATE `[users]` SET `cash`=`cash`+".$data['high_bod']." WHERE `id`=".$data['bieder']);
mysql_query("UPDATE `markt_bezit` SET `high_bod`=".$bod.", `bied_bod`=".$bod.", `bieder`=".ID." WHERE `land_id`=".$land_id." AND `bezit_id`=".$bezit_id." LIMIT 1");
$msg = good("Je bod is geplaatst!");
}
}
}
}
}
if(isset($_GET['add'])){
$times = array(1,2,4, 8, 12, 18, 24);
$set = false;
if(isset($_POST['add'])){
if($_POST['gebouw'] == 0){
$ssql = mysql_query("SELECT `land_id` FROM `kf` WHERE `owner`=".ID);
} elseif($_POST['gebouw'] == 1){
$ssql = mysql_query("SELECT `land_id` FROM `rld` WHERE `owner`=".ID);
} else {
$ssql = mysql_query("SELECT `land_id` FROM `bezit` WHERE `owner`=".ID." AND `bezit_id`=".$_POST['gebouw']." LIMIT 1");
$bezitt = mysql_query("SELECT `land_id`, `winst_hour`, `winst`, `bezit_id` FROM `bezit` WHERE `owner`=".ID." AND `bezit_id`=".$_POST['gebouw']." LIMIT 1");
}
$time = $_POST['time'];
$bbod = $_POST['bbod'];
$gebouw = $_POST['gebouw'];
$rres = mysql_fetch_assoc($ssql);
$lID = $rres['land_id'];
$msql = mysql_query("SELECT `uur` FROM `markt_bezit` WHERE `bezit_id`='".$_POST['gebouw']."' AND `land_id`='".$lID."' LIMIT 1");
if(mysql_num_rows($msql) == 1){
$msg_m = bad("Dit gebouw staat al op de markt!");
} elseif($__dona == 0){
$msg_m = bad("Je moet minimaal <b><span class=donator>donateur</span> </b> zijn om op de markt te kunnen handelen!<br><a href=?=creditshop>Klik hier om <b><span class=donator>donateur</span></b> te worden.");
} elseif($data['username'] == $naam){
$msg_m = bad("Je kan niet op je eigen gebouw bieden!");
} else if(!$open){
$msg_m = bad("De markt is gesloten! Alle transacties worden nu afgehandeld!");
$set = true;
} elseif(!array_key_exists($time, $times)){
$msg_m = bad("Je hebt een ongeldige tijd opgegeven!");
} elseif(!ctype_digit($bbod) || $bbod < 1000000 || strlen($bbod) > 10){
$msg_m = bad ("Het startbod moet minimaal \$1,000,000 zijn!");
} elseif($numAdd >= 5){
$msg_m = bad("Je mag maximaal <b>5</b> keer gebouwen aanbieden!");
$set = true;
} elseif($bbod > 999999999999){
$msg_m = bad("Het startbod mag maximaal <b>\$999,999,999,999</b> zijn!");
} elseif($besh){
$msg_m = bad("Je staat nog onder bescherming!");
}elseif(mysql_num_rows($kfsql) == 0 AND $_POST['gebouw'] == 0){
$msg_m = bad("Je hebt deze bezit niet!");
}elseif(mysql_num_rows($rldsql) == 0 AND $_POST['gebouw'] == 1){
$msg_m = bad("Je hebt deze bezit niet!");
}elseif(mysql_num_rows($bezitt) == 0 AND $_POST['gebouw'] >= 3){
$msg_m = bad("Je hebt geen ".$gebouwen[$_POST['gebouw']]."!");
} else {
if($_POST['gebouw'] == 0){
mysql_query("INSERT INTO `markt_bezit`
(`bezit_id`, `land_id`, `user_id`, `high_bod`, `bied_bod`, `uur`, `type`)
VALUES
('0', ".$kf['land_id'].", ".ID.", ".$bbod.", ".$bbod.", ".$times[$time].", '3')
");
} elseif($_POST['gebouw'] == 1){
mysql_query("INSERT INTO `markt_bezit`
(`bezit_id`, `land_id`, `user_id`, `high_bod`, `bied_bod`, `uur`, `type`)
VALUES
('1', ".$rld['land_id'].", ".ID.", ".$bbod.", ".$bbod.", ".$times[$time].", '3')
");
}elseif($_POST['gebouw'] >= 0){
mysql_query("INSERT INTO `markt_bezit`
(`bezit_id`, `land_id`, `user_id`, `high_bod`, `bied_bod`, `uur`, `type`)
VALUES
('".$_POST['gebouw']."', ".$bezit['land_id'].", ".ID.", ".$bbod.", ".$bbod.", ".$times[$time].", '3')
");
$msg_m = good("Je hebt je <b>".$gebouwen[$_POST['gebouw']]."</b> te koop gezet!");
$set = true;
}
}
}
?>
<?
if(isset($_GET['add']) == true){
?>
<form method="post" action="index-v1.php?p=markt_gebouwen&add=true">
<table border='0' cellspacing='1' width='50%' bgcolor='#000' align='center'>
<tr>
<td class='subtop' colspan='2'>
Bezittingen verkopen
</td>
</tr>
<?php
if(isset($msg_m)){
echo "<tr>
<td class='inhoud' colspan='2'>
".$msg_m."
</td>
</tr>";
}
?>
<tr>
<td class='inhoud' width='40%'>
<img src='images/icons/building.png' alt=''''> Bezittingen:
</td>
<td class='inhoud' width='60%'>
<?PHP
if(mysql_num_rows($bezitsql) == 0 && mysql_num_rows($kfsql) == 0 && mysql_num_rows($rldsql) == 0){
echo "<select name='gebouw'></select>";
} else {
echo'
<select name="gebouw">
<option value="0" selected="selected">Kogelfabriek</option>
<option value="1">Red Light District</option>
<option value="2">Bank</option>
<option value="3">Uitrustingwinkel</option>
<option value="4">Makelaardij</option>
<option value="5">Ziekenhuis</option>
<option value="6">Garage</option>
<option value="7">Vliegveld</option>
<option value="8" >Dobbelen</option>
<option value="9">Racetrack</option>
<option value="10">Cardwar</option>
<option value="11">Keno</option>
<option value="12">Blackjack</option>
<option value="13">Slot Machine</option>
<option value="14">Loterij</option>
<option value="15">Roulette</option>
</select>
';
}
?>
</td>
</tr>
<tr>
<td class='inhoud' width='40%'>
<img src='images/icons/money.png' alt=''''> Begin bod:
</td>
<td class='inhoud' width='60%'>
<input type='text' name='bbod' maxlenght='10'>
</td>
</tr>
<tr>
<td class='inhoud' width='40%'>
<img src='images/icons/clock.png' alt=''''> Tijd:
</td>
<td class='inhoud' width='60%'>
<select name='time'>
<?php
foreach($times AS $id => $t){
echo "<option value='".$id."'>".$t." uur</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td class='inhoud' width='40%'>
</td>
<td class='inhoud' width='60%'>
<input type='submit' name='add' value='Bezittingen Aanbieden' />
</td>
</tr>
</table>
<br>
<?
}
}
?>
<a href="index-v1.php?p=markt_gebouwen&add=true"><b>Plaats bezittingen op de markt</b></a><br /><br />
<form method="post" action="index-v1.php?p=markt_gebouwen">
<table border='0' cellspacing='1' width='98%' bgcolor='#000' align='center'>
<tr>
<td class="subtop" width="5%">
<b>#</b>
</td>
<td class="subtop" width="20%">
<b>Type</b>
</td>
<td class="subtop" width="14%">
<b>Eigenaar</b>
</td>
<td class="subtop" width="14%">
<b>Bieder</b>
</td>
<td class="subtop" width="14%">
<b>Tijd</b>
</td>
<td class="subtop" width="14%">
<b>Hoogste Bod</b>
</td>
<td class="subtop" width="22%">
<b>Bieden</b>
</td>
</tr>
<?php
if(isset($msg)){
echo "<tr>
<td class='inhoud' colspan='8'>
".$msg."
</td>
</tr>
";
}
?>
<?php
$i = 1;
$sql = mysql_query("SELECT `id`, `bieder` , `high_bod` , `bied_bod` , `uur` , `user_id`, `bezit_id` , `land_id` FROM
`markt_bezit` ORDER BY `uur` ASC, `bezit_id` ASC , `land_id` ASC");
while($res = mysql_fetch_assoc($sql)){
if($i / 2 != round($i / 2)){
$color = "464646";
}else {
$color = "4C4C4C";
}
echo "
<tr>
<td class='inhoud_c' width='5%' style='padding: 2px; background-color: #$color'>
".$i."
</td>
<td class='inhoud_c' width='20%' style='padding: 2px; background-color: #$color'>
".$gebouwen[$res['bezit_id']]." ".$staten[$res['land_id']]."
</td>
<td class='inhoud_c' width='14%' style='padding: 2px; background-color: #$color'>
";
if($res['user_id']){
$nam = getname($res['user_id']);
echo "<a href='profile.php?x=".$nam."'>".$nam."</a>";
} else {
echo "Geen";
}
echo "
</td>
<td class='inhoud_c' width='14%' style='padding: 2px; background-color: #$color'>
";
if($res['bieder'] == 0){
echo "Geen";
} else {
$name = getname($res['bieder']);
echo "<a href='profile.php?x=".$name."'>".$name."</a>";
}
echo "
</td>
<td class='inhoud_c' width='14%' style='padding: 2px; background-color: #$color'>
".$res['uur']." uur
</td>
<td class='inhoud_c' width='14%' style='padding: 2px; background-color: #$color'>
$".number_format($res['bied_bod'])."
</td>
<td class='inhoud_c' width='22%' style='padding: 2px; background-color: #$color'>
<input type='text' style='width: 80px;' name='bod_".$res['bezit_id']."_".$res['land_id']."' value='".($res['bied_bod'] + 5000)."' maxlength='10'>
<input type='submit' name='bied_".$res['bezit_id']."_".$res['land_id']."' value='Bieden'>
</td>
</tr>
";
$i++;
}
if(mysql_num_rows($sql) == "0"){
echo"<tr><td class='inhoud' colspan='10'>";
echo ("Er staan geen items op de markt!");
echo"</td></tr>";
}
?>
</table></table>
</div>
</tr>
Toon Meer