gestire un albero genealogico con PHP e Mysql

ypsilon86

Utente Attivo
18 Dic 2012
48
0
0
Roma
Ciao a tutti, vorrei se fosse possibile, creare con PHP un modo che mi permetta di gestire un albero genealogico prendendo informazioni da un database MySql.

Poniamo il caso che avessi in MySql la seguente Tabella: "CLIENTE", che prevede i seguenti campi [id_cliente (dato intero), nome_cliente(dato varchar), padre_cliente(dato varchar), madre_cliente(dato varchar)]. Avrei quindi nel database solo la 1°generazione.

Vorrei visualizzare nella pagina tutti i discendenti del cliente, fino all'ottava generazione.
Ogni cliente avrebbe: 4 nonni, 8 bisnonni e 16 trisnonni.

Nel database registrerò anche i nonni, i bisnonni, i trisnonni, i nonni dei trisnonni ecc ecc...
Quando registrerò un nonno, segnerò nella tabella il nome del nonno, il padre del nonno e la madre del nonno, che invece corrisponderanno per il Cliente ai bisnonni.
Devo concatenare le Tabelle in Mysql? Se si come?

In questo modo quando avrò a video l'albero genealogico di Mario Rossi, potrei cliccare sul nome del nonno materno di M.Rossi; e vedere chi sono i trisnonni del nonno di Mario Rossi.

HTML:
<table border="1">
  
  <tr>
    <td rowspan="8" align="center" valign="middle">
     
    <h1><a href="#">PADRE(nome)</a></h1></td>

    <td rowspan="4" align="center" valign="middle"> 
    <h2><a href="#">NONNO PATERNO(nome)</a></h2>
    </td>

    <td rowspan="2" align="center" valign="middle">
    <h3><a href="#">BISNONNO PATERNO(nome)</a></h3>
    </td>

    <td width="80" height="50" align="center" valign="middle">
    <h4><a href="#">TRISNONNO PATERNO(nome)</a></h4>
    </td>
    
  </tr>
  
  <tr>
    <td width="80" height="50" align="center" valign="middle">
    <h4><a href="#">TRISNONNA MATERNA(nome)</a></h4>
    </td>
  </tr>
  
  <tr>
    <td width="130" height="100" rowspan="2" align="center" valign="middle">
    <h3><a href="#">BISNONNA MATERNA(nome)</a></h3>
    </td>
    <td width="80" height="50" align="center" valign="middle">
    <h4><a href="#">TRISNONNO PATERNO(nome)</a></h4>
    </td>
  </tr>
  
  <tr>
    <td width="80" height="50" align="center" valign="middle">
    <h4><a href="#">TRISNONNA PATERNA(nome)</a></h4>
    </td>
  </tr>
  
  <tr>
    <td width="170" height="200" rowspan="4" align="center" valign="middle">
    <h2><a href="">NONNA MATERNA(nome)</a></h2>
    </td>

    <td width="130" height="100" rowspan="2" align="center" valign="middle">
    <h3>......</h3>
    </td>

    <td width="80" height="50" align="center" valign="middle">
    <h4>......</h4>
    </td>
  </tr>
  
  <tr>
    <td width="80" height="50" align="center" valign="middle">
    <h4>....</h4>
    </td>
  </tr>
  
  <tr>
    <td width="130" height="100" rowspan="2" align="center" valign="middle">
      <h3>....</h3></td>

    <td width="80" height="50" align="center" valign="middle">
    <h4>...</h4>
    </td>
  </tr>
  
  <tr>
    <td width="120" height="62" align="center" valign="middle">
   <h4>....<h4>
    </td>
  </tr>
  
   <tr>
    <td width="200" height="400" rowspan="8" align="center" valign="middle">
    <h1>....</h1>
    </td>

    <td  width="180" height="200" rowspan="4" align="center" valign="middle"> 
    <h2>.....</h2>
    </td>

    <td width="140" height="100" rowspan="2" align="center" valign="middle">
    <h3>.....</h3>
    </td>

    <td width="100" height="50" align="center" valign="middle">
     <h4>.....</h4>
    </td>
  </tr>
  
  <tr>
    <td width="100" height="50" align="center" valign="middle">
    <h4>.....</h4>
    </td>
  </tr>
  
  <tr>
    <td width="140" height="100" rowspan="2" align="center" valign="middle">
       <h3>....</h3></td>

    <td width="100" height="50" align="center" valign="middle">
    <h4>.....</h4>
    </td>
  </tr>
  
  <tr>
    <td width="100" height="50" align="center" valign="middle">
    <h4>....</h4>
    </td>
  </tr>
  
  <tr>
    <td width="180" height="200" rowspan="4" align="center" valign="middle">
    <h2>.....</h2>
    </td>

    <td height="100" rowspan="2" align="center" valign="middle">
    <h3>.....</h3>
    </td>

    <td width="100" height="50" align="center" valign="middle">
    <h4><a href="#">TRISNONNO MATERNO(nome)</a></h4>
    </td>
  </tr>
  
  <tr>
    <td width="100" height="50" align="center" valign="middle">
    <h4><a href="#">TRISNONNA MATERNA(nome)</a></h4>
    </td>
  </tr>
  
  <tr>
    <td height="100" rowspan="2" align="center" valign="middle">
    <h3><a href="#">BISNONNA MATERNA(nome)</a></h3>
    </td>

    <td width="100" height="50" align="center" valign="middle">
    <h4><a href="#">TRISNONNO MATERNO (nome)</a></h4>
    </td>
  </tr>
  
  <tr>
    <td width="100" height="50" align="center" valign="middle"> 
    <h4><a href="#">TRISNONNA MATERNA(nome)</a></h4>
    </td>
  </tr>

