Showing a Cell in an HTML document

I have a number of tables that I want to show (see attached).  Everything but the pricing is static.  The owner of the site wants to be able to change pricing.  Ideally, I'd setup a Google Spreadsheet so that she can go in and change the prices, then somehow the prices are imported from the spreadsheet when the page loads via some kind of script... but I have no idea how to do that, nor am I having any kind of luck figuring out how.

Another possible solution would be to keep the price list in a text document, then when the page loads, it looks at those prices and puts them in their respective spots.  But again, I'm not sure how to make that happen and my Google fu isn't helping me here.

Do you have any ideas?
LVL 1
Azra LyndseyNerdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
Nothing attached.  What you're talking about is normally done with a database.  But then you have to write an Admin page where the user can login and edit the values.
0
Alexandre SimõesManager / Technology SpecialistCommented:
You want to do it from where, javascript or server-side?

From javascript I found this lib that looks good:
https://github.com/mikeymckay/google-spreadsheet-javascript

and here's a sample:
http://mikeymckay.github.io/google-spreadsheet-javascript/sample.html
0
Alexandre SimõesManager / Technology SpecialistCommented:
I'm not a PHP guy but this looks like a good option if you want to do it from your server:
https://github.com/asimlqt/php-google-spreadsheet-client
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Ray PaseurCommented:
...prices are imported from the spreadsheet when the page loads via some kind of script... but I have no idea how to do that...
Typically this sort of thing is done by keeping the product and pricing information in a data base.  The magic term is "table maintenance script."  The archetype table maintenance script is phpMyAdmin which allows the client to manipulate data base information on the server.  You would need a very small subset of its capabilities.

The general "meets-minimum" design would include these scripts:

1. A script that lists the products and prices.  Each line of the list is a hyperlink to a script that displays one product.  The product key is a URL parameter for the other scripts.

2. A script that displays one product.  It would use the key to locate the data base record and would copy the information out of the data base into the fields of an HTML form.  The client can change the contents of the form, then submit the form.

3. A script that uses the form information to update one product.  It would simply take the contents of the POST-request from the HTML form and replace all of the data base fields with an UPDATE query, using a WHERE clause that contained the key.

4. A script that adds products and prices.  Like #2, it would present the client a form, but the form would be empty and the key would be zero.  In this case, the #3 script would recognize the zero key and would INSERT a new row instead of doing an UPDATE to an existing row.

If you're new to web application development, you might want to hire a professional developer for this part of the work.  There are many ways to get it all wrong, and a professional developer will know how to avoid the risks.  If you want to learn how to do this sort of thing yourself, this article will help you get started.  I would especially recommend the Welling/Thompson book.  A month of study with that book will put you on firm ground to complete the task accurately and securely.

Best of luck with it, and if you want to post the thing that was supposed to be attached, I'll be glad to have a look. ~Ray
0
Alexandre SimõesManager / Technology SpecialistCommented:
Well @Ray_Paseur, you're kind of right but I see no harm on having the client update he's products based on a spreadsheet... being it from google or directly by importing an excel file.

This is a common practice that just works, specially with customers less at ease with technology. In fact, most eCommerce solutions implement this feature of manipulating batch data on excel files. It's much faster than having to edit the products one by one.

...you might want to hire a professional developer for this part of the work... There are many ways to get it all wrong...
This is also true, but won't prevent anyone to end up with a mess :)
The IT world would be so much better if this "pick a professional" was that easy.
0
Ray PaseurCommented:
... faster than having to edit the products one by one
Of course!  And that's why I wrote, "general 'meets-minimum' design."  

I have nothing against spreadsheets or Excel.  And it's certainly possible to write a PHP script that exposes all of the data elements at the same time, add AJAX support and pagination, etc.  It's possible to write a PHP script that will consume and XLS or XLSX file (although CSV is more commonly used when PHP and Excel need to communicate).  But I think that level of technological integration may be a bit out of reach for our Author of this question.  

I was keying off this in the original question: "... somehow the prices are imported ... but I have no idea ..."  From where I sit that isn't a question that has an answer; it's more of a plea for help.  Which is why a professional programmer might be a valuable addition to the team.
0
Dave BaldwinFixer of ProblemsCommented:
It appears that @xioc who asked the question isn't going to participate by giving us any response to our suggestions.  But, especially since I do this kind of PHP programming all the time, I agree with Ray.  His suggestions are expanded versions of my initial comment.
0
Azra LyndseyNerdAuthor Commented:
This led us to our eventual answer, which was to use the Google API.  Thanks for the answer, and thank you everybody else for playing.  Good answers all around this time.

Cheers,
Z
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.