[Release]Full working webmall

02/21/2013 10:24 cok28rus#76
This fix does not work
02/21/2013 11:07 nephren#77
:rolleyes: would you please start a new Thread in here: [Only registered and activated users can see links. Click Here To Register...]
and describe your problem with 'bank' a bit more ?
03/02/2013 01:04 karakas1997#78
after the purchase of the item where you come from?
03/02/2013 01:52 nephren#79
It is in your GiftBox
03/08/2013 21:17 sominus#80
Hi, I have this problem when I try to make a Items Pack:

By default you get the form to add 2 items to that Pack, but, there's a "Add 1" button to the right, that lets you add another input box so that way you can add more and more items to that pack, right? So far it works.

But if I use the Add 1 button, to add more than 2 items in the pack, I get the "Bad ItemID" error, and I'm sure every ItemID I put is correct and do exist in my DB (Eg: ItemID: 30252, wich is a special lapis).

So, I can make Packs with 2 items in them, but can't make Packs with 3 or more items in them, because I get that "Bad ItemID" error when I try to insert the 3rd item.

Now if I put just 2 items, the Pack is created OK.

Any help or hint on that?

(sorry for my english)
03/14/2013 18:01 cypherxxl#81
Same Problem here.

Cannot create Item Packs grater than 2 items.
03/15/2013 02:11 treica#82
I found a way to make it allow you to input more items on a pack this is allowing you up to 5 items to add if your looking better you will see what to edit if you want to add more columns or less because on the adding 1 column button is bugged and is copying the data from the third column to the second and that's why ur getting bad item ID.

Change this one with urs from webmall/system/modules/admin/ "shop_items.php" and you will be allowed to add 5 items on the pack.


PHP Code:
<?php
    
    $ex_item_name 
'';
    
$ex_item_id '';
    
$ex_item_count '';
    
$ex_item_ali '';
    
    if (
get_url_param('edit')) {
        
$query mysql_query("SELECT * FROM donate_items WHERE id = '" get_url_param('edit') . "'");
        
$data mysql_fetch_array($query);
    }
    
    
$_page = (get_url_param('page')) ? '&page=' get_url_param('page') : '';
    
    
$current_url base64_decode(back_url());
    
    if (
get_url_param('more_item')) {
        
$new_more get_url_param('more_item') + 1;
        
$new_more_minus = (get_url_param('more_item') > 0) ? get_url_param('more_item') - get_url_param('more_item');
        
$_more_item_url str_replace('more_item=' get_url_param('more_item'), 'more_item=' $new_more$current_url);
        
$_more_item_url_remove str_replace('more_item=' get_url_param('more_item'), 'more_item=' $new_more_minus$current_url);
    } else {
        
$_more_item_url $current_url '&more_item=1';
        
$_more_item_url_remove $current_url;
    }
?>
<fieldset class='add_item_box'>
    <?php
        $add_type 
= array('one' => 'Add item''pack' => 'Add item pack');
        
$i 0;
        
