PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 9th, 2012, 07:53 AM
frantzs frantzs is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 2 frantzs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 55 sec
Reputation Power: 0
PHP-General - List Input + Calculation Help

I'm looking more for a starting point here. I'd like to build a web application using PHP. The application will accept user input, a field for quantity, description, and two different inputs for "prices"

The user will be able to "add a new row" to this list by clicking a "Add New Row" link or button of some sort, and then at the end hit "Calculate" and a calculation of the totals in the "price" inputs will be calculated.

Users will also be able to save their list, edit/update their list and print the list after it has been computed.

I'm more or less looking for advice, I'm thinking of using CodeIgniter as my framework -- but I'm wondering if anyone has any other suggestions? OR where a good place to start might be?

Reply With Quote
  #2  
Old November 9th, 2012, 08:12 AM
NotionCommotion NotionCommotion is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,464 NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 6 h 21 m 9 sec
Reputation Power: 526
I've never used CodeIgniter, but I have heard good things about it. I would be interested to hear other options of it.

If your application is simple (or even complicated), the following framework will work.

While I am showing tasks such as addRow and calculate creating the page HTML, typically I do not do so, but make these tasks AJAX routines which display some text or JSON. My main page will include JavaScript and take the response and modify the page as necessary.

PHP Code:
<?php
    $task
=(isset($_GET['task']))?trim($_GET['task']):
    ((isset(
$_POST['task']))?trim($_POST['task']):'display');
    switch(
$task)
    {
        case 
'addRow':
            
//Add row to database
            
echo(display());
            break;

        case 
'calculate':
            echo(
'Display my calculations');
            break;

        default:    
//display
            
display();
            break;
    }
    die();

    function 
display()
    {
        echo(
'Echo my HTML headers.
        Then use the database to display the number of rows.
        Then display some links such as the following:
        <a href="index.php?task=addRow">Add Row</a>
        <a href="index.php?task=calculate">Calculate</a>        
        '
);
    }

?>

Reply With Quote
  #3  
Old November 9th, 2012, 08:14 AM
frantzs frantzs is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 2 frantzs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 55 sec
Reputation Power: 0
Interesting... thanks! That does help actually.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - List Input + Calculation Help

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap