I can’t wrap my head around this particular problem. There is a bakery, and an office that accepts orders. Bakery is open from Monday to Sunday, it’s only closed during public holidays. Orders can be placed from Monday to Friday unless it’s a public holiday i.e. the office is open during working days. We also need to distinguish if the
Tag: logic
How to round an integer UP to the nearest 15 in PHP
I have the INTEGER(255) variable $duration stored with a value taken from the user. I need to round this UP to the nearest 15. I have searched all over but haven’t been able to find a solution. How may I go about doing this? For example: 10 becomes 15 16 becomes 30 130 becomes 135 Also, how can I add
Revert a number to its original value in PHP
I have a problem in reverting the original amount of a customer. A customer can amortize its balance in 3 months. So, if the balance is 1,100.00 1,100.00 / 3 = 366.666666667 rounded up to 366.67 …
How to Assign a Gateway Fee in WooCommerce to Multiple User Roles?
I’ve built an online shop on WooCommerce that sells retail as well as wholesale. But credit card fees are so damn expensive. I’m happy to pay the credit card fees for my retail customers but I want to charge my resellers if they choose to pay by credit card. I managed to come up with the following code that works
Find the Christian Liturgical Year – Return a letter A, B, or C for any Year
In the Christian liturgical year, Advent starts things off four weeks before Christmas, and there are three cycles (Year A, B, and C). In PHP, what would be the most efficient and elegant method to determine what cycle we would be in for any given year. Here are the rules: The beginning of the cycle occurs on whatever Sunday falls
How I can create my own pow function using PHP?
I want to create a function in which I put two values (value and its power – Example function: multiply(3, 3) result 27). I have tried so far but failed, I have searched using Google but I have been unable to find any result because I don’t know the name of this function. What I want exactly: 3,3 => 3
MySQL GROUP_CONCAT with COLUMN SPLIT
I am working with a TABLE, need logical help. Check the below URL for the table structure and sample data. http://sqlfiddle.com/#!2/ece06/2 Table Schema: Inserted Data: Query: OutPUT: Expected OUTPUT: As you can see the output of the query has concat with comma. And currently we are doing string concat using PHP which splits while displaying!! Is there any other way
Stuck with the number pattern printing in PHP
Stuck with the number pattern printing logic. Let me know what i am doing wrong as my file is simply going on execution without giving me a pattern. My Code — Pattern to achieve — UPDATE After applying new changes following are the screenshots — Answer Your error is in the last for, that should not exist since you are