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

// [user profile 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';

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


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



function xuser_profile () {

//main vars
global 	$uop, $arr_var_result, $var_result_size, $wpsid, $PHP_AUTH_USER, $PHP_AUTH_PW,
	$warp_registrat_fail, $y_warp_back_text_x, $ywusr_max_orders_per_page, $offset,
	$uox;

global 	$ybar_color, $ymain_color, $ybar_menu_color, $ymain_color_alt, $ysmall_text_color, $ywarp_max_display_cfg ;

global	$y_warp_back_text, $y_warp_back_text_x, $ywusr_new_profile, $ywusr_status_txt, 	$ywusr_process_upd_txt, 
	$y_warp_post_text_hint, $y_warp_post_text_mark,	$ywusr_first_name, $ywusr_second_name, 
	$ywusr_company, $ywusr_address, $ywusr_city, $ywusr_reg_st, $ywusr_zip_code, $ywusr_phone, 
	$ywusr_country, $ywusr_email, $ywusr_nocountry,	$ywebsite_addr, $y_warp_picts_dir, $ywusr_user_id, 
	$ywusr_user_pass, $ywusr_user_repass, $ywusr_add_step_one, $ywusr_add_step_two, 
	$ywusr_must_logout, $ywusr_already_logon, $ywusr_already_logon_title, $ywusr_edit_prof_title, 
	$y_warp_update_txt, $ywusr_add_step_thr, $y_warp_text_okay, $ywusr_thecompany_isneeded,
	$ywusr_user_zz_user, $ywusr_status_of_orders, $ywusr_status_of_orders_view_title, $yecomm_active,
	$yecomm_order_status_valid, $yecomm_order_status_valid_wait, $yecomm_order_status_invalid, 
	$yecomm_order_status_invalid_wait, $yecomm_order_status_unknown, $yecomm_order_usr_list, $y_warp_total_text, 
	$y_warp_prev_text, $y_warp_next_text, $yecomm_order_ord_no, $yecomm_order_ord_txtdate, 
	$yecomm_order_ord_txttime, $yecomm_order_ord_txtstat, $yecomm_order_usr_note, $ywusr_thewelcome_title, 
	$ywusr_thewelcome_note, $ywusr_thewelcome_note_ecomm, $ywusr_thewelcome_xmain, $ywusr_add_step_xtitlex,
	$ywusr_edit_prof_title_idx, $yecomm_order_ord_txtstatx, $yecomm_order_ord_print_previewx, 
	$ywusr_adm_cont_lnk_txt, $yecomm_order_reffx_contact, $y_warp_err_data_failure, $yecomm_order_usr_det,
	$yecomm_order_usr_downloads, $yecomm_order_dwn_emptynote, $yecomm_order_dwn_emptynote_2,
	$y_warp_download_text, $ywusr_hhty_newsletter_subscribe, $ywusr_hhty_view_agreement ;


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


//------------------------ check user auth

xrecheck_secure_header_ret_usrid ('y');

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


//---------------------
if (empty($uop)) {
   $uop = 'usrwelcome';
} //end if
//---------------------


//################################ welcome

if ($uop == 'usrwelcome') {


//==================== where bar

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_link ("$ywusr_add_step_two", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrinf", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$ywusr_add_step_thr", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usridx", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				if ($yecomm_active == 'y') {
					xtext_link ("$ywusr_status_of_orders", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrordx&offset=0", '_self');
					xspace ();
					xtext_small ('|');
					xspace ();
				} //end if
				xtext_link ("$y_warp_back_text_x", "$ywebsite_addr"."xw_main.php"."?wpsid=$wpsid", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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



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

xtable_start ("$ywarp_max_display_cfg");

	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ybar_color");
			xtext_title ("&nbsp;"."$ywusr_thewelcome_xmain".' [ '."$PHP_AUTH_USER".' ] ');
		xtable_column_end ();
	xtable_row_end ();

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

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

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


				xtable_start ("50%");
					xtable_row_start ();
						xtable_column_start_vcenter ('1', '', "$ymain_color");
							xpict ("$ywebsite_addr"."$y_warp_picts_dir".'/usr_accnt.jpg', '30', '30');
							xvpix ('10');
						xtable_column_end ();

						xtable_column_start_vcenter ('1', '', "$ymain_color");
							xtext_small ('<b>'."$ywusr_thewelcome_title".', '."$PHP_AUTH_USER".'</b>');
							xnewline();
							xtext_small ("$ywusr_thewelcome_note");
							if ($yecomm_active == 'y') {
								xnewline();
								xtext_small ("$ywusr_thewelcome_note_ecomm");
							} //end if
							xnewline();
							xnewline();
							xtext_link ("$ywusr_hhty_view_agreement", "$ywebsite_addr".'user_agreement.txt', '_blank');
						xtable_column_end ();
					xtable_row_end ();
				xtable_end ();


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

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

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

xtable_end ();

} //end if

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


//################################ user edit info

if ($uop == 'usrinf') {


//==================== where bar

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$ywusr_add_step_two</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$ywusr_add_step_thr", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usridx", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				if ($yecomm_active == 'y') {
					xtext_link ("$ywusr_status_of_orders", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrordx&offset=0", '_self');
					xspace ();
					xtext_small ('|');
					xspace ();
				} //end if
				xtext_link ("$y_warp_back_text_x", "$ywebsite_addr"."xw_main.php"."?wpsid=$wpsid", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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



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

xtable_start ("$ywarp_max_display_cfg");

	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ybar_color");
			xtext_title ("&nbsp;"."$ywusr_edit_prof_title".' [ '."$PHP_AUTH_USER".' ] ');
		xtable_column_end ();
	xtable_row_end ();

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

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

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

			$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_countr_id, w_subscr FROM users WHERE ( (usr_name='$PHP_AUTH_USER') AND (usr_pass='$WARP_B64_ENC_AUTH_PASSW') ) ");
			$arr_usr_data = $arr_var_result;

			xmysql_read_data ("SELECT c_id, c_name, id FROM country_list WHERE (c_id='$arr_usr_data[9]') ");
			$arr_country_list_sel = $arr_var_result;

			xmysql_read_data ("SELECT c_id, c_name FROM country_list WHERE (c_id!='$arr_usr_data[9]') ORDER BY c_name DESC ");
			$arr_country_list_nsel = $arr_var_result;

			//-----------------------------------build clist


			$ylocal_country_xflash_list_name = '';
			$ylocal_country_xflash_list_idx = '';

			$arr_count = count($arr_country_list_nsel);
			for ($i=0; $i < $arr_count; $i++) {
				$i_idx = $i;
				$i_name = $i + 1;
				$i = $i + 1;

				$ylocal_country_xflash_list_idx = "$ylocal_country_xflash_list_idx"."&arr_id"."$ii"."=".rawurlencode("$arr_country_list_nsel[$i_idx]");
				$ylocal_country_xflash_list_name = "$ylocal_country_xflash_list_name"."&arr_name"."$ii"."=".rawurlencode("$arr_country_list_nsel[$i_name]");

				$ii = $ii + 1;

			} //end for


			if (!empty($arr_country_list_sel[2])) {
				$ylocal_country_xflash_list_idx = "$ylocal_country_xflash_list_idx"."&arr_id"."$ii"."=".rawurlencode("$arr_country_list_sel[0]");
				$ylocal_country_xflash_list_name = "$ylocal_country_xflash_list_name"."&arr_name"."$ii"."=".rawurlencode("$arr_country_list_sel[1]");
			} //end if
			else {
				$ylocal_country_xflash_list_idx = "$ylocal_country_xflash_list_idx"."&arr_id"."$ii"."=".rawurlencode('xxx');
				$ylocal_country_xflash_list_name = "$ylocal_country_xflash_list_name"."&arr_name"."$ii"."=".rawurlencode("$ywusr_nocountry");
			} //end else

			if ($ywusr_thecompany_isneeded == 'y') {
				$hy_locx_company_zvarh = "&company_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_company".' :') ;
				$hy_locx_company_zvarh_ext = "$ywusr_company".' ';
			} //end if
			else {
				$hy_locx_company_zvarh = "&company_txt=".rawurlencode("$ywusr_company".' :') ;
				$hy_locx_company_zvarh_ext = "$ywusr_user_zz_user".' ';
			} //end else

			$op_var = 'uedx';
			xwriteflash_nobg_var ("$ywebsite_addr"."usr_frm.swf",
				"&flash_form_backcolor=".rawurlencode($ybar_menu_color).
				"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
				"&flash_form_text_back=".rawurlencode($y_warp_back_text).
				"&flash_form_text_bttn=".rawurlencode($y_warp_update_txt).
				"&flash_form_text_bttnoky=".rawurlencode($y_warp_text_okay).
				"&flash_form_text_status=".rawurlencode($ywusr_status_txt." : ").
				"&flash_form_text_process=".rawurlencode($ywusr_process_upd_txt).
				"&hint_txt=".rawurlencode("$y_warp_post_text_hint").
				"&fname_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_zz_user".' '."$ywusr_first_name".' :').
				"&sname_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_zz_user".' '."$ywusr_second_name".' :').
				"$hy_locx_company_zvarh".
				"&addr_txt=".rawurlencode("$y_warp_post_text_mark"."$hy_locx_company_zvarh_ext"."$ywusr_address".' :').
				"&city_txt=".rawurlencode("$y_warp_post_text_mark"."$hy_locx_company_zvarh_ext"."$ywusr_city".' :').
				"&region_txt=".rawurlencode("$y_warp_post_text_mark"."$hy_locx_company_zvarh_ext"."$ywusr_reg_st".' :').
				"&zipcode_txt=".rawurlencode("$y_warp_post_text_mark"."$hy_locx_company_zvarh_ext"."$ywusr_zip_code".' :').
				"&phone_txt=".rawurlencode("$y_warp_post_text_mark"."$hy_locx_company_zvarh_ext"."$ywusr_phone".' :').
				"&country_txt=".rawurlencode("$y_warp_post_text_mark"."$hy_locx_company_zvarh_ext"."$ywusr_country".' :').
				"&email_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_zz_user".' '."$ywusr_email".' :').
				"&fname_var=".rawurlencode("$arr_usr_data[0]").
				"&sname_var=".rawurlencode("$arr_usr_data[1]").
				"&company_var=".rawurlencode("$arr_usr_data[2]").
				"&addr_var=".rawurlencode("$arr_usr_data[3]").
				"&city_var=".rawurlencode("$arr_usr_data[4]").
				"&region_var=".rawurlencode("$arr_usr_data[5]").
				"&zipcode_var=".rawurlencode("$arr_usr_data[6]").
				"&phone_var=".rawurlencode("$arr_usr_data[7]").
				"&email_var=".rawurlencode("$arr_usr_data[8]").
				"$ylocal_country_xflash_list_idx".
				"$ylocal_country_xflash_list_name".
				"&subscr_txt=".rawurlencode("$ywusr_hhty_newsletter_subscribe").
				"&subscr_var=".rawurlencode("$arr_usr_data[10]").
				"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/usr_accnt.jpg').
				"&flash_form_op=".rawurlencode($op_var).
				"&xurl=".rawurlencode("$ywebsite_addr"."usr_op.php").
				"&okyurl=".rawurlencode("$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrinf").
				"&wxu=".rawurlencode(MD5($PHP_AUTH_USER)).
				"&wxp=".rawurlencode(MD5(base64_encode($PHP_AUTH_PW))).
				"&"
			, '450', '520');

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

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

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

xtable_end ();

} //end if

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



//################################ user edit name, pass

if ($uop == 'usridx') {


//==================== where bar

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$ywusr_add_step_thr</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$ywusr_add_step_two", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrinf", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				if ($yecomm_active == 'y') {
					xtext_link ("$ywusr_status_of_orders", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrordx&offset=0", '_self');
					xspace ();
					xtext_small ('|');
					xspace ();
				} //end if
				xtext_link ("$y_warp_back_text_x", "$ywebsite_addr"."xw_main.php"."?wpsid=$wpsid", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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



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

xtable_start ("$ywarp_max_display_cfg");

	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ybar_color");
			xtext_title ("&nbsp;"."$ywusr_edit_prof_title_idx".' [ '."$PHP_AUTH_USER".' ] ');
		xtable_column_end ();
	xtable_row_end ();

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

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

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

			$WARP_B64_ENC_AUTH_PASSW = base64_encode($PHP_AUTH_PW);
			xmysql_read_data ("SELECT usr_name, usr_pass FROM users WHERE ( (usr_name='$PHP_AUTH_USER') AND (usr_pass='$WARP_B64_ENC_AUTH_PASSW') ) ");
			$arr_usr_data_idx = $arr_var_result;

			$ylocal_usr_fored_id = $arr_usr_data_idx[0];
			$ylocal_usr_fored_pw = base64_decode($arr_usr_data_idx[1]);

				$op_var = 'uedy';
				xwriteflash_nobg_var ("$ywebsite_addr"."usrid_frm.swf",
					"&flash_form_backcolor=".rawurlencode($ybar_menu_color).
					"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
					"&flash_form_text_back=".rawurlencode($y_warp_back_text).
					"&flash_form_text_bttn=".rawurlencode($y_warp_update_txt).
					"&flash_form_text_bttnoky=".rawurlencode($y_warp_text_okay).
					"&flash_form_text_status=".rawurlencode($ywusr_status_txt." : ").
					"&flash_form_text_process=".rawurlencode($ywusr_process_upd_txt).
					"&usr_id_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_id".' :').
					"&usr_pass_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_pass".' :').
					"&usr_repass_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_repass".' :').
					"&hint_txt=".rawurlencode($y_warp_post_text_hint).
					"&usr_id_var=".rawurlencode($ylocal_usr_fored_id).
					"&usr_pass_var=".rawurlencode($ylocal_usr_fored_pw).
					"&usr_repass_var=".rawurlencode($ylocal_usr_fored_pw).
					"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/usr_accnt.jpg').
					"&flash_form_op=".rawurlencode("$op_var").
					"&xurl=".rawurlencode("$ywebsite_addr"."usr_op.php").
					"&okyurl=".rawurlencode("$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usridx").
					"&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_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();

xtable_end ();

} //end if

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



//################################ orders list

if ( ($uop == 'usrordx') AND ($yecomm_active == 'y') ) {


//==================== where bar

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$ywusr_status_of_orders</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$ywusr_add_step_two", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrinf", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$ywusr_add_step_thr", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usridx", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$y_warp_back_text_x", "$ywebsite_addr"."xw_main.php"."?wpsid=$wpsid", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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

xtable_start ("$ywarp_max_display_cfg");

	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ybar_color");
			xtext_title ("&nbsp;"."$ywusr_status_of_orders_view_title - $yecomm_order_usr_list".' [ '."$PHP_AUTH_USER".' ] ');
		xtable_column_end ();
	xtable_row_end ();

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

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

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

			xnewline();
			xtable_start ("50%");
				xtable_row_start ();
					xtable_column_start_vcenter ('1', '', "$ymain_color");
						xpict ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_order.jpg', '30', '30');
						xvpix ('10');
					xtable_column_end ();

					xtable_column_start_vcenter ('1', '', "$ymain_color");
						xtext_small ($yecomm_order_usr_note);
					xtable_column_end ();
				xtable_row_end ();
			xtable_end ();



			$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') ) ");
			$arr_usr_data_idx = $arr_var_result[0];


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

			$hvxb_querry = "SELECT ord_id, w_date, w_time, payed, confirmed FROM orders WHERE (usr_id='$arr_usr_data_idx') " ;

			$hvxb_querry_c = "SELECT COUNT(*) FROM orders WHERE (usr_id='$arr_usr_data_idx') " ;

			xmysql_count_data ($hvxb_querry_c);
			//$var_result_size
			xmysql_read_data ($hvxb_querry." ORDER BY id DESC LIMIT $offset, $limit ");
			//$arr_var_result

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

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

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


		//==================== nav bar

		xnewline ();

		xtable_start ("90%");
			xtable_row_start ();
				xtable_column_start ('1', '', "$ybar_menu_color");
					xtext_small ('|');
					xspace ();
					xtext_small ("<b>$yecomm_order_usr_list</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$var_result_size</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"."usr_prof.php?wpsid=$wpsid&uop=usrordx&offset=$newoffsetprev", '_self');
								xspace ();
								xtext_small ('|');
								xspace ();
							} //end if

							//Show NEXT
							if ($newoffsetnext < $var_result_size) {
								xtext_link ("$y_warp_next_text", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrordx&offset=$newoffsetnext", '_self');
								xspace ();
								xtext_small ('|');
								xspace ();
							} //end if
					xcenter_end ();
				xtable_column_end ();
			xtable_row_end ();
		xtable_end ();

		xnewline();

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

			xtable_start ('90%');

				xtable_row_start ();
					xtable_column_start_vcenter ('4', '', "$ymain_color");
						xvline('100%');
					xtable_column_end ();
				xtable_row_end ();

				xtable_row_start ();

					xtable_column_start ('1', '', "$ybar_menu_color");
						xtext_small ('&nbsp;&nbsp;&nbsp;&nbsp;');
						xtext_small ('<b>'.$yecomm_order_ord_no.'</b>');
						xspace();
					xtable_column_end ();

					xtable_column_start ('1', '', "$ybar_menu_color");
						xtext_small ('<b>'.$yecomm_order_ord_txtdate.'</b>');
						xspace();
					xtable_column_end ();

					xtable_column_start ('1', '', "$ybar_menu_color");
						xtext_small ('<b>'.$yecomm_order_ord_txttime.'</b>');
						xspace();
					xtable_column_end ();

					xtable_column_start ('1', '', "$ybar_menu_color");
						xcenter_right_start ();
							xtext_small ('<b>'.$yecomm_order_ord_txtstat.'</b>'.'&nbsp;&nbsp;&nbsp;');
							xspace();
						xcenter_end ();
					xtable_column_end ();

				xtable_row_end ();


			$i_xy_cnt_z = $offset + 0;

			$arr_count = count($arr_var_result);
			for ($i=0; $i < $arr_count; $i++) {
				$i_id = $i;
				$i_date = $i +1;
				$i_time = $i + 2;
				$i_payed = $i + 3;
				$i_fulfil = $i + 4;
				$i = $i + 4;


				$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 ();

					xtable_column_start_vcenter ('1', '', "$ylocal_alt_tbl_color");
						xtext_small ('&nbsp;&nbsp;&nbsp;');
						xtext_link ($arr_var_result[$i_id], "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrordy&uox=$arr_var_result[$i_id]&offset=$offset", '_self');
						xspace();
					xtable_column_end ();

					xtable_column_start_vcenter ('1', '', "$ylocal_alt_tbl_color");
						xtext_small ($arr_var_result[$i_date]);
						xspace();
					xtable_column_end ();

					xtable_column_start_vcenter ('1', '', "$ylocal_alt_tbl_color");
						xtext_small ($arr_var_result[$i_time]);
						xspace();
					xtable_column_end ();

					xtable_column_start_vcenter ('1', '', "$ylocal_alt_tbl_color");

						$ylocal_msg_ord_stats = $yecomm_order_status_unknown;
						if ($arr_var_result[$i_payed] == 'y') {
							if ($arr_var_result[$i_fulfil] == 'y') {
								$ylocal_msg_ord_stats = $yecomm_order_status_valid;
							} //end if
							else {
								$ylocal_msg_ord_stats = $yecomm_order_status_valid_wait;
							} //end else
						} //end if
						else {
							if ($arr_var_result[$i_fulfil] == 'y') {
								$ylocal_msg_ord_stats = $yecomm_order_status_invalid;
							} //end if
							else {
								$ylocal_msg_ord_stats = $yecomm_order_status_invalid_wait;
							} //end else
						} //end else

						xcenter_right_start ();
							xtext_small ($ylocal_msg_ord_stats.'&nbsp;&nbsp;&nbsp;');
							xspace();
						xcenter_end ();
					xtable_column_end ();

				xtable_row_end ();

			} //end for


				xtable_row_start ();
					xtable_column_start ('4', '', "$ymain_color");
						xvline('100%');
					xtable_column_end ();
				xtable_row_end ();


			xtable_end ();
			xnewline();

		//==================== nav bar

		xtable_start ("90%");
			xtable_row_start ();
				xtable_column_start ('1', '', "$ybar_menu_color");
					xtext_small ('|');
					xspace ();
					xtext_small ("<b>$yecomm_order_usr_list</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$var_result_size</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"."usr_prof.php?wpsid=$wpsid&uop=usrordx&offset=$newoffsetprev", '_self');
								xspace ();
								xtext_small ('|');
								xspace ();
							} //end if

							//Show NEXT
							if ($newoffsetnext < $var_result_size) {
								xtext_link ("$y_warp_next_text", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrordx&offset=$newoffsetnext", '_self');
								xspace ();
								xtext_small ('|');
								xspace ();
							} //end if
					xcenter_end ();
				xtable_column_end ();
			xtable_row_end ();
		xtable_end ();

		xnewline ();

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

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

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

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

xtable_end ();

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


} //end if

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



//################################ orders details

if ( ($uop == 'usrordy') AND ($yecomm_active == 'y') ) {


//==================== where bar

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$ywusr_status_of_orders</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$ywusr_add_step_two", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrinf", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$ywusr_add_step_thr", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usridx", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$y_warp_back_text_x", "$ywebsite_addr"."xw_main.php"."?wpsid=$wpsid", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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

xtable_start ("$ywarp_max_display_cfg");

	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ybar_color");
			xtext_title ("&nbsp;"."$ywusr_status_of_orders_view_title - $yecomm_order_usr_det".' [ '."$PHP_AUTH_USER".' ] ');
		xtable_column_end ();
	xtable_row_end ();

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

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


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


			$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') ) ");
			$arr_usr_data_idx = $arr_var_result[0];

			$arr_uox_ord_res = array();
			xmysql_read_data ("SELECT ord_id, w_date, w_time, payed, confirmed, comments, id, xdeliv_d_lst  FROM orders WHERE ( (usr_id='$arr_usr_data_idx') AND (ord_id='$uox') ) ");
			$arr_uox_ord_res = $arr_var_result;

						$ylocal_msg_ord_stats = $yecomm_order_status_unknown;
						if ($arr_uox_ord_res[3] == 'y') {
							$hxvb_enable_downloads = 'y';
							if ($arr_uox_ord_res[4] == 'y') {
								$ylocal_msg_ord_stats = $yecomm_order_status_valid;
							} //end if
							else {
								$ylocal_msg_ord_stats = $yecomm_order_status_valid_wait;
							} //end else
						} //end if
						else {
							$hxvb_enable_downloads = 'n';
							if ($arr_uox_ord_res[4] == 'y') {
								$ylocal_msg_ord_stats = $yecomm_order_status_invalid;
							} //end if
							else {
								$ylocal_msg_ord_stats = $yecomm_order_status_invalid_wait;
							} //end else
						} //end else



			if(!empty($arr_uox_ord_res[6])) {

			xnewline();
			xtable_start ('');
				xtable_row_start ();
					xtable_column_start_vcenter ('1', '', "$ymain_color");
						xpict ("$ywebsite_addr"."$y_warp_picts_dir".'/prod_order.jpg', '30', '30');
						xvpix ('10');
					xtable_column_end ();

					xtable_column_start_vcenter ('1', '', "$ymain_color");
						xtext_link ("$yecomm_order_usr_list", "$ywebsite_addr"."usr_prof.php?wpsid=$wpsid&uop=usrordx&offset=$offset", '_self');
					xtable_column_end ();
				xtable_row_end ();
			xtable_end ();

			xnewline();

			xtable_start ('75%');
				xtable_row_start ();
					xtable_column_start_vcenter ('1', '', "$ymain_color");
						xcenter_start();

						xtable_start ('100%');
							xtable_row_start ();
								xtable_column_start_vcenter ('2', '', "$ymain_color");
									xvline('100%');
								xtable_column_end ();
							xtable_row_end ();

							xtable_row_start ();
								xtable_column_start_vcenter ('1', '', "$ymain_color");
									xtext_small ('[ '."$yecomm_order_ord_no".' : '.'<b>'."$arr_uox_ord_res[0]".'</b>'.' ]');
									xspace();
								xtable_column_end ();

								xtable_column_start_vcenter ('1', '', "$ymain_color");
									//print
									$op_prn_var = 'orders';
									$op_prn_var = base64_encode($op_prn_var);
									$op_prn_var = rawurlencode($op_prn_var);
									xcenter_right_start();
										xtext_link ("$yecomm_order_ord_print_previewx", "$ywebsite_addr"."print_redir.php?xid=$arr_uox_ord_res[0]&xop=$op_prn_var&wpsid=$wpsid", 'wnd_prn');
										xspace();
									xcenter_end();
								xtable_column_end ();
							xtable_row_end ();

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

								xtable_column_start_vcenter ('1', '', "$ymain_color");
									//adm
									$hxtt_order_reff_text = rawurlencode($yecomm_order_reffx_contact.' : '.$arr_uox_ord_res[0]);
									xcenter_right_start();
										xtext_link ("$ywusr_adm_cont_lnk_txt", "$ywebsite_addr"."adm_contact.php?wpsid=$wpsid&vxmsgx=$hxtt_order_reff_text", '_self');
										xspace();
									xcenter_end();
								xtable_column_end ();
							xtable_row_end ();


							xtable_row_start ();
								xtable_column_start_vcenter ('2', '', "$ymain_color");
									xtext_small ("$yecomm_order_ord_txtdate".' : '.'<b>'."$arr_uox_ord_res[1]".'</b>');
									xnewline();
									xtext_small ("$yecomm_order_ord_txttime".' : '.'<b>'."$arr_uox_ord_res[2]".'</b>');
									xnewline();
									xvline('100%');
									xnewline();
									xtext_small ("$yecomm_order_ord_txtstat".' : '.'<b>'."$ylocal_msg_ord_stats".'</b>');
									xnewline();
									xtext_small ("$yecomm_order_ord_txtstatx".' : '.'<br><i>'."$arr_uox_ord_res[5]".'</i>');
									xnewline();
									xvline('100%');
									xnewline();
								xtable_column_end ();
							xtable_row_end ();
						xtable_end ();


						//downloads
						xtable_start ('100%');

							xtable_row_start ();
								xtable_column_start_vcenter ('3', '', "$ymain_color");
									xtext_small ("$yecomm_order_usr_downloads".' :');
								xtable_column_end ();
							xtable_row_end ();

							$xy_download_pxlist_tmd = trim($arr_uox_ord_res[7]);
							if  ($hxvb_enable_downloads == 'y') {
								$xy_download_prod_list_arr = array();
								$xy_download_prod_list_arr = explode(",", $xy_download_pxlist_tmd);

								if ( ((count($xy_download_prod_list_arr)) > '0') AND (!empty($xy_download_pxlist_tmd)) ) {
									for ($i=0; $i<count($xy_download_prod_list_arr); $i++) {
										$xy_download_prod_list_idval = trim($xy_download_prod_list_arr[$i]);
										xmysql_read_data ("SELECT id, descr, size_kb FROM prod_dwn WHERE (pblock='$xy_download_prod_list_idval')");

										for ($ii=0; $ii<count($arr_var_result); $ii++) {
											$ii_id = $ii;
											$ii_desc = $ii + 1;
											$ii_size = $ii + 2;
											$ii = $ii + 2;

											xtable_row_start ();
												xtable_column_start_vcenter ('1', '', "$ymain_color_alt");
													xtext_small('<i>'.$arr_var_result[$ii_desc].'</i>');
													xspace();
												xtable_column_end ();

												xtable_column_start_vcenter ('1', '', "$ymain_color_alt");
													xtext_small('<i>'."$arr_var_result[$ii_size]".' kb'.'</i>');
													xspace();
												xtable_column_end ();

												xtable_column_start_vcenter ('1', '', "$ymain_color_alt");
													$op_var = "$ywebsite_addr"."req_redir.php?xid=$arr_var_result[$ii_id]&xop=sdwn&wpsid=$wpsid&wordid=$arr_uox_ord_res[0]";
													xpict_link ("$ywebsite_addr"."$y_warp_picts_dir".'/save_mini.jpg', "$y_warp_download_text", '20', '20', "$op_var", 'wnd_dwn');
													xspace();
												xtable_column_end ();
											xtable_row_end ();
										} //end for

									} //end for
								} //end if
								else {
									xtable_row_start ();
										xtable_column_start_vcenter ('3', '', "$ymain_color");
											xtext_small('<i>'."$yecomm_order_dwn_emptynote".'</i>');
										xtable_column_end ();
									xtable_row_end ();
								} //end else

							} //end if
							else {
								xtable_row_start ();
									xtable_column_start_vcenter ('3', '', "$ymain_color");
										xtext_small('<i>'."$yecomm_order_dwn_emptynote_2".'</i>');
									xtable_column_end ();
								xtable_row_end ();
							} //end else

							xtable_end ();

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

			} //end if
			else {


			xnewline();
			xtable_start ('');
				xtable_row_start ();
					xtable_column_start_vcenter ('1', '', "$ymain_color");
						xwriteflash_nobg_var ('flagger.swf',
						"&xaction=".rawurlencode('err').
						"&"
						, '30', '30');
						xvpix ('10');
					xtable_column_end ();

					xtable_column_start_vcenter ('1', '', "$ymain_color");
						xtext_small ("$y_warp_err_data_failure");
					xtable_column_end ();
				xtable_row_end ();
			xtable_end ();


			} //end else


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

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

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

xtable_end ();

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


} //end if

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





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

} //end function


//-------------------------------
xuser_profile ();
//-------------------------------



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