Hello, i have this code below where i can activate / deactivate a art(product) and it works fine.
What i want to do now is change this part of code below with checkboxes.
<?
$active = $row->state;
if($active)
{
$status = "<td bgcolor=#FFFFFF valign=\"top\">(<font color=#336600><b><i>Active</i></b></font> )</td> <td bgcolor=#FFFFFF valign=\"top\"><a href=$PHP_SELF?deactivate=1&done=1&art_id=$id>Deactivate</a></td>";
}
else
{
$status = "<td bgcolor=#FFFFFF valign=\"top\">(<font color=red><i>InActive</i></font> )</td> <td bgcolor=#FFFFFF valign=\"top\"><a href=$PHP_SELF?done=1&art_id=$id>Make Active</a></td>";
}
print "$status";
?>
Can u any please help me....
here is the full code:
<?
if($done)
{
if($deactivate)
{
$query = "UPDATE arts SET state = 0 WHERE artID = $art_id";
$result=mysql_query($query)or die (mysql_error(). " : ".mysql_errno());
}
else
{
$query = "UPDATE arts SET state = 1 WHERE artID = $art_id";
$result=mysql_query($query)or die (mysql_error(). " : ".mysql_errno());
}
echo "<script language=\"JavaScript\" type=\"text/javascript\">\n";
echo "<!--\n";
echo "location.href = 'voorb.php';\n";
echo "//-->\n";
echo "</script>\n";
}
else
{
print "<table border=1 cellpadding=3 cellspacing=0 width=95% bordercolor=#000000>";
print "<tr><td width=10% bgcolor=\"#9900FF\"><font color=\"#ffffff\"><b>Status</b></font></td><td width=10% bgcolor=\"#9900FF\"><font color=\"#ffffff\"><b>Action</b></font></td><td width=10% bgcolor=\"#9900FF\"><font color=\"#ffffff\"><b>Art Name</b></font></td><td width=10% bgcolor=\"#9900FF\"><font color=\"#ffffff\"><b>Category</b></font></td></tr><tr>";
while($row=mysql_fetch_object($result))
{
$result1=mysql_query("select categoryName from category where categoryID=$row->categoryID ") or die (mysql_error(). " : ".mysql_errno());
$row1=mysql_fetch_object($result1);
$id = $row->artID;
$active = $row->state;
if($active)
{
$status = "<td bgcolor=#FFFFFF valign=\"top\">(<font color=#336600><b><i>Active</i></b></font> )</td> <td bgcolor=#FFFFFF valign=\"top\"><a href=$PHP_SELF?deactivate=1&done=1&art_id=$id>Deactivate</a></td>";
}
else
{
$status = "<td bgcolor=#FFFFFF valign=\"top\">(<font color=red><i>InActive</i></font> )</td> <td bgcolor=#FFFFFF valign=\"top\"><a href=$PHP_SELF?done=1&art_id=$id>Make Active</a></td>";
}
print "$status";
print "<td bgcolor=#FFFFFF valign=\"top\">$row->name</td>";
print "<td bgcolor=#FFFFFF valign=\"top\">$row1->categoryName</td>";
print "</tr>";
}
print "</table>";
}
?>