hi guyz can u help me here..
hi guyz how can i work this in checkbox i want to delete the check box..
thanks for who want to help me..
PHP Code:
$view = safe(cleanInput($_GET["view"]));
//////ALL LISTS SCRIPT <<
if($view=="")$view="all";
if($page=="" || $page<=0)$page=1;
$myid = getuid_sid($sid);
$doit=false;
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$uid."'"));
$num_items = $noi[0]; //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
if($num_items>0)
{
if($doit)
{
$exp = "&rwho=$myid";
}else
{
$exp = "";
}
//changable sql
if($view=="all")
{
$sql = "SELECT
a.name, b.id, b.byuid, b.unread, b.starred FROM ibwf_users a
INNER JOIN ibwf_private b ON a.id = b.byuid
WHERE b.touid='".$myid."' AND b.folderid='0'
ORDER BY b.timesent DESC
LIMIT $limit_start, $items_per_page
";
}else if($view=="snt")
{
$sql = "SELECT
a.name, b.id, b.touid, b.unread, b.starred FROM ibwf_users a
INNER JOIN ibwf_private b ON a.id = b.touid
WHERE b.byuid='".$myid."'
ORDER BY b.timesent DESC
LIMIT $limit_start, $items_per_page
";
}else if($view=="str")
{
$sql = "SELECT
a.name, b.id, b.byuid, b.unread, b.starred FROM ibwf_users a
INNER JOIN ibwf_private b ON a.id = b.byuid
WHERE b.touid='".$myid."' AND b.starred='1'
ORDER BY b.timesent DESC
LIMIT $limit_start, $items_per_page
";
}else if($view=="urd")
{
$sql = "SELECT
a.name, b.id, b.byuid, b.unread, b.starred FROM ibwf_users a
INNER JOIN ibwf_private b ON a.id = b.byuid
WHERE b.touid='".$myid."' AND b.unread='1'
ORDER BY b.timesent DESC
LIMIT $limit_start, $items_per_page
";
}
$items = mysql_query($sql);
echo mysql_error();
while ($item = mysql_fetch_array($items))
{
$avlink = getavatar($item[2]);
if($item[3]=="1")
{
$iml = "[U]";
}else{
if($item[4]=="1")
{
$iml = "[S]";
}else{
$iml = "[R]";
}
}
$lnk = "<form action=\"inbox.php?\" method=\"post\"><input type=\"checkbox\" name=\"checkbox[]\" value=\"$item[1]\">
<a href=\"inbox_readpm.php?pmid=$item[1]\">$iml$item[0]</a>";
$pmtext = mysql_fetch_array(mysql_query("SELECT text FROM ibwf_private WHERE id='".$item[1]."'"));
$mprev = (htmlspecialchars(strlen($pmtext[0])<20?$pmtext[0]:substr($pmtext[0], 0, 15)));
//$mtext = parsepm($mprev, $sid);
echo "$lnk: $mprev..";
echo "<br/>";
}
echo "Selected: <select name=\"checkbox\">";
echo "<option value=\"1\" select>Delete</option>";
echo "</select>";
echo "<input type=\"submit\" class=\"button\" value=\"Submit\"/>";
echo "</form>";
foreach ($_POST["checkbox"] as $value)
{
if(value=="1")
{
echo " Cant Delete Message,It Is Reported.";
}else{
$del = mysql_query("DELETE FROM ibwf_private WHERE id={$value}");
if($del)
{
echo "Message Deleted Successfully";
}else{
echo "Can't Delete Message At The Moment";
}
}
}
thanks for who want to help me..
Comment