<?php
/*
osCommRes, Services Online
http://www.oscommres.com

Copyright (c) 2005 osCommRes

Released under the GNU General Public License

Freeway eCommerce from ZacWare
http://www.zac-ware.com/freeway

Copyright 2007 ZacWare Pty. Ltd
*/
// Set flag that this is a parent file
	define( '_FEXEC', 1 );
  require('includes/application_top.php');
  require(DIR_WS_CLASSES . 'split_page_results_event.php');
  require('includes/functions/categories_description.php'); 	
  require('includes/languages/'.$language.'/products_create.php');
  require('includes/functions/subscription_tree.php');
  require(DIR_WS_CLASSES . 'currencies.php');
  global $currencies;
  $currencies = new currencies();
  require('products_create_ajax.php');  
  $command=(isset($HTTP_GET_VARS['command'])?tep_db_prepare_input($HTTP_GET_VARS['command']):'');
  $page=(isset($HTTP_GET_VARS['page'])?(int)$HTTP_GET_VARS['page']:'1');
  $cID=(isset($HTTP_GET_VARS['cID'])?(int)$HTTP_GET_VARS['cID']:0);
  $level=(isset($HTTP_GET_VARS['level'])?tep_db_prepare_input($HTTP_GET_VARS['level']):0);
  $show_order=(isset($HTTP_GET_VARS['show_order'])?tep_db_prepare_input($HTTP_GET_VARS['show_order']):'AN');
  $open_ids=isset($HTTP_GET_VARS["open_ids"])?$HTTP_GET_VARS["open_ids"] . ",":'';
  
  if($command!=''){
	$commands[]=$command;
	for($icnt=0;$icnt<count($commands);$icnt++){
  	switch($commands[$icnt]){
		case 'fetch_sub_list':
		case 'fetch_sub_list_open':
			echo 'command||fetch_sub_list{}category||' . $cID . '{}page||' . $page . '{}result||';
			echo output_sub_result($cID,$page,$show_order,$level,$open_ids);
			break;
		case 'fetch_all_list':
			$cID=substr($open_ids,0,strpos($open_ids,","));
			if($cID=='') $cID=str_replace(",","",$open_ids);
			if($icnt==1) $cID=0;
			echo 'command||' . $commands[$icnt] . '{}category||' . $cID . '{}page||' . $page . '{}result||';
			echo output_sub_result($cID,$page,$show_order,$level,$open_ids);
			break;
		case 'do_sort_list':	
			do_sort($show_order,$level);
			$commands[]="fetch_all_list";
			break;
		case 'fetch_sub_products':
			echo 'command||fetch_sub_products{}category||' . $cID . '{}page||' . $page . '{}result||';
			echo output_products_result($cID,$page,$show_order);
			break;
		 case 'product_search':
			echo 'product_search^';
			global $languages_id,$global_categories_id;			
			$product_search=isset($HTTP_GET_VARS['product_search'])?tep_db_prepare_input($HTTP_GET_VARS['product_search']):'';
			$global_categories_id=0;
			$categories_sql = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = 0 and cd.categories_name like '%" . tep_db_input($product_search) . "%' order by c.sort_order, cd.categories_name");
			if(tep_db_num_rows($categories_sql)>0){
				$categories_array=tep_db_fetch_array($categories_sql);
				$global_categories_id=$categories_array['categories_id'];				
			}
			output_sub_result(0,1,'A',0,'',1,$product_search);
			echo '<div align="right"><a href="javascript: reset_search();">'. tep_image_button('button_reset.gif', IMAGE_RESET).'</a></div>';
			break;
	    case 'reset_search':
			echo 'reset_search^';
			output_sub_result(0,1,'A',0,'',1);
			break;
		case 'load_non_category_details':
			echo 'load_non_category_details^';
			$non_categories_products_id=isset($HTTP_GET_VARS['non_categories_products_id'])?tep_db_prepare_input($HTTP_GET_VARS['non_categories_products_id']):'';
			echo $non_categories_products_id.'^';
			echo load_non_category_details($non_categories_products_id);
			break;
		case 'delete_non_product':
			echo 'delete_non_product^';
			$non_products_id=isset($HTTP_GET_VARS['non_products_id'])?tep_db_prepare_input($HTTP_GET_VARS['non_products_id']):'';
			tep_db_query("delete from ".TABLE_PRODUCTS." where products_id='$non_products_id'");
			tep_db_query("delete from ".TABLE_PRODUCTS_DESCRIPTION." where products_id='$non_products_id'");
			tep_db_query("delete from ".TABLE_PRODUCTS_NOTIFICATIONS." where products_id='$non_products_id'");
			tep_db_query("delete from ".TABLE_PRODUCTS_REMINDERS." where products_id='$non_products_id'");
			tep_db_query("delete from ".TABLE_PRODUCTS_STOCK." where products_id='$non_products_id'");
			tep_db_query("delete from ".TABLE_PRODUCTS_TO_CATEGORIES." where products_id='$non_products_id'");
			tep_db_query("delete from ".TABLE_PRODUCTS_TO_SUBSCRIPTIONS." where products_id='$non_products_id'");
			tep_db_query("delete from ".TABLE_PRODUCTS_XSELL." where products_id='$non_products_id'");

			echo tep_list_not_categories_product();
			break;
	}
   }//for loop
	exit;  
  }  
	tep_get_product_cat_ajax_list(0,0,"open_ids",$jmp_results,$jmp_open_ids);
	tep_get_last_access_file();
	$pro_id=isset($HTTP_GET_VARS['pID'])?(int)$HTTP_GET_VARS['pID']:0;		
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<style>
.stl{
	/*body {background-color: #CEE7A3;*/ 
	scrollbar-shadow-color: #CEE7A3;
	scrollbar-highlight-color: #CEE7A3;
	scrollbar-face-color: #CEE7A3;
	scrollbar-3dlight-color: #CEE7A3;
	scrollbar-darkshadow-color: #CEE7A3;
	scrollbar-track-color: #CEE7A3;
	scrollbar-arrow-color: #CEE7A3;}
}
</style>
<script language="javascript" src="includes/general.js"></script>
<script language="javascript" src="includes/http.js"></script>
<script language="javascript" src="includes/menu.js"></script>
<script language="JavaScript" src="includes/date-picker.js"></script>
<script type="text/javascript" src="htmlarea/htmlarea.js"></script>
<script type="text/javascript" src="htmlarea/editor.js"></script>
<script type="text/javascript" src="includes/aim.js"></script>
<?php 	$options_array=tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "' order by products_options_sort_order");
	while($option_result=tep_db_fetch_array($options_array)){
		$value_query=tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $option_result['products_options_id'] . "' and pov.language_id = '" . (int)$languages_id . "'");
			while($value_result=tep_db_fetch_array($value_query)){
				$options_values_array[]=array('options_id' =>$option_result["products_options_id"],
												'values_id' =>$value_result["products_options_values_id"],
												'value_name' => $value_result["products_options_values_name"]);
			}
	}
