<?php
while ( $row = mysql_fetch_array( $query ) ) {
$id=$row["id"];
$purchase_id=$row["purchase_id"];
$sql1=mysql_query( "select *,DATE_FORMAT(`date`,'%Y-%m-%d') as date from purchase_detail where id='$purchase_id'" );
$row1=mysql_fetch_array( $sql1 );
$date=$row1["date"];
$material_detail=$row1["material"];
$purchase_price=$row1["purchase_price"];
$sales_price=$row1["sales_price"];
$vendorname=$row1["vendorname"];
$comname=$row1["comname"];
$other_detail=$row1["other_detail"];
$type=$row1["type"];
echo"<tr bgcolor='#FFFFFF'>";
$bill_no=$row["bill_no"];
if ( $bill_no == '' ) {
echo "<tr bgcolor='pink'>";
}
if ( $bill_no != '' ) // when i use if condition than search option not working
{
echo"<tr bgcolor='red'>";
}
else {
echo"<tr bgcolor='white'>";
}
echo "<td><input type='checkbox' class='active' name='active[]' id='active' value='".$row["id"]."'></input></td>";
echo "<td> ".$row["make_bill_id"]."</td>";
echo"<td>".$row["bill_no"]."</td>";
echo"<td>".$date."</td>";
echo "<td> ".$material_detail."</td>";
echo "<td> ".$other_detail."</td>";
echo "<td> ".$purchase_price."</td>";
echo "<td> ".$vendorname."</td>";
echo "<td> ".$sales_price."</td>";
echo "<td> ".$type."</td>";
echo "<td> ".$comname."</td>";
echo "<td> ".$row["assign_by"]."</td>";
echo"</tr>";
}
?>
// Remove this one
//echo"<tr bgcolor='#FFFFFF'>";
$bill_no=$row["bill_no"];
if ( $bill_no == '' ) {
echo "<tr bgcolor='pink'>";
}
else if ( $bill_no != '' ) // when i use if condition than search option not working
{
echo"<tr bgcolor='red'>";
}
else {
echo"<tr bgcolor='white'>";
}