This topic is locked

Reassign child records

10/20/2009 9:17:55 AM
PHPRunner General questions
P
Phil_G author

Hello All

Kinda stuck on this and looking for some inspiration.

I have a simple master-child relationship between two tables (employees - orders). Every so often users need to filter the master table and reassign the orders to a different employee. For example, take all orders by Doe_J due in the next two weeks and reassign to Smith_T. There are quite a few records so going through them one by one isn't really a solution.

I'm thinking on my list page, a drop-down box that looks up the other employee + a 'Reassign!' button? But I'm stuck as to how to actually code that...

Any ideas?

J
Jane 10/20/2009
P
Phil_G author 10/21/2009

Thanks, that's great, but how could I reference the value from a custom drop-down box in the code on the afterdelete event?



Philippe,
here is a sample:

http://www.xlinesoft.com/phprunner/docs/update_multiple_records.htm

J
Jane 10/21/2009

Could you clarify what does 'custom dropdown box in the code' mean?

P
Phil_G author 10/21/2009

Sure

I need the update function to be dependent on the value taken from a dropdown box on the list page, so that the update function is dynamic. I have a code snippet with a drop-down box called 'new_cleaner', and the code in the BeforeDelete function is

$sql = "UPDATE [MWC_3].[dbo].[Cleaner_Upcoming_Jobs_view]

SET [cleaner_id] = ".$_REQUEST['new_cleaner'].$where;

CustomQuery($sql);


Except this doesn't work because the $_REQUEST['new_cleaner'] is empty.



Could you clarify what does 'custom dropdown box in the code' mean?