change color of list elements according to condition

后端 未结 1 650
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 04:24

I have two tables :

Table 1 (overall Score )

Table 2 (weekly score )

I have a leaderboard where I am echoing the overall score value from T

1条回答
  •  天涯浪人
    2020-12-12 04:45

    1) Join the the queries into one

    select EmployeeTable.*,Table2.pointsRewarded as `weeklyDelta`
    from EmployeeTable join Table2 on EmployeeTable.EmployeeID = Table2.EmployeeID
    where Table2.WeekNumber = 'week1'
    order by Total_points_Rewarded desc
    

    2) Then give the employees with negative deltas a special class

    " .
            $toprow2['overallRank'] . "" . 
            $toprow2['EmployeeName'] . "" . 
            $toprow2['Total_points_Rewarded'] . "
    "; } ?>

    3) give those employees a style

    .parent-div.dropped { color:red }
    

0 讨论(0)
提交回复
热议问题