PDA

View Full Version : Looking for....



Frog Brew
03-12-2007, 03:41 PM
I really need help here. Going to pull out my hair soon because I simply can't grasp what you guys can. I have someone who wants me to do a collectors site.

They want the end user to be able to check off what they already have and have it calculate the value.

Let's say it's hockey cards.

*picture of hockey card 1* 20.00$ radial button (this one checked off)
*picture of hockey card 2* 10.00$ radial button
*picture of hockey card 3* 5.00$ radial button (this one checked off)
*picture of hockey card 4* 30.00$ radial button

Total owned= 25.00 Total unowned 40.00

This is a good example of something that is close to what I am looking for...
http://www.pugetsystems.com/certified_sys.php?sys_id=51


Is there any pre written script that would do this? It would aslo have to be linked to a database because of the large amount of collectibles...I think I am in over my head here.

BLiZZaRD
03-12-2007, 11:40 PM
You can easily (more or less) do it in Flash, which means you can do it in javascript.

PHP is a possibility as well, although I feel JS handles math a little better.

What are the stipulations, how many "items" are we talking about etc?

mburt
03-13-2007, 12:22 AM
Simple with js:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Calculator</title>
<script type="text/javascript">
var value = 0;
function calc() {
value = 0;
var el=document.getElementById("contents"),
c=el.getElementsByTagName("input");
for (var i=0;i<c.length;i++) {
if (c[i].checked==true&&c[i].type=="checkbox")
value = Number(value)+Number(c[i].getAttribute("rel"));
}
var t=document.getElementById("total"),
el=document.createElement("span");
while (t.firstChild) t.removeChild(t.firstChild);
el.appendChild(document.createTextNode(value));
t.appendChild(el);
}
</script>
</head>
<body>
<div id="contents">

Hockey Card #1:
<br><input type="checkbox" rel="20.00"> $20.00

<br>Hockey Card #2:
<br><input type="checkbox" rel="14.25"> $14.25

<br>Hockey Card #3:
<br><input type="checkbox" rel="15.00"> $15.00

<br>Hockey Card #4:
<br><input type="checkbox" rel="10.05"> $10.05

<br><input type="button" value="Calculate" onclick="calc()">
<br><b>Total:</b>
<div id="total"></div>
</div>
</body>
</html>

Hopefully you understand how to add cards/values.

<input type="checkbox" rel="15.02">
Once that check box is checked, it will add $15.02 to your total. Simple.

BLiZZaRD
03-13-2007, 12:31 AM
See? Told ya JS could do it easy enough :)

Frog Brew
03-13-2007, 06:27 PM
Wow..ok I am going to try this right now...I was starting to panic.

The guy I am doing this for is a Star Wars geek, one of those guys that just sits around all day and think up ways to make money.

So it will involve every Star Wars toy made.

He came by yesterday and added more to it I hope some can help modify.

*picture of hockey card 1* 20.00$ radial button (this one checked off) *Collectors Value guide Price (35.00)*, *profit/loss (15.00)*
*picture of hockey card 2* 20.00$ radial button (this one not checked off) *Collectors Value guide Price (20.00)*, *profit/loss (0.00)*
*picture of hockey card 3* 5.00$ radial button (this one NOTchecked off) *(20.00)*, *profit/loss (0.00)*


40.00 Total unowned 40.00

Basically the end user would have to be able to enter the amount he paid for the item, then it would subtract it from the actual Collectors Value guide Price

If this is possible is it possible to have it tied into an excel database, so that when prices fluctuate, he can make changes and upload the file to the site, and this would reflect all the new prices?

I got a flush feeling while typing this. I will kill him if he decides to make anymore change!!

Frog Brew
03-13-2007, 06:46 PM
BTW thanks guys you are saving my sorry @$$...

mburt
03-13-2007, 06:56 PM
What do you want different? I don't understand the problem.

Frog Brew
03-13-2007, 07:42 PM
Ok I built a non functioning example so it is more clear. I was even getting frustrated trying to explain.

http://www.lightthelamp.com/example.jpg

CVGP=Collectors Value Guide Price
The end user types in the quantity he has, the price he paid for them,

So it would be (quantity X CVGP) - (quantity X Cost) = Profit Loss

Now there would be about 5 lto 10 toys per page, and he wants the total of the items checked off to display at the bottom. So I actually might need a box that displays QTY X Cost in this example it would be 30.00.

I apologize if I am not clear...

I know I am in way over... uhg

Frog Brew
03-13-2007, 11:00 PM
This is super easy to do in Excel...so I assume it can be done, I just don't know how.

I could send you an example in Excel that would show what he wants.