PHP time (deadline within one week)


Posted on 16th Feb 2014 07:03 pm by admin

I have a column ['projdue'], which stores the deadline for a project.
I have PHP code and <span class>'s to show projects that are within timescale, due today and overdue:
Code: <?php
// get the date parts from the MySQL date
$dateparts = preg_split('/[-s]/', $row_rsProjects['projdue']);
// get the Unix timestamp for midnight at the beginning of the due date
$projdue = mktime(0,0,0, $dateparts[1], $dateparts[2], $dateparts[0]);
// get the Unix timestamp for midnight at the beginning of today
$today = mktime(0,0,0, date('n'), date('j'), date('Y'));
if ($today == $projdue) { ?>
<tr class="duetoday">
<?php } else if ($today > $projdue) { ?>
<tr class="within">
<?php } else if ($today < $projdue) { ?>
<tr class="overdue">
<?php }?>What I'm after is a bit of code to flag-up any projects that are due in 7 days

No comments posted yet

Your Answer:

Login to answer
137 Like 19 Dislike
Previous forums Next forums
Other forums

modifying a property of an object from a different class
I have 2 classes:
- Math
- Distance

in my math class, I have this line:
$distance =

Get to know your fellow coder
I think it's time we got personal around here. There's a lot of code swapping and a few members kno

Selecting an "empty" date formated field
How do you select an "empty" date field? I've tried the few ways I can think.
SQL> select

Production Order Enterprise Service to Manufacturing Exctn Sys (MES) ???
Hello Experts,

In our current landscape SAP ECC 5.0 is integrated to MES system via PI 7.

Undefined Variable: PHP_SELF, pls help
Hi,

Im a newbie on PHP / MySQL programming and Im running a script to search one field on my

Removing Title From database problem
Hi again ! i am having an issue with updating database. When i update any price of a title it remove

JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w

Help uploading .JPG
I have a problem with upload images when the ending is .JPG capitalized.. I really don't know what c

Help with PHP Email Script
Hi guys,

I'm a newbie to php and need help with the script below:

At the moment when I

Little problem with form insertion in MySQL, Please help!!!
Hi!,

I'm a little bit new with php and I have a little issue here. I created a webform to ins

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash