php - Quantity Conditional -


Here's the one that I got stumped. Working in PHP5

I am creating a store app for a client who uses a web service from a large agency because it is a broker for this web service that an end user needs to purchase one In a certain quantity, or the order will be considered ineligible for the purchase.

I have to create a dropdown option box in which there are only eligible quantity numbers, the rules are as follows:

If more than 12 quantities are available, leave any quantity

If less than 12 quantities are available and have said that quantity, then only allow pairs to purchase

If less than 12 quantities are available and the quantity is odd, then it is g Allow any quantity by releasing, which is left to only one object.

I'm a bit confused how my conditions should be adjusted to determine dropdown content. By subscribing, how can I know that in the final quantity, the quantity of the user will be left alone to purchase from the requested quantity and will it be denied?

I can not imagine why the service provider has not made it, so instead of a rigid number, an array of eligible quantities was returned. Please also note that there are two other rules that have already managed the meeting.

Any help would be greatly appreciated!

itemprop = "text"> if ($ profit> 12 || $ profit% 2) {$ step = 1; // large profit or strange profit For all qtys} and {$ step = 2; // even qtys gain for small) $ options = array (); ($ I = $ profit - ($ step == 1); $ i & Gt; $ i - = $ move) {// skip qty = step = 1 $ profit for options [] = $ i;}

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -