Please someone..anything! Help!!
Posted: Thu Mar 26, 2009 9:47 am
I was asked to create another condition. If the date the client initially registered is more than 12 months ago then they'll have to take a 12th month survey, if less than 12th month then they'll have to take the 6th month survey. Now so you understand, the 6th month code already existed when I started working here so all I added was the 12th month condition. However, here's the part that confuses me. There's a column in the database that keeps track of when the 6th month survey was taken so when i created the 12th month condition I created a new column to keep track of that date but now that I'm trying to figure out how that date is being entered I'm told that it's timestamped, so supposedly it does it automatically. I don't get it! Where in the code below does it create a new record or lets that field in MySQL that it should update??? Please help!
Code: Select all
if($result){
if(mysql_num_rows($result)==1){
$row=mysql_fetch_assoc($result);
echo '<p><b>Client ID: </b>'.$row[tblPart_ID_Pk].'<br>';
echo '<p><b>Mother\'s Initials: </b>'.$row[tblPart_FirstTwoLettersMothersFirstName].'<br>';
echo '<p><b>Birth Year: </b>'.$row[tblPart_TwoDigitBirthYear].'<br>';
echo '<p><b>Birth Day: </b>'.$row[tblPart_TwoDigitBirthDay].'<br>';
echo '<p><b>Initial Survey/Registration Date: </b>'.date("m.d.Y", strtotime($row[tblPart_Timestamp])).'</p>';
echo '<p><b>Click here for Client <font color="red">'.$row[tblPart_ID_Pk].'</font></b>';
if ((date('Y-m-d') >= date('Y-m-d', DateAdd('m', 12, strtotime($row[tblPart_Timestamp])))) && $row[tblPart_twelveMonthDate] =='0000-00-00'){
echo '<a href="http://sphprojects.umdnj.edu/perseus/se.ashx?s=6A0A4CEE6D258687#A1" target="_blank" onClick= "return confirm(\'Click OK, ONLY if you are about to complete the 12-Month Survey, otherwise click CANCEL.\')"><b><u> 12-Month Survey</u></b></a>';
}elseif ((date('Y-m-d') >= date('Y-m-d', DateAdd('m', 6, strtotime($row[tblPart_Timestamp])))) && $row[tblPart_sixthMonthDate] =='0000-00-00'){
echo '<a href="http://sphprojects.umdnj.edu/perseus/se.ashx?s=6A0A4CEE6D258687#A1" target="_blank" onClick= "return confirm(\'Click OK, ONLY if you are about to complete the 6-Month Survey, otherwise click CANCEL.\')"><b><u> 6-Month Survey</u></b></a>';
}else{
echo '<a href="http://sphprojects.umdnj.edu/perseus/se.ashx?s=6A0A4CEE6D258687#A1" target="_blank"><b><u> Visit Survey</u></b></a>';
}
mysql_close();
}
}else{
}