Location: PHPKode > projects > Warp.cms - php/mysql content management > warp_121/mod_products.php
<?php

// [products module v.1.2.1]
// xantis.warp.cms - version 1.2
// (c) 2002 xantis - all rights reserved
// this code is registered and protected by international copyrights laws


//##################################################

if ($warp_module_var_check_auth != 'x99warpv12.cms') {
	$y_hlocalmodz_xdate = date("Y-m-d");
	$y_hlocalmodz_xtime = date("H:i:s");
	$wpmod_xdyech =	"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n".
			"<!--:: xantis.warp.cms :: Xantis Warp - Content Management Server - v.1.2 :: $y_hlocalmodz_xdate :: $y_hlocalmodz_xtime :: -->\n".
			"<html>\n".
			"<head>\n".
			"<title>! ! !</title>\n".
			"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n".
			"</head>\n".
			"<body bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n".
			"<br>\n".
			"<div align=\"center\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash6/cabs/swflash.cab#version=6,0,0,0\" width=\"30\" height=\"30\">\n".
			"<param name=\"movie\" value=\"flagger.swf\">\n".
			"<param name=\"flashvars\" value=\"&xaction=err&\">\n".
			"<param name=\"quality\" value=\"high\">\n".
			"<param name=\"bgcolor\" value=\"#FFFFFF\">\n".
			"<param name=\"menu\" value=\"false\">\n".
			"<embed src=\"flagger.swf\" flashvars=\"&xaction=err&\" quality=\"high\" bgcolor=\"#FFFFFF\" width=\"30\" height=\"30\" menu=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>\n".
			"</object>\n".
			"</div>\n".
			"</body>\n".
			"</html>\n" ;
	die("$wpmod_xdyech");
} //end if


//---------------------
if (empty($pmop)) {
   $pmop = 'pcat';
} //end if
//---------------------


//======================require secure

function prod_secure () {

	global 	$mod_req_sec;
	global 	$pmop;
	global	$y_warp_prods_restrict_details_acc, $y_warp_prods_restrict_downloads_acc, $y_warp_prods_restrict_resources_acc ;

	if ( (($pmop == 'pdet') AND ($y_warp_prods_restrict_details_acc == 'y')) OR (($pmop == 'pdwn') AND ($y_warp_prods_restrict_downloads_acc == 'y')) OR (($pmop=='pres') AND ($y_warp_prods_restrict_resources_acc == 'y')) ) {
		$mod_req_sec = 'y';
	} // end if

	return $mod_req_sec;

} //end function

//=====================================


//=======================================functions


function xshow_prod_categs_data ($ytitle, $ytotal, $ydetail, $ypict, $ylink) {

	global 	$ywebsite_addr, $y_warp_picts_dir, $y_warp_pcat_picts_dir,
		$ybar_color, $ymain_color, $ydisplay_width_corrected,
		$yprods_categ_view_prods, $yprods_categ_title_xs ;

	$ysize = $ydisplay_width_corrected;

	//icon size
	$ysize_icon = '50';

	//pict size
	$y_size_w_pict = '100';
	$y_size_h_pict = '75';

	//calc sizes
	$ysize_det = $y_size_w_pict + 10;
	$ysize_descr = $ysize - ($ysize_icon + $ysize_det);


//-------------------------------
xtable_start ("$ysize");
//-------------------------------

//-----------------------title
	xtable_row_start ();
		xtable_column_start ('1', "$ysize", "$ybar_color");
			//title
			xtext_title ("$ytitle");
		xtable_column_end ();
	xtable_row_end ();

//-----------------------vline
	xtable_row_start ();
		xtable_column_start ('1', "$ysize", "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();

//-----------------------middle
	xtable_row_start ();
		xtable_column_start ('1', "$ysize", "$ymain_color");

			xtable_start ("$ysize");
				xtable_row_start ();

					xtable_column_start ('1', "$ysize_icon", "$ymain_color");
						//icon
						xspace ();
						xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_categ.jpg', '30', '30', "$yprods_categ_title_xs");
					xtable_column_end ();

					xtable_column_start ('1', "$ysize_descr", "$ymain_color");
						//the link
						xtext_link ("$yprods_categ_view_prods", "$ylink", '_self');

						//totals
						xtext_small (' ('.$ytotal.')');

						//detail
						xnewline ();
						xnewline ();
						xtext_small ("$ydetail");
					xtable_column_end ();

					xtable_column_start ('1', "$ysize_det", "$ymain_color");
						xspace ();
						//the picture
						if (substr($ypict, -4, 4) == '.swf') {
							xwriteflash_nobg ("$ywebsite_addr"."$y_warp_pcat_picts_dir".'/'."$ypict", "$y_size_w_pict", "$y_size_h_pict");
						} //end if
						elseif (!empty($ypict)) {
							xpict ("$ywebsite_addr"."$y_warp_pcat_picts_dir".'/'."$ypict", "$y_size_w_pict", "$y_size_h_pict");
						} //end elseif
					xtable_column_end ();

				xtable_row_end ();
			xtable_end ();

		xtable_column_end ();
	xtable_row_end ();

//-----------------------vline
	xtable_row_start ();
		xtable_column_start ('1', "$ysize", "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();


//-------------------------------
xtable_end ();
//-------------------------------

} //end function
//----------------



function xshow_prod_items_data ($ytype, $ypromo, $ytitle, $yprice, $ydetail, $ypict, $ylink, $yviews) {

	global 	$ywebsite_addr, $y_warp_picts_dir, $y_warp_pitm_picts_dir, $y_warp_crr_dir,
		$ybar_color, $ymain_color, $ydisplay_width_corrected, $yprods_item_title, 
		$yprods_item_view_detail, $yprods_item_title_xs, $yprods_item_price, 
		$yprods_item_crr, $yecomm_buyonline, $yprods_item_promo, $yprods_item_noprice,
		$yprods_item_xtotal_views ;


	$ysize = $ydisplay_width_corrected;

	//icon size
	$ysize_icon = '50';

	//pict size
	$y_size_w_pict = '100';
	$y_size_h_pict = '75';

	//calc sizes
	$ysize_det = $y_size_w_pict + 10;
	$ysize_descr = $ysize - ($ysize_icon + $ysize_det);

	$y_crr_active = '/crr_'."$yprods_item_crr".'.jpg';


//-------------------------------
xtable_start ("$ysize");
//-------------------------------

//-----------------------title
	xtable_row_start ();
		xtable_column_start ('1', "$ysize", "$ybar_color");
			//title
			xtext_title ("$ytitle");
		xtable_column_end ();
	xtable_row_end ();

//-----------------------vline
	xtable_row_start ();
		xtable_column_start ('1', "$ysize", "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();

//-----------------------middle
	xtable_row_start ();
		xtable_column_start ('1', "$ysize", "$ymain_color");

			xtable_start ("$ysize");
				xtable_row_start ();

					xtable_column_start ('1', "$ysize_icon", "$ymain_color");
						//icon
						xspace ();
						xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_item.jpg', '30', '30', "$yprods_item_title_xs");

						//promo icon
						if ($ypromo == 'promo') {
							xnewline ();
							xspace ();
							xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_item_p.jpg', '30', '30', "$yprods_item_promo");
						} //end if
					xtable_column_end ();

					xtable_column_start ('1', "$ysize_descr", "$ymain_color");
						//the link
						if ($ytype == 'e') {
							xtext_link ("$yprods_item_view_detail".' / '."$yecomm_buyonline", "$ylink", '_self');
							xspace ();
							xtext_small (' [ '.$yviews.' '.$yprods_item_xtotal_views.' ] ');
						} //end if
						else {
							xtext_link ("$yprods_item_view_detail", "$ylink", '_self');
							xspace ();
							xtext_small (' [ '.$yviews.' '.$yprods_item_xtotal_views.' ] ');
						} //end else

						//detail
						xnewline ();
						xnewline ();
						xtext_small ("$ydetail");

						//price
						xnewline ();
						xnewline ();

						xtable_start ('');
							xtable_row_start ();
								xtable_column_start_vcenter ('1', '', "$ymain_color");
									xtext_small ('<b>'.$yprods_item_price.' : '.$yprice.'</b>');
								xtable_column_end ();

								if ($ytype <> 'x') {
									xtable_column_start_vcenter ('1', '', "$ymain_color");
										xspace ();
										xpict ("$ywebsite_addr"."$y_warp_crr_dir"."$y_crr_active", '20', '20');
									xtable_column_end ();
								} //end if
							xtable_row_end ();
						xtable_end ();
					xtable_column_end ();

					xtable_column_start ('1', "$ysize_det", "$ymain_color");
						xspace ();
						//the picture
						if (substr($ypict, -4, 4) == '.swf') {
							xwriteflash_nobg ("$ywebsite_addr"."$y_warp_pitm_picts_dir".'/'."$ypict", "$y_size_w_pict", "$y_size_h_pict");
						} //end if
						elseif (!empty($ypict)) {
							xpict ("$ywebsite_addr"."$y_warp_pitm_picts_dir".'/'."$ypict", "$y_size_w_pict", "$y_size_h_pict");
						} //end elseif
					xtable_column_end ();

				xtable_row_end ();
			xtable_end ();

		xtable_column_end ();
	xtable_row_end ();

//-----------------------vline
	xtable_row_start ();
		xtable_column_start ('1', "$ysize", "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();


//-------------------------------
xtable_end ();
//-------------------------------

} //end function
//----------------



function products_module () {

//link
global	$pmop, $offset, $wpqid, $wpsid,
	$offxc, $offxi, $qval, 
	$fcategid, $fitmid ;

//main
global	$arr_var_result, $var_result_size,
	$PHP_AUTH_PW, $PHP_AUTH_USER ;

//dirs
global	$ywebsite_addr, $ywebsite_addr_secure, $y_warp_picts_dir, 
	$y_warp_pitm_picts_dir,	$y_warp_pcat_picts_dir, $y_warp_crr_dir ;

//warp cfg
global	$y_warp_prev_text, $y_warp_next_text, $y_warp_total_text, $y_warp_filter_text,
	$y_warp_filter_hint, $y_warp_filter_text_bttn, $y_warp_filter_remove, 
	$y_warp_keyword_txt, $y_warp_back_text, $y_warp_text_okay, $y_warp_filtered_text,
	$y_warp_print_text, $y_warp_filter_sign ;

//cfg
global	$ydisplay_width_corrected, $ybar_color, $ybar_menu_color, $ymain_color,
	$ysite_back_color, $ysmall_text_color ;

//local
global	$y_warp_max_prods_perpage, $yprods_show_title, $yprods_categ_title,
	$yprods_categ_title_short, $yprods_categ_title_xs, $yprods_categ_title_xs_short,
	$yprods_item_title, $yprods_item_title_short, $yprods_item_title_xs,
	$yprods_item_code, $yprods_item_pname, $yprods_item_cartprocess, $yprods_item_promo,
	$yprods_item_cartadd_hint, $yprods_item_cartdelete, $yprods_item_code_full,
	$yprods_item_weight_um, $yprods_item_weight, $yprods_item_descr, $yprods_item_noprice,
	$yprods_item_details, $yprods_item_specifications, $yprods_item_package, 
	$yprods_item_delivery_method, $yprods_item_delivery_method_p, $yprods_item_delivery_pst_note,
	$yprods_item_delivery_method_d, $yprods_item_delivery_dwn_note, $yprods_item_crr,
	$yprods_item_price, $yprods_item_crr_expl, $yprods_item_delivery_method_s,
	$yprods_item_askfordetails ;

//downloads and resources
global	$y_warp_downloads_text_p, $y_warp_resources_text_p ;

//ecomm
global	$yecomm_active, $yecomm_shoppingcart, $yecomm_showcart, $yecomm_addtocart, $yecomm_buyonline ;

//number format
global	$warp_numform_decimal_sep, $warp_numform_thousand_sep ;

//######################################



//###################################### OP product categs


if ($pmop=='pcat') {

$limit = $y_warp_max_prods_perpage;

//----------------------------------------------get data

//---------------------
if (empty($offset)) {
   $offset = 0;
} //end if
//---------------------


//---------------the prod categs

	$wquerry_main = "SELECT id, title, description, pict FROM prod_categs WHERE (active='y') ";

	$wquerry_main_c = "SELECT COUNT(*) FROM prod_categs WHERE (active='y') ";

	$arr_pcat_result = array();

	xmysql_count_data ($wquerry_main_c);
	xmysql_read_data ($wquerry_main." ORDER BY id DESC LIMIT $offset, $limit");
	$arr_pcat_result = $arr_var_result;
	$y_pcat_nums = $var_result_size;

	//---------------------------------------------
		//vars
		$newoffsetnext = $offset + $limit ;
		$newoffsetprev = $offset - $limit ;
		$offsetlistedmin = $offset + 1;

		if ($newoffsetnext <= $y_pcat_nums) {
			$offsetlistedmax = $newoffsetnext;
		} //end if
		else {
			$offsetlistedmax = $y_pcat_nums;
		} //end else

		if ($offsetlistedmax == 0) {
			$offsetlistedmin = 0;
		} //end if
	//---------------------------------------------

	//==================== products categs where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yprods_show_title</b>");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

	//=====================================


	//==================== cart

	if ($yecomm_active == 'y') {

	xtable_start ("$ydisplay_width_corrected");

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '30%', "$ybar_menu_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();
					xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_cart.jpg', '30', '30', "$yecomm_shoppingcart");
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '50%', "$ybar_menu_color");

				xwriteflash_bg_var ('alinker.swf',
					"&alinker_txt=".rawurlencode("$yecomm_showcart").
					"&alinker_url=".rawurlencode("$ywebsite_addr_secure".'cart_shop.php').
					"&wpqid=".rawurlencode($wpqid).
					"&wpsid=".rawurlencode($wpsid).
					"&"
				, '250', '20', "$ybar_menu_color");

			xtable_column_end ();

			xtable_column_start_vcenter ('1', '20%', "$ybar_menu_color");
					xspace ();
			xtable_column_end ();
		xtable_row_end ();

	xtable_end ();
	xnewline ();

	} //end if

	//=====================================



	//==================== prod categs nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yprods_categ_title</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$y_pcat_nums</b> $y_warp_total_text)]");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pcat&offset=$newoffsetprev", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $y_pcat_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pcat&offset=$newoffsetnext", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

	//=====================================


	//==================== list categs


	$arr_count = count($arr_pcat_result);
	for ($i=0; $i < $arr_count; $i++) {
		$i_id = $i;
		$i_title = $i + 1;
		$i_descr = $i + 2;
		$i_pict = $i + 3;
		$i = $i + 3;

		//get data about number of products within each categ

		xmysql_count_data ("SELECT COUNT(*) FROM prod_items WHERE ( (categ_id='$arr_pcat_result[$i_id]') AND (active='y') ) ");
		//$var_result_size;

		//--------------------------------------list pcategs

		$y_pcat_lnk = "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pitm&fcategid=$arr_pcat_result[$i_id]&offxc=$offset&offset=0" ;

		xshow_prod_categs_data ($arr_pcat_result[$i_title], $var_result_size, $arr_pcat_result[$i_descr], $arr_pcat_result[$i_pict], $y_pcat_lnk);

		xnewline ();
		
		//------------
	}//end for

	//==================== prod categs nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yprods_categ_title</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$y_pcat_nums</b> $y_warp_total_text)]");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pcat&offset=$newoffsetprev", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $y_pcat_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pcat&offset=$newoffsetnext", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

	//=====================================


} //end if




//###################################### OP product items

if ($pmop=='pitm') {

$limit = $y_warp_max_prods_perpage;

//------------------------------------------------------establish vars
//vars
$qval = rawurldecode($qval);
$qwval_src = trim($qval);
$qwval_src_arr = array ();
$qwval_src_arr = explode("$y_warp_filter_sign", $qwval_src);
$qval_url = rawurlencode(stripslashes($qval));
$xurl = "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=$pmop&fcategid=$fcategid&offxc=$offxc&offset=0";
//----------------------------------------

//------------------------------------------------------search querry
//filter empties
$qwval_src_arr_new = array ();
for ($i=0 ; $i<count($qwval_src_arr) ; $i++) {
	if ( trim($qwval_src_arr[$i]) <> '' ) {
		array_push ($qwval_src_arr_new, trim($qwval_src_arr[$i]));
	} //end if
} //end for

//build the querry
if (count($qwval_src_arr_new) <> '0') {
	$w_querryx_bld = " AND ";
	for ($i=0 ; $i<count($qwval_src_arr_new) ; $i++) {
		$w_querryx_bld_i = $qwval_src_arr_new[$i];
		$w_querryx_bld = " ".$w_querryx_bld." ( (title LIKE '%".$w_querryx_bld_i."%') OR (description LIKE '%".$w_querryx_bld_i."%') OR (full_detail LIKE '%".$w_querryx_bld_i."%') ) ";
		if ($i <> ( count($qwval_src_arr_new) - 1 ) ) {
			$w_querryx_bld = $w_querryx_bld." AND " ;
		} //end if
	} //end for
} //end if

//[set text if filtered] or [empty querry]
$w_src_filteredby = " - ".$y_warp_filtered_text ;
if (count($qwval_src_arr_new) == '0') {
	$w_querryx_bld = ' ';
	$w_src_filteredby = '';
} //end if

//-----------------------------------------------------------------


//----------------------------------------------get data

//---------------------
if (empty($offset)) {
   $offset = 0;
} //end if
//---------------------

//---------------the selected categ

	$arr_categ_result = array();

	xmysql_read_data ("SELECT title FROM prod_categs WHERE (id='$fcategid') ");
	$arr_categ_result = $arr_var_result;


//---------------the prod items


	$wquerry_main = "SELECT id, title, description, pict_s, p_code, price, promo, e_comm, promo_txt FROM prod_items WHERE ( (categ_id='$fcategid') AND (active='y') ".$w_querryx_bld." )";

	$wquerry_main_c = "SELECT COUNT(*) FROM prod_items WHERE ( (categ_id='$fcategid') AND (active='y') ".$w_querryx_bld." )";

	$arr_pitm_result = array();

	xmysql_count_data ($wquerry_main_c);
	xmysql_read_data ($wquerry_main." ORDER BY promo DESC, id DESC LIMIT $offset, $limit");
	$arr_pitm_result = $arr_var_result;
	$y_pitm_nums = $var_result_size;

	//---------------------------------------------
		//vars
		$newoffsetnext = $offset + $limit ;
		$newoffsetprev = $offset - $limit ;
		$offsetlistedmin = $offset + 1;

		if ($newoffsetnext <= $y_pitm_nums) {
			$offsetlistedmax = $newoffsetnext;
		} //end if
		else {
			$offsetlistedmax = $y_pitm_nums;
		} //end else

		if ($offsetlistedmax == 0) {
			$offsetlistedmin = 0;
		} //end if
	//---------------------------------------------

	//==================== products items where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yprods_show_title</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yprods_categ_title_short", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pcat&offset=$offxc", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

	//=====================================


	//==================== src bar, category, cart

	xtable_start ("$ydisplay_width_corrected");

	//-----------------------cart

	if ($yecomm_active == 'y') {

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '30%', "$ybar_menu_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();
					xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_cart.jpg', '30', '30', "$yecomm_shoppingcart");
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '50%', "$ybar_menu_color");

				xwriteflash_bg_var ('alinker.swf',
					"&alinker_txt=".rawurlencode("$yecomm_showcart").
					"&alinker_url=".rawurlencode("$ywebsite_addr_secure".'cart_shop.php').
					"&wpqid=".rawurlencode($wpqid).
					"&wpsid=".rawurlencode($wpsid).
					"&"
				, '250', '20', "$ybar_menu_color");

			xtable_column_end ();

			xtable_column_start_vcenter ('1', '20%', "$ybar_menu_color");
					xspace ();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start ('3', '100%', "$ysite_back_color");
					xspace ();
			xtable_column_end ();
		xtable_row_end ();

	} //end if

	//-----------------------src bar
	xtable_row_start ();
		xtable_column_start ('3', '100%', "$ysite_back_color");
			xcenter_start ();

				xwriteflash_nobg_var ("$ywebsite_addr"."src_frm.swf",
					"&flash_form_backcolor=".rawurlencode($ymain_color).
					"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
					"&flash_form_text_flby=".rawurlencode($y_warp_filter_text).
					"&flash_form_text_hint=".rawurlencode($y_warp_filter_hint).
					"&flash_form_text_bttn=".rawurlencode($y_warp_filter_text_bttn).
					"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/prod_item.jpg').
					"&flash_form_listall=".rawurlencode($y_warp_filter_remove).
					"&qval_hint=".rawurlencode("[$yprods_item_pname | $y_warp_keyword_txt]").
					"&qval=".$qval_url.
					"&xurl=".rawurlencode("$xurl").
					"&"
				, '500', '40');

			xcenter_end ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('3', '100%', "$ysite_back_color");
				xspace ();
		xtable_column_end ();
	xtable_row_end ();

	//-----------------------category
	xtable_row_start ();
		xtable_column_start_vcenter ('1', '30%', "$ymain_color");
			xcenter_right_start ();
				xvpix_h ('5');
				xnewline ();
				xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_categ.jpg', '30', '30', "$yprods_categ_title_xs");
				xspace ();
				xspace ();
			xcenter_end ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '50%', "$ymain_color");
				xtext_small ("$yprods_categ_title_xs_short".' : '.'<b>'."$arr_categ_result[0]".'</b>');
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '20%', "$ymain_color");
				xspace ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_end ();

	xnewline ();


	//=====================================



	//==================== prod items nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yprods_item_title</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$y_pitm_nums</b> $y_warp_total_text)]"."$w_src_filteredby");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pitm&fcategid=$fcategid&offxc=$offxc&offset=$newoffsetprev&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $y_pitm_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pitm&fcategid=$fcategid&offxc=$offxc&offset=$newoffsetnext&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

	//=====================================


	//==================== list items


	$arr_count = count($arr_pitm_result);
	for ($i=0; $i < $arr_count; $i++) {
		$i_id = $i;
		$i_title = $i + 1;
		$i_descr = $i + 2;
		$i_pict = $i + 3;
		$i_pcode = $i + 4;
		$i_price = $i + 5;
		$i_promo = $i + 6;
		$i_ecomm = $i + 7;
		$i_promo_txt = $i + 8;
		$i = $i + 8;

		//--------------------------------------list pitems

		$y_itm_lnk = "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pdet&fcategid=$fcategid&fitmid=$arr_pitm_result[$i_id]&offxc=$offxc&offxi=$offset&qval=$qval_url" ;

		$y_local_itm_typ_prm = 'n';
		$y_local_itm_typ_prm_txt = '';
		if ($arr_pitm_result[$i_promo] == '1' ) {
			$y_local_itm_typ_prm = 'promo';
			$y_local_itm_typ_prm_txt = '<i>'.$yprods_item_promo.'</i> <b>'.$arr_pitm_result[$i_promo_txt].'</b><br><br>';
		} //end if

		$y_local_itm_typx = xestab_ptyp ($yecomm_active, $arr_pitm_result[$i_ecomm], $arr_pitm_result[$i_price]);

		if ($y_local_itm_typx == 'x') {
			$y_itm_price = $yprods_item_noprice;
		} //end if
		else {
			$y_itm_price = number_format($arr_pitm_result[$i_price], 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
		} //end if


		xmysql_count_data ("SELECT COUNT(*) FROM prod_views WHERE (p_id='$arr_pitm_result[$i_id]') ");
		//$var_result_size


		xshow_prod_items_data ($y_local_itm_typx, $y_local_itm_typ_prm, $arr_pitm_result[$i_title].' ['.$yprods_item_code.' : '.$arr_pitm_result[$i_pcode].']', $y_itm_price, $y_local_itm_typ_prm_txt.$arr_pitm_result[$i_descr], $arr_pitm_result[$i_pict], $y_itm_lnk, $var_result_size);

		xnewline ();
		
		//------------
	}//end for


	//==================== prod items nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yprods_item_title</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$y_pitm_nums</b> $y_warp_total_text)]"."$w_src_filteredby");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pitm&fcategid=$fcategid&offxc=$offxc&offset=$newoffsetprev&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $y_pitm_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pitm&fcategid=$fcategid&offxc=$offxc&offset=$newoffsetnext&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

	//=====================================


} //end if



//###################################### OP product details

if ($pmop=='pdet') {


$qval = rawurldecode($qval);
$qval = rawurlencode($qval);

//------------------------ get user auth

//read from users
$WARP_B64_ENC_AUTH_PASSW = base64_encode($PHP_AUTH_PW);
xmysql_read_data ("SELECT id FROM users WHERE ( (usr_name='$PHP_AUTH_USER') AND (usr_pass='$WARP_B64_ENC_AUTH_PASSW') )");

$ylocal_prodmod_usr_id = '0';
if (!empty($arr_var_result[0])) {
	$ylocal_prodmod_usr_id = $arr_var_result[0];
} //end if


//------------------------ get cartinfo
if ($yecomm_active == 'y') {
	//get items in cart
	xmysql_read_data ("SELECT p_qty FROM prod_cart WHERE ( (w_sess='$wpsid') AND (p_id='$fitmid') AND (u_id='$ylocal_prodmod_usr_id') ) ");

	if (empty($arr_var_result[0])) {
		$yx_local_pcinf_qty_isc = '0';
	} //end if
	else {
		$yx_local_pcinf_qty_isc = $arr_var_result[0];
	} //end else
} //end if

//----------------------------------------------get data


//---------------the selected product

	$arr_pdet_result = array();

	$wquerry_main = "SELECT id, p_code, title, description, full_detail, u_m, price, weight_g, pict_b, e_comm, e_deliver, categ_id, promo, promo_txt  FROM prod_items WHERE (id='$fitmid') ";
	xmysql_read_data ($wquerry_main);
	$arr_pdet_result = $arr_var_result;

	//update rank_v
	xmysql_read_data ("SELECT id FROM prod_views WHERE ( (w_sess='$wpsid') AND (p_id='$fitmid') ) ");
	if (empty($arr_var_result[0])) {
		xmysql_write_data ("INSERT INTO prod_views (w_sess, p_id) VALUES ('$wpsid', '$fitmid') ");
	} //end if

//---------------the selected categ

	$arr_categ_result = array();
	$fcategid = $arr_pdet_result[11];

	xmysql_read_data ("SELECT title FROM prod_categs WHERE (id='$fcategid') ");
	$arr_categ_result = $arr_var_result;

//--------------------------------------------------

	$y_local_itm_typx = xestab_ptyp ($yecomm_active, $arr_pdet_result[9], $arr_pdet_result[6]);

	//==================== products items where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yprods_show_title</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yprods_categ_title_short", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pcat&offset=$offxc", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yprods_item_title_short", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pitm&fcategid=$fcategid&offxc=$offxc&offset=$offxi&qval=$qval", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

	//=====================================



	//==================== category, cart, cartadd

	xtable_start ("$ydisplay_width_corrected");

	//-----------------------cart

	if ($yecomm_active == 'y') {

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '30%', "$ybar_menu_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();
					xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_cart.jpg', '30', '30', "$yecomm_shoppingcart");
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '50%', "$ybar_menu_color");

				xwriteflash_bg_var ('alinker.swf',
					"&alinker_txt=".rawurlencode("$yecomm_showcart").
					"&alinker_url=".rawurlencode("$ywebsite_addr_secure".'cart_shop.php').
					"&wpqid=".rawurlencode($wpqid).
					"&wpsid=".rawurlencode($wpsid).
					"&"
				, '250', '20', "$ybar_menu_color");

			xtable_column_end ();

			xtable_column_start_vcenter ('1', '20%', "$ybar_menu_color");
					xspace ();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start ('3', '100%', "$ysite_back_color");
					xspace ();
			xtable_column_end ();
		xtable_row_end ();

		//show cart add if sell online
		if ($y_local_itm_typx == 'e') {

		xtable_row_start ();
			xtable_column_start ('3', '100%', "$ysite_back_color");
				xcenter_start ();

					xwriteflash_nobg_var ("$ywebsite_addr"."cart_op.swf",
						"&flash_form_backcolor=".rawurlencode($ymain_color).
						"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
						"&flash_form_text_bttn=".rawurlencode($yecomm_addtocart).
						"&flash_form_text_back=".rawurlencode($y_warp_back_text).
						"&flash_form_text_okybttn=".rawurlencode($y_warp_text_okay).
						"&flash_form_text_process=".rawurlencode($yprods_item_cartprocess).
						"&flash_form_cartinfo_num=".rawurlencode($yx_local_pcinf_qty_isc).
						"&hintvar=".rawurlencode($yprods_item_cartadd_hint).
						"&flash_form_cart_remove=".rawurlencode($yprods_item_cartdelete).
						"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/prod_cart_a.jpg').
						"&xurl=".rawurlencode("$ywebsite_addr"."cart_op.php").
						"&wpsid=".rawurlencode($wpsid).
						"&fitmid=".rawurlencode($fitmid).
						"&wxu=".rawurlencode(MD5($PHP_AUTH_USER)).
						"&wxp=".rawurlencode(MD5(base64_encode($PHP_AUTH_PW))).
						"&"
					, '500', '40');

				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start ('3', '100%', "$ysite_back_color");
					xspace ();
			xtable_column_end ();
		xtable_row_end ();

		} //end if

	} //end if

	// ---------------------------- the request for an offer
	if ($y_local_itm_typx != 'e') {

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '30%', "$ymain_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();
					xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_quot.jpg', '30', '30', "$yprods_item_askfordetails");
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '50%', "$ymain_color");

				xwriteflash_bg_var ('alinker.swf',
					"&alinker_txt=".rawurlencode("$yprods_item_askfordetails").
					"&alinker_url=".rawurlencode("$ywebsite_addr".'adm_contact.php').
					"&wpsid=".rawurlencode($wpsid).
					"&opvar=".rawurlencode('pquote').
					"&refxmsg=".rawurlencode(' ['.$yprods_item_code_full.' : '.$arr_pdet_result[1].'] - '."$yprods_item_pname".' : '."$arr_pdet_result[2]").
					"&xbackurl=".rawurlencode("$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pdet&fcategid=$fcategid&fitmid=$fitmid&offxc=$offxc&offxi=$offxi&qval=$qval").
					"&"
				, '250', '20', "$ymain_color");

			xtable_column_end ();

			xtable_column_start_vcenter ('1', '20%', "$ymain_color");
					xspace ();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start ('3', '100%', "$ysite_back_color");
					xspace ();
			xtable_column_end ();
		xtable_row_end ();

	} //end if

	//-----------------------


	//-----------------------category
	xtable_row_start ();
		xtable_column_start_vcenter ('1', '30%', "$ymain_color");
			xcenter_right_start ();
				xvpix_h ('5');
				xnewline ();
				xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_categ.jpg', '30', '30', "$yprods_categ_title_xs");
				xspace ();
				xspace ();
			xcenter_end ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '50%', "$ymain_color");
				xtext_small ("$yprods_categ_title_xs_short".' : '.'<b>'."$arr_categ_result[0]".'</b>');
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '20%', "$ymain_color");
				xspace ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_end ();

	xnewline ();



	//==================== product

	xtable_start ("$ydisplay_width_corrected");


	// the title and code
	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ybar_color");
			xtext_title (' ['.$yprods_item_code_full.' : '.$arr_pdet_result[1].']');
		xtable_column_end ();
	xtable_row_end ();


	//vline
	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();

	//prod icon
	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");


		xtable_start ("$ydisplay_width_corrected");

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '30%', "$ymain_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();
					xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_item.jpg', '30', '30', "$yprods_item_title_xs");
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '50%', "$ymain_color");
				xtext_small ('<i>'."$yprods_item_pname".' : </i>');
				xnewline ();
				xtext_small ('<b>'."$arr_pdet_result[2]".'</b>');
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '20%', "$ymain_color");
				xspace ();
			xtable_column_end ();
		xtable_row_end ();

		//------------ promo
		if ($arr_pdet_result[12] == '1') {
		xtable_row_start ();
				xtable_column_start_vcenter ('1', '30%', "$ymain_color");
					xcenter_right_start ();
						xvpix_h ('5');
						xnewline ();
						xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_item_p.jpg', '30', '30', "$yprods_item_promo");
						xspace ();
						xspace ();
					xcenter_end ();
				xtable_column_end ();

				xtable_column_start_vcenter ('1', '50%', "$ymain_color");
					xtext_small ('<i>'."$yprods_item_promo".'</i>');
					if (!empty($arr_pdet_result[13])) {
						xnewline ();
						xtext_small ('<b>'."$arr_pdet_result[13]".'</b>');
					} //end if
				xtable_column_end ();

				xtable_column_start_vcenter ('1', '20%', "$ymain_color");
					xspace ();
				xtable_column_end ();
		xtable_row_end ();
		} //end if

		xtable_end ();

		xtable_column_end ();
	xtable_row_end ();

	//vline
	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();


	//the picture
	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");
			if (substr($arr_pdet_result[8], -4, 4) == '.swf') {
				xcenter_start ();
					xwriteflash_nobg ("$ywebsite_addr"."$y_warp_pitm_picts_dir".'/'."$arr_pdet_result[8]", '400', '250');
					xvline ('100%');
				xcenter_end ();
			} //end if
			elseif (!empty($arr_pdet_result[8])) {
				xcenter_start ();
					xpict ("$ywebsite_addr"."$y_warp_pitm_picts_dir".'/'."$arr_pdet_result[8]", '400', '250');
					xvline ('100%');
				xcenter_end ();
			} //end elseif
		xtable_column_end ();
	xtable_row_end ();


	//description

	//check price
	if ($y_local_itm_typx <> 'x') {
		$y_itm_price = number_format($arr_pdet_result[6], 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
	} //end if
	else {
		$y_itm_price = $yprods_item_noprice;
	} //end else


	if ($arr_pdet_result[10] == 'p') {
		$y_itm_weight = number_format($arr_pdet_result[7], 0, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
		$y_itm_weight = $y_itm_weight.' '."$yprods_item_weight_um";
		$y_itm_weight = "$yprods_item_weight".' : '.'<b>'."$y_itm_weight".'</b>';
	} //end if
	else {
		$y_itm_weight = 'xno';
	} //end else


	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");

		xcenter_start ();

		//texts
		xtable_start ('400');


		xtable_row_start ();

			xtable_column_start ('1', '100%', "$ymain_color");
				xnewline();				
				xtext_small ('<i>'."$yprods_item_descr".' : </i>');
				xnewline();
				xtext_small ('<b>'."$arr_pdet_result[3]".'</b>');
				xnewline();
				xvline ('100%');
				xtext_small ('<i>'."$yprods_item_details".' : </i>');
				xnewline();
				xtext_small ("$arr_pdet_result[4]");
				xnewline();
				xvline ('100%');

				xtext_small ('<i>'."$yprods_item_specifications".' : </i>');
				xnewline();
				xtext_small ("$yprods_item_package".' : '.'<b>'."$arr_pdet_result[5]".'</b>');
				xnewline();

				//show postal delivery note if sell online and pst
				if ( ($y_local_itm_typx == 'e') AND ($arr_pdet_result[10] == 'p') ) {

					//show weight if have
					if ($y_itm_weight <> 'xno') {
						xtext_small ($y_itm_weight);
						xnewline();
					} //end if

					xvline ('100%');
					xtext_small ('<i>'."$yprods_item_delivery_method".' : '.'</i>');
					xnewline();
					xtext_small ('<b>'."$yprods_item_delivery_method_p".'</b>');
					xnewline();
					xtext_small ("$yprods_item_delivery_pst_note");
					xnewline();
				} //end if

				//show download delivery note if sell online and dwn
				if ( ($y_local_itm_typx == 'e') AND ($arr_pdet_result[10] == 'd') ) {
					xvline ('100%');
					xtext_small ('<i>'."$yprods_item_delivery_method".' : '.'</i>');
					xnewline();
					xtext_small ('<b>'."$yprods_item_delivery_method_d".'</b>');
					xnewline();
					xtext_small ("$yprods_item_delivery_dwn_note");
					xnewline();
				} //end if


				//show download delivery note if sell online and service
				if ( ($y_local_itm_typx == 'e') AND ($arr_pdet_result[10] == 's') ) {
					xvline ('100%');
					xtext_small ('<i>'."$yprods_item_delivery_method".' : '.'</i>');
					xnewline();
					xtext_small ('<b>'."$yprods_item_delivery_method_s".'</b>');
					xnewline();
				} //end if

				xvline ('100%');



				//the price
				$y_crr_active = '/crr_'."$yprods_item_crr".'.jpg';

				xcenter_right_start ();
				xtable_start ('');
					xtable_row_start ();
						xtable_column_start_vcenter ('1', '', "$ymain_color");
							xtext_small ($yprods_item_price.' : '.'<b>'.$y_itm_price.'</b>');
						xtable_column_end ();
						xtable_column_start_vcenter ('1', '', "$ymain_color");

							if ($y_local_itm_typx <> 'x') {
								xspace ();
								xpict ("$ywebsite_addr"."$y_warp_crr_dir"."$y_crr_active", '20', '20');
							} //end if
							else {
								xspace ();
							} //end else

						xtable_column_end ();
					xtable_row_end ();
				xtable_end ();
				xcenter_end ();

				if ($y_local_itm_typx <> 'x') {
					xtext_small ("$yprods_item_crr_expl");
					xnewline ();
				} //end if

				xvline ('100%');

			xtable_column_end ();

		xtable_row_end ();

		xtable_end ();

		xnewline ();

		//utils icons
		xtable_start ('400');


		xtable_row_start ();

			xtable_column_start ('1', '100%', "$ymain_color");

					//print
					$op_var = 'products';
					$op_var = base64_encode($op_var);
					$op_var = rawurlencode($op_var);
					xpict_link ("$ywebsite_addr"."$y_warp_picts_dir".'/print_mini.jpg', "$y_warp_print_text", '20', '20', "$ywebsite_addr"."print_redir.php?xid=$fitmid&xop=$op_var&wpsid=$wpsid", 'wnd_prn');

					xspace ();
					xspace ();

					//downloads
					xpict_link ("$ywebsite_addr"."$y_warp_picts_dir".'/save_mini.jpg', "$y_warp_downloads_text_p", '20', '20', "$ywebsite_addr"."xw_main.php?wpqid=$wpqid&wpsid=$wpsid&offset=0&pmop=pdwn&fcategid=$fcategid&fitmid=$fitmid", '_self');

					xspace ();
					xspace ();

					//resources
					xpict_link ("$ywebsite_addr"."$y_warp_picts_dir".'/docs_mini.jpg', "$y_warp_resources_text_p", '20', '20', "$ywebsite_addr"."xw_main.php?wpqid=$wpqid&wpsid=$wpsid&offset=0&pmop=pres&fcategid=$fcategid&fitmid=$fitmid", '_self');


			xtable_column_end ();

		xtable_row_end ();

		xtable_end ();



		xcenter_end ();

		xtable_column_end ();
	xtable_row_end ();


	//vline
	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();


	xtable_end ();

} //end if

//######################################


//###################################### OP product downloads

if ($pmop=='pdwn') {

	downloads_module ('pdwn');

} //end if

//######################################


//###################################### OP product resources

if ($pmop=='pres') {

	resources_module ('pres');

} //end if

//######################################


} //end function
//----------------



//======================================= END functions


//----------------------------

//init
//require also mod_downloads and mod_resources
//prod_secure ();

//products_module ();

//----------------------------


// end of php code
?>
Return current item: Warp.cms - php/mysql content management