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

Not Inserting into DB
I can't get my Add new Division form to submit to the database. Anyone see my issue?

Code: &a

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data

file downloaded can't be read !!
<?php
$fileName = 'mypic.jpg';
$mimeType = 'image/jpeg';
header('content-dispositio

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Image loading
Hi Developers,

I'm trying to display an image from images/image.gif getting the url from mysq

having probem inserting data into db table
hi

i have a table with following columns in it
Code: candidate_id, degree, cgpa, institute

Gridview Not updating in Update Panel
I have a gridview, three dropdown list boxes, and a button on my form. What is displayed in the gri

DBCA Templates
Hi all,

I'm working on creating a template for DBCA, but can't find any documentation on the

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