[FX.php List] RE: looking for advice...

Alex Gates alex at gandrpublishing.com
Tue Jan 16 09:52:43 MST 2007


Hi John-

Thanks for the response.

I have something very similar to this working now.... My main problem is
that I need an intuitive way for a user to order their recipes any way
they wish for their printed book.  For example, if a recipe is the 30th
in the list and they want to move it to 2nd, the sortID field in
FileMaker will have to change on records 2-30.
This number is needed so we can export the data into inDesign in the
correct order.

I'm stuck design wise on an intuitive way to allow the user to create
this order, and also php-wise because loooping through 200 or so records
and editing a field may take some time....

Alex


-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of John Moed
Sent: Tuesday, January 16, 2007 10:10 AM
To: fx.php_list at mail.iviking.org
Subject: [FX.php List] RE: looking for advice...

Alex,

Create a variable for sort parameter and sort field. You can either
create
hyper-links on the column headers that allow the user to click on them
and
change the sort order. I also create a sort type variable which tells
the
page what type of sort it is and a sort changed variable. If the user
clicks
on the "Recipe Name" column header, the sort parameter is set to
"ascend",
the sort field is set to "recipe", sort changed is set to "YES" and sort
type is set to "recipeascend". Before your find request in the PHP, put
an
if...then...else statement 
Something like (off the top of my head):
If ($_get(changesort=="YES")){
$sorttype=$_get('sorttype');
$sortfield=$_get('sortfield');
$sortparam=$_get('sortparam');
}else{}

For each column header, have an if then else statement:
<?php If ($sorttype='recipeascend'){ ?>
<a
href=recipe.php?sorttype=recipedescend&sortfield=recipe&sortparam=descen
d&ch
angesort=YES>Recipe</a>
<?php }?>
<?php Else if ($sorttype='recipedescend'){ ?>
<a
href=recipe.php?sorttype=recipeascend&sortfield=recipe&sortparam=ascend&
chan
gesort=YES>Recipe</a>
<?php Else }{ ?>
<a
href=recipe.php?sorttype=recipeascend&sortfield=recipe&sortparam=ascend&
chan
gesort=YES>Recipe</a>
<?php }?>

There is probably a better way to do this, but it is working so far for
me.
I would be happy to hear suggestions.

Thanks,
John

_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list






More information about the FX.php_List mailing list