close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Data Assist insert and delete item question

Thread began 6/21/2010 8:34 pm by nick354316 | Last modified 6/25/2010 3:06 pm by nick354316 | 1739 views | 5 replies |

nick354316

Data Assist insert and delete item question

The site that I am building offers seasonal goods, each with their unique item numbers. They will also sometimes run out of an item and have to remove it from the store.

Right now, if an item is temporarily unavailable, my client would go to 'items detail' page and click on the delete button to remove the item from the store. Unfortunately, doing so also removes the item from the database.

When the item becomes available again, the information will have to be added to the database again. That can be a hassle as the information would have to be looked up from an outside source (Excel file, printout, etc.) in order to activate that item again.

It may be beyond the scope of your products, but is there a way to remove the item from the active store, but keep it in the database so it can be added later without having to enter all the information for that item? It would be great if you could disable the item in the store without that item being deleted from the product database, and added at another time just by inserting the unique item number with the rest of the information for that item populated through the information in the database.

Is that possible?

Sign in to reply to this post

Dave BuchholzBeta Tester

Nick add a flag in the database called active (or publish which is what I call mine) and then add a checkbox to the admin page to check or uncheck to show / hide on the main site. You will need to add the check into your sql for the product as well.

Example database table:

CREATE TABLE `tbl_categories` (
`id` int(11) unsigned NOT NULL auto_increment COMMENT 'Primary Key',
`title` tinytext COMMENT 'Name - Max 255 Characters (String)',
`details` text COMMENT 'Description - Max 65,535 Characters (String)',
`image` varchar(100) default NULL COMMENT 'Image File - Max 100 Characters (Fixed Length)',
`publish` tinyint(1) NOT NULL default '0' COMMENT 'Publish Option (0 = Unpublished, 1 = Published)',
`tstampinsert` int(11) unsigned default NULL COMMENT 'Insert Timestamp use <?php echo time(); ?> in a hidden field in your form',
`tstampupdate` int(11) unsigned default NULL COMMENT 'Update Timestamp use <?php echo time(); ?> in a hidden field in your form',
`url` tinytext COMMENT 'URL Parameter for Mod Rewrite - Max 255 Characters (String)',
`dateinsert` date default NULL,
`dateupdate` date default NULL,
PRIMARY KEY (`id`),
FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `details` (`details`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8



and in your sql you would have something like:

SELECT tbl_categories.title AS category, tbl_categories.details, tbl_categories.image FROM  tbl_categories WHERE tbl_categories.publish = 1



screenshot of the relevant part a typical admin panel that I build is attached.

Hope that helps you get going.

attachment.php?attachmentid=4085&stc=1&d=1277196593

Sign in to reply to this post

nick354316

Data Assist insert and delete item question

Hi Dave - Just an update. Thank you for your help on this, but I am pretty much totally lost on this. It emphasizes the fact that I am a designer and not a programmer. I was easily able to import the table that you provided, but I have no idea what to do with the other code, or what I need to do to bind the publish buttons to the values in the database. I'm not sure if it is within the scope of your support to help any further, but any additional help you could provide would be appreciated.

Sign in to reply to this post

Dave BuchholzBeta Tester

Nick,

You can use the DataAssist Wizard to control the inserts & updates but you would need to add the new form fields and bindings yourself.

If need help to modify your database and admin panel it might be worth posting a request in the Jobs Forum if you have a budget for this.

Sign in to reply to this post

CraigRBeta Tester

Nick,

as Dave suggests, this is quite a common thing and it has been raised in the forums before

Once you get your head around it, you shouldn't find it too difficult.

here is a link to an earlier post which may help.

showthread.php?t=13433

Sign in to reply to this post

nick354316

Data Assist insert and delete item question

Hi Dave - Yeah, I thought it was beyond what the the scope of tech responsibility, and to underscore, thanks for going the extra mile on this for me. You have clarified it a little more for me, and at a glance, CraigR's link looks like it goes into greater detail. Many thanks to you, Craig, for the link. Your taking the time to help is really appreciated.

And now irony plays a part. Had I not bought the Suite of extensions and addons, and spent countless (I can't bear to count them), lost revenue hours trying to work through developing what I am sure is a very simple PHP based site, I most certainly would have had the budget to hire someone from the Jobs Forum. And, if I factor in my time, I would have come out far ahead to have just had someone do the entire site for me. And if you factor in the adverse effect that missing my deadlines for this job has had on my reputation... well, I prefer not to think about it. Live and learn. And, just so it is clear, I am not blaming anyone but myself. I should have looked more deeply through the forums, and the all too similar reviews prior to making my purchases. End of venting.

Just to be perfectly clear, I am sincerely grateful for all your help. I would have been far more lost than I presently am without it. At least now, with your help, I can anticipate the end of the project.

One thing about the logic of the original question: If you are building a site for a client with a rotating stock of the same items, it would just seem logical that you would have the capability to remove an item from the store without destroying that information in their database, thereby requiring them to look up and enter, once again, the information from an outside source.

Your solution with the 'Published, not Published' or 'Private, not Private' option seems like it would be both a simple and logical one for WebAssist to incorporate into the DataAssist Wizard. My lack of programming knowledge doesn't prevent me from understanding the benefit that would provide the users of your product and in so doing, increasing the appeal of the WebAssist extensions.

I am sure there is a wishlist for items like this, however, at the moment, I don't have the time to look for it. Maybe when this seemingly endless job is over, I'll look for it (hmm. Sounds like more frustration fighting through) and enter it there.

So, to sum up, your efforts to help me are appreciated at a level that I cannot presently convey, so all I can say is thank you for all your help.

I'll let you know if the information at the link that Craig provided will help resolve the problem for me.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...