PHP 결과에서 5 개의 열을 반환하는 스크립트가 있습니다. 기한 날짜와 현재 날짜 중 하나를 일치 시키려고합니다. 반환 된 날짜가 오래된 경우 해당 행을 강조 표시하고 싶습니다. 그것은 어떤 이유로는 보이지 않습니다. if 문을 테스트 한 결과 작동합니다.결과에서 행 강조하기
<?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();
?>
반환되는 행을 강조 표시하는 PHP 클래스가 있습니까?
이 경우 CSS를 사용하십시오. –
정상 흐름이 누락되어 강조 표시된 셀만 인쇄하고 있습니까? – Tokk
아니요 그냥 강제로 싶었습니다 – user1010756