EndOfHTML; include 'bodybottom.html'; exit; } else { echo <<To download SWEET, please provide your name and e-mail address below. You can also choose to join one of our mailing lists.

  • On the announcements mailing list, we periodically send out announcements about California Wind Energy Collaborative events, courses, and publications. We promise to not annoyingly fill your e-mail inbox with frequent messages.
  • The small wind discussion mailing list is a discussion forum for participants of our Small Wind Energy Systems course. We hope that you'll use the list to share your small wind purchasing and ownership experiences.

We will never give or sell your e-mail address to any other organization or persons. If you choose not to join our mailing list, we will still notify you of new releases of SWEET. However, we will not send you any other mailings.

If you have any questions, please email smallwind@cwec.ucdavis.edu.




EndOfHTML; } function myProcess($values) { $firstname = htmlspecialchars($values['firstname']); $lastname = htmlspecialchars($values['lastname']); $email = htmlspecialchars($values['email']); $joinannounce = htmlspecialchars($values['joinannounce']); $joindiscuss = htmlspecialchars($values['joindiscuss']); $date = date("Y-m-d H:i"); // Notify via e-mail //$recipients = 'training@cwec.ucdavis.edu'; //$headers['From'] = 'training@cwec.ucdavis.edu'; //$headers['To'] = 'training@cwec.ucdavis.edu'; //$headers['Subject'] = 'Tech Training Reg: ' . $values['lastname'] . ", " . $values['firstname']; //$body = <<send($recipients, $headers, $body); // Write to file $outfile = "./registration.txt"; $fp = fopen($outfile, "a"); $fileline = "$date\t${values['lastname']}\t${values['firstname']}\t${values['email']}\t${values['joinannounce']}\t${values['joindiscuss']}\n"; $write = fputs($fp, $fileline); fclose($fp); } // Output the form $form->display(); include 'bodybottom.html'; ?>

SWEET: Small Wind Energy Economic Tool

setDefaults(array( // 'name' => 'Joe User' //)); // Add some elements to the form //$form->addElement('header', null, 'QuickForm tutorial example'); $form->addElement('text', 'firstname', 'First name:', array('size' => 50, 'maxlength' => 255)); $form->addElement('text', 'lastname', 'Last name:', array('size' => 50, 'maxlength' => 255)); $form->addElement('text', 'email', 'E-mail:', array('size' => 50, 'maxlength' => 255)); $form->addElement('static', '', '
'); $form->addElement('advcheckbox', 'joinannounce', null, ' Join the CWEC announcements mailing list', null, null); $form->addElement('advcheckbox', 'joindiscuss', null, ' Join CWEC\'s small wind discussion mailing list', null, null); $form->addElement('static', '', '
'); //$form->addElement('reset', null, 'Clear form'); $form->addElement('submit', null, 'Go to SWEET!'); // Define filters and validation rules $form->applyFilter('firstname', 'trim'); $form->addRule('firstname', 'First name is required.', 'required', null); $form->applyFilter('lastname', 'trim'); $form->addRule('lastname', 'Last name is required.', 'required', null); $form->applyFilter('email', 'trim'); $form->addRule('email', 'E-mail address is required.', 'required', null); $form->addRule('email', 'E-mail address is required.', 'email', null); $form->addRule('email', 'A valid e-mail address is required.', 'email', null); // Try to validate a form if ($form->validate()) { $form->freeze(); $form->process('myProcess', false); echo <<SWEET, the Small Wind Energy Economic Tool, was developed by Scott Johnson and the California Wind Energy Collaborative. To run SWEET, you need Microsoft Excel and you will need to choose to enable macros as SWEET starts up. SWEET works in both MacOS and Windows. If you have any questions regarding the download or use of SWEET, please e-mail to smallwind@cwec.ucdavis.edu.

Please do not openly redistribute SWEET or the password for this site.

Use the links immediately below to download SWEET.


SWEET is part of the CWEC Small Wind Energy Systems course. If you haven't already, please consider attending the course for detailed information on the science and economics that go along with SWEET.




SWEET Release History

4 December 2006. SWEET v2.4 released. Added taxation of rebates. Minor interface changes.

18 November 2006. SWEET v2.3 released. First public release.