On May 25, 7:44 am, "fungied.cheese" <[email protected]> wrote:

> First person comes and filles out the form, on the top of the form it says
> "Invoice 1" and once he hits submit I receive all the information in my
> email including the ID number. And now second person will have invoice 2,
> etc, etc.

Let's say your model is called "Invoice", so by Cake conventions, you
would name your controller InvoicesController.

In your controller, you can save your new invoice simply by calling
"save" on the model (assuming your form is created with the
FormHelper):
  $this->Invoice->save($this->data);

- then the id of the newly created invoice will be available as $this-
>Invoice->id:
  mail('[email protected]', 'New order', 'Invoice id is: ' . $this-
>Invoice->id);
(or use the email component from Cake: http://book.cakephp.org/view/176/Email)

For the view, try to take a look at the FormHelper - it will create
the form for you (http://book.cakephp.org/view/182/Form).

  Regards

    Jonathan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to