?>
<script>
var cat_expand;
var count = 0;
var id = new Array();
var category_list = new Array();
var default_category = '';
var panel_expand;
var description_expand=false;
var panel_expand_id;
var ids = new Array();
var page='<?php echo $page;?>';
var order='<?php echo $order;?>';
var prev_value;
var option_array=new Array();
var attributes_array=new Array();
var values_arr=new Array();
<?php
	for($i=0,$n=sizeof($options_values_array); $i<$n; $i++){?>
				option_array[<?php echo $i;?>]="<?php echo $options_values_array[$i]['options_id'].'#'.$options_values_array[$i]['values_id'].'#'.$options_values_array[$i]['value_name'];?>";		
				values_arr[<?php echo $options_values_array[$i]['values_id']?>]="<?php echo $options_values_array[$i]['value_name']?>";
	<?php	}
?>
var attrb_cnt=0;
var pname="";
var cname="";
var splt=Array();
 for(i=0;i<option_array.length;i++){
		splt=option_array[i].split("#");
		cname=splt[0];
		if(pname!=cname){
			attributes_array[attrb_cnt]=cname;
			attrb_cnt++;
			pname=splt[0];
		}
	}
 
	function getdetails(page,orders){
		order=orders;
		if(document.getElementById("load_details")) document.getElementById("load_details").style.display="";
		command="<?php echo tep_href_link(FILENAME_PRODUCTS_MAINPAGE,'command=fetch_details');?>&page="+ page + "&panel="+panel_expand+ '&cID='+panel_expand_id + '&order=' +order;
		do_get_command(command);
	}	
	function get_details(type,cID,pID,page,params){
		if(document.getElementById("load_details")) document.getElementById("load_details").style.display="";
		if(type=='PM') command="<?php echo tep_href_link(FILENAME_CATEGORIES,'command=fetch_details');?>&page="+ page + "&panel="+panel_expand+ '&cID='+panel_expand_id+'&pID='+pID ;
		do_get_command(command);
	}
	function display_popup(){
		if(document.getElementById("display_menu"))document.getElementById("display_menu").style.display = "";
	}
	function display_null(){
		if(document.getElementById("display_menu"))document.getElementById("display_menu").style.display = "none";
	}
</script>
</head>
<body marginwidth="0"  marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php   
	$file_name=FILENAME_PRODUCTS_MAINPAGE;	
	require(DIR_WS_INCLUDES . 'products_mainpage.js.php');
	require(DIR_WS_INCLUDES . 'header.php');
?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
	<tr>
	<!-- body_text //-->
		<td width="100%" valign="top">
			<table border="0" width="100%" cellspacing="0" cellpadding="2">
				<tr>
					<td>
					<table border="0"  width="100%" cellspacing="0" cellpadding="0">
					<tr>
					<td>
					<table width="100%" cellpadding="0" cellspacing="0" border="0">
					<tr class="dataTableHeadingRow" style="height:25px">
                 	<td colspan="5">
                 		<table border="0" cellspacing="0" cellpadding="0" width=100%>	
                 			<tr>
                 				<td valign="bottom" class="pageHeading" align="left" width="500" ><?php echo '<a onMouseOver="javascript:change_class(this,2);" onMouseOut="javascript:change_class(this,3);" alt="Product" title="Product" id="img_new" href="javascript:do_actions(\'new_category\');">'.tep_image(DIR_WS_IMAGES.'template/img_new.gif','22','22','22').'</a>'; ?></td>
			                 	<td class="dataTableHeadingContent" align="right" valign="bottom" width="300"><?php echo tep_draw_form('product_search_form',FILENAME_PRODUCTS_MAINPAGE,'','post','onSubmit="javascript: return product_search_validation();"').'&nbsp;'.TEXT_SEARCH.tep_draw_input_field('product_search').'&nbsp;';?>
								<input  type="image" align="absbottom" src="<?php echo DIR_WS_IMAGES.'template/img_search.gif';?>" alt="Search" title="Search"></form></td>	
								<td valign="bottom" class="dataTableHeadingContent" align="right" width="200"><?php echo TEXT_JUMP_TO.'&nbsp;&nbsp;'.tep_draw_pull_down_menu("cbo_jumpto",$jmp_results,'',' style="width:100px;" onChange="javascript:do_jump_list(this.value)"'); ?></td>
                 			</tr>
                 	</table>
                 	</td>                 	
               </tr>
					<tr class="dataTableHeadingRow" style="height:25">
						<td align="left" width='3%'>
						<?php 
							echo tep_image(DIR_WS_IMAGES . 'template/icon_descending.gif',IMAGE_ASCENDING,'','',' id="pop_common_sort_display_con" onMouseOver="javascript:show_cpopup(\'sort_display\',0,20);" onclick="javascript:show_sort();"');
							echo '<input type="hidden" name="show_sort_order" id="show_sort_order" value="AN">';
							echo "<div id='pop_common_sort_display' style='position:absolute;display:none;width:110px;height:70px;z-index:999;border:1px solid;border-color:#6883CA;background-color:#FFFFFF;padding:3px;'>";
							echo tep_draw_separator('pixel_trans.gif','10','5');
							echo '<br><table class="main" cellpadding="0" cellspacing="0">';
							$popup=array(array("img"=>'icon_ascending.gif',"txt"=>TEXT_ASCENDING,'id'=>'AN'),array("img"=>'icon_descending.gif',"txt"=>TEXT_DESCENDING,'id'=>'DN'),array('img'=>'icon_active.gif',"txt"=>TEXT_SHOW_AVAILABLE,"id"=>'AV'));											
							for ($icnt=0,$n=count($popup);$icnt<$n;$icnt++){
								echo '<tr height="20" class="tableMenuItem" onMouseOver="javascript:rowOverEffect(this)" onMouseOut="javascript:rowOutEffect(this)"><td valigm="middle" width="18">' . tep_image(DIR_WS_IMAGES . "template/" .$popup[$icnt]["img"],$popup[$icnt]["txt"],'','','align=absmiddle') . '</td><td>';
								echo '<a style="color:#000000;text-decoration:none" href="javascript:do_page_fetch(\'fetch_all_list\',\'' . $popup[$icnt]["id"] . '\');">' . $popup[$icnt]["txt"] . '</a></td></tr>';
								echo '<tr height="3"><td></td></tr>';
							}
							echo "</td></tr></table></div>";
						?>
						</td>
						<td colspan="4" width='92%' align="left" class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>
					</tr>
					</table></td>
					</tr>
						<tr>
							<td valign="top">
							  <table border="0" width="100%" cellspacing="0" cellpadding="2">
								<tr><td class="dataTableHeadingContent" colspan="2" id="res_display" style="display:none"></td></tr>
								  <tr>
									<td id="get_details" colspan="2">
									   <?php
									    	$display='style="display:none"';
									    	$action_type="";  
									   		if($HTTP_GET_VARS['pID']>0 && $HTTP_GET_VARS['cID']>0 && (isset($HTTP_GET_VARS['source']) && (tep_db_prepare_input($HTTP_GET_VARS['source']))=='products_expected')) {
									   			$display='';
									   			$action_type='edit';
									   		}									   		
									   		set_time_limit(5);
										 	echo tep_draw_form('new_product', FILENAME_PRODUCTS_MAINPAGE, 'action=file_upload', 'post', ' onSubmit="javascript:return AIM.submit(document.new_product, {\'onStart\' : startCallback_product, \'onComplete\' : completeCallback_product});" enctype="multipart/form-data"'); 
											
											echo tep_draw_hidden_field('attributes_array','');
							
											//echo tep_draw_hidden_field('is_attributes');
											echo tep_draw_hidden_field('product_to_subscripiton');
													
									    ?>
										<input type='hidden' id="product_id" name='product_id' value='<?php echo tep_output_string($pID);?>'>
										<input type="hidden" id="sort_order" name="sort_order">
										<input type="hidden" id="category_sort_order" name="category_sort_order">
										<input type='hidden' id="action_type" name='action_type' value='<?php echo tep_output_string($action_type);?>'>								
										
										<input type='hidden' id="image_type" name='image_type'>							
										<div id="new_category" <?php echo $display;?>><?php echo (($action_type=='edit')?product_new_edit():'');?></div>			
										<div id="search_result_details"><?php output_sub_result(0,1,'A',0,'',1); ?></div>
										<div id="non_category_product"><?php echo tep_list_not_categories_product(); ?></div>	
										<?php if($action_type=='edit'){ ?>
											<script language="javascript">
												 editor_init('edit');
												 description_expand=true;
						  					</script>   
									<?php } ?>	
																																					
										</form>										
									</td>
								</tr>	
							</table>
							</td>
						</tr>
						<tr>
							 <td>
								<table border="0" width="100%" cellspacing="0" cellpadding="0">
									<tr>
										<td>
										 <table border="0" width="100%" cellpadding="5" cellspacing="0">
											<tr>
												<td>
												<table cellpadding="0" cellspacing="0" border="0" width="100%">
													<tr class="product_title">
														<td colspan="2"><?php echo '<b>' . TABLE_PRODUCT_MANAGEMENT . '</b>'; ?></td>
													</tr>	
													<tr height="7"/>
													<tr>
														<td width="7%"><table border="0" border="0" cellpadding="0" cellspacing="0" width="74px" height="84px">
															<tr> 
																<td width="63px" height="74px"> 
																<?php echo tep_image(DIR_WS_IMAGES . 'product_mgt.gif', ProductManagement);?>
																</td>
															</tr>	
														</table>	
														</td>
														<td width="93%" valign="top">
															<table width="100%" class="info_content">
																<tr><td class="info_content"><?php echo '<a id="link_categories" href="javascript:do_actions(\'new_category\');">' . IMAGE_NEW_CATEGORY . '</a>'; ?></td></tr>
																<tr><td class="info_content"><?php echo '<a id="link_product" href="javascript:do_actions(\'new_product\');">' . IMAGE_NEW_PRODUCT . '</a>'; ?></td></tr>																
																<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_FEATURED) . '">' . IMAGE_NEW_FEATURED_PRODUCT . '</a>'; ?></td></tr>
																<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS,'page=1&action=new') . '">' . IMAGE_NEW_SPECIAL_PRODUCT . '</a>'; ?></td></tr>
															</table>
														</td>
													</tr>	
												</table>
												</td>
												</tr>
												<tr>
												<td>
												<table cellpadding="0" cellspacing="0" width="100%" border="0">
													<tr class="product_title">
														<td colspan="2"><?php echo '<b>' .TABLE_PRODUCT_MARKETING . '</b>'; ?></td>
													</tr>	<tr height="7"/>
													<tr>
														<td width="7%"><table border="0" cellpadding="0" cellspacing="0" width="74px" height="84px">
														<tr> 
																<td> 
															<?php echo tep_image(DIR_WS_IMAGES . 'pdt_marketing.gif', ProductMarketing);?>
															</td></tr>
															</table>
														</td>
														<td width="93%" valign="top">
															<table border="0" class="info_content" >
																<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_SALEMAKER,'top=1') . '">' . IMAGE_DISCOUNTS . '</a>'; ?></td></tr>
																<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_SALES,'top=1') . '">' . PROMOTE_PRODUCT_SALE . '</a>'; ?></td></tr>
																<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES,'cPath='.$categories['categories_id'].'&action=new_product') . '">' . PRODUCT_STATUS_CHANGE . '</a>'; ?></td></tr>
																<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_REVIEWS,'top=1') . '">' . PRODUCTS_REMINDERS . '</a>'; ?></td></tr>
															</table>
														</td>
													</tr>
												</table>	
												</td>
											</tr>
											<tr>
												<td>
													<table cellpadding="0" cellspacing="0" width="100%" border="0">
														<tr class="product_title">
															<td colspan="2"><?php echo '<b>' . TABLE_PRODUCT_REPORTS . '</b>'; ?></td>
														</tr>	<tr height="7"/>
														<tr>
															<td width="7%"><table border="0" cellpadding="0" cellspacing="0" width="74px" height="84px">
																<tr> 
																<td> 
																<?php echo tep_image(DIR_WS_IMAGES . 'reports.gif', Reports);?>
																</td></tr>
																</table>
															</td>		
															<td width="93%" valign="top">
																<table  class="info_content">
																	<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED,'top=1') . '">' . BEST_VIEWED_PRODUCTS . '</a>'; ?></td></tr>
																	<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_INVENTORY,'top=1') . '">' . SEE_INVENTORY . '</a>'; ?></td></tr>
																	<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_CART_DROP_REPORT,'top=1') . '">' . DROPPED_CART . '</a>'; ?></td></tr>
																	<tr><td class="info_content"><?php echo '<a href="' . tep_href_link(FILENAME_REPORTS_FULFILLER,'top=1') . '">' . FULLFILLER . '</a>'; ?></td></tr>
																</table>
															</td>
														</tr>
													</table>
												</td>
												<td height="5"></td>
											</tr>
										 </table>
									  </td>
									</tr>
								 </table>		
								</td>
							</tr>			
						</table>
					</td>
				</tr>								
</table>
<div id="ajax_load_img" style="display:none"><?php echo tep_image(DIR_WS_IMAGES . '24-1.gif') ;?></div>
<?php //products_create_ajax
	$options_values_array=array();
	$options_array=tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "' order by products_options_sort_order");
	while($option_result=tep_db_fetch_array($options_array)){
	$value_query=tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $option_result['products_options_id'] . "' and pov.language_id = '" . (int)$languages_id . "'");
	while($value_result=tep_db_fetch_array($value_query)){
		$options_values_array[]=array('options_id' =>$option_result["products_options_id"],
										'values_id' =>$value_result["products_options_values_id"],
										'value_name' => $value_result["products_options_values_name"]);
	}
  }	
	$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
	$tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
	while ($tax_class = tep_db_fetch_array($tax_class_query)) {
	  $tax_class_array[] = array('id' => $tax_class['tax_class_id'],
								 'text' => $tax_class['tax_class_title']);
	}
?>  
<!-- body_text_eof //-->
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); 	  ?>
<?php if(isset($HTTP_GET_VARS['create_category']) && tep_db_prepare_input($HTTP_GET_VARS['create_category'])=='new'){ ?>
	<script langauge="javascript">
	if(document.getElementById("action_type")) document.getElementById("action_type").value='new_category';
	if(document.getElementById("cPath")){
			var cPath=document.getElementById("cPath").value;
			toggle_category_panel(cPath,0);
	}

	do_get_command('<?php echo tep_href_link(FILENAME_PRODUCTS_MAINPAGE,'action=edit_category&return=menu');?>');
	</script>
<?php } 
 if(isset($HTTP_GET_VARS['create_product']) && tep_db_prepare_input($HTTP_GET_VARS['create_product'])=='new'){ ?>
	<script langauge="javascript">
	if(document.getElementById("action_type")) document.getElementById("action_type").value='new';
	do_get_command('<?php echo tep_href_link(FILENAME_PRODUCTS_MAINPAGE,'action=edit_product&return=menu');?>');
	</script>
<?php } ?>