<?php
// feed_via_date.php
// RJM Programming
// October, 2018
// Plug dates into feed URLs that ask for that
function ourfile_get_contents($ul) {
$retv="";
$retv=file_get_contents($ul);
if ($retv == "") {
if (file_exists("./fgc.pyout")) {
unlink("./fgc.pyout");
}
exec("" . '/' . "usr" . '/' . "local" . '/' . "bin" . '/' . "python3.3 .." . '/' . "Python" . '/' . 'file_get_contents.py "' . $ul . '" > fgc.pyout');
if (file_exists("./fgc.pyout")) {
$retv=file_get_contents("./fgc.pyout");
unlink("./fgc.pyout");
}
}
return $retv;
}
function mailit($ht, $ou) {
global $to, $two, $four, $xrest;
$outwo="";
$purl=$ou . $xrest;
if ($four != "" && $two != "") {
$purl=str_replace($two, "YYYY-mm-dd", $purl);
if (substr($four,0,1) >= "0" && substr($four,0,1) <= "9") { $purl=str_replace($four, "YYYY-mm-dd", $purl); }
$subject="Report regarding date " . $two . " and " . $four . " at " . date("l jS \of F Y h:i:s A") . " with " . $ou;
$filname="feed_" . str_replace(" ","_",str_replace(":","-",str_replace(":","-",$two))) . "-to-" . str_replace(" ","_",str_replace(":","-",str_replace(":","-",$four))) . "_via_date.html";
} else if ($two != "") {
$purl=str_replace($two, "YYYY-mm-dd", $purl);
$subject="Report regarding date " . $two . " at " . date("l jS \of F Y h:i:s A") . " with " . $ou;
$filname="feed_" . str_replace(" ","_",str_replace(":","-",str_replace(":","-",$two))) . "_via_date.html";
} else {
$subject="Report at " . date("l jS \of F Y h:i:s A") . " with " . $ou;
$filname="feed_" . date("Y-m-d") . "_via_date.html";
}
$outwo=" or to do another date of your own click " . "https://www.rjmprogramming.com.au/PHP/feed_via_date.php?justfillin=y&urlfeed=" . urlencode($purl);
$eol = PHP_EOL;
$headers = 'From: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
$headers .= 'Reply-To: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
$content = chunk_split(base64_encode( str_replace(" action='//"," action='https://",$ht) ));
//$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/plain; charset=\"iso-8859-1\"" . $eol;
$headers .= "Content-Transfer-Encoding: 8bit" . $eol . $eol;
$headers .= "Please see attachment below, which is the same as just clicking the " . $ou . $outwo . " link:" . $eol . $eol;
//ourpremail($tem, $mysubject, "", $headers . "--" . $separator . "--");
// attachment
$headers .= "--" . $separator . $eol;
$headers .= "Content-Type: application/octet-stream; name=\"" . $filname . "\"" . $eol;
$headers .= "Content-Transfer-Encoding: base64" . $eol;
$headers .= "Content-Disposition: attachment;filename=\"" . $filname . "\"" . $eol;
$headers .= $content . $eol . $eol;
$headers .= "--" . $separator . "--";
mail($to, $subject, "", $headers);
}
function relative_to_absolute($inth) {
global $urlis;
$ub="HTTP://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0];
if ($urlis != "") {
$ubf=explode("?", $urlis);
$ubff=explode("/", $ubf[0]);
if (strpos($ubff[sizeof($ubff) - 1], ".") !== false && (sizeof($ubff) - 1) > 2) {
$ub=str_replace("/" . $ubff[sizeof($ubff) - 1], "/", $ubf[0]);
} else {
$ub=str_replace("@$@", "", str_replace("/@$@", "/", ($ubf[0] . "@$@")));
}
$urlis="";
}
$ubf=explode("?", $ub);
$udirname=str_replace("/feed" . "_via_date.php", "/", $ubf[0]);
//$low = strtolower($inth);
$inth=str_replace(' href="javascript:"', ' hReF="javascript:"', $inth);
$inth=str_replace(' href="mailto:"', ' hReF="mailto:"', $inth);
$outth = $inth;
$ideas = array(" data-ng-include=\"'", " action='", ' action="', " Action='", ' Action="', " ACTION='", ' ACTION="', " action=", " Action=", " ACTION=", " href='", ' href="', " Href='", ' Href="', " HREF='", ' HREF="', " href=", " Href=", " HREF=", " src='", ' src="', " Src='", ' Src="', " SRC='", ' SRC="', " src=", " Src=", " SRC=");
if ($udirname != "") {
for ($m=0; $m<sizeof($ideas); $m++) {
$huhs = explode($ideas[$m], $inth);
if (sizeof($huhs) > 1) {
for ($ii=(sizeof($huhs) - 1); $ii>=1; $ii--) {
if (strtolower(str_replace("file", "http", strtolower(substr($huhs[$ii], 0, 4)))) == "http") {
$outth = $outth;
} else if (substr($huhs[$ii], 0, 1) != "/" && substr($huhs[$ii], 0, 1) != "'" && substr($huhs[$ii], 0, 1) != '"') {
$outth = str_replace($huhs[$ii], $udirname . $huhs[$ii], $outth);
} else if (substr($huhs[$ii], 1, 1) != "/" && substr($huhs[$ii], 0, 1) != "'" && substr($huhs[$ii], 0, 1) != '"') {
$outth = str_replace($huhs[$ii], substr($udirname, 0, (strlen($udirname) - 1)) . $huhs[$ii], $outth);
}
}
}
}
}
return $outth;
}
$straight='brfr';
if (isset($_GET['justemail']) || isset($_POST['justemail'])) {
$straight='justemail';
} else if (isset($_GET['straight']) || isset($_POST['straight'])) {
$straight='straight';
}
$detprefix='<details id=mydetails style=display:none; open=><summary></summary>';
$detsuffix='</details>';
$arr_browsers = ["MSIE", "Edge"]; // thanks to https://artisansweb.net/detect-browser-php-javascript/
$agent = $_SERVER['HTTP_USER_AGENT'];
foreach ($arr_browsers as $browser) {
if (strpos($agent, $browser) !== false) {
$detprefix='';
$detsuffix='';
break;
}
}
$ufrom="YYYY-mm-dd";
$uto="YYYY-mm-dd";
$clk="document.getElementById(straight).click();";
if (isset($_GET['justfillin']) || isset($_POST['justfillin'])) {
if (!isset($_GET['anddo']) && !isset($_POST['anddo'])) {
$clk="";
}
$uto=date('Y-m-d');
}
$urlis="";
$to="";
$scriptis="<scr" . "ipt type='text/javascript'>\n
var straight='" . $straight . "', secoffset=0, lssl=0, lastdatestr='', xdate=null, gdate=null, ti='', tis='_self', mif='myiframe', every_thousand=0, siv=null, lastfih='', tp='andmore', nexttp='moreand', addhowmany='0', triggernowstr='', cdate=null, mdate=null, cdatestr='', mdatestr='', datestr='';
function xdcomp(xvsd) {
var ix, iy, spare='', qdate=null, qqdate=null, fd=['firstdate'];
if ((document.getElementById('seconddate').value + ' ').substring(0,1) >= '0' && (document.getElementById('seconddate').value + ' ').substring(0,1) <= '9' && document.getElementById('seconddate').value.indexOf('-') != -1) {
fd.push('seconddate');
}
for (ix=0; ix<fd.length; ix++) {
qdate=new Date(document.getElementById(fd[ix]).value);
qqdate=new Date(qdateis.getTime() + eval(('' + xvsd) * 1000));
iy=document.getElementById(fd[ix]).value.length;
document.getElementById(fd[ix]).value=(qqdate.getFullYear() + '-' + ('0' + qqdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + qqdate.getMonth())).slice(-2) + ':' + ('0' + qqdate.getHours()).slice(-2) + ':' + ('0' + qqdate.getMinutes()).slice(-2) + ':' + ('0' + qqdate.getSeconds()).slice(-2)).substring(0,iy);
}
pieceurl();
}
function dcomp(vsd) {
var ix, iy, spare='', qdate=null, qqdate=null, fd=['firstdate'];
if (vsd != lastdatestr && lastdatestr != '') {
if (lssl != 0) {
if (vsd.substring(0,lssl) != lastdatestr.substring(0,lssl)) {
if ((document.getElementById('seconddate').value + ' ').substring(0,1) >= '0' && (document.getElementById('seconddate').value + ' ').substring(0,1) <= '9' && document.getElementById('seconddate').value.indexOf('-') != -1) {
fd.push('seconddate');
}
if (secoffset == 0) {
for (ix=0; ix<fd.length; ix++) {
if (document.getElementById(fd[ix]).value.length == lssl) {
document.getElementById(fd[ix]).value=vsd.substring(0,lssl);
} else if (document.getElementById(fd[ix]).value.length > lssl) {
spare=vsd.substring(0,lssl) + document.getElementById(fd[ix]).value.substring(lssl);
document.getElementById(fd[ix]).value=spare;
} else {
document.getElementById('spacer').value=document.getElementById('spacer').value + ' ';
}
}
pieceurl();
} else if (lssl == ('YYYY-MM-DD:HH:MI:S').length) {
for (ix=0; ix<fd.length; ix++) {
qdate=new Date(document.getElementById(fd[ix]).value);
qqdate=new Date(qdateis.getTime() + eval(('' + secoffset) * 10000));
iy=document.getElementById(fd[ix]).value.length;
document.getElementById(fd[ix]).value=(qqdate.getFullYear() + '-' + ('0' + qqdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + qqdate.getMonth())).slice(-2) + ':' + ('0' + qqdate.getHours()).slice(-2) + ':' + ('0' + qqdate.getMinutes()).slice(-2) + ':' + ('0' + qqdate.getSeconds()).slice(-2)).substring(0,iy);
}
pieceurl();
} else if (lssl == ('YYYY-MM-DD:HH:MI:').length || lssl == ('YYYY-MM-DD:HH:MI').length) {
for (ix=0; ix<fd.length; ix++) {
qdate=new Date(document.getElementById(fd[ix]).value);
qqdate=new Date(qdateis.getTime() + eval(('' + secoffset) * 60000));
iy=document.getElementById(fd[ix]).value.length;
document.getElementById(fd[ix]).value=(qqdate.getFullYear() + '-' + ('0' + qqdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + qqdate.getMonth())).slice(-2) + ':' + ('0' + qqdate.getHours()).slice(-2) + ':' + ('0' + qqdate.getMinutes()).slice(-2) + ':' + ('0' + qqdate.getSeconds()).slice(-2)).substring(0,iy);
}
pieceurl();
} else if (lssl == ('YYYY-MM-DD:HH:M').length) {
for (ix=0; ix<fd.length; ix++) {
qdate=new Date(document.getElementById(fd[ix]).value);
qqdate=new Date(qdateis.getTime() + eval(('' + secoffset) * 600000));
iy=document.getElementById(fd[ix]).value.length;
document.getElementById(fd[ix]).value=(qqdate.getFullYear() + '-' + ('0' + qqdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + qqdate.getMonth())).slice(-2) + ':' + ('0' + qqdate.getHours()).slice(-2) + ':' + ('0' + qqdate.getMinutes()).slice(-2) + ':' + ('0' + qqdate.getSeconds()).slice(-2)).substring(0,iy);
}
pieceurl();
} else if (lssl == ('YYYY-MM-DD:HH:').length || lssl == ('YYYY-MM-DD:HH').length) {
for (ix=0; ix<fd.length; ix++) {
qdate=new Date(document.getElementById(fd[ix]).value);
qqdate=new Date(qdateis.getTime() + eval(('' + secoffset) * 3600000));
iy=document.getElementById(fd[ix]).value.length;
document.getElementById(fd[ix]).value=(qqdate.getFullYear() + '-' + ('0' + qqdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + qqdate.getMonth())).slice(-2) + ':' + ('0' + qqdate.getHours()).slice(-2) + ':' + ('0' + qqdate.getMinutes()).slice(-2) + ':' + ('0' + qqdate.getSeconds()).slice(-2)).substring(0,iy);
}
pieceurl();
} else if (lssl == ('YYYY-MM-DD:H').length) {
for (ix=0; ix<fd.length; ix++) {
qdate=new Date(document.getElementById(fd[ix]).value);
qqdate=new Date(qdateis.getTime() + eval(('' + secoffset) * 36000000));
iy=document.getElementById(fd[ix]).value.length;
document.getElementById(fd[ix]).value=(qqdate.getFullYear() + '-' + ('0' + qqdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + qqdate.getMonth())).slice(-2) + ':' + ('0' + qqdate.getHours()).slice(-2) + ':' + ('0' + qqdate.getMinutes()).slice(-2) + ':' + ('0' + qqdate.getSeconds()).slice(-2)).substring(0,iy);
}
pieceurl();
} else if (lssl <= ('YYYY-MM-DD:').length || lssl <= ('YYYY-MM-DD').length) {
for (ix=0; ix<fd.length; ix++) {
qdate=new Date(document.getElementById(fd[ix]).value);
qqdate=new Date(qdateis.getTime() + eval(('' + secoffset) * 216000000)); // 60 x 60 x 24 x 1000
iy=document.getElementById(fd[ix]).value.length;
document.getElementById(fd[ix]).value=(qqdate.getFullYear() + '-' + ('0' + qqdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + qqdate.getMonth())).slice(-2) + ':' + ('0' + qqdate.getHours()).slice(-2) + ':' + ('0' + qqdate.getMinutes()).slice(-2) + ':' + ('0' + qqdate.getSeconds()).slice(-2)).substring(0,iy);
pieceurl();
}
}
}
}
}
return vsd;
}
function revit() {
document.getElementById('myh').innerHTML='<a href=#countdown title=Top>' + document.getElementById('countdown').innerText + '</a>';
}
function triggerwhen() {
if (triggernowstr != '') {
var xmdate=new Date();
var xmdatestr=xmdate.getFullYear() + '-' + ('0' + xmdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + xmdate.getMonth())).slice(-2) + ':' + ('0' + xmdate.getHours()).slice(-2) + ':' + ('0' + xmdate.getMinutes()).slice(-2) + ':' + ('0' + xmdate.getSeconds()).slice(-2);
if (eval(xmdatestr.replace(/\-/g,'').replace(/\:/g,'').replace(/\ /g,'')) >= eval(triggernowstr.replace(/\-/g,'').replace(/\:/g,'').replace(/\ /g,''))) {
triggernowstr='';
setTimeout(triggerwhen, 1000);
if (('' + addhowmany).trim() != ('' + addhowmany)) {
document.getElementById('spacer').value=document.getElementById('spacer').value + ' ';
pieceurl();
} else {
xdcomp(('' + addhowmany).trim());
//alert('yes');
}
} else {
setTimeout(triggerwhen, 1000);
}
} else {
setTimeout(triggerwhen, 1000);
}
}
function tn(inp,dts) {
var ij=0;
var gaz=prompt('As required, to forever automate a standing order of a form change, append the date and time by ; and amount to increment the date by in seconds else to resubmit the same form data leave the date and time intact, else click the Cancel to make your own changes. Know that back when you change the webpage element you can strategically place an equal sign placement works date changes left of that equal and plus placement(s) add that many datetime units to relevant left hand part and minus placement(s) subtract that many datetime units to relevant left hand part.', inp);
if (gaz == null) { return dts; }
if (gaz.indexOf(';') != -1) {
addhowmany='' + gaz.split(';')[1];
if (addhowmany == '') { addhowmany='0 '; }
gaz=gaz.split(';')[0];
if (gaz.indexOf('=') != -1) {
lssl=gaz.split('=')[0].length;
secoffset=0;
} else if (gaz.indexOf('+') != -1) {
lssl=gaz.split('+')[0].length;
secoffset=0;
for (ij=lssl; ij<gaz.length; ij++) {
if (gaz.substring(ij,eval(eval(('' + ij)) + 1)) == '+') { secoffset++; }
}
} else if (gaz.indexOf('--') != -1) {
lssl=gaz.split('--')[0].length;
secoffset=0;
lssl++;
for (ij=lssl; ij<gaz.length; ij++) {
if (gaz.substring(ij,eval(eval(('' + ij)) + 1)) == '-') { secoffset--; }
}
lssl--;
} else if (gaz.indexOf('-:') != -1) {
secoffset=-1;
lssl=gaz.split('-:')[0].length;
} else if (gaz.indexOf(':-') != -1) {
lssl=gaz.split(':-')[0].length;
secoffset=0;
lssl++;
for (ij=lssl; ij<gaz.length; ij++) {
if (gaz.substring(ij,eval(eval(('' + ij)) + 1)) == '-') { secoffset--; }
}
lssl--;
}
triggernowstr=gaz.replace(/\+/g,'').replace(/\:\-/g,':').replace(/\-\:/g,':').replace(/\-\-/g,'-').replace(/\:\=/g,':').replace(/\=\:/g,':').replace(/\-\=/g,'-').replace(/\=/g,'');
if (addhowmany == '0 ') {
document.getElementById('pred').innerHTML='<span id=gaz>' + gaz.replace(/\+/g,'').replace(/\:\-/g,':').replace(/\-\:/g,':').replace(/\-\-/g,'-').replace(/\:\=/g,':').replace(/\=\:/g,':').replace(/\-\=/g,'-').replace(/\=/g,'') + '</span> we will change the form so that at ';
} else {
document.getElementById('pred').innerHTML='<span id=gaz>' + gaz.replace(/\+/g,'').replace(/\:\-/g,':').replace(/\-\:/g,':').replace(/\-\-/g,'-').replace(/\:\=/g,':').replace(/\=\:/g,':').replace(/\-\=/g,'-').replace(/\=/g,'') + '</span> we will add ' + addhowmany.trim() + ' seconds to date at ';
}
gdate=new Date(gaz.replace(/\+/g,'').replace(/\:\-/g,':').replace(/\-\:/g,':').replace(/\-\-/g,'-').replace(':','T'));
return dts;
} else {
triggernowstr=gaz.replace(/\+/g,'').replace(/\:\-/g,':').replace(/\-\:/g,':').replace(/\-\-/g,'-').replace(/\:\=/g,':').replace(/\=\:/g,':').replace(/\-\=/g,'-').replace(/\=/g,'');
addhowmany='0 ';
document.getElementById('pred').innerHTML='<span id=gaz>' + gaz.replace(/\+/g,'').replace(/\:\-/g,':').replace(/\-\:/g,':').replace(/\-\-/g,'-').replace(/\:\=/g,':').replace(/\=\:/g,':').replace(/\-\=/g,'-').replace(/\=/g,'') + '</span> we will change the form so that at ';
gdate=new Date(gaz.replace(/\+/g,'').replace(/\:\-/g,':').replace(/\-\:/g,':').replace(/\-\-/g,'-').replace(':','T'));
return dts;
}
}
function andmore() {
if (every_thousand != 0 && tp == 'andmore' && nexttp == 'moreand') {
setTimeout(andmore, Math.abs(every_thousand));
var predv=document.getElementById('pred').innerHTML, pfrom='youllneverfindthis', pto='youllneverfindthis';
if (lastih != document.getElementById('myform').innerHTML) {
lastih=document.getElementById('myform').innerHTML;
// iframe src set here
mdate=new Date();
mdatestr=mdate.getFullYear() + '-' + ('0' + mdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + mdate.getMonth())).slice(-2) + ':' + ('0' + mdate.getHours()).slice(-2) + ':' + ('0' + mdate.getMinutes()).slice(-2) + ':' + ('0' + mdate.getSeconds()).slice(-2);
datestr=dcomp(mdatestr);
lastdatestr=datestr;
ti=' (that is <span id=nact>' + tdadd(mdate, eval(('' + Math.abs(every_thousand)) / 1)) + '</span>)';
if (document.getElementById('gaz')) {
pfrom=document.getElementById('gaz').innerHTML;
if (xdate == null) {
xdate=new Date(pfrom.replace(':','T'));
}
pto=tdadd(xdate, eval(('' + Math.abs(every_thousand)) / 1));
xdate=gdate;
triggernowstr=pto;
//gdate=new Date(pto.replace(':','T'));
}
if (tis == '_SELF') {
document.getElementById('myiframe').src=document.getElementById('feedurl').value + '&straight=straight';
} else if (tis == '_self') {
document.getElementById('myiframe').src=document.getElementById('feedurl').value;
} else if (tis == mif) {
document.getElementById('myiframe').src=document.getElementById('feedurl').value + '&justemail=justemail';
}
document.getElementById('countdown').innerHTML='At <span id=pred>' + predv.replace(pfrom,pto) + '</span><div id=dtdiv style=display:inline; contenteditable=true onblur=\"this.innerHTML=tn(this.innerHTML,datestr);\" onchange=\"this.innerHTML=tn(this.innerHTML,datestr);\" title=\"At this time get prompted for instructions and know an equal sign placement works date changes left of that equal and plus placement(s) add that many datetime units to relevant left hand part and minus placement(s) subtract that many datetime units to relevant left hand part\">' + datestr + '</div>, in ' + eval(Math.abs(every_thousand) / 1000) + ' seconds' + ti + ', if you have changed any <a onclick=revit(); href=#myform title=Form>form</a> values (or if you amend the <span class=dtdiv>datetime stamp to the left</span>) we will rerun the feed URL.';
revit();
//addhowmany='0';
} else {
mdate=new Date();
mdatestr=mdate.getFullYear() + '-' + ('0' + mdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + mdate.getMonth())).slice(-2) + ':' + ('0' + mdate.getHours()).slice(-2) + ':' + ('0' + mdate.getMinutes()).slice(-2) + ':' + ('0' + mdate.getSeconds()).slice(-2);
datestr=dcomp(mdatestr);
lastdatestr=datestr;
ti=' (that is <span id=nact>' + tdadd(mdate, eval(('' + Math.abs(every_thousand)) / 1)) + '</span>)';
if (document.getElementById('gaz')) {
pfrom=document.getElementById('gaz').innerHTML;
if (xdate == null) {
xdate=new Date(pfrom.replace(':','T'));
}
pto=tdadd(xdate, eval(('' + Math.abs(every_thousand)) / 1));
xdate=gdate;
triggernowstr=pto;
}
document.getElementById('countdown').innerHTML='At <span id=pred>' + predv + '</span><div id=dtdiv style=display:inline; contenteditable=true onblur=\"this.innerHTML=tn(this.innerHTML,datestr);\" onchange=\"this.innerHTML=tn(this.innerHTML,datestr);\" title=\"At this time get prompted for instructions and know an equal sign placement works date changes left of that equal and plus placement(s) add that many datetime units to relevant left hand part and minus placement(s) subtract that many datetime units to relevant left hand part\">' + datestr + '</div>, in ' + eval(Math.abs(every_thousand) / 1000) + ' seconds' + ti + ', if you have changed any <a onclick=revit(); href=#myform title=Form>form</a> values (or if you amend the <span class=dtdiv>datetime stamp to the left</span>) we will rerun the feed URL.';
revit();
}
}
}
function moreand() {
if (every_thousand != 0 && tp == 'moreand' && nexttp == 'andmore') {
setTimeout(moreand, Math.abs(every_thousand));
var predv=document.getElementById('pred').innerHTML, pfrom='youllneverfindthis', pto='youllneverfindthis';
if (lastih != document.getElementById('myform').innerHTML) {
lastih=document.getElementById('myform').innerHTML;
// iframe src set here
mdate=new Date();
mdatestr=mdate.getFullYear() + '-' + ('0' + mdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + mdate.getMonth())).slice(-2) + ':' + ('0' + mdate.getHours()).slice(-2) + ':' + ('0' + mdate.getMinutes()).slice(-2) + ':' + ('0' + mdate.getSeconds()).slice(-2);
datestr=dcomp(mdatestr);
lastdatestr=datestr;
ti=' (that is <span id=nact>' + tdadd(mdate, eval(('' + Math.abs(every_thousand)) / 1)) + '</span>)';
if (document.getElementById('gaz')) {
pfrom=document.getElementById('gaz').innerHTML;
if (xdate == null) {
xdate=new Date(pfrom.replace(':','T'));
}
pto=tdadd(xdate, eval(('' + Math.abs(every_thousand)) / 1));
xdate=gdate;
triggernowstr=pto;
//gdate=new Date(pto.replace(':','T'));
}
if (tis == '_SELF') {
document.getElementById('myiframe').src=document.getElementById('feedurl').value + '&straight=straight';
} else if (tis == '_self') {
document.getElementById('myiframe').src=document.getElementById('feedurl').value;
} else if (tis == mif) {
document.getElementById('myiframe').src=document.getElementById('feedurl').value + '&justemail=justemail';
}
//alert(pfrom + ' for ' + pto + ' ... ' + datestr + ' ... ' + 'At <span id=pred>' + predv.replace(pfrom,pto) + '</span><div id=dtdiv style=display:inline; contenteditable=true onblur=\"this.innerHTML=tn(this.innerHTML,datestr);\" onchange=\"this.innerHTML=tn(this.innerHTML,datestr);\" title=\"At this time get prompted for instructions and know an equal sign placement works date changes left of that equal and plus placement(s) add that many datetime units to relevant left hand part and minus placement(s) subtract that many datetime units to relevant left hand part\">' + datestr + '</div>, in ' + eval(Math.abs(every_thousand) / 1000) + ' seconds' + ti + ', if you have changed any <a onclick=revit(); href=#myform title=Form>form</a> values (or if you amend the <span class=dtdiv>datetime stamp to the left</span>) we will rerun the feed URL.');
document.getElementById('countdown').innerHTML='At <span id=pred>' + predv.replace(pfrom,pto) + '</span><div id=dtdiv style=display:inline; contenteditable=true onblur=\"this.innerHTML=tn(this.innerHTML,datestr);\" onchange=\"this.innerHTML=tn(this.innerHTML,datestr);\" title=\"At this time get prompted for instructions and know an equal sign placement works date changes left of that equal and plus placement(s) add that many datetime units to relevant left hand part and minus placement(s) subtract that many datetime units to relevant left hand part\">' + datestr + '</div>, in ' + eval(Math.abs(every_thousand) / 1000) + ' seconds' + ti + ', if you have changed any <a onclick=revit(); href=#myform title=Form>form</a> values (or if you amend the <span class=dtdiv>datetime stamp to the left</span>) we will rerun the feed URL.';
revit();
//addhowmany='0';
} else {
mdate=new Date();
mdatestr=mdate.getFullYear() + '-' + ('0' + mdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + mdate.getMonth())).slice(-2) + ':' + ('0' + mdate.getHours()).slice(-2) + ':' + ('0' + mdate.getMinutes()).slice(-2) + ':' + ('0' + mdate.getSeconds()).slice(-2);
datestr=dcomp(mdatestr);
lastdatestr=datestr;
ti=' (that is <span id=nact>' + tdadd(mdate, eval(('' + Math.abs(every_thousand)) / 1)) + '</span>)';
if (document.getElementById('gaz')) {
pfrom=document.getElementById('gaz').innerHTML;
if (xdate == null) {
xdate=new Date(pfrom.replace(':','T'));
}
pto=tdadd(xdate, eval(('' + Math.abs(every_thousand)) / 1));
xdate=gdate;
triggernowstr=pto;
//gdate=new Date(pto.replace(':','T'));
}
document.getElementById('countdown').innerHTML='At <span id=pred>' + predv + '</span><div id=dtdiv style=display:inline; contenteditable=true onblur=\"this.innerHTML=tn(this.innerHTML,datestr);\" onchange=\"this.innerHTML=tn(this.innerHTML,datestr);\" title=\"At this time get prompted for instructions and know an equal sign placement works date changes left of that equal and plus placement(s) add that many datetime units to relevant left hand part and minus placement(s) subtract that many datetime units to relevant left hand part\">' + datestr + '</div>, in ' + eval(Math.abs(every_thousand) / 1000) + ' seconds' + ti + ', if you have changed any <a onclick=revit(); href=#myform title=Form>form</a> values (or if you amend the <span class=dtdiv>datetime stamp to the left</span>) we will rerun the feed URL.';
revit();
}
}
}
function osm() {
if (every_thousand != 0) {
document.getElementById('myform').target=mif;
if (document.getElementById('mydetails')) {
document.getElementById('mydetails').style.display='block';
}
document.getElementById(mif).style.display='block';
document.getElementById(mif).style.width='100%';
document.getElementById(mif).style.height='400px';
document.getElementById(mif).style.border='2px dashed red';
if (every_thousand > 0) {
if (cdate == null) {
setTimeout(triggerwhen, 1000);
cdate=new Date();
if (document.getElementById('firsttime').value == '' && (document.getElementById('firstdate').value + ' ').substring(0,1) >= '0' && (document.getElementById('firstdate').value + ' ').substring(0,1) <= '9' && document.getElementById('firstdate').value.indexOf(':') == -1) {
document.getElementById('firsttime').value=('0' + cdate.getHours()).slice(-2) + ':' + ('0' + cdate.getMinutes()).slice(-2) + ':' + ('0' + cdate.getSeconds()).slice(-2);
}
if (document.getElementById('secondtime').value == '' && (document.getElementById('seconddate').value + ' ').substring(0,1) >= '0' && (document.getElementById('seconddate').value + ' ').substring(0,1) <= '9' && document.getElementById('seconddate').value.indexOf(':') == -1) {
document.getElementById('secondtime').value=('0' + cdate.getHours()).slice(-2) + ':' + ('0' + cdate.getMinutes()).slice(-2) + ':' + ('0' + cdate.getSeconds()).slice(-2);
}
} else {
cdate=new Date();
}
mdate=cdate;
cdatestr=cdate.getFullYear() + '-' + ('0' + cdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + cdate.getMonth())).slice(-2) + ':' + ('0' + cdate.getHours()).slice(-2) + ':' + ('0' + cdate.getMinutes()).slice(-2) + ':' + ('0' + cdate.getSeconds()).slice(-2);
mdatestr=cdatestr;
datestr=dcomp(cdatestr);
lastdatestr=datestr;
lastih=document.getElementById('myform').innerHTML;
ti=' (that is <span id=nact>' + tdadd(cdate, eval(('' + every_thousand) / 1)) + '</span>)';
if (tp == 'andmore') {
setTimeout(andmore, every_thousand);
nexttp='moreand';
document.getElementById('countdown').innerHTML='At <span id=pred></span><div id=dtdiv style=display:inline; contenteditable=true onblur=\"this.innerHTML=tn(this.innerHTML,datestr);\" onchange=\"this.innerHTML=tn(this.innerHTML,datestr);\" title=\"At this time get prompted for instructions and know an equal sign placement works date changes left of that equal and plus placement(s) add that many datetime units to relevant left hand part and minus placement(s) subtract that many datetime units to relevant left hand part\">' + datestr + '</div>, in ' + eval(Math.abs(every_thousand) / 1000) + ' seconds' + ti + ', if you have changed any <a onclick=revit(); href=#myform title=Form>form</a> values (or if you amend the <span class=dtdiv>datetime stamp to the left</span>) we will rerun the feed URL.';
} else {
setTimeout(moreand, every_thousand);
nexttp='andmore';
document.getElementById('countdown').innerHTML='At <span id=pred></span><div id=dtdiv style=display:inline; contenteditable=true onblur=\"this.innerHTML=tn(this.innerHTML,datestr);\" onchange=\"this.innerHTML=tn(this.innerHTML,datestr);\" title=\"At this time get prompted for instructions and know an equal sign placement works date changes left of that equal and plus placement(s) add that many datetime units to relevant left hand part and minus placement(s) subtract that many datetime units to relevant left hand part\">' + datestr + '</div>, in ' + eval(Math.abs(every_thousand) / 1000) + ' seconds' + ti + ', if you have changed any <a onclick=revit(); href=#myform title=Form>form</a> values (or if you amend the <span class=dtdiv>datetime stamp to the left</span>) we will rerun the feed URL.';
}
every_thousand=eval(0 - every_thousand);
}
} else {
document.getElementById('myform').target=tis.toLowerCase();
}
return true;
}
function tdadd(adateis, secsadd) {
gdate=new Date(adateis.getTime() + secsadd);
return gdate.getFullYear() + '-' + ('0' + gdate.getDate()).slice(-2) + '-' + ('0' + eval(1 + gdate.getMonth())).slice(-2) + ':' + ('0' + gdate.getHours()).slice(-2) + ':' + ('0' + gdate.getMinutes()).slice(-2) + ':' + ('0' + gdate.getSeconds()).slice(-2);
}
function pieceurl() {
var pit='', minusone=1.0, lastet=every_thousand;
document.getElementById('feedurl').value='';
if (document.getElementById('prefixfeedurl').value.toUpperCase().indexOf('HTTP') == 0) {
pit=document.getElementById('prefixfeedurl').value;
if (document.getElementById('firstdate').value.trim() != document.getElementById('firstdate').value) {
document.getElementById('spacer').value=document.getElementById('firstdate').value.replace(document.getElementById('firstdate').value.trim(),'');
}
pit+=encodeURIComponent(document.getElementById('firstdate').value.trim());
pit+=document.getElementById('middlefeedurl').value;
pit+=encodeURIComponent(document.getElementById('seconddate').value);
if (every_thousand < 0) { minusone=-1.0; }
every_thousand=0;
if (document.getElementById('everyn').value.replace('0','').replace('.0','') != '') {
if (document.getElementById('everyunit').value == '') {
pit+='#' + document.getElementById('everyn').value + 'minute';
every_thousand=Math.floor(eval(('' + document.getElementById('everyn').value) * minusone * 60.0 * 1000.0));
} else {
pit+='#' + document.getElementById('everyn').value + document.getElementById('everyunit').value;
if (document.getElementById('everyunit').value == 'minute') {
every_thousand=Math.floor(eval(('' + document.getElementById('everyn').value) * minusone * 60.0 * 1000.0));
} else if (document.getElementById('everyunit').value == 'hour') {
every_thousand=Math.floor(eval(('' + document.getElementById('everyn').value) * minusone * 60.0 * 60.0 * 1000.0));
} else if (document.getElementById('everyunit').value == 'day') {
every_thousand=Math.floor(eval(('' + document.getElementById('everyn').value) * minusone * 60.0 * 60.0 * 24.0 * 1000.0));
}
}
}
if (lastet != 0 && every_thousand != 0 && Math.abs(lastet) != Math.abs(every_thousand)) {
tp=nexttp;
every_thousand=Math.abs(every_thousand);
}
if (document.getElementById('optionalemail').value.replace('emailee@goes.here','').indexOf('@') != -1) {
if (pit.replace('/#/','').indexOf('#') != -1) {
pit+='%20' + encodeURIComponent(document.getElementById('optionalemail').value);
} else {
pit+='#' + encodeURIComponent(document.getElementById('optionalemail').value);
}
if (document.getElementById('je').innerHTML.length == 0) {
document.getElementById('je').innerHTML=\" <input onmouseover='tis=mif;' onclick='tis=mif;' style='background-color:yellow;' type=submit name=justemail id=justemail value='Just Email ...'></input>\";
document.getElementById('myform').target='myiframe';
}
}
document.getElementById('feedurl').value=pit;
}
}
</scr" . "ipt>";
$wholeu="";
$one="";
$two="";
$three="";
$four="";
$five="emailee@goes.here";
$six="0.0";
$minutesel="";
$hoursel="";
$daysel="";
$xrest="@!@!@@@!^$";
$htmlis="<!doctype><html><head><title>Feed via Date - RJM Programming - October, 2018</title><style> #myh { background-color:lightgray; } #nact { background-color:pink; } #gaz { background-color:yellow; } #pred { background-color:lightgreen; } .dtdiv { background-color:lightblue; } #dtdiv { background-color:lightblue; } input[type=submit] { margin-left:40%; align:right; } </style>" . $scriptis . "</head><body><div id=countdown></div><div id=msg></div>" . $detprefix . "<iframe name=myiframe id=myiframe style='display:none;' src=''></iframe>" . $detsuffix . "</body></html>";
if (isset($_GET['feedurl']) || isset($_GET['urlfeed'])) {
if (isset($_GET['feedurl'])) {
$wholeu=str_replace($ufrom,$uto,str_replace("+"," ",$_GET['feedurl']));
} else {
$wholeu=str_replace($ufrom,$uto,str_replace("+"," ",$_GET['urlfeed']));
}
if ($wholeu != "") {
$urlis=explode("#",$wholeu)[0];
if (strpos($wholeu, "#") !== false) {
$rest=str_replace("%20"," ",str_replace("%40","@",explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))]));
if (strpos($rest, "@") !== false) {
$to=explode(" ",$rest)[-1 + sizeof(explode(" ",$rest))];
$five=$to;
$rest=str_replace($to,"",$rest);
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
}
if (strpos($rest, "minute") !== false) {
$six=explode("minute",$rest)[0];
$minutesel=" selected";
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
} else if (strpos($rest, "hour") !== false) {
$six=explode("hour",$rest)[0];
$hoursel=" selected";
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
} else if (strpos($rest, "day") !== false) {
$six=explode("day",$rest)[0];
$daysel=" selected";
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
} else if (trim($rest) != "") {
if (substr($rest,0,1) >= "0" && substr($rest,0,1) <= "9") {
$six=trim($rest);
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
}
}
}
if (strpos($wholeu, "=") !== false) {
$one=explode("=", $wholeu)[0] . "=";
$two=explode("#",explode("&",explode($one, $wholeu)[1])[0])[0];
if (strpos(explode(($one . $two), $wholeu)[1], "=") !== false) {
$three=explode("=",explode(($one . $two), $wholeu)[1])[0] . "=";
$four=explode("#",explode("&",explode(($one . $two . $three), $wholeu)[1])[0])[0];
}
} else {
$one=explode("#", $wholeu)[0];
}
if (strpos(($wholeu . "?"), "/feed_via_date.php?") !== false || strpos(($wholeu . "?"), "/feed_via_date.php#") !== false) {
$repcont="Welcome to feed_via_date.php on " . date("l jS \of F Y h:i:s A");
if (isset($_GET['justemail'])) {
mailit("<html><body><p>" . $repcont . "</p></body></html>", str_replace($xrest,"", $wholeu));
exit;
}
} else if (isset($_GET['feedurl'])) {
if (isset($_GET['straight']) || isset($_GET['justemail']) || isset($_GET['justfillin'])) {
if (strpos($to, "@") !== false) {
$htmlis=str_replace("<body>", "<body onload=\"pieceurl(); " . $clk . " \">", $htmlis);
$htmlis=str_replace("</body>", "<div style='background-color:white;border:5px dotted lightgray;'>Via ... <a target=_blank title='" . str_replace("https:","http:",str_replace("/#/","/~/",str_replace($xrest,"", $wholeu))) . "' href='" . str_replace($xrest,"", $wholeu) . "'>" . str_replace($xrest,"", $wholeu) . "</a> ... <br>" . str_replace("</body>","</BODY>",$repcont) . "</div><br><br><p style='display:none;'> ... via ... " . str_replace("/#/","/~/",str_replace($xrest,"", $wholeu)) . "</p><br><br><h1>Feed via Date</h1><h4 id=myh></h4><h3>RJM Programming - October, 2018</h3><form onsubmit='return osm();' id=myform action='" . "//" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "' method=GET><input type=hidden id=spacer value=''></input><input type=hidden name=feedurl id=feedurl></input></body>", $htmlis);
$htmlis=str_replace("</body>", "<table border=20 style='width:100%;'><tr><th>Feed URL Prefix Before First Date </th><th>First Date</th><th>Optional More URL</th><th>Optional Second Date</th><th>Optional Emailee</th><th id=thr style='display:block;'>Optional Every</th></tr><tr><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=url id=prefixfeedurl value='" . $one . "' placeholder='" . "HTTP://" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "?firstdate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=firstdate value='" . $two . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=firsttime></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=middlefeedurl value='" . $three . "' placeholder='&seconddate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=seconddate value='" . $four . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=secondtime></input></td><td><input onblur='pieceurl();' type=email id=optionalemail style='width:90%;' placeholder='emailee@goes.here' value='" . $five . "'></input></td><td id=tdr style='display:block;'><input onchange='pieceurl();' onblur='pieceurl();' title='0 means no recurring runs' type=number value='" . $six . "' min='0.0' step='0.1' id='everyn' style='width:40px;'></input> <select onchange='pieceurl();' id='everyunit'><option value=''></option><option value='minute'" . $minutesel . ">minute</option><option value='hour'" . $hoursel . ">hour</option><option value='day'" . $daysel . ">day</option></select></td></tr></table><br><input onmouseover=\"tis='_self';\" onclick=\"tis='_self';\" style='background-color:yellow;' type=submit id=brfr value='Run Feed Report ...'></input> <input onmouseover=\"tis='_SELF';\" onclick=\"tis='_SELF';\" style='background-color:yellow;' type=submit name=straight id=straight value='Goto Feed Webpage Itself ...'></input><div id=je></div></form></body>", $htmlis);
if (isset($_GET['justfillin'])) {
$clk="";
echo str_replace("document.getElementById(straight).click();","",$htmlis);
exit;
} else {
mailit($htmlis, str_replace($xrest,"", $wholeu));
}
}
if (!isset($_GET['justemail']) && !isset($_GET['justfillin'])) {
$repcont=" ";
header("Location: " . str_replace($xrest,"", $wholeu));
exit;
} else if (!isset($_GET['justfillin'])) {
echo "<html><body onload=\" if (parent.document.getElementById('msg')) { parent.document.getElementById('msg').innerHTML='" . $to . " emailed " . $two . " report.<br>'; } \"></body></html>";
exit;
}
} else {
$repcont=relative_to_absolute(ourfile_get_contents(str_replace("https:","http:",str_replace("/#/","/~/",str_replace($xrest,"", $wholeu)))));
}
if ($repcont == "") {
header("Location: " . str_replace($xrest,"", $wholeu));
exit;
}
}
}
if (isset($_GET['feedurl'])) {
$htmlis=str_replace("<body>", "<body onload='pieceurl();'>", $htmlis);
$htmlis=str_replace("</body>", "<div style='background-color:white;border:5px dotted lightgray;'>Via ... <a target=_blank title='" . str_replace("https:","http:",str_replace("/#/","/~/",str_replace($xrest,"", $wholeu))) . "' href='" . str_replace($xrest,"", $wholeu) . "'>" . str_replace($xrest,"", $wholeu) . "</a> ... <br>" . str_replace("</body>","</BODY>",$repcont) . "</div><br><br><p style='display:none;'> ... via ... " . str_replace("/#/","/~/",str_replace($xrest,"", $wholeu)) . "</p><br><br><h1>Feed via Date</h1><h4 id=myh></h4><h3>RJM Programming - October, 2018</h3><form onsubmit='return osm();' id=myform action='" . "//" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "' method=GET><input type=hidden id=spacer value=''></input><input type=hidden name=feedurl id=feedurl></input></body>", $htmlis);
$htmlis=str_replace("</body>", "<table border=20 style='width:100%;'><tr><th>Feed URL Prefix Before First Date </th><th>First Date</th><th>Optional More URL</th><th>Optional Second Date</th><th>Optional Emailee</th><th id=thr style='display:block;'>Optional Every</th></tr><tr><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=url id=prefixfeedurl value='" . $one . "' placeholder='" . "HTTP://" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "?firstdate='></input><input type=hidden value='' id=firsttime></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=firstdate value='" . $two . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=firsttime></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=middlefeedurl value='" . $three . "' placeholder='&seconddate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=seconddate value='" . $four . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=secondtime></input></td><td><input onblur='pieceurl();' type=email id=optionalemail style='width:90%;' placeholder='emailee@goes.here' value='" . $five . "'></input></td><td id=tdr style='display:block;'><input onchange='pieceurl();' onblur='pieceurl();' title='0 means no recurring runs' type=number value='" . $six . "' min='0.0' step='0.1' id='everyn' style='width:40px;'></input> <select onchange='pieceurl();' id='everyunit'><option value=''></option><option value='minute'" . $minutesel . ">minute</option><option value='hour'" . $hoursel . ">hour</option><option value='day'" . $daysel . ">day</option></select></td></tr></table><br><input onmouseover=\"tis='_self';\" onclick=\"tis='_self';\" style='background-color:yellow;' type=submit id=brfr value='Run Feed Report ...'></input> <input onmouseover=\"tis='_SELF';\" onclick=\"tis='_SELF';\" style='background-color:yellow;' type=submit name=straight id=straight value='Goto Feed Webpage Itself ...'></input><div id=je></div></form></body>", $htmlis);
if (strpos($to, "@") !== false) { mailit($htmlis, str_replace($xrest,"", $wholeu)); }
} else {
$htmlis=str_replace("<body>", "<body onload=\"pieceurl(); " . $clk . " \">", $htmlis);
$htmlis=str_replace("</body>", "<div style='background-color:white;border:5px dotted lightgray;'>Via ... <a target=_blank title='" . str_replace("https:","http:",str_replace("/#/","/~/",str_replace($xrest,"", $wholeu))) . "' href='" . str_replace($xrest,"", $wholeu) . "'>" . str_replace($xrest,"", $wholeu) . "</a> ... <br>" . str_replace("</body>","</BODY>",$repcont) . "</div><br><br><p style='display:none;'> ... via ... " . str_replace("/#/","/~/",str_replace($xrest,"", $wholeu)) . "</p><br><br><h1>Feed via Date</h1><h4 id=myh></h4><h3>RJM Programming - October, 2018</h3><form onsubmit='return osm();' id=myform action='" . "//" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "' method=GET><input type=hidden id=spacer value=''></input><input type=hidden name=feedurl id=feedurl></input></body>", $htmlis);
$htmlis=str_replace("</body>", "<table border=20 style='width:100%;'><tr><th>Feed URL Prefix Before First Date </th><th>First Date</th><th>Optional More URL</th><th>Optional Second Date</th><th>Optional Emailee</th><th id=thr style='display:block;'>Optional Every</th></tr><tr><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=url id=prefixfeedurl value='" . $one . "' placeholder='" . "HTTP://" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "?firstdate='></input><input type=hidden value='' id=firsttime></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=firstdate value='" . $two . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=firsttime></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=middlefeedurl value='" . $three . "' placeholder='&seconddate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=seconddate value='" . $four . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=secondtime></input></td><td><input onblur='pieceurl();' type=email id=optionalemail style='width:90%;' placeholder='emailee@goes.here' value='" . $five . "'></input></td><td id=tdr style='display:block;'><input onchange='pieceurl();' onblur='pieceurl();' title='0 means no recurring runs' type=number value='" . $six . "' min='0.0' step='0.1' id='everyn' style='width:40px;'></input> <select onchange='pieceurl();' id='everyunit'><option value=''></option><option value='minute'" . $minutesel . ">minute</option><option value='hour'" . $hoursel . ">hour</option><option value='day'" . $daysel . ">day</option></select></td></tr></table><br><input onmouseover=\"tis='_self';\" onclick=\"tis='_self';\" style='background-color:yellow;' type=submit id=brfr value='Run Feed Report ...'></input> <input onmouseover=\"tis='_SELF';\" onclick=\"tis='_SELF';\" style='background-color:yellow;' type=submit name=straight id=straight value='Goto Feed Webpage Itself ...'></input><div id=je></div></form></body>", $htmlis);
if (strpos($to, "@") !== false) { mailit($htmlis, str_replace($xrest,"", $wholeu)); }
}
} else if (isset($_POST['feedurl']) || isset($_POST['urlfeed'])) {
if ($wholeu != "") {
if (isset($_POST['feedurl'])) {
$wholeu=str_replace($ufrom,$uto,str_replace("+"," ",$_POST['feedurl']));
} else {
$wholeu=str_replace($ufrom,$uto,str_replace("+"," ",$_POST['urlfeed']));
}
$urlis=explode("#",$wholeu)[0];
if (strpos($wholeu, "#") !== false) {
$rest=str_replace("%20"," ",str_replace("%40","@",explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))]));
if (strpos($rest, "@") !== false) {
$to=explode(" ",$rest)[-1 + sizeof(explode(" ",$rest))];
$five=$to;
$rest=str_replace($to,"",$rest);
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
}
if (strpos($rest, "minute") !== false) {
$six=explode("minute",$rest)[0];
$minutesel=" selected";
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
} else if (strpos($rest, "hour") !== false) {
$six=explode("hour",$rest)[0];
$hoursel=" selected";
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
} else if (strpos($rest, "day") !== false) {
$six=explode("day",$rest)[0];
$daysel=" selected";
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
} else if (trim($rest) != "") {
if (substr($rest,0,1) >= "0" && substr($rest,0,1) <= "9") {
$six=trim($rest);
$xrest="#" . explode("#", $wholeu)[-1 + sizeof(explode("#", $wholeu))];
}
}
}
if (strpos($wholeu, "=") !== false) {
$one=explode("=", $wholeu)[0] . "=";
$two=explode("#",explode("&",explode($one, $wholeu)[1])[0])[0];
if (strpos(explode(($one . $two), $wholeu)[1], "=") !== false) {
$three=explode("=",explode(($one . $two), $wholeu)[1])[0] . "=";
$four=explode("#",explode("&",explode(($one . $two . $three), $wholeu)[1])[0])[0];
}
} else {
$one=explode("#", $wholeu)[0];
}
if (strpos(($wholeu . "?"), "/feed_via_date.php?") !== false || strpos(($wholeu . "?"), "/feed_via_date.php#") !== false) {
$repcont="Welcome to feed_via_date.php on " . date("l jS \of F Y h:i:s A");
if (isset($_POST['justemail'])) {
mailit("<html><body><p>" . $repcont . "</p></body></html>", str_replace($xrest,"", $wholeu));
exit;
}
} else if (isset($_POST['feedurl'])) {
if (isset($_POST['straight']) || isset($_POST['justemail']) || isset($_POST['justfillin'])) {
if (strpos($to, "@") !== false) {
$htmlis=str_replace("<body>", "<body onload=\"pieceurl(); " . $clk . " \">", $htmlis);
$htmlis=str_replace("</body>", "<div style='background-color:white;border:5px dotted lightgray;'>Via ... <a target=_blank title='" . str_replace("https:","http:",str_replace("/#/","/~/",str_replace($xrest,"", $wholeu))) . "' href='" . str_replace($xrest,"", $wholeu) . "'>" . str_replace($xrest,"", $wholeu) . "</a> ... <br>" . str_replace("</body>","</BODY>",$repcont) . "</div><br><br><p style='display:none;'> ... via ... " . str_replace("/#/","/~/",str_replace($xrest,"", $wholeu)) . "</p><br><br><h1>Feed via Date</h1><h4 id=myh></h4><h3>RJM Programming - October, 2018</h3><form onsubmit='return osm();' id=myform action='" . "//" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "' method=GET><input type=hidden id=spacer value=''></input><input type=hidden name=feedurl id=feedurl></input></body>", $htmlis);
$htmlis=str_replace("</body>", "<table border=20 style='width:100%;'><tr><th>Feed URL Prefix Before First Date </th><th>First Date</th><th>Optional More URL</th><th>Optional Second Date</th><th>Optional Emailee</th><th id=thr style='display:block;'>Optional Every</th></tr><tr><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=url id=prefixfeedurl value='" . $one . "' placeholder='" . "HTTP://" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "?firstdate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=firstdate value='" . $two . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=firsttime></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=middlefeedurl value='" . $three . "' placeholder='&seconddate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=seconddate value='" . $four . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=secondtime></input></td><td><input onblur='pieceurl();' type=email id=optionalemail style='width:90%;' placeholder='emailee@goes.here' value='" . $five . "'></input></td><td id=tdr style='display:block;'><input onchange='pieceurl();' onblur='pieceurl();' title='0 means no recurring runs' type=number value='" . $six . "' min='0.0' step='0.1' id='everyn' style='width:40px;'></input> <select onchange='pieceurl();' id='everyunit'><option value=''></option><option value='minute'" . $minutesel . ">minute</option><option value='hour'" . $hoursel . ">hour</option><option value='day'" . $daysel . ">day</option></select></td></tr></table><br><input onmouseover=\"tis='_self';\" onclick=\"tis='_self';\" style='background-color:yellow;' type=submit id=brfr value='Run Feed Report ...'></input> <input onmouseover=\"tis='_SELF';\" onclick=\"tis='_SELF';\" style='background-color:yellow;' type=submit name=straight id=straight value='Goto Feed Webpage Itself ...'></input><div id=je></div></form></body>", $htmlis);
if (isset($_POST['justfillin'])) {
$clk="";
echo str_replace("document.getElementById(straight).click();","",$htmlis);
exit;
} else {
mailit($htmlis, str_replace($xrest,"", $wholeu));
}
}
if (!isset($_POST['justemail']) && !isset($_POST['justfillin'])) {
$repcont=" ";
header("Location: " . str_replace($xrest,"", $wholeu));
exit;
} else if (!isset($_POST['justfillin'])) {
echo "<html><body onload=\" if (parent.document.getElementById('msg')) { parent.document.getElementById('msg').innerHTML='" . $to . " emailed " . $two . " report.<br>'; } \"></body></html>";
exit;
}
} else {
$repcont=relative_to_absolute(ourfile_get_contents(str_replace("https:","http:",str_replace("/#/","/~/",str_replace($xrest,"", $wholeu)))));
}
if ($repcont == "") {
header("Location: " . str_replace($xrest,"", $wholeu));
exit;
}
}
}
if (isset($_POST['feedurl'])) {
$htmlis=str_replace("<body>", "<body onload='pieceurl();'>", $htmlis);
$htmlis=str_replace("</body>", "<div style='background-color:white;border:5px dotted lightgray;'>Via ... <a target=_blank title='" . str_replace("https:","http:",str_replace("/#/","/~/",str_replace($xrest,"", $wholeu))) . "' href='" . str_replace($xrest,"", $wholeu) . "'>" . str_replace($xrest,"", $wholeu) . "</a> ... <br>" . str_replace("</body>","</BODY>",$repcont) . "</div><br><br><p style='display:none;'> ... via ... " . str_replace("/#/","/~/",str_replace($xrest,"", $wholeu)) . "</p><br><br><h1>Feed via Date</h1><h4 id=myh></h4><h3>RJM Programming - October, 2018</h3><form onsubmit='return osm();' id=myform action='" . "//" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "' method=GET><input type=hidden id=spacer value=''></input><input type=hidden name=feedurl id=feedurl></input></body>", $htmlis);
$htmlis=str_replace("</body>", "<table border=20 style='width:100%;'><tr><th>Feed URL Prefix Before First Date </th><th>First Date</th><th>Optional More URL</th><th>Optional Second Date</th><th>Optional Emailee</th><th id=thr style='display:block;'>Optional Every</th></tr><tr><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=url id=prefixfeedurl value='" . $one . "' placeholder='" . "HTTP://" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "?firstdate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=firstdate value='" . $two . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=firsttime></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=middlefeedurl value='" . $three . "' placeholder='&seconddate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=seconddate value='" . $four . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=secondtime></input></td><td><input onblur='pieceurl();' type=email id=optionalemail style='width:90%;' placeholder='emailee@goes.here' value='" . $five . "'></input></td><td id=tdr style='display:block;'><input onchange='pieceurl();' onblur='pieceurl();' title='0 means no recurring runs' type=number value='" . $six . "' min='0.0' step='0.1' id='everyn' style='width:40px;'></input> <select onchange='pieceurl();' id='everyunit'><option value=''></option><option value='minute'" . $minutesel . ">minute</option><option value='hour'" . $hoursel . ">hour</option><option value='day'" . $daysel . ">day</option></select></td></tr></table><br><input onmouseover=\"tis='_self';\" onclick=\"tis='_self';\" style='background-color:yellow;' type=submit id=brfr value='Run Feed Report ...'></input> <input onmouseover=\"tis='_SELF';\" onclick=\"tis='_SELF';\" style='background-color:yellow;' type=submit name=straight id=straight value='Goto Feed Webpage Itself ...'></input><div id=je></div></form></body>", $htmlis);
if (strpos($to, "@") !== false) { mailit($htmlis, str_replace($xrest,"", $wholeu)); }
} else {
$htmlis=str_replace("<body>", "<body onload=\"pieceurl(); " . $clk . " \">", $htmlis);
$htmlis=str_replace("</body>", "<div style='background-color:white;border:5px dotted lightgray;'>Via ... <a target=_blank title='" . str_replace("https:","http:",str_replace("/#/","/~/",str_replace($xrest,"", $wholeu))) . "' href='" . str_replace($xrest,"", $wholeu) . "'>" . str_replace($xrest,"", $wholeu) . "</a> ... <br>" . str_replace("</body>","</BODY>",$repcont) . "</div><br><br><p style='display:none;'> ... via ... " . str_replace("/#/","/~/",str_replace($xrest,"", $wholeu)) . "</p><br><br><h1>Feed via Date</h1><h4 id=myh></h4><h3>RJM Programming - October, 2018</h3><form onsubmit='return osm();' id=myform action='" . "//" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "' method=GET><input type=hidden id=spacer value=''></input><input type=hidden name=feedurl id=feedurl></input></body>", $htmlis);
$htmlis=str_replace("</body>", "<table border=20 style='width:100%;'><tr><th>Feed URL Prefix Before First Date </th><th>First Date</th><th>Optional More URL</th><th>Optional Second Date</th><th>Optional Emailee</th><th id=thr style='display:block;'>Optional Every</th></tr><tr><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=url id=prefixfeedurl value='" . $one . "' placeholder='" . "HTTP://" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "?firstdate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=firstdate value='" . $two . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=firsttime></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=middlefeedurl value='" . $three . "' placeholder='&seconddate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=seconddate value='" . $four . "' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=secondtime></input></td><td><input onblur='pieceurl();' type=email id=optionalemail style='width:90%;' placeholder='emailee@goes.here' value='" . $five . "'></input></td><td id=tdr style='display:block;'><input onchange='pieceurl();' onblur='pieceurl();' title='0 means no recurring runs' type=number value='" . $six . "' min='0.0' step='0.1' id='everyn' style='width:40px;'></input> <select onchange='pieceurl();' id='everyunit'><option value=''></option><option value='minute'" . $minutesel . ">minute</option><option value='hour'" . $hoursel . ">hour</option><option value='day'" . $daysel . ">day</option></select></td></tr></table><br><input onmouseover=\"tis='_self';\" onclick=\"tis='_self';\" style='background-color:yellow;' type=submit id=brfr value='Run Feed Report ...'></input> <input onmouseover=\"tis='_SELF';\" onclick=\"tis='_SELF';\" style='background-color:yellow;' type=submit name=straight id=straight value='Goto Feed Webpage Itself ...'></input><div id=je></div></form></body>", $htmlis);
if (strpos($to, "@") !== false) { mailit($htmlis, str_replace($xrest,"", $wholeu)); }
}
} else {
$htmlis=str_replace("</body>", "<h1>Feed via Date</h1><h4 id=myh></h4><h3>RJM Programming - October, 2018</h3><form onsubmit='return osm();' id=myform action='" . "//" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "' method=GET><input type=hidden id=spacer value=''></input><input type=hidden name=feedurl id=feedurl></input></body>", $htmlis);
$htmlis=str_replace("</body>", "<table border=20 style='width:100%;'><tr><th>Feed URL Prefix Before First Date </th><th>First Date</th><th>Optional More URL</th><th>Optional Second Date</th><th>Optional Emailee</th><th id=thr style='display:block;'>Optional Every</th></tr><tr><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=url id=prefixfeedurl value='' placeholder='" . "HTTP://" . str_replace(":80/","/",str_replace(":443/","/",$_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0])) . "?firstdate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=firstdate value='' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=firsttime></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=middlefeedurl value='' placeholder='&seconddate='></input></td><td><input onblur='pieceurl();' title='Example' style='width:90%;' type=text id=seconddate value='' placeholder='" . date("Y-m-d h:i:s") . "'></input><input type=hidden value='' id=secondtime></input></td><td><input onblur='pieceurl();' type=email id=optionalemail style='width:90%;' placeholder='emailee@goes.here' value=''></input></td><td id=tdr style='display:block;'><input onchange='pieceurl();' onblur='pieceurl();' title='0 means no recurring runs' type=number value='0.0' min='0.0' step='0.1' id='everyn'></input> <select onchange='pieceurl();' id='everyunit'><option value=''></option><option value='minute'>minute</option><option value='hour'>hour</option><option value='day'>day</option></select></td></tr></table><br><input onmouseover=\"tis='_SELF';\" onclick=\"tis='_SELF';\" style='background-color:yellow;' type=submit id=brfr value='Run Feed Report ...'></input> <input onmouseover=\"tis='_SELF';\" onclick=\"tis='_SELF';\" style='background-color:yellow;' type=submit name=straight id=straight value='Goto Feed Webpage Itself ...'></input><div id=je></div></form></body>", $htmlis);
}
echo $htmlis;
?>