Jeannie109 Posted June 4, 2006 Share Posted June 4, 2006 I have a Job List with different fields. I would like a column that would have the ability to click on C(ompleted) and when you check it off it will post these jobs to a new web page of completed jobs. Actually, instead of having the Delete choice, I would like a C(ompleted) choice with the V(iew) and E(dit) I can't figure out how to do this. Any help would be appreciated. Here is the site: [a href=\"http://jobboard.bernardtransportation.com/jobs.php?posting=yes&\" target=\"_blank\"]http://jobboard.bernardtransportation.com/...hp?posting=yes&[/a]Please don't delete any entries or make any radical changes to the Job List. Link to comment https://forums.phpfreaks.com/topic/11166-completed-task-columnpost-to-new-web-page/ Share on other sites More sharing options...
Barand Posted June 5, 2006 Share Posted June 5, 2006 Here's one way[code]<?php if (isset($_GET['action'])) { $id = $_GET['id']; switch ($_GET['action']) { case 'D': # delete rec with id = $id here echo "Deleting $id"; break; case 'V': /* # display rec with id = $id # eg header("location: taskdetail.php?id=$id"); exit; */ echo "Viewing $id"; break; case 'E': /* # display edit form for rec with id = $id # eg header("location: taskedit.php?id=$id"); exit; */ echo "Editing $id"; break; } }?><hr/>Task 1 <a href='?action=V&id=1'>View</a> <a href='?action=E&id=1'>Edit</a> <a href='?action=D&id=1'>Delete</a><br />Task 2 <a href='?action=V&id=2'>View</a> <a href='?action=E&id=2'>Edit</a> <a href='?action=D&id=2'>Delete</a><br />Task 3 <a href='?action=V&id=3'>View</a> <a href='?action=E&id=3'>Edit</a> <a href='?action=D&id=3'>Delete</a><br />[/code] Link to comment https://forums.phpfreaks.com/topic/11166-completed-task-columnpost-to-new-web-page/#findComment-41972 Share on other sites More sharing options...
Jeannie109 Posted June 5, 2006 Author Share Posted June 5, 2006 Barry,Thank you so much for writing back. I appreciate your trying to help with the code. However, I already have the capability to View Edit and Delete. What I need is the code for one of the Options to be [b]Complete[/b] or [b]Done[/b], INSTEAD of Delete, and for the items once completed to be posted to a new page, complete.php. Is that something that is feasible?Again, thank you so much for offering to help.Jeannie Link to comment https://forums.phpfreaks.com/topic/11166-completed-task-columnpost-to-new-web-page/#findComment-42092 Share on other sites More sharing options...
Barand Posted June 5, 2006 Share Posted June 5, 2006 My preferred method is to put a checkbox against each item. Give the checkboxes the same name, something like "done_task[]" and give each the value of the task id[code]TASK 1 <input type='checkbox' name='done_task[]' value='$task_id'>[/code]When you process[code]if (isset($_POST['done_task'])) { $done_id_list = join (",", $_POST['done_task']); mysql_query ("UPDATE tasks SET completed = 1 WHERE id IN ($done_id_list)");}[/code] Link to comment https://forums.phpfreaks.com/topic/11166-completed-task-columnpost-to-new-web-page/#findComment-42172 Share on other sites More sharing options...
.josh Posted June 5, 2006 Share Posted June 5, 2006 barry? aHAHahAHAHahHAAa ermm...yeah anyways, in case it's not clear, with barand's ^ post, you would then select/echo items on each of your pages, based on the 'completed' field being set to 1 or not. Link to comment https://forums.phpfreaks.com/topic/11166-completed-task-columnpost-to-new-web-page/#findComment-42178 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.