Jump to content

cleibesouza

Members
  • Posts

    71
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.grupocaranova.com

Profile Information

  • Gender
    Male

cleibesouza's Achievements

Member

Member (2/5)

0

Reputation

  1. Sorry for taking forever to reply but I had to devote my attention to an emergency issue at work. Thank you for all of you who put your time into helping me with this challenge. Barand's solution worked like a charm for this scenario. There are other scenarios where measures are calculated based on several queries. For instance: Give me the percentage of people who have persistent asthma for the months we have data. So, same issue here. Some months we have data, some we don't, but we need to show an interrupted line on the chart for the months we don't have data. This is just to tell you that there will probably be more coming if I can't adapt Barand's solution to this scenario ... But for now, I'll tag this thread as solved. Thank you all again!!!!
  2. I'll have to show you what I have so far because I still can't see how this is going to work. Sorry for my stupidity!! QUERY: $asthma5_40Query = "SELECT measure, periodYear, periodMonth FROM measureTemp WHERE practiceID = '" . $_SESSION['practiceID'] . "' AND questionRecID = 1 ORDER BY periodYear, periodMonth"; EXECUTE QUERY AND GET TOTAL NUMBER OF RESULTS: $asthma5_40Res = mysql_query($asthma5_40Query); $queryNumRes = mysql_num_rows($asthma5_40Res); LOOP THROUGH QUERY RESULTS: while($row = mysql_fetch_array($asthma5_40Res)){ $mArray[] = $row['periodMonth']; $yArray[] = $row['periodYear']; $measureArray[] = $row['measure']; }//end while GET FIRST, LAST MONTH AND FIRST, LAST YEAR: $firstMonth = $mArray[0]; $lastMonth = $mArray[$queryNumRes - 1]; $firstYear = min($yArray); $lastYear = max($yArray); THIS IS THE FUNCTION WRITEN BY SILKFIRE: function generate_month_range($month_start, $year_start, $month_end, $year_end) { $array = array(); $start_time = mktime(0, 0, 0, $month_start, 1, $year_start); $end_time = mktime(0, 0, 0, $month_end + 1, 1, $year_end); $months_count = round(($end_time - $start_time) / 2629743); for ($m = 0; $m < $months_count; $m++) { $date = strtotime("+$m months", $start_time); $array[date('Y', $date)][date('n', $date)] = ''; } return $array; I'm sorry, but I still don't see how to pass months, years and measures to this function and output it. To maybe help you understand it better, to graph it, this is the format that needs to be passed to the xml file, which I'm writing on the fly with PHP. <set label=$periodMonth . "/" . $periodYear . "\" value=\"" . $measure . "\"/>"; Your help is greatly appreciated. I'm really frustrated with the fact that I can't see something that's sounds really simple
  3. I understand that. I'm not knowing how to plug the measure values into the year/month array. That's where I'm stuck.
  4. This is a sample data from the database: Month Year Measure 5 2010 164 6 2010 31 7 2010 20 8 2010 10 9 2010 10 10 2010 10 12 2010 10 1 2011 10 I need to graph the measures using month/year labels. If a don't have a measure for a specific month(in this case Nov.), the label need to appear on the chart with empty measure. I attached an image of how it should look like. Thanks.
  5. This is a great step on the right direction and I appreciate your help. I've been trying to plug the measure data from the db into the function but can't make it work. Thanks.
  6. SELECT measure, periodYear, periodMonth FROM tableName WHERE pracID = 'xxx' AND qRecID = 'x' ORDER BY periodYear, periodMonth";
  7. Yes, I've done that by grabbing the first month and the last month and creating a monthArray using range. $monthArray = range($firstMonth, $lastMonth). This gives me all the month from May through January (for this example). I haven't been able to match the measure value with the right month, because once I create the array for the entire range, the indexes shift because of the added months that aren't on the database. Thanks
  8. The data looks like the first example. Month Year Measure 5 2010 164 6 2010 31 7 2010 20 8 2010 10 9 2010 10 10 2010 10 12 2010 10 1 2011 10 I don't need to show ALL months for the year, but I need to show from first month collected to the last month collected including months that data wasn't collected. In other words, let's say data was collected from May 2010 to Sept 2011, but Oct, Nov and December 2010 were skipped. In this case I need to show from May 2010 through Sept. 2011 including Oct, Nov and Dec (months when data wasn't collected. Need to display label -month/year- on chart but no value). Think as if you were looking at a chart. It would be hard to notice one month missing if we don't show the label (month/year) for the missing month. In my data above, you can see that I'm missing month 11. So, what I need is a way to insert month 11 and year 2010(for this example) with no measure. Thanks.
  9. I've spent many hours trying to solve this with no success. So, here's my challenge. Sample Data from DB: Month Year Measure 5 2010 164 6 2010 31 7 2010 20 8 2010 10 9 2010 10 10 2010 10 12 2010 10 1 2011 10 I need to display this data in a chart, but notice that I don't have data for month 11 and the chart must show all months with data and the month that I don't have data for (11 in this case) will show an interrupted line. I need to put this into an array to display month/year as label and measure as chart value. So, the above data needs to become: Month Year Measure 5 2010 164 6 2010 31 7 2010 20 8 2010 10 9 2010 10 10 2010 10 11 2010 -- 12 2010 10 1 2011 10 The issue here isn't the chart, but how to add the missing month (11) to the array and keep the measures corresponding with their months. Thank you.
  10. I'm using the tablesorter plugin with no problem to this point. The tables have been laid out with a 'view details colum: Example ---------------------------------------------------------- Name | Date | Action ---------------------------------------------------------- some name | 05/22/2010 | View details somename | 05/05/2010 | View details ... ..... ..... Where on the action column View details is a link, and not sortable. So, we're redesigning these pages to add more info. To accomplish that we're making the name a link to the details, thus replacing the Action column with more important data. Once I make the name column clickable, tablesorter stops working. Well, it works, but doesn't sort by the name column when clicking on it like it does if the name isn't a link. Any ideas? Thank you.
  11. Thank you for your help. I found another solution
  12. I tried to follow your suggestion of the <noscript> tag and added this: <script language="javascript"> function createCookie(name,value,days) { if(days){ var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); }else{ var expires = ""; }//end if/else document.cookie = name+"="+value+expires+"; path=/"; }//end function createCookie('isReady', 'y', 1); </script> <noscript> <?php $_SESSION['javascriptReady'] = false; ?> </noscript> No success...
  13. Hi all, here's my problem. I need to check if javascript is enabled during a user visit. So, I'm trying to set a cookie using javascript then I try to read it using PHP. If cookie exists I'm setting a session variable that will be passed across the aplication. Keep in mind that I need to do all of this on the same page. I even tried to set the cookie (through javascript) on a different page and use a php header redirect but the php receiving page doesn't read the cookie. Here's the code: <script language="javascript"> function createCookie(name,value,days) { if(days){ var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); }else{ var expires = ""; }//end if/else document.cookie = name+"="+value+expires+"; path=/"; }//end function createCookie('isReady', 'y', 1); </script> PHP CODE: if(strlen($_COOKIE['isReady'])){ $_SESSION['javascriptReady'] = true; }//end if It only works when I refresh the page. Thanks for any help.
  14. I've actually solved the problem by creating 2 CASE statements in the query to figure out event type and if a date is in the future or not. Thank you for all your help. Greatly appreciated.
×
×
  • 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.