Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by ZulfadlyAshBurn

  1. How can I do this? 1 = 1 2 = 2 3 = 3 4 = 4 5 = 5 And the value will reset after 5 meaning 6 = 1 7 = 2 8 = 3 9 = 4 10 = 5 So when I call a function as pass 9, it will return me 4.
  2. If I worked morning shift, its shift 1. If I worked night shift, it's shift 2. There is no fixed schedule thus when they key in their entry, it checks if the time is after 1800hrs. But sometimes their shift extends to the next morning which is shift 1 but I want the shift to remain as shift 2.
  3. My mistake, added another echo instead of return on the function.
  4. Currently the code is run and the shift value is added into the database with other data. However sometimes the night shift overruns the morning shift time and thus the shift value will change to 1 instead. I was think of setting a cookie when the user logged in and store the session for 12hours. However I cannot confirm the time of their login this the 12hours cookie will overrun into the next shift.
  5. I'm creating a shift system where it stores into database which shift is the user in. However sometimes their shift extends over the other shift. How can I implement it better I'm currently using the time to get which shift they are on. There are two shift. 1) morning: 0800 - 1930hrs 2) night: 1930 - 0800hrs Sometimes the shift will overrun. How do I maintain on which shift they were. $whatshift = (int) date("Hi"); if ($whatshift > "0800" && $whatshift < "1800") { $shift = 1; } else { $shift = 2; }
  6. Managed to get CSS to work. Had to do inline CSS for it work tho.
  7. I'm unable to include the css in the PDF. I'm using TCPDF.
  8. You can implement a function to check if the time is 12:00 pm. If so, echo 12:00 noon. I've created a simple script. Hope it helps. function isNoon($format) { global $date; $timenow = date('g:i a'); if ($timenow == "12:00 pm") { echo date('l, F j\,') . " 12:00 noon"; } else { return $date->format($format); } } To adapt this into your code, you can try this. <?php $tas_start_datetime = tribe_get_start_date(); function isNoon($format) { global $date; $timenow = date('g:i a'); if ($timenow == "12:00 pm") { echo date('l, F j\,') . " 12:00 noon"; } else { return $date->format($format); } } ?><strong>Los Angeles, USA: </strong><?php $date = new DateTime($tas_start_datetime, new DateTimeZone('America/Los_Angeles')); echo isNoon('l, F j\, g:i a') . "\n"; ?><br/><strong>Detroit, USA: </strong><?php $date->setTimezone(new DateTimeZone('America/Detroit')); echo isNoon('l, F j\, g:i a') . "\n"; ?><br/><strong>Accra, Ghana: </strong><?php $date->setTimezone(new DateTimeZone('Africa/Accra')); echo isNoon('l, F j\, g:i a') . "\n"; ?><br/><strong>London, UK: </strong><?php $date->setTimezone(new DateTimeZone('Europe/London')); echo isNoon('l, F j\, g:i a') . "\n"; ?><br/><strong>Lagos, Nigeria: </strong><?php $date->setTimezone(new DateTimeZone('Africa/Lagos')); echo isNoon('l, F j\, g:i a') . "\n"; ?><br/><strong>Auckland, New Zealand: </strong><?php $date->setTimezone(new DateTimeZone('Pacific/Auckland')); echo isNoon('l, F j\, g:i a') . "\n"; ?>
  9. I have created a PHP page where the contents are pulled from DB. Is there a way that I can save the file with the output and stylesheet to PDF with a click of a button.
  10. Can't give comments due to the following Sorry, we are currenly in maintenance mode!We are working hard and fast to make changes to our website, please try again shortly. Stay connected with us on social media and follow what's going on.
  11. Please change my username from ZulfaldyAshBurn to ZulfadlyAshBurn. I made this mistake when i sign up.
  • 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.