
	<? $title="$lang_221";
	   require 'templates/'.$tfold.'/header.php';
	?>
	</td>
  </tr>
  
<tr><td valign="top" class="ft2">
<table border="0" align="center" cellpadding="3" cellspacing="0" width="100%">
<tr height=40>
<td class="tr_border" colspan=2><font size="2"><b>
<?
    if($mode=="edit")
    echo "Edit Your Item"; 
    else if($mode=="repost")
    echo "Repost Your Item"; 
    else if($mode=="repost") 
    echo "Relist Your Item"; 
    else
    echo "$lang_413";
 ?> 
<? echo "$lang_188" ?></b>
</font> </td></tr>
<tr class="sub_tr_border">
<td height="30" colspan="2">
<? echo "$p_steps" ?> </td>
</tr>
<tr><td>
<? if($err_flag==1)
{ 
?>
<table width="100%" align="center"><tr><td>
<img src="templates/<? echo "$tfold" ?>/img_files/xclabid.gif"></td>
<td><font class="head_font" color="red"><? echo "$lang_388" ?></font></td>
<? if(!empty($err_title))
 {
 ?>
<tr><td>&nbsp;</td>
<td><a href="post_ad.php#txttitle"><? echo "$lang_145" ?></a> - <?= $err_title; ?></td></tr>
<? 
}
?>
<? if(!empty($err_des))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#areades"><? echo "$lang_189" ?></a> - <?= $err_des; ?></td></tr>
<? 
}
?>
<? if(!empty($err_min_amt))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#txt_min_amt">Minimum <? echo "$lang_109" ?></a> - <?= $err_min_amt; ?></td></tr>
<? 
}
?>
<? if(!empty($err_fix_price))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#txt_quick"><? echo "$lang_190" ?></a> - <?= $err_fix_price; ?></td></tr>
<? 
}
?>
<? if(!empty($err_rev_price))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#txt_rev_price"><? echo "$lang_191" ?></a> - <?= $err_rev_price; ?></td></tr>
<? 
}
?>
<? if(!empty($err_qty))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#txt_qty">Quantity</a> - <?= $err_qty; ?></td></tr>
<? 
}
?>
<? if(!empty($err_dur))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#cbodur">Duration</a> - <?= $err_dur; ?></td></tr>
<? 
}
?>

<? 
if(!empty($err_size_qty))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#size_of_qty"><? echo "$lang_192" ?></a> - <?= $err_size_qty; ?></td></tr>
<? 
} 
?>

<?
if($bid_permission=='yes'){
 if(!empty($err_bid_inc))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#txt_bid_inc"><? echo "$lang_193" ?></a> - <?= $err_bid_inc; ?></td></tr>
<? 
} }
?>
<? if(!empty($err_cur))
 {
 ?>
<tr><td>&nbsp;</td>
<td><a href="post_ad.php#cbocurrency">Currency</a> - <?= $err_cur; ?></td></tr>
<? 
}
?>
<? if(!empty($err_img1))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#img1">Image1</a> - <?= $err_img1; ?></td></tr>
<? 
}
?>
<? if(!empty($err_img2))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#img2">Image2</a> - <?= $err_img2; ?></td></tr>
<? 
}
?>
<? if(!empty($err_img3))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#img3">Image3</a> - <?= $err_img3; ?></td></tr>
<? 
}
?>
<? if(!empty($err_img4))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#img4">Image4</a> - <?= $err_img4; ?></td></tr>
<? 
}
?>
<? if(!empty($err_img5))
 {
 ?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#img5">Image5</a> - <?= $err_img5; ?></td></tr>
<? 
}
?>


<? 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);
	$dummy=$tab_col->name;
