Need guidance on how to change font color using CSS

maximus1974
maximus1974 used Ask the Experts™
on
I want to change the font color of a row to white when an order is Priority = 1 with the database. I assume I will accomplish this by using CSS.
I am using third party that came with our ERP which displays dashboards. Can anyone point me in the right direction on how
to accomplish this? below is the complete sql statement I am using to display results in the dashboard. Also attached a screenshot of how the
results are displayed.

SELECT WO_NUMBER AS WONUM
      ,PART_NUMBER AS PN
      ,DESCRIPTION AS DESCR
      ,PRIORITY
      ,CASE CONTRACT_TYPE WHEN 'PBH Pool' THEN 'PBH' ELSE 'TM' END AS CONTRACT
      ,DAYS_OPEN AS TAT
      ,CASE WARRANTEE_FLAG  WHEN 'F' THEN ' ' WHEN 'T' THEN 'W' END AS INFO
      ,TECHNICIAN AS TECH
,case when days_open > 5 or priority >= 1 then '#ff0000' else case when days_open > 3  then '#f68835' else '#66b65d' end end row_color
  FROM BA_VIEW_WIP_SHOP_SCREENS
  WHERE STATUS IN ('OPEN', 'AWT SHOP EVAL', 'SHOP EVALUATION') AND SHOP = 'SH AVIONIC ARO'
order by days_open desc

Open in new window

Capture.PNG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
Generally, the CSS would go in your HTML, not the SQL Query. Basically, when you build the HTML, you would do the CSS there. Don't know how you're doing that but a quick example would be:

<?php while ( $row = $records->fetch() ) : ?>
<tr class="<?= $row->PRIORITY == 1 ? 'hilite' : null ?>">
    <td><?= $row->WONUM ?></td>
    <td><?= $row->PN ?></td>
    <td><?= $row->DESC ?></td>
</tr>
<?php endwhile; ?>

Open in new window

Now any row where PRIORITY is one will have a class of hilite added to it. You can then style that using css:

.hilite { color: white; }

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial