|
|
@@ -91,13 +91,13 @@ function start_dig($tables) {
|
|
|
$res=$db->query($sql);
|
|
|
while($h=$db->fetch($res)) {
|
|
|
$hist_loop[$Y][]=$h;
|
|
|
- dig_next($hist_loop,$h);
|
|
|
+ dig_next($hist_loop,$t,$h);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-function dig_next($hist_loop,$prev_dig) {
|
|
|
+function dig_next($hist_loop,$prev_tbl,$prev_dig) {
|
|
|
global $db,$tables;
|
|
|
//detect next ref tbls
|
|
|
$sql = array();
|
|
|
@@ -106,11 +106,17 @@ function dig_next($hist_loop,$prev_dig) {
|
|
|
foreach($z['rel'] as $z_rel_from=>$z_rel_to) {
|
|
|
echo "test z_rel_fr ".$z_rel_from." to z_rel_to ".$z_rel_to ;
|
|
|
|
|
|
- foreach($prev_dig as $col=>$val) {
|
|
|
- if($z_rel_from == $col) {
|
|
|
+ if( $prev_tbl['rel'][$z_rel_from] ) {
|
|
|
+ $sql[$Z]['rel'][$z_rel_to]= $prev_dig[$prev_tbl['rel'][$z_rel_to]];
|
|
|
+ }
|
|
|
+
|
|
|
+ /*foreach($prev_dig as $col=>$val) {
|
|
|
+ //transl ref to ref
|
|
|
+ if( $prev_tbl['rel'][$z_rel_from] ) {
|
|
|
$sql[$Z]['rel'][$z_rel_to]=$val;
|
|
|
}
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
}
|
|
|
}
|