<!doctype html>
<html>
<head>
<title>Once a Day ASX Company Categorization Report - Client Pre-emptive Iframe Example - RJM Programming - September, 2015</title>
<link href='//www.rjmprogramming.com.au/PHP/emboss_h1.css' rel='stylesheet' type='text/css'>
<script type='text/javascript'>
// Thanks to http://stackoverflow.com/questions/11124322/get-date-time-for-a-specific-time-zone-using-javascript
var csecs="_00.html";
var altcsecs="_01.html";
var lastcall="";
var goes=-2;
var rnum=Math.floor(Math.random() * 19000) + 1;
var preselbit='<select onclick="this.size=1;" style="background-color:lightblue;" size=20 onchange="gothere(this.value);" id="asxsel"><option value="">Please see ASX company sorted by Sector then Code then Company Name below ... click for more ASX detail</option></select>';
var aconto = null;
var today = new Date();
var localoffset = -(today.getTimezoneOffset()/60);
var destoffset = 8; // Perth, Western Australia ... Crazy Domains home of www.rjmprogramming.com.au
var offset = destoffset-localoffset;
var d = new Date( new Date().getTime() + offset * 3600 * 1000);
var thisyear = d.getFullYear();
function maybeundefine(tval) {
if (tval == "" || tval == ".html") {
if (tval != ".html") document.getElementById('smonth').value="";
document.getElementById('sday').value=".html";
document.getElementById('shour').value="";
document.getElementById('sminute').value=".html";
}
}
function showreport() {
goes = 1;
document.getElementById('mth').innerHTML='_Minute_00.html';
document.getElementById('result').innerHTML=" ";
rnum = Math.floor(Math.random() * 9000) + 1;
lastcall=(document.getElementById('spath').innerHTML + document.getElementById('sprefix').innerHTML + document.getElementById('syear').value + document.getElementById('smonth').value + document.getElementById('sday').value + document.getElementById('shour').value + document.getElementById('sminute').value + "?x=" + rnum).replace(".html.html", ".html");
document.getElementById('ifdreport').src=lastcall;
}
function globalizeit(iois) {
var badresult="Sorry, but no data found, even though we tried looking very very very hard.", prefix="", bad=false, selb="";
if (document.getElementById('result').innerHTML == "" || goes <= 0) prefix="Latest run shows ";
if (iois != null) {
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
if (lastcall.indexOf(csecs) != -1 && aconto.body.innerHTML.length > 30) {
bad=true;
} else {
selb=becomesselect(aconto.body.innerHTML);
if (selb == preselbit) {
selb+='<br><a href="./once_a_day_report.html?x=' + rnum + '" title="Back">Back to Latest Report</a>';
}
document.getElementById('result').innerHTML=selb;
}
badresult="";
}
}
}
if (badresult != "") document.getElementById('result').innerHTML=badresult;
}
function onl() {
// Thanks to http://stackoverflow.com/questions/18536726/javascript-to-display-the-current-date-and-time
var amonths=["","January","February","March","April","May","June","July","August","September","October","November","December"];
var n = d.toDateString();
var t = d.toLocaleTimeString();
var ts = t.split(" am ");
if (ts.length == 1) ts = t.split(" pm ");
if (ts.length == 2) t = ts[0];
var h="" + d.getHours();
document.getElementById('myh3').innerHTML += ' (where it is ' + n + ' ' + t + ' right now)';
document.getElementById('nextyear').value = eval(1 + d.getFullYear());
document.getElementById('nextyear').innerHTML = eval(1 + d.getFullYear());
document.getElementById('prevyear').value = eval(-1 + d.getFullYear());
document.getElementById('prevyear').innerHTML = eval(-1 + d.getFullYear());
document.getElementById('optyear').value = d.getFullYear();
document.getElementById('optyear').innerHTML = d.getFullYear();
document.getElementById('syear').value = d.getFullYear();
document.getElementById('optmonth').value = "-" + ("0" + eval(1 + d.getMonth())).substring(eval(eval(1 + d.getMonth()).length - 1));
document.getElementById('optmonth').innerHTML = ("0" + eval(1 + d.getMonth())).substring(eval(eval(1 + d.getMonth()).length - 1)) + " (" + amonths[eval(1 + d.getMonth())].substring(0,3) + ")";
document.getElementById('smonth').value = "-" + ("0" + eval(1 + d.getMonth())).substring(eval(eval(1 + d.getMonth()).length - 1));
document.getElementById('optday').value = "-" + ("0" + d.getDate()).substring(eval(("" + d.getDate()).length - 1));
document.getElementById('optday').innerHTML = ("0" + d.getDate()).substring(eval(("" + d.getDate()).length - 1));
document.getElementById('sday').value = "-" + ("0" + d.getDate()).substring(eval(("" + d.getDate()).length - 1));
if (1 == 2) document.getElementById('shour').value = "_" + ("0" + d.getHours()).substring(eval(("" + d.getHours()).length - 1));
if (1 == 2) document.getElementById('sminute').value = "_" + ("0" + d.getMinutes()).substring(eval(("" + d.getMinutes()).length - 1)) + "_00.html";
}
function becomesselect(inrpt) {
var xmonths=["","January","February","March","April","May","June","July","August","September","October","November","December"];
var dbits, iyears, iyear, imonth, iday, sector="", restis, code="", cname="", presector="", presis, jmonth=0;
var datseps=inrpt.split(".dat ");
var selbit=preselbit; //'<select style="background-color:lightblue;" size=20 onchange="gothere(this.value);" id="asxsel"><option value="">Please see ASX company sorted by Sector then Code then Company Name below ... click for more ASX detail</option></select>';
for (var i=1; i<datseps.length; i++) {
dbits=datseps[eval(-1 + i)].split('-');
iday=dbits[eval(dbits.length - 1)];
imonth=dbits[eval(dbits.length - 2)];
jmonth=eval(0 + imonth);
iyears=dbits[eval(dbits.length - 3)].split("_");
iyear=iyears[eval(iyears.length - 1)];
presector=dbits[eval(dbits.length - 3)].replace("_" + iyear, "").replace(/_/g, " ");
presis=presector.split('"');
sector=presis[eval(-1 + presis.length)];
restis=datseps[i].split('"');
if (restis.length >= 4) {
code=restis[1];
cname=restis[3];
}
selbit=selbit.replace("</select>", "<option value='" + code + "'>" + sector + ": " + cname + " (" + code + ") Last Updated on " + iday + ' ' + xmonths[jmonth] + ' ' + iyear + "</option></select>");
}
return selbit;
}
function gothere(inc) {
if (inc != "") window.open("http://www.asx.com.au/asx/research/company.do#!/" + inc, "_blank", "top=50,left=50,width=600,height=600");
}
</script>
</head>
<body style='background-color:orange;' onload=" onl(); ">
<h1 align='center'>Once a Day Report - Client Pre-emptive Iframe Example - RJM Programming - September, 2015</h1>
<h3 id='myh3' align='center'>Once a Day ASX Company Categorization Report Information Relative to AWST - Australian Western Standard Time</h3>
<div align='center'><table>
<tr><th>Relative Path</th><th>Filename Prefix</th><th>Year</th><th>-Month</th><th>-Day</th><th style='display:none;'>_Hour</th><th id='mth' style='display:none;'>_Minute_00.html</th></tr>
<tr><td id='spath'>dreports/</td><td id='sprefix'>aonceaday.rpt</td><td>
<select id='syear'><option id='prevyear' value='2014'>2014</option><option id='optyear' value='2015' selected>2015</option><option id='nextyear' value='2016'>2016</option></select>
</td><td>
<select id='smonth' onchange='maybeundefine(this.value);'><option id='optmonth' value='-09'>September</option><option value=''>Undefined</option><option value='-01'>January</option><option value='-02'>February</option><option value='-03'>March</option><option value='-04'>April</option><option value='-05'>May</option><option value='-06'>June</option><option value='-07'>July</option><option value='-08'>August</option><option value='-09'>September</option><option value='-10'>October</option><option value='-11'>November</option><option value='-12'>December</option></select>
</td><td>
<select id='sday' onchange='maybeundefine(this.value);'><option id='optday' value='-21'>21</option><option value='.html'>Undefined</option>
<option value='-01'>01</option><option value='-02'>02</option><option value='-03'>03</option><option value='-04'>04</option><option value='-05'>05</option><option value='-06'>06</option><option value='-07'>07</option><option value='-08'>08</option><option value='-09'>09</option><option value='-10'>10</option>
<option value='-11'>11</option><option value='-12'>12</option><option value='-13'>13</option><option value='-14'>14</option><option value='-15'>15</option><option value='-16'>16</option><option value='-17'>17</option><option value='-18'>18</option><option value='-19'>19</option><option value='-20'>20</option>
<option value='-21'>21</option><option value='-22'>22</option><option value='-23'>23</option><option value='-24'>24</option><option value='-25'>25</option><option value='-26'>26</option><option value='-27'>27</option><option value='-28'>28</option><option value='-29'>29</option><option value='-30'>30</option>
<option value='-31'>31</option>
</select>
</td><td style='display:none;'>
<select style='display:none;' id='shour' onchange='maybeundefine(this.value);'><option value=''></option><option id='opthour' value='_00'>00</option><option value=''>Undefined</option>
<option value='_00'>00</option>
<option value='_01'>01</option><option value='_02'>02</option><option value='_03'>03</option><option value='_04'>04</option><option value='_05'>05</option><option value='_06'>06</option><option value='_07'>07</option><option value='_08'>08</option><option value='_09'>09</option><option value='_10'>10</option>
<option value='_11'>11</option><option value='_12'>12</option><option value='_13'>13</option><option value='_14'>14</option><option value='_15'>15</option><option value='_16'>16</option><option value='_17'>17</option><option value='_18'>18</option><option value='_19'>19</option><option value='_20'>20</option>
<option value='_21'>21</option><option value='_22'>22</option><option value='_23'>23</option></select>
</td><td style='display:none;'>
<select style='display:none;' id='sminute' onchange='maybeundefine(this.value);'><option value='.html'></option><option id='optminute' value='_00_00.html'>00</option><option value='.html'>Undefined</option>
<option value='_00_00.html'>00</option>
<option value='_01_00.html'>01</option><option value='_02_00.html'>02</option><option value='_03_00.html'>03</option><option value='_04_00.html'>04</option><option value='_05_00.html'>05</option><option value='_06_00.html'>06</option><option value='_07_00.html'>07</option><option value='_08_00.html'>08</option><option value='_09_00.html'>09</option><option value='_10_00.html'>10</option>
<option value='_11_00.html'>11</option><option value='_12_00.html'>12</option><option value='_13_00.html'>13</option><option value='_14_00.html'>14</option><option value='_15_00.html'>15</option><option value='_16_00.html'>16</option><option value='_17_00.html'>17</option><option value='_18_00.html'>18</option><option value='_19_00.html'>19</option><option value='_20_00.html'>20</option>
<option value='_21_00.html'>21</option><option value='_22_00.html'>22</option><option value='_23_00.html'>23</option><option value='_24_00.html'>24</option><option value='_25_00.html'>25</option><option value='_26_00.html'>26</option><option value='_27_00.html'>27</option><option value='_28_00.html'>28</option><option value='_29_00.html'>29</option><option value='_30_00.html'>30</option>
<option value='_31_00.html'>31</option><option value='_32_00.html'>32</option><option value='_33_00.html'>33</option><option value='_34_00.html'>34</option><option value='_35_00.html'>35</option><option value='_36_00.html'>36</option><option value='_37_00.html'>37</option><option value='_38_00.html'>38</option><option value='_39_00.html'>39</option><option value='_40_00.html'>40</option>
<option value='_41_00.html'>41</option><option value='_42_00.html'>42</option><option value='_43_00.html'>43</option><option value='_44_00.html'>44</option><option value='_45_00.html'>45</option><option value='_46_00.html'>46</option><option value='_47_00.html'>47</option><option value='_48_00.html'>48</option><option value='_49_00.html'>49</option><option value='_50_00.html'>50</option>
<option value='_51_00.html'>51</option><option value='_52_00.html'>52</option><option value='_53_00.html'>53</option><option value='_54_00.html'>54</option><option value='_55_00.html'>55</option><option value='_56_00.html'>56</option><option value='_57_00.html'>57</option><option value='_58_00.html'>58</option><option value='_59_00.html'>59</option>
</select>
</td></tr>
</table></div>
<div align='center'><br><br><input style='background-color:yellow;' onclick='showreport();' type='button' value='Show ASX Companies Report as of Date Above'></input></div><br><br>
<script type='text/javascript'>
document.write("<iframe onload='globalizeit(this);' style='display:none;' id='ifdreport' src='dreports/aonceaday.rpt" + thisyear + ".html?x=" + rnum + "' title='Web Server total number of processes running'></iframe><div align='center' id='result'></div>");
</script>
</body>
</html>