This topic is locked

Export only selected records

8/4/2006 5:29:54 AM
PHPRunner General questions
M
myway author

I built an enterprise-database with PHPRunner 3.0 . I want to give the user the possibility to export selected data records from the main list. With PHPRunner its possible at the moment to delete selected records, so i think, it's not very difficult to do some small changes on the code?
Thank you for your support.

J
Jane 8/8/2006

Hi,
you can do it editing generated ..._list.php file manually.

We plan to add this feature to the next PHPRunner version.
We don't have a ready to go solution for this now.

M
myway author 8/11/2006

Thank you. I think, this will be a very useful feature.

M
myway author 12/26/2006

Hello,
is this function implemented in the actual version of phprunner meanwhile? Or is there a small code for that?
Thank you!

J
Jane 12/27/2006

Hi,
here is the step-by-step instruction:

  1. proceed to the Visual Editor tab
  2. turn on HTML mode, find this line:
    <!-- delete form -->

and add following code just before:

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

href="TableName_list.htm#">export records</A>


3. proceed to the Events tab and add some events.

Here is a sample code:

function BeforeDelete($where)

{

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

return true;
$_SESSION["where"].=$where." or ";

return false;

}
function AfterMassDelete()

{

header("Location: TableName_export.php");

exit();

}
function ListOnLoad()

{

$_SESSION["where"]="";

}
function ExportOnLoad()

{

global $strTableName;

$str = $_SESSION[$strTableName."_sql"]." where ".$_SESSION["where"];

$_SESSION[$strTableName."_sql"] = substr($str,0,strlen($str)-4);

}