Jump to content

requinix

Administrators
  • Posts

    15,290
  • Joined

  • Last visited

  • Days Won

    436

Everything posted by requinix

  1. In that chart, why is 2020-09-21 a 4? Shouldn't there be a 2 in 09-21 and another 2 in 09-22? The way I see it, the first step is to split that array of dates for both classes into one array of dates for each class. So one array has 09-21, 09-28, 10-12, and the other has 09-22, 09-29, 10-06, and 10-13. That also means each array's total increments exactly the way it should: the previous total + the current number of hours. 2, 4, 6, 8, and so on. No confusion about 2, 2, 4, 4, 6, 6 or 64, 68, 66, 68. Each array will then have one and only one item in it with a total of 34 hours. And only one 68 hours. From there I'm not sure because I don't know what the output is supposed to represent. Is it a "schedule" for someone to get 34 hours of each class, but they can only take one class at a time?
  2. But how do you know which is which? 2020-09-21 - 2 - 0 - 2 2020-09-22 - 2 - 0 - 2 2020-09-28 - 2 - 0 - 4 2020-09-29 - 2 - 0 - 4 The 09-21 and 09-22 dates are for the two classes. The 09-28 and 09-29 dates are also for the two classes. But it isn't obvious that the 09-21 and 09-28 dates are the same class. Is there anything other than the 7 day difference to tell which one goes for which class? What if a class is rescheduled to be a day earlier or later? I see one class will be missing two dates at the beginning of 2021-12 - aren't they going to be 4 hours behind the other?
  3. Those dates look like they come from two different data sets. Why is the first end date 02-01 and not 02-09? Why is the second 06-22 and not 06-14?
  4. Where are you getting 2021-02-01 from? Where does the 34 from $tot come in? How about this: given those three arrays, $cronograma = array( "2020-09-21" => array("2020-09-21", 2, 2, 2), "2020-09-28" => array("2020-09-28", 2, 2, 4) ); $id = array( 58, 60 ); $tot = array( 34, 34 ); (1) what is the output you want to get, and (2) what thought process did you follow for you to come up with that output?
  5. Dunno. It was a clear decision to padding-bottom about 50%. They might be expecting someone to put an image in the background? Fixed. IPS made tons of theme changes, but fortunately the conflict resolution process has been mostly to just revert all changes - seems the new layouts are a bit more compatible with theming.
  6. $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); Apparently there is no "chosen_shipping_methods" value in the session. You need to provide a default - an array of shipping method values to use when that session value isn't present. Guessing based on the code, you can do so with $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ) ?? ['suitable:set:of:values'];
  7. requinix

    group by

    What do you mean by "group"? The normal way this "I have 2 dropdown boxes being populated" problem goes is that you get a list of all titles and put that in the first one, then get a list of all artists that match the title selected in the first. Neither have anything to do with grouping.
  8. As long as the filesystem permissions are set up to allow whatever user PHP is running as to write files then yeah, sure, you can do that.
  9. Try wrapping the class definition in an if(true) { }, which will prevent PHP from optimizing away the declaration, and then logging a debug_backtrace() somewhere before the if. Locally you should see two traces while in production there should only be the one. Then you can compare the traces to see if that suggests anything.
  10. To be clear, you're talking about ignoring errors in the sense that PHP continues execution after? No: once the error has been raised, that's it. They can't be trapped with set_error_handler() either, although they can be detected with some register_shutdown_function() trickery. Assuming production isn't running some hacked version of PHP, and assuming that everything is running properly to completion, that must mean there aren't any fatal errors. So there's some difference between there and your setup.
  11. Well... Given just that code it's going to be really hard for anyone besides you to understand what the problem could be. You say the page is refreshing but it sounds like that's just the regular page load from submitting the form. Write out a list of steps that the code is supposed to follow, then verify each one in turn. For example, one of those steps is going to be that the code checks if the "submitButton" was pressed, so you need to verify that (1) there is a submit button, (2) it is named "submitButton", (3) it has a value so that it can be sent along with the form, and (4) you are using it to submit the form.
  12. It should probably come as no surprise to learn that the answer is "to check if the input is the right combination". You have a query that looks for matching username and password. What will happen if there is a match? What will happen if there is not a match? How can you get the code to tell which is happening?
  13. Seems reasonable enough. What's the problem?
  14. No specific rules. Consider how useful the new information is, how old the thread is, how likely people are to come across the thread and need the new information, whether the post is likely to revive a discussion that really has no need to be revived, stuff like that. Worst case the post isn't useful and some staff member removes (hides) it because they don't feel it contributes enough. Warnings are mostly for repeat offenders and folks who put a minimum amount of thought into what they do.
  15. Is the cf_type "url"? What incorrect URL are you trying?
  16. Potentially. How about going into more detail about what you're dealing with?
  17. How is that accomplished? You wouldn't happen to be setting disabled to "false", would you?
  18. Single ' quotes are for strings and only for strings. They will not work for table or column names. You don't normally need quotes for table or column names, and you should try to avoid putting yourself into a situation where you do need them, but if you must then for PostgreSQL you should use double " quotes.
  19. I upgraded to PHP 7.4 locally because duh. Recently I needed to deal with a Laravel 5.x app. Does it work on PHP 7.4? Yeah, even though it's an older version. Well, almost worked. Somewhere in a plugin there was a call to implode() with the arguments backwards and support for that was E_DEPRECATED. Okay, deprecated, fine. But you see, in Laravel's infinite wisdom, it decided that every single error of any severity needs to be shoved into an ErrorException and thrown. So the entire application breaks down because of a single line in a single plugin that is still working perfectly fine, it just won't work "perfectly fine" after hypothetically changing the system configuration at some undetermined point in the future. So yeah. "Version too high" is stupid.
  20. Allow me to summarize the posts in this thread: (OP) I'm trying to learn OOP. Regardless, I have some problems with checkboxes in that I can't tell which checkboxes are which. (me) Checkboxes are only submitted when they're checked. If you need to know which fruits were selected then it requires looking at the values in the checkbox array. (Psycho) Don't use submitted data as field names in a query. The user could have done something malicious that will mess up your application. (OP to Psycho) I removed some code but I still don't know what's wrong. (OP to me) I completely changed the checkboxes and the code so it doesn't use an array. Here is some validation code that no longer works because it expected an array. (me) Why did you completely change how the checkboxes and the code look? The array from before was fine. (OP) So what do I do? It still doesn't work. Please give me code. Here's another explanation of what I want. (me) I don't know what "completely changed" is but you need the fruit name in the array somehow. You can then check if each fruit was selected using one of two methods. (OP) This isn't helpful. I'm going to take my question somewhere else. (me) I don't think that will make a difference. We weren't going to give you the new code. Not even sure we had enough information to do so. But we can try to tell you what is wrong and how it needs to be changed. Unfortunately, that wasn't good enough.
  21. At this rate, probably not. See how much spending money you have and hire a programmer to do the work for you.
  22. Seems like you're kinda just guessing. If you make the "ajax" a function instead of an object, then you can do whatever you want. Like make your own AJAX request. When you do that, you'll get back the information that the DataTable wants as well as the header string thing. Put the header string thing into your header element thing, then use the "callback" to hand the table data off for processing.
  23. Not the xhr event. I said "ajax". As in what I linked to in the documentation. As in "ajax": { method :"POST", url : '<?php echo admin_url('admin-ajax.php');?>', data : {action:action,tax:tax,id:id,}, }, that.
  24. I don't know what your checkboxes look like now, but you've put the name of the fruit as an array key or as an array value. If you put it as a key then test if each fruit was selected using isset(). If you put it as a value then test using in_array().
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.