Hi guys, i’m new to PHP and i just couldn’t get something right…
http://carnex.com.sg/preownedcars.php
this is the web that i’m currently having problem with, after pressing the button “learn more”.
It will link to a page example, http://carnex.com.sg/view_car.php?id=97
And it should show more details of the cars, but i aren’t getting any my details out…
The scripts are here…
I’m not sure if this is correct…
[php] <?php
include "includes/common.php";
$det1 = mysql_query("select * from tab_product where Status='1' and feat='1' limit $offset,$recperpage");
while($det2 = mysql_fetch_array($det1))
{
$det[] = $det2;
}
$objSmarty->assign("det",$det);
$objSmarty->assign("IncludeTemplate","view_car.tpl");
$objSmarty->display("pagetemplateautomobile.tpl");
?>
[/php]
[php]
{literal}
<script type="text/javascript" charset="utf-8">
google.load("jquery", "1.3");
</script>
<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
.error {
font: normal 12px arial;
text-align:center;
font-weight:bold;
background-color: #ffc;
border: 1px solid #c00;
}
.ok {
font: normal 12px arial;
text-align:center;
font-weight:bold;
background-color:#EFFFDF;
border: 1px solid #339966;
color:#009900;
}
{/literal}
{section name=a loop=$det}
<td width="580" align="center" valign="top"><table width="580" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="672" align="center" valign="top" background="images/boby_bg_top.jpg" style="background-position:top; background-repeat:repeat-x; background-color:#FFFFFF;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"> </td>
<td> </td>
</tr>
<tr>
<td width="580" valign="top"><table width="580" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td height="620" align="center" valign="top"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td width="32%" align="left" valign="middle"><!--<a href="carforsale.php"><img src="images/back.jpg" name="back" width="80" border="0" /></a>--></td>
<td width="43%" align="left" valign="middle"> </td>
</tr>
<tr align="left">
<td width="12%" class="tit_1">{$det[a].prod_name}</td>
<td width="88%" class="tit_1"> </td>
</tr>
<tr align="left">
<td colspan="2" valign="top" class="tit_1"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="registration_border">
<tr>
<td height="228" valign="top" bgcolor="#FFFFFF"><table width="95%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td height="15" colspan="3"></td>
</tr>
<tr>
<td align="center" class="content_text" valign="top" colspan="2">
{if $det[a].prod_imgsize1 eq '0' and $det[a].prod_imgsize2 eq '0' and $det[a].prod_imgsize3 eq '0' and $det[a].prod_imgsize4 eq '0' and $det[a].prod_imgsize5 eq '0' and $det[a].prod_imgsize6 eq '0' and $det[a].prod_imgsize7 eq '0'}<img src="product_img/no_image.gif" width="100" align="absmiddle" border="1" style="border-color:#CCCCCC; padding:5px;"/>
{else}
<a href="product_img/{$det[a].prod_imgname1}"rel=“prettyPhoto[mixed]”>{/if}
{if $det[a].prod_imgsize2 neq ‘0’}{/if}
{if $det[a].prod_imgsize3 neq ‘0’}{/if}
{if $det[a].prod_imgsize4 neq ‘0’}{/if}
{if $det[a].prod_imgsize5 neq ‘0’}{/if}
{if $det[a].prod_imgsize6 neq ‘0’}{/if}
{if $det[a].prod_imgsize7 neq ‘0’}{/if}
{/if}{if $det[a].feat eq ‘1’}
<div style="margin-top:-5px;" align="center"><img src="administrator/images/favorites.png" width="36" border="0" /><>
{/if}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Car Name : </strong></td>
<td class="content_text">{$det[a].prod_name}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Category : </strong></td>
<td class="content_text">{$det[a].category}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Agent Name : </strong></td>
<td class="text1">{$fname} {$lname}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Agent Email : </strong></td>
<td class="text1">{$det[a].email}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Agent Code : </strong></td>
<td class="text1">{$det[a].agent}</td>
</tr>
<tr>
<td class="car_1_blc" valign="top"><strong class="car_1_blc">Contact No. : </strong></td>
<td class="text1">{$phone}<br /><br />{$phone2}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Sale Price : </strong></td>
<td class="content_text">${$det[a].saleprice}</td>
</tr>
{if $smarty.session.user_log neq ''}
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Dealer Price : </strong></td>
<td class="content_text">{$det[a].prod_price}</td>
</tr>
{/if}
<!-- <tr>
<td class="car_1_blc"><strong class="car_1_blc">Car Quantity : </strong></td>
<td class="content_text">{$det[a].quant}</td>
</tr>-->
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Road Tax : </strong></td>
<td class="content_text">{$det[a].roadtax}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Transmission : </strong></td>
<td class="content_text">{$det[a].trans}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Engine Capacity : </strong></td>
<td class="content_text">{$det[a].capacity}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Mileage : </strong></td>
<td class="content_text">{$det[a].mile}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Register date : </strong></td>
<td class="content_text">{$det[a].regdate}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Features : </strong></td>
<td class="content_text">{$det[a].features}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Accessories : </strong></td>
<td class="content_text">{$det[a].acc}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">COE : </strong></td>
<td class="content_text">{$det[a].coe}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">OMV : </strong></td>
<td class="content_text">{$det[a].omv}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Depreciation : </strong></td>
<td class="content_text">{$det[a].dep}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">No. of owners : </strong></td>
<td class="content_text">{$det[a].owner}</td>
</tr>
<tr>
<td class="car_1_blc"><strong class="car_1_blc">Type of Vehicle : </strong></td>
<td class="content_text">{$det[a].type}</td>
</tr>
<tr>
<td class="car_1_blc" valign="top"><strong class="car_1_blc">Description : </strong></td>
<td colspan="2" class="content_text">{$det[a].desc}</td>
</tr>
<tr>
<td height="10" colspan="3"></td>
</tr>
<tr>
<td width="25%"> </td>
<td colspan="2"><a href="sendmail.php?id={$det[a].prod_id}"><img src="images/sendthemail.jpg" border="0" style="padding:10px;" /></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<!-- Side panel -->
<td width="32%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
{include file="side.tpl"}
</table></td>
<!-- Side ends -->
</tr>
<tr>
<td width="68%"> </td>
<td> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
{/section}
{literal}
{/literal}
|
|
[/php] |