Jump to content

requinix

Administrators
  • Posts

    15,274
  • Joined

  • Last visited

  • Days Won

    432

Everything posted by requinix

  1. No, "dio.so[P​HP]" is not in there. "dio.so" is, but that's not the file PHP is trying to load...
  2. It's a subtle distinction but don't let yourself fall into the trap of thinking traits constitute composition. Because they don't. Traits are only code reuse. So the question is whether "language-assisted copy-and-paste" is the solution to the problem. And sometimes it is. But I don't think this is one of those times. The way I see it, it isn't so much about a hierarchy but about a relationship: a "tenant" user is associated with a tenant, a "vendor" user is associated with a vendor (which is associated with a tenant), and a "super" user is associated with zero(?)-or-more tenants. What's your UML for the users? In other words, what kinds of properties do the different types of users have, and thus how are they different from each other?
  3. Why aren't you using <select>s?
  4. Don't do date math on Unix timestamps. MySQL is perfectly capable of doing date arithmetic using DATETIMEs with INTERVALs, and in PHP you should always load the date into a DateTime object and use its add/sub/modify methods. See above. Details would be nice. Especially where (SQL or PHP?) and when (manipulating data or displaying values to the user?) you want to do the math.
  5. What's going on here is that you think "20211021141214" is a number. It is not. It is a string made up of the characters 0-9. That string is not a useful timestamp. Either store your date as a regular DATETIME/TIMESTAMP like "2021-10-21 14:12:14" (easier to work with in SQL) or store it as a Unix timestamp like 1634825534 (easier to work with in PHP).
  6. It's needed in both. Your code worked for the exact same reason that it did not work before. If you have a <div> then the style.display is nothing because there is no actual value set, even though the effective value is "block". Why I think what is a stupid question?
  7. You're really making it sound like you don't actually understand the difference between = and ==. style.display will return the actual value set with CSS. It will not return the effective value if the value isn't set.
  8. Have you tried troubleshooting this on your own?
  9. Like how $inactive_status is never assigned a value. Or how it would be set to true if any of the agents are status=N. And I don't understand why you have all this stuff dealing with $statuses and $display_names. That's the general idea, though what you have there won't work (see what I said above). You can throw class names onto whatever elements you want to represent whatever information you want, then add CSS rules to target things you care about. Consider this: $month = 10; $year = 2021; $daysinmonth = date("t", mktime(0, 0, 0, $month, 1, $year)); for ($day = 1; $day <= $daysinmonth; $day++) { $date = mktime(0, 0, 0, $month, $day, $year); list($monthname, $dayname, $weekday, $fulldate) = explode("/", date("F/l/N/F jS", $date)); $isweekday = $weekday <= 5; ?> <span class="month-<?=$monthname?> day-<?=$dayname?> <?=$isweekday ? 'is-weekday' : 'is-weekend'?>"> <?=$fulldate?> is a <?=$dayname?> </span> <?php } ?> outputs <span class="month-October day-Friday is-weekday">October 1st is a Friday</span> <span class="month-October day-Saturday is-weekend">October 2nd is a Saturday</span> <span class="month-October day-Sunday is-weekend">October 3rd is a Sunday</span> <span class="month-October day-Monday is-weekday">October 4th is a Monday</span> ... and then you can do things like .day-Monday::after { content: "😢"; } .day-Friday::after { content: "🎉"; } .is-weekend { background-color: #ccc; }
  10. Sounds like you're being bit by the Let's Encrypt kerfuffle. Upgrade to OpenSSL 1.1.0 or later.
  11. You've got more problems in there than that, but Don't do inline CSS. Give the TD a class name like "agent-status-Y" or "agent-status-N" and then create a CSS rule or two to give the TD appropriate styling accordingly.
  12. Feel like doing some troubleshooting?
  13. Sure, if you like the sounds of it. Doctrine is the main one people go for.
  14. Suggestion #1: if ($condition) { // ... } else { return $value; } // is the same as if (!$condition) { return $value; } // ... Suggestion #2: if ($condition_1) { // thing } else if ($condition_2) { // same thing } // is the same as if ($condition_1 || $condition_2) { // thing } I have two more, but let's start with those and see what you do.
  15. PDO is the standard because it supports basically every database system. Most people prefer its API over mysqli's but the differences are meaningless if you add your own abstraction on top of it. mysqli is dedicated to MySQL and can offer better support for MySQL features. I wouldn't say it's "discouraged", rather that people encourage PDO over it. Almost nobody changes database systems after using one for a while. When they do, PDO has the advantage that you can switch drivers easily, but it won't help them audit all their SQL queries for compatibility.
  16. Maybe. It depends how things are set up. The best answer to that is "try it and find out".
  17. Margins are more complicated than simply giving you spacing from the edge some nearby element. Like they'll merge and collapse with other margins. And margins can extend outside what you think the bounding box of the element is. The comment-action's margin does not push it away from the bottom of the parent div because there was nothing to push against. That bottom edge isn't a hard edge. Think of margins as a way of spacing from other unrelated elements while padding is for spacing from other related elements; use a margin with a div + div but use padding with a div > div. Of course it's not actually that simple, but it's a start.
  18. Step away from the computer for a while, eat something, then come back and look at if ($lang = "en")
  19. The number one thing it would explain is how you got PHP settings onto your machine that don't make sense, given that you didn't put them there yourself. The configs aren't messed up. They work fine. On the shared hosting server. They may not work fine for you on your personal computer. Find the php.ini and comment out (put a semicolon ; at the beginning of the line) the setting for the session.save_path. Just make sure you don't push that change back up to the server.
  20. You're way overthinking this. Forget positioning. Let the element render where it would normally because that's where you want it. Then simply align its contents right. https://jsfiddle.net/fk9n1pbz/
  21. Using something like Local would explain a lot. But I don't know Local much. Are you sure you're using it? What little I can find that describes technical details suggests that it should be running everything in a separate environment - like a separate operating system - than your own, so you shouldn't be seeing any error messages that mention files in C:\... How did you come to use Local, too? Is that something you were told to do by someone when you wanted to have a copy of the site?
  22. There's no way to craft a magical link that will do the sorts of things you're describing - without adding some code on the target page. The cleanest option is to cause the page to be rendered with the desired tab in view right from the start, which would allow you to use the # anchor immediately. But it requires changing something on the server so that it outputs the proper HTML and such so that the correct tab is shown by default. If that's not an option then you have to come up with a scheme for fragments where the target page can inspect it on load and decipher (a) that it needs to load a particular tab and (b) scrolls to the target. But it can be less complicated than it sounds: if you use #commentform as the fragment then Javascript can extract that from the URL, find the element, determine which tab it belongs to based on its ancestor elements, switch to that tab, and then do the scroll action to the element. The first option would be easier to explain if we knew the PHP (?) code on the server that renders the page; essentially you do something like /path/to/page?tab=reviews#commentform in your link, grab the "reviews" in code, and output (I assume) the correct CSS classes to set that particular tab as the default active tab. The browser would handle the scrolling. The second option would be easier to explain if we knew the markup of the tabs and comment form.
  23. That /var/cpanel is not a default setting for php.ini so something put that value there... Where is this php.ini exactly? What is the setup you have for running this site on Windows - are you using XAMPP or WampServer or what?
  24. You can't simply copy php.ini settings from one machine and put them on another machine. Same way you can't take a remote that worked on one TV and expect it to work on a different TV. Remove/undo those settings you copied.
×
×
  • 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.