This topic is locked

adding a checkbox(link to datafield) in List

10/14/2006 4:32:09 PM
PHPRunner General questions
E
emdee author

I have a table called MEMBERS ....for events like party or Fieldtrip etc...i like to handpick some MEMBERS.

The list view shows a nice overview of all members in the table....one of the fields in the table is SELECT..this is the checkbox i want to use to "flag" the members i want to select.

The problem is that to check this box, i have to first edit every record individually...I would be very logical to use the list page for this...so the list page should have a possiblity to show a "realtime" datafield.

Is this possible, because i have not discoverd it so far....

Mark
PHPRUNNER 3.1 in Demo mode(evaluating....)

Admin 10/16/2006

Mark,
you can do this modifying PHPRunner-crteated files manually.

This task requires some PHP knowledge.
You can extend the "Delete selected" functionality to flag users instead of deleting them.

Make a copy of "Delete selected" link, modify it and add a code to generated ..._list.php file that will "flag" the users you selected.

E
emdee author 10/18/2006

Mark,

you can do this modifying PHPRunner-crteated files manually.

This task requires some PHP knowledge.
You can extend the "Delete selected" functionality to flag users instead of deleting them.

Make a copy of "Delete selected" link, modify it and add a code to generated ..._list.php file that will "flag" the users you selected.


Is it also possible to do this by modifying the template. So that i do not have implement this code manually everytime I rebuild the site?

Admin 10/18/2006

Hi,
sure, you can modify files in C:\Program Fiels\PHPRunner3.1\source folder for this.

E
emdee author 10/18/2006

Hi,

sure, you can modify files in C:\Program Fiels\PHPRunner3.1\source folder for this.


Perfect! I am beginning to like the program more and more <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=11921&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />

Maybe anyone can help me with this item?
I found the delete function:
foreach(@$_POST["mdelete"] as $ind)

{

$keys=array();

$keys["idLeden"]=refine($_POST["mdelete1"][$ind-1]);
$strSQL="update ".AddTableWrappers($strOriginalTableName)." where ".KeyWhere($keys);

..

..

}




I know it must be rather easy...but i am a newby....( I know you guest already lol)

I know its something with an UPDATE query

I like to change the delete function to flag a field in my database...

J
Jane 10/19/2006

Here is a step-by-step instruction:

  1. open your page in the HTML mode on the Visual Editor tab. Find this line:
    <!-- delete form -->



and add following code just before:

<A

onclick="if (!confirm('Do you really want to update these records?')) return false; frmAdmin.a.value='update'; frmAdmin.submit(); return false;"

href="orders_list.htm#">Update selected</A>


2. Proceed to the Events tab, select Before record deleted event and add your code in it.

Here is a sample:

function BeforeDelete($where)

{

//if you click on the delete link

if(@$_POST["a"]=="delete")

return true;
//if you click on the update link

global $conn;

$strSQL="update TableName set FieldName1 = 'you value' where ".$where;

db_exec($strSQL,$conn);
return false;

}

T
thesofa 10/24/2006

onclick="if (!confirm('Do you really want to update these records?')) return false; frmAdmin.a.value='update'; frmAdmin.submit(); return false;"

href="orders_list.htm#">Update selected</A>


should the frmAdmin be changed to reflect the name of the form being used, or is the frmAdmin a command?

J
Jane 10/24/2006

frmAdmin is a name of HTML form. This name is used in the JavaScript code.

Don't change this parameter.