Jump to content

requinix

Administrators
  • Posts

    13,858
  • Joined

  • Last visited

  • Days Won

    346

requinix last won the day on October 22

requinix had the most liked content!

7 Followers

About requinix

Profile Information

  • Gender
    Not Telling
  • Location
    America/Los_Angeles

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

requinix's Achievements

Prolific Member

Prolific Member (5/5)

1.1k

Reputation

265

Community Answers

  1. 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.
  2. 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).
  3. 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?
  4. 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.
  5. 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; }
  6. Sounds like you're being bit by the Let's Encrypt kerfuffle. Upgrade to OpenSSL 1.1.0 or later.
  7. 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.
  8. Feel like doing some troubleshooting?
  9. Sure, if you like the sounds of it. Doctrine is the main one people go for.
  10. 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.
  11. 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.
  12. Maybe. It depends how things are set up. The best answer to that is "try it and find out".
×
×
  • 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.