Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Location
    Bucharest,Romania
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with a php calc

    PHP Code:
        /*
            RN = RENDARFAM NOTE
            FD= DIVISION FACTOR
            TF = TIMPE PER  FRAME
            NF = NO OF  FRAME
            NU = NOTE CPU USER 
            FU = FREQUENCY CPU - SELECTED FROM LIST VALUE
            FP = FREQUENCY CPU - SELECTED FROM FORM INPUT
            CN = CPU NO 
            TRU = TIME RENDER USER - CONVERT h.min.sec  INTO MINUTES
            TR = TIME  RENDER FARM
            NSU = NOTE USER SIST 
            AMOUNT = TOTAL PAYMENT
            DISCOUNT = DISCOUNT RULES 
        */

                
    $RN =$_POST['RN'] =977;
                
    $FU =$_POST['GHZ'];
                
    $FP =$_POST['CLOC'];
                
    $NSU =($NU/$FU)*$FP;
                
    $FD =$RN/$NSU;
                
    $TRU =$TF*$NF;
                
    $TR =$TRU*$FD;
                
    $PRICE =3.8;
                
    $AMOUNT =(($TR*$PRICE*'2000')/100);
                
    $DISCOUNT=$_POST['AMOUNT'];    
        <
    form action="" method="">
                    <
    label>Your CPU-type:</label>
                        <
    select id="type" name="type">
                            <
    option value="17.040">Intel Xeon</option>
                            <
    option value="16.321">AMD</option>
                        </
    select>
                    <
    label>Cloc[GHz]:</label>
                    <
    input type="text" maxlength="4" size="8"/>
                    <
    label>#CPU</label>
                        
    <select id="cpu" name="cpu">
                            <
    option value="1">1</option>
                            <
    option value="2">2</option>
                            <
    option value="3">3</option>
                            <
    option value="4">4</option>
                            <
    option value="5">5</option>
                            <
    option value="6">6</option>
                            <
    option value="7">7</option>
                            <
    option value="8">8</option>
                        </
    select>
                    <
    label>Average render time per frame:</label>
                        <
    input type="text" size="2" maxlength="2" >.h
                        
    <input type="text" size="2" maxlength="2" >.min
                        
    <input type="text" size="2" maxlength="2" >.sec
                    
    <label>Total frames: </label>
                    <
    input type="text" maxlength="6" size="8" >
                    <
    input type="submit" value="Calculate" name="Calculate" />
                </
    form
    hello again, im trying to make a php calc for a wp theme. This calc has to show the user how much is the cost if he will use the render farm services.

    the list in your cpu type is from cpubenchmark and the values are the marks shown on the site this is the first step.
    the point of this calc is to show the time / frame that the user is geting on hes pc and the time per frame in the rander farm.
    Last edited by AlexDigital; 07-16-2012 at 03:46 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,537
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Welcome to Coding Forums.

    Please wrap your code in the appropriate tags (code or php) and actually describe your problem and steps you've taken, as well as what you're trying to accomplish. You've thrown us a bunch of code and expect what from it?

  • #3
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    I would also consider using Javascript for the calculator instead of PHP. With PHP the page has to be reloaded to get the output, with Javascript the output is updated instantly without a page reload.

    It makes for a nicer web experience for the user.
    Leonard Whistler


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •