Thanks Ray. I did have an unnecessary redirect you're right. But I realised also had the wrong database password reference in the email template.
I still have an issue with this. as follows.
The reason why I have two stages to this is because I need certain values ( 'num_of_blocks' and 'total_flats' ) that the user enters in the modal form ( index.php ) to calculate the value in the hidden field ( 'quote' ) in the 'send_quote_form' on the quote-result.php page. when the 'send_quote_form' is submitted the quote value is sent to the database and is placed in the email template that is sent to the user.
Here is my problem:
Our price formula is as follows:
- Price per block £500 / Price per flat £75 /
- Total cost would be: ( £500 x total amount of Blocks ) + ( £75 x total flats )
example: 14 flats in 2 blocks / ( 14 x 75 ) + ( 2 x 500 ) = £2050.00
This is not a problem and have this in the hidden field that is used to send the value to the database record in an update record behaviour:
<input type="hidden" class="form-control" name="quote" id="quote" value="<?php echo ($row_rsQuotes['total_flats'] * 75) + ($row_rsQuotes['num_of_blocks'] * 500); ?>">
BUT!!
We have a minimum charge of £1000.. So if the user was requesting an estimate/quote for 6 flats in 1 Block, which totals £950… the quote would be wrong.
So basically when ever the details are 1 Block and 6 or less flats I need to send a value of £1000 to the database and not the calculation in the hidden field.
I have tried to create access rules to do this using two hidden fields but with no success. because I would need two conditions to be true for it to pass.
So for example:
Rule 1 - IF num_of_blocks = 1 AND totlal_flats <= 6 ( this would send an update behaviour using hidden field value of £1000 )
Rule 2 - IF num_of_blocks >= 2 ( this would send an update behaviour using hidden field value with calculation
I hope you understand this.
Thanks in advance!