$count count($add_type);
        foreach (
$add_type as $key => $val) {
            if (
get_url_param('action')) { if (get_url_param('action') == $key$selected "selected"; else $selected ""; } else $selected "";
            
            if (
$i == && !get_url_param('action'))
                echo 
"<div class='add_item_box_title selected_first'><a href='{$config['home_url']}/admin.php?do=shop_items&action={$key}{$_page}'>{$val}</a></div>";
            else
                echo 
"<div class='add_item_box_title {$selected}'><a href='{$config['home_url']}/admin.php?do=shop_items&action={$key}{$_page}'>{$val}</a></div>";
            
            
$i++;
        }
    
?>
    <div class='clear'></div>

    <?php 
        
// not pack
        
if (get_url_param('action') == 'one' || !get_url_param('action')) { 
    
?>
    <form action='<?php echo $config['home_url']; ?>/admin.php?validate=item' method='post'>
        <input type='hidden' name='back_path' value='<?php echo back_url(); ?>' />
        
        <?php
            
if (!get_url_param('edit')) {
                echo 
"<input type='hidden' name='add_item' value='1' />";
            } else {
                echo 
"<input type='hidden' name='edit_item' value='1' />";
                echo 
"<input type='hidden' name='edit_id' value='{$data['id']}' />";
            }
        
?>
        
        <input type='hidden' name='type' value='one' />
        
        <table style='margin-left: 10px; margin-top: 10px; width: 90%;'>
            <tr>
                <td style='width: 100px;'>Item name <input type='text' name='item_name' class='text' value='<?php if (isset($data['item_name'])) echo $data['item_name']; else echo read_session('item_name'); ?>' /></td>
                <td style='width: 100px;'>Item id <input type='text' name='item_id' class='text' value='<?php if (isset($data['item_id'])) echo $data['item_id']; else echo read_session('item_id'); ?>' /></td>
                <td style='width: 100px;'>Item price <input type='text' name='item_price' class='text' value='<?php if (isset($data['item_price'])) echo $data['item_price']; else echo read_session('item_price'); ?>' /></td>
                <td style='width: 100px;'>Item count <input type='text' name='item_count' class='text' value='<?php if (isset($data['item_count'])) echo $data['item_count']; else echo read_session('item_count'); ?>' /></td>
                <td style='width: 60px;'>ALI <select name='item_ali' class='select'>
                    <?php
                        $des 
= array('Off''On');
                        foreach (
$des as $key => $value) {
                            if (isset(
$data)) { 
                                if (
$key == $data['item_ali']) $selected "selected='selected'"; else $selected ""
                            } else { 
                                if (
read_session('item_ali') && $key == read_session('item_ali')) $selected "selected='selected'"; else $selected ""
                            }
                            
                            echo 
"<option value='{$key}{$selected}>{$value}</option>"
                        }
                    
?>
                </select></td>
            </tr>
            
            <tr>
                <td>Category <br /> <select name='item_cat' class='select' style='width: 158px;'>
                        <?php
                            
foreach ($items_cats as $key => $value) {
                                if (isset(
$data)) { 
                                    if (
$key == $data['item_cat']) $selected "selected='selected'"; else $selected ""
                                } else { 
                                    if (
read_session('item_cat') && $key == read_session('item_cat')) $selected "selected='selected'"; else $selected ""
                                }
                            
                                echo 
"<option value='{$key}{$selected}>{$value}</option>";
                            }
                        
?>
                    </select>
                </td>
                
                <td>Image <br /> <input type='text' name='item_image' class='text' value='<?php if (isset($data['item_image'])) echo $data['item_image']; else echo read_session('item_image'); ?>'/>
                </td>
            </tr>
        </table>
        
        <div class='item_submit_button'>
            <input type='submit' name='item' class='button green' value='<?php echo (isset($data)) ? 'Update item' 'Add item'?>' />
        </div>
    </form>
    
    <?php echo get_msg('item_msg''width: 720px; margin-top: 10px; margin-bottom: -5px; margin-left: 10px;'); ?>
    <?php 
    
// pack
    
else { ?>
    <form action='<?php echo $config['home_url']; ?>/admin.php?validate=item' method='post'>
        <input type='hidden' name='back_path' value='<?php echo back_url(); ?>' />
        
        <?php
            
if (!get_url_param('edit')) {
                echo 
"<input type='hidden' name='add_item' value='1' />";
            } else {
                echo 
"<input type='hidden' name='edit_item' value='1' />";
                echo 
"<input type='hidden' name='edit_id' value='{$data['id']}' />";
                
                
$ex_item_name explode(','$data['item_name']);
                
$ex_item_id explode(','$data['item_id']);
                
$ex_item_count explode(','$data['item_count']);
                
$ex_item_ali explode(','$data['item_ali']);
            }
        
?>
        
        <input type='hidden' name='type' value='pack' />
        <input type='hidden' name='items_count' value='<?php echo get_url_param('more_item') + 2?>' />
        
        <table style='margin-left: 10px; margin-top: 10px; width: 70%;'>
            <tr>
                <td style='width: 100px;'>Item name <br /> <input type='text' name='item_name_1' class='text' value='<?php if (isset($ex_item_name[0])) echo $ex_item_name[0]; else echo read_session('item_name_1'); ?>' /></td>
                <td style='width: 100px;'>Item id <br /> <input type='text' name='item_id_1' class='text' value='<?php if (isset($ex_item_id[0])) echo $ex_item_id[0]; else echo read_session('item_id_1'); ?>' /></td>
                <td style='width: 100px;'>Item count <br /> <input type='text' name='item_count_1' class='text' value='<?php if (isset($ex_item_count[0])) echo $ex_item_count[0]; else echo read_session('item_count_1'); ?>' /></td>
                <td style='width: 50px;'>ALI <br /> <select name='item_ali_1' class='select'>
                    <?php
                        $des 
= array('Off''On');
                        foreach (
$des as $key => $value) {
                            if (isset(
$ex_item_ali[0])) { 
                                if (
$key == $ex_item_ali[0]) $selected "selected='selected'"; else $selected ""
                            } else { 
                                if (
read_session('item_ali_1') && $key == read_session('item_ali_1')) $selected "selected='selected'"; else $selected ""
                            }
                            
                            echo 
"<option value='{$key}{$selected}>{$value}</option>"
                        }
                    
?>
                </select></td>
            </tr>
            
            [color=red]<tr>
                <td style='width: 100px;'>Item name <br /> <input type='text' name='item_name_1' class='text' value='<?php if (isset($ex_item_name[0])) echo $ex_item_name[0]; else echo read_session('item_name_1'); ?>' /></td>
                <td style='width: 100px;'>Item id <br /> <input type='text' name='item_id_1' class='text' value='<?php if (isset($ex_item_id[0])) echo $ex_item_id[0]; else echo read_session('item_id_1'); ?>' /></td>
                <td style='width: 100px;'>Item count <br /> <input type='text' name='item_count_1' class='text' value='<?php if (isset($ex_item_count[0])) echo $ex_item_count[0]; else echo read_session('item_count_1'); ?>' /></td>
                <td style='width: 50px;'>ALI <br /> <select name='item_ali_1' class='select'>
                    <?php
                        $des 
= array('Off''On');
                        foreach (
$des as $key => $value) {
                            if (isset(
$ex_item_ali[0])) { 
                                if (
$key == $ex_item_ali[0]) $selected "selected='selected'"; else $selected ""
                            } else { 
                                if (
read_session('item_ali_1') && $key == read_session('item_ali_1')) $selected "selected='selected'"; else $selected ""
                            }
                            
                            echo 
"<option value='{$key}{$selected}>{$value}</option>"
                        }
                    
?>
                </select></td>
            </tr>[/color]
            
            <tr>
                <td style='width: 100px;'>Item name <br /> <input type='text' name='item_name_1' class='text' value='<?php if (isset($ex_item_name[0])) echo $ex_item_name[0]; else echo read_session('item_name_1'); ?>' /></td>
                <td style='width: 100px;'>Item id <br /> <input type='text' name='item_id_1' class='text' value='<?php if (isset($ex_item_id[0])) echo $ex_item_id[0]; else echo read_session('item_id_1'); ?>' /></td>
                <td style='width: 100px;'>Item count <br /> <input type='text' name='item_count_1' class='text' value='<?php if (isset($ex_item_count[0])) echo $ex_item_count[0]; else echo read_session('item_count_1'); ?>' /></td>
                <td style='width: 50px;'>ALI <br /> <select name='item_ali_1' class='select'>
                    <?php
                        $des 
= array('Off''On');
                        foreach (
$des as $key => $value) {
                            if (isset(
$ex_item_ali[0])) { 
                                if (
$key == $ex_item_ali[0]) $selected "selected='selected'"; else $selected ""
                            } else { 
                                if (
read_session('item_ali_1') && $key == read_session('item_ali_1')) $selected "selected='selected'"; else $selected ""
                            }
                            
                            echo 
"<option value='{$key}{$selected}>{$value}</option>"
                        }
                    
?>
                </select></td>
            </tr>
            
            <tr>
                <td style='width: 100px;'>Item name <br /> <input type='text' name='item_name_1' class='text' value='<?php if (isset($ex_item_name[0])) echo $ex_item_name[0]; else echo read_session('item_name_1'); ?>' /></td>
                <td style='width: 100px;'>Item id <br /> <input type='text' name='item_id_1' class='text' value='<?php if (isset($ex_item_id[0])) echo $ex_item_id[0]; else echo read_session('item_id_1'); ?>' /></td>
                <td style='width: 100px;'>Item count <br /> <input type='text' name='item_count_1' class='text' value='<?php if (isset($ex_item_count[0])) echo $ex_item_count[0]; else echo read_session('item_count_1'); ?>' /></td>
                <td style='width: 50px;'>ALI <br /> <select name='item_ali_1' class='select'>
                    <?php
                        $des 
= array('Off''On');
                        foreach (
$des as $key => $value) {
                            if (isset(
$ex_item_ali[0])) { 
                                if (
$key == $ex_item_ali[0]) $selected "selected='selected'"; else $selected ""
                            } else { 
                                if (
read_session('item_ali_1') && $key == read_session('item_ali_1')) $selected "selected='selected'"; else $selected ""
                            }
                            
                            echo 
"<option value='{$key}{$selected}>{$value}</option>"
                        }
                    
?>
                </select></td>
            </tr>
            
            <tr>
                <td style='width: 100px;'>Item name <br /> <input type='text' name='item_name_2' class='text' value='<?php if (isset($ex_item_name[1])) echo $ex_item_name[1]; else echo read_session('item_name_2'); ?>' /></td>
                <td style='width: 100px;'>Item id <br /> <input type='text' name='item_id_2' class='text' value='<?php if (isset($ex_item_id[1])) echo $ex_item_id[1]; else echo read_session('item_id_2'); ?>' /></td>
                <td style='width: 100px;'>Item count <br /> <input type='text' name='item_count_2' class='text' value='<?php if (isset($ex_item_count[1])) echo $ex_item_count[1]; else echo read_session('item_count_2'); ?>' /></td>
                <td style='width: 50px;'>ALI <br /> <select name='item_ali_2' class='select'>
                    <?php
                        $des 
= array('Off''On');
                        foreach (
$des as $key => $value) {
                            if (isset(
$ex_item_ali[1])) { 
                                if (
$key == $ex_item_ali[1]) $selected "selected='selected'"; else $selected ""
                            } else { 
                                if (
read_session('item_ali_2') && $key == read_session('item_ali_2')) $selected "selected='selected'"; else $selected ""
                            }
                            
                            echo 
"<option value='{$key}{$selected}>{$value}</option>"
                        }
                    
?>
                </select></td>
            </tr>
            
            <?php if (get_url_param('more_item')) echo more_items(get_url_param('more_item'), $ex_item_name$ex_item_id$ex_item_count$ex_item_ali); ?>
            
            <tr>
                <td>Pack category <br /> <select name='item_cat' class='select' style='width: 158px;'>
                        <?php
                            
foreach ($items_cats as $key => $value) {
                                if (isset(
$data)) { 
                                    if (
$key == $data['item_cat']) $selected "selected='selected'"; else $selected ""
                                } else { 
                                    if (
read_session('item_cat') && $key == read_session('item_cat')) $selected "selected='selected'"; else $selected ""
                                }
                            
                                echo 
"<option value='{$key}{$selected}>{$value}</option>";
                            }
                        
?>
                    </select>
                </td>
                
                <td>Pack image <br /> <input type='text' name='item_image' class='text' value='<?php if (isset($data['item_image'])) echo $data['item_image']; else echo read_session('item_image'); ?>'/>
                </td>
                
                <td>Pack price <br /> <input type='text' name='item_price' class='text' value='<?php if (isset($data['item_price'])) echo $data['item_price']; else echo read_session('item_price'); ?>'/>
                </td>
            </tr>
        </table>
        
        <div class='item_submit_button'>
            <input type='submit' name='item' class='button green' value='<?php echo (isset($data)) ? 'Update item pack' 'Add item pack'?>' />
            <input type='button' name='item' class='button green' onclick="location.href='<?php echo $_more_item_url?>'" value='Add 1' />
            <input type='button' name='item' class='button green' onclick="location.href='<?php echo $_more_item_url_remove?>'" value='Remove 1' />
        </div>
    </form>
    
    <?php echo get_msg('item_msg''width: 570px; margin-top: 10px; margin-bottom: -5px; margin-left: 10px;'); ?>
    <?php ?>
</fieldset>

<div class='added_items_box'>
    <?php
    
        $query 
mysql_query("SELECT * FROM donate_items");
        
$Num_Rows mysql_num_rows($query);

        
$page = (isset($_GET['page'])) ? $_GET['page'] : '';

        
$Per_Page 10;

        
$pagination = new Pagination();
        
$pagination->setLink("admin.php?do=shop_items&page=%s");
        
$pagination->setPage($page);
        
$pagination->setSize($Per_Page);
        
$pagination->setTotalRecords($Num_Rows);
        
        
$query mysql_query("SELECT * FROM donate_items " $pagination->getLimitSql()) or die(mysql_error());
        
        if (
$Num_Rows 0) {
    
    
?>
    <table class='added_items_table' style='width: 100%; text-align: center;'>
        <tr>
            <td style='font-weight: bold;'>Name</td>
            <td style='font-weight: bold;'>ID</td>
            <td style='font-weight: bold;'>Price</td>
            <td style='font-weight: bold;'>Count</td>
            <td style='font-weight: bold;'>Category</td>
            <td style='font-weight: bold;'>Type</td>
            <td style='font-weight: bold;'>Image name</td>
            <td style='font-weight: bold;'>#</td>
            <td style='font-weight: bold;'>#</td>
        </tr>
        
        <?php  
            $row 
= array();
                while(
$row mysql_fetch_array($query)) {
                
                    
$ali_status = ($row['item_ali'] == 1) ? "On" "Off";
                    
$action = ($row['item_pack'] != 0) ? "pack" "one";
                    
$image = ($row['item_image']) ? $row['item_image'] : "no image";
                    
                    if (
$row['item_pack'] != 0) {
                        
$ex_item_name explode(','$row['item_name']);
                        
$pack_count count($ex_item_name) - 3;
                        if (
$pack_count == || $pack_count == 0) {
                            
$pack_count 0;
                        }
                        
                        echo 
"<tr class='tr_hover'>
                            <td><a href='#' title='
{$row['item_name']}'>Informacija</a></td>
                            <td><a href='#' title='
{$row['item_id']}'>Informacija</a></td>
                            <td>
{$row['item_price']}</td>
                            <td><a href='#' title='
{$row['item_count']}'>Informacija</a></td>
                            <td>
{$items_cats[$row['item_cat']]}</td>
                            <td>
{$action}</td>
                            <td>
{$image}</td>
                            <td><a href='
{$config['home_url']}/admin.php?do=shop_items{$_page}&edit={$row['id']}&action={$action}&more_item={$pack_count}'>Edit</a></td>
                            <td><a href='
{$config['home_url']}/admin.php?do=delete&id={$row['id']}&back=" back_url() . "' style='color: red;'>Delete</a></td>
                        </tr>"
;
                    } else {
                        echo 
"<tr class='tr_hover'>
                            <td>
{$row['item_name']}</td>
                            <td>
{$row['item_id']}</td>
                            <td>
{$row['item_price']}</td>
                            <td>
{$row['item_count']}</td>
                            <td>
{$items_cats[$row['item_cat']]}</td>
                            <td>
{$action}</td>
                            <td>
{$image}</td>
                            <td><a href='
{$config['home_url']}/admin.php?do=shop_items{$_page}&edit={$row['id']}&action={$action}'>Edit</a></td>
                            <td><a href='
{$config['home_url']}/admin.php?do=delete&id={$row['id']}&back=" back_url() . "' style='color: red;'>Delete</a></td>
                        </tr>"
;
                    }
                }
                
            echo 
"</table>";
            } else {
                echo 
"No items";
            }
            
            
$pagination $pagination->create_links();
            
            if (!empty(
$pagination)) {
                echo 
$pagination;
            }
        
?>
        <div class='clear'>
</div>
if you want to add a column add this between </tr> <tr> tags or to remove a column between <tr> to </tr>
this is what you need to add for a column

PHP Code:
<tr>
                <td style='width: 100px;'>Item name <input type='text' name='item_name' class='text' value='<?php if (isset($data['item_name'])) echo $data['item_name']; else echo read_session('item_name'); ?>' /></td>
                <td style='width: 100px;'>Item id <input type='text' name='item_id' class='text' value='<?php if (isset($data['item_id'])) echo $data['item_id']; else echo read_session('item_id'); ?>' /></td>
                <td style='width: 100px;'>Item price <input type='text' name='item_price' class='text' value='<?php if (isset($data['item_price'])) echo $data['item_price']; else echo read_session('item_price'); ?>' /></td>
                <td style='width: 100px;'>Item count <input type='text' name='item_count' class='text' value='<?php if (isset($data['item_count'])) echo $data['item_count']; else echo read_session('item_count'); ?>' /></td>
                <td style='width: 60px;'>ALI <select name='item_ali' class='select'>
                    <?php
                        $des 
= array('Off''On');
                        foreach (
$des as $key => $value) {
                            if (isset(
$data)) { 
                                if (
$key == $data['item_ali']) $selected "selected='selected'"; else $selected ""
                            } else { 
                                if (
read_session('item_ali') && $key == read_session('item_ali')) $selected "selected='selected'"; else $selected ""
                            }
                            
                            echo 
"<option value='{$key}{$selected}>{$value}</option>"
                        }
                    
?>
                </select></td>
            </tr>
Regards.
03/15/2013 11:15 cypherxxl#83
Thank you, but this dont works.

The Items will be marked as okay, so no =Bad Item ID

But...
There are 2 Items only in the database.

Maybe any1 have an email address of the Creator of this Script?
05/29/2013 03:30 GM.Triest#84
Perhaps an old topic, I know, but I just wanted to know why the script keeps telling me " Image not exists "
Could you tell me how to re-route the script to get into the user/images/shop_icons folder?
Thanks!
Also, I rewrote the script in odbc for those whose MSSQL / MYSQL doesn't work. If interested, please pm me. Thanks!
05/29/2013 21:01 Sh1nra#85
you need to enter the image name..

exampe: 47.png
05/30/2013 00:17 GM.Triest#86
Silly mistake. Thanks!

P.S. The query on the original file doesn't work.
This one does
Code:
USE [webmall]
GO
/****** Object:  Table [dbo].[donate_items]    Script Date: 05/29/2013 15:57:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[donate_items](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[item_name] [varchar](255) NOT NULL,
	[item_price] [int] NOT NULL,
	[item_count] [varchar](255) NOT NULL,
	[item_id] [varchar](255) NOT NULL,
	[item_ali] [varchar](255) NOT NULL,
	[item_cat] [int] NOT NULL,
	[item_pack] [int] NOT NULL,
	[item_image] [varchar](255) NOT NULL,
 CONSTRAINT [PK_donate_items] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
New error. It keeps giving me " Please fill in all fields " whenever I try to buy something.
05/30/2013 15:08 PrinciCh#87
Hi i Post next Time my Web mall full work :)
07/10/2013 12:53 IonutTheDawg#88
Quote:
Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\webmall\core.php on line 17
how can i fix thiiis :[
07/10/2013 20:33 GM.Triest#89
Your xampp / php version may not support the mssql format thing. Instead, try installing an older copy of xampp. (Example: Xampp 1.7.0 )
07/16/2013 14:10 treica#90
This script works perfect under Xampp 1.7.3 (older and newer versions not!) or other programs like wamp etc.. sincerely i never had a problem with it since i got the script also i have used it on a live server and everything run smoothly.