CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Editable Grid PHP

Print topic Send  topic

Author Message
Ivo
Posted: 06/01/2003, 10:53 AM

Hello,

I have a problem with a editable grid for my php page. I found on the
codecharge site some help but not the solution.
I found the article: "deletion of records in grid using checkboxes
http://www.gotocode.com/art.asp?art_id=51

That is what I want but then for PHP.

I have an update grid working and I have and grid working to delete a field,
but everything I try, I can not find how to do this in one form.
I hope there is someone who can help me.

Thanks for helping!

Ivo


THE SCRIPT:
----------------------------------------------------------------------------
--
Header of the form:
<form name="grid" method="GET" action="shop.php">
----------------------------------------------------------------------------
--
Footer of the form:
<input type=submit value=submit> </form>
----------------------------------------------------------------------------
--
Before show for update
$fldprice = "<input type=text name=" . $fldorderline_id . " value=".
$fldprice ." size=4>";
----------------------------------------------------------------------------
--
Before show for delete:
$fldbox = "<input type=checkbox name=$fldorderline_id value=OFF>";
----------------------------------------------------------------------------
--
Page Open Event for update:
$max = dLookUp("orderline", "max(orderline_id)", "1=1");
$min = dLookUp("orderline", "min(orderline_id)", "1=1");

for ($i=$min; $i<= $max; $i++)
{
//echo $i." is ".get_param("$i")."<br>";
$price = get_param("$i");
if ($price != "")
{
$price = str_replace(",", ".", $price );
$sSQLu = "UPDATE orderline SET price =" . $price . " WHERE
orderline_id=".$i;
$db->query($sSQLu);
}
}
----------------------------------------------------------------------------
--
Before show for delete:
$max = dLookUp("orderline", "max(orderline_id)", "1=1");
$min = dLookUp("orderline", "min(orderline_id)", "1=1");

for ($i=$min; $i<= $max; $i++)
{
$box = get_param("$i");
if ($box = "")
{
$sSQLd = "delete from orderline where orderline_id=".$i;
//or use update sql query
$db->query($sSQLd);
}
}
----------------------------------------------------------------------------
--


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.