Register for your free account! | Forgot your password?

You last visited: Today at 03:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Webmall problem

Discussion on Webmall problem within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2009
Posts: 380
Received Thanks: 85
Webmall problem

i have got a problem with the webmall i keep getting content corupt error massage when i click buy on any items i think it has to do with the
$back_url is there another way to do this insted of $back_url
Code:
<?php
if (isset($_POST['buy'])) {
	$post_data = do_request($_POST, true);
	$back_url = str_replace('&', '&', base64_decode($_POST['back_url']));
	
	$left_empty_slots = 0;
	
	if ($_POST['js_enabled'] != 1)
		set_msg('You must have javascript enabled in your browser', 'error', $back_url, 'buy_msg_' . $post_data['id']);
	
	if (!$post_data)
		set_msg('Please fill all fields', 'error', $back_url, 'buy_msg_' . $post_data['id']);
		
	$query = mysql_query("SELECT * FROM donate_items WHERE id = '{$post_data['id']}'") or die();
	if (mysql_num_rows($query) <= 0)
		set_msg('Unexpected error!', 'error', $back_url, 'buy_msg_' . $post_data['id']);
		
	$item_data = mysql_fetch_array($query);
	
	if ($user_data['Point'] < $item_data['item_price'])
		set_msg("You do not have enough points", 'error', $back_url, 'buy_msg_' . $post_data['id']);
	
	if ($item_data['item_pack'] == 0) {
		if ($item_data['item_ali']) {
			$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}'") or die();
			$count_slots = mssql_num_rows($query);
			if ($config['max_slots'] > $count_slots)
				$left_empty_slots = $config['max_slots'] - $count_slots;
		
			if ($left_empty_slots >= $item_data['item_count']) {
				for($i=1;$i<=$item_data['item_count'];$i++) {
					$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}'") or die();
					$s = 0;
					$empty_slot = false;
					if (mssql_num_rows($query) > 0) {
						while ($row = mssql_fetch_array($query)) {
							$s++;
							
							if ($s <= $config['max_slots']) {
								$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}' AND slot = '{$s}'") or die();
								if (mssql_num_rows($query) <= 0) {
									$empty_slot = $s;
									break;
								}
							} else {
								$empty_slot = false;
								break;
							}
						}
						
						if ($empty_slot) {
							mssql_query("INSERT INTO PS_GameData.dbo.UserStoredPointItems (UserUID, Slot, ItemID, ItemCount, BuyDate) VALUES ('{$user_data['UserUID']}','{$empty_slot}','{$item_data['item_id']}','1','" . date('Y-m-d H:i:s') . "')") or die();
						} else {
							set_msg('No empty slots for items', 'error', $back_url, 'buy_msg_' . $post_data['id']);
						}
					} else {
						$empty_slot = 1;
						mssql_query("INSERT INTO PS_GameData.dbo.UserStoredPointItems (UserUID, Slot, ItemID, ItemCount, BuyDate) VALUES ('{$user_data['UserUID']}','{$empty_slot}','{$item_data['item_id']}','1','" . date('Y-m-d H:i:s') . "')") or die();
					}
				}
			} else {
				set_msg('No empty slots for items', 'error', $back_url, 'buy_msg_' . $post_data['id']);
			}
		} else {
			$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}'") or die();
			$s = 0;
			$empty_slot = false;
			if (mssql_num_rows($query) > 0) {
				while ($row = mssql_fetch_array($query)) {
					$s++;
					
					if ($s <= $config['max_slots']) {
						$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}' AND slot = '{$s}'") or die();
						if (mssql_num_rows($query) <= 0) {
							$empty_slot = $s;
							break;
						}
					} else {
						$empty_slot = false;
						break;
					}
				}

				if ($empty_slot) {
					mssql_query("INSERT INTO PS_GameData.dbo.UserStoredPointItems (UserUID, Slot, ItemID, ItemCount, BuyDate) VALUES ('{$user_data['UserUID']}','{$empty_slot}','{$item_data['item_id']}','{$item_data['item_count']}','" . date('Y-m-d H:i:s') . "')") or die();
				} else {
					set_msg('No empty slots for items', 'error', $back_url, 'buy_msg_' . $post_data['id']);
				}
			} else {
				$empty_slot = 1;
				mssql_query("INSERT INTO PS_GameData.dbo.UserStoredPointItems (UserUID, Slot, ItemID, ItemCount, BuyDate) VALUES ('{$user_data['UserUID']}','{$empty_slot}','{$item_data['item_id']}','{$item_data['item_count']}','" . date('Y-m-d H:i:s') . "')") or die();
			}
		}
		
		$new_points = $user_data['Point'] - $item_data['item_price'];
		mssql_query("UPDATE PS_UserData.dbo.Users_Master SET Point = '{$new_points}' WHERE UserUID = '{$user_data['UserUID']}'") or die();
		set_msg('Item purchased!', 'success', $back_url, 'buy_msg_' . $post_data['id']);
	} 
	// pack
	else {
		$ex_item_ali = explode(',', $item_data['item_ali']);
		$ex_item_name = explode(',', $item_data['item_name']);
		$ex_item_id = explode(',', $item_data['item_id']);
		$ex_item_count = explode(',', $item_data['item_count']);
		$count = count($ex_item_ali)-1;
		
		$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}'") or die();
		$count_slots = mssql_num_rows($query);
		if ($config['max_slots'] > $count_slots)
			$left_empty_slots = $config['max_slots'] - $count_slots;
		
		if ($left_empty_slots >= $count) {
			for ($e=0;$e<=$count;$e++) {
				if ($ex_item_ali[$e]) {
					for($i=1;$i<=$ex_item_count[$e];$i++) {
						$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}'") or die();
						$s = 0;
						$empty_slot = false;
						if (mssql_num_rows($query) > 0) {
							while ($row = mssql_fetch_array($query)) {
								$s++;

								if ($s <= $config['max_slots']) {
									$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}' AND slot = '{$s}'") or die();
									if (mssql_num_rows($query) <= 0) {
										$empty_slot = $s;
										break;
									}
								} else {
									$empty_slot = false;
									break;
								}
							}
							
							if ($empty_slot) {
								mssql_query("INSERT INTO PS_GameData.dbo.UserStoredPointItems (UserUID, Slot, ItemID, ItemCount, BuyDate) VALUES ('{$user_data['UserUID']}','{$empty_slot}','{$ex_item_id[$e]}','1','" . date('Y-m-d H:i:s') . "')") or die();
							} else {
								set_msg('No empty slots for items', 'error', $back_url, 'buy_msg_' . $post_data['id']);
							}
						} else {
							$empty_slot = 1;
							mssql_query("INSERT INTO PS_GameData.dbo.UserStoredPointItems (UserUID, Slot, ItemID, ItemCount, BuyDate) VALUES ('{$user_data['UserUID']}','{$empty_slot}','{$ex_item_id[$e]}','1','" . date('Y-m-d H:i:s') . "')") or die();
						}
					}
				} else {
					$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}'") or die();
					$s = 0;
					$empty_slot = false;
					if (mssql_num_rows($query) > 0) {
						while ($row = mssql_fetch_array($query)) {
							$s++;
							
							if ($s <= $config['max_slots']) {
								$query = mssql_query("SELECT UserUID FROM PS_GameData.dbo.UserStoredPointItems WHERE UserUID = '{$user_data['UserUID']}' AND slot = '{$s}'") or die();
								if (mssql_num_rows($query) <= 0) {
									$empty_slot = $s;
									break;
								}
							} else {
								$empty_slot = false;
								break;
							}
						}

						if ($empty_slot) {
							mssql_query("INSERT INTO PS_GameData.dbo.UserStoredPointItems (UserUID, Slot, ItemID, ItemCount, BuyDate) VALUES ('{$user_data['UserUID']}','{$empty_slot}','{$ex_item_id[$e]}','{$ex_item_count[$e]}','" . date('Y-m-d H:i:s') . "')") or die();
						} else {
							set_msg('No empty slots for items', 'error', $back_url, 'buy_msg_' . $post_data['id']);
						}
					} else {
						$empty_slot = 1;
						mssql_query("INSERT INTO PS_GameData.dbo.UserStoredPointItems (UserUID, Slot, ItemID, ItemCount, BuyDate) VALUES ('{$user_data['UserUID']}','{$empty_slot}','{$ex_item_id[$e]}','{$ex_item_count[$e]}','" . date('Y-m-d H:i:s') . "')") or die();
					}
				}
			}
		} else{
			set_msg('No empty slots for items', 'error', $back_url, 'buy_msg_' . $post_data['id']);
		}
		
		$new_points = $user_data['Point'] - $item_data['item_price'];
		mssql_query("UPDATE PS_UserData.dbo.Users_Master SET Point = '{$new_points}' WHERE UserUID = '{$user_data['UserUID']}'") or die();
		set_msg('Items pack purchased!', 'success', $back_url, 'buy_msg_' . $post_data['id']);
	}
}
?>
Big_ is offline  
Old 04/01/2015, 11:12   #2
 
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
use a back url is the best way, else u can edit at begin a to static url like
Code:
$back_url = 'store.php';
but this will redirect only to first page.
btw fix your error shouldn't be hard if u show me the error message that u receive and the side where declare back_url .
beetols is offline  
Thanks
1 User
Old 04/01/2015, 21:39   #3
 
elite*gold: 0
Join Date: Jul 2009
Posts: 380
Received Thanks: 85
yeh i might have to make it 1 page so u add all the items to 1 page not septrate ones so i can $backurl = 'cat1'


wanna add my skype big__ben1 with two _ from new zealand in firefox the error is curupt content page shows in crome it just loads and loads and loads and dose nothing when u click buy on a item in IE u just get the stander error page
Big_ is offline  
Old 04/02/2015, 01:13   #4
 
elite*gold: 0
Join Date: Jul 2010
Posts: 523
Received Thanks: 523
The webmall needs several modifications to work properly. Also I recomend to use just the 'pack' section, even if you sell a single item.
And don't use the webmall to create items or packs, make your own page to do it (or create them directly on the DB), 'cause the webmall's edit page has some bugs.
sominus is offline  
Old 04/02/2015, 02:19   #5
 
elite*gold: 0
Join Date: Jul 2009
Posts: 380
Received Thanks: 85
well i got it all working useing only 1 catagory and useing this $back_url = 'index.php?cat=1'; and did sumthign simaler in the admin part for adding and updateing items
Big_ is offline  
Thanks
2 Users
Reply

Tags
web mall


Similar Threads Similar Threads
Shaiya WebMall Problem
11/09/2015 - Shaiya PServer Development - 3 Replies
friends help. I have problem with webmall. When buying the subject says "No empty slots for items" help solve the problem.
WEBmall
01/08/2015 - Shaiya PServer Development - 0 Replies
can anyone me explain how i fixing the webmall...3 items per line not 1 and added packages dont work.please
webmall
07/26/2014 - Shaiya Private Server - 1 Replies
im searching fora webmall for mssql and hp, have anyone this?
Webmall problem
02/04/2014 - Shaiya PServer Development - 0 Replies
Hi epvpers i'll tried install webmall what coded zokylove there items after buying sent to bankteller but i getting same errors everytime Warning: mssql_query() : message: There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. (severity 15) in C:\xampp\htdocs\webmall\system\modules\user\valida tion\validate_buy.php on line 52 Warning:...
WebMall Problem
09/14/2013 - Shaiya Private Server - 0 Replies
Hello , http://i.epvpimg.com/lpP7d.jpg I want to remove those commas which are put between item names when item is more than one (Item Pack). How can I remove those commas and make it only one name as it is in single item add. Like this : http://i.epvpimg.com/UGmBg.jpg



All times are GMT +1. The time now is 03:29.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.