• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

Pulling an image from the database

I am trying to write a script whereby if an image is not uploaded to the site then it will display an icon image that corresponds to the category id that the user has selected by default.  I wrote a query and tested it on SQLyog and the query works. I just cannot get it to funtion on the template page and actually pull the information out of the database and display it on the page.

<TABLE cellSpacing=0 cellPadding=0 width=206 class=table_border
                  border=0 height="250">
                          <tr><td align="center">
                           <?
                           if(!empty($row['picture1']))
                     {
                           $img=$row['picture1'];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>160)
                          {
                          $nw=160;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
                    ?>
                  <img name="runimg" src="images/<? echo $row['picture1']; ?>" border=1 width=<?= $w; ?> height=<?=$h?> >
                     <?
                     }
                     else
                     {
                           $result = mysql_query "SELECT
    placing_item_bid.category_id
    , category_master.icon_1
FROM
    school_auction.category_master
    , school_auction.placing_item_bid
WHERE
    placing_item_bid.category_id=category_master.category_id and category_master.icon_1=category_master.icon_1;"
      $row = mysql_fetch_array( $result );
                            $img=$row['icon_1'];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                     ?>
                      <img name="runimg" src="images/<? echo $row['icon_1']; ?>" border=1 width=<?= $w; ?> height=<?=$h?> >
                     <?
                     }
                           ?>
                          </td></tr>
 </TABLE>
0
dantana1776
Asked:
dantana1776
  • 3
  • 2
1 Solution
 
DelTremeCommented:
When you run the script, what happens?

If there is an error message, please enter it here.
If it just displays a red cross, look at the outputted HTML source and see what image URL is actually used, that usually gives you a clue of where to look.
0
 
dantana1776Author Commented:
When I load the page with the script it just displays a blank white screen
0
 
DelTremeCommented:
You are probably getting an error message then, but on that server error messages are not being displayed.

Try adding this to the top of your file:

<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
?>

That should enable displaying error messages on that page.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
dantana1776Author Commented:
Tried adding that but still getting a blank screen.  Here is the full source. It's actually a .tpl file I don't if that would make a difference for that script.


<?php
/***************************************************************************
 *File Name                        :detail.tpl
 *File Created                        :Wednesday, June 21, 2006
 * File Last Modified                  :Wednesday, June 21, 2006
 * Copyright                        :(C) 2001 AJ Square Inc
 * Email                        :licence@ajsquare.net
 * Software Language                  :PHP
 * Version Created                  :V 4.3.2
 * Programmers worked                    :S.Priya, B.ReenaKumari, K.Shanmuga priya
 * $Id                                  : memberlist.php,v 1.36.2.12 2006/02/07 20:42:51 grahamje Exp $
 *
 ***************************************************************************/
 

/****************************************************************************
 
*      Licence Agreement:
 
*     This program is a Commercial licensed software;
*     you are not authorized to redistribute it and/or modify/and or sell it under any publication
*     or license /or term it under the GNU General Public License as published by the Free Software Foundation;
*     either user and developer versions of the License, or (at your option)
*     any later version is applicable for the same.
 
*****************************************************************************/

 ?>

<? require 'include/connect.php'; ?>

<table width="980" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td valign="top">
       <?
       $title="Details of item";
       require 'include/detail_top.php';
       ?>
      </td>
  </tr>
 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;Listed in Category :  
<?
if($cat_sql_row[category_head_id])
{
cat_display($cat_sql_row[category_head_id],$cat_string);
}
?>
<a  href="category.php?cate_id=<?= $cat_sql_row[category_id] ?>"><?= $cat_sql_row[category_name] ?></a>
</td></tr>
<tr><td valign="top">
<table width="100%" align="center" cellpadding="0" cellspacing="0" border=0>
<tr><td colspan="3" class="tr_border" height=30>
<table width="100%"><tr><td align="left"><font size="3">
<b><div align="left">
&nbsp;&nbsp; <? echo ucwords($row['item_title']); ?>
 </div> </b></font>
 </td>
<td align="right" style="padding-right:5px"><b>Item #(</b>&nbsp;<?= $row['item_id']; ?>) </td></tr>
<?
if($row[sub_title])
{
?>
<tr><td colspan="2" style="padding-left:20px"><?= $row[sub_title] ?> </td></tr>
<?
}
?>
</table>
 </td></tr>
<tr align="center" height=35>
<td width=2>&nbsp;</td>
<?
if(!empty($warning))
{
?>
<td class="table_bgcolor_withborder" align="center">
      <font size="2" color="red">
    <b> &nbsp;&nbsp;&nbsp;<?= $warning?></b></font>
      <?
      }

      if($email_to_status)
      {
      ?>
      <td class="table_bgcolor_withborder" align="center">
      <font size="2" color="red">
    <b> &nbsp;&nbsp;&nbsp;<?= $email_to_status?></b></font>
      <?
      }
      else if($success_mes)
      {
      ?>
      <td class="table_bgcolor_withborder" align="center">
      <font size="2" color="red">
    <b> &nbsp;&nbsp;&nbsp; Item Purchased Successfully! </b></font>
      <?
      }
      else if($watch_flag==1)
    {
      $watch_tot_sql="select count(*) from watch_list where user_id=$user_id";
    $watch_ins_sql=mysql_query($watch_tot_sql);
      $watch_res_sql=mysql_fetch_array($watch_ins_sql);
      $watch_tot=$watch_res_sql[0];
    ?>
      <td class="table_bgcolor_withborder" align="center">
 <font size="2" color="red">
<b> &nbsp;&nbsp;&nbsp;This item is being watched in My Auction  (<a href="watchlist.php" style="text-decoration:none"> <?= $watch_tot?> items </a>)
 <!-- This item has been added to Watchlist. --> </b></font>
   <?
   }
      else if(empty($_SESSION[userid]))
      {
      ?>
   <td class="table_bgcolor_withborder" align="left">
&nbsp;&nbsp;&nbsp;Bidder or seller of this item?</B>&nbsp;<A href="signin.php">Sign in</A> for your status &nbsp;
    <?
    }
      else
      {
      ?>
      <td class="table_bgcolor_withborder" align="left">
&nbsp;&nbsp;&nbsp;      Welcome
      <?
      }
    ?>
      <span align="right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <?
      if($watch_flag!=1)
      {
      ?>
    <a href="detail.php?item_id=<?= $row['item_id'] ?>&mode=watch" >Watch this Item</a> &nbsp;&nbsp;
    <?
      $mode="";
      }
      ?>
       | &nbsp;&nbsp;      
<a href="forward_to_friend.php?item_id=<?= $row['item_id']; ?>" >Forward to a Friend</a>
&nbsp;&nbsp;      
</span>
</td>
<td width=2>&nbsp;</td>
</tr>
</table></td></tr>
<tr><td width= align="center">
<table width=100% align="center" cellpadding="5" cellspacing="2">
<tr>
<td valign="top">
<TABLE cellSpacing=0 cellPadding=0 width=206
                  border=0>
                          <tr><td valign="top">
 <TABLE cellSpacing=0 cellPadding=0 width=206 class=table_border
                  border=0 height="250">
                          <tr><td align="center">
                           <?
                           if(!empty($row['picture1']))
                     {
                           $img=$row['picture1'];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>160)
                          {
                          $nw=160;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
                    ?>
                  <img name="runimg" src="images/<? echo $row['picture1']; ?>" >
                     <?
                     }
                     else
                     {
                           $result = "SELECT
    placing_item_bid.category_id
    , category_master.icon_1
FROM
    school_auction.category_master
    , school_auction.placing_item_bid
WHERE
    placing_item_bid.category_id=category_master.category_id and category_master.icon_1=category_master.icon_1;"
      $query=mysql_query($result);
      $row = mysql_fetch_array($query);
                            $img=$row['icon_1'];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                     ?>
                      <img src="images/<? echo $row['icon_1']; ?>" border=1  name="runimg" >
                     <?
                     }
                           ?>
                          </td></tr>
 </TABLE>
               </td></tr>
                     <tr><td class="mylist" align="center" height="30">
                     <font size="-1">
                 <a href="#" id="dislink" onClick="window.open('view_full_size.php?item_id=<?= $row[item_id];?>&i=1','pop_up','toolbar=no, top=0,location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=400')">View Album </a></font>
                     </td></tr>
