Gossamer Forum
Home : Products : DBMan : Customization :

Addition/subtraction mod

Quote Reply
Addition/subtraction mod
Okay, say you would like to have certain users update the DB by having them editing a certain field. Now, they would like to add hours to that field. Is there a mod out there that will let the DBMan script add (addition) hours together??? Example:

In one field you have a total of 17 hours.
The user would like to add 8 hours, so you would have a total of 25 hours.
I don't want the user to add the hours together by him/herself. I would like the script to add the hours together. Is this possible, and if so, could I please have some input/assistance with this. Thank you.

Shawn Anderson
Webmaster
Southwest Virtual Airways
http://www.virtualswa.com
Quote Reply
Re: Addition/subtraction mod In reply to
ummm ... not for sure without checking GT's resources / or visiting:
You may want to check our JPDeni's excellent DBMan tutorial.
http://jpdeni.com/dbman

And LoisC's excellent resource
Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/


Thanks to them both.


I'm pretty sure you can get information on how to add fields toegther at the the unoffical dbman faq then you'd probably just call the record do a $rec{'hoursold'}+$rec{'hoursnew'} with a simple input field for the new hours.

If you really want to get fancy you could make new modify subs in html.pl and db.cgi so that the user would only have to worry about that they're adding new information not modifying all the old.



or simpler yet make use of if ($per_admin); if you have JPDeni's added permission mod installed you could probably use if ($per_mem); conversely to show/hide which variables that a user could add to or not.

one other idea is just provide a java caluculater so the user could caluculate it out and just add the new number on their own ;-)

hmmm ... lot's of possiblities

good luck.

**************************************
on the pages in between ...
Quote Reply
Re: Addition/subtraction mod In reply to
You will find a solution in the FAQ noted below in the section "Calculate / Counts".

Check out a few related threads and find the best option for your database.


Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/