home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / cabal / test.php~ < prev   
Text File  |  2009-07-12  |  1KB  |  71 lines

  1. <?php
  2. // if you want to do more or less than three months, change that here
  3.  
  4. $nummonths = 3;
  5.  
  6. require("cottonbale.inc");
  7.  
  8. require("dbstart.inc");
  9.  
  10. require("header.inc");
  11.  
  12. // make the dates for the months of the events
  13.  
  14. for ($i=0; $i< ($nummonths + 1); $i++)
  15. {
  16.     $t = mktime(0,0,0,date("m")+$i,1,  date("Y"));
  17.     
  18.     $months[$i] = date("M", $t);
  19.     $years[$i] = date("Y", $t);
  20.     $dates[$i] = date("Y-m-d", $t);
  21. }
  22.  
  23. // now put in the html for the tables
  24.  
  25. for ($i=0; $i<$nummonths; $i++)
  26. {
  27.     require("monthhead.inc");
  28.     
  29.     $j = $i + 1;
  30.     
  31.     $query  = "select edate, starttime, endtime, ecity, ename, ";
  32.     $query .= "description from events where edate >= '$dates[$i]' ";
  33.         $query .= "and edate <= '$dates[$j]' ";
  34.         $query .= "and gname = 'cabal' order by edate, starttime";
  35.     
  36.     $res = mysql_query($query);
  37.  
  38.     while(list($edate, $start, $end, $city, $name, $descrip)=mysql_fetch_row($res))
  39.     {
  40.  
  41.         echo "<tr><td";
  42.         
  43.         echo $start == 0 ? "><em>" : " class=\"str\">";
  44.         
  45.         echo dateExpand($edate);
  46.  
  47.         echo $start == 0 ? "</em></td><td" : "</td><td";
  48.         
  49.         if ($start == 0)
  50.         {
  51.             echo "><center>-</center>";
  52.         }
  53.         else
  54.         {
  55.             echo " class=\"str\">";
  56.             echo timeExpand($start, true);
  57.             echo "-";
  58.             echo timeExpand($end, true);
  59.             echo "";
  60.         }
  61.         echo "</td><td>$city</td><td>$descrip</td></tr>\n";
  62.         
  63.     }
  64.     
  65.     echo "</table>\n\n\n";
  66. }
  67.  
  68. require("footer.inc");
  69.  
  70. ?>
  71.