Dear All,
i want to make a program through which, our chairman gets a prompt message one day before a deadline of a specific event comes.
In database, il make a database fields like,
serialno, file, intial date, deadline date, status

how a user to get a deadline prompt message continues blinking when a deadline of a file comes?
Help Please !

Recommended Answers

Compare Today date and Dead line date...
If Today date is less than deadline date , Print your Prompt

message in blinking area..

If you have any doubt in date and date comparison, please check

Jump to Post

How is your date data stored? unix datetime (2013-01-02) or unix timestamp (1357084800).

Jump to Post

All 8 Replies

Member Avatar

How is your date data stored? unix datetime (2013-01-02) or unix timestamp (1357084800).

Im storing date in YYYY-MM-DD format for eg 2013-12-30

Actually i want to alert the user the number of timeout events with a alert message with an option for VIEW those timeout events OR CLOSE.

Member Avatar

If you want js alert:

var diff = new Date(new Date("2012-01-03") - new Date("2012-01-02"));
alert(days = diff/86400000);

You can insert dates from php:

var diff = new Date(new Date("<?php echo $date1;?>") - new Date("<?php echo $date2;?>"));
alert(days = diff/86400000);

No, Diafol;
your not getting the point !
I dont want user to input into prompt message.
i want to show an alert message on the basis of the recordset showing records of pending events which have crossed the deadline dates.

1) alert box showing options

what i need is a alert box ! havivng option VIEW and CLOSE, If user clicks VIEW it redirects to the page showing the timeout/pending records else on the same page..


Member Avatar

OK, use the datediff function in mysql.

SELECT * FROM table WHERE DATEDIFF(`deadline_date`,CURDATE()) <= 1

You can then get the actual items and the total number of them.
Or if you just need the total number for showing in the alert box:

SELECT COUNT(*) AS cnt FROM table WHERE DATEDIFF(`deadline_date`,CURDATE()) <= 1

Warning: Not Tested

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.