</TABLE>
</td>
<td width=1>&nbsp;</td>
<td  valign="top">
<? if($row['selling_method']=="auction" or $row['selling_method']=="dutch_auction")
{
?>
<table cellpadding="5" cellspacing="0"  width=300 >
<tr>
<td width="100">Current Bid : </td>
<td ><? echo $row['currency']." ".$current_price; ?>
<?
if($row['reserve_price']!="0.00")
{
if($row['reserve_price'] <= $current_price )
{
?>
( <font size="1" color="red">Reserve Price has been met</font> )
<?
}
else
{
?>
( <font size="1" color="red">Reserve Price has not been met</font> )
<?
}
}
?>
</td>
</tr>
<tr>
<td width="100">Starting Bid : </td>
<td><? echo $row['currency']." ".$row['min_bid_amount'];?> </td>
</tr>
<tr><td colspan="2"><hr /></td></tr>
<tr><td>Quantity :</td> <td><? echo $row['Quantity'];?></td> </tr>
<?
if(($row[privatelistings]=="No") or empty($row[privatelistings]))
{
?>
<tr> <td>Bid History: </td>
              <?
               if($tot[0]!=0)
              {
              ?>
          <td><a href="bidhistory.php?item_id=<?= $row['item_id']?> "><? echo $tot[0];?></a></td>
              <?
              }
              else
              {
              ?>
               <td width="130"><? echo "-"; ?></td>
              <?
               }
              ?>
</tr>
<?
}
?>
<tr><td>Highest Bidder : </td>
              <?
               if($highest_bidder)
              {
              ?>
          <td><a href="feedback.php?user_id=<?=$max['user_id'];?>" id="dislink">
              <? echo $highest_bidder;?></a>&nbsp;&nbsp;&nbsp;&nbsp;( <a href="feedback.php?user_id=<?=$max['user_id'];?>" id="dislink"><? echo $high_feed_tot[feedbacktotal]; ?></a><img src="images/<?= $feedback_highimg ?>" /> )</td>
              <?
              }
              else
              {
              ?>
               <td width="130"><? echo "-"; ?></td>
              <?
              }
              ?>
</tr>
        <tr>
          <td>Ending Time : </td>
              <?
              $expire_date=$row['expire_date'];
          require 'ends.php';
              ?>
              <td><? echo "$string_difference" ;?></td>
        </tr>
            
          <tr><td colspan="2"><hr /></td></tr>      
            <tr>
          <td>Shipping Cost: </td>
              <? if(!empty($row['shipping_cost']))
              {
          ?>
          <td><? echo $row['currency'] ?>       <?= number_format(($row['shipping_cost']),2,'.',''); ?>
 </td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
              <? }
                            ?>
        </tr>
             <tr>
          <td>Tax Amount: </td>
              <? if(!empty($row['tax']))
              {
          ?>
          <td><? echo $row['currency']." ".$row['tax'];?></td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
              <? }
                            ?>
        </tr>
            <!--   <tr>
          <td>Size Of Quantity: </td>
              <? if(!empty($row['size_of_quantity']))
              {
          ?>
          <td><? echo $row['size_of_quantity'];?></td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
              <? }
              ?>
          </tr> -->
             <tr>
               
               
               
          <td>Shipping From: </td>
             
              <?
             
             
               if(!empty($country['country']))
              {
          ?>
          <td><? echo $country['country'];?></td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
              <? }
              ?>
          </tr>
             
             
               <tr>
          <td>Shipping To: </td>
              <? if(!empty($row['shipping_route']))
              {
          ?>
          <td>
                  <?
    $shipping_array=$row['shipping_route'];
      $shipping=explode(",",$shipping_array);
    $ship_sql="select * from shipping_location";
    $ship_res=mysql_query($ship_sql);
    $total=mysql_num_rows($ship_res);
    $j=1;
    while($ship_row=mysql_fetch_array($ship_res))
    {
for($i=0;$i<=$total;$i++)
{
if($ship_row['ship_id']==$shipping[$i])
{
?>
<?=$ship_row[location];?>&nbsp;
<?
}
}
}
?>
</td>
              <?
              }
              else
              {
              ?>
           <td><? echo "-" ;?></td>
              <?
               }
              ?>
          </tr>
         <?
            $cat_sql="select * from cat_slave where category_id=".$row['category_id'];
        if($custom_res=mysql_query($cat_sql))
        {
        $customrow=mysql_fetch_array($custom_res);
        $tablename=$customrow[tablename];
             
              if($tablename)
            {
            $tab_sql="select * from $tablename";
            $tab_res=mysql_query($tab_sql);
            $i = 2;
            while ($i < mysql_num_fields($tab_res))
            {
       $tab_col = mysql_fetch_field($tab_res, $i);
       $table_sql="select * from $tablename where item_id=$item_id";
         $table_res=mysql_query($table_sql);
       $tablerow=mysql_fetch_array($table_res);
           ?>
<tr><td><?=  $tab_col->name; ?>      </td><td> <?= $tablerow[$tab_col->name] ?>            </td></tr>
<?       
$i++;
} // while
}
}
?>            
</table>
<?
}
else if($row['selling_method']=="fix")
{
?>
<table cellpadding="5" cellspacing="0"  width=300 >
<tr>
<td width="100">Fixed Price : </td>
<td ><? echo $row['currency']." ".$row[quick_buy_price];
$current_price=$row[quick_buy_price]; ?></td>
</tr>
          <tr>
          <td>Ending : </td>
              <?
              $expire_date=$row['expire_date'];
          require 'ends.php';
              ?>
              <td><? echo "$string_difference" ;?></td>
          </tr>
            
        <tr>
          <td>Started: </td>
          <td>
              <?
              $bid_startdate= explode(" ",$row['bid_starting_date']);
              echo $bid_startdate[0];
              ?></td>
        </tr>
            
            <tr><td colspan="2"><hr /></td></tr>      
            <!-- <tr>
          <td>Shipping Cost: </td>
              <? if(!empty($row['shipping_cost']))
              {
          ?>
          <td><? echo $row['currency']." ".$row['shipping_cost'];?></td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
               <?
               }
               ?>
        </tr>
             <tr>
          <td>Tax Amount: </td>
              <? if(!empty($row['tax']))
              {
          ?>
          <td><? echo $row['currency']." ".$row['tax'];?></td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
              <? }
                            ?>
        </tr> -->
            <tr>
          <td>Ending Time : </td>
              <?
              $expire_date=$row['expire_date'];
          require 'ends.php';
              ?>
              <td><? echo "$string_difference" ;?></td>
        </tr>
             
             
              <tr><td colspan="2"><hr /></td></tr>      
            <tr>
          <td>Shipping Cost: </td>
              <? if(!empty($row['shipping_cost']))
              {
          ?>
          <td><? echo $row['currency']." ".$row['shipping_cost'];?></td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
              <? }
                            ?>
        </tr>
             <tr>
          <td>Tax Amount: </td>
              <? if(!empty($row['tax']))
              {
          ?>
          <td><? echo $row['currency']." ".$row['tax'];?></td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
              <? }
                            ?>
        </tr>
<!--               <tr>
          <td>Size Of Quantity: </td>
              <? if(!empty($row['size_of_quantity']))
              {
          ?>
          <td><? echo $row['size_of_quantity'];?></td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
              <? }
              ?>
          </tr> -->
             <tr>
               
               
               
          <td>Shipping From: </td>
             
              <?
             
             
               if(!empty($country['country']))
              {
          ?>
          <td><? echo $country['country'];?></td>
              <?
              }
              else
              {
              ?>
                        <td><? echo "-" ;?></td>
              <? }
              ?>
          </tr>
             
               
             
             <tr>
          <td>Shipping To: </td>
              <? if(!empty($row['shipping_route']))
              {
          ?>
          <td>
                  <?
    $shipping_array=$row['shipping_route'];
      $shipping=explode(",",$shipping_array);
    $ship_sql="select * from shipping_location";
    $ship_res=mysql_query($ship_sql);
    $total=mysql_num_rows($ship_res);
    $j=1;
    while($ship_row=mysql_fetch_array($ship_res))
    {
for($i=0;$i<=$total;$i++)
{
if($ship_row['ship_id']==$shipping[$i])
{
?>
<?=$ship_row[location];?>&nbsp;
<?
}
}
}
?>
</td>
<?
}
else
{
?>
<td><? echo "-" ;?></td>
<?
 }
?>
          </tr>
             <tr>
               
             
         <?
            $cat_sql="select * from cat_slave where category_id=".$row['category_id'];
        if($custom_res=mysql_query($cat_sql))
        {
        $customrow=mysql_fetch_array($custom_res);
        $tablename=$customrow[tablename];
             
              if($tablename)
            {
            $tab_sql="select * from $tablename";
            $tab_res=mysql_query($tab_sql);
            $i = 2;
            while ($i < mysql_num_fields($tab_res))
            {
       $tab_col = mysql_fetch_field($tab_res, $i);
       $table_sql="select * from $tablename where item_id=$item_id";
         $table_res=mysql_query($table_sql);
       $tablerow=mysql_fetch_array($table_res);
           ?>
<tr><td><?=  $tab_col->name; ?>            </td><td> <?= $tablerow[$tab_col->name] ?>            </td></tr>
<?       
$i++;
} // while
}
}
?>

</table>
<?
}
?>
</td>
<td width=1>&nbsp;</td>
<td valign="top">
               
              <table cellpadding="0" cellspacing="0" class=table_border width=100%>
                     <tr><td class="tr_border"><font size="+1">&nbsp;&nbsp;&nbsp;Seller Information</font></td></tr>
              <tr><td>  
               <table cellpadding="5" cellspacing="2">
                     <tr>
               <td valign="middle"><a href="feedback.php?user_id=<?=$row['user_id'];?>" id="dislink"><? echo $user['user_name'];?></a>&nbsp;&nbsp;&nbsp;&nbsp;( <a href="feedback.php?user_id=<?=$row['user_id'];?>" id="dislink"><? echo $feed_tot[feedbacktotal]; ?></a><img src="images/<?= $feedback_img ?>" /> )  </td>
               </tr>
                     <tr>
                <td><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FeedBack Score:&nbsp;<? echo $feed_tot[feedbacktotal]; ?></b>              </td>
              </tr>
                    <tr>
                <td><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Positive FeedBack:<?= $positive_percentage ?>&nbsp;%</b></td>
              </tr>
                     <tr>
              <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Member Since
                    
                   <?
  $custom_date=explode(" ",$user['date_of_registration']);
  $custom_date1=$custom_date[0];
  $custom_time=$custom_date[1];
  $custom_date3=substr($custom_date1,"-2");
  $custom_date2=explode("-",$custom_date1);
  $custom_date1=$custom_date2[0];
  $custom_date2=$custom_date2[1];
  $custom_date4=$custom_date3."-"."$custom_date2"."-"."$custom_date1"." "."$custom_time";
  echo $custom_date4; ?> in <?= $country['country']; ?></td>
              </tr>
                    <?
                    $user=$row[user_id];
                    $sql=mysql_query("select * from user_registration where user_id=".$user);
                    $res=mysql_fetch_array($sql);
                    $org=$res[organisation];
                    ?>
                                      <tr><td style="padding-left:30px;"><strong>Organization : </strong><?=$org?></td></tr>
      <?
    $admin_cat_sort="select * from admin_settings where set_id=45";
      $admin_cat_res=mysql_query($admin_cat_sort);
      $admin_catrow=mysql_fetch_array($admin_cat_res);
      if($admin_catrow[2]==1)
      {            
      if($row[user_id]!=$_SESSION[userid])
      {
                  ?>

                  
                    <tr>
                <td><a href="ask_seller_qus.php?item_id=<?= $row[item_id]; ?>" >Ask the Seller a Question</a></td>
              </tr>
      <?
      }
      }
      else if($admin_catrow[2]==2 and $_SESSION[username]!="")
      {
      if($row[user_id]!=$_SESSION[userid])
      {
      ?>              
              <tr>
                <td><a href="ask_seller_qus.php?item_id=<?= $row[item_id]; ?>" >Ask the Seller a Question</a></td>
              </tr>
      
    <?
      }
      }
      ?>         <tr>
                <td>
                        <a href="sellers_othersitem.php?seller_id=<?=$row['user_id']; ?>" >View seller's other items</a>
               </td>
              </tr>
                    <tr>
                <td></td>
              </tr>
                    <tr>
                <td><a href="feedback.php?user_id=<?=$row['user_id'];?>" >Read Feedback</a></td>
              </tr>
                    <tr>
                <td><a href="detail.php?item_id=<?= $item_id ?>#view" >View Questions and Comments.</a></td>
              </tr>
                    </table>
                    </td></tr>
                    </table>

</td>
  </tr>
</table>

</td></tr>
<tr><td align=center>
<table cellpadding="0" cellspacing="0" class="table_border" width=100%>
<tr><td class="mylist">
<font size="+1">&nbsp;&nbsp;&nbsp;
Item Description:</font> </td></tr>
  <tr align="center">
          <td> </td>
        </tr>
            <!--- themes  ----- -->
            
            
            <tr><td colspan="2" align="left">
      <?
      
      if($row[themes_id])
    {
      $img=$theme_top;
    list($width, $height, $type, $attr) = getimagesize("images/$img");
      ?>
   <table width="100%" cellpadding="5" cellspacing="0" align="left">
   <tr><td background="images/<?= $theme_top ?>" style="background-repeat:no-repeat"  height=<?= $height ?> align="left"  ></td></tr>
   <tr><td background="images/<?= $theme_content ?>"  style="background-repeat:repeat-y" align="left" >
   <?
     if($row[layout]=="layout_top.gif")
   {
   ?>
   <table width=100% cellpadding="5">
   <tr><td align="center">
   <? if($row[picture1])
   {  
                   $img=$row[picture1];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>400)      
                           {
                           $nh=400;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>400)
                          {
                          $nw=400;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture1] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td style="padding:50px" >  <?= $row[detailed_descrip]; ?>  </td></tr>
   
   <tr><td align="center">
   <? if($row[picture2])
   {  
                   $img=$row[picture2];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture2] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   
   <tr><td align="center">
   <? if($row[picture3])
   {  
                   $img=$row[picture3];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture3] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture4])
   {  
                   $img=$row[picture4];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture4] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture5])
   {  
                   $img=$row[picture5];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture5] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture6])
   {  
                   $img=$row[picture6];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture6] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture7])
   {  
                   $img=$row[picture7];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture7] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   </table>
   <?
    } // end of top layout
   ?>
      <?
   if($row[layout]=="layout_bottom.gif")
   {
   ?>
   <table width=100% cellpadding="5" >
    <tr><td style="padding:50px" >  <?= $row[detailed_descrip]; ?>  </td></tr>
   <tr><td align="center">
   <? if($row[picture1])
   {  
                   $img=$row[picture1];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>400)      
                           {
                           $nh=400;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>400)
                          {
                          $nw=400;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture1] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
 
   
   <tr><td align="center">
   <? if($row[picture2])
   {  
                   $img=$row[picture2];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture2] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   
   <tr><td align="center">
   <? if($row[picture3])
   {  
                   $img=$row[picture3];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture3] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture4])
   {  
                   $img=$row[picture4];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture4] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture5])
   {  
                   $img=$row[picture5];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture5] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture6])
   {  
                   $img=$row[picture6];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture6] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture7])
   {  
                   $img=$row[picture7];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture7] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   </table>
   <?
   } // end of bottom layout
   ?>
   <?
   if($row[layout]=="layout_left.gif")
   {
   ?>
   <table width=100% cellpadding="5" >
   <tr><td align="left" > <table>
   <tr><td align="center" style="padding-left:20px">
   <? if($row[picture1])
   {  
                   $img=$row[picture1];
                           list($width, $height, $type,$attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>400)      
                           {
                           $nh=400;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>400)
                          {
                          $nw=400;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture1] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
 
   
   <tr><td align="center">
   <? if($row[picture2])
   {  
                   $img=$row[picture2];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture2] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   
   <tr><td align="center">
   <? if($row[picture3])
   {  
                   $img=$row[picture3];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture3] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture4])
   {  
                   $img=$row[picture4];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture4] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture5])
   {  
                   $img=$row[picture5];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture5] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture6])
   {  
                   $img=$row[picture6];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture6] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="center">
   <? if($row[picture7])
   {  
                   $img=$row[picture7];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture7] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   </table></td><td style="padding:50px" valign="top">  <?= $row[detailed_descrip]; ?>  </td></tr>
   </table>
   <?
    } // end of left layout
   ?>

      <?
   if($row[layout]=="layout_right.gif")
   {
   ?>
   <table width=100% cellpadding="5" >
   <tr>
   <td style="padding:50px" valign="top">  <?= $row[detailed_descrip]; ?>  </td>
   <td>
   <table>
   <tr><td align="left">
   <? if($row[picture1])
   {  
                   $img=$row[picture1];
                           list($width, $height, $type,$attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>400)      
                           {
                           $nh=400;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>400)
                          {
                          $nw=400;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture1] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
 
   
   <tr><td align="left">
   <? if($row[picture2])
   {  
                   $img=$row[picture2];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture2] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   
   <tr><td align="left">
   <? if($row[picture3])
   {  
                   $img=$row[picture3];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture3] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="left">
   <? if($row[picture4])
   {  
                   $img=$row[picture4];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture4] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="left">
   <? if($row[picture5])
   {  
                   $img=$row[picture5];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture5] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="left">
   <? if($row[picture6])
   {  
                   $img=$row[picture6];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture6] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   <tr><td align="left">
   <? if($row[picture7])
   {  
                   $img=$row[picture7];
                           list($width, $height, $type, $attr) = getimagesize("images/$img");
                           $h=$height;
                           $w=$width;
                           if($h>200)      
                           {
                           $nh=200;
                           $nw=($w/$h)*$nh;
                           $h=$nh;
                           $w=$nw;
                           }
                          if($w>200)
                          {
                          $nw=200;
                          $nh=($h/$w)*$nw;
                          $h=$nh;
                          $w=$nw;
                          }
   
   ?>
   <img src="images/<?= $row[picture7] ?>" width=<?= $w ?> height=<?= $h ?> >  <? } ?>
   
   </td></tr>
   </table></td></tr>
   </table>
   <?
   } // end of right layout
   ?>
    </td></tr>
  <?
    $img=$theme_bottom;
    list($width, $height, $type, $attr) = getimagesize("images/$img");
  ?>      
   <tr><td background="images/<?= $theme_bottom ?>" style="background-repeat:no-repeat" width=100% height=<?= $height ?> align="left" >
   </td></tr>
   </table>
    <?
      } // end of if($themes_id)
      else
      {
      ?>
       <tr align="center">
     <td><? echo $row['detailed_descrip']; ?></td>
     </tr>
     <?
     }
     ?>
     </td></tr>
            
            <!---- end of themes --->
            
            
<!-- <tr><td> <table width=770 cellpadding="5" cellspacing="2">
<tr>
<?
if(!empty($row['picture1']))
{
?>
 <td align="center"><img src="images/<? echo $row['picture1']; ?>" border=0> </td>
<?
}
?>
<?
if(!empty($row['picture2']))
{
?>
 <td align="center"><img src="images/<? echo $row['picture2']; ?>" border=0> </td>
<?
}
?>
<?
if(!empty($row['picture3']))
{
?>
 <td align="center"><img src="images/<? echo $row['picture3']; ?>" border=0 > </td>
<?
}
?>
</tr></table></td></tr>             -->
            
<tr><td align="center">
        <br />
        <?
            if($row[clicks] > 0)
            {
            ?>
            <font size=2> This item has been viewed </font>
                <? if($row[item_counter_style]==1)
                  {
                  ?>
                  <b><font size=+1 color="#009900">
                <?= $row[clicks]; ?>
                  </font>
                  </b>
                  <?
                  }
                else
                  { ?>
               <b><I><font size=+1 color="#003399">
                <?= $row[clicks]; ?>
                  </font>
                  </I></b>                  
             <?
                 }
                 ?>
                  times. </font>
            <?
            }
            ?>
</td></tr>
</table></td></tr>
<tr><td>
<br />
<table width=100% align="center">
<tr><td class=tr_border><font size="+1">&nbsp;&nbsp;&nbsp;
Cross Promoted Items</font>
</td></tr>
<tr><td align="center"><? if(empty($row[crosspromote]))
{
echo "<font size=2>No Items are Cross Promoted</font>";
}
else
{
$sqlpromoteitem="select * from placing_item_bid where item_id=$row[crosspromote]";
$sqlqrypromoteitem=mysql_query($sqlpromoteitem);
$sqlfetchpromoteitem=mysql_fetch_array($sqlqrypromoteitem);
?>
<table align="center" width="20%" border=1>
<tr height="30"><td class=tr_border align="center"><strong>More Great Items From This Seller</strong></td></tr>
<?
if(!empty($sqlfetchpromoteitem[picture1]))
{
?>
<tr><td align="center"><img src=images/<?=$sqlfetchpromoteitem[picture1]?> height=200 width=350></td></tr>
<?
}
?>
<tr><td class=tr_border align="center">
<a href=detail.php?item_id=<?=$sqlfetchpromoteitem[item_id]?>><?=$sqlfetchpromoteitem[item_title]?></a></td></tr>
</table>
<?
}
?>
</td></tr>
</table></td></tr>
















