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

// [e-commerce cart 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


//####### Register Globals !

extract($HTTP_ENV_VARS);
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
extract($HTTP_COOKIE_VARS);
extract($HTTP_SERVER_VARS);

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


$xnt_control_var = 'xnt2002warp.cms';

if (empty($yfilename)) {
	$yfilename = 'cart_shop.php';
} //end if

require("lib_adv.php");


//check session
if (strlen($wpsid) < '32') {
	$hlocal_sess_req_redr = "$ywebsite_addr".'xindex.php';
	header("Location: $hlocal_sess_req_redr");
} //end if


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


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



function xcart_module () {

//link
global	$pmop, $offset, $wpqid, $wpsid ;

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

//cfg vars
global	$ywarp_max_display_cfg, $ywebsite_addr, $ywebsite_addr_secure, $ysmall_text_color,
	$y_warp_crr_dir, $y_warp_picts_dir, $y_warp_prev_text, $y_warp_next_text,
	$y_warp_total_text, $ybar_color, $ybar_menu_color, $y_warp_back_text_x,
	$ymain_color, $ymain_color_alt, $y_warp_back_text, $y_warp_text_okay,
	$y_warp_update_txt, $y_warp_profile_text, $warp_deny_acc_sect ;

//mod vars
global	$yprods_back_text, $yprods_item_cartprocess, $yprods_item_code,
	$yprods_item_crr, $yprods_item_crr_expl, $yprods_item_delivery_method_d,
	$yprods_item_delivery_method_p, $yprods_item_delivery_method_s, $yprods_item_package, 
	$yprods_item_pname, $yprods_item_price, $yprods_item_qty, $yprods_item_weight_um, 
	$yprods_show_title, $yprods_item_crr_name ;

//yecomm
global	$yecomm_cart_items, $yecomm_crt_subtotal_price, $yecomm_crt_totals,
	$yecomm_max_cart_items_ppage, $yecomm_shoppingcart, $yecomm_shoppingcart_title,
	$yecomm_total_rows, $yecomm_your_shoppingcart, $yecomm_your_shoppingcart_s2,
	$yecomm_your_shoppingcart_s3, $yecomm_your_shoppingcart_s4,
	$yecomm_cart_user_note, $yecomm_vat_tax, $yecomm_incomplete_usrdata, $yecomm_crt_excepting_vat, 
	$yecomm_crt_includding_vat, $yecomm_your_shoppingcart_txt_ordernow, $yecomm_your_shoppingcart_ns,
	$yecomm_total_weight, $yecomm_for_prepos_txt, $yecomm_active, $yecomm_deliv_vat_znote,
	$yecomm_crt_total_deliv_price, $yecomm_crt_total_deliv_p_list, $yecomm_crt_total_topay, 
	$yecomm_total_deliv_chrg, $yecomm_vat_for_delivery, $yecomm_crt_includding_dev_p ,
	$yecomm_crt_total_deliv_weight, $yecomm_deliv_time_note, $yecomm_deliv_availab_note,
	$yecomm_yhh_country_destin, $yecomm_yhh_country_origin, $yecomm_vendor_country,
	$yecomm_cart_user_note_xplus, $yecomm_order_xsafety_note, $yecomm_order_cancel,
	$yecomm_order_accept, $yecomm_order_gnote, $yecomm_order_processing, $yecomm_order_status,
	$y_warp_err_data_failure, $yecomm_crt_errorx_overflow, $yecomm_crt_errorx_innerflow,
	$ywusr_xentire_cxinfo ;

//payment
global	$yecomm_payment_ccvs_gateway;

//users
global	$ywusr_xentire_company, $ywusr_xentire_phone, $ywusr_xentire_email, $ywusr_xentire_name, $ywusr_xentire_addr,
	$ywusr_thecompany_isneeded, $ywusr_user_forcompany ;

//number format
global	$warp_numform_decimal_sep, $warp_numform_thousand_sep ;

//md5 checksums
global 	$wchkcrt, $wchkusr, $wordid;

//sec
global	$wrshruid_xhlock_fct_usr_id ;

global	$REQUEST_METHOD, $QUERY_STRING, $y_warp_direct_file_acc_msg_reff ;



//---------------------------------------------------------page header
xheader ("$yecomm_shoppingcart_title", 'secure');
xcenter_start ();
xshow_page_title_ssl ("$yecomm_shoppingcart_title", "$wpsid");
xnewline ();
//---------------------------------------------------------

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

//check request method
if ( ($REQUEST_METHOD <> 'POST') OR (!empty($QUERY_STRING)) ) {
	xzerr_die_after_header ($y_warp_direct_file_acc_msg_reff);
} //end if


//------------------------ check user auth, country, user data, vat

xrecheck_secure_header_ret_usrid ('y');
$ylocal_prodmod_usr_id = $wrshruid_xhlock_fct_usr_id;

$arr_usr_data = array();
$arr_cvfy_country_id = array();
$arr_deliv_coefs = array();

//get user
$WARP_B64_ENC_AUTH_PASSW = base64_encode($PHP_AUTH_PW);
xmysql_read_data ("SELECT usr_fname, usr_sname, usr_company, usr_addr, usr_city, usr_reg_st, usr_zip, usr_phone, usr_email, usr_country, usr_countr_id FROM users WHERE ( (usr_name='$PHP_AUTH_USER') AND (usr_pass='$WARP_B64_ENC_AUTH_PASSW') ) ");
$arr_usr_data = $arr_var_result;

//country verify
xmysql_read_data ("SELECT id, vat_tax, pst_tax_zone FROM country_list WHERE ( (c_name='$arr_usr_data[9]') AND (c_id='$arr_usr_data[10]') ) ");
$arr_cvfy_country_id = $arr_var_result;

//get country delivery coef
xmysql_read_data ("SELECT id, coef FROM delivery_zones WHERE (id='$arr_cvfy_country_id[2]') " );
$arr_deliv_coefs = $arr_var_result;

//check if e-commerce active
if ($yecomm_active <> 'y') {
	xzerr_die_after_header ($warp_deny_acc_sect);
} //end if

//check country and user data
if ($ywusr_thecompany_isneeded == 'y') {
	//with company
	if ( (empty($arr_cvfy_country_id[0])) OR (empty($arr_usr_data[0])) OR (empty($arr_usr_data[1])) OR (empty($arr_usr_data[2])) OR
	     (empty($arr_usr_data[3])) OR (empty($arr_usr_data[4])) OR (empty($arr_usr_data[5])) OR (empty($arr_usr_data[6])) OR
 	     (empty($arr_usr_data[7])) OR (empty($arr_usr_data[8])) ) {
		xzerr_die_after_header ($yecomm_incomplete_usrdata);
	} //end if
} //end if
else {
	//without company
	if ( (empty($arr_cvfy_country_id[0])) OR (empty($arr_usr_data[0])) OR (empty($arr_usr_data[1])) OR
	     (empty($arr_usr_data[3])) OR (empty($arr_usr_data[4])) OR (empty($arr_usr_data[5])) OR (empty($arr_usr_data[6])) OR
 	     (empty($arr_usr_data[7])) OR (empty($arr_usr_data[8])) ) {
		xzerr_die_after_header ($yecomm_incomplete_usrdata);
	} //end if
} //end else

//assign vat tax per country
if (empty($arr_cvfy_country_id[1])) {
	$x_vattax_country_particular = 'n';
} //end if
else {
	$x_vattax_country_particular = $arr_cvfy_country_id[1];
} //end else


//assign postal tax zone per country
if (empty($arr_deliv_coefs[0])) {
	$x_delivery_price_country_particular = '0';
} //end if
else {
	$x_delivery_price_country_particular = $arr_deliv_coefs[1];
} //end else

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

$wcheck_local_usr_sum = '';
$wcheck_local_usr_sum = $arr_usr_data[0].$arr_usr_data[1].$arr_usr_data[2].$arr_usr_data[3].$arr_usr_data[4].
			$arr_usr_data[5].$arr_usr_data[6].$arr_usr_data[7].$arr_usr_data[8].$arr_usr_data[9].
			$arr_usr_data[10].$ylocal_prodmod_usr_id ;

$wcheck_local_usr_sum_md5 = md5($wcheck_local_usr_sum);
$wcheck_local_usr_sum = '';


//###################################### OP shopping cart

if ($pmop=='pcs1') {

$limit = $yecomm_max_cart_items_ppage;

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

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

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

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

	$wquerry_main = " SELECT id, p_id, p_qty FROM prod_cart WHERE ( (w_sess='$wpsid') AND (u_id='$ylocal_prodmod_usr_id') ) ";

	$wquerry_main_c = " SELECT COUNT(*) FROM prod_cart WHERE ( (w_sess='$wpsid') AND (u_id='$ylocal_prodmod_usr_id') ) ";

	$arr_ycrt_xresult_all = array();

	//get cart all (for calculations)
	xmysql_read_data ($wquerry_main." ORDER BY id ASC ");
	$arr_ycrt_xresult_all = $arr_var_result;


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

	// TOTALS and cart check

	$yxall_local_calc_tot_price = '0';
	$yxall_local_calc_tot_vat = '0';

	$yxall_local_calc_tot_weight = '0';
	$yxall_local_calc_tot_delivery_p = '0';
	$yxall_local_calc_tot_delivery_p_vat = '0';
	$yxall_local_calc_tot_delivery_list = '';
	$yxall_local_calc_tot_delivery_list_num = '0';

	$yxall_local_vaj_dev_coef = '0';

	$yxall_local_calc_tot_topay = '0';

	$zindx_iterator_zz = '0';

	$wcheck_local_cart_sum = '';

	//delete errors and calc totals
	$arr_count = count($arr_ycrt_xresult_all);
	for ($i=0; $i < $arr_count; $i++) {
		$i_id = $i;
		$i_pid = $i + 1;
		$i_pqty = $i + 2;
		$i = $i + 2;

		$zindx_iterator_zz = $zindx_iterator_zz + 1;

		xmysql_read_data ("SELECT price, vat_tax, weight_g, e_deliver, delivery_p, id FROM prod_items WHERE (id='$arr_ycrt_xresult_all[$i_pid]') " );

		if (empty($arr_var_result[5])) {
			xmysql_write_data ("DELETE FROM prod_cart WHERE (id='$arr_ycrt_xresult_all[$i_id]') " );
		} //end if
		else {
			//checksum
			$wcheck_local_cart_sum = $wcheck_local_cart_sum.$arr_ycrt_xresult_all[$i_id].$arr_ycrt_xresult_all[$i_pid].$arr_ycrt_xresult_all[$i_pqty] ;

			$yxall_local_calc_tot_price = $yxall_local_calc_tot_price + ($arr_var_result[0] * $arr_ycrt_xresult_all[$i_pqty]);

			if ($x_vattax_country_particular == 'y') {
				$yxall_local_calc_tot_vat = $yxall_local_calc_tot_vat + ($arr_var_result[0] * $arr_ycrt_xresult_all[$i_pqty] * $arr_var_result[1] / 100);
			} //end if
			else {
				$yxall_local_calc_tot_vat = '0';
			} //end else

			if ($arr_var_result[3] == 'p') {
				$yxall_local_calc_tot_weight = $yxall_local_calc_tot_weight + ($arr_var_result[2] * $arr_ycrt_xresult_all[$i_pqty]);
				$yxall_local_calc_tot_delivery_list = $yxall_local_calc_tot_delivery_list.$zindx_iterator_zz.'; ';
				$yxall_local_calc_tot_delivery_list_num = $yxall_local_calc_tot_delivery_list_num + 1;

				$yxall_local_vaj_dev_coef = $arr_var_result[4] * $x_delivery_price_country_particular ;
				$yxall_local_vaj_dev_coef = number_format($yxall_local_vaj_dev_coef, 2, '.', '');
				$yxall_local_calc_tot_delivery_p = $yxall_local_calc_tot_delivery_p + ($yxall_local_vaj_dev_coef * $arr_ycrt_xresult_all[$i_pqty]);
			} //end if
			else {
				$yxall_local_calc_tot_weight = $yxall_local_calc_tot_weight;
			} //end else

		} //end else

	} //end for

	$yxall_local_calc_tot_delivery_p_vat = $yxall_local_calc_tot_delivery_p * $yecomm_vat_for_delivery / 100 ;

	$yxall_local_calc_tot_price = $yxall_local_calc_tot_price + $yxall_local_calc_tot_delivery_p ;
	$yxall_local_calc_tot_vat = $yxall_local_calc_tot_vat + $yxall_local_calc_tot_delivery_p_vat ;
	$yxall_local_calc_tot_price = number_format ($yxall_local_calc_tot_price, 2, '.', '');
	$yxall_local_calc_tot_vat = number_format ($yxall_local_calc_tot_vat, 2, '.', '');

	$yxall_local_calc_tot_price_fxt = number_format($yxall_local_calc_tot_price, 2, '.', '');
	$yxall_local_calc_tot_vat_fxt = number_format($yxall_local_calc_tot_vat, 2, '.', '');

	$yxall_local_calc_tot_topay = $yxall_local_calc_tot_price_fxt + $yxall_local_calc_tot_vat_fxt ;
	$yxall_local_calc_tot_topay = number_format ($yxall_local_calc_tot_topay, 2, '.', '');

	$wcheck_local_cart_sum_md5 = '';
	$wcheck_local_cart_sum = $wcheck_local_cart_sum.$yxall_local_calc_tot_topay.$wpsid ;
	$wcheck_local_cart_sum_md5 = md5($wcheck_local_cart_sum) ;
	$wcheck_local_cart_sum = '';

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

	$arr_ycrt_result = array();

	//count data
	xmysql_count_data ($wquerry_main_c);
	$y_crt_itm_nums = $var_result_size;

	//get cart per page
	xmysql_read_data ($wquerry_main." ORDER BY id ASC LIMIT $offset, $limit");
	$arr_ycrt_result = $arr_var_result;


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

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

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


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

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

	xnewline ();

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


	//==================== back to prods

	xtable_start ("$ywarp_max_display_cfg");

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '20%', "$ybar_menu_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();
					xpict_alt ("$ywebsite_addr_secure"."$y_warp_picts_dir".'/prod_categ.jpg', '30', '30', "$yprods_show_title");
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '60%', "$ybar_menu_color");
				xtext_link ("$yprods_back_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid", '_self');
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();

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



	//==================== cart process info

	xtable_start ("$ywarp_max_display_cfg");

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

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
					xtext_small ('<b>'."$yprods_item_cartprocess".'</b>');
			xtable_column_end ();

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

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

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
				xtext_small ('<b><i>'.'1. '."$yecomm_your_shoppingcart".'</i></b>');
				xnewline ();
				xtext_small ('2. '."$yecomm_your_shoppingcart_s2");
				xnewline ();
				xtext_small ('3. '."$yecomm_your_shoppingcart_s3");
				xnewline ();
				xtext_small ('4. '."$yecomm_your_shoppingcart_s4");
				xnewline ();
				xnewline ();
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();

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

	//==================== user info

	xtable_start ("$ywarp_max_display_cfg");

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '20%', "$ymain_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();
					xpict_alt ("$ywebsite_addr_secure"."$y_warp_picts_dir".'/usr_accnt.jpg', '30', '30', "$y_warp_profile_text");
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
					xtext_small ('<b>'."$y_warp_profile_text".'</b>'." ($PHP_AUTH_USER) ");
					xtext_link ("$y_warp_update_txt", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid", '_self');
			xtable_column_end ();

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

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

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
				if ($ywusr_thecompany_isneeded == 'y') {
					xtext_small ("$ywusr_xentire_company".' : <b>'."$arr_usr_data[2]".'</b>');
					xnewline ();
				} //end if
				else {
					xtext_small ("$ywusr_xentire_name".' : <b>'."$arr_usr_data[0]".' '."$arr_usr_data[1]".'</b>');
					xnewline ();
				} //end else
				xtext_small ("$ywusr_xentire_addr".' : <b>'.
					     "$arr_usr_data[6]".' '."$arr_usr_data[4]".', '."$arr_usr_data[3]".', '.
					     "$arr_usr_data[5]".', '."$arr_usr_data[9]".'</b>'
				);
				xnewline ();
				xtext_small ("$ywusr_xentire_phone".' : <b>'."$arr_usr_data[7]".'</b>');
				xnewline ();
				xtext_small ("$ywusr_xentire_email".' : <b>'."$arr_usr_data[8]".'</b>');
				xnewline ();

				if ($ywusr_thecompany_isneeded == 'y') {
					xtext_small ("$ywusr_user_forcompany".' : <b>'."$arr_usr_data[0]".' '."$arr_usr_data[1]".'</b>');
					xnewline ();
				} //end if

				xnewline ();
				xtext_small ('<i>'."$yecomm_cart_user_note".' '."$yecomm_cart_user_note_xplus".'</i>');
				xnewline ();
				xnewline ();
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();


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


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

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

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xwriteflash_bg_var ('alinkers.swf',
								"&alinker_txt=".rawurlencode("$y_warp_prev_text").
								"&alinker_url=".rawurlencode("$ywebsite_addr_secure".'cart_shop.php').
								"&wpqid=".rawurlencode($wpqid).
								"&wpsid=".rawurlencode($wpsid).
								"&pmop=".rawurlencode('pcs1').
								"&offset=".rawurlencode($newoffsetprev).
								"&"
							, '150', '20', "$ybar_menu_color");
						} //end if

						//Show NEXT
						if ($newoffsetnext < $y_crt_itm_nums) {
							xwriteflash_bg_var ('alinkers.swf',
								"&alinker_txt=".rawurlencode("$y_warp_next_text").
								"&alinker_url=".rawurlencode("$ywebsite_addr_secure".'cart_shop.php').
								"&wpqid=".rawurlencode($wpqid).
								"&wpsid=".rawurlencode($wpsid).
								"&pmop=".rawurlencode('pcs1').
								"&offset=".rawurlencode($newoffsetnext).
								"&"
							, '150', '20', "$ybar_menu_color");
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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



	//==================== tax note

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ymain_color");
				xtext_small ('&#149; *'."$yprods_item_crr_expl");
				xnewline ();
				xtext_small ('&#149; <i>'."$yecomm_deliv_vat_znote".' ['."$yecomm_yhh_country_destin : $arr_usr_data[9]".']'.' - '.' ['."$yecomm_yhh_country_origin : $yecomm_vendor_country".']'.'</i>');
				xnewline ();
				xtext_small ('&#149; '."$yecomm_deliv_availab_note".' '."$yecomm_deliv_time_note");
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();


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

	xtable_start ("$ywarp_max_display_cfg");
	xtable_row_start ();
	xtable_column_start ('1', '', "$ybar_color");
	//--------------

		xtable_start_sp ("$ywarp_max_display_cfg");

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

			xtable_row_start ();

				//idx
				xtable_column_start ('1', '', "$ybar_menu_color");
					xcenter_start ();
						xtext_small ('<b>&nbsp;#</b>');
					xcenter_end ();
				xtable_column_end ();

				//p_name
				xtable_column_start ('1', '', "$ybar_menu_color");
					xcenter_start ();
						xtext_small ('<b>&nbsp;'."$yprods_item_pname".'</b>');
					xcenter_end ();
				xtable_column_end ();

				//p_qty
				xtable_column_start ('1', '', "$ybar_menu_color");
					xcenter_start ();
						xtext_small ('<b>'."$yprods_item_qty".'</b>');
						xnewline ();
						xtext_small ('<b>'."($yprods_item_package)".'</b>');
					xcenter_end ();
				xtable_column_end ();

				//p_price
				xtable_column_start ('1', '', "$ybar_menu_color");
					xcenter_start ();
						xtext_small ('<b>'.'*'."$yprods_item_price".'<br>'."($yprods_item_package)".'</b><br>');
						xpict ("$ywebsite_addr_secure"."$y_warp_crr_dir"."$y_crr_active", '20', '20');
					xcenter_end ();
				xtable_column_end ();

				//total price no vat
				xtable_column_start ('1', '', "$ybar_menu_color");
					xcenter_start ();
						xtext_small ('<b>'."$yecomm_crt_subtotal_price".'<br>'."$yecomm_crt_excepting_vat".'</b><br>');
						xpict ("$ywebsite_addr_secure"."$y_warp_crr_dir"."$y_crr_active", '20', '20');
					xcenter_end ();
				xtable_column_end ();

				//vat sub totals
				xtable_column_start ('1', '', "$ybar_menu_color");
					xcenter_start ();
						xtext_small ('<b>'."$yecomm_vat_tax".'<br>'."$yecomm_for_prepos_txt".' '."$arr_usr_data[9]".'</b><br>');
						xpict ("$ywebsite_addr_secure"."$y_warp_crr_dir"."$y_crr_active", '20', '20');
					xcenter_end ();
				xtable_column_end ();

			xtable_row_end ();

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

		$i_xy_cnt_z = $offset + 0;

		//get maximum to check max cart
		$hxv_crt_maxchecks = $y_crt_itm_nums;

		$arr_count = count($arr_ycrt_result);
		for ($i=0; $i < $arr_count; $i++) {
			$i_id = $i;
			$i_pid = $i + 1;
			$i_pqty = $i + 2;
			$i = $i + 2;


			xmysql_read_data ("SELECT title, p_code, e_deliver, price, weight_g, u_m, vat_tax, delivery_p FROM prod_items WHERE (id='$arr_ycrt_result[$i_pid]') " );
			//$arr_var_result

			$i_xy_cnt_z = $i_xy_cnt_z + 1;

			//------------------
			//alternate
			if( $i_xy_cnt_z % 2 ) {
				$ylocal_alt_tbl_color = $ymain_color;
			} //end if
			else {
				$ylocal_alt_tbl_color = $ymain_color_alt;
			} //end else
			//------------------

			xtable_row_start ();

				//idx
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color");
					xtext_small ("$i_xy_cnt_z".'.');
				xtable_column_end ();

				//p_name
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color");
					xtable_start ('100%');
						xtable_row_start ();
							xtable_column_start ('1', '', "$ylocal_alt_tbl_color");
								xtext_link ("$arr_var_result[0]", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&pmop=pdet&fcategid=&fitmid=$arr_ycrt_result[$i_pid]", '_self');
								xnewline ();
								xtext_small ("$yprods_item_code".' : '."$arr_var_result[1]");
								xnewline ();
								xtext_small ("$yprods_item_package".' : '.'<b>'."$arr_var_result[5]".'</b>');
								xnewline ();
								if ($arr_var_result[2] == 'd') {
									xtext_small ('<i>'."$yprods_item_delivery_method_d".'</i>');
								} //end if
								if ($arr_var_result[2] == 'p') {
									xtext_small ('<i>'."$yprods_item_delivery_method_p".'</i>');
									xnewline ();

									$y_local_qty_we_nf = number_format($arr_ycrt_result[$i_pqty], 0, $warp_numform_decimal_sep, $warp_numform_thousand_sep);

									//delivery charge
									$yx_local_calc_deliv_p = '0';
									$yx_local_calc_deliv_x = '0';
									$yx_local_calc_deliv_x = $arr_var_result[7] * $x_delivery_price_country_particular;
									$yx_local_calc_deliv_x = number_format($yx_local_calc_deliv_x, 2, '.', '');
									$yx_local_calc_deliv_p = $yx_local_calc_deliv_x * $arr_ycrt_result[$i_pqty];
									$yx_local_calc_deliv_p_nf = number_format($yx_local_calc_deliv_p, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
									$yx_local_calc_deliv_p_um_nf = number_format($yx_local_calc_deliv_x, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);

									xtext_small (
										'<i>'."$yecomm_total_deliv_chrg".' : '.
										'('."$yx_local_calc_deliv_p_um_nf".' x '."$y_local_qty_we_nf".') = '.
										'<b>'."$yx_local_calc_deliv_p_nf $yprods_item_crr_name".'</b></i>'
									);

									xnewline ();

									//weight
									$yx_local_calc_weight = '0';
									$yx_local_calc_weight = $arr_var_result[4] * $arr_ycrt_result[$i_pqty];
									$yx_local_calc_weight_nf = number_format($yx_local_calc_weight, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
									$yx_local_calc_weight_um_nf = number_format($arr_var_result[4], 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);

									xtext_small (
										'<i>'."$yecomm_total_weight".' : '.
										'('."$yx_local_calc_weight_um_nf".' x '."$y_local_qty_we_nf".') = '.
										'<b>'."$yx_local_calc_weight_nf $yprods_item_weight_um".'</b></i>'
									);
								} //end if
								if ($arr_var_result[2] == 's') {
									xtext_small ('<i>'."$yprods_item_delivery_method_s".'</i>');
								} //end if
							xtable_column_end ();
						xtable_row_end ();
					xtable_end ();
				xtable_column_end ();

				//p_qty
				$y_local_qty_nf = number_format($arr_ycrt_result[$i_pqty], 0, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color");
					xcenter_start ();
						xtext_small ("$y_local_qty_nf");
					xcenter_end ();
				xtable_column_end ();

				//p_price
				$yx_local_calc_itm_price = number_format($arr_var_result[3], 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color");
					xcenter_right_start ();
						xtext_small ("$yx_local_calc_itm_price");
					xcenter_end ();
				xtable_column_end ();

				//total no vat
				$yx_local_calc_itm_subtot_price = '0';
				$yx_local_calc_itm_subtot_price = $arr_var_result[3] * $arr_ycrt_result[$i_pqty] ;
				$yx_local_calc_itm_subtot_price_nf = number_format($yx_local_calc_itm_subtot_price, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color");
					xcenter_right_start ();
						xtext_small ('<b>'."$yx_local_calc_itm_subtot_price_nf".'</b>');
					xcenter_end ();
				xtable_column_end ();

				//vat tax
				$yx_local_calc_vattax = '0';
				if ($x_vattax_country_particular == 'y') {
					$yx_local_calc_vattax = ($arr_var_result[6] * $yx_local_calc_itm_subtot_price) / 100 ;
				} //end id
				else {
					$yx_local_calc_vattax = '0';
				} //end else
				$yx_local_calc_vattax_nf = number_format($yx_local_calc_vattax, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color");
					xcenter_right_start ();
						xtext_small ('<b>'."$yx_local_calc_vattax_nf".'</b>');
						xnewline ();
						if ($x_vattax_country_particular == 'y') {
							xtext_small ('('."$arr_var_result[6]".'%)');
						} //end if
						else {
							xtext_small ('(0%)');
						} //end else
					xcenter_end ();
				xtable_column_end ();

			xtable_row_end ();

		} //end for


		//--------------- at end list deliv price if exist

		$hlocal_deliv_show_to_total = '';
		if ( ($newoffsetnext >= $y_crt_itm_nums) AND ($yxall_local_calc_tot_delivery_p > '0') AND ($hxv_crt_maxchecks < '100') ) {

			$hlocal_deliv_show_to_total = ' - '.$yecomm_crt_includding_dev_p;

			// DELIVERY CHARGE
			xtable_row_start ();

				if ($ylocal_alt_tbl_color == $ymain_color) {
					$ylocal_alt_tbl_color_deliv = $ymain_color_alt;
				} //end if
				else {
					$ylocal_alt_tbl_color_deliv = $ymain_color;
				} //end else

				//delivery charge text
				$yxall_local_calc_tot_weight_nf = number_format($yxall_local_calc_tot_weight, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start ('2', '', "$ylocal_alt_tbl_color_deliv");
					xtable_start ('100%');
						xtable_row_start ();
							xtable_column_start_vcenter ('1', '', "$ylocal_alt_tbl_color_deliv");
								xtext_small ('<b>'."$yecomm_crt_total_deliv_price".' '."$yecomm_for_prepos_txt".' '."$arr_usr_data[9]".' - '."$yxall_local_calc_tot_delivery_list_num".' '."$yecomm_total_rows".'</b>');
								xnewline ();
								xtext_small ('<i>'."$yecomm_crt_total_deliv_weight".' - '."$yxall_local_calc_tot_delivery_list_num".
								' '."$yecomm_total_rows".' : <b>'."$yxall_local_calc_tot_weight_nf".' '."$yprods_item_weight_um".'</b></i>');
								xnewline ();
								xtext_small ("$yecomm_crt_total_deliv_p_list".' :');
								xnewline ();
								xtext_small ('# : '."$yxall_local_calc_tot_delivery_list");
							xtable_column_end ();
						xtable_row_end ();
					xtable_end ();
				xtable_column_end ();

				//qty
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color_deliv");
					xcenter_start ();					
						xtext_small ('-');
					xcenter_end ();
				xtable_column_end ();

				//price
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color_deliv");
					xcenter_start ();					
						xtext_small ('-');
					xcenter_end ();
				xtable_column_end ();

				//delivery charge price
				$yxall_local_calc_tot_delivery_p_nf = number_format($yxall_local_calc_tot_delivery_p, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color_deliv");
					xcenter_right_start ();
						xtext_small ('<b>'."$yxall_local_calc_tot_delivery_p_nf".'</b>');
					xcenter_end ();
				xtable_column_end ();

				//delivery charge vat
				$yxall_local_calc_tot_delivery_p_vat_nf = number_format($yxall_local_calc_tot_delivery_p_vat, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start ('1', '', "$ylocal_alt_tbl_color_deliv");
					xcenter_right_start ();
						xtext_small ('<b>'."$yxall_local_calc_tot_delivery_p_vat_nf".'</b>');
						xnewline ();
						xtext_small ('('."$yecomm_vat_for_delivery".'%)');
					xcenter_end ();
				xtable_column_end ();

			xtable_row_end ();

		} //end if


		//--------------- at end List TOTAL

		if ( ($newoffsetnext >= $y_crt_itm_nums) AND ($y_crt_itm_nums > '0') AND ($hxv_crt_maxchecks < '100') ) {

			// TOTALS
			xtable_row_start ();

				//total text
				xtable_column_start_vcenter ('2', '', "$ybar_menu_color");
					xtext_small ('<b>'."$yecomm_crt_totals".' - '."$y_crt_itm_nums".' '."$yecomm_total_rows".' '."$hlocal_deliv_show_to_total".'</b>');
					xspace ();
				xtable_column_end ();

				//quantity
				xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
					xcenter_start ();
						xtext_small ('<b>'.'-'.'</b>');
					xcenter_end ();
				xtable_column_end ();

				//price
				xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
					xcenter_start ();
						xtext_small ('<b>'.'-'.'</b>');
					xcenter_end ();
				xtable_column_end ();

				//total price
				$yxall_local_calc_tot_price_nf = number_format($yxall_local_calc_tot_price, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
					xcenter_right_start ();
						xtext_small ('<b>'."$yxall_local_calc_tot_price_nf".'</b>');
					xcenter_end ();
				xtable_column_end ();

				//total vat tax
				$yxall_local_calc_tot_vat_nf = number_format($yxall_local_calc_tot_vat, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
					xcenter_right_start ();
						xtext_small ('<b>'."$yxall_local_calc_tot_vat_nf".'</b>');
					xcenter_end ();
				xtable_column_end ();

			xtable_row_end ();


			// TOTAL TO PAY
			xtable_row_start ();

				//total to pay text
				xtable_column_start_vcenter ('4', '', "$ybar_menu_color");
					xnewline ();
					xtable_start ('100%');
						xtable_row_start ();
							xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
								xtext_small ('<b>'."$yecomm_crt_total_topay ($yprods_item_crr_name) $hlocal_deliv_show_to_total - $yecomm_crt_includding_vat".'</b>');
							xtable_column_end ();
						xtable_row_end ();
					xtable_end ();
					xnewline ();
				xtable_column_end ();

				//total to pay amount
				$yxall_local_calc_tot_topay_nf = number_format($yxall_local_calc_tot_topay, 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep);
				xtable_column_start_vcenter ('2', '', "$ybar_menu_color");
					xcenter_start ();
						xtable_start ('');
							xtable_row_start ();
								xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
									xtext_small ('<b>'."$yxall_local_calc_tot_topay_nf".'</b>');
									xspace ();
								xtable_column_end ();

								xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
									xpict ("$ywebsite_addr_secure"."$y_warp_crr_dir"."$y_crr_active", '20', '20');
								xtable_column_end ();
							xtable_row_end ();
						xtable_end ();
					xcenter_end ();
				xtable_column_end ();

			xtable_row_end ();

		} //end if

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


		xtable_end ();

	//--------------
	xtable_column_end ();
	xtable_row_end ();
	xtable_end ();

	xnewline ();

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


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

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

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xwriteflash_bg_var ('alinkers.swf',
								"&alinker_txt=".rawurlencode("$y_warp_prev_text").
								"&alinker_url=".rawurlencode("$ywebsite_addr_secure".'cart_shop.php').
								"&wpqid=".rawurlencode($wpqid).
								"&wpsid=".rawurlencode($wpsid).
								"&pmop=".rawurlencode('pcs1').
								"&offset=".rawurlencode($newoffsetprev).
								"&"
							, '150', '20', "$ybar_menu_color");
						} //end if

						//Show NEXT
						if ($newoffsetnext < $y_crt_itm_nums) {
							xwriteflash_bg_var ('alinkers.swf',
								"&alinker_txt=".rawurlencode("$y_warp_next_text").
								"&alinker_url=".rawurlencode("$ywebsite_addr_secure".'cart_shop.php').
								"&wpqid=".rawurlencode($wpqid).
								"&wpsid=".rawurlencode($wpsid).
								"&pmop=".rawurlencode('pcs1').
								"&offset=".rawurlencode($newoffsetnext).
								"&"
							, '150', '20', "$ybar_menu_color");
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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



	//==================== prev, next step

	if ( ($newoffsetnext >= $y_crt_itm_nums) AND ($y_crt_itm_nums > '0') AND ($hxv_crt_maxchecks < '100') ) {

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_start ();

					xwriteflash_bg_var ('alinker.swf',
						"&alinker_txt=".rawurlencode("$yecomm_your_shoppingcart_ns").
						"&alinker_url=".rawurlencode("$ywebsite_addr_secure".'cart_shop.php').
						"&wpqid=".rawurlencode($wpqid).
						"&wpsid=".rawurlencode($wpsid).
						"&wchkcrt=".rawurlencode($wcheck_local_cart_sum_md5).
						"&wchkusr=".rawurlencode($wcheck_local_usr_sum_md5).
						"&pmop=".rawurlencode('pcs2').
						"&"
					, '250', '20', "$ybar_menu_color");

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

	xnewline ();

	} //end if


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


	//==================== cart overflow note

	if ($hxv_crt_maxchecks >= '100') {

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
				xcenter_start ();

				xtable_start ('');
					xtable_row_start ();
						xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
							xwriteflash_bg_var ('flagger.swf',
							"&xaction=".rawurlencode('err').
							"&"
							, '30', '30', "$ybar_menu_color");
						xtable_column_end ();
						xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
							xtext_small ("$yecomm_crt_errorx_overflow");
						xtable_column_end ();
					xtable_row_end ();
				xtable_end ();

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

	xnewline ();

	} //end if

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


	//==================== cart empty note

	if ($hxv_crt_maxchecks <= '0') {

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
				xcenter_start ();

				xtable_start ('');
					xtable_row_start ();
						xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
							xwriteflash_bg_var ('flagger.swf',
							"&xaction=".rawurlencode('err').
							"&"
							, '30', '30', "$ybar_menu_color");
						xtable_column_end ();
						xtable_column_start_vcenter ('1', '', "$ybar_menu_color");
							xtext_small ("$yecomm_crt_errorx_innerflow");
						xtable_column_end ();
					xtable_row_end ();
				xtable_end ();

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

	xnewline ();

	} //end if

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


} //end if

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


//###################################### OP order validation

if ($pmop=='pcs2') {

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

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

	xnewline ();

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


	//==================== warning

	xtable_start ("$ywarp_max_display_cfg");

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '20%', "$ybar_menu_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();

					xwriteflash_nobg_var ('flagger.swf',
					"&xaction=".rawurlencode('wrn').
					"&"
					, '30', '30');

					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '60%', "$ybar_menu_color");
				xtext_small ("$yecomm_order_xsafety_note");
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();

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


	//==================== cart process info

	xtable_start ("$ywarp_max_display_cfg");

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

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
					xtext_small ('<b>'."$yprods_item_cartprocess".'</b>');
			xtable_column_end ();

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

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

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
				xtext_small ('<i>'.'1. '."$yecomm_your_shoppingcart".'</i>');
				xnewline ();
				xtext_small ('<b><i>'.'2. '."$yecomm_your_shoppingcart_s2".'</i></b>');
				xnewline ();
				xtext_small ('3. '."$yecomm_your_shoppingcart_s3");
				xnewline ();
				xtext_small ('4. '."$yecomm_your_shoppingcart_s4");
				xnewline ();
				xnewline ();
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();

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

	//==================== user info

	xtable_start ("$ywarp_max_display_cfg");

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '20%', "$ymain_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();
					xpict_alt ("$ywebsite_addr_secure"."$y_warp_picts_dir".'/usr_accnt.jpg', '30', '30', "$y_warp_profile_text");
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
					xtext_small ('<b>'."$y_warp_profile_text".'</b>'." ($PHP_AUTH_USER) ");
			xtable_column_end ();

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

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

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
				if ($ywusr_thecompany_isneeded == 'y') {
					xtext_small ("$ywusr_xentire_company".' : <b>'."$arr_usr_data[2]".'</b>');
					xnewline ();
				} //end if
				else {
					xtext_small ("$ywusr_xentire_name".' : <b>'."$arr_usr_data[0]".' '."$arr_usr_data[1]".'</b>');
					xnewline ();
				} //end else
				xtext_small ("$ywusr_xentire_addr".' : <b>'.
					     "$arr_usr_data[6]".' '."$arr_usr_data[4]".', '."$arr_usr_data[3]".', '.
					     "$arr_usr_data[5]".', '."$arr_usr_data[9]".'</b>'
				);
				xnewline ();
				xtext_small ("$ywusr_xentire_phone".' : <b>'."$arr_usr_data[7]".'</b>');
				xnewline ();
				xtext_small ("$ywusr_xentire_email".' : <b>'."$arr_usr_data[8]".'</b>');
				xnewline ();

				if ($ywusr_thecompany_isneeded == 'y') {
					xtext_small ("$ywusr_user_forcompany".' : <b>'."$arr_usr_data[0]".' '."$arr_usr_data[1]".'</b>');
					xnewline ();
				} //end if

				xnewline ();
				xtext_small ('<i>'."$yecomm_cart_user_note".'</i>');
				xnewline ();
				xnewline ();
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();


	//===================================== order generation form


	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ymain_color");
				xcenter_start ();

					xwriteflash_nobg_var ('cart_ord.swf',
						"&flash_form_backcolor=".rawurlencode($ybar_menu_color).
						"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
						"&flash_form_bttn_cancel=".rawurlencode($yecomm_order_cancel).
						"&flash_form_bttn_accept=".rawurlencode($yecomm_order_accept).
						"&flash_form_bttn_back=".rawurlencode($y_warp_back_text_x).
						"&flash_form_bttn_oky=".rawurlencode($yecomm_your_shoppingcart_ns).
						"&note_txt=".rawurlencode("$yecomm_order_gnote").

						"&flash_form_text_status=".rawurlencode($yecomm_order_status." : ").
						"&flash_form_text_process=".rawurlencode($yecomm_order_processing).
						"&flash_form_logo=".rawurlencode("$ywebsite_addr_secure"."$y_warp_picts_dir".'/prod_order.jpg').

						"&wpqid=".rawurlencode($wpqid).
						"&wpsid=".rawurlencode($wpsid).
						"&wchkcrt=".rawurlencode($wchkcrt).
						"&wchkusr=".rawurlencode($wchkusr).
						"&pmop=".rawurlencode('pcs3').
						"&xurl=".rawurlencode("$ywebsite_addr_secure"."cart_ord_op.php").
						"&yurl=".rawurlencode("$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid").
						"&zurl=".rawurlencode("$ywebsite_addr_secure"."cart_shop.php").
						"&wxu=".rawurlencode(MD5($PHP_AUTH_USER)).
						"&wxp=".rawurlencode(MD5(base64_encode($PHP_AUTH_PW))).
						"&"
					, '450', '250');

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


} //end if

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


//###################################### OP order preview

if ($pmop=='pcs3') {

	//if no order id die
	if (strlen($wordid) < '25') {
		xzerr_die_after_header ($y_warp_err_data_failure);
	} //end if

	$arr_var_result = array();
	xmysql_read_data ("SELECT details_htm, id, usr_all_name, usr_company, usr_all_addr, usr_phone, usr_email, usr_by_co FROM orders WHERE ( ( ord_id='$wordid' ) AND (usr_id='$ylocal_prodmod_usr_id') ) ");

	//compare with db data
	if ( (empty($arr_var_result[0])) OR (empty($arr_var_result[1])) ) {
		xzerr_die_after_header ($y_warp_err_data_failure);
	} //end if

	//do step update
	xmysql_write_data ("UPDATE orders SET status=CONCAT(status, ' [step preview done] ') WHERE ( ( ord_id='$wordid' ) AND (usr_id='$ylocal_prodmod_usr_id') ) ");


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

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

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

	xnewline ();

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


	//==================== warning

	xtable_start ("$ywarp_max_display_cfg");

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '20%', "$ybar_menu_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();

					xwriteflash_nobg_var ('flagger.swf',
					"&xaction=".rawurlencode('wrn').
					"&"
					, '30', '30');

					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '60%', "$ybar_menu_color");
				xtext_small ("$yecomm_order_xsafety_note");
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();

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


	//==================== cart process info

	xtable_start ("$ywarp_max_display_cfg");

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

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
					xtext_small ('<b>'."$yprods_item_cartprocess".'</b>');
			xtable_column_end ();

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

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

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
				xtext_small ('<i>'.'1. '."$yecomm_your_shoppingcart".'</i>');
				xnewline ();
				xtext_small ('<i>'.'2. '."$yecomm_your_shoppingcart_s2".'</i>');
				xnewline ();
				xtext_small ('<b><i>'.'3. '."$yecomm_your_shoppingcart_s3".'</i></b>');
				xnewline ();
				xtext_small ('4. '."$yecomm_your_shoppingcart_s4");
				xnewline ();
				xnewline ();
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();

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

	//==================== user info

	xtable_start ("$ywarp_max_display_cfg");

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '20%', "$ymain_color");
				xcenter_right_start ();
					xvpix_h ('5');
					xnewline ();
					xpict_alt ("$ywebsite_addr_secure"."$y_warp_picts_dir".'/usr_accnt.jpg', '30', '30', "$y_warp_profile_text");
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
					xtext_small ('<b>'."$ywusr_xentire_cxinfo".'</b>'." ($PHP_AUTH_USER) ");
			xtable_column_end ();

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

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

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
				if ($arr_var_result[7] == 'y') {
					xtext_small ("$ywusr_xentire_company".' : <b>'."$arr_var_result[3]".'</b>');
					xnewline ();
				} //end if
				else {
					xtext_small ("$ywusr_xentire_name".' : <b>'."$arr_var_result[2]".'</b>');
					xnewline ();
				} //end else
				xtext_small ("$ywusr_xentire_addr".' : <b>'."$arr_var_result[4]".'</b>');
				xnewline ();
				xtext_small ("$ywusr_xentire_phone".' : <b>'."$arr_var_result[5]".'</b>');
				xnewline ();
				xtext_small ("$ywusr_xentire_email".' : <b>'."$arr_var_result[6]".'</b>');
				xnewline ();

				if ($arr_var_result[7] == 'y') {
					xtext_small ("$ywusr_user_forcompany".' : <b>'."$arr_var_result[2]".'</b>');
					xnewline ();
				} //end if

				xnewline ();
				xtext_small ('<i>'."$yecomm_cart_user_note".'</i>');
				xnewline ();
				xnewline ();
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();


	//===================================== html order preview

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();

			xtable_column_start ('1', '10%', "$ymain_color_alt");
					xspace();
			xtable_column_end ();

			xtable_column_start ('1', '80%', "$ymain_color_alt");
				xcenter_start ();
					xnewline();

					//html order
					xtext_small (xdex_warp_decrypt ("$arr_var_result[0]"));

					xnewline();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start ('1', '10%', "$ymain_color_alt");
					xspace();
			xtable_column_end ();

		xtable_row_end ();
	xtable_end ();
	xnewline ();

	//===================================== next step

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_start ();

					xwriteflash_bg_var ('alinker.swf',
						"&alinker_txt=".rawurlencode("$yecomm_your_shoppingcart_ns").
						"&alinker_url=".rawurlencode("$ywebsite_addr_secure"."$yecomm_payment_ccvs_gateway").
						"&wpqid=".rawurlencode($wpqid).
						"&wpsid=".rawurlencode($wpsid).
						"&payxop=".rawurlencode('form').
						"&wordid=".rawurlencode($wordid).
						"&"
					, '250', '20', "$ybar_menu_color");

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



} //end if

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

//---------------------------------------------------------page footer
xcenter_end ();
xfooter ();
//---------------------------------------------------------



} // END FUNCTION


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


//---------------------
//secure ssl check
if ($SERVER_PORT == "$ywebsite_addr_secure_port") {
	xcart_module ();
} //end if
else {
	$xnt_control_var = 'xx';
	xhalt_hack ();
} //end else
//---------------------



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