Help with automatic calculation after entering a field ($25)

Completed work-for-hire transactions. -- For archive purposes.

Moderators: Erik Frèrejean, Honor

Forum rules
Completed work-for-hire transactions. -- For archive purposes. Do not contact members privately from topics in this forum.

Help with automatic calculation after entering a field ($25)

Postby caribsa89 » 14 Apr 2011, 21:49

I want to add a small functionality to the Application Form Mod located here: http://www.phpbb.com/customise/db/mod/application_form/
I'm willing to pay $25 or give me your best offer. You don't have to install it for me, just add the extra functionality and I'll do the rest.

I'm using the Ultimate Point System on my board as a way to redeem points for ebooks. I was able to change the Application form fields so users can order their ebook. Screenshots below of what it looks like now. Also a zip attachment of the 3 files that came with the mod that I changed.

Here's what I want:
I want to add a new line in the posted topic that calculated how much SRF Cash it will cost the user depending on the price field that they entered.
It will show up in the topic after Request Description to say, This book will cost you (total) SRF Cash

So Here's what I want:
User enter price in a form
Number1 = price Round to the nearest .50
So $2.27 would be $2.50
S0 $2.64 would be $3.00
Total = (Number1 divided by $.50) * 100 so that would be Total = (roundToNearest answer/ .50) * 100

I want to pass the total to the forum topic that says (This book will cost you (total) SRF Cash)!

I found a function that calculate to the nearest .50 but I don't know if it's correct. But here it is below. Just want to know what to add to application.php code to calculate the total and then pass it to the forum topic?

roundToNearest
Code: Select all
   function roundToNearest($number,$nearest=50)
      {
          $number = round($number);
     
          if($nearest>$number || $nearest <= 0)
              return $number;
     
          $x = ($number%$nearest);
         
          return ($x<($nearest/2))?$number-$x:$number+($nearest-$x);
      }
Attachments
root _new.zip
(4.32 KiB) Downloaded 49 times
ApplicationForm.JPG
ApplicationTopic.JPG
caribsa89
Cadet III
Cadet III
 
Posts: 35
Joined: 20 Oct 2010, 09:03
Gender: Female
phpBB Knowledge: 3




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Return to Completed Transactions

Who is online

Users browsing this forum: No registered users and 1 guest