Jump to content
MakeWebGames

Cars


-BRAIDZ-

Recommended Posts

I want where it says "Tune" I want under it, Tune in green where you can click on it and it takes you to tune.php

You may have yo add it to your game to actually see what I mean

 

garage.php:

<?php
require_once "globals.php";
if(!$_GET['st'] ) { $_GET['st']=0; }
$start=abs((int) $_GET['st']);
$cpp=20;
print "<div class='generalinfo_txt'>
<div><img src='images/info_left.jpg' alt='' /></div>
<div class='info_mid'><h2 style='padding-top:10px;'> Garage </h2></div>
<div><img src='images/info_right.jpg' alt='' /></div> </div>
<div class='generalinfo_simple'> 
<h3>Your Garage</h3><hr />
> <a href='caryard.php'><font color='red'>Buy A Car (Car Yard)</font></a>
> <a href='carmarket.php'><font color='red'>Buy A Car (Car Market)</font></a>
> <a href='sellcar.php'><font color='red'>Sell Car (On The Car Market)</font></a><hr /><h3>Your Cars</h3>";
$q=mysql_query("SELECT cpcPLAYER FROM cars_playercars WHERE cpcPLAYER=$userid", $c);
$cars=mysql_num_rows($q);
$pages=ceil($cars/$cpp);
print "Pages: ";
for($i=1; $i<=$pages; $i++)
{
$st=($i-1)*$cpp;
if($st == $start)
{
print "<b>$i</b> ";
}
else
{
print "<a href='garage.php?st=$st'>$i</a> ";
}
}
print "
<table width=100% border=6> <tr style='background:maroon'><th>Car</th><th>Acceleration</th> <th>Handling</th><th>Speed</th><th>Shield</th><th>In Challenge?</th><th>Tune</th></tr>";
$q=mysql_query("SELECT cp.*, ct.* FROM cars_playercars cp LEFT JOIN cars_types ct ON cp.cpcCAR=ct.carID WHERE cp.cpcPLAYER=$userid LIMIT $start, $cpp", $c);
$count=0;
$cars=array();
while($r=mysql_fetch_array($q))
{
$count++;
$acc=$r['cpcACCLV']*$r['carACC'];
$han=$r['cpcHANLV']*$r['carHAN'];
$spd=$r['cpcSPDLV']*$r['carSPD'];
$shd=$r['cpcSHDLV']*$r['carSHD'];
$q2=mysql_query("SELECT * FROM challenges WHERE chCHRCAR={$r['cpcID']} AND chSTATUS='open'", $c);
if (mysql_num_rows($q)  == 0) { $challenge="<font color='red'>blue</font>"; } else { $challenge="<font color='red'>No</font>"; }
print "<tr><td>{$r['carNAME']} </td> <td>Lv{$r['cpcACCLV']} ($acc)</td>  <td>Lv{$r['cpcHANLV']} ($han)</td> <td>Lv{$r['cpcSPDLV']} ($spd)</td> <td>Lv{$r['cpcSHDLV']} ($shd)</td><td>$challenge</td> </td> </tr>";
$cars[$r['cpcID']]="{$r['carNAME']} - {$r['cpcACCLV']}/{$r['cpcHANLV']}/{$r['cpcSPDLV']}/{$r['cpcSHDLV']}";
}
if($count == 0) { print "<tr><th colspan=6>No Cars In Your Garage</th></tr>"; }
print "</table>";
$totalraces=$ir['cars_races_won']+$ir['cars_races_lost'];
$races_highstakes=$ir['cars_won']+$ir['cars_lost'];
if($ir['cars_races_income'] > 0)
{
$income = '<font color="green">$'.number_format($ir['cars_races_income'])."</font>";
}
else if($ir['cars_races_income'] == 0)
{
$income='$0';
}
else
{
$income = '<font color="red">-$'.number_format(abs($ir['cars_races_income']))."</font>";
}
print "<hr />
<h3>Your Driver's Record</h3>
<table width=100% border=6>
<tr>
<td width='50%'>Cars Owned</td>
<td width='50%'>{$ir['cars_owned']}</td>
</tr>
<tr>
<td>Cars Won In Races</td>
<td>{$ir['cars_won']}</td>
</tr>
<tr>
<td>Cars Lost In Races</td>
<td>{$ir['cars_lost']}</td>
</tr>
<tr>
<td>Challenges Sent</td>
<td>{$ir['cars_challs_sent']}</td>
</tr>
<tr>
<td>Challenges Accepted</td>
<td>{$ir['cars_challs_accpt']}</td>
</tr>
<tr>
<td>Challenges Declined</td>
<td>{$ir['cars_challs_decln']}</td>
</tr>
<tr>
<td>Races Won</td>
<td>{$ir['cars_races_won']}</td>
</tr>
<tr>
<td>Races Lost</td>
<td>{$ir['cars_races_lost']}</td>
</tr>
<tr>
<td>Total Races</td>
<td>$totalraces</td>
</tr>
<tr>
<td>Total Income From Betted Races</td>
<td>$income</td>
</tr>
<tr>
<td>Friendly Races</td>
<td>{$ir['cars_races_friendly']}</td>
</tr>
<tr>
<td>Betted Races</td>
<td>{$ir['cars_races_betted']}</td>
</tr>
<tr>
<td>High-Stakes Races</td>
<td>{$races_highstakes}</td>
</tr>
</table>";
print "<hr />
<h3>Pending Challenges To You</h3>
<table width='90%'><tr style='background:maroon'> <th>Challenger</th> <th>When Sent?</th> <th>View</th> </tr>";
$q=mysql_query("SELECT c.*,u.* FROM challenges c LEFT JOIN users u ON c.chCHR=u.userid WHERE chCHD=$userid AND chSTATUS = 'open'", $c);
if(mysql_num_rows($q) == 0)
{
print "<tr><th colspan=3>No Pending Challenges</th></tr>";
}
else
{
while($r=mysql_fetch_array($q))
{
print "<tr><td>{$r['username']}</td> <td>".date('F j Y, g:i:s a', $r['chTIME'])."</td> <td><a href='viewchallenge.php?id={$r['chID']}'>View</a></td></tr>";
}
}
print "</table>";
print "<hr />
<h3>Pending Challenges Sent By You</h3>
<table width='90%'><tr style='background:maroon'> <th>Challenged</th> <th>When Sent?</th> <th>Cancel</th> </tr>";
$q=mysql_query("SELECT c.*,u.* FROM challenges c LEFT JOIN users u ON c.chCHD=u.userid WHERE chCHR=$userid AND chSTATUS = 'open'", $c);
if(mysql_num_rows($q) == 0)
{
print "<tr><th colspan=3>No Pending Sent Challenges</th></tr>";
}
else
{
while($r=mysql_fetch_array($q))
{
print "<tr><td>{$r['username']}</td> <td>".date('F j Y, g:i:s a', $r['chTIME'])."</td> <td><a href='cancelchallenge.php?id={$r['chID']}'>Cancel</a></td></tr>";
}
}
print "</table>";
if($count > 0)
{
print "<hr />
<h3 name=\"challenge\">Challenge Someone To A Race</h3>";
foreach($cars as $k => $v)
{
if($ir['userid'] == 241)
{
print $k." = ".$v."";
}
}
print "
<form action='makechallenge.php' method='post'>
Player ID To Challenge: <input type='text' name='id' value='".$_GET["selectprouser"]."' />
Type: <select name='type' type='dropdown'><option>Friendly</option> <option>Betted</option> <option>High-Stakes</option></select>
Car to Use: <select name='car' type='dropdown'>";
foreach($cars as $k => $v)
{
if($_GET['selectprocar'] == $k)
$selected = 'selected';
else
$selected = "youwant = \"battlefield 1942 and battlefield 2\"";
print "<option value='$k' $selected>$v</option>";
}
print "</select>
Bet (if Betted Race): <input type='text' name='bet' value='0' />
<input type='submit' value='Send Challenge' /></form>";
}
$h->endpage();
?>

 

Yes I know I need to convert it properly.

But it's working at the moment so I will convert it in the next day or two

This part here:

print "
<table width=100% border=6> <tr style='background:maroon'><th>Car</th><th>Acceleration</th> <th>Handling</th><th>Speed</th><th>Shield</th><th>In Challenge?</th><th>Tune</th></tr>";

 

- - - Updated - - -

I can provide screenshots if need be

Link to comment
Share on other sites

No, I will try explain it a little better but may have to provide some screen shots.

It says

It's laid out like this, I want next to each car name after where it says if it's in a challenge or no.

I will provide screen shots if it's easier easier

- - - Updated - - -

 

Are you asking how to change the text color of an anchor tag?

No, I will try explain it a little better but may have to provide some screen shots.

It says

It's laid out like this, I want next to each car name after where it says if it's in a challenge or no.

I will provide screen shots if it's easier easier

Link to comment
Share on other sites

Just add a link to the table row "<tr>" also, you have 2 </td>'s in that same row. Something like:
<td style='color:green;'><a href='tune.php'>Tune</a></td>

Where abouts would I put that? Check my screenshot and you'll see what I mean and where I want.it

Link to comment
Share on other sites

Where abouts would I put that? Check my screenshot and you'll see what I mean and where I want.it

the code is a mess but i managed to find line 45

 

print "<tr><td>{$r['carNAME']} </td> <td>Lv{$r['cpcACCLV']} ($acc)</td>  <td>Lv{$r['cpcHANLV']} ($han)</td> <td>Lv{$r['cpcSPDLV']} ($spd)</td> <td>Lv{$r['cpcSHDLV']} ($shd)</td><td>$challenge</td> </td> </tr>";

 

as someone said can't remember who but you have a extra </td>

change that link to

 

print "<tr><td>{$r['carNAME']} </td> <td>Lv{$r['cpcACCLV']} ($acc)</td>  <td>Lv{$r['cpcHANLV']} ($han)</td> <td>Lv{$r['cpcSPDLV']} ($spd)</td> <td>Lv{$r['cpcSHDLV']} ($shd)</td><td>$challenge</td> <td style='color:green;'><a href='tune.php'>Tune</a></td> </tr>";
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...