Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6744673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:06:43+00:00 2026-05-26T12:06:43+00:00

I have a script which returns 5 columns from a php result. I am

  • 0

I have a script which returns 5 columns from a php result. I am trying to match one of the columns due date against the current date. If the date returned is older I want to highlight that row. It does not seem to for some reason. I have tested my if statement and it work.

<?php
    // First of all initialise the user and check for permissions
    require_once "/var/www/users/user.php";
    $user = new CHUser(7);

    // Initialise the template
    require_once "/var/www/template/template.php";
    $template = new CHTemplate();

    // And create a cid object
    require_once "/var/www/WIPProgress/DisplayWIPOnLocation.php";
    $WIPProgress= new CHWIPProgress();
    $content = "<h1>Check WIP Status on Location </h1>";
    $content = 
        "<form action='index.php' method='get' name ='location'>
            <select id='location' name ='location'  >
        <option>Skin Room</option>
                <option>Clicking</option>
                <option>Kettering</option>
        <option>Closing</option>
                <option>Rushden</option>
                <option>Assembly</option>
                <option>Lasting</option>
                <option>Making</option>
                <option>Finishing</option>
                <option>Shoe Room</option> 
             </select>
             <input type='submit' />
         </form>"; 

    if(isset($_GET['location'])) {
         $wip = $WIPProgress->ListWIPOnLocation($_GET['location']);
         $location = $_GET['location'];
         $todays_date = date("Y-m-d H:i:s");

         // Now show the details
         $content .= 
             "<h2>Details for $location </h2>
             <table>
                 <tr>
                     <th>PPDescription</th>
                     <th>Works Order</th>                 
                     <th>Bundle Number</th>
                     <th>Bundle Reference</th>
                     <th>Due Date</th>  
                 </tr>";

         foreach($wip as $x) {
             if(strtotime($x['DueDate']) > strtotime($todays_date)){ 
                 $content .= 
                     "<tr bgcolor='#FF0000'>
                         <td>" . $x['Description'] . "</td>
                         <td>" . $x['WorksOrder'] . "</td>
                         <td>" . $x['Number'] . "</td>
                         <td>" . $x['Reference'] . "</td>
                         <td>" . $x['DueDate'] . "</td>
                     </tr>";
             }
         }
    }
    else {
         $content .= "<h3>Please choose a location to view WIP</h3>";
    }

    $template->SetTag("content", $content);
    echo $template->Display();
?>

Is there any classes available in php which highlights rows returned?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:06:43+00:00Added an answer on May 26, 2026 at 12:06 pm

    Instead of defining bgcolor with tr define with each td in it.

    OR better way to associate a CSS class to the tr and target all the td of this tr through CSS.

    $content .= "<tr class='highlight'>...";
    
    <style>
    .highlight td
    {
      background-color:#FF0000;
    }
    </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CSV export script (enrdata_arch.php) which calls information from an existing database
I have a script which returns a price for a product. However, the price
I have a php script which outputs an image, how can I POST data
I have a simplified ajay script, from which I have removed all nonrelevant code.
I have a small ajax jquery script which returns some XML for me. Whilst
I am using Ext.data.Store to call a PHP script which returns a JSON response
Hi I have a shell script which should run based on the return of
I have a script which contacts a few sources and tell them the IP-address
I have a script which logs on to a remote server and tries to
I have a script which will be run interactively by non-technical users. The script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.