I have not got a piece of code as I cannot seem to get my head around it.
What I do have is what I am using to extract the data from the database.
When the date is inserted into the database it is formatted like this
14-05-2007 and is displayed the same way.
This is the full code I am using:
<?php
echo "
<br />
<br />
<table id='users'>
<tr class='tablehead'>
<td>Title</td>
<td>Name</td>
<td>Department</td>
<td class='center'>Start Date</td>
</tr>
";
$sql="SELECT * FROM user_info ORDER BY Start_Date";
$result=mysql_query($sql);
// Define $color=1
$color="1";
while($rows=mysql_fetch_array($result)){
$id ="$rows[id]";
// If $color==1 table row color = #FFC600
if($color==1){
echo "
<tr bgcolor='#F0F5FE'>
<td>".$rows['Title']."</td>
<td><a
href='users_view_individual.php?cmd=edit&id=$id'>".$rows['First_Name']."&nbs
p;".$rows['Last_Name']."</a></td>
<td>".$rows['Department_Name']."</td>
<td align='center'>".$rows['Start_Date']."</td> <<<<<<<<<<<<<<<<<<< this is
where I need the date to go red when it approaches the due date. Date is
formatted as 14-05-2007
</tr>";
// Set $color==2, for switching to other color
$color="2";
}
// When $color not equal 1, use this table row color
else {
echo "
<tr bgcolor='#ffffff'>
<td>".$rows['Title']."</td>
<td><a
href='users_view_individual.php?cmd=edit&id=$id'>".$rows['First_Name']."&nbs
p;".$rows['Last_Name']."</a></td>
<td>".$rows['Department_Name']."</td>
<td align='center'>".$rows['Start_Date']."</td>
</tr>";
// Set $color back to 1
$color="1";
}
}
echo '</table>';
mysql_close();
?>
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Daniel Israel
Sent: 13 May 2007 18:27
To: [email protected]
Subject: RE: [php-list] after certain date do this....
Maybe if you post the code you have that's not working, we can help you get
it working.
-D. Israel
[EMAIL PROTECTED] <mailto:dan%40ebji.org>
http://www.customcodebydan.com
AIM: JudoDanIzz
(A)bort, (R)etry, (I)nfluence with large hammer.
> -----Original Message-----
> From: [email protected] <mailto:php-list%40yahoogroups.com>
> [mailto:[email protected] <mailto:php-list%40yahoogroups.com> ] On
Behalf Of Mark Mckee
> Sent: Sunday, May 13, 2007 10:08 AM
> To: [email protected] <mailto:php-list%40yahoogroups.com>
> Subject: RE: [php-list] after certain date do this....
>
> Thanks for the info. I'm unfortunately not getting it though.
> I understand what you mean but I am having trouble trying to
> get anything working. Do you have any more info or perhaps
> some references I can check out?
>
>
>
> From: [email protected] <mailto:php-list%40yahoogroups.com>
> [mailto:[email protected] <mailto:php-list%40yahoogroups.com> ] On
Behalf Of Wade Smart
> Sent: 13 May 2007 17:42
> To: [email protected] <mailto:php-list%40yahoogroups.com>
> Subject: Re: [php-list] after certain date do this....
>
>
>
> 05132007 1136 GMT-6 DST
>
> Start with something like this:
>
> $duedate = some date
> Get the date that is five days before the date with either
> strtotime() or mktime()
>
> Then if the $duedate is 5 days out = font color equals red.
> Sending the email is the same...
> if the duedate is five days out = font color red, send mail.
>
> Wade
>
> On Sun, 2007-05-13 at 17:23 +0100, Mark Mckee wrote:
> > Hi All
> >
> >
> >
> > I need a little help. I am creating an internal site for work.
> > Basically
> we
> > will be adding names and info to a database that have to
> have certain
> things
> > done before a certain date. Each date is different. I need a little
> > help with a php script that will detect the date and change
> the font
> > colour to red if the date is 5 days away or has passed completely.
> >
> >
> >
> > I would like to have an email sent to a certain person when it is 5
> > days before, then an email sent to multiple people if the
> date arrives
> > and
> passes
> >
> >
> >
> > Is this possible and could someone point me in the right
> direction to
> > get started?
> >
> >
> >
> > Mark M.
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > Community email addresses:
> > Post message: [email protected]
<mailto:php-list%40yahoogroups.com>
> > <mailto:php-list%40yahoogroups.com>
>
> > Subscribe: [EMAIL PROTECTED]
<mailto:php-list-subscribe%40yahoogroups.com>
> <mailto:php-list-subscribe%40yahoogroups.com>
> > Unsubscribe: [EMAIL PROTECTED]
<mailto:php-list-unsubscribe%40yahoogroups.com>
> <mailto:php-list-unsubscribe%40yahoogroups.com>
> > List owner: [EMAIL PROTECTED]
<mailto:php-list-owner%40yahoogroups.com>
> <mailto:php-list-owner%40yahoogroups.com>
> >
> > Shortcut URL to this page:
> > http://groups.yahoo.com/group/php-list
> > Yahoo! Groups Links
> >
> >
> >
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> Community email addresses:
> Post message: [email protected] <mailto:php-list%40yahoogroups.com>
> Subscribe: [EMAIL PROTECTED]
<mailto:php-list-subscribe%40yahoogroups.com>
> Unsubscribe: [EMAIL PROTECTED]
<mailto:php-list-unsubscribe%40yahoogroups.com>
> List owner: [EMAIL PROTECTED]
<mailto:php-list-owner%40yahoogroups.com>
>
> Shortcut URL to this page:
> http://groups.yahoo.com/group/php-list
> Yahoo! Groups Links
>
>
>
[Non-text portions of this message have been removed]