<?
if($row[payment_instructions] or $row[returnpolicy_instructions])
{
?>
<tr><td>
<br />
<table width=100% align="center">
<tr><td class=tr_border><font size="+1">&nbsp;&nbsp;&nbsp;
Payment and Return Policy Details</font>
</td></tr>
<?
}
?>
<?
if($row[payment_instructions])
{
?>
<tr><td>
<?= $row[payment_instructions] ?>
</td></tr>
<?
}
?>
<?
if($row[returnpolicy_instructions])
{
?>
<tr><td>
<?= $row[returnpolicy_instructions] ?>
</td></tr>
<?
}
?>
</table>
</td></tr>
<tr><td>
<br /><a href="#" id=view></a>
<table width=100% align="center">
<tr><td class=tr_border>
      <!-- <a href="ask_seller_qus.php?item_id=<?= $row[item_id]; ?>" name=view>
    <font size=2><b>Ask the Seller a Question</b></font></a> -->
      <font size=3><b>&nbsp;&nbsp;Questions and Answers</b></font>
      </td></tr>
            <? $ask_sql="select * from ask_question where item_id=".$row[item_id];
               $ask_res=mysql_query($ask_sql);
               if(mysql_numrows($ask_res)>0)
               {
               while($askrow=mysql_fetch_array($ask_res))
               {
               if($askrow[answer])
               {
            ?>
            <tr bgcolor=white><td><img src="images/question.gif">&nbsp;&nbsp;
            <?= $askrow[question];?>
            </td></tr>
            <tr><td style="border-bottom:1px solid gray";>
            <img src="images/answer.gif">&nbsp;&nbsp;
            <?= $askrow[answer];?>
            </td></tr>
            <?
            }
            }
            }
            else
            {
            ?>
            <tr><td align="center"><font size="2" color="red">No Queries!</font></td></tr>
            <?
            }
            ?>
            </table>
</td></tr>
<tr><td>
<br />
<table width="100%" border="0" align="center" cellspacing=0 cellpadding="0">
<tr><td class="tr_border" height="30" colspan="3"><font size="+1">&nbsp;&nbsp;&nbsp;
<?
   if($row[quick_buy_price] and ($row[selling_method]=="auction" or $row[selling_method]=="dutch_auction"))
     echo "Ready to bid or buy?";
   else if($row[selling_method]=="fix")
     echo "Ready to buy?";
   else if($row[selling_method]=="auction" or $row[selling_method]=="dutch_auction")
     echo "";
?>
   
   </font></td>
</tr>
<tr>
<td width=50% valign="top" align="center">
<?
if($row[selling_method]=="auction" or $row['selling_method']=="dutch_auction")
{
?>
<table width="100%" border="0" align="center" >
<tr><td>
<table width="100%" border="0" align="center" >
<th  height=15 >
<font size="2"><b><div align="left">
Place a Bid </div> </b></font> </th>
<tr><td colspan=2>
<table width="100%"  cellpadding="5" cellspacing="2">
<form name=bid_form action=bidding.php method=post onSubmit="return validate()">
<?
/* if($row['reserve_price'])
{
if($row['reserve_price'] <= $current_price )
{
?>
<tr><td colspan="2" align="center"> <font size="2" color="red">Reserve Price has been met</font> </td></tr>
<?
}
else
{
?>
<tr><td colspan="2" align="center"> <font size="2" color="red">Reserve Price has not been met</font> </td></tr>
<?
}
} */
?>
   <tr >
    <td >Current Bid:</td>
    <td align="left"><? echo $row['currency']." ".$current_price;?></td>
  </tr>
   <tr >
    <td >Increment:</td>
    <td><? echo $row['currency']." ".$row['bid_increment']; ?></td>
  </tr>
  <tr >
    <td>Your Maximum Bid</td>
      <td><input type="text" name="max_bid" <?if($row[Quantity]==0 or $row[status]=='Closed'){echo "disabled";}?>></td></tr>
             <tr ><td>&nbsp;</td>
             <td>( Minimum Bid:<? echo $row[currency]." ".($current_price+$row['bid_increment']) ?> )</td>
             </tr>
      <tr >
 <?
       if($row['selling_method']=="dutch_auction")
      {
      if($row[Quantity] > 0 )
      {
      ?>
      <td height="27" >Quantity:</td>
    <td align="left">
      <select name=qty <?if($row[Quantity]==0 or $row[status]=='Closed'){echo "disabled";}?>>
       <option value="Quantity">Quantity</option>
      <? for($i=1;$i<=$row[Quantity];$i++)
      {
      ?>
       <option value="<?= $i;?>"><?= $i;?></option>
      <?
      }
      ?>
      </select>
      </td>
    <?
      }
      
      ?></tr>
     <?
     }
       else
       {
       ?>
             <input type="hidden" name=qty value=1>
       <?
       }
       ?>
      <tr ><td align="left" colspan="2">
      <input name="chk" type="checkbox" value="chk" <?if($row[Quantity]==0 or $row[status]=='Closed'){echo "disabled";}?>>
              Email Reminder for Highest Bidder</td> </tr>

      <tr>
      <td colspan="2" align=center>
      <input type="submit" value="Place bid" class=buttonbig <?if($row[Quantity]==0 or $row[status]=='Closed'){echo "disabled";}?>>
                <? /* if(!empty($row[reserver_price]))
      {
      ?>          Buy Now is only available until
the reserve price is met
                <input name="button" type="button" class=buttonbig onClick=quick("<?= $item_id;?>") value="Quick Buy" > 
                <?
       } */
       ?>
             <input type="hidden" name=flag value=1>
             <input type="hidden" name=err_flag value=<?= $err_flag; ?>>
            <input type="hidden" name=item_id value=<?= $item_id; ?> >
                   </td></tr>
            </form>
            </table></td>
            </tr>      
   </table></td>
   <?
   if($row[quick_buy_price]!=0)
   {
   if($row['reserve_price'] >= $current_price or $row['reserve_price']==0.00)
   {
   ?>
   <td bgcolor="#CCCCCC" width=1> </td>
   <td width=50% valign="top">
   <table width="100%" align="center" cellpadding="5" cellspacing="2" id=buyitnow>
<th  height=15>
<font size="2"><b><div align="left">
Buy it now</div> </b></font> </th>
<tr><td align="center"><br>
<font size="2">Buy Now Price:</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?= $row['currency']; ?> <?= $row['quick_buy_price']; ?>
<br></td></tr>
<form name=fix_form action="detail.php" method=post >
    <input type="hidden" name=qty value=1>
      <input type="hidden" value=1 name=flag>
      <input type="hidden" value="<?= $err_flag; ?>" name="err_flag" >
      <input type="hidden" value="fix" name="sell_method">
<input type="hidden" value="<?= $item_id;?>" name=item_id>
<input type="hidden" value="<?= $row[quick_buy_price];?>" name=fixed_price>
<tr><td align="center">
<input type="button" value=Buyitnow onClick="confirm_buynow()"; <?if($row[Quantity]==0 or $row[status]=='Closed'){echo "disabled";}?>>
</td></tr>
</form>
<tr><td align="center">
  <br>
       <?= $_SESSION[site_name]  ?> Pro will inform the seller of your intent to purchase this item.<br><br>
     Your purchase is a contract between you and the item seller. <br>
     If you submit this purchase you will enter into a legally binding contract. </td></tr>
</table>
   <?
   }
   }
   ?>
  </td>
   </tr></table>
   <?
   } //if(selling_method=="auction")
      ?>
<!--
</td>
<td bgcolor="#F5F5F5" width=2>&nbsp;</td>
<td width="47%" valign="top">  -->
<?
if(empty($displaydetails))
{
$bid_sql_max="select MAX(bidding_amount) as amt from placing_bid_item where item_id=".$item_id;
$bid_res_max=mysql_query($bid_sql_max);
$bidrow_max=mysql_fetch_array($bid_res_max);
if($row[selling_method]=="fix")
{
?>
<table width="100%" align="center" cellpadding="5" cellspacing="2" id=buyitnow>
<th  height=15>
<font size="2"><b><div align="left">
Buy it now</div> </b></font> </th>
<tr><td align="center"><br>
<font size="2">Buy Now Price:</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?= $row['currency']; ?> <?= $row['quick_buy_price']; ?>
<br></td></tr>
<form name=fix_form action="detail.php" method=post >
    <input type="hidden" name=qty value=1>
      <input type="hidden" value=1 name=flag>
      <input type="hidden" value=<?= $err_flag; ?> name="err_flag">
      <input type="hidden" value="fix" name="sell_method">
<input type="hidden" value="<?= $item_id;?>" name=item_id>
<input type="hidden" value="<?= $row[quick_buy_price];?>" name=fixed_price>
<tr><td align="center"><input type="button" value=Buyitnow onClick="confirm_buynow()"; <?if($row[Quantity]==0 or $row[status]=='Closed'){echo "disabled";}?>></td></tr>
</form>
<tr><td align="center">
  <br>
       <?= $_SESSION[site_name]  ?> Pro will inform the seller of your intent to purchase this item.<br><br>
     Your purchase is a contract between you and the item seller. <br>
     If you submit this purchase you will enter into a legally binding contract. </td></tr>
</table>
</td>

</tr>
</table>
<?
 } //if($row[selling_method]=="fix")
 }
?>
</td></tr>
<script language="javascript">
function validate()
{
if(document.bid_form.max_bid.value=="")
{
alert("Please enter the Max bid amount");
document.bid_form.max_bid.focus();

return false;
}
if(document.bid_form.qty.value=="Quantity")
{
alert("Please select the Quantity");
document.bid_form.qty.focus();
return false;
}
document.bid_form.flag.value=1;
return true;
}
function confirm_buynow()
{
var where_to= confirm("Please Click Here To Confirm Your Bid");
if (where_to==true)
 {
 document.fix_form.submit();
 }
}
</script>
0
 
dantana1776Author Commented:
I figured it out  misp;aces the ";"  
0
 
Computer101Commented:
PAQed with points refunded (250)

Computer101
EE Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now