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

// [e-commerce payment module (indirect pay) 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



$yecomm_xpayinfo_intro = 	'We do not accept online payments ! Please use the following details for the payment :';
$yecomm_xpayinfo_method = 	'Payment method : Bank Money Transfer';
$yecomm_xpayinfo_eml = 		'After the money transfer please send a confirmation to the following e-mail address :';
$yecomm_xpayinfo_note = 	'If the payment will be not made within 30 days, the order will be canceled. You can track all the information about your orders anytime using '.
				'your profile on this website. After the payment you will receive / can access all the '.
				'products related to the order.' ;



//####### 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_pay.php';
} //end if

require("lib_adv.php");


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




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


function xcart_pay_module () {

//special
global	$wpqid, $wpsid, $wordid, $payxop ;

//main
global	$arr_var_result, $PHP_AUTH_PW, $PHP_AUTH_USER,
	$warp_registrat_fail, $y_warp_err_data_failure,
	$warp_numform_decimal_sep, $warp_numform_thousand_sep,
	$y_warp_xdate, $y_warp_xtime, $y_warp_back_text_x,
	$y_warp_office_email ;

//sec
global	$wrshruid_xhlock_fct_usr_id ;

//ecomm
global	$yecomm_shoppingcart_title, $ywarp_max_display_cfg, $ybar_menu_color, 
	$yecomm_shoppingcart, $yecomm_order_xsafety_note, $ymain_color, $ywebsite_addr_secure, 
	$y_warp_picts_dir, $yprods_item_cartprocess, $yecomm_your_shoppingcart, $yecomm_your_shoppingcart_s2, 
	$yecomm_your_shoppingcart_s3, $yecomm_your_shoppingcart_s4, 
	$y_warp_profile_text, $ywusr_xentire_cxinfo, $ywusr_xentire_company, $ywusr_xentire_name, 
	$ywusr_xentire_addr, $ywusr_xentire_phone, $ywusr_xentire_email, $ywusr_user_forcompany, $yecomm_cart_user_note,
	$ywebsite_addr, $ywusr_adm_cont_lnk_txt, $yecomm_order_invoice_prof, $yecomm_order_ord_no, $yecomm_crt_total_topay, 
	$yecomm_order_usr_det ;

//reff
global	$hlx_apache_headers_reff, $y_warp_direct_file_acc_msg_reff;


//particular
global	$yecomm_xpayinfo_intro, $yecomm_xpayinfo_method, $yecomm_xpayinfo_note, $yecomm_xpayinfo_eml,
	$yecomm_vendor_bank_accnt, $yecomm_vendor_company, $yecomm_vendor_email, $yecomm_vendor_company_txt ;



//---------------------
if (empty($payxop)) {
	$payxop = 'payres';
} //end if
//---------------------


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


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

	//------------------
	//get, check user
	xrecheck_secure_header_ret_usrid ('y');
	$ylocal_pay_auth_usr_id = $wrshruid_xhlock_fct_usr_id;

	$arr_var_result = array();
	$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 = $arr_var_result;
	if ( (empty($arr_usr_data[0])) OR ($arr_usr_data[0] <> $ylocal_pay_auth_usr_id) ) {
		xzerr_die_after_header ("$warp_registrat_fail");
	} //end if

	$hklx_usr_the_id = $arr_usr_data[0];

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


	//------------------
	//get order
	$arr_var_result = array();
	xmysql_read_data ("SELECT id, usr_all_name, usr_company, usr_all_addr, usr_phone, usr_email, usr_by_co, tot_pay, w_crr_name, w_crr_id FROM orders WHERE ( ( ord_id='$wordid' ) AND (usr_id='$ylocal_pay_auth_usr_id') AND (payed<>'y') AND (ord_lock<>'y') ) ");

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

	//do step update
	xmysql_write_data ("UPDATE orders SET status=CONCAT(status, ' [step enter payment done] '), ord_lock='y' WHERE ( ( ord_id='$wordid' ) AND (usr_id='$ylocal_pay_auth_usr_id') AND (payed<>'y') ) ");


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

	//==================== 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 ('<i>'.'3. '."$yecomm_your_shoppingcart_s3".'</i>');
				xnewline ();
				xtext_small ('<b><i>'.'4. '."$yecomm_your_shoppingcart_s4".'</i></b>');
				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[6] == 'y') {
					xtext_small ("$ywusr_xentire_company".' : <b>'."$arr_var_result[2]".'</b>');
					xnewline ();
				} //end if
				else {
					xtext_small ("$ywusr_xentire_name".' : <b>'."$arr_var_result[1]".'</b>');
					xnewline ();
				} //end else
				xtext_small ("$ywusr_xentire_addr".' : <b>'."$arr_var_result[3]".'</b>');
				xnewline ();
				xtext_small ("$ywusr_xentire_phone".' : <b>'."$arr_var_result[4]".'</b>');
				xnewline ();
				xtext_small ("$ywusr_xentire_email".' : <b>'."$arr_var_result[5]".'</b>');
				xnewline ();

				if ($arr_var_result[6] == 'y') {
					xtext_small ("$ywusr_user_forcompany".' : <b>'."$arr_var_result[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 ();

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


	//==================== pay info

	xtable_start ("$ywarp_max_display_cfg");

		xtable_row_start ();
			xtable_column_start ('1', '20%', "$ymain_color");
				xcenter_right_start ();
					xnewline();
					xpict_alt ("$ywebsite_addr_secure"."$y_warp_picts_dir".'/prod_order.jpg', '30', '30', $yecomm_order_usr_det);
					xspace ();
					xspace ();
				xcenter_end ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '60%', "$ymain_color");
					xnewline();
					xtext_small ("$yecomm_order_invoice_prof".' : '.'<b>'."$arr_var_result[0]".'</b>');
					xnewline();
					xtext_small ("$yecomm_order_ord_no".' : '.'<b>'."$wordid".'</b>');
					xnewline();
					xnewline();
					xtext_small ("$yecomm_crt_total_topay".' : '.'<b>'.number_format($arr_var_result[7], 2, $warp_numform_decimal_sep, $warp_numform_thousand_sep).' '."$arr_var_result[8]".'</b>');
					xnewline();
					xvline ('100%');

					xnewline();
					xtext_small ('<b><i>'.$yecomm_xpayinfo_intro.'</i><br><br>'.$yecomm_xpayinfo_method.'<br>'.$yecomm_vendor_company_txt.' : '.$yecomm_vendor_company.'<br>'.$yecomm_vendor_bank_accnt.'<br>'.'</b><br><br>'.$yecomm_xpayinfo_note.'<br>');
					xnewline();
					xtext_small ('<b>'.$yecomm_xpayinfo_eml.'</b>&nbsp;&nbsp;');
					xtext_link($yecomm_vendor_email, "mailto:$yecomm_vendor_email", '');
					xnewline();
					xvline ('100%');

					xcenter_start();
					xtext_link ("$y_warp_back_text_x", "$ywebsite_addr"."xw_main.php?wpqid=$wpqid&wpsid=$wpsid", '_self');
					xcenter_end();

					xvline ('100%');
					xnewline();
			xtable_column_end ();

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

	xtable_end ();
	xnewline ();


	xmysql_write_data ("DELETE FROM prod_cart WHERE ( (w_sess='$wpsid') AND (u_id='$hklx_usr_the_id') ) ");


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


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


} //end function


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


//---------------------
//secure ssl check
if ($SERVER_PORT == "$ywebsite_addr_secure_port") {
	xcart_pay_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