</table>
 
Discussioni simili
Autore Titolo Forum Risposte Data
G Qualcuno conosce questo software per gestire le telecamere IP Cam e Videosorveglianza 0
E Come gestire al meglio le immagini legno grande formato Photoshop 0
L Interfaccia grafica per gestire sql server .NET Framework 1
R Plugin per Gestire videocorsi a pagamento WordPress 3
M Come gestire aggiornamenti e modifiche di sito live CMS (Content Management System) 0
S Gestire scelta dropdown con dati da Mysql PHP 2
Tommy03 Gestire dimensioni immagini PHP 4
D Come gestire un singolo checkbox PHP 10
MarcoGrazia Gestire lista campi vuoti in fase di autenticazione jQuery 1
elpirata Gestire permessi accesso alle pagine PHP 3
A [ASP.Net] Gestire il profilo ADMIN in un progetto ASP NET e pattern MVC ASP.NET 0
M [PHP] Come gestire gli utenti online PHP 9
M [php] Come gestire i tags PHP 1
svtmaster professionalità per gestire sito web Offerte e Richieste di Lavoro e/o Collaborazione 4
L [HTML] Gestire movimento GIF HTML e CSS 0
BestSellerMauroTop Software per gestire tanti profili e pagine, e farle crescere in modo autonomo! Annunci servizi di Social Media Marketing 0
W Gestire ccTalk o libreria c++ da php PHP 0
W [PHP] gestire una richiesta curl sul server PHP 0
W Piccolo sistema per gestire alcune periferiche, Java o altro linguaggio? Java 8
bubino8 [WordPress] Gestire SSL (https://) da .htaccess WordPress 9
C [WordPress] Creare e gestire un nuovo sito web WordPress 5
M Gestire ErrorDocument 404 mantenendo lo stesso url Web Server 0
S gestire una tabella mysql PHP 9
R gestire il ritorno di una variabile con success Ajax 2
S Gestire Motion Detection TP-LINK CAMERA NC200 IP Cam e Videosorveglianza 0
A [Javascript] [HTML] Gestire una pagina esterna con 2 iframe Javascript 4
webmachine [PHP] gestire rinnovi PHP 1
P Gestire accesso ad un file xml pubblico PHP 1
D Gestire diversi tipi di pagamento per tipologia di cliente E-Commerce 4
asevenx Cerco plugin per gestire appuntamenti con agenda e campi di selezione WordPress 4
matteoraggi Software per gestire migliaia di permament redirect? SEO e Posizionamento 0
K Gestire response con servlet remota Sviluppo app per Android 1
P Piccolo software per gestire gli utenti. Snippet PHP 5
F Gestire data e ora PHP 6
D Gestire firme digitali con PHP PHP 0
C [Facebook Autolike]Software per gestire più account, mandare like, creare stati, amicizie e altro.. Vendere e Acquistare pubblicita' online 0
D gestire commenti e risposte ... PHP 3
L Gestire password utenti registrati. Quale codifica? PHP 23
asevenx Gestire posizionamento voci sottomenu che si nascondono HTML e CSS 1
N Programma per gestire Cookies secondo disposizioni del Garante Privacy 3/6/2014 G.U. 126 Leggi, Normative e Fisco 0
A Gestire e modificare immagini Java 2
M Gestire la chiusura forzata. Sviluppo app per Android 1
L Sito con doppia lingua. Gestire il cambio PHP 4
felino Wordpress e QTranslate: come gestire i widget WordPress 11
IImanuII Gestire lingua su facebook con php PHP 18
mondrian Gestire un web server su una virtualbox Apache 12
L gestire array per radio-checkbox in ciclo while PHP 2
MarcoGrazia Gestire gruppi e categorie di link con PHP PHP 1
L Button per gestire JS in WebBrowser di VBNet .NET Framework 0
A gestire errori 400-401-403-404-500 con file htaccess PHP 0

Discussioni simili