2c2 < // family_tree.php --- > // hierarchy_organization.php 5,8c5 < // Trying out Python GraphViz package ... thanks to https://forum.graphviz.org/t/emojis-not-working/1935/2 < < $abl=['my_family_tree',"\"Malik✅\", \"Cecil\", \"Sultan\"","\"Mehwish\", \"Miriam\", \"Sultana\"","\"Malik✅\": [\"Sultan\", \"Usman\"], \"Cecil\": [\"Margaret\", \"Christina\"], \"Sultan\": [\"Lilly\", \"Adam\"]"]; < $newabl=['my-family-tree',"\"Malik✅\", \"Cecil\", \"Sultan\"","\"Mehwish\", \"Miriam\", \"Sultana\"","\"Malik✅\": [\"Sultan\", \"Usman\"], \"Cecil\": [\"Margaret\", \"Christina\"], \"Sultan\": [\"Lilly\", \"Adam\"]"]; --- > // Trying out Python GraphViz package ... thanks to https://graphviz.readthedocs.io/en/stable/ 9a7,8 > $abl=['unix','','','']; > $newabl=['organization-hierarchy','','','']; 17c16 < $fmt='svg'; --- > $fmt='pdf'; 23,24d21 < $newt=''; < $newablzero='My%20Family%20Tree'; 213,215d209 < $newabl[1]=''; < $newabl[2]=''; < $newabl[3]=''; 226d219 < $newablzero=str_replace('+','%20',urlencode($newabl[0])); 230,239d222 < < < if (strpos($newabl[0], 'amily') !== false) { < $parts=explode('-',str_replace('_','-',$newabl[0])); < $newt=''; < for ($iy=0; $iy $_POST['fmt']='pdf'; 277,282c260 < $pycont=file_get_contents('./family_tree.py'); < < if (trim($newt) != '') { < $newablzero=str_replace('+','%20',urlencode(trim($newt))); < $pycont=str_replace("My Family Tree", trim($newt), $pycont); < } --- > $pycont=file_get_contents('./hierarchy_organization.py'); 301c279 < $pycont=str_replace("'shape': 'record'", "'shape': '" . $shape . "'", $pycont); --- > $pycont=str_replace("u.attr(", "u.attr('node', shape='" . $shape . "') \nu.attr(", $pycont); 318,320c296 < $pycont=str_replace($abl[1], $xone, $pycont); < $pycont=str_replace($abl[2], $xtwo, $pycont); < $pycont=str_replace($abl[3], $xthree, $pycont); --- > $cols=explode('|', $xone . '|' . $xtwo . '|' . $xthree); 322,324c298,308 < $pycont=str_replace($abl[0], $newabl[0], $pycont); < if ($fmt != 'svg') { < $pycont=str_replace("format='svg'", "format='" . $fmt . "'", $pycont); --- > // 5th Edition;6th Edition,PWB 1.0|6th Edition;LSX,1 BSD,Mini Unix,Wollongong,Interdata > for ($ic=0; $ic if (trim($cols[$ic]) != '') { > $withincols=explode(';', $cols[$ic]); > for ($jc=1; $jc $rightcols=explode(',', $withincols[$jc]); > for ($kc=0; $kc $pymidbit.="u.edge('" . str_replace("\t","+", urldecode($withincols[0])) . "','" . str_replace("\t","+", urldecode($rightcols[$kc])) . "') " . "\n"; > } > } > } 327,335c311,312 < if (strpos($newabl[0], 'amily') !== false) { < $parts=explode('-',str_replace('_','-',$newabl[0])); < $newt=''; < for ($iy=0; $iy if ($pymidbit != '' && $pysuffix != "") { > $pycont=str_replace($pysuffix, $pymidbit . $pysuffix, $pycont); 337a315,318 > $pycont=str_replace($abl[0], $newabl[0], $pycont); > if ($fmt != 'pdf') { > $pycont=str_replace(", filename=", ", format='" . $fmt . "', filename=", $pycont); > } 341c322 < $pycont=str_replace('Digraph', '' . $mode . '', $pycont); --- > $pycont=str_replace('.Digraph(', '.' . $mode . '(', $pycont); 346,354c327,335 < file_put_contents($prefix . 'family_tree_' . $suffix . '.py', $pycont); < //file_put_contents($prefix . 'family_tree0_' . $suffix . '.py', $pycont); < //file_put_contents($prefix . 'family_tree_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/python3 " . $prefix . "family_tree_" . $suffix . ".py >> " . $prefix . "family_tree.good 2>> " . $prefix . "family_tree.bad \nln -s " . $prefix . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf \nrm -f " . $prefix . "family_tree_" . $suffix . ".py \nrm -f " . $prefix . "family_tree_" . $suffix . ".ksh \nexit"); < file_put_contents($prefix . 'family_tree_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/python3 " . $prefix . "family_tree_" . $suffix . ".py >> " . $prefix . "family_tree.good 2>> " . $prefix . "family_tree.bad \nsleep 5\n\n/usr/bin/python3 " . $prefix . "family_tree_" . $suffix . ".py >> " . $prefix . "family_tree.good 2>> " . $prefix . "family_tree.bad \n\nrm -f " . $prefix . "family_tree_" . $suffix . ".py \nrm -f " . $prefix . "family_tree_" . $suffix . ".ksh \nexit"); < //file_put_contents($prefix . 'family_tree0_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/python3 " . $prefix . "family_tree_" . $suffix . ".py >> " . $prefix . "family_tree.good 2>> " . $prefix . "family_tree.bad \nsleep(5)\n\n/usr/bin/python3 " . $prefix . "family_tree_" . $suffix . ".py >> " . $prefix . "family_tree.good 2>> " . $prefix . "family_tree.bad \n\n\nrm -f " . $prefix . "family_tree_" . $suffix . ".py \nrm -f " . $prefix . "family_tree_" . $suffix . ".ksh \nexit"); < exec('chmod 777 ' . $prefix . 'family_tree_' . $suffix . '.ksh'); < exec('chown root ' . $prefix . 'family_tree_' . $suffix . '.ksh'); < exec('chgrp root ' . $prefix . 'family_tree_' . $suffix . '.ksh'); < while (file_exists($prefix . 'family_tree_' . $suffix . '.ksh')) { --- > file_put_contents($prefix . 'hierarchy_organization_' . $suffix . '.py', $pycont); > //file_put_contents($prefix . 'hierarchy_organization0_' . $suffix . '.py', $pycont); > //file_put_contents($prefix . 'hierarchy_organization_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/python3 " . $prefix . "hierarchy_organization_" . $suffix . ".py >> " . $prefix . "hierarchy_organization.good 2>> " . $prefix . "hierarchy_organization.bad \nln -s " . $prefix . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf \nrm -f " . $prefix . "hierarchy_organization_" . $suffix . ".py \nrm -f " . $prefix . "hierarchy_organization_" . $suffix . ".ksh \nexit"); > file_put_contents($prefix . 'hierarchy_organization_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/python3 " . $prefix . "hierarchy_organization_" . $suffix . ".py >> " . $prefix . "hierarchy_organization.good 2>> " . $prefix . "hierarchy_organization.bad \nsleep 5\n\n/usr/bin/python3 " . $prefix . "hierarchy_organization_" . $suffix . ".py >> " . $prefix . "hierarchy_organization.good 2>> " . $prefix . "hierarchy_organization.bad \n\nrm -f " . $prefix . "hierarchy_organization_" . $suffix . ".py \nrm -f " . $prefix . "hierarchy_organization_" . $suffix . ".ksh \nexit"); > //file_put_contents($prefix . 'hierarchy_organization0_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/python3 " . $prefix . "hierarchy_organization_" . $suffix . ".py >> " . $prefix . "hierarchy_organization.good 2>> " . $prefix . "hierarchy_organization.bad \nsleep(5)\n\n/usr/bin/python3 " . $prefix . "hierarchy_organization_" . $suffix . ".py >> " . $prefix . "hierarchy_organization.good 2>> " . $prefix . "hierarchy_organization.bad \n\n\nrm -f " . $prefix . "hierarchy_organization_" . $suffix . ".py \nrm -f " . $prefix . "hierarchy_organization_" . $suffix . ".ksh \nexit"); > exec('chmod 777 ' . $prefix . 'hierarchy_organization_' . $suffix . '.ksh'); > exec('chown root ' . $prefix . 'hierarchy_organization_' . $suffix . '.ksh'); > exec('chgrp root ' . $prefix . 'hierarchy_organization_' . $suffix . '.ksh'); > while (file_exists($prefix . 'hierarchy_organization_' . $suffix . '.ksh')) { 358,361c339,342 < file_put_contents('/tmp/family_tree.py', $pycont); < exec('chmod 777 ' . '/tmp/family_tree.py'); < exec('chown rjmprogr ' .'/tmp/family_tree.py'); < exec('chgrp rjmprogr ' . '/tmp/family_tree.py'); --- > file_put_contents('/tmp/hierarchy_organization.py', $pycont); > exec('chmod 777 ' . '/tmp/hierarchy_organization.py'); > exec('chown rjmprogr ' .'/tmp/hierarchy_organization.py'); > exec('chgrp rjmprogr ' . '/tmp/hierarchy_organization.py'); 368c349 < exec('/usr/bin/python3 /tmp/family_tree.py > family_tree.good 2> family_tree.bad'); --- > exec('/usr/bin/python3 /tmp/hierarchy_organization.py > hierarchy_organization.good 2> hierarchy_organization.bad'); 375c356 < exec('/usr/bin/python3 family_tree.py'); --- > exec('/usr/bin/python3 hierarchy_organization.py'); 388c369 < Trying out Python GraphViz hosted in PHP - RJM Programming - September, 2024 - Family Tree --- > Trying out Python GraphViz hosted in PHP - RJM Programming - September, 2024 - Organization Hierarchy 391c372 < var aplace='';0 --- > var aplace=''; 393c374 < aplace='" . $abl[1] . "'; //'5th Edition;6th Edition,PWB 1.0|6th Edition;LSX,1 BSD,Mini Unix,Wollongong,Interdata|Interdata;Unix/TS 3.0,PWB 2.0,7th Edition'; --- > aplace='5th Edition;6th Edition,PWB 1.0|6th Edition;LSX,1 BSD,Mini Unix,Wollongong,Interdata|Interdata;Unix/TS 3.0,PWB 2.0,7th Edition'; 396c377 < aplace='" . $abl[2] . "'; //'7th Edition;8th Edition,32V,V7M,Ultrix-11,Xenix,UniPlus+|V7M;Ultrix-11'; --- > aplace='7th Edition;8th Edition,32V,V7M,Ultrix-11,Xenix,UniPlus+|V7M;Ultrix-11'; 397a379 > aplace=''; 399c381 < aplace='" . $abl[3] . "'; //'8th Edition;9th Edition|1 BSD;2 BSD|2 BSD;2.8 BSD|2.8 BSD;Ultrix-11,2.9 BSD|32V;3 BSD|3 BSD;4 BSD|4 BSD;4.1 BSD|4.1 BSD;4.2 BSD|4.2 BSD;4.3 BSD,Ultrix-32|PWB 1.0;PWB 1.2,USG 1.0|PWB 1.2;PWB 2.0|USG 1.0;CB Unix 1,USG 2.0|CB Unix 1;CB Unix 2|CB Unix 2;CB Unix 3|CB Unix 3;Unix/TS++,PDP-11 Sys V|USG 2.0;USG 3.0|USG 3.0;Unix/TS 3.0|PWB 2.0;Unix/TS 3.0|Unix/TS 1.0;Unix/TS 3.0|Unix/TS 3.0;TS 4.0|Unix/TS++;TS 4.0|CB Unix 3;TS 4.0|TS 4.0;System V.0|System V.0;System V.2|System V.2;System V.3'; --- > aplace='8th Edition;9th Edition|1 BSD;2 BSD|2 BSD;2.8 BSD|2.8 BSD;Ultrix-11,2.9 BSD|32V;3 BSD|3 BSD;4 BSD|4 BSD;4.1 BSD|4.1 BSD;4.2 BSD|4.2 BSD;4.3 BSD,Ultrix-32|PWB 1.0;PWB 1.2,USG 1.0|PWB 1.2;PWB 2.0|USG 1.0;CB Unix 1,USG 2.0|CB Unix 1;CB Unix 2|CB Unix 2;CB Unix 3|CB Unix 3;Unix/TS++,PDP-11 Sys V|USG 2.0;USG 3.0|USG 3.0;Unix/TS 3.0|PWB 2.0;Unix/TS 3.0|Unix/TS 1.0;Unix/TS 3.0|Unix/TS 3.0;TS 4.0|Unix/TS++;TS 4.0|CB Unix 3;TS 4.0|TS 4.0;System V.0|System V.0;System V.2|System V.2;System V.3'; 413c395 < if (aone != '') { document.getElementById('plus').title='Smaller'; document.getElementById('minus').style.cursor='Pointer'; document.getElementById('minus').style.textDecoration='underline'; document.getElementById('plus').title='Bigger'; document.getElementById('plus').style.cursor='Pointer'; document.getElementById('plus').style.textDecoration='underline'; document.getElementById('plus').innerHTML='+'; while (aone.indexOf(String.fromCharCode(9)) != -1) { aone=aone.replace(String.fromCharCode(9),'+'); } document.getElementById('one').value=aone; document.getElementById('none').value=aone; } --- > if (aone != '') { document.getElementById('plus').title='Smaller'; document.getElementById('minus').style.cursor='Pointer'; document.getElementById('minus').style.textDecoration='underline'; document.getElementById('plus').title='Bigger'; document.getElementById('plus').style.cursor='Pointer'; document.getElementById('plus').style.textDecoration='underline'; document.getElementById('plus').innerHTML='+'; while (aone.indexOf(String.fromCharCode(9)) != -1) { aone=aone.replace(String.fromCharCode(9),'+'); } document.getElementById('one').value=aone; document.getElementById('none').value=aone; } 470c452 < em+='?subject=' + document.getElementById('newablzero').value + '&body=' + encodeURIComponent( (document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#title=' + encodeURIComponent(document.getElementById('ititle').value) + '#back=' + encodeURIComponent(document.getElementById('back').value.replace('#','')) + '#fsize=' + encodeURIComponent(document.getElementById('fsize').value) + '#shape=' + encodeURIComponent(document.getElementById('shape').value) + '#mode=' + encodeURIComponent(document.getElementById('mode').value) + '#fmt=' + encodeURIComponent(document.getElementById('fmt').value) + '#one=' + encodeURIComponent(document.getElementById('none').value) + '#two=' + encodeURIComponent(document.getElementById('ntwo').value) + '#three=' + encodeURIComponent(document.getElementById('nthree').value)).replace('#fmt=svg#one=#','#fmt=pdf#one=#') ); --- > em+='?subject=Hierarchy%20Organization&body=' + encodeURIComponent( (document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#title=' + encodeURIComponent(document.getElementById('ititle').value) + '#back=' + encodeURIComponent(document.getElementById('back').value.replace('#','')) + '#fsize=' + encodeURIComponent(document.getElementById('fsize').value) + '#shape=' + encodeURIComponent(document.getElementById('shape').value) + '#mode=' + encodeURIComponent(document.getElementById('mode').value) + '#fmt=' + encodeURIComponent(document.getElementById('fmt').value) + '#one=' + encodeURIComponent(document.getElementById('none').value) + '#two=' + encodeURIComponent(document.getElementById('ntwo').value) + '#three=' + encodeURIComponent(document.getElementById('nthree').value)).replace('#fmt=svg#one=#','#fmt=pdf#one=#') ); 477,491d458 < function naz(intv) { < var retval='My%20%Family%20Tree'; < var jntv=intv.replace(/\ /g,'-').replace(/\_/g,'-'); < var jst=jntv.split('-'); < if (jntv.indexOf('amily') != -1) { < retval=jst[0].substring(0,1).toUpperCase() + jst[0].substring(1).toLowerCase() + ' '; < for (var ij=1; ij height: 120px; 543c509 <

