Commit afd178cc authored by Skia's avatar Skia
Browse files

Improve family graph generation

parent 581a98bf
...@@ -40,6 +40,9 @@ class genealogie ...@@ -40,6 +40,9 @@ class genealogie
/* utilisateur (id) */ /* utilisateur (id) */
var $id_utl; var $id_utl;
/* profondeur */
var $depth;
/* utilisateur (surnom) */ /* utilisateur (surnom) */
var $surnom; var $surnom;
...@@ -72,11 +75,12 @@ class genealogie ...@@ -72,11 +75,12 @@ class genealogie
$this->out_conf .= "\tnode [shape=box,style=filled,color=firebrick1];\n"; $this->out_conf .= "\tnode [shape=box,style=filled,color=firebrick1];\n";
} }
function generate_filiation_utl ($id_utl, $db) function generate_filiation_utl ($id_utl, $db, $depth)
{ {
/* affectation variables membres */ /* affectation variables membres */
$this->id_utl = $id_utl; $this->id_utl = $id_utl;
$this->db = $db; $this->db = $db;
$this->depth = $depth;
/* tableau des fillots deja parses */ /* tableau des fillots deja parses */
$this->explored = array (); $this->explored = array ();
...@@ -104,7 +108,7 @@ class genealogie ...@@ -104,7 +108,7 @@ class genealogie
$this->explored[] = $rs[1]; $this->explored[] = $rs[1];
$nom = $rs[0]; $nom = $rs[0];
$this->get_childs ($this->id_utl, $nom, 3); $this->get_childs ($this->id_utl, $nom, $this->depth);
/* fin configuration */ /* fin configuration */
$this->out_conf .= "}\n"; $this->out_conf .= "}\n";
......
...@@ -53,9 +53,13 @@ if ( !$site->user->is_valid() ) ...@@ -53,9 +53,13 @@ if ( !$site->user->is_valid() )
} }
$id = mysql_real_escape_string($_REQUEST['id']); $id = mysql_real_escape_string($_REQUEST['id']);
$depth = 3;
if(isset($_REQUEST['depth'])) {
$depth = intval(mysql_real_escape_string($_REQUEST['depth']));
}
$gene = new genealogie (); $gene = new genealogie ();
$gene->generate_filiation_utl ($id, $site->db); $gene->generate_filiation_utl ($id, $site->db, $depth);
$gene->generate (); $gene->generate ();
$gene->destroy (); $gene->destroy ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment