<?php
// flowchart.php
// RJM Programming 
// January, 2019
// Add accountability to flowchart.html

$ua="";
$phpcont="";
$getpostfound=false;
foreach( $_POST as $stuff ) {
  $getpostfound=true;
}
foreach( $_GET as $stuff ) {
  $getpostfound=true;
}
$fct="flowchart.html";
if (strpos(('' . $_SERVER['HTTP_REFERER']), "flowchart.htm") !== false && strpos(('' . $_SERVER['HTTP_REFERER']), "flowchart.html") === false) {
  $fct="flowchart.htm";
}

$defeto="";
$defefrom="you" . "will" . "nere" . "fInd" . "That";
$fflist="";
$subjarr=["", "", "", ""];

function zmail($zris, $zxsis, $ztis, $zhis) {
     global $subjarr, $fflist;
     // file_put_contents("091.091","");
     if (strpos($zxsis, "[") === false && strpos($zxsis, "<") === false && $zxsis != "") {
        $zxsis.=" at [date] for [files]";
    // file_put_contents("092.092",$zxsis);
        analtoken($zxsis, "");
     }
    // file_put_contents("093.093",$fflist);
     subjtokenization($fflist, "files");
     $zhis=str_replace("<files>", $fflist, str_replace("[files]", $fflist, $zhis));
     return mail($zris, subjtokenization($zxsis,"subject"), $ztis, $zhis);
}

    
function analtoken($inofinterest, $ifnotblankbody) {
  global $subjarr, $fflist;
  $inofinterest=trim($inofinterest);
  if ($ifnotblankbody == "" && $inofinterest != "") {   // subject
    if (strpos($inofinterest, "[") === false && strpos($inofinterest, "<") === false && $inofinterest != "") {
        $inofinterest.=" [lf] at [date] [lf] for [files]";
    }
    if (strpos(($inofinterest . "~"), "]~") !== false && strpos(($inofinterest . "~"), "[") !== false) {
// file_put_contents("012.012",$inofinterest);
      $subjarr[3]="html";
      $inofinterest=str_replace("[date]", date('l jS \of F Y h:i:s A'), $inofinterest);
      if (isset($_SERVER['HTTP_REFERER'])) {
      $inofinterest=str_replace("[httpreferer]", $_SERVER['HTTP_REFERER'], $inofinterest);
      $inofinterest=str_replace("[serveraddr]", $_SERVER['SERVER_ADDR'], $inofinterest);
      $inofinterest=str_replace("[requesttime]", $_SERVER['REQUEST_TIME'], $inofinterest);
      $inofinterest=str_replace("[httpacceptlanguage]", $_SERVER['HTTP_ACCEPT_LANGUAGE'], $inofinterest);
      $inofinterest=str_replace("[httpuseragent]", $_SERVER['HTTP_USER_AGENT'], $inofinterest);
      $inofinterest=str_replace("[remoteaddr]", $_SERVER['REMOTE_ADDR'], $inofinterest);
      $inofinterest=str_replace("[requesturi]", $_SERVER['REQUEST_URI'], $inofinterest);
      if (isset($_SERVER['PATH_INFO'])) {
      $inofinterest=str_replace("[pathinfo]", $_SERVER['PATH_INFO'], $inofinterest);
      }
      }
      $inofinterest=str_replace("[lf]", "\n", $inofinterest);
      $inofinterest=str_replace("[crlf]", "\r\n", $inofinterest);
      $huharr=explode("[", $inofinterest);
// file_put_contents("013.013",$inofinterest);
      // $proposedih=$huharr[0];
      if (strpos(($inofinterest . "~"), "]") !== false && strpos(($inofinterest . "~"), "[") !== false) {
// file_put_contents("014.014",$inofinterest);
        for ($ih=1; $ih<sizeof($huharr); $ih++) {
          $thisone=explode("]", $huharr[$ih])[0];
          //if ($huharr[$ih] != ($thisone . "]")) {
          //  $proposedih.=explode(($thisone . "]"), $huharr[$ih])[1];
          //}
          if (strpos($thisone, " ") === false) {
            if (isset($_POST[$thisone])) {
              $inofinterest=str_replace("[" . $thisone . "]", str_replace("+", " ", urldecode($_POST[$thisone])), $inofinterest);
            } else if (isset($_GET[$thisone])) {
              $inofinterest=str_replace("[" . $thisone . "]", str_replace("+", " ", urldecode($_GET[$thisone])), $inofinterest);
            }
          }
        }
      }
      if (strpos(($inofinterest . "~"), "]") !== false && strpos(($inofinterest . "~"), "[") !== false) {
// file_put_contents("015.015",$inofinterest);
        $huharr=explode("[", $inofinterest);
        $proposedih=$huharr[0];
        for ($ih=1; $ih<sizeof($huharr); $ih++) {
          $thisone=explode("]", $huharr[$ih])[0];
          if ($huharr[$ih] != ($thisone . "]")) {
            $proposedih.=explode(($thisone . "]"), $huharr[$ih])[1];
          }
        }
// file_put_contents("025.025",$inofinterest);
        $subjarr[0]=str_replace("\n", " ", str_replace("\r\n", " ", $proposedih));
        if (substr($inofinterest, 0, 1) == "[") {
// file_put_contents("026.026",$inofinterest);
          $subjarr[1]=str_replace("\n", "<br>", str_replace("[", "<", str_replace("]", ">", $inofinterest)));
        } else {
        if (strpos($inofinterest, "\n") !== false) {
// file_put_contents("027.027",$inofinterest);
          $huharr=explode("\n", $inofinterest);


        if (strpos(">" . $inofinterest, ">Flowchart ") !== false) {
          $subjarr[1]="<html><body><div style='width:90%;font-size:28px;font-weight:bold;border:1px solid transparent;background-color:#f0f0f0;'>" . str_replace("\n","<br>",str_replace("Flowchart ", "Flowchart <span title=\"Animated Emoji\" style='opacity:0.5;font-size:32px;'>&#127754;</span><span style='margin-left:-32px;opacity:0.5;font-size:32px;'>&#128202;</span> ", $inofinterest)) . "</div></body></html>";
        } else if (strpos(">" . $inofinterest, ">Mind Map ") !== false) {
          $subjarr[1]="<html><body><div style='width:90%;font-size:28px;font-weight:bold;border:1px solid transparent;background-color:#f0f0f0;'>" . str_replace("\n","<br>",str_replace("Mind Map ", "Mind Map <span title=\"Animated Emoji\" style='opacity:0.5;font-size:32px;'>&#129504;</span><span style='margin-left:-32px;opacity:0.5;font-size:32px;'>&#128506;</span> ", $inofinterest)) . "</div></body></html>";
        } else if (strpos(">" . $inofinterest, ">Venn Diagram ") !== false) {
          $subjarr[1]="<html><body><div style='width:90%;font-size:28px;font-weight:bold;border:1px solid transparent;background-color:#f0f0f0;'>" . str_replace("\n","<br>",str_replace("Venn Diagram ", "Venn Diagram <span title=\"Animated Emoji\" style='opacity:0.5;font-size:32px;'>&#128206;</span><span style='margin-left:-32px;opacity:0.5;font-size:32px;'>&#128391;</span> ", $inofinterest)) . "</div></body></html>";
        } else {

          $subjarr[1]="<html><body><textarea style='width:90%;font-size:28px;font-weight:bold;border:1px solid transparent;background-color:#f0f0f0;' rows=" . (1 + sizeof($huharr)) . ">" . $inofinterest . "</textarea></body></html>";
        }
        } else {
          $subjarr[1]="<html><body><h1>" . $inofinterest . "</h1></body></html>";
// file_put_contents("028.028",$subjarr[1]);
        }
        }
      } else {
// file_put_contents("016.016",$inofinterest);
        $subjarr[0]=str_replace("\n", " ", str_replace("\r\n", " ", $inofinterest));
        if (strpos($inofinterest, "\n") !== false) {
          $huharr=explode("\n", $inofinterest);
        if (strpos(">" . $inofinterest, ">Flowchart ") !== false) {
          $subjarr[1]="<html><body><div style='width:90%;font-size:28px;font-weight:bold;border:1px solid transparent;background-color:#f0f0f0;'>" . str_replace("\n","<br>",str_replace("Flowchart ", "Flowchart <span title=\"Animated Emoji\" style='opacity:0.5;font-size:32px;'>&#127754;</span><span style='margin-left:-32px;opacity:0.5;font-size:32px;'>&#128202;</span> ", $inofinterest)) . "</div></body></html>";
        } else if (strpos(">" . $inofinterest, ">Mind Map ") !== false) {
          $subjarr[1]="<html><body><div style='width:90%;font-size:28px;font-weight:bold;border:1px solid transparent;background-color:#f0f0f0;'>" . str_replace("\n","<br>",str_replace("Mind Map ", "Mind Map <span title=\"Animated Emoji\" style='opacity:0.5;font-size:32px;'>&#129504;</span><span style='margin-left:-32px;opacity:0.5;font-size:32px;'>&#128506;</span> ", $inofinterest)) . "</div></body></html>";
        } else if (strpos(">" . $inofinterest, ">Venn Diagram ") !== false) {
          $subjarr[1]="<html><body><div style='width:90%;font-size:28px;font-weight:bold;border:1px solid transparent;background-color:#f0f0f0;'>" . str_replace("\n","<br>",str_replace("Venn Diagram ", "Venn Diagram <span title=\"Animated Emoji\" style='opacity:0.5;font-size:32px;'>&#128206;</span><span style='margin-left:-32px;opacity:0.5;font-size:32px;'>&#128391;</span> ", $inofinterest)) . "</div></body></html>";
        } else {

          $subjarr[1]="<html><body><textarea style='width:90%;font-size:28px;font-weight:bold;border:1px solid transparent;background-color:#f0f0f0;' rows=" . (1 + sizeof($huharr)) . ">" . $inofinterest . "</textarea></body></html>";
        }
        } else {
          $subjarr[1]="<html><body><h1>" . $inofinterest . "</h1></body></html>";
        }
      }
    }
  } else if ($inofinterest != "") {   // body
    $ifnotblankbody=trim($ifnotblankbody);
  }
// file_put_contents("017.017",$inofinterest);
  return $inofinterest;
}
    
function subjtokenization($inthing, $inmode) {
  global $subjarr, $fflist;
  if ($inmode == "subject") {
    if ($subjarr[0] != "") {
      if ($fflist == "") { return $subjarr[0];   }
      return str_replace("<files>", $fflist, str_replace("[files]", $fflist, str_replace("<file>", $fflist, str_replace("[file]", $fflist, $subjarr[0]))));
    } else if (strpos($inthing, "[") !== false) {
      if ($fflist == "") { return str_replace("[date]", date('l jS \of F Y h:i:s A'), $inthing);   }
      return str_replace("<files>", $fflist, str_replace("[files]", $fflist, str_replace("<file>", $fflist, str_replace("[file]", $fflist, str_replace("[date]", date('l jS \of F Y h:i:s A'), $inthing)))));
    }
    return str_replace("<files>", $fflist, str_replace("[files]", $fflist, $inthing));
  } else if ($inmode == "bodysubject") {
// file_put_contents("036.036","");
    if ($subjarr[1] != "") {
// file_put_contents("037.037",$subjarr[1]);
      if (substr($subjarr[1], 0, 1) == "<" && strpos($subjarr[1], "</h1>") !== false) {
        $subjarr[1]=str_replace("</h1>", "</h1><h3>" . str_replace("\n", "<br>", $inthing) . "</h3>", $subjarr[1]);
      } else if (substr($subjarr[1], 0, 1) == "<" && strpos($subjarr[1], "</body>") !== false) {
        $subjarr[1]=str_replace("</body>", "<h3>" . str_replace("\n", "<br>", $inthing) . "</h3></body>", $subjarr[1]);
      }
      if ($fflist == "" || 1 == 1) { return $subjarr[1]; }
      return str_replace("<files>", $fflist, str_replace("[files]", $fflist, $subjarr[1]));
    }
  } else if ($inmode == "body") {
    if ($subjarr[2] != "") {
      return $subjarr[2];
    }
  } else if ($inmode == "contenttype") {
    if ($subjarr[3] != "") {
      return $subjarr[3];
    }
  } else if ($inmode == "file") {
// file_put_contents("057.057",$subjarr[1]);
    $subjarr[1]=str_replace("<file>", $inthing, str_replace("[file]", $inthing, $subjarr[1]));
// file_put_contents("058.058",$subjarr[1]);
  } else if ($inmode == "files" && $inthing != "") {
// file_put_contents("067.067",$subjarr[0]);
    $subjarr[0]=str_replace("<files>", $inthing, str_replace("[files]", $inthing, $subjarr[0]));
    $subjarr[1]=str_replace("<files>", $inthing, str_replace("[files]", $inthing, $subjarr[1]));
    if ($subjarr[0] != "" && $subjarr[1] != "") {
      if (strpos(preg_replace('/\s+/', ' ', str_replace("<br>","",str_replace("\n","",$subjarr[1]))), preg_replace('/\s+/', ' ', str_replace("<br>","",str_replace("\n","",$subjarr[0])))) !== false) {
        $subjarr[0].=explode("<", explode(preg_replace('/\s+/', ' ', str_replace("<br>","",str_replace("\n","",$subjarr[0]))), preg_replace('/\s+/', ' ', str_replace("<br>","",str_replace("\n","",$subjarr[1]))))[1])[0];
      }
    }
    if (strpos($subjarr[1], "Flowchart ") !== false) {
      //$subjarr[1]=str_replace("textarea", "div", str_replace("Flowchart ", "Flowchart <span title=\"Animated Emoji\" style='opacity:0.5;font-size:32px;'>&#127754;</span><span style='margin-left:-32px;opacity:0.5;font-size:32px;'>&#128202;</span> ", $subjarr[1]));
      $subjarr[0]=str_replace("Flowchart ", "Flowchart " . html_entity_decode("&#127754;") . html_entity_decode("&#128202;") . " ", $subjarr[0]);
    }
    if (strpos($subjarr[1], "Venn Diagram ") !== false) {
      $subjarr[0]=str_replace("Venn Diagram ", "Venn Diagram " . html_entity_decode("&#128206;") . html_entity_decode("&#128391;") . " ", $subjarr[0]);
    }
    if (strpos($subjarr[1], "Mind Map ") !== false) {
      $subjarr[0]=str_replace("Mind Map ", "Mind Map " . html_entity_decode("&#129504;") . html_entity_decode("&#128506;") . " ", $subjarr[0]);
    }
    }
  }
  return $inthing;
}


function server_remote_addr() {
    global $ua;
    $rma = $_SERVER['REMOTE_ADDR'];
    $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
    // you can add different browsers with the same way ..
    if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
            $rma = '000000'.$rma;
    elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
            $rma = '000'.$rma;
    elseif(preg_match('/(opr)[ \/]([\w.]+)/', $ua))
            $rma = '000'.$rma;
    elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
            $rma = '0000'.$rma;
    elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
            $rma = '00'.$rma;
    elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
            $rma = '0'.$rma;
    elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
            $rma = '00000'.$rma;
    else
            $rma = '0000000'. $rma;
    return str_replace(":", "_", str_replace(".", "_", $rma));
}

if (!$getpostfound) {
  $phpcont=file_get_contents(dirname(__FILE__) . "/flowchart.php");
  
  // http://www.rjmprogramming.com.au/HTMLCSS/flowchart.html?feedback=yes&recim=pptestis
  // &emailcc=rmetcalfe15%40gmail.com&emailto=Rmetcalfe41%40gmail.com&nameto=RM&namecc=RMet&nameto=RM&namecc=RMet
  if (strpos(('' . $_SERVER['HTTP_REFERER']), $fct . "?feedback=") !== false && strpos(('' . $_SERVER['HTTP_REFERER']), $fct . "?feedback=&") === false) {
  //file_put_contents("1110.aaa", "");
   if (strpos(('' . $_SERVER['HTTP_REFERER']), "&recim=") !== false && strpos(('' . $_SERVER['HTTP_REFERER']), "recim=&") === false) {
  //file_put_contents("1110.bbb", "");
   $buttrytofind='$' . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0] . '_' . server_remote_addr() . '="';
   $trytofind='$' . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0] . '_0';
   if (strpos($phpcont, $trytofind) !== false && strpos($phpcont, $buttrytofind) === false) {
  //file_put_contents("1110.ccc", "");
    $sufftry=explode('="', explode($trytofind, $phpcont)[-1 + sizeof(explode($trytofind, $phpcont))])[0] . '="';
    $trytofind.=$sufftry;

    $retst="";
    if (strpos(('' . $_SERVER['HTTP_REFERER']), "&namecc=") !== false && strpos(('' . $_SERVER['HTTP_REFERER']), "namecc=&") === false) {
     $retst.=str_replace("+"," ",urldecode(explode("&", explode("&namecc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])) . "[]";
     $retst=str_replace("[]", "[" . strtoupper(substr(str_replace("+"," ",urldecode(explode("&", explode("&emailcc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])),0,1)) . strtolower(substr(str_replace("+"," ",urldecode(explode("&", explode("&emailcc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])),1)) . "]", $retst);
    } else {
     $retst.=strtoupper(substr(str_replace("+"," ",urldecode(explode("&", explode("&emailcc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])),0,1)) . strtolower(substr(str_replace("+"," ",urldecode(explode("&", explode("&emailcc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])),1));
    }
    if (strpos(('' . $_SERVER['HTTP_REFERER']), "&nameto=") !== false && strpos(('' . $_SERVER['HTTP_REFERER']), "nameto=&") === false) {
     $retst.=";" . str_replace("+"," ",urldecode(explode("&", explode("&nameto=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])) . "[]";
     $retst=str_replace("[]", "[" . strtolower(str_replace("+"," ",urldecode(explode("&", explode("&emailto=", ('' . $_SERVER['HTTP_REFERER']))[1])[0]))) . "]", $retst);
    } else {
     $retst.=";" . strtolower(str_replace("+"," ",urldecode(explode("&", explode("&emailto=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])));
    }
    $retst.=";" . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0];    
    
  //file_put_contents("1110.fff", "");
    if (strlen(explode('"', explode($trytofind, $phpcont)[1])[0]) == strlen(explode('" . "', explode($trytofind, $phpcont)[1])[0])) {
  //file_put_contents("1110.ggg", "");
     if (strpos(explode('";', explode($trytofind, $phpcont)[1])[0], '_' . server_remote_addr() . '_') === false) {
  //file_put_contents("1110.hhh", "");
      if (strlen(explode('"', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0]) == strlen(explode('";', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0])) {
  //file_put_contents("1110.iii", "");
       $phpcont=str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '" . "' . '~' . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0] . '_' . server_remote_addr() . '_' . str_replace('"','`',$retst),$phpcont);
       file_put_contents(dirname(__FILE__) . "/flowchart.php", $phpcont);
      } else {
  //file_put_contents("1110.jjj", "");
       $phpcont=str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '~' . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0] . '_' . server_remote_addr() . '_' . server_remote_addr() . '_' . str_replace('"','`',$retst),$phpcont);
       file_put_contents(dirname(__FILE__) . "/flowchart.php", $phpcont);
      }
     }
    }
    }
   }
  }
    
  $defeto="";
  $defefrom="you" . "will" . "nere" . "fInd" . "That";
  $selchoices=explode('_' . server_remote_addr() . '="', $phpcont);
  $selchoicestwo=explode('_' . server_remote_addr() . '_', $phpcont);
  $selcont="";
  if (sizeof($selchoices) > 1 || sizeof($selchoicestwo) > 1) {
  $selcont="<select style=background-color:yellow; onclick=unnotc(event); id=mysel onchange=ifit(this);><option id=topsaveopt value=> ... that you Saved ...</option></select>";
  for ($i=0; $i<sizeof($selchoices); $i++) {

    if (strpos(explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))], "%3Cdiv") === false && strpos(explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))], "PGRpdiBp") === false) {
    
    if (($i + 1) == sizeof($selchoices)) {
    $selcont=str_replace("</select>", "<option title=\"\" value=\"" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "\">" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "</option></select>", $selcont);
    } else if (strpos($selchoices[1 + $i], '" . "') !== false && strpos($selchoices[1 + $i], '"') !== false && strpos($selchoices[1 + $i], '" . "') == strpos($selchoices[1 + $i], '"')) { 
    $xytitle=explode('";', explode('" . "', $selchoices[1 + $i])[1])[0];
    $xtitle=str_replace('\"', '"', explode('" . "', $xytitle)[0]);
    if ($xtitle != "") {
      $defefrom=' viaphp=""';
      $defeto=' viaphp="' . $xtitle . '"';
    }
    $selcont=str_replace("</select>", "<option title=\"\" value=\"" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "\">" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "</option></select>", $selcont);
    $selcont=str_replace("> ... that you Saved ...<", "> ... that you Saved ... or Originated<", $selcont);
    $selcont=str_replace("</select>", "<option data-title=\"" . explode('"', $selchoices[1 + $i])[0] . "\" value=\"" . str_replace('"', '`', $xtitle) . "\" title=\"" . str_replace('"', '`', $xtitle) . "\">" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . " as Originator</option></select>", $selcont);
    } else {
    $selcont=str_replace("</select>", "<option title=\"\" value=\"" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "\">" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "</option></select>", $selcont);
    }

    }
  }
  file_put_contents("1115.fff", "" . sizeof($selchoicestwo));
  for ($i=0; $i<sizeof($selchoicestwo); $i++) {
    if (($i + 1) != sizeof($selchoicestwo)) {
  //file_put_contents("1115.ggg", "" . sizeof($selchoicestwo));
     $selcont=str_replace("> ... that you Saved ...<", "> ... that you Saved ... or Collaborated<", str_replace("> ... that you Saved ... or Originated<", "> ... that you Saved ... or Originated or Collaborated<", $selcont));
     $anydef=explode('"', explode("~", $selchoicestwo[1 + $i])[0])[0];
     if ($anydef != "") {
     $selcont=str_replace("</select>", "<option data-phpnop=\"" . $anydef . "\" title=\" tryhard \" value=\"" . explode('~', $selchoicestwo[$i])[-1 + sizeof(explode('~', $selchoicestwo[$i]))] . "\">" . explode('~', $selchoicestwo[$i])[-1 + sizeof(explode('~', $selchoicestwo[$i]))] . " as Collaborator</option></select>", $selcont);
     } else {
     $selcont=str_replace("</select>", "<option title=\" tryhard \" value=\"" . explode('~', $selchoicestwo[$i])[-1 + sizeof(explode('~', $selchoicestwo[$i]))] . "\">" . explode('~', $selchoicestwo[$i])[-1 + sizeof(explode('~', $selchoicestwo[$i]))] . " as Collaborator</option></select>", $selcont);
     }
    }
  }

  echo str_replace("></h1>", "></H1>", str_replace("></H1>", "></h1>", str_replace('<div id="dsave"></div>', '<div id="dsave">&nbsp;</div>', str_replace("ambeingsupervised=false", "ambeingsupervised=true", str_replace("ambeingsupervised = false", "ambeingsupervised=true", str_replace("t</h1>", "t " . $selcont . "</h1>", str_replace($defefrom, $defeto, file_get_contents(dirname(__FILE__) . "/" . $fct))))))));
  } else {
  echo str_replace('<div id="dsave"></div>', '<div id="dsave">&nbsp;</div>', str_replace("ambeingsupervised=false", "ambeingsupervised=true", str_replace("ambeingsupervised = false", "ambeingsupervised=true", str_replace($defefrom, $defeto, file_get_contents(dirname(__FILE__) . "/" . $fct)))));
  }
  exit;
} else if (isset($_GET['recall'])) {
  $zzx="'";
  $plusal="";
  $xd="";
  if (isset($_GET['tryhard'])) {
  //file_put_contents("111.nnn", "");
    $xd="X";
    $qwa=str_replace("+"," ",urldecode($_GET['tryhard']));
    $atl="alert";
    if (strlen($qwa) == 0 && isset($_GET['feedback'])) { 
      $qwa=str_replace("+"," ",urldecode($_GET['feedback']));
      if ($qwa == "") {
  //file_put_contents("111.mmm", "");
        $atl=" var fbk=prompt";
        if (isset($_GET['emailcc'])) { 
        $zzx="Please enter any feedback you want to return to ' + bto + ' at " . str_replace("+"," ",urldecode($_GET['emailto'])) . " noting that if you append a blank we will wait around and also pass on your first click position as well.',''); if (fbk == null) { fbk='';  } else { if (fbk.length > 0) {  gfbk=document.URL.replace('recall=','recim=').replace('.php','.html').split('#')[0] + encodeURIComponent(fbk.trim()); if (fbk == fbk.trim()) { location.href=gfbk;  } else { gridxy=' '; } }  } var xfbk=(fbk";
        } else if (!isset($_GET['phpnop'])) {
        $zzx="Please enter any feedback you want to return to ' + bto + ' noting that if you append a blank we will wait around and also pass on your first click position as well.',''); if (fbk == null) { fbk='';  } else { if (fbk.length > 0) { gfbk=document.URL.replace('recall=','recim=').replace('.php','.html').split('#')[0] + encodeURIComponent(fbk.trim());   if (fbk == fbk.trim()) { location.href=gfbk;  } else { gridxy=' '; }  }  } var xfbk=(fbk";
        } else {
        $atl=" var fbk=dummyprompt";
        $zzx="Please enter any feedback you want to return to ' + bto + ' noting that if you append a blank we will wait around and also pass on your first click position as well.',''); if (fbk == null) { fbk='';  } else { if (fbk.length > 0) { gfbk=document.URL.replace('recall=','recim=').replace('.php','.html').split('#')[0] + encodeURIComponent(fbk.trim());   if (fbk == fbk.trim()) { location.href=gfbk;  } else { gridxy=' '; }  }  } var xfbk=(fbk";
        }
      } else {
  //file_put_contents("111.kkk", "");
      }
    } else {
  file_put_contents("111.jjj", "");
    }
    if (strlen($qwa) == 0) { 
      if ($zzx == "'") { $atl=" \$vbcx=";  }
    }
    if (isset($_GET['suggestionxy'])) {
    $plusal=" <scri" . "pt type='text/javascript'> function dummyprompt(a,b) { return '  '; } function doal() { " . $atl . "('" . str_replace("~", "' + String.fromCharCode(10) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("<br>", "' + String.fromCharCode(10) + '", str_replace("+"," ",urldecode($_GET['tryhard'])))))) . "" . $zzx . ");  var beis=documentelementFromPoint(" . str_replace('a','0',str_replace('b','1',str_replace('c','2',str_replace('d','3',str_replace('e','4',str_replace('f','5',str_replace('g','6',str_replace('h','7',str_replace('i','8',str_replace('j','9',str_replace('k',',',str_replace("+"," ",urldecode($_GET['suggestionxy']))))))))))))) . "); if (beis) { beis.click(); } else if (1 == 2) { alert('Ouch'); } } setTimeout(doal,9000); </scr" . "ipt>";
    } else if (!isset($_GET['phpnop'])) {
    $plusal=" <scri" . "pt type='text/javascript'> function dummyprompt(a,b) { return '  '; } function doal() { " . $atl . "('" . str_replace("~", "' + String.fromCharCode(10) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("<br>", "' + String.fromCharCode(10) + '", str_replace("+"," ",urldecode($_GET['tryhard'])))))) . "" . $zzx . "); } setTimeout(doal,9000); </scr" . "ipt>";
    } else {
    $plusal=" <scri" . "pt type='text/javascript'> function dummyprompt(a,b) { return '  '; } function doal() { " . $atl . "('" . str_replace("~", "' + String.fromCharCode(10) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("<br>", "' + String.fromCharCode(10) + '", str_replace("+"," ",urldecode($_GET['tryhard'])))))) . "" . $zzx . "); } setTimeout(doal,9000); </scr" . "ipt>";
    }
  }
  $phpcont=file_get_contents(dirname(__FILE__) . "/flowchart.php");
  $trytofind='$' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '_' . server_remote_addr() . '="';
  if (strpos($phpcont, $trytofind) !== false) {     
  //file_put_contents("111.ppp", "");
    $vdb='';
    $vdbe='';
    $htmlisc=file_get_contents(dirname(__FILE__) . "/" . $fct);
    if (strpos($htmlisc, '<div id="dheader"') !== false) {  $vdb='<div id="dheader"' . explode('</div>', explode('<div id="dheader"', $htmlisc)[1])[0] . '</div>';  }
    echo str_replace("<p></p>", $plusal, str_replace('function onl() {', 'function onl() { myselsc="' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '"; setTimeout(mysels,2000); ', str_replace('"' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '">', '"' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '" selected>', str_replace(">Start<", ">?<", str_replace('"Start"', '"?"', str_replace('<div id="dcontent">' . $vdb . '</div>', '<div id="dcontent">' . str_replace('+', ' ', urldecode(base64_decode(explode('"', explode($trytofind, $phpcont)[1])[0]))) . '</div>', $htmlisc))))));
  } else if (isset($_GET['tryhard'])) {  
  //file_put_contents("111.zzz", "");
    $plusal="";
    $qwa=str_replace("+"," ",urldecode($_GET['tryhard']));
    $atl="alert";
    if (strlen($qwa) == 0 && isset($_GET['feedback'])) { 
      $qwa=str_replace("+"," ",urldecode($_GET['feedback']));
      if ($qwa == "") {
        $atl=" var fbk=prompt";
        if (isset($_GET['emailcc'])) { 
        $zzx="Please enter any feedback you want to return to ' + bto + ' at " . str_replace("+"," ",urldecode($_GET['emailto'])) . " noting that if you append a blank we will wait around and also pass on your first click position as well.',''); if (fbk == null) { fbk='';  } else { if (fbk.length > 0) { gfbk=document.URL.replace('recall=','recim=').replace('.php','.html').split('#')[0] + encodeURIComponent(fbk.trim());  if (fbk == fbk.trim()) { location.href=gfbk;  } else { gridxy=' '; }  }  } var xfbk=(fbk";
        } else if (!isset($_GET['phpnop'])) {
        $zzx="Please enter any feedback you want to return to ' + bto + ' noting that if you append a blank we will wait around and also pass on your first click position as well.',''); if (fbk == null) { fbk='';  } else { if (fbk.length > 0) { gfbk=document.URL.replace('&feedback=','').replace('recall=','recim=').replace('emailto=','EMAILTOX=').replace('emailcc=','emailto=').replace('EMAILTOX=','emailcc=').replace('.php','.html').replace('?','?feedback=' + encodeURIComponent(fbk.trim()) + '&').split('#')[0];  if (fbk == fbk.trim()) { location.href=gfbk;  } else { gridxy=' '; }  }  } var xfbk=(fbk";
        } else {
        $atl=" var fbk=dummyprompt";
        $zzx="Please enter any feedback you want to return to ' + bto + ' noting that if you append a blank we will wait around and also pass on your first click position as well.',''); if (fbk == null) { fbk='';  } else { if (fbk.length > 0) { gfbk=document.URL.replace('&feedback=','').replace('recall=','recim=').replace('emailto=','EMAILTOX=').replace('emailcc=','emailto=').replace('EMAILTOX=','emailcc=').replace('.php','.html').replace('?','?feedback=' + encodeURIComponent(fbk.trim()) + '&').split('#')[0];  if (fbk == fbk.trim()) { location.href=gfbk;  } else { gridxy=' '; }  }  } var xfbk=(fbk";
        }
      }
    }
    if (strlen($qwa) == 0) { 
      if (str_replace("'","",$zzx) == "") { $atl=" \$vbcx=";  }
    }
  if (isset($_GET['suggestionxy'])) {
  $plusal=" <scri" . "pt type='text/javascript'> function dummyprompt(a,b) { return '  '; }  function doal() { " . $atl . "('" . str_replace("~", "' + String.fromCharCode(10) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("<br>", "' + String.fromCharCode(10) + '", str_replace("+"," ",urldecode($_GET['tryhard'])))))) . "" . $zzx . ");  var beis=documentelementFromPoint(" . str_replace('a','0',str_replace('b','1',str_replace('c','2',str_replace('d','3',str_replace('e','4',str_replace('f','5',str_replace('g','6',str_replace('h','7',str_replace('i','8',str_replace('j','9',str_replace('k',',',str_replace("+"," ",urldecode($_GET['suggestionxy']))))))))))))) . "); if (beis) { beis.click(); } else if (1 == 2) { alert('OucH'); }  } setTimeout(doal,9000); </scr" . "ipt>";
  } else if (!isset($_GET['phpnop'])) {
  $plusal=" <scri" . "pt type='text/javascript'> function dummyprompt(a,b) { return '  '; }  function doal() { " . $atl . "('" . str_replace("~", "' + String.fromCharCode(10) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("<br>", "' + String.fromCharCode(10) + '", str_replace("+"," ",urldecode($_GET['tryhard'])))))) . "" . $zzx . "); } setTimeout(doal,9000); </scr" . "ipt>";
  } else {
  $plusal=" <scri" . "pt type='text/javascript'> function dummyprompt(a,b) { return '  '; }  function doal() { " . $atl . "('" . str_replace("~", "' + String.fromCharCode(10) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("<br>", "' + String.fromCharCode(10) + '", str_replace("+"," ",urldecode($_GET['tryhard'])))))) . "" . $zzx . "); } setTimeout(doal,9000); </scr" . "ipt>";
  }
  $trytofind='$' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '_0'; // . server_remote_addr() . '="';
   file_put_contents("111.yyy", "");
  if (strpos($phpcont, $trytofind) !== false) {   
  //file_put_contents("111.xxx", "");
    $sufftry=explode('="', explode($trytofind, $phpcont)[-1 + sizeof(explode($trytofind, $phpcont))])[0] . '="';
    $trytofind.=$sufftry;
    $vdb='';
    $vdbe='';
  //file_put_contents("111.www", $fct);
    $htmlisc=file_get_contents(dirname(__FILE__) . "/" . $fct);
  //file_put_contents("111.vvv", "");
    if (strpos($phpcont, $trytofind) !== false && strpos($htmlis, "<br></div>") !== false) {
    
  //file_put_contents("111.aaa", "");
    if (strlen(explode('"', explode($trytofind, $phpcont)[1])[0]) == strlen(explode('" . "', explode($trytofind, $phpcont)[1])[0])) {
  //file_put_contents("111.bbb", "");
     if (strpos(explode('";', explode($trytofind, $phpcont)[1])[0], '_' . server_remote_addr() . '_') === false) {
  //file_put_contents("111.ccc", "");
      if (strlen(explode('"', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0]) == strlen(explode('";', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0])) {
  //file_put_contents("111.ddd", "");
       file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '" . "' . '~' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '_' . server_remote_addr() . '_',$phpcont));
      } else {
  //file_put_contents("111.eee", "");
       file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '~' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '_' . server_remote_addr() . '_' . server_remote_addr() . '_',$phpcont));
      }
     }
    }
    
    echo str_replace("<p></p>", $plusal, str_replace("<br></div>", "<br></div>" . "<img src=" . explode('"', explode($trytofind, $phpcont)[1])[0] . "></img>", $htmlis));
    } else if (!isset($_GET['phpnop'])) {
    if (strpos($htmlisc, '<div id="dheader"') !== false) {  $vdb='<div id="dheader"' . explode('</div>', explode('<div id="dheader"', $htmlisc)[1])[0] . '</div>';  }
    
  //file_put_contents("111.fff", "");
    if (strlen(explode('"', explode($trytofind, $phpcont)[1])[0]) == strlen(explode('" . "', explode($trytofind, $phpcont)[1])[0])) {
  //file_put_contents("111.ggg", "");
     if (strpos(explode('";', explode($trytofind, $phpcont)[1])[0], '_' . server_remote_addr() . '_') === false) {
  //file_put_contents("111.hhh", "");
      if (strlen(explode('"', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0]) == strlen(explode('";', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0])) {
  //file_put_contents("111.iii", "");
       file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '" . "' . '~' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '_' . server_remote_addr() . '_',$phpcont));
      } else {
  //file_put_contents("111.jjj", "");
       file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '~' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '_' . server_remote_addr() . '_' . server_remote_addr() . '_',$phpcont));
      }
     }
    }
    
    echo str_replace("<p></p>", $plusal, str_replace('funct' . $xd . 'ion onl() {', 'function onl() { myselsc="' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '"; setTimeout(mysels,2000); ', str_replace('"' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '">', '"' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '" selected>', str_replace(">Start<", ">?<", str_replace('"Start"', '"?"', str_replace('<div id="dcontent">' . $vdb . '</div>', '<div id="dcontent">' . str_replace('+', ' ', urldecode(base64_decode(explode('"', explode($trytofind, $phpcont)[1])[0]))) . '</div>', $htmlisc))))));
    } else {
    if (strpos($htmlisc, '<div id="dheader"') !== false) {  $vdb='<div id="dheader"' . explode('</div>', explode('<div id="dheader"', $htmlisc)[1])[0] . '</div>';  }
    
  //file_put_contents("111.kkk", "");
    if (strlen(explode('"', explode($trytofind, $phpcont)[1])[0]) == strlen(explode('" . "', explode($trytofind, $phpcont)[1])[0])) {
  //file_put_contents("111.lll", "");
     if (strpos(explode('";', explode($trytofind, $phpcont)[1])[0], '_' . server_remote_addr() . '_') === false) {
  //file_put_contents("111.mmm", "");
      if (strlen(explode('"', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0]) == strlen(explode('";', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0])) {
  //file_put_contents("111.nnn", "");
       file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '" . "' . '~' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '_' . server_remote_addr() . '_',$phpcont));
      } else {
  //file_put_contents("111.ooo", "");
       file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '~' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '_' . server_remote_addr() . '_' . server_remote_addr() . '_',$phpcont));
      }
     }
    }
    
    echo str_replace("<p></p>", $plusal, str_replace('funct' . $xd . 'ion onl() {', 'function onl() { myselsc="' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '"; setTimeout(mysels,2000); ', str_replace('"' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '">', '"' . str_replace('+','',str_replace(' ','',urldecode($_GET['recall']))) . '" selected>', str_replace(">Start<", ">?<", str_replace('"Start"', '"?"', str_replace('<div id="dcontent">' . $vdb . '</div>', '<div id="dcontent">' . str_replace('+', ' ', urldecode(base64_decode(explode('"', explode($trytofind, $phpcont)[1])[0]))) . '</div>', $htmlisc))))));
    }
  }
  } else {
    $phpcont=file_get_contents(dirname(__FILE__) . "/flowchart.php");
    echo "<!doctype html><html><body onload=\" if (parent.document.getElementById('dsave')) { if (parent.document.getElementById('dsave').innerHTML.length == 0) { parent.document.getElementById('dsave').innerHTML='&nbsp;'; } } \"></body></html>";
  }
  exit;
} else if (isset($_POST['recall'])) {
  $zzx="'";
  $plusal="";
  $xd="";
  if (isset($_POST['tryhard'])) {
    $xd="X";
    $qwa=str_replace("+"," ",urldecode($_POST['tryhard']));
    $atl="alert";
    if (strlen($qwa) == 0 && isset($_POST['feedback'])) { 
      $qwa=str_replace("+"," ",urldecode($_POST['feedback']));
      if ($qwa == "") {
        $atl=" var fbk=prompt";
        if (isset($_POST['emailcc'])) { 
        $zzx="Please enter any feedback you want to return to ' + bto + ' at " . str_replace("+"," ",urldecode($_POST['emailto'])) . " noting that if you append a blank we will wait around and also pass on your first click position as well.',''); if (fbk == null) { fbk='';  } else { if (fbk.length > 0) { gfbk=document.URL.replace('recall=','recim=').replace('.php','.html').split('#')[0] + encodeURIComponent(fbk.trim());  if (fbk == fbk.trim()) { location.href=gfbk;  } else { gridxy=' '; }  }  } var xfbk=(fbk";
        } else if (!isset($_POST['phpnop'])) {
        $zzx="Please enter any feedback you want to return to ' + bto + ' noting that if you append a blank we will wait around and also pass on your first click position as well.',''); if (fbk == null) { fbk='';  } else { if (fbk.length > 0) { gfbk=document.URL.replace('&feedback=','').replace('recall=','recim=').replace('emailto=','EMAILTOX=').replace('emailcc=','emailto=').replace('EMAILTOX=','emailcc=').replace('.php','.html').replace('?','?feedback=' + encodeURIComponent(fbk.trim()) + '&').split('#')[0];  if (fbk == fbk.trim()) { location.href=gfbk;  } else { gridxy=' '; }  }  } var xfbk=(fbk";
        } else {
        $atl=" var fbk=dummyprompt";
        $zzx="Please enter any feedback you want to return to ' + bto + ' noting that if you append a blank we will wait around and also pass on your first click position as well.',''); if (fbk == null) { fbk='';  } else { if (fbk.length > 0) { gfbk=document.URL.replace('&feedback=','').replace('recall=','recim=').replace('emailto=','EMAILTOX=').replace('emailcc=','emailto=').replace('EMAILTOX=','emailcc=').replace('.php','.html').replace('?','?feedback=' + encodeURIComponent(fbk.trim()) + '&').split('#')[0];  if (fbk == fbk.trim()) { location.href=gfbk;  } else { gridxy=' '; }  }  } var xfbk=(fbk";
        }
      }
    }
    if (strlen($qwa) == 0) { 
      if (str_replace("'","",$zzx) == "") { $atl=" \$vbcx=";  }
    }
    if (isset($_POST['suggestionxy'])) {
    $plusal=" <scri" . "pt type='text/javascript'> function dummyprompt(a,b) { return '  '; }  function doal() { " . $atl . "('" . str_replace("~", "' + String.fromCharCode(10) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("<br>", "' + String.fromCharCode(10) + '", str_replace("+"," ",urldecode($_POST['tryhard'])))))) . "');  var beis=documentelementFromPoint(" . str_replace('a','0',str_replace('b','1',str_replace('c','2',str_replace('d','3',str_replace('e','4',str_replace('f','5',str_replace('g','6',str_replace('h','7',str_replace('i','8',str_replace('j','9',str_replace('k',',',str_replace("+"," ",urldecode($_POST['suggestionxy']))))))))))))) . "); if (beis) { beis.click(); } else if (1 == 2) { alert('Ouch'); } } setTimeout(doal,9000); </scr" . "ipt>";
    } else if (!isset($_POST['phpnop'])) {
    $plusal=" <scri" . "pt type='text/javascript'> function dummyprompt(a,b) { return '  '; }  function doal() { " . $atl . "('" . str_replace("~", "' + String.fromCharCode(10) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("<br>", "' + String.fromCharCode(10) + '", str_replace("+"," ",urldecode($_POST['tryhard'])))))) . "'); } setTimeout(doal,9000); </scr" . "ipt>";
    } else {
    $plusal=" <scri" . "pt type='text/javascript'> function dummyprompt(a,b) { return '  '; }  function doal() { " . $atl . "('" . str_replace("~", "' + String.fromCharCode(10) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("<br>", "' + String.fromCharCode(10) + '", str_replace("+"," ",urldecode($_POST['tryhard'])))))) . "'); } setTimeout(doal,9000); </scr" . "ipt>";
    }
  }
  $phpcont=file_get_contents(dirname(__FILE__) . "/flowchart.php");
  $trytofind='$' . str_replace('+','',str_replace(' ','',urldecode($_POST['recall']))) . '_' . server_remote_addr() . '="';
  if (strpos($phpcont, $trytofind) !== false) { 
    $vdb='';
    $vdbe='';
    $htmlisc=file_get_contents(dirname(__FILE__) . "/" . $fct);
    if (strpos($htmlisc, '<div id="dheader"') !== false) {  $vdb='<div id="dheader"' . explode('</div>', explode('<div id="dheader"', $htmlisc)[1])[0] . '</div>';  }
    echo  str_replace("<p></p>", $plusal, str_replace('funct' . $xd . 'ion onl() {', 'function onl() { myselsc="' . str_replace('+','',str_replace(' ','',urldecode($_POST['recall']))) . '"; setTimeout(mysels,2000); ', str_replace('"' . str_replace('+','',str_replace(' ','',urldecode($_POST['recall']))) . '">', '"' . str_replace('+','',str_replace(' ','',urldecode($_POST['recall']))) . '" selected>', str_replace(">Start<", ">?<", str_replace('"Start"', '"?"', str_replace('<div id="dcontent">' . $vdb . '</div>', '<div id="dcontent">' . str_replace('+', ' ', urldecode(base64_decode(explode('"', explode($trytofind, $phpcont)[1])[0]))) . '</div>', $htmlisc))))));
  } else {
    $phpcont=file_get_contents(dirname(__FILE__) . "/flowchart.php");
    echo "<!doctype html><html><body onload=\" if (parent.document.getElementById('dsave')) { if (parent.document.getElementById('dsave').innerHTML.length == 0) { parent.document.getElementById('dsave').innerHTML='&nbsp;'; } } \"></body></html>";
  }
  exit;
} else if (1 == 4 && isset($_GET['newsave']) && isset($_GET['newsavecontent'])) {
  $phpcont=file_get_contents(dirname(__FILE__) . "/flowchart.php");
  $ourstuff='$' . str_replace('+','',str_replace(' ','',urldecode($_GET['newsave']))) . '_' . server_remote_addr() . '="';
  if (strpos($phpcont, $ourstuff) !== false) {  
  $phpcont=str_replace($ourstuff . explode('"', explode($ourstuff, $phpcont)[1])[0] . '";', '', $phpcont);
  $ourstuff.=base64_encode($_GET['newsavecontent']) . '"; ';
  file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace('?' . '>', $ourstuff . "\n" . '?' . '>', $phpcont));  
  } else {
  $ourstuff.=base64_encode($_GET['newsavecontent']) . '"; ';
  file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace('?' . '>', $ourstuff . "\n" . '?' . '>', $phpcont));  
  }   
} else if (isset($_POST['newsave']) && isset($_POST['newsavecontent'])) {
  //file_put_contents('000.xxx', '' . strlen($_POST['newsave']) . ' ' . $ua);
  $phpcont=file_get_contents(dirname(__FILE__) . "/flowchart.php");
  $ourstuff='$' . str_replace('+','',str_replace(' ','',urldecode($_POST['newsave']))) . '_' . server_remote_addr() . '="';
  //file_put_contents('000.yyy', "");
  if (strpos($phpcont, $ourstuff) !== false) {  
  //file_put_contents('000.ttt', "");
  $phpcont=str_replace($ourstuff . explode('"', explode($ourstuff, $phpcont)[1])[0] . '"', " \$wqr=\"\"", $phpcont);
  if (isset($_POST['extraarg'])) {
  //file_put_contents('000.zzz', "");
  $ourstuff.=base64_encode($_POST['newsavecontent']) . '" . "' . str_replace('"','`',str_replace("+"," ",urldecode($_POST['extraarg']))) . '"; ';
  } else {
  //file_put_contents('000.www', "");
  $ourstuff.=base64_encode($_POST['newsavecontent']) . '"; ';
  }
  file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace('?' . '>', $ourstuff . "\n" . '?' . '>', $phpcont));  
  } else {
  if (isset($_POST['extraarg'])) {
  //file_put_contents('000.vvv', "");
  $ourstuff.=base64_encode($_POST['newsavecontent']) . '" . "' . str_replace('"','`',str_replace("+"," ",urldecode($_POST['extraarg']))) . '"; ';
  } else {
  //file_put_contents('000.uuu', "");
  $ourstuff.=base64_encode($_POST['newsavecontent']) . '"; ';
  }
  //file_put_contents('000.sss', "");
  file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace('?' . '>', $ourstuff . "\n" . '?' . '>', $phpcont));  
  } 
  exit;  
} else if (1 == 4 && isset($_GET['newemail']) && isset($_GET['newemailcontent'])) {
                $subject = analtoken('Flowchart via https://www.rjmprogramming.com.au/HTMLCSS/' . $fct,'');
                $to = explode(";", urldecode($_GET['newemail']))[0];
                $eol = PHP_EOL;
                $headers = 'From: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
                $headers .= 'Reply-To: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;

                $filename="flow_chart.html";
                $hcont='<html><body><div id="dcontent">' .  str_replace("+", " ", urldecode($_GET['newemailcontent'])) . '</div><style>' . explode("<style>", explode("</style>", file_get_contents(dirname(__FILE__) . "/" . $fct))[0])[1] . '</style></body></html>';
                $content = chunk_split(base64_encode($hcont));
                //$uid = md5(uniqid(time()));

                // a random hash will be necessary to send mixed content
                $separator = md5(time());

                $headers .= "MIME-Version: 1.0" . $eol;
                $headers .= "Content-Type: multipart/mixed; boundary=\"" . $separator . "\"" . $eol . $eol;
                $headers .= "Content-Transfer-Encoding: 7bit" . $eol;
                $headers .= "This is a MIME encoded message." . $eol . $eol;

                // message
                $headers .= "--" . $separator . $eol;
                $headers .= "Content-Type: text/" . subjtokenization("plain", "contenttype") . "; charset=\"iso-8859-1\"" . $eol;
                $headers .= "Content-Transfer-Encoding: 8bit" . $eol . $eol;

                $headers .= subjtokenization("Please see attachment below:", "bodysubject") . $eol . $eol;

                // attachment
                $headers .= "--" . $separator . $eol;
                $headers .= "Content-Type: application/octet-stream; name=\"" . $filename . "\"" . $eol;
                $headers .= "Content-Transfer-Encoding: base64" . $eol;

                if ($fflist == "") {
                  $fflist=$filename;
                } else {
                  $fflist.="," . $filename;
                }
    		$headers .= "Content-Disposition: attachment;filename=\"" . subjtokenization($filename,"file") . "\"" . $eol;


                //$headers .= "Content-Disposition: attachment;filename=\"" . $filename . "\"" . $eol;
                $headers .= $content . $eol . $eol;

                $headers .= "--" . $separator . "--";

                zmail($to, $subject, "", $headers);


                echo "<!doctype html><html><body onload=\" parent.document.getElementById('myemail').innerHTML='Emailed " . $to . " the ';   \"></body></html>";
                
} else if (isset($_POST['newemail']) && isset($_POST['newemailcontent'])) {
                if (strpos(('' . $_SERVER['HTTP_REFERER']), "?venn=Mind") !== false) {
                $subject = analtoken('Mind Map via https://www.rjmprogramming.com.au/HTMLCSS/' . $fct,'');
                $filename="mind_map.html";
                } else if (strpos(('' . $_SERVER['HTTP_REFERER']), "?venn=") !== false) {
                $subject = analtoken('Venn Diagram via https://www.rjmprogramming.com.au/HTMLCSS/' . $fct,'');
                $filename="venn_diagram.html";
                } else {
                $subject = analtoken('Flowchart via https://www.rjmprogramming.com.au/HTMLCSS/' . $fct,'');
                $filename="flow_chart.html";
                }
                $to = explode(';', urldecode($_POST['newemail']))[0];
                $eol = PHP_EOL;
                $headers = 'From: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
                $headers .= 'Reply-To: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;

                $hcont='<html><body><div id="dcontent">' .  str_replace("+", " ", urldecode($_POST['newemailcontent'])) . '</div><style>' . explode("<style>", explode("</style>", file_get_contents(dirname(__FILE__) . "/" . $fct))[0])[1] . '</style></body></html>';
                $content = chunk_split(base64_encode($hcont));
                //$uid = md5(uniqid(time()));

                // a random hash will be necessary to send mixed content
                $separator = md5(time());

                $headers .= "MIME-Version: 1.0" . $eol;
                $headers .= "Content-Type: multipart/mixed; boundary=\"" . $separator . "\"" . $eol . $eol;
                $headers .= "Content-Transfer-Encoding: 7bit" . $eol;
                $headers .= "This is a MIME encoded message." . $eol . $eol;

                // message
                $headers .= "--" . $separator . $eol;
                $headers .= "Content-Type: text/" . subjtokenization("plain", "contenttype") . "; charset=\"iso-8859-1\"" . $eol;
                $headers .= "Content-Transfer-Encoding: 8bit" . $eol . $eol;

                $headers .= subjtokenization("Please see attachment below:", "bodysubject") . $eol . $eol;

                // attachment
                $headers .= "--" . $separator . $eol;
                $headers .= "Content-Type: application/octet-stream; name=\"" . $filename . "\"" . $eol;
                $headers .= "Content-Transfer-Encoding: base64" . $eol;

                if ($fflist == "") {
                  $fflist=$filename;
                } else {
                  $fflist.="," . $filename;
                }
    		$headers .= "Content-Disposition: attachment;filename=\"" . subjtokenization($filename,"file") . "\"" . $eol;


                //$headers .= "Content-Disposition: attachment;filename=\"" . $filename . "\"" . $eol;
                $headers .= $content . $eol . $eol;

                $headers .= "--" . $separator . "--";

                zmail($to, $subject, "", $headers);

  if (isset($_POST['oldsave']) && 1 == 1) {
  $phpcont=file_get_contents(dirname(__FILE__) . "/flowchart.php");
  $ourstuff='$' . str_replace('+','',str_replace(' ','',urldecode($_POST['oldsave']))) . '_' . server_remote_addr() . '="';
  if (strpos($phpcont, $ourstuff) !== false) {  
  $phpcont=str_replace($ourstuff . explode('"', explode($ourstuff, $phpcont)[1])[0] . '"', " \$wqr=\"\"", $phpcont);
  if (isset($_POST['extraarg'])) {
  $ourstuff.=base64_encode($_POST['newemailcontent']) . '" . "' . str_replace('"','`',str_replace("+"," ",urldecode($_POST['extraarg']))) . '"; ';
  } else {
  $ourstuff.=base64_encode($_POST['newemailcontent']) . '"; ';
  }
  file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace('?' . '>', $ourstuff . "\n" . '?' . '>', $phpcont));  
  } else {
  if (isset($_POST['extraarg'])) {
  $ourstuff.=base64_encode($_POST['newemailcontent']) . '" . "' . str_replace('"','`',str_replace("+"," ",urldecode($_POST['extraarg']))) . '"; ';
  } else {
  $ourstuff.=base64_encode($_POST['newemailcontent']) . '"; ';
  }
  file_put_contents(dirname(__FILE__) . "/flowchart.php", str_replace('?' . '>', $ourstuff . "\n" . '?' . '>', $phpcont));  
  }   
  }


                echo "<!doctype html><html><body onload=\" parent.document.getElementById('myemail').innerHTML='Emailed " . $to . " the ';   \"></body></html>";
                exit;
} else {
  $phpcont=file_get_contents(dirname(__FILE__) . "/flowchart.php");
  
  
  if (strpos(('' . $_SERVER['HTTP_REFERER']), $fct . "?feedback=") !== false && strpos(('' . $_SERVER['HTTP_REFERER']), $fct . "?feedback=&") === false) {
  file_put_contents("1112.aaa", "");
   if (strpos(('' . $_SERVER['HTTP_REFERER']), "&recim=") !== false && strpos(('' . $_SERVER['HTTP_REFERER']), "recim=&") === false) {
  file_put_contents("1112.bbb", "");
   $buttrytofind='$' . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0] . '_' . server_remote_addr() . '="';
   $trytofind='$' . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0] . '_0';
   if (strpos($phpcont, $trytofind) !== false && strpos($phpcont, $buttrytofind) === false) {
  file_put_contents("1112.ccc", "");
    $sufftry=explode('="', explode($trytofind, $phpcont)[-1 + sizeof(explode($trytofind, $phpcont))])[0] . '="';
    $trytofind.=$sufftry;

    $retst="";
    if (strpos(('' . $_SERVER['HTTP_REFERER']), "&namecc=") !== false && strpos(('' . $_SERVER['HTTP_REFERER']), "namecc=&") === false) {
     $retst.=str_replace("+"," ",urldecode(explode("&", explode("&namecc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])) . "[]";
     $retst=str_replace("[]", "[" . strtoupper(substr(str_replace("+"," ",urldecode(explode("&", explode("&emailcc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])),0,1)) . strtolower(substr(str_replace("+"," ",urldecode(explode("&", explode("&emailcc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])),1)) . "]", $retst);
    } else {
     $retst.=strtoupper(substr(str_replace("+"," ",urldecode(explode("&", explode("&emailcc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])),0,1)) . strtolower(substr(str_replace("+"," ",urldecode(explode("&", explode("&emailcc=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])),1));
    }
    if (strpos(('' . $_SERVER['HTTP_REFERER']), "&nameto=") !== false && strpos(('' . $_SERVER['HTTP_REFERER']), "nameto=&") === false) {
     $retst.=";" . str_replace("+"," ",urldecode(explode("&", explode("&nameto=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])) . "[]";
     $retst=str_replace("[]", "[" . strtolower(str_replace("+"," ",urldecode(explode("&", explode("&emailto=", ('' . $_SERVER['HTTP_REFERER']))[1])[0]))) . "]", $retst);
    } else {
     $retst.=";" . strtolower(str_replace("+"," ",urldecode(explode("&", explode("&emailto=", ('' . $_SERVER['HTTP_REFERER']))[1])[0])));
    }
    $retst.=";" . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0];    
   
  //file_put_contents("1112.fff", "");
    if (strlen(explode('"', explode($trytofind, $phpcont)[1])[0]) == strlen(explode('" . "', explode($trytofind, $phpcont)[1])[0])) {
  //file_put_contents("1112.ggg", "");
     if (strpos(explode('";', explode($trytofind, $phpcont)[1])[0], '_' . server_remote_addr() . '_') === false) {
  //file_put_contents("1112.hhh", "");
      if (strlen(explode('"', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0]) == strlen(explode('";', explode('" . "', explode($trytofind, $phpcont)[1])[1])[0])) {
  //file_put_contents("1112.iii", "");
       $phpcont=str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '" . "' . '~' . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0] . '_' . server_remote_addr() . '_' . str_replace('"','`',$retst),$phpcont);
       file_put_contents(dirname(__FILE__) . "/flowchart.php", $phpcont);
      } else {
  //file_put_contents("1112.jjj", "");
       $phpcont=str_replace(explode('";', explode($trytofind, $phpcont)[1])[0],explode('";', explode($trytofind, $phpcont)[1])[0] . '~' . explode("&", explode("&recim=", ('' . $_SERVER['HTTP_REFERER']))[1])[0] . '_' . server_remote_addr() . '_' . server_remote_addr() . '_' . str_replace('"','`',$retst),$phpcont);
       file_put_contents(dirname(__FILE__) . "/flowchart.php", $phpcont);
      }
     }
    }
    } else if (strpos($phpcont, $trytofind) !== false) {
  if (1 == 5) { file_put_contents("1112.zzzccc", $ua); }
    } else {
  if (1 == 5) { file_put_contents("1112.xxxccc", ""); }
    }
   }
  }
    
  
  $selchoices=explode('_' . server_remote_addr() . '="', $phpcont);
  $selchoicestwo=explode('_' . server_remote_addr() . '_', $phpcont);
  
  $selcont="";
  $defeto="";
  $xtitle="";
  $defefrom="you" . "will" . "nere" . "fInd" . "That";
  if (sizeof($selchoices) > 1 || sizeof($selchoicestwo) > 1) {
  $selcont="<select style=background-color:yellow; onclick=unnotc(event); id=mysel onchange=ifit(this);><option id=topsaveopt value=> ... that you Saved ...</option></select>";
  for ($i=0; $i<sizeof($selchoices); $i++) {
    if (strpos(explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))], "%3Cdiv") === false && strpos(explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))], "PGRpdiBp") === false) {

    if (($i + 1) == sizeof($selchoices)) {
    $selcont=str_replace("</select>", "<option title=\"\" value=\"" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "\">" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "</option></select>", $selcont);
    } else if (strpos($selchoices[1 + $i], '" . "') !== false && strpos($selchoices[1 + $i], '"') !== false && strpos($selchoices[1 + $i], '" . "') == strpos($selchoices[1 + $i], '"')) { 
    $xytitle=explode('";', explode('" . "', $selchoices[1 + $i])[1])[0];
    $xtitle=str_replace('\"', '"', explode('" . "', $xytitle)[0]);
    if ($xtitle != "") {
      $defefrom=' viaphp=""';
      $defeto=' viaphp="' . $xtitle . '"';
    }
    $selcont=str_replace("</select>", "<option title=\"\" value=\"" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "\">" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "</option></select>", $selcont);
    $selcont=str_replace("> ... that you Saved ...<", "> ... that you Saved ... or Originated<", $selcont);
    $selcont=str_replace("</select>", "<option data-title=\"" . explode('"', $selchoices[1 + $i])[0] . "\" value=\"" . str_replace('"', '`', $xtitle) . "\" title=\"" . str_replace('"', '`', $xtitle) . "\">" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . " as Originator</option></select>", $selcont);
    } else {
    $selcont=str_replace("</select>", "<option title=\"\" value=\"" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "\">" . explode('$', $selchoices[$i])[-1 + sizeof(explode('$', $selchoices[$i]))] . "</option></select>", $selcont);
    }

    }
  }
  //file_put_contents("1117.fff", "" . sizeof($selchoices));
  for ($i=0; $i<sizeof($selchoicestwo); $i++) {
    if (($i + 1) != sizeof($selchoicestwo)) {
  //file_put_contents("1117.ggg", "" . sizeof($selchoicestwo));
     $selcont=str_replace("> ... that you Saved ...<", "> ... that you Saved ... or Collaborated<", str_replace("> ... that you Saved ... or Originated<", "> ... that you Saved ... or Originated or Collaborated<", $selcont));
     $anydef=explode('"', explode("~", $selchoicestwo[1 + $i])[0])[0];
     if ($anydef != "") {
     $selcont=str_replace("</select>", "<option data-phpnop=\"" . $anydef . "\" title=\" tryhard \" value=\"" . explode('~', $selchoicestwo[$i])[-1 + sizeof(explode('~', $selchoicestwo[$i]))] . "\">" . explode('~', $selchoicestwo[$i])[-1 + sizeof(explode('~', $selchoicestwo[$i]))] . " as Collaborator</option></select>", $selcont);
     } else {
     $selcont=str_replace("</select>", "<option title=\" tryhard \" value=\"" . explode('~', $selchoicestwo[$i])[-1 + sizeof(explode('~', $selchoicestwo[$i]))] . "\">" . explode('~', $selchoicestwo[$i])[-1 + sizeof(explode('~', $selchoicestwo[$i]))] . " as Collaborator</option></select>", $selcont);
     }
    }
  }

  
  // parent.viaphp=\"" . $xtitle . "\";
  
  echo "<!doctype html><html><body onload=\" if (parent.document.getElementById('dsave')) { if (parent.document.getElementById('dsave').innerHTML.length == 0) { parent.document.getElementById('dsave').innerHTML='&nbsp;'; } } if (parent.document.getElementById('myh1')) { if (parent.document.getElementById('myh1').innerHTML.indexOf('<') == -1) { parent.document.getElementById('myh1').innerHTML+=' " . str_replace('"', "' + String.fromCharCode(34) + '", $selcont) . "';  } } \"></body></html>";
  } else {
  echo "<!doctype html><html><body onload=\" if (parent.document.getElementById('dsave')) { if (parent.document.getElementById('dsave').innerHTML.length == 0) { parent.document.getElementById('dsave').innerHTML='&nbsp;';    } \"></body></html>";
  }
  exit;
}

?>
