Deactivating links in PHP -


the below code has link apply job when deadline not met.how can make link deactivate after deadline application has passed,or change link label 'apply' 'closed'?i appreciate help.

while($row = mysqli_fetch_array($query))   {      $ref=$row['id'];    echo "<tr id=".$ref.">";    echo "<td >" .$row['refno'] . "</td>";    echo "<td >" . $row['title'] . "</td>";    echo "<td >" . $row['positions'] . "</td>";    echo "<td>" . $row['typeofcontract']."</td>";    echo "<td>" . $row['deadline'] . "</td>";    echo "<td>" .$row['dept']."</td>";    $det= $row['details'];     echo "<td style='width:100px' >" ."<a href='../../admin/admin/jobdetails/".$det."' target='_blank'>job details</a>" . "</td>";     echo "<td>".'<a href="apply.php?deptid='.$ref.'" style="color:blue" >apply</a>'."</td>";    echo "</tr>";   } 

 if($row['deadline'] >= time()) echo "<td>".'<a href="apply.php?deptid='.$ref.'" style="color:blue" >apply</a>'."</td>"; 

if $row['deadline'] timestamp, echo fired if timestamp lower actual time. of course can return html in case, example:

 if($row['deadline'] >= time()) echo "<td>".'<a href="#" style="color:blue" >deadline reached</a>'."</td>"; 

hope helps

edit:

http://www.w3schools.com/php/func_date_time.asp


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -