[PHP-DB] RE: [PHP] build menu with mysql data

2003-01-21 Thread Edward Peloke
Marc,

I did something sort of along these lines with an 'auction' site I worked
on.  I displayed rows from a db.  If the row had bid information in the db
(or your case submenu info) then a + sign icon was displayed next to it.  IF
the plus sign was clicked, the page would reload and the bid or submenu info
would be displayed and the + sign would change to a - sign to give the
appearence of a tree menu.   Can you post some of your code?

Eddie

-Original Message-
From: Marc Bleuler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 12:31 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] build menu with mysql data


Hi,

I would like to bild a tree menu with mySQL data. where I have the collapsed
main menue and when I click the link the specific submenue expands (as
follow).

(collapsed Main Menu)
+ Home
+ Downloads
+ About me
+ Search

and for example if I click the Download section it will look as
follow

(expanded Main-Sub Menu)
+ Home
+ Downloads
- Music
- Programm
+ About me
+ Search

and the SQL Tables...

MAINMENUE_TABLE
IDNAME
-
|1|Home|
|2|Downloads|
|3|About me  |
|4|Search   |

and

SUBMENUE_TABLE
IDMAIN_ID  NAMEURL
---
|1|2|Music|
./somefile.php?action=music
|2|2|Programm |
./somefile.php?action=programm
|3|3|Pictures |
./somefile.php?action=pictures
|4|3|Address|
./somefile.php?action=address
|5|4|My Page   |
./somefile.php?action=mypage
|6|4|The Web   |
./somefile.php?action=theweb
|7|4|Google  |
./somefile.php?action=google


If I'm using a while loop it won't work, so I realy don't have and more
ideas...
Please consider in your explanations I'm a PHP beginner... :-)

thanks
Marc



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: [PHP] build menu with mysql data

2003-01-21 Thread Marc Bleuler
Hi Eddie,

This is exactly what I'm looking for. I don't have some code today that's
why I'm posting to the newsgroup. The only working thing I have today is the
listing of the main db
It looks a bit whired since I copy past it from the file.
Could you post some of your code?


-
print $html_body_in;
   print bSystems/bbrbr;
   print table border=\0\ width=\900\ cellspacing=\0\
cellpadding=\0\ style=\font-size: 10pt\;
  print tr;
 print td width=\20\b/b/td;
print td width=\130\bName/b/a/td;
print td width=\130\bVendor/b/td;
   print td width=\620\bDescription/bb/td;
 print \t/tr\n;
   print /table\n;

   $query=SELECT system.*, vendor.* FROM system, vendor where system.VENDOR
= vendor.ID order by system.NAME ASC;
   $result=mysql_query($query);
   $num=mysql_numrows($result);

   $i=0;

   while ($i  $num) {
   $system_id=mysql_result($result,$i,system.ID);
   $system_name=mysql_result($result,$i,system.NAME);
   $vendor_name=mysql_result($result,$i,vendor.NAME);
   $vendor_id=mysql_result($result,$i,vendor.ID);
   $system_description=mysql_result($result,$i,system.DESCRIPTION);


   print table border=\0\ width=\900\ cellspacing=\0\
cellpadding=\0\ style=\font-size: 10pt\;
print tr;
  print td width=\20\a
href=\index.php?$LINKACTION=systemSUB=systemdetailsysid=$system_id\im
g border=\0\ src=\$plus_gif\ alt=\extract $system_name\/a/td;
   print td width=\130\a
href=\index.php?$LINKACTION=systemSUB=systemdetailsysid=$system_id\$sy
stem_name/a/td;
print td width=\130\a
href=\index.php?$LINKACTION=systemSUB=vendordetailvendorid=$vendor_id\
$vendor_name/a/td;
   print td width=\520\$system_description/td;
print td width=\25\a
href=\index.php?$LINKACTION=systemSUB=systemdetailsysid=$system_id\im
g border=\0\ src=\$edit_gif\ alt=\edit $system_name\ width=\12\
height=\12\/a/td;
   print td width=\25\a
href=\index.php?$LINKACTION=adminSUB=useradd\img border=\0\
src=\$new_gif\ alt=\add Useraccount\ width=\12\
height=\12\/a/td;
print td width=\50\a
href=\index.php?$LINKACTION=systemSUB=systemdetailsysid=$system_id\im
g border=\0\ src=\$delete_gif\ alt=\delete $system_name\ width=\12\
height=\12\/a/td;

   print /tr;
  print /table;

   ++$i;
   }


-

br Marc


   print $html_body_out;
Edward Peloke [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Marc,

 I did something sort of along these lines with an 'auction' site I worked
 on.  I displayed rows from a db.  If the row had bid information in the db
 (or your case submenu info) then a + sign icon was displayed next to it.
IF
 the plus sign was clicked, the page would reload and the bid or submenu
info
 would be displayed and the + sign would change to a - sign to give the
 appearence of a tree menu.   Can you post some of your code?

 Eddie

 -Original Message-
 From: Marc Bleuler [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 12:31 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: [PHP] build menu with mysql data


 Hi,

 I would like to bild a tree menu with mySQL data. where I have the
collapsed
 main menue and when I click the link the specific submenue expands (as
 follow).

 (collapsed Main Menu)
 + Home
 + Downloads
 + About me
 + Search

 and for example if I click the Download section it will look as
 follow

 (expanded Main-Sub Menu)
 + Home
 + Downloads
 - Music
 - Programm
 + About me
 + Search

 and the SQL Tables...

 MAINMENUE_TABLE
 IDNAME
 -
 |1|Home|
 |2|Downloads|
 |3|About me  |
 |4|Search   |

 and

 SUBMENUE_TABLE
 IDMAIN_ID  NAMEURL
 ---
 |1|2|Music|
 ./somefile.php?action=music
 |2|2|Programm |
 ./somefile.php?action=programm
 |3|3|Pictures |
 ./somefile.php?action=pictures
 |4|3|Address|
 ./somefile.php?action=address
 |5|4|My Page   |
 ./somefile.php?action=mypage
 |6|4|The Web   |
 ./somefile.php?action=theweb
 |7|4|Google  |
 ./somefile.php?action=google


 If I'm using a while loop it won't work, so I realy don't have and more
 ideas...
 Please consider in your explanations I'm a PHP beginner... :-)

 thanks
 Marc



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: 

RE: [PHP-DB] Re: [PHP] build menu with mysql data

2003-01-21 Thread Edward Peloke
;
  printtd bgcolor=$bgcolor/td;
  printtdfont face='arial' size='2' color=$bgcolorbBid
History/td;
  print tdfont face='arial' size='2'
color=$bgcolorbOperator/td;
  print tdfont face='arial' size='2'
color=$bgcolorbBid/td;
  print tdfont face='arial' size='2' color=$bgcolorbBid
Date/td;
  printtd bgcolor=$bgcolor/td;
  printtd bgcolor=$bgcolor/td;
  printtd bgcolor=$bgcolor/td;
  print td bgcolor=$bgcolor/td/tr;
  while ($myrow4 = mysql_fetch_array($result4)){
   print tr bgcolor='$trcolor';
   printtd bgcolor=$bgcolor/td;
   printtd bgcolor=$bgcolor/td;
   printtd bgcolor=$bgcolor/td;
   printtd.$myrow4[corpname]./td;
   printtd.$myrow4[amount]./td;
   printtd.$myrow4[timestamp]./td;
   printtd bgcolor=$bgcolor/td;
   printtd bgcolor=$bgcolor/td;
   printtd bgcolor=$bgcolor/td;

   print td bgcolor=$bgcolor/td/tr;
 }
}

if($clientreqid$myrow[id]){
   print tr bgcolor='$trcolor';
   if ($count10){
  printtda
href='auction3.php?clientreqid=.$myrow[id].bidhist=1'img
name='bidhist' src='plus.gif' border='0'/a/td;
  $minbid=$myrow3[min(amount)];
}
if ($count1==0){
  printtd/td;
  $minbid=No Bids;
   }
 printtd.$myrow[departdate]./td;
printtd.$myrow[departloc]./td;
printtd.$myrow[numpass]./td;
printtd$return/td;
printtd.$myrow[returndate]./td;
printtd/td;
printtd.$myrow[craftpref]./td;
printtd$minbid/td;
print tdnobra href='addbid.php?reqid=.$myrow[id].
operatorid=$operatorid'Add Bid/a/nobr/td/tr;

  }
   }


   }
 print/table;

?


-Original Message-
From: Marc Bleuler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 2:11 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Re: [PHP] build menu with mysql data


Hi Eddie,

This is exactly what I'm looking for. I don't have some code today that's
why I'm posting to the newsgroup. The only working thing I have today is the
listing of the main db
It looks a bit whired since I copy past it from the file.
Could you post some of your code?


-
print $html_body_in;
   print bSystems/bbrbr;
   print table border=\0\ width=\900\ cellspacing=\0\
cellpadding=\0\ style=\font-size: 10pt\;
  print tr;
 print td width=\20\b/b/td;
print td width=\130\bName/b/a/td;
print td width=\130\bVendor/b/td;
   print td width=\620\bDescription/bb/td;
 print \t/tr\n;
   print /table\n;

   $query=SELECT system.*, vendor.* FROM system, vendor where system.VENDOR
= vendor.ID order by system.NAME ASC;
   $result=mysql_query($query);
   $num=mysql_numrows($result);

   $i=0;

   while ($i  $num) {
   $system_id=mysql_result($result,$i,system.ID);
   $system_name=mysql_result($result,$i,system.NAME);
   $vendor_name=mysql_result($result,$i,vendor.NAME);
   $vendor_id=mysql_result($result,$i,vendor.ID);
   $system_description=mysql_result($result,$i,system.DESCRIPTION);


   print table border=\0\ width=\900\ cellspacing=\0\
cellpadding=\0\ style=\font-size: 10pt\;
print tr;
  print td width=\20\a
href=\index.php?$LINKACTION=systemSUB=systemdetailsysid=$system_id\im
g border=\0\ src=\$plus_gif\ alt=\extract $system_name\/a/td;
   print td width=\130\a
href=\index.php?$LINKACTION=systemSUB=systemdetailsysid=$system_id\$sy
stem_name/a/td;
print td width=\130\a
href=\index.php?$LINKACTION=systemSUB=vendordetailvendorid=$vendor_id\
$vendor_name/a/td;
   print td width=\520\$system_description/td;
print td width=\25\a
href=\index.php?$LINKACTION=systemSUB=systemdetailsysid=$system_id\im
g border=\0\ src=\$edit_gif\ alt=\edit $system_name\ width=\12\
height=\12\/a/td;
   print td width=\25\a
href=\index.php?$LINKACTION=adminSUB=useradd\img border=\0\
src=\$new_gif\ alt=\add Useraccount\ width=\12\
height=\12\/a/td;
print td width=\50\a
href=\index.php?$LINKACTION=systemSUB=systemdetailsysid=$system_id\im
g border=\0\ src=\$delete_gif\ alt=\delete $system_name\ width=\12\
height=\12\/a/td;

   print /tr;
  print /table;

   ++$i;
   }


-

br Marc


   print $html_body_out;
Edward Peloke [EMAIL PROTECTED] schrieb im