how to make check box for deleta all on inbox sms gateway
Posted: Thu Jul 01, 2010 4:20 am
please corect my code....
Code: Select all
<html>
<head>
<title>Inbox</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #008800;
}
-->
</style></head>
<script type="text/javascript">
function delayer(){
document.location="inbox.php"
}
function pilih_semua (jumlah)
{var i;
for (i=0; i < jumlah; i++)
document.getElementById ("checkdata" + i).checked=true;
}catch (e) {
alert (e);
}
}
return false;
}
function kosong_semua (jumlah)
{
var i;
for (i=0; < jumlah; i++)
document.getElementById("checkdata"+ i).checked=false;
return false;
}
function konfirmasi ()
{
var objek =document.getElementsByTagname ("input");
var jumlah =(objek.length -2) /2;
var total =0;
var teks ="";
var ReceivingDateTime;
var pemisah;
for (i=0; i<jumlah; i++)
{
if (document.getElementById (
"checkdata" +1). checked == true)
{
total++;
ReceivingDateTime= getElementById ("hidden" +1).value;
if (teks = "")
pemisah ="";
else
pemisah = "-";
teks =teks +pemisah + nip;
}
}
if (total >0)
{
var jawaban =confirm ("Anda akan menghapus pesan berikut?\n" + teks);
return jawaban ;
}
else
alert ("silahkan pilih dulu data yang akan dihapus");
return false;
}
function confirmation() {
var answer = confirm("Hapus pesan ini?")
if (answer){
alert("Pesan Terhapus")
window.location = "inbox.php";
}
else{
window.location = "inbox.php";
}
}
</script>
<body onLoad="setTimeout ('delayer()',100000)">
<div align=center>
<table width=65% bgcolor=#FFFFFF >
<tr>
<td width=10% align=center>
<a href=inbox.php><img src="image/inbox-48.png" title="inbox" alt="inbox" border=0></a>
</td>
<td width=10% align=center>
<a href=outbox.php><img src="image/send_48.png" title="kirim pesan" alt="kirim pesan" border=0 ></a>
</td>
<td width=10% align=center>
<a href=sentitem.php><img src="image/database_server_48.png" title="pesan terkirim" alt="pesan terkirim" border=0 ></a>
</td>
<td width=10% align=center>
<a href=info.php><img src="image/info-icon.png" title="info" alt="info" border=0></a>
</td>
</tr>
</table>
</div>
<?php
require ("connectDB.php");
$link=koneksidb();
$tablename="inbox";
$sqlstr="SELECT ReceivingDateTime,SenderNumber,TextDecoded,ID FROM $tablename order by ReceivingDateTime desc ";
$result = mysql_query ($sqlstr) or die("kesalahan pada sintak sql");
mysql_close($link);
echo("<div align=center><table width=60% border=0 width=100% cellspacing=1 cellpadding=2 bgcolor=#0099CC>");
echo("<tr><td bgcolor=#0099CC>Nomor</td><td bgcolor=#0099CC>Tanggal diterima</td><td bgcolor=#0099CC>Nomor Pengirim</td><td bgcolor=#0099CC>Pesan</td><td bgcolor=#0099CC>Balas</td><td bgcolor=#0099CC>Hapus</td></tr>");
$i =0;
while ($row = mysql_fetch_object ($result))
{
?> <form action=reply.php method=post> <?
$nomor=$nomor+1;
$ReceivingDateTime=$row->ReceivingDateTime;
$SenderNumber=$row->SenderNumber;
$TextDecoded=$row->TextDecoded;
$ID=$row->ID;
//while ($row2 = mysql_fetch_object ($result2))
//{
$Name=$row2->Name;
//}
echo("<tr><td bgcolor=#00FFFF align=center>$nomor</td><td bgcolor=#00FFFF>$ReceivingDateTime</td><td bgcolor=#00FFFF>$SenderNumber</td><td bgcolor=#00FFFF>$TextDecoded</td><td bgcolor=#00FFFF>");
?> <input type=image src="image/send_48.png" title="balas ke nomer <?echo($SenderNumber);?>" name=reply value="<?echo($SenderNumber);?>"></form>
<form action=hapus.php method=post > <?
echo("</td><td bgcolor=#00FFFF>");
?> <input type=image src="image/delete-icon.png" title="hapus" name=hapus value="<?echo($ID);?>"></form>
<form action=edit.php method=post> <?
echo("</td><td bgcolor=#00FFFF>");
?> <input type="image" src="image/image/edit_f2.png" title="edit" name=edit value="<a href="edit.php?id='.$row["$ID"].;?></form>
<?
echo("</td></tr>");
}
echo("</table>");
?>
</form>
</body>
</html>