<?php
// quarter_hour_timer.php
// RJM Programming
// December, 2021
set_time_limit(300);

$lportbit=":8888";
$os_platform="win Unknown OS Platform";
$ismobile=false;

$notifmore=' function aaen() { if (parent.document.getElementById("myh1")) {  if (parent.document.getElementById("myh1").innerHTML.indexOf(" - RJM") != -1) { parent.document.getElementById("myh1").innerHTML=parent.document.getElementById("myh1").innerHTML.replace(' . "'" . ' - RJM' . "'" . ',' . "'" . ' <a target=_blank href="//www.rjmprogramming.com.au/HTMLCSS/notifications_ideas.php-----GETME" title="To optionally allow for Notifications to also occur (or update the code, as required), download this latest code version into macOS HTTP://localhost:8888/notifications_ideas.php or Windows HTTP://localhost/notifications_ideas.php (as two MAMP ( at https://mamp.info ) ideas) to start getting additional Notifications.">&#128276;</a> RJM' . "'" . '); } } } setTimeout(aaen,3000); ';
if (file_exists('qhtmnf.txt')) {
  $notifmore=file_get_contents('qhtmnf.txt');
  unlink('qhtmnf.txt');
}
$dbis="x"; //date("Ymd-Hi"); 
$dbisc="xx"; //date("H:i d/m/Y"); 
//foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "screen-*.jpg") as $jfilename) { 
//      if ($xdbis == "") {
//        $xdbis=explode(".jp", explode("screen-", $jfilename)[1])[0];
//        if (strlen($xdbis) == 13) { $dbis=$xdbis; $dbisc=str_replace('-',':',$dbis);  }
//        $xdbis="";
//      } 
//}

//if (!file_exists('xxx.xxx')) { file_put_contents('xxx.xxx', getOS()); }

$user_agent = $_SERVER["HTTP_USER_AGENT"];
//if (!file_exists('xxxxxx.xxxxxx')) { file_put_contents('xxxxxx.xxxxxx', $user_agent); }
function getOS() { // thanks to https://www.daniweb.com/programming/web-development/threads/495588/getting-users-os-info-out-of-server-http-user-agent
    global $user_agent, $lportbit, $os_platform, $ismobile, $notifmore, $dbis, $dbisc;
    $os_platform    =   "win Unknown OS Platform";
    $os_array       =   array(
                            '/windows nt 10/i'     =>  'Windows 10',
                            '/windows nt 6.3/i'     =>  'Windows 8.1',
                            '/windows nt 6.2/i'     =>  'Windows 8',
                            '/windows nt 6.1/i'     =>  'Windows 7',
                            '/windows nt 6.0/i'     =>  'Windows Vista',
                            '/windows nt 5.2/i'     =>  'Windows Server 2003/XP x64',
                            '/windows nt 5.1/i'     =>  'Windows XP',
                            '/windows xp/i'         =>  'Windows XP',
                            '/windows nt 5.0/i'     =>  'Windows 2000',
                            '/windows me/i'         =>  'Windows ME',
                            '/win98/i'              =>  'Windows 98',
                            '/win95/i'              =>  'Windows 95',
                            '/win16/i'              =>  'Windows 3.11',
                            '/macintosh|mac os x/i' =>  'Mac OS X',
                            '/mac_powerpc/i'        =>  'Mac OS 9',
                            '/linux/i'              =>  'Linux',
                            '/ubuntu/i'             =>  'Ubuntu',
                            '/iphone/i'             =>  'iPhone',
                            '/ipod/i'               =>  'iPod',
                            '/ipad/i'               =>  'iPad',
                            '/android/i'            =>  'Android',
                            '/blackberry/i'         =>  'BlackBerry',
                            '/webos/i'              =>  'Mobile'
                        );

    foreach ($os_array as $regex => $value) {

        if (preg_match($regex, $user_agent)) {
            $os_platform    =   $value;
            if (str_replace('Mo','iP',str_replace('Bl','iP',str_replace('An','iP',substr($os_platform,0,2)))) == 'iP') {
              $ismobile=true;
            } 
        }

    }
    
    if (strpos($user_agent, "iPhone;") !== false) {  $os_platform='iPhone'; $ismobile=true; }

    return $os_platform;
}

$callornot="call ";
$precmds="";
$impreexe="screenCapture"; //"import";
$switches=""; //" -window root ";
if (substr(strtoupper(getOS()),0,3) === 'WIN') {
  $lportbit="";
  if (file_exists($_SERVER['DOCUMENT_ROOT'] . "\\" . $impreexe . ".exe")) {
  $precmds=$_SERVER['DOCUMENT_ROOT'] . "\\";
  } else {
  foreach (glob("C:\\Users\\*\\" . $impreexe . ".exe") as $infl) {
  $precmds=explode($impreexe . ".exe", $infl)[0];
  }
  }
} 
 

// iptc_make_tag() function by Thies C. Arntzen
function iptc_make_tag($rec, $data, $value) {
    global $notifmore, $dbis, $dbisc;
    $length = strlen($value);
    $retval = chr(0x1C) . chr($rec) . chr($data);

    if($length < 0x8000)
    {
        $retval .= chr($length >> 8) .  chr($length & 0xFF);
    }
    else
    {
        $retval .= chr(0x80) . 
                   chr(0x04) . 
                   chr(($length >> 24) & 0xFF) . 
                   chr(($length >> 16) & 0xFF) . 
                   chr(($length >> 8) & 0xFF) . 
                   chr($length & 0xFF);
    }

    return $retval . $value;
}

if (isset($_GET['yourta'])) {
 $dru="http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/";
 $cet="";
 if (strlen($_GET['yourta']) != 0) { $cet=" contenteditable=true onblur=repostit(this); onfocus=wopen(event,false); "; }
 $prepath=$_SERVER['DOCUMENT_ROOT'];
 if (strpos($dru, "rjmprogramming.com.au") !== false) {
   $prepath="HTTP://localhost" . $lportbit;
   $dru="HTTP://localhost" . $lportbit . "/";
 }
 $contis=str_replace('+',' ',urldecode($_GET['yourta']));
 //file_put_contents('xx.xx', $contis);
 $htmlis='';
 $myf='';
 $backi='';
 $cali='';
 $taback='';
 $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'";
 if (substr(($bcontis . '   '),0,3) == "' + ") {  $bcontis=$bcontis.substr(3); }
 if (substr(('   ' . $bcontis),-3,3) == " + '") {  $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }
 $psofar=";";
 foreach ($_GET as $name=>$val) {
   if ($name != 'yourta') { // && $val == '') {
   //echo $name;
     $orig=$name;
     $myf=$name;
     for ($imh=12; $imh>=1; $imh--) {
     for ($idd=31; $idd>=1; $idd--) {
     //file_put_contents('xz.xz',$orig . ' Is ' . substr('00' . $imh,-2,2) . substr('00' . $idd,-2,2) . ' less than ' . $val);
     if ((substr('00' . $imh,-2,2) . substr('00' . $idd,-2,2)) <= $val) {
     for ($ihh=0; $ihh<=23; $ihh++) {
     for ($imm=0; $imm<=45; $imm+=15) {
     //if ($ihh != 0 || $imm != 0) {
       $myf=str_replace("0101_", substr('00' . $imh,-2,2) . substr('00' . $idd,-2,2) . "_",$orig); 
       $myf=str_replace("_0000", "_" . substr('00' . $ihh,-2,2) . substr('00' . $imm,-2,2),$myf); 
     //}
     $taback=str_replace('-','_',str_replace('itd','tatd',$myf));
     $backi=str_replace('-','_',str_replace('screen-','itd_',$myf));
     $cali=str_replace('-','',str_replace('screen-','td',$myf));
     $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0];

// Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html

// Path to jpeg file
$path = $prepath . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg';
//file_put_contents('x.x',$path);
if (file_exists($path) || strpos(strtoupper($prepath),"HTTP") !== false) {

    if (file_exists($path) && 1 == 11) {
      if (file_exists("../notifications_ideas.php")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("../notifications_ideas.html")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.php")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.html")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } 
    }

$capt = "" . str_replace('+',' ',urldecode($_GET['yourta']));  // Thanks to https://www.php.net/manual/en/function.iptcparse.php
$size = getimagesize( $path, $info );
if ($size) {
if (isset($info["APP13"])) {
//file_put_contents('xx.xx',$path);
    if ($iptc = iptcparse( $info["APP13"] ) ) {
//file_put_contents('xxx.xxx',$path);
        $capt = str_replace( "\000", "", $iptc["2#120"][0] );
//file_put_contents('xxxx.xxxx',$capt);
    }
}
//file_put_contents('xxz.xxz',file_get_contents('xxz.xxz') . "\n" . $path . " " . $capt);
 $bcontis="" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "";
 $ccpre="<p" . $cet . " onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-repeat:no-repeat;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); onmouseover=wopen(event,true); onmouseout=wopen(event,false);  title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">";
 $ccpost="</p>";
 $ccontis="<br><p style='background-color:orange; title='" . str_replace('td','p',$cali) . "' id=" . str_replace('td','p',$cali) . ">" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "<br>", str_replace("\r\n", "<br>", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "</p>";
//file_put_contents('xxxxx.xxxxx',$bcontis);
//file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi);
//file_put_contents('xxxxxxx.xxxxxxx',"parent.document.getElementById('" . $backi . "').title='" . $bcontis . "';  parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; ");

  // }
   
 if ($bcontis != "''" && $bcontis != "") { 
   if ($htmlis == '') {
    $psofar.=str_replace('td','p',$cali) . ';';
    $htmlis="<html><head><script type=text/javascript> var imois=null, iwo=null; 
     function repostit(ih) {
     var ihis=(ih.innerText || ih.contentWindow || ih.contentDocument);
     var pathpart=ih.id;
     if (ihis != '') {
   var xzhr = new XMLHttpRequest();
   var xform=new FormData();
   xform.append('myta',ihis);
   xform.append(pathpart.split('.')[0].replace('ip_','screen-').replace('_','-'),'');
   xzhr.open('post','./quarter_hour_timer.php',true);
   xzhr.send(xform);
     }
     }
     function wopen(event,overvsout) { if (!overvsout) { if (imois == event.target) { imois=null; } return;  } imois=event.target; setTimeout(postwopen, 2000); } function postwopen() { var pois=imois; if (pois.outerHTML.indexOf('URL(') != -1) { window.open(pois.outerHTML.split('URL(')[1].split(')')[0].replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),''),'_blank','top=50,left=50,width=600,height=600');    }  } function onl() {   var huhg='';  if (parent.document.getElementById('" . $idcali . "')) { huhg='" . $ccpre . $bcontis . $ccpost . "';  while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>');  } if (parent.document.getElementById('" . $idcali . "').innerHTML.indexOf('" . str_replace('td','p',$cali) . "') != -1) { huhg=''; }  parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; }     } " . $notifmore . "  </script></head><body onload=\"onl();\"><iframe name=pophide id=pophide style=display:none; src=//www.rjmprogramming.com.au/About_Us.html></iframe></body></html>"; 
   } else if (strpos($htmlis, $myf) === false && strpos($psofar, (';' . str_replace('td','p',$cali) . ';')) === false) {
    $psofar.=str_replace('td','p',$cali) . ';';
// if (strpos($myf, "20211205") !== false) {
//file_put_contents('xxz.xxz',file_get_contents('xxz.xxz') . "\nhuhg='" . $ccpre . $bcontis . $ccpost . "';  while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>');  } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; \n" . $htmlis);
// }
    $htmlis=str_replace("+=huhg; }", "+=huhg; \n huhg='" . $ccpre . $bcontis . $ccpost . "';  while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>');  }  if (parent.document.getElementById('" . $idcali . "').innerHTML.indexOf('" . str_replace('td','p',$cali) . "') != -1) { huhg=''; } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; }", $htmlis);
//   } else {
// if (strpos($myf, "20211205") !== false) {
//file_put_contents('xxz.xxz',file_get_contents('xxz.xxz') . "\nHuhg='" . $ccpre . $bcontis . $ccpost . "';  while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>');  } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; ");
// }
   }
 }

   }
   }
    
 }
 }
 
 if ($htmlis != "") { echo $htmlis;  }
  
 }
 }
 }
 }
 }
 } else if (isset($_GET['myta'])) {
 $dru="http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/";
 $contis=str_replace('+',' ',urldecode($_GET['myta']));
 //file_put_contents('xx.xx', $contis);
 $myf='';
 $backi='';
 $cali='';
 $taback='';
 $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'";
 if (substr(($bcontis . '   '),0,3) == "' + ") {  $bcontis=$bcontis.substr(3); }
 if (substr(('   ' . $bcontis),-3,3) == " + '") {  $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }
 foreach ($_GET as $name=>$val) {
   if ($name != 'myta' && $val == '') {
   //echo $name;
     $myf=$name;
     $taback=str_replace('-','_',str_replace('itd','tatd',$myf));
     $backi=str_replace('-','_',str_replace('screen-','itd_',$myf));
     $cali=str_replace('-','',str_replace('screen-','td',$myf));
     $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0];

// Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html

// Path to jpeg file
$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg';
//file_put_contents('x.x',$path);


    if (file_exists($path) && 1 == 11) {
      if (file_exists("../notifications_ideas.php")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("../notifications_ideas.html")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.php")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.html")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } 
    }



$capt = "";  // Thanks to https://www.php.net/manual/en/function.iptcparse.php
$size = getimagesize( $path, $info );
if (isset($info["APP13"])) {
//file_put_contents('xx.xx',$path);
    if ($iptc = iptcparse( $info["APP13"] ) ) {
//file_put_contents('xxx.xxx',$path);
        $capt = str_replace( "\000", "", $iptc["2#120"][0] );
//file_put_contents('xxxx.xxxx',$capt);
    }
}
 $bcontis="" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "";
 $ccpre="<p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-repeat:no-repeat;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); onmouseover=wopen(event,true); onmouseout=wopen(event,false);  title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">";
 $ccpost="</p>";
 $ccontis="<br><p style='background-color:orange; title='" . str_replace('td','p',$cali) . "' id=" . str_replace('td','p',$cali) . ">" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "<br>", str_replace("\r\n", "<br>", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "</p>";
//file_put_contents('xxxxx.xxxxx',$bcontis);
//file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi);
//file_put_contents('xxxxxxx.xxxxxxx',"parent.document.getElementById('" . $backi . "').title='" . $bcontis . "';  parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; ");

   }
 if ($bcontis != "''") { echo "<html><head><script type=text/javascript> var iwo=null, imois=null; function wopen(event,overvsout) { imois=event.target; setTimeout(postwopen, 2000); } function postwopen() { var pois=imois; if (pois.outerHTML.indexOf('URL(') != -1) { if (iwo) { iwo.close(); iwo=null; } iwo=window.open(pois.outerHTML.split('URL(')[1].split(')')[0].replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),''),'_blank','top=50,left=50,width=600,height=600');    }  } " . $notifmore . "  </script></head><body onload=\" parent.document.getElementById('" . $backi . "').title='" . $bcontis . "';  parent.document.getElementById('" . $taback . "').value='" . $bcontis . "';   if (parent.document.getElementById('" . $idcali . "')) { var huhg='" . $ccpre . "' + parent.document.getElementById('" . $taback . "').value + '" . $ccpost . "';  while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>');  } if (parent.document.getElementById('" . $idcali . "').innerHTML.indexOf('" . str_replace('td','p',$cali) . "')== -1) { parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } }  \"><iframe name=pophide id=pophide style=display:none; src=//www.rjmprogramming.com.au/About_Us.html></iframe></body></html>"; } 
 }
 } else if (isset($_POST['myta'])) {
 $dru="http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/";
 $contis=str_replace('+',' ',urldecode($_POST['myta']));
 //file_put_contents('xx.xx', $contis);
 $myf='';
 $backi='';
 $cali='';
 $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'";
 
 $ccpre="<p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-repeat:no-repeat;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . ".jpg" . "); onmouseover=wopen(event,true); onmouseout=wopen(event,false);  title=" . substr(str_replace('td','p',$cali),-4,2) . ":" . substr(str_replace('td','p',$cali),-2,2) . "++ id=" . str_replace('td','p',$cali) . ">";
 $ccpost="</p>";
 $ccontis="<br><p style='background-color:orange; title='" . str_replace('td','p',$cali) . "' id=" . str_replace('td','p',$cali) . ">" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "<br>", str_replace("\r\n", "<br>", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "</p>";

 
 if (substr(($bcontis . '   '),0,3) == "' + ") {  $bcontis=$bcontis.substr(3); }
 if (substr(('   ' . $bcontis),-3,3) == " + '") {  $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }
 foreach ($_POST as $name=>$val) {
   if ($name != 'myta') {
     $myf=$name;
     $backi=str_replace('-','_',str_replace('screen-','itd_',$myf));
     $taback=str_replace('tatd','tatd_',substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),0,12)) . '_' . substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),-4,4);
     $pback=str_replace('tatd','ip',$taback);
     $cali=str_replace('-','',str_replace('screen-','td',$myf));
     $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0];

// Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html

// Path to jpeg file
$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $myf . '.jpg';

//file_put_contents('x.x', $path);

// Set the IPTC tags
$iptc = array(
    '2#120' => $contis,
    '2#116' => 'Copyright 2021, RJM Programming'
);

// Convert the IPTC tags into binary code
$data = '';

foreach($iptc as $tag => $string) {
    $tag = substr($tag, 2);
    $data .= iptc_make_tag(2, $tag, $string);
}

// Embed the IPTC data
$content = iptcembed($data, $path);

// Write the new image data out to the file.
$fp = fopen($path, "wb");
fwrite($fp, $content);
fclose($fp);

    if (file_exists($path) && 1 == 11) {
      if (file_exists("../notifications_ideas.php")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . $myf . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("../notifications_ideas.html")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . $myf . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.php")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . $myf . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.html")) {
        $notifmore=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/' . $myf . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } 
    }

   }


 echo "<html><head><script type=text/javascript> var iwo=null, imois=null; function wopen(event,overvsout) { imois=event.target; setTimeout(postwopen, 2000); } function postwopen() { var pois=imois; if (pois.outerHTML.indexOf('URL(') != -1) {  if (iwo) { iwo.close(); iwo=null; } iwo=window.open(pois.outerHTML.split('URL(')[1].split(')')[0].replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),''),'_blank','top=50,left=50,width=600,height=600');    }  }  " . $notifmore . " </script></head><body onload=\" parent.document.getElementById('" . $backi . "').title=" . $bcontis . ";   if (parent.document.getElementById('" . $idcali . "')) { var huhg='" . $ccpre . "' + parent.document.getElementById('" . $taback . "').value + '" . $ccpost . "';  if (parent.document.getElementById('" . $pback . "')) { huhg=parent.document.getElementById('" . $taback . "').value; }  while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'<br>');  }    if (parent.document.getElementById('" . $pback . "')) {  parent.document.getElementById('" . $pback . "').innerHTML=huhg; } else { if (parent.document.getElementById('" . $idcali . "').innerHTML.indexOf('" . str_replace('td','p',$cali) . "') == -1) { parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } }  } " . $notifmore . " \"><iframe name=pophide id=pophide style=display:none; src=//www.rjmprogramming.com.au/About_Us.html></iframe></body></html>";
 }
 } else if ($lportbit != "" || $ismobile) {
 if (!$ismobile) { 
    $xdbis="";
    $dbis=date("Ymd-Hi"); 
    $dbisc=date("H:i d/m/Y"); 
    exec("/usr/sbin/screencapture -Cd -tjpg " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "screen-`date +\"%Y%m%d-%H%M\"`.jpg");
    foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "screen-*.jpg") as $jfilename) { 
      if ($xdbis == "") {
        $xdbis=explode(".jp", explode("screen-", $jfilename)[1])[0];
        if (strlen($xdbis) == 13) { $dbis=$xdbis; $dbisc=str_replace('-',':',$dbis);  }
        $xdbis="";
      } 
    }
    
    $huhgf="";
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "screen-" . $dbis . ".jpg")) {
      if (file_exists("../notifications_ideas.php")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("../notifications_ideas.html")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.php")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.html")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); } setTimeout(aen,2000); ');
      } 
    }
    if ($huhgf != "") { //file_exists('qhtmnf.txt')) {
      //$huhgf=file_get_contents('qhtmnf.txt');
      //unlink('qhtmnf.txt');
      echo "<html><head><script type='text/javascript'> " . $huhgf . " </script></head><body><iframe id=pophide name=pophide style=display:none; src=//www.rjmprogramming.com.au/About_Us.html></iframe></body></html>";
    }
 }
 } else {
 if (isset($_GET['tz'])) {
   $tzis=str_replace('+','_',urldecode($_GET['tz']));
   if (strpos($tzis, "/") !== false) { date_default_timezone_set($tzis);   }
 }
 $dateis = date('Ymd-Hi');
 if (file_exists($_SERVER['DOCUMENT_ROOT'] . "\\screenCapture.jpg")) {
    $xdbis="";
    $dbis=date("Ymd-Hi"); 
    $dbisc=date("H:i d/m/Y"); 
 exec('copy ' . '"' . $_SERVER['DOCUMENT_ROOT'] . "\\screenCapture.jpg" . '" "' . $_SERVER['DOCUMENT_ROOT'] . "\\screen-" . $dateis . '.jpg"');
 // exec('erase ' . '"' . $_SERVER['DOCUMENT_ROOT'] . "\\screenCapture.jpg" . '"');
    foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "screen-*.jpg") as $jfilename) { 
      if ($xdbis == "") {
        $xdbis=explode(".jp", explode("screen-", $jfilename)[1])[0];
        if (strlen($xdbis) == 13) { $dbis=$xdbis; $dbisc=str_replace('-',':',$dbis);  }
        $xdbis="";
      } 
    }

    $huhgf="";
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "screen-" . $dateis . ".jpg")) {
      if (file_exists("../notifications_ideas.php")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500"); if (parent.document.getElementById("myh1")) {  if (parent.document.getElementById("myh1").innerHTML.indexOf(" - RJM") != -1) { parent.document.getElementById("myh1").innerHTML=parent.document.getElementById("myh1").innerHTML.replace(' . "'" . ' - RJM' . "'" . ',' . "'" . '<a target=_blank href="//www.rjmprogramming.com.au/HTMLCSS/notifications_ideas.php-----GETME" title="Download this into macOS HTTP://localhost:8888/notifications_ideas.php or Windows HTTP://localhost/notifications_ideas.php (as two MAMP ( at https://mamp.info ) ideas) to start getting Notification Scheduling advice.">-</a> RJM' . "'" . '); } } } setTimeout(aen,2000); ');
      } else if (file_exists("../notifications_ideas.html")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500");  if (parent.document.getElementById("myh1")) {  if (parent.document.getElementById("myh1").innerHTML.indexOf(" - RJM") != -1) { parent.document.getElementById("myh1").innerHTML=parent.document.getElementById("myh1").innerHTML.replace(' . "'" . ' - RJM' . "'" . ',' . "'" . '<a target=_blank href="//www.rjmprogramming.com.au/HTMLCSS/notifications_ideas.php-----GETME" title="Download this into macOS HTTP://localhost:8888/notifications_ideas.php or Windows HTTP://localhost/notifications_ideas.php (as two MAMP ( at https://mamp.info ) ideas) to start getting Notification Scheduling advice.">-</a> RJM' . "'" . '); } } } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.php")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500");  if (parent.document.getElementById("myh1")) {  if (parent.document.getElementById("myh1").innerHTML.indexOf(" - RJM") != -1) { parent.document.getElementById("myh1").innerHTML=parent.document.getElementById("myh1").innerHTML.replace(' . "'" . ' - RJM' . "'" . ',' . "'" . '<a target=_blank href="//www.rjmprogramming.com.au/HTMLCSS/notifications_ideas.php-----GETME" title="Download this into macOS HTTP://localhost:8888/notifications_ideas.php or Windows HTTP://localhost/notifications_ideas.php (as two MAMP ( at https://mamp.info ) ideas) to start getting Notification Scheduling advice.">-</a> RJM' . "'" . '); } } } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.html")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500");  if (parent.document.getElementById("myh1")) {  if (parent.document.getElementById("myh1").innerHTML.indexOf(" - RJM") != -1) { parent.document.getElementById("myh1").innerHTML=parent.document.getElementById("myh1").innerHTML.replace(' . "'" . ' - RJM' . "'" . ',' . "'" . '<a target=_blank href="//www.rjmprogramming.com.au/HTMLCSS/notifications_ideas.php-----GETME" title="Download this into macOS HTTP://localhost:8888/notifications_ideas.php or Windows HTTP://localhost/notifications_ideas.php (as two MAMP ( at https://mamp.info ) ideas) to start getting Notification Scheduling advice.">-</a> RJM' . "'" . '); } } } setTimeout(aen,2000); ');
      } 
    }
    if ($huhgf != "") { //file_exists('qhtmnf.txt')) {
      //$huhgf=file_get_contents('qhtmnf.txt');
      //unlink('qhtmnf.txt');
      echo "<html><head><script type='text/javascript'> " . $huhgf . " </script></head><body><iframe id=pophide name=pophide style=display:none; src=//www.rjmprogramming.com.au/About_Us.html></iframe></body></html>";
    }

} else {
    $xdbis="";
    $dbis=date("Ymd-Hi"); 
    $dbisc=date("H:i d/m/Y"); 
 exec($callornot . '"' . $precmds . $impreexe . '.exe" ' . $switches . ' "' . $_SERVER['DOCUMENT_ROOT'] . "\\screen-" . $dateis . '.jpg"');
    foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "screen-*.jpg") as $jfilename) { 
      if ($xdbis == "") {
        $xdbis=explode(".jp", explode("screen-", $jfilename)[1])[0];
        if (strlen($xdbis) == 13) { $dbis=$xdbis; $dbisc=str_replace('-',':',$dbis);  }
        $xdbis="";
      } 
    }

    $huhgf="";
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "screen-" . $dateis . ".jpg")) {
      if (file_exists("../notifications_ideas.php")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500");  if (parent.document.getElementById("myh1")) {  if (parent.document.getElementById("myh1").innerHTML.indexOf(" - RJM") != -1) { parent.document.getElementById("myh1").innerHTML=parent.document.getElementById("myh1").innerHTML.replace(' . "'" . ' - RJM' . "'" . ',' . "'" . '<a target=_blank href="//www.rjmprogramming.com.au/HTMLCSS/notifications_ideas.php-----GETME" title="Download this into macOS HTTP://localhost:8888/notifications_ideas.php or Windows HTTP://localhost/notifications_ideas.php (as two MAMP ( at https://mamp.info ) ideas) to start getting Notification Scheduling advice.">-</a> RJM' . "'" . '); } } } setTimeout(aen,2000); ');
      } else if (file_exists("../notifications_ideas.html")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500");  if (parent.document.getElementById("myh1")) {  if (parent.document.getElementById("myh1").innerHTML.indexOf(" - RJM") != -1) { parent.document.getElementById("myh1").innerHTML=parent.document.getElementById("myh1").innerHTML.replace(' . "'" . ' - RJM' . "'" . ',' . "'" . '<a target=_blank href="//www.rjmprogramming.com.au/HTMLCSS/notifications_ideas.php-----GETME" title="Download this into macOS HTTP://localhost:8888/notifications_ideas.php or Windows HTTP://localhost/notifications_ideas.php (as two MAMP ( at https://mamp.info ) ideas) to start getting Notification Scheduling advice.">-</a> RJM' . "'" . '); } } } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.php")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.php?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500");  if (parent.document.getElementById("myh1")) {  if (parent.document.getElementById("myh1").innerHTML.indexOf(" - RJM") != -1) { parent.document.getElementById("myh1").innerHTML=parent.document.getElementById("myh1").innerHTML.replace(' . "'" . ' - RJM' . "'" . ',' . "'" . '<a target=_blank href="//www.rjmprogramming.com.au/HTMLCSS/notifications_ideas.php-----GETME" title="Download this into macOS HTTP://localhost:8888/notifications_ideas.php or Windows HTTP://localhost/notifications_ideas.php (as two MAMP ( at https://mamp.info ) ideas) to start getting Notification Scheduling advice.">-</a> RJM' . "'" . '); } } } setTimeout(aen,2000); ');
      } else if (file_exists("./notifications_ideas.html")) {
         $huhgf=(' function aen() { window.open("HTTP://localhost' . $lportbit . '/HTMLCSS/notifications_ideas.html?scheduledblurb=' . urlencode($dbisc . ' activities snapshot ...') . '&image=' . urlencode('HTTP://localhost' . $lportbit . '/screen-' . $dbis . '.jpg') . '","pophide","top=50,left=50,width=500,height=500");  if (parent.document.getElementById("myh1")) {  if (parent.document.getElementById("myh1").innerHTML.indexOf(" - RJM") != -1) { parent.document.getElementById("myh1").innerHTML=parent.document.getElementById("myh1").innerHTML.replace(' . "'" . ' - RJM' . "'" . ',' . "'" . '<a target=_blank href="//www.rjmprogramming.com.au/HTMLCSS/notifications_ideas.php-----GETME" title="Download this into macOS HTTP://localhost:8888/notifications_ideas.php or Windows HTTP://localhost/notifications_ideas.php (as two MAMP ( at https://mamp.info ) ideas) to start getting Notification Scheduling advice.">-</a> RJM' . "'" . '); } } } setTimeout(aen,2000); ');
      } 
    }
    if ($huhgf != "") { //file_exists('qhtmnf.txt')) {
      //$huhgf=file_get_contents('qhtmnf.txt');
      //unlink('qhtmnf.txt');
      echo "<html><head><script type='text/javascript'> " . $huhgf . " </script></head><body><iframe id=pophide name=pophide style=display:none; src=//www.rjmprogramming.com.au/About_Us.html></iframe></body></html>";
    }

} 
 }
 exit;
?>
