I created a form for booking.
Now I'd like to send the email as an invoice. Therefor I need to create an invoicenumber. Creating should be easy by using the last cf_id of the forms table.
Getting this value in Standard "Form-hmtl" is not a Problem:
But I want to do this just "on Submitting form", because when questioning this before, two users could get the same Number.
I tried to use it "on submit - befor sending email", but didn't get the value {last_id} displayed in the email.
Any solutions? Or is there an other way of getting autocrementing number from the database?
Now I'd like to send the email as an invoice. Therefor I need to create an invoicenumber. Creating should be easy by using the last cf_id of the forms table.
Getting this value in Standard "Form-hmtl" is not a Problem:
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Last ID:*</label>
<input class="cf_inputbox required" maxlength="50" size="40" title="" id="text_12" name="name" type="text" value="<?php $db =& JFactory::getDBO();
$SQL = 'SELECT MAX(cf_id) AS mid FROM jos_chronoforms_buchung3';
$res = mysql_query($SQL);
$ret = mysql_fetch_array($res);
$wert = $ret['mid'];
echo $wert;
$wert = $wert+1;
echo $wert;
?> " />
</div>
<div class="cfclear"> </div>
</div>
But I want to do this just "on Submitting form", because when questioning this before, two users could get the same Number.
I tried to use it "on submit - befor sending email", but didn't get the value {last_id} displayed in the email.
Any solutions? Or is there an other way of getting autocrementing number from the database?
Hi office-4-sale,
This has been discussed here several times. Searching the forums on cf_id should find you some code examples.
Bob
This has been discussed here several times. Searching the forums on cf_id should find you some code examples.
Bob
Thanks for your fast reply. But searching the forum for "cf_id" results in: "The following words in your search query were ignored because they are too common words: cf id."
Well, i searched before and didn't find it, but now, together with google I got it ;-)
Posting http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=16978 did it.
I only needed to put
Thanks for this great compononent!
Well, i searched before and didn't find it, but now, together with google I got it ;-)
Posting http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=16978 did it.
I only needed to put
<?php echo "Number: ".$MyForm->tablerow["jos_chronoforms_Reserveren"]->cf_id;?>
into the email template. Remember to turn "off" Editor in email settings.Thanks for this great compononent!
This topic is locked and no more replies can be posted.