R8  

Go Back   R8 > Design & Development > Programming
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-11-2009, 10:11 AM
realistic realistic is offline
Senior Member
 
Join Date: Oct 2008
Posts: 310
Question Help required in delete option

The delete option is not working in table. Please help me

here is my php script


<?php
$link = mysql_connect("localhost", "root", "")
or die("Could not connect: " . mysql_error());
mysql_select_db('taskmangment', $link)
or die(mysql_error());
?>
<?php
switch ($_GET['action'])
{
case "remove":

$sql = "DELETE FROM AddJob WHERE note_id='".$_GET['id']."'";
break;
}

if (isset($sql) && !empty($sql)) {
echo "<!--" . $sql . "-->";
$result = mysql_query($sql)
or die("Invalid query: " . mysql_error());
}
?>

<html>
<head>
<title>JobNotes</title>
<style type="text/css">
TD{color:#353535;font-family:Verdana, Arial, Helvetica, sans-serif}
TH{color:#FFFFFF;font-family:Verdana, Arial, Helvetica,
sans-serif;background-color:#336699;font-size:10pt}
body,td {
border-left:#FFF;
font-size: 8pt;
}
a:link {
color: #00F;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #00F;
}
a:hover {
text-decoration: none;
color: #600;
}
a:active {
text-decoration: none;
color: #00F;
}
</style>
<script>
function deleteAlert(id){
var conBox = confirm("Are you sure you want to delete");
if(conBox){
location.href="JobNotes.php?note_id="+ id + "&action=remove";
}else{
return;
}
}
</script>
<script type="text/javascript">
function open_win()
{
window.open("New_Notes.php?action=add&id=",'','wid th=480,height=200,left=450,top=150');
}

</script>
<script type="text/javascript">
function edit_win(id)
{
var url="New_Notes.php?note_id="+id+"&action=edit";

window.open(url,'','width=480,height=200,left=450, top=150,resizable=yes');
}

</script>

<script type="text/javascript">
function Att_win(id)
{
var url="AddNew1.php?note_id="+id+"&action=add1";

window.open(url,'','width=480,height=200,left=450, top=150,resizable=yes');
}

</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<table border="0" width="100%" cellspacing="1" cellpadding="3"
bgcolor="#353535" >
<tr>
<th bgcolor="#FFFFFF" align="center">
JobNotes
</th>
<th colspan="2" align="left" bgcolor="#FFFFFF"><input type='button'
value="AddNew" onClick="open_win()"></th>
</tr>
<?php
$sql = "SELECT * FROM AddJob ORDER BY note_id";
$result = mysql_query($sql)
or die("Invalid query: " . mysql_error());
while ($row = mysql_fetch_array($result)) {
?>
<tr>
<td bgcolor="#FFFFFF" width="77%">
Asigned to:&nbsp;<?php echo $row['Ass']; ?>&nbsp;&nbsp;|&nbsp;&nbsp;Deliverd Date(M/d/Y):&nbsp;
<?php echo $row['Ddate']; ?>&nbsp;&nbsp;|&nbsp;&nbsp;Verified By:
</td>
<td width="13%" rowspan="3" align="right" valign="top" bgcolor="#FFFFFF"><?php echo $row['date_time']; ?></td>
<td width="10%" rowspan="3" align="right" valign="top" bgcolor="#FFFFFF">
<a href="javascript:edit_win(<?php echo $row['note_id']?>)"><img src="Images/edit.gif" width="16"
height="16" hspace="0" vspace="0" border="0"></a>
<a href="javascript:deleteAlert('id')">Remove</a>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><?php echo nl2br($row['note']); ?></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><a href="javascript:Att_win(<?php echo $row['note_id']?>)">Attchments</a></td>
</tr>
<?php
}
?>

</table>
</body>
</html>
__________________
SEO Services | Natural Acne Treatment
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:39 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.