Trying out Python GraphViz hosted in PHP " . $plus . " Family Tree  

--- >

Trying out Python GraphViz hosted in PHP " . $plus . " Organization Hierarchy  

545c511 <

Thanks to https://forum.graphviz.org/t/emojis-not-working/1935/2

--- >

Thanks to https://graphviz.readthedocs.io/en/stable/examples.html

547c513 < --- > 549c515 <
--- > 551,558c517,524 <      

<

Family Tree Names ...


< < < <
<
<

--- >      

>

Hierarchical Relationship Names ...


> > > >
>
>

563d528 < 569c534 < Trying out Python GraphViz hosted in PHP - RJM Programming - September, 2024 - Family Tree --- > Trying out Python GraphViz hosted in PHP - RJM Programming - September, 2024 - Organization Hierarchy 574c539 < aplace='" . $abl[0] . "'; //'5th Edition;6th Edition,PWB 1.0|6th Edition;LSX,1 BSD,Mini Unix,Wollongong,Interdata|Interdata;Unix/TS 3.0,PWB 2.0,7th Edition'; --- > aplace='5th Edition;6th Edition,PWB 1.0|6th Edition;LSX,1 BSD,Mini Unix,Wollongong,Interdata|Interdata;Unix/TS 3.0,PWB 2.0,7th Edition'; 577c542 < aplace='" . $abl[1] . "'; //'7th Edition;8th Edition,32V,V7M,Ultrix-11,Xenix,UniPlus+|V7M;Ultrix-11'; --- > aplace='7th Edition;8th Edition,32V,V7M,Ultrix-11,Xenix,UniPlus+|V7M;Ultrix-11'; 578a544 > aplace=''; 580c546 < aplace='" . $abl[2] . "'; //'8th Edition;9th Edition|1 BSD;2 BSD|2 BSD;2.8 BSD|2.8 BSD;Ultrix-11,2.9 BSD|32V;3 BSD|3 BSD;4 BSD|4 BSD;4.1 BSD|4.1 BSD;4.2 BSD|4.2 BSD;4.3 BSD,Ultrix-32|PWB 1.0;PWB 1.2,USG 1.0|PWB 1.2;PWB 2.0|USG 1.0;CB Unix 1,USG 2.0|CB Unix 1;CB Unix 2|CB Unix 2;CB Unix 3|CB Unix 3;Unix/TS++,PDP-11 Sys V|USG 2.0;USG 3.0|USG 3.0;Unix/TS 3.0|PWB 2.0;Unix/TS 3.0|Unix/TS 1.0;Unix/TS 3.0|Unix/TS 3.0;TS 4.0|Unix/TS++;TS 4.0|CB Unix 3;TS 4.0|TS 4.0;System V.0|System V.0;System V.2|System V.2;System V.3'; --- > aplace='8th Edition;9th Edition|1 BSD;2 BSD|2 BSD;2.8 BSD|2.8 BSD;Ultrix-11,2.9 BSD|32V;3 BSD|3 BSD;4 BSD|4 BSD;4.1 BSD|4.1 BSD;4.2 BSD|4.2 BSD;4.3 BSD,Ultrix-32|PWB 1.0;PWB 1.2,USG 1.0|PWB 1.2;PWB 2.0|USG 1.0;CB Unix 1,USG 2.0|CB Unix 1;CB Unix 2|CB Unix 2;CB Unix 3|CB Unix 3;Unix/TS++,PDP-11 Sys V|USG 2.0;USG 3.0|USG 3.0;Unix/TS 3.0|PWB 2.0;Unix/TS 3.0|Unix/TS 1.0;Unix/TS 3.0|Unix/TS 3.0;TS 4.0|Unix/TS++;TS 4.0|CB Unix 3;TS 4.0|TS 4.0;System V.0|System V.0;System V.2|System V.2;System V.3'; 594c560 < if (aone != '') { document.getElementById('plus').title='Smaller'; document.getElementById('minus').style.cursor='Pointer'; document.getElementById('minus').style.textDecoration='underline'; document.getElementById('plus').title='Bigger'; document.getElementById('plus').style.cursor='Pointer'; document.getElementById('plus').style.textDecoration='underline'; document.getElementById('plus').innerHTML='+'; while (aone.indexOf(String.fromCharCode(9)) != -1) { aone=aone.replace(String.fromCharCode(9),'+'); } document.getElementById('one').value=aone; document.getElementById('none').value=aone; } --- > if (aone != '') { document.getElementById('plus').title='Smaller'; document.getElementById('minus').style.cursor='Pointer'; document.getElementById('minus').style.textDecoration='underline'; document.getElementById('plus').title='Bigger'; document.getElementById('plus').style.cursor='Pointer'; document.getElementById('plus').style.textDecoration='underline'; document.getElementById('plus').innerHTML='+'; while (aone.indexOf(String.fromCharCode(9)) != -1) { aone=aone.replace(String.fromCharCode(9),'+'); } document.getElementById('one').value=aone; document.getElementById('none').value=aone; } 647c613 < em+='?subject=' + document.getElementById('newablzero').value + '&body=' + encodeURIComponent( (document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#title=' + encodeURIComponent(document.getElementById('ititle').value) + '#back=' + encodeURIComponent(document.getElementById('back').value.replace('#','')) + '#fsize=' + encodeURIComponent(document.getElementById('fsize').value) + '#shape=' + encodeURIComponent(document.getElementById('shape').value) + '#mode=' + encodeURIComponent(document.getElementById('mode').value) + '#fmt=' + encodeURIComponent(document.getElementById('fmt').value) + '#one=' + encodeURIComponent(document.getElementById('none').value) + '#two=' + encodeURIComponent(document.getElementById('ntwo').value) + '#three=' + encodeURIComponent(document.getElementById('nthree').value)).replace('#fmt=svg#one=#','#fmt=pdf#one=#') ); --- > em+='?subject=Hierarchy%20Organization&body=' + encodeURIComponent( (document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#title=' + encodeURIComponent(document.getElementById('ititle').value) + '#back=' + encodeURIComponent(document.getElementById('back').value.replace('#','')) + '#fsize=' + encodeURIComponent(document.getElementById('fsize').value) + '#shape=' + encodeURIComponent(document.getElementById('shape').value) + '#mode=' + encodeURIComponent(document.getElementById('mode').value) + '#fmt=' + encodeURIComponent(document.getElementById('fmt').value) + '#one=' + encodeURIComponent(document.getElementById('none').value) + '#two=' + encodeURIComponent(document.getElementById('ntwo').value) + '#three=' + encodeURIComponent(document.getElementById('nthree').value)).replace('#fmt=svg#one=#','#fmt=pdf#one=#') ); 654,668d619 < function naz(intv) { < var retval='My%20%Family%20Tree'; < var jntv=intv.replace(/\ /g,'-').replace(/\_/g,'-'); < var jst=jntv.split('-'); < if (jntv.indexOf('amily') != -1) { < retval=jst[0].substring(0,1).toUpperCase() + jst[0].substring(1).toLowerCase() + ' '; < for (var ij=1; ij height: 120px; 719c669 <

Trying out Python GraphViz hosted in PHP " . $plus . " Family Tree  

--- >

Trying out Python GraphViz hosted in PHP " . $plus . " Organization Hierarchy  

723c673 < --- > 725c675 < --- > 727c677 <      

--- >      

729,735c679,685 <

Family Tree Names ...


< < < <
<
<

--- >

Hierarchical Relationship Names ...


> > > >
>
>

739d688 <