Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. $Fields being empty is one problem, but you haven't posted enough code for us to figure out why. The other is that $ARR is an associative row. That means there is no [0] or [3] and instead, as you can see in the print_r() output, it has a [Field] and [Key]. So if ($ARR["Key"] == "PRI" && in_array($ARR["Field"], $Fields)) { $primary[] = $ARR["Field"]; }You also need to initialize $primary to an empty array for the case of tables that don't have primary keys. Otherwise your function will return null.
  2. Not sure what you want for this. If you want simplicity then a database isn't the answer. I'd go for a flat file, like INI or JSON or even just text files with one email per line. Mock up the email in a single HTML file, put quick little placeholders (like "{{date}}") for any information that needs to be inserted, then file_get_contents() and strtr() with an array to get the final result. "Tags"?
  3. That only holds for overnight shifts. Are you specifically targeting only those and want to deliberately prevent your system from being compatible with daytime shifts? What about a case where an overnight worker has an emergency and leaves during the same day? Assuming logoff is the next day will automatically credit the person with 24h more than they should, not to mention potentially conflict with a shift the next day. Depends. What does the business think? It's probably determined based on the start date: "if start date is within month then sum(end date - start date)." So you want duplicate IDs? Don't. More appropriate would be to store login and logoff in the same row.
  4. Then they need to know about that. But many projects like Bootstrap and jQuery use the MIT license which allows for virtually any usage, including resale, provided the copyright blocks are left alone and the warranty statement (or more precisely the lack of warranty) is included with a copy of the license. So this likely will not be a problem. I assume the issue is that the "often used code" is your own personal license-able code which you've reused with the application? a) You treat those parts as "third-party library" code, and add it to their application by granting it/the client with an appropriate license - eg, one that would grant them the ability to share the code and/or application. Like the MIT license. You can do so specifically for this client without affecting licenses granted elsewhere. b) You rewrite the affected parts so they're no longer your own personal code. Do not do "implied" licenses. It should always be written in the contract, and when it isn't it's generally legally assumed that the product of your work under their employment is automatically their property.
  5. Don't store login hours. Store login timestamps. Full DATETIME/TIMESTAMP values. And if you have each work period storing a login/logout pair then you can SUM the diffs.
  6. They're not sure? That's a problem.
  7. Well, what do they have available? mssql? SQLSRV? ODBC?
  8. Ha, yeah, I just noticed what forum this is in... So you need the current page's query string? Try document.location.search (which includes the question mark).
  9. Use parse_url with PHP_URL_QUERY to grab just that part.
  10. Does too. https://3v4l.org/v5Cdt
  11. Try $THROWOUT_PAYED_FULL = (float)($BUYEDFULL . '.' . $BUYEDHALF);
  12. We have no idea what that code is or what it does. If I search for "get_image_for_designment" then all I find is a bunch of other posts from you on other sites (including at least four posts on StackOverflow for this one problem).
  13. "Foreign key constraint is incorrectly formed" I feel like I've been snippy lately? Maybe I should step away from the forums for a while.
  14. Looks like you haven't set up the configuration stuff yet. I don't know where $config is coming from, but the code expects it to include database information. What's in there needs to be whatever your MySQL connection details are - which should not be for the root user.
  15. The date picker should not be creating dates with names. Regardless of what it displays to the user, it should always "output" in a standardized format like Y-m-d or m/d/Y. But that's what it appears to be doing - at least according to the "dateFormat" (assuming that since it's not defined there then the date picker is using the default). So are you sure that the $this->date in the code is correct? It's not somehow being set to the current date?
  16. Your generate_list() will return an array of arrays. Loop over those to get timezone identifiers, construct a DateTimeZone for each, then use its getOffset() method with some quick math (to convert seconds to hours+minutes) to form that output.
  17. What did you do to make IIS support PHP, and what did you do to make IIS run the website you're running with PHP? Actually no, let's just skip to the chase: iis method not allowed
  18. How did you set it up?
  19. Are you running this site on your own computer? With IIS? How did you set it up?
  20. I showed you code. You need to make the mental leap to understand what it is and what it does. It's only three lines. More of a step than a leap.
  21. Sounds like POSTing isn't enabled for your script. Talk to your hosting provider to see what's up with that.
  22. "Weeks"? Really? Array (Whatever variable you dumped is an array, [2] => WP_User Object ( [3] => WP_User Object (containing WP_User objects, [data] => stdClass Object (with "data" properties that are plain stdClass objects, [ID] => 3 [user_email] => noreply1@test.comthat contain "ID" and "user_email" properties. foreach ($variable as $user) { echo "ID: {$user->data->ID}, Email: {$user->data->user_email}"; }
  23. So how familiar are you with PHP? MySQL? What have you learned so far? This forum works a lot more effectively if you can ask specific questions. In general you'll need 1. To know how to get stuff from a database (the list of states) 2. To know how to put stuff into the database (who the user is and which state they chose) 3. A map 4. Information about where each state is on the map - like actual pixel locations (eg, the center of Florida is at X,Y on this image) - which you should store in the database along with the state information itself 5. Some HTML and CSS knowledge; besides obviously making the page, you will need to be able to overlay one HTML element on top of another (that is, a with the username overlaid on the map) On that main page you'll pull information for one user (I guess?), including which state and where that is on the map, then position an and accordingly.
  24. If all you need is those IDs then use a foreach to extract the values into a separate array, then sort the 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.