Jump to content

CBR

Members
  • Posts

    27
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

CBR's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. In addition, when I close IE9 and reaload it loads the latest status page with the correct content. Makes me think that caching is preventing this from working.
  2. I have a PHP file that I have running several queries to update status indicators (ApplicationsStatus.php) that is linked with in my index.php file included below. This code below goes and checks to see if that file has been updated wityh new content and will reflect that update in the page. For some reason it is not working in Internet Explorer 9 but works in Firefox and Chrome. Any ideas why? Or do you know of another simpler method? My code is old so maybe things are better in the latest Ajax calls that I am not aware of. <script language="javascript"> function createRequestObject() { var req; if(window.XMLHttpRequest){ // Firefox, Safari, Opera... req = new XMLHttpRequest(); } else if(window.ActiveXObject) { // Internet Explorer req = new ActiveXObject("Microsoft.XMLHTTP"); } else { // There is an error creating the object, // just as an old browser is being used. alert("Your Browser Does Not Support This Script - Please Upgrade Your Browser ASAP"); } return req; } // Make the XMLHttpRequest object var http = createRequestObject(); function sendRequest(page) { // Open PHP script for requests http.open('get', page); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4 && http.status == 200){ // Text returned FROM the PHP script var response = http.responseText; if(response) { // UPDATE ajaxTest content document.getElementById("appstatus").innerHTML = response; } } } function repeatloop() { sendRequest('ApplicationStatusLoad.php'); // Load actual app status URL setTimeout("repeatloop()", 10000); } window.onload=function() { repeatloop(); } </script> </head><body> <span id="appstatus"></span>
  3. FYI. I am willing to kick some money for help on this. I'm a bit confused on how this is accomplished.
  4. the foreach usage is so poorly documented. Anyone have any examples of what I am trying to do above with usage of foreach? Not sure what the hell I am doing wrong. <dataset seriesName='Total Alerts'> <?php $con1 = mysql_connect(edited,false,65536); mysql_select_db('reporting'); //Call the proc() procedure $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); mysql_close($con1); $master_data_set = array(); while ($myrow1 = mysql_fetch_array($result1)) $master_data_set[] = $myrow1; foreach($master_data_set) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} } ?> </dataset> <!--<dataset color='FF0000' seriesName='Violations' renderAs='Area' parentYAxis='P'>--> <dataset color='FF0000' seriesName='Violations' renderAs='Area' parentYAxis='P'> <?php foreach ($master_data_set) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} } ?> </dataset> <dataset lineThickness='2' seriesName='Percent Handled' parentYAxis='S'> <?php foreach ($master_data_set) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} } ?> </dataset>
  5. It isnt that simple. Each myrow could have hundreds of results. Maybe I am not understanding what you are saying. Take a look at my code. It is a bit more to it. <dataset seriesName='Total Alerts'> <?php //Call the proc() procedure $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); mysql_close($con1); while ($myrow1 = mysql_fetch_array($result1)) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} } ?> </dataset> <dataset color='FF0000' seriesName='Violations' renderAs='Area' parentYAxis='P'> <?php //Call the proc() procedure $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); mysql_close($con1); while ($myrow1 = mysql_fetch_array($result1)) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} } ?> </dataset> <dataset lineThickness='2' seriesName='Percent Handled' parentYAxis='S'> <?php //Call the proc() procedure $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); mysql_close($con1); while ($myrow1 = mysql_fetch_array($result1)) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} } ?> </dataset> <trendLines> <line startValue='90' color='00FF00' displayvalue='90% Target OLA' valueOnRight='1' parentYAxis='S'/> </trendLines> </chart>
  6. So I have this issue. I am calling a query and would like to display the result 3 times in 3 different ways. It is the same data in the 1 query I would like to display but in different orders. For instance. $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); while ($myrow1 = mysql_fetch_array($result1)) { echo " <set value='".$myrow1["total_handled"]."' />";} } while ($myrow1 = mysql_fetch_array($result1)) { echo " <set value='".$myrow1["percent"]."' />";} } while ($myrow1 = mysql_fetch_array($result1)) { echo " <set value='".$myrow1["data1"]."' />";} } ... However this does not unless I run the query again before the while statements. IT is a performance problem executing the query 3 times instead of just once to get the same data. Is this possible?
  7. I got it working! It would help if I had a .php extension now wouldnt uit? Thanks for all of your help!
  8. when I do that, it does not load the javascript? Here is my entire code. <?php $myid = 85; ?> <script type="text/javascript" src="js/prototype/prototype.js"></script> <script type="text/javascript" src="js/bramus/jsProgressBarHandler.js"></script> <div class="percentImage1" id="element6">[ Loading Progress Bar ]</div> <script type="text/javascript"> Event.observe(window, 'load', function() { manualPB2 = new JS_BRAMUS.jsProgressBar( $('element6'), <?php echo $myid; ?>, { barImage : Array( 'images/bramus/percentImage_back4.png', 'images/bramus/percentImage_back3.png', 'images/bramus/percentImage_back2.png', 'images/bramus/percentImage_back1.png' ) } ); }, false); </script>
  9. Take a look at the top code. It has a place where it has an 85. I would like to get the number out of a mysql query for instance 88, and populate that new number where the 85 is. Does that make sense? This is for a progress bar that I plan to use to show status of some goals.
  10. <script type="text/javascript"> Event.observe(window, 'load', function() { manualPB2 = new JS_BRAMUS.jsProgressBar( $('element6'), 85, { barImage : Array( 'images/bramus/percentImage_back4.png', 'images/bramus/percentImage_back3.png', 'images/bramus/percentImage_back2.png', 'images/bramus/percentImage_back1.png' ) } ); }, false); </script> In the above code I would like to insert an array where 85 is listed. for instance I would like to put in there the below. $arrayname = 'arraynameresult'; So putting in $arrayname where the 85 is will not work, I have tried over and over. any ideas?
  11. My manual "Programming PHP - Oreilly"says.. then I referenced my other book and it says for a lower case i it is the same so I guess this book has a misprint. thanks!
  12. for instance it is using a 10:01 AM timestamp as we speak for all DB entries, it is 10:21 AM where I am.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.