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

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t

Custom Container in module pool program
Hello everyone,

I have created a custom control in my module pool screen. Now I want to s

empty() error
Why does

Code: empty($USER_ID = $_SESSION["USER_ID"])
create this error...

The type or namespace name 'ServiceModel' does not exist in the namespace 'System'
When I locally run the website, it works just fine, but when I uploaded it to the hosting environmen

Just cannot get 'area' to submit to db using same php code as already used
Basically all i have done is just modified some code and added an area section.
The form is allre

Remove Rows From Database ad
Hi All,

I have this:

Code: [Select]<?php
session_start();
include('../com

Reading waves
Hi,

I am trying to find a way of finding the highs and lows on a graph line, the line points

Displaying Multidimensional Arrays...about to put my head in a vice, PLEASE HELP
I am fairly new to PHP and MySQL and I have a problem which I have been trying to resolve for days.

PHP IMAGE UPLOAD SCRIPT
Hi for the last week i have been looking for scripts that will upload a photo to a certain folder wh

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