Cash ShopYou have Coins

Here you can buy some special items for Athens Fiesta Coins. If you run out of coins you can buy more using form below.

'.$category['name'].'See all'; // Select top 4 items from this category $selectItems = mssql_query( "SELECT TOP 3 * FROM Account..tItem WHERE category = ".$category['category']." AND isSell = 'True' ORDER BY registerDate DESC;" ); echo ''; while ( $item = mssql_fetch_array( $selectItems ) ) { if ( $item['imageName'] == NULL ) $item['imageName'] = "NONE"; echo ''; } echo ''; echo '

['.$item['unit'].'x] '.$item['name'].'


'; if($item['price'] == 0) echo 'Free'; else echo $item['price'].' Gold'; // echo '

'; } } elseif ( $itemViewID != 0 ) { $selectItemInfo = mssql_query( "SELECT * FROM Account..tItem WHERE goodsNo = $itemViewID AND isSell = 'True';" ); if ( mssql_num_rows( $selectItemInfo ) == 1 ) { $item = mssql_fetch_array( $selectItemInfo ); $selectCategoryName = mssql_query( "SELECT name FROM Account..tItemCategory WHERE category = (SELECT category FROM Account..tItem WHERE goodsNo = $itemViewID);" ); if ( $item['imageName'] == NULL ) $item['imageName'] = "NONE"; echo '

['.$item['unit'].'x] '.$item['name'].''.mssql_result( $selectCategoryName, 0, 0 ).'

'; echo '

'; if($item['price'] == 0) echo 'Free'; else echo $item['price'].' Gold'; echo '
'.$item['description'].'
'; echo '
'; echo '
'; echo '
'; if ( $_POST['Buy'] ) { // First check if user has enought points $selectPoints = mssql_query( "SELECT * FROM Account..tCash WHERE userNo = '".$_SESSION['userID']."' AND cashtype = '0';" ); if ( mssql_result( $selectPoints, 0, 2 ) >= $item['price'] ) { $newCash = ( mssql_result( $selectPoints, 0, 2 ) - $item['price'] ); $changePoints = mssql_query( "UPDATE Account..tCash SET cash = ".$newCash." WHERE userNo = ".$_SESSION['userID']." AND cashtype = 0;" ); if ( $changePoints ) { $insertItem = mssql_query( "INSERT INTO Account..tChargeItem(userNo, goodsNo) VALUES(".$_SESSION['userID'].",".$item['groupNo'].");" ); if ( $insertItem ) { showMessage( 'success', 'Item has been purchased' ); } else { showMessage( 'error', 'Internal item purchase error' ); } } else { showMessage( 'error', 'Internal item error' ); } } else { showMessage( 'error', 'You do not have enought coins.' ); } } } else { showMessage( 'error', 'Item not found!' ); } } else { $selectCategory = mssql_query( "SELECT name FROM Account..tItemCategory WHERE category = '$catID' AND status = 'True';" ); if ( mssql_num_rows( $selectCategory ) == 1 ) { // Select sub-categories $selectSubCategories = mssql_query( "SELECT * FROM Account..tItemCategory WHERE parent = '$catID' AND status = 'True';" ); if ( mssql_num_rows( $selectSubCategories ) > 0 ) { while ( $category = mssql_fetch_array( $selectSubCategories ) ) { echo '

'.$category['name'].'See all

'; // Select top 4 items from this category $selectItems = mssql_query( "SELECT TOP 3 * FROM Account..tItem WHERE category = ".$category['category']." AND isSell = 'True' ORDER BY registerDate DESC;" ); echo ''; while ( $item = mssql_fetch_array( $selectItems ) ) { if ( $item['imageName'] == NULL ) $item['imageName'] = "NONE"; echo ''; } echo ''; echo '

['.$item['unit'].'x] '.$item['name'].'


'; if($item['price'] == 0) echo 'Free'; else echo $item['price'].' Gold'; echo '

'; } } // Select Items in Category/Subcategory $selectCategoryItems = mssql_query( "SELECT * FROM Account..tItem WHERE category = '$catID' AND isSell = 'True' ORDER BY registerDate DESC;" ); echo '

'.mssql_result( $selectCategory, 0, 0 ).'Cash Shop Home Page

'; if ( mssql_num_rows( $selectCategoryItems ) > 0 ) { $column = 1; echo ''; while ( $item = mssql_fetch_array( $selectCategoryItems ) ) { if ( $item['imageName'] == NULL ) $item['imageName'] = "NONE"; if ( $column == 1 ) { echo ''; } $column++; echo ''; if ( $column == 4 ) { echo ''; $column = 1; } } echo '

['.$item['unit'].'x] '.$item['name'].'


'; if($item['price'] == 0) // echo 'Free'; else echo $item['price'].' Gold'; echo '
'; } else { showMessage( 'info', 'There are no items in this category.' ); } } else { showMessage( 'error', 'Category not found' ); } } } else { showMessage( 'info', 'Cash Shop is currently offline for technical work.
Please visit Cash Shop sometime later' ); } } else { if ( isset( $_POST['Login'] ) ) { $username = mssql_escape_string( $_POST['username'] ); $password = mssql_escape_string( $_POST['password'] ); $mssql_link = @mssql_connect( '.\SQLEXPRESS', 'sa', 'Password' ); if ( !$mssql_link ) { showMessage( 'info', 'Registration is temporarly offline' ); } else { $checkUser = mssql_query( "SELECT nUserNo FROM Account..tUser WHERE sUserID = '$username' AND sUserPW = '$password';" ); if ( mssql_num_rows( $checkUser ) == 1 ) { $userInfo = mssql_fetch_array( $checkUser ); $_SESSION['userID'] = $userInfo[0]; $_SESSION['logged_in'] = true; showMessage( 'success', 'You are logged in!', 3, 'index.php?module=mall' ); } else { showMessage( 'error', 'Wrong username and/or password!' ); } } } else { echo '
Username: Password:
'; } } } ?>