It wouldn't be that difficult, but then again I've been coding for a while. Since you're willing to help with the code if necessary, I'll assume you know some PHP/JS.
Here's a mockup of one way it could be done (you'll see it's not really that difficult);
1) You create the form in the wordpress page using standard HTML.
2) The form Posts the numbers to a page called "calculations.php" inside "../wp-content/plugins/spreadsheets/calculations.php", which looks something like this:
Code:
require_once('WP_Load'); //Load necessary wordpress functions
//Get the values from the form
$interest = $_POST['interest'];
$cash = $_POST['cash'];
$period = $_POST['period'];
$page_id = $_POST['page_id'];
//Calculate total after period
$estimate = ($interest/12 * $cash) * $period;
//Save this value back to the spreadsheet in the current page
add_post_meta($post->ID, 'estimate', $estimate);
//Redirect to the page
header(get_permalink($page_id));
3) Then you just add a hook to the required wordpress file (probably "functions.php") that looks at all the "estimate" values stored inside the page:
Code:
add_filter('the_content', display_spreadsheet($content));
function display_spreadsheet($content){
$content = '<table>';
foreach(get_post_meta($post->ID, 'estimate') as $estimate){
$content .= '<tr><td>' . $estimate . '</td></tr>';
}
$content .= '</table>';
return $content;
}
I mean that would be it in a nutshell. In fact, you could probably copy+paste that code and it would work lol
Bookmarks