if(empty($_SESSION[$tab_col->name]))
        {
		require 'include/configurations.php'; // ITECHBIDS Configuration File
?>
<tr><td>&nbsp;</td><td><a href="post_ad.php#<?= $tab_col->name ?>"><?= $tab_col->name ?></a>-<?= $err_23 ?></td></tr>
	 <?
	    }
		else
		{
	    $var_type=$tab_col->type;
		if($var_type=="int" or $var_type=="tinyint")
		{
		if(!is_numeric($_SESSION[$tab_col->name]))
	    {
	    ?>
		 <tr><td>&nbsp;</td><td><a href="post_ad.php#<?= $tab_col->name ?>"><?= $tab_col->name ?></a>-<?= $err_23 ?></td></tr>
		<?
		}
		}
		}
	$i++;
}
}  ?>
</table></td></tr>
<tr><td>
<hr size="1" noshade class="hr_color"></td></tr>
<?
}
 ?>
<tr>
<td> 
<form name="form1" Action="post_ad.php"  method=post enctype="multipart/form-data">
<table width="100%" cellpadding="0" cellspacing="0" >
 <?
  function display_subcategory($sub_cat_id,$sub_cat,$chk)
  {
  $sub1_sql="select * from site_categories where category_head_id=".$sub_cat_id;
  $sub1_res=mysql_query($sub1_sql);
  $sub1_tot=mysql_num_rows($sub1_res);
  if($sub1_tot!=0)
  {
  while($sub1_row=mysql_fetch_array($sub1_res))
  {
   if(trim($sub1_row['category_id'])==trim($sub_cat))
  {
  ?>
  <option value="<?= $sub1_row['category_id'] ?>" selected> &nbsp;&nbsp;&nbsp; <?= $sub1_row['category_name'] ?></option>
  <? 
  }
  else
  {
	?>
  <option value="<?= $sub1_row['category_id'] ?>"> &nbsp;&nbsp;&nbsp;<?= $sub1_row['category_name'] ?></option>
  <?
  }
  ?>
  <?
  $sub_cat_id=$sub_row1['category_id'];
  if($sub_cat_id)
  display_subcategory($sub_cat_id,$sub_cat,$chk);
  }
  } //while($sub1_row=mysql_fetch_array($sub1_res))
  } //function
 if($_SESSION[categoryid])
 {
  $sub_sql="select * from site_categories where category_head_id=$_SESSION[categoryid]";
//  $sub_sql="select * from site_categories where category_head_id=7";
  $sub_res=mysql_query($sub_sql);
  $sub_tot=mysql_num_rows($sub_res);
 }
 
if($sub_tot!=0)
{ 
?>
<tr><td><font class="head_font"><b><? echo "$lang_393" ?></b></font></td></tr>
<tr><td><select name=cbosubcat><option value="0">Select</option>
<? while($sub_row=mysql_fetch_array($sub_res))
 {
  if(trim($sub_row['category_id'])==trim($sub_cat))
  {
  ?>
  <option value="<?= $sub_row['category_id'] ?>" selected><?= $sub_row['category_name']?></option>
  <? 
  }
  else
    {
	?>
  <option value="<?= $sub_row['category_id'] ?>"><?= $sub_row['category_name'] ?></option>
  <?
  }
  $sub_cat_id=$sub_row['category_id'];
	if($sub_cat_id)
	{
	    display_subcategory($sub_cat_id,$sub_cat,1);
	}
	else
	break;
  }
  ?>
  </select>
 </td></tr>
 <? 
 }
 else
 { ?>
  <?
  if($file_path)
 require "$file_path";
   ?>
<? 
 }
 ?>
<tr><td>
<? if(!empty($err_title))
 {?>
 <img src="templates/<? echo "$tfold" ?>/img_files/xclabids.gif">&nbsp;<font class="head_font" color=red><?= $err_title ?></font>
 <br>
 <b><font class="head_font" color=red><? echo "$lang_145" ?></font></b>
 <?
  }
  else
  {
 ?>
   <b><font class="head_font" ><? echo "$lang_145" ?></font></b>
   <? 
   }
   ?>
 </td></tr>
 <tr><td width=250><input type="text" name="txttitle" class="txtbig" value="<?= $producttitle; ?>">
 </td></tr>
 <tr><td>
  <? if(!empty($err_des))
 {
 ?>
 <img src="templates/<? echo "$tfold" ?>/img_files/xclabids.gif">&nbsp;
 <font class="head_font" color=red><?= $err_des; ?></font>
 <br>
 <b><font class="head_font" color=red><? echo "$lang_189" ?></font></b>
 <?
  }
  else
  {
   ?>
   <b><font class="head_font" ><? echo "$lang_189" ?></font></b>
   <?
    }
   ?>
 </td></tr>
 <tr><td width="100%">
 <?php
include_once("fckeditor/fckeditor.php") ;
?>
<?php
$oFCKeditor = new FCKeditor('htmlcontent') ;
$oFCKeditor->BasePath = './HTMLEditor/' ;
$oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
$oFCKeditor->Create() ;
?>
<br>
<font class="head_font" class="hint_font">Describe your items features, benefits, 
and condition. Be sure to include in your description: Condition (new, used, etc.)</font></td>
</tr>
<tr>
                <td><font class="head_font" ><b>Hit Counter Style
</b></font></td>
              </tr>
<tr><td>
<? 
if($item_counter_style==2)
{
 ?>
<input type="radio" name="item_counter_style" value=1 > 
 <b><font size=+1 color="#009900">
		    12345
			</font>
			</b> 
<input type="radio" name="item_counter_style" value=2 checked> 
<I><font size=+1 color="#003399">
		    12345
			</font>
			</I>  
<?
}
else
{
?>		 
<input type="radio" name="item_counter_style" value=1 checked> 
 <b><font size=+1 color="#009900">
		    12345
			</font>
			</b> 
<input type="radio" name="item_counter_style" value=2 > 
<I><font size=+1 color="#003399">
		    12345
			</font>
			</I>  
<?
}
?></td></tr>
 <?
  if($admin_start_row['set_value']=='yes')
 {
 ?>

 <? if($mode!="edit")
 {
 ?>
  <tr><td width=250><b><font class="head_font"><? echo "$lang_519" ?></font></b></td></tr>
 <tr><td width=250>
 <select name="cbo_start_delay" >
  <option value=0 name=cbo_start_delay selected>Select</option>
 <? if($start_delay==1)
 {
 ?>
 <option value=1 name=cbo_start_delay selected>1 Days</option>
 <?
 }
 else
 {
 ?>
 <option value=1 name=cbo_start_delay>1 Days</option>
 <? 
 } 
 ?>
 <? if($start_delay==2)
 {
 ?>
 <option value=2 name=cbo_start_delay selected>2 Days</option>
 <?
 }
 else
 {
 ?>
 <option value=2 name=cbo_start_delay>2 Days</option>
 <? 
 } 
 ?>
<? if($start_delay==3)
{
?>
<option value=3 name=cbo_start_delay selected>3 Days</option>
<?
}
else
{
?>
<option value=3 name=cbo_start_delay>3 Days</option>
<? 
} 
?>
<? if($start_delay==4)
{
?>
<option value=4 name=cbo_start_delay selected>4 Days</option>
<?
}
else
{
?>
<option value=4 name=cbo_start_delay>4 Days</option>
<? 
} 
?>
<? if($start_delay==5)
{
?>
<option value=5 name=cbo_start_delay selected>5 Days</option>
<?
}
else
{
?>
<option value=5 name=cbo_start_delay>5 Days</option>
<? 
} 
?>
<? if($start_delay==6)
{
?>
<option value=6 name=cbo_start_delay selected>6 Days</option>
<?
}
else
{
?>
<option value=6 name=cbo_start_delay>6 Days</option>
<? 
} 
?>
<? if($start_delay==7)
{
?>
<option value=7 name=cbo_start_delay selected>7 Days</option>
<?
}
else
{
?>
<option value=7 name=cbo_start_delay>7 Days</option>
<? 
} 
?>
</select></td></tr>
<?
}// if($mode=="edit")
 } // if($admin_start_row=='yes')
?>
  <tr><td>
 <? if(!empty($err_qty))
 {
 ?>
 <img src="templates/<? echo "$tfold" ?>/img_files/xclabids.gif">&nbsp;<font class="head_font" color=red><?= $err_qty?></font>
 <br>
 <b><font class="head_font" color=red>Quantity</font></b>
 <?
  }
  else
  {
 ?>
   <b><font class="head_font">Quantity</font></b>
   <? 
    }
   // } //if($postformat==2) online  667
   ?>
 </td>
 <? 
 if($admin_end_row['set_value']=="yes")
 {
 ?>
 <td>
<? if(!empty($err_dur))
 { 
 ?>
 <img src="templates/<? echo "$tfold" ?>/img_files/xclabids.gif">&nbsp;<font class="head_font" color=red><?= $err_dur; ?></font>
 <br>
 <b><font class="head_font" color=red>Duration</font></b>
 <?
   }
  else
  {
 ?>
   <b><font class="head_font" >Duration</font></b>
   <? 
   }
    } //  if($admin_end_row=='yes')
   ?>
 </td>
</tr>
<tr>
 <td width=250>
 <input type="text" name="txt_qty" class="txtsmall" value=<?= $qty; ?>>
 </td>
<td width=250 >
<?  if($admin_end_row['set_value']=='yes')
{
if($mode!="edit")
{

$auction_query="select * from auction_duration";
$table=mysql_query($auction_query);

?>
<select name="cbodur">
<option value="0">Select</option>
<?
while($row=mysql_fetch_array($table))
{
?>
<? if($dur==$row['duration'])
{
?>
<option value="<?= $row['duration'] ?>" selected><?= $row['duration'] ?> Days</option>
<?
}
else
{
?>
<option value="<?= $row['duration'] ?>" ><?= $row['duration'] ?> Days</option>
<?
}
} // while($row=mysql_fetch_array($table))
?>
</select>
</td>
 <?
 } //if($mode=="edit")
 
 }  // if($admin_end_row=='yes')
 ?></tr>
<tr ><td class="tr_bottomless_border" colspan="2"><font size="2"><? echo "$lang_520" ?></font></td></tr>
<tr><td align="left" colspan="2"><font size="2"><? echo "$lang_521" ?></font>
<?
$pay_sql="select * from payment_gateway where status='Yes'";
$pay_res=mysql_query($pay_sql);
?>
<select name="payment" onChange="payment_fun()">
<option value="">Select</option>
<?
while($pay_row=mysql_fetch_array($pay_res))
{
if($pay_row[gateway_id]==$payment)
{
?>
<option value="<?=$pay_row['gateway_id'];?>" selected><?=$pay_row[payment_gateway];?></option>
<?
}
else
{
?>
<option value="<?=$pay_row['gateway_id'];?>"><?=$pay_row[payment_gateway];?></option>
<?
}
}
?>
</select>
</td>
</tr>
<tr><td align="left"><div id="pay"></div></td></tr> 
<tr width=980><td colspan="2" class="tr_bottomless_border"><font size="2"><b><? echo "$lang_200" ?></b></font></td></tr>
<tr><td colspan="2">
<? if(!empty($err_img1))
 {?>
 <img src="templates/<? echo "$tfold" ?>/img_files/xclabids.gif">&nbsp;<font class="head_font" color=red><?= $err_img1; ?></font>
 <br>
 <b><font class="head_font" color=red>Image1</font></b>
 <?
  }
  else
  {
 ?>
   <b><font class="head_font" >Image1</font></b>
   <? 
   }
   ?>
    <input type="file" name="img1" value="<?= $img1; ?>">
	<? if(!empty($_SESSION[img1]))
	{
	?>
	<img src="templates/<? echo "$tfold" ?>/img_files/gallery.png" width=10 height=10>
	<?
	}
	?></td></tr>
	<tr><td colspan="2">
  <? if(!empty($err_img2))
  {
  ?>
 <img src="templates/<? echo "$tfold" ?>/img_files/xclabids.gif">&nbsp;<font class="head_font" color=red><?= $err_img2; ?></font>
 <br>
 <b><font class="head_font" color=red>Image2</font></b>
 <?
  }
  else
  {
 ?>
   <b><font class="head_font" >Image2</font></b>
   <? }
   ?>
    <input type="file" name="img2" value=<?= $img2; ?>>
	<? if(!empty($_SESSION[img2]))
	{
	?>
	<img src="templates/<? echo "$tfold" ?>/img_files/gallery.png" width=10 height=10>
	<?
	}
	?></td></tr>
<tr><td colspan="2">
<? if(!empty($err_img3))
 {?>
 <img src="templates/<? echo "$tfold" ?>/img_files/xclabids.gif">&nbsp;<font class="head_font" color=red><?= $err_img3; ?></font>
 <br>
 <b><font class="head_font" color=red>Image3</font></b>
 <?
  }
  else
  {
 ?>
   <b><font class="head_font" >Image3</font></b>
   <? 
   }
   ?>
    <input type="file" name="img3" value=<?= $img3; ?>>
	<? if(!empty($_SESSION[img3]))
	{
	?>
	<img src="templates/<? echo "$tfold" ?>/img_files/gallery.png" width=10 height=10>
	<?
	}
	?></td></tr>
	<?  
	    $mem_sql="select * from member_details where user_id=$_SESSION[userid]";
        $mem_res=mysql_query($mem_sql);  
	    $mem_row=mysql_fetch_array($mem_res);
	    $member_account=$mem_row[member_account];
		
	if($member_account==1 or $member_account==2)
	{
$userid=$_SESSION[userid];
$mem_plan=member_tp($userid);
	$sql="select * from site_fees where admin_id=$mem_plan";
	$exe=mysql_query($sql);
	$ret=mysql_fetch_array($exe);
	$gret=$ret['gallery_price'];
    $hret=$ret['homepage_price'];
	$sret=$ret['subtitle_price'];
	$bret=$ret['bold_price'];
	$highret=$ret['highlight_price'];
	$privateret=$ret['private_fee'];

	}
	?>
	<tr width=980>
	<td colspan="2" class="tr_bottomless_border" ><font size="2"><b> <? echo "$lang_317" ?>
    </font></b></td></tr>
	<tr><td>
	<br>
	<b><font class="head_font"><? echo "$lang_318" ?></font></b>
    <br>
	<br>
	<table cellpadding="0" cellspacing="0" align="center" class="table_border1" width="100%">
	<tr bgcolor="#eeeeee"><td>&nbsp;</td><td><b>Item</b></td>
	<td><b># of Bids</b></td><td><b>Price</b></td>
	<td><b>Ends</b></td></tr>
	<tr><td><img src="templates/<? echo "$tfold" ?>/img_files/gallery.png"></td>
	<td><u><font color="blue"><? echo "$lang_319" ?></font></u></td>
	<td>-</td>
	<td>$x.xx</td>
	<td>12h 50m</td></tr>
	<tr bgcolor="eeeeee"><td>&nbsp;</td>
	<td><u><font color="blue"><? echo "$lang_145" ?></font></u>
	<br><br>
	Sub Title</td>
	<td>-</td>
	<td>$x.xx</td>
	<td>12h 50m</td></tr>
	<tr><td>&nbsp;</td>
	<td><b><u><font color="blue"><? echo "$lang_320" ?></font></u></b></td>
	<td>-</td>
	<td>$x.xx</td>
	<td>12h 50m</td></tr>
	</table>
		</td></tr>	
		<?
		 $user_query="select * from member_details where	user_id='$_SESSION[userid]'";
		$table=mysql_query($user_query);
		if($row=mysql_fetch_array($table))
		{
		 $member_type=$row['member_account'];
		}
		?>
	<tr><td>
	<? if(!empty($Gallery))
	{
	?>
	<input type="checkbox" name=chkGallery value="yes" checked>
	<?
	}
	else
	{
	?>
	<input type="checkbox" name=chkGallery value="yes">
	<?
	}
	?>
    <font class="head_font" >
	Gallery <? if($member_type==1) echo "$ (" .  $gret .")"; ?>
	 [Requires a picture,<a href="postdetails.php#img1"> <? echo "$lang_321" ?> </a>] <br>
    <? echo "$lang_322" ?> 
    </font>
	<input type=hidden name="gallery" value="<? if($member_type==1) echo $gret; ?>">
 	</td></tr>
   <tr><td>
	<? if(!empty($Home))
	{
	?>
	<input type="checkbox" name=chkHome value="yes" checked>
	<?
	}
	else
	{
	?>
	<input type="checkbox" name=chkHome value="yes">
	<?
	}
	?>
    <font class="head_font">
	Home Page Featured  
	<? if(($member_type==1)||($member_type==2)) echo "$ (" . $hret. ")"; ?>
	<input type=hidden name="home_page" value="<? if(($member_type==1)||($member_type==2)) echo $hret; ?>">
    </font>
 	</td></tr>
<!--
    <tr><td>
	<? 
	if(!empty($Subtitle))
	{
	?>
		<input type="checkbox" name=chkSubtitle value="yes" checked>
	<?
	}
	else
	{
	?>
    	<input type="checkbox" name=chkSubtitle value="yes">	
	<?
	}
	?>
    <font class="head_font" >SubTitle <br>
	<? echo "$lang_323" ?>  
    </font>
 	</td></tr>
	<tr><td width=250 >
	<input type="text" name="txtSubtitle" class="txtbig" value=<?= $Subtitle_name; ?>></td></tr> -->
	<tr><td>
	<? if(!empty($Bold))
	{
	?>
	<input type="checkbox" name=chkBold value="yes" checked>
	<?
	}
	else
	{
	?>
	<input type="checkbox" name=chkBold value="yes">
	<?
	}
	?>
     <font class="head_font" >Bold <br> <?  if(($member_type==1)||($member_type==2)) echo "$ (" . $bret .")"; ?>
    <? echo "$lang_399" ?> 
    </font>
	<input type=hidden name="bold" value="<? if($member_type==1) echo $bret; ?>">
 	</td></tr>


<tr><td>
	<? if(!empty($Privateauc))
	{
	?>
	<input type="checkbox" name=chkPrivateauc value="yes" checked>
	<?
	}
	else
	{
	?>
	<input type="checkbox" name=chkPrivateauc value="yes">
	<?
	}
	?>
     <font class="head_font" >Private Auction <br> <?  if(($member_type==1)||($member_type==2)) echo "$ (" . $privateret .")"; ?>
    <? echo "$lang_399" ?> 
    </font>
	<input type=hidden name="privateauc" value="<? if($member_type==1) echo $privateret; ?>">
 	</td></tr>



	<tr><td>
	<? if(!empty($Highlight))
	{
	?>
	<input type="checkbox" name=chkHighlight value="yes" checked>
	<?
	}
	else
	{
	?>
	<input type="checkbox" name=chkHighlight value="yes">
	<?
	}
	?>
    <font class="head_font">Highlight  <br> 
	<? if(($member_type==1)||($member_type==2)) echo "$ (" . $highret .")"; ?>
   <? echo "$lang_401" ?>  
    </font>
 	</td></tr>
	<input type=hidden name="highlight" value="<?  echo $highret; ?>">
		<?
	// }
	?>
    <input type="hidden" name=flag value="1">
	<input type="hidden" name="cat_id" value=<?= $cat_id; ?>>
	<input type="hidden" name=mode value="<?= $mode; ?>">
	<input type="hidden" name=postformat value="<?= $postformat; ?>">
	<input type="hidden" name=productid value=<?= $productid; ?>>
	<input type="hidden" name=own_html_flag value=<?= $ownhtml; ?>>
    <tr><td colspan="2" align="center">
	<? if($mode=="" or $mode=="relist" or $mode=="repost")
	{
	?>
	<input class="submit_button" type="submit" name=detsub value=Continue>
	<?
	}
	else if($mode=="change")
	{ 
	?>
	<input class="submit_button" type="submit" name=detsub value="Save" >
    <?
	}
	?></td></tr>
   </table